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 |
---|---|---|---|---|---|---|
/ Tirer de la pioche. Returns the drawn card. TODO: check there are cards to draw from. | function drawCard($userId) {
$options = getUnusedCards(getGameOf($userId));
if (count($options) == 0) {
return false;
}
$index = array_rand($options);
$card = $options[$index];
$to_draw = SQLGetChamp("select cards_to_draw from users where id = $userId");
SQLInsert("insert into decks (user_id, card_name) values ($userId, '$card')");
if ($to_draw-- > 0) {
SQLUpdate("update users set cards_to_draw = $to_draw where id = $userId");
// We had been forced to draw by a +2 or +4
if ($to_draw == 0) {
$gameId = getGameOf($userId);
$next = nextToPlay($gameId);
SQLUpdate("update games set user_to_play = $next");
}
}
return $card;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function drawCard(int $cardId): Card;",
"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 }",
"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 drawACard(&$deck) {\n\t$randomKey = array_rand($deck);\n\t$randomCard = $deck[$randomKey];\n\tunset($deck[$randomKey]);\n\treturn $randomCard;\n}",
"public function getCard() {\n return $this->card;\n }",
"public function getCard()\n {\n return $this->card;\n }",
"public function card()\n {\n if ( ! $this->bean->card) $this->bean->card = R::dispense('card');\n return $this->bean->card;\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 }",
"public function get_card(){ return $this->_card;}",
"public function card();",
"public function getCard()\n {\n return $this->vaultHelper->getQuoteCard($this->getSubscription()->getQuote());\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 it_can_draw_card_from_deck()\n {\n $this->beConstructedWith(['Test'], $this->cardFactory);\n\n $this->count()->shouldBe(1);\n $this->draw()->shouldBeAnInstanceOf(TestCard::class);\n $this->count()->shouldBe(0);\n }",
"public function getDraw()\n {\n return $this->draw;\n }",
"public function getCardholder()\n {\n return $this->cardholder;\n }",
"public function get_background_card(){ return $this->_background_card;}",
"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}",
"public function getCard(): ?string\n {\n return $this->card;\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 }",
"public function getIdCard()\n {\n return $this->id_card;\n }",
"public function getCard(): ?bool\n {\n return $this->card;\n }",
"public function getCards();",
"public function getDrawNumber();",
"function createCard($account_id) {\n // final product looks like this: https://www.w3schools.com/w3css/tryit.asp?filename=tryw3css_cards_buttons2\n\n $con = Connection::connect();\n $stmt = $con->prepare(\"select * from Account where account_ID = ? and active = 0\");\n $stmt->bindValue(1, $account_id, PDO::PARAM_INT);\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n if ($row != null) {\n return \"\";\n }\n\n $image = \"data:image/jpeg;base64, /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABQQEBkSGScXFycyJh8mMi4mJiYmLj41NTU1NT5EQUFBQUFBRERERERERERERERERERERERERERERERERERERET/2wBDARUZGSAcICYYGCY2JiAmNkQ2Kys2REREQjVCRERERERERERERERERERERERERERERERERERERERERERERERERET/wAARCAJYAlgDACIAAREBAhEB/8QAGgABAQEBAQEBAAAAAAAAAAAAAAEEAwIFBv/EACcQAQACAgEDBAIDAQEAAAAAAAABAgMRMQQSITJBUWETcSJCkVKB/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAH/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMAAAERAhEAPwD9UAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAgqAAAAAAAgoD0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAACAAAAAAAAgAAD2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAACAKgAAAAAiiAAAAA9gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAgCoAAAAAAIAAAAAAD2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAgAAAAAAICoAAAAAIKA9gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkzEcgo426isceXKeptPEaBrGGc1593ibTPMg+huITuj5fPAfR3Eq+asWmOJB9EYYzXj3e46m0cxsGsca9RWefDrExPAKAAAAAAgAAAAAAAIAAAAAAACKAgGwAACQBA5AdAAAAAAAAAAAAAAAAAAAAAAAAAAASZ15kFeLXrTmXHJ1HtT/WeZmfMg7X6mZ9Phxm028z5QUAAAAAAAAAAFi018x4QBop1Mx6vLvW9b8SwLEzHmEH0Rmx9R7X/ANaImJ8wCoqAAAAAAAIqAAAAAAAIKCAAAAIqAAAAA6AAAAAAAAAAAAAAAAAAAAAAAAA55csY4+wW+SKRuWPJkm/PHw82tNp3KKAAAAAAAAAAAAAAAAAAD3jyzTjj4eAG+mSLxuHp8+tprO4bMWWMkfaDoAAAACAAAAAAAAgAAAAIoAIqAAACAOoAAAAAAAAAAAAAAAAAAAAAAPN7RSNyDzkyRjj7YpmbTuVvebzuXlQAAAAAAAAAAAAAAAAAAAAAAWJms7jlAG7HkjJH29vn0vNJ3DdW0XjcIPSKgAAAAAAAIAAAAAioAAAAAigAgDqAAAAAAAAAAAAAAAAAAAAAAxZsnfOo4h3z5O2NRzLGAAoAAAAAAAAAAAAAAAAAAAAAACKCOuHJ2TqeJcgH0RxwZO6NTzDsgAAAAAAgAAAAAIKgAAAACKgAAOoAAAAAAAAAAAAAAAAAAACcK49Rftrr5BmyX77TLwCgAAAAAAAAAAAAAAAAAAAAAAioAAAAD3jv2WiW7l85s6e3dXXwg6gAAAIABsAEUBBUAAAABBUAABBQHUAAAAAAAAAAAAAAAAAAABiz27rfpsmdRt8+Z3OwQBQAAAAAAAAAAAAAAAAAAAAAAQAAAAAHXBbtt+3IideYB9ESJ3G/kQUEBUAARQQAAAAAEFAQABFAQAHYAAAAAAAAAAAAAAAAAAAHLPOqSxNXVT4iGUABQAAAAAAAAAAAAAAAAAABABUAAAAAAAABswTukOrP00+JhoQQAAEBQQFQAAAAQAABABdiAAAOwAAAAAAAAAAAAAAAAAAAMvVT5iGd36n1R+nBQAAAAAAAAAAAAAAAAAABAVAAAAAAAAAAEAaOm5lpZem9U/pqQAAAAEAAAAEAAAAASVQAAD9gA7AAAAAAAAAAAAAAAAAAAAydT6o/Tg0dTzDOoAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAIADv03qn9NTN03MtKAAAgAAAAgKgAAAJKpMgB5ABCQUQB3AAAAAAAAAAAAAAAAAAABn6qPESytvURun6YgAFAAAAAAAAAAAAAABAAAAAAAAAAAAQAAAaemjxMtDlgjVHVAQADYAAAgAAAAIAAAioAAAADuAAAAAAAAAAAAAAAAAAADzaO6Jj5fPfSYc9e28/fkHMBQAAAAAAAAAAAABAAAAAAAAAAARQBAAAdMNe68fXkGysdsRCiIKgAAAgAB+wABAA2AAAIAAHsAIA0AAAAAAAAAAAAAAAAAAAAOHU03Xu+HdJjcakHzh6vXtmYl5UAAAAAAAAAAAQFQAAAAAAAAAEFBAAAAGrp6ajfyzVr3TEQ3xGo1AACAAAgAqAAACAAAAioAAAIoCAA0AAAAAAAAAAAAAAAAAAAAAAz9Rj3HdHsyvosWXH2T9ewOYCgAAAAAAAAgAAAAAAAAAAgAqAAAA94qd869vcHbp6ajun3dzgQAAEVAAAEUBAAAABOQACQBFBAAQUBoAAAAAAAAAAAAAAAAAAAAAAeMlIvGpewHzrVms6lG3Ni743HLFMa8SoAAAAAgKIAAAAAAAAAAAgAAAAERsFiJtOobcdIpGnnFi7I3PLogqAAAAgAAACAAAIbVAAAAQFQABAFEAaQAAAAAAAAAAAAAAAAAAAAAAAHHNh7/McuyA+dMa8SNuTFF/2x2pNJ1KiAAAgAAAAAAAAAIAAAAAD1Ws3nUA8xG/DXixdnmeXrFiin3Py9oKgAAAgEgAAIAAHACAC/SAAIAoIAciAogAADSAAAAAAAAAAAAAAAAAAAAAAACAAJasWjUqAyZME1818w4voud8Nb/UgwjrfBavHmHNRAAAAAAAABAAAAdaYLW58Q0UxVp+wcMeCbeZ8Q01rFY1D0iABsAAENAAAACAqAAACAAAAIABIgKCAEgCCgNIAAAAAAAAAAAAAAAAAAAAACAAAAAAAA8Wx1tzD0A4W6aP6y5WwXj222APnzWY5hH0UmtZ5iAfPG78VfiD8VPgGEbvxUj2WK1jiIBgiszxG3SuC8/X7bAGevTR/aXatK14h6AQVAAAAAAQFSQAJABDYAAAkAAAAgAAASigIABIb90AABqAAAAAAAAAAAAAAAAAAAARUABJmI8yCjhfqYj0+We2S1+ZBrtlrXmXK3U/8AMf6zCjr+e+97dadTH9mUB9CtotxKvnxOvMOlc9o+0GwcK9THvGnSMtJ9wexInfCgAgAAAkzp4nLWPcHQZ7dTEcQ52z3n6BqtaK8zpxv1Mf1hmmd8ijp+e+97e69T/wBQzgNtctbe/l0fOe65LV4nwg2jhTqIn1eHaJieAUDkBCDYAAAgAAAAAIAiooIACoACAAH2A1AAAAAAAAAAAAAAAAAAAgBM6eMmWKc8/DJfLa/PHwDvk6iI8V8s1rTadyiKKioAAAAAAAAAsXtHEy8qD1+W/wAr+a/y5gPf5b/KTe0+8vIAAAAAioAAACAPVbTXzEomwasfURPiztt897plmnHANo8UyRfjn4e0AEAAARUAAARUAiQAAQAAANIAADWAAAAAAAAAAAAAAAACAOOXP2+K8vObN/Wv+swEzvzICgCAAAAAAAAAAAIAAAAAAACKAgAAAAgAAAABvU7hqxZu7xbllQH0BnxZv62/1oQA5QF0nKoBIACAAAAkqgCKbAQIAABrAAAAAAAAAAAAAAAAZs+b+tf/AF6z5e3+McsgACgioAAAAAAAAAgoCAAAAAAAACAAAAAAgAAAAAAIAA0Yc39bf+M4D6COOHL3fxnl2QDYAciALKCAogAAAgAAABADWAAAAAAAAAAAAAA8ZL9kbemLLk77b9vYHiZmZ3KAoAAgAAAAAAAAACKgAAAAAAAIAAAAACAAAAAAgKioAAAABE6nw2Uv312xvWO/bP17g2ofYgAAIqASAASgAAAQICgA1gAAAAAAAAAAAAkzryDj1F9R2xzLI9Xt32mXlQBAVAAAAAAAAAAAAQAAAAAAQFQAAAAQBUAAAAAEVAAAAAASQAAacF9x2/DsxUt2zts3uNwCiCAABIIAAACAoiggANgAAAAAAAAAAIA49RfVdfLsxZrd1p+vAOYCgioAAAAAAAAAAAIAAAAAAAIAAAAIAAAAAAAIAAAAAAgAAAAI1YLbjU+zK6Yrdtv2DYgIAIAAAACKgCoAAANgAAAAAAAAIAADze3bWZYGrqbaiI+WUBBVEAAAAAAAAEAUQAAAAAAARUAAAABFEAAAAABAVAAAAABAAAARUAAAbaW7oiXpx6e3jXw6oAAAigSioAqKCAAAA2AAAAAAAAgAAAMfUTu2vhyesk7tM/bwoAAAAAAAAAAAgAAAAAACKgAAAAAgAAAAAbEBUAAAAABAAAAQUBAAAB1wT/L9tLHSdWiWwAOBADaAKIAqAAAAANgAAAAACKgAACTOo2rxkn+M/oGFAUAAAAAAAAAQAAAAAABFQAAAABBQQAAAAABFQAAAEBUVANAAAAIqAAACADdHnyxNmP0x+gegEEUNgipsAAAAn4AAUbAEAABAAAAAAeMvol7eMvokGABQAAAAAAEAAAAAAAAQAAAAAJQAAAAAEBUAAAAABFQAAAEAAAAABAAAGzFP8IY2zH6YB7AQQAA+gAIDYIoigEgNoCACAAAAAAAOeX0S6OeX0SDCAoAAAAAAIAAAAAAACAAAASIAKgAAAAAAIAAACKIAAAACKgAAAACAAAANmP0wxtmP0wD2hyIHAICgASCKKIAAINoIAAAAAAAAA55fRL28ZfRIMICgAACAqAAAAAAigCAAAACACoAAAAAIAqAAAAigIAAAAioCoAAACAAAAAA2YvTDG2Y/TAPRIIAAACiSqScAAIAQA2AAAAAAAAIADxl9Evbxl9EgwgKAICoqAAAAAAAIAAAAACAAAAAAAAgAAAIoAgAAAAgLKAAAAIAAAAAAgDZj9MMbbi9MfoHpUEABQAAEP0gCoC+wQA1gAAAAAgAAADxm9EgDCAoAAgAAAAACAAAAAAACAAAAAAIAAAAACAAAAAAgAAAAAgAAACAAACteP0wAPYCAnIKAALsBBDQAv2Ao/9k=\";\n\n $user = User::fromID($account_id);\n $location = $user->formatCityAndState();\n if ($location == \"\") {\n $location = getApproximateLocation($account_id);\n }\n //$imageSrc = file_get_contents(\"http://corsair.cs.iupui.edu:22891/courseproject/image.php?account_id=\" . $account_id);\n //$imageSrc = \"http://corsair.cs.iupui.edu:22891/courseproject/image.php?account_id=\" . $account_id;\n\n return '<div class=\"w3-container\" style=\"display: inline-block; text-align: center; order: ' . $account_id . ';\">\n <div class=\"w3-card-4 w3-margin-bottom\">\n <header class=\"w3-container w3-pale-red\">\n <h3>'.$user->formatName().'</h3>\n </header>\n <div class=\"w3-container w3-text-grey w3-white\">\n <div class=\"w3-row-padding\">\n <div class=\"w3-third\">\n <div class = \"w3-padding-16\" style=\"position: relative; top: 50%;\">\n <img id=\"' . $account_id . '\" class=\"w3-circle w3-border\" src=\"' . $image . '\" style=\"width: 100%;\" alt=\"Avatar\">\n </div>\n <p style=\"margin:0.25em;\">' . getUserMentorshipPreference($account_id) . \" / \" . $user->formatGender() . '</p>\n </div>\n <div class=\"w3-twothird w3-small\" style=\"text-align: left;\">' . formatDegreesAndJobs(getDegrees($account_id), getJobs($account_id)) . '</div>\n </div>\n <hr>\n <p>' . $location . '</p>\n </div>\n <a class=\"w3-button w3-block w3-dark-grey\" href=\"profile.php?user=' . $account_id . '\">+ View Profile</a>\n </div></div>';\n}",
"public function actionPaymentcard()\n\t{ \n\t\t\n\t\tif( isset($_SESSION['invoice_id']) )\n\t\t{\n\t\t\t$invoiceModel = new Invoices;\n\t\t\t$payment\t\t= $invoiceModel->getInvoicePayment( $_SESSION['invoice_id'] );\n\t\t\t# Add 2% of the total in the invoice total for creditcard only\n\t\t\t$twoPercentAmount = ($payment[0]['payment_amount'] * 2)/100;\n\t\t\t$payment[0]['payment_amount'] += round($twoPercentAmount, 2);\n\t\t\t$this->render(\"cardForm\", array(\"payment\"=>$payment));\n \t\t}\n\t\t\n\t}",
"public function getDeck()\n {\n return $this->deck;\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 }",
"public function inCard()\n {\n return $this->inCard;\n }",
"public function inCard()\n {\n return $this->inCard;\n }",
"function display_graphic($piece)\n{\n}",
"public function getCardHand() {\n\t\treturn $this->cardHand;\n\t}",
"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 executeDraw($player_id, $age_min = null, $location_to = 'hand', $bottom_to=false) { // Execute a draw. If $age_min is null, draw in the deck according to the board of the player, else, draw a card of the specified value or more, according to the rules\n $age_to_draw = self::getAgeToDrawIn($player_id, $age_min);\n \n if ($age_to_draw > 10) {\n // Attempt to draw a card above 10 : end of the game by score\n self::setGameStateValue('game_end_type', 1);\n self::setGameStateInitialValue('player_who_could_not_draw', $player_id);\n self::trace('EOG bubbled from self::executeDraw (age > 10');\n throw new EndOfGame();\n }\n \n $card = self::getDeckTopCard($age_to_draw);\n try {\n $card = self::transferCardFromTo($card, $player_id, $location_to, $bottom_to, $location_to == 'score');\n }\n catch (EndOfGame $e) {\n self::trace('EOG bubbled from self::executeDraw');\n throw $e; // Re-throw exception to higher level\n }\n return $card;\n }",
"public function getCard(): Model\\CardSetting\n {\n return $this->card;\n }",
"public function getCidCard()\n {\n return $this->cid_card;\n }",
"public function revealTopCard(): int;",
"function chooseCard () {\n\tglobal $sql;\n\t$response = array();\n\t$gameid = @$_COOKIE['gameid']?:\"\";\n\t$card = @$_GET['card']?:\"\";\n\t$offdef = @$_GET['offdef']?:\"\";\n\t\n\t$Query = $sql->prepare(\"UPDATE `fliip_games` SET `fg_\".$offdef.\"` = ? WHERE `fg_id` = ?\".\n\t\t\t\t\t\t\t/* control to only set Offense card if Defense is not yet set, and as a contrary only set Defense if Offense is already set */\n\t\t\t\t\t\t\t\" AND \".($offdef==\"offense\"?\"`fg_defense` is NULL\":\"`fg_offense` is not NULL\"));\n\t$Query->bind_param(\"si\",$card,$gameid);\n\t$Query->execute();\n\tif ($Query->affected_rows > 0) {\n\t\t$response['status']=\"OK\";\n\t\t$response['html']=\"Card \".$card.\" recorded successfully for \".$offdef.\". (gameid=\".$gameid.\")\";\n\t} else {\n\t\t$response['status']=\"ERROR\";\n\t\t$response['html']=\"Card \".$card.\" not valid, gameid \".$gameid.\" (empty if no cookie) not found, side \".$offdef.\" error or try to change offense after defense choice or SQL error.\";\n\t}\n\treturn (@$_GET['format']==\"json\")?json_encode($response):$response['html'];\n}",
"public function needCard() {\n return FALSE;\n }",
"public function getCardAt($offset)\n {\n return $this->get(self::CARD, $offset);\n }",
"public function googleCard()\n\t{\n\t\t// if we're using caching\n\t\tif ($this->cache_data > 0)\n\t\t{\n\t\t\t$html = $this->ghettoCache();\n\t\t\treturn $html;\n\t\t}\n\t\t// don't cache, use a transient instead\n\t\telse\n\t\t{\n\t\t\t// see if our data is in the db\n\t\t\tif (false === ($data = get_transient('googlecards')))\n\t\t\t{\n\t\t\t\t// if data is not in the db, fetch the data and store\n\t\t\t\t$data = $this->handleLoad();\n\t\t\t\tset_transient('googlecards', $data, 60*60*$this->cache_hours);\n\t\t\t}\n\n\t\t\t// return the data for both cases\n\t\t\treturn $data;\n\t\t}\n\t}",
"public function printCard($card)\n {\n $card->printHtml();\n }",
"public function draw() {}",
"public function draw() {}",
"public function card(CardInterface $card)\n\t{\n\t\treturn $this->respond(self::RESPONSE_TYPE_CARD, $card->toArray());\n\t}",
"function displayCard($cards) {\n \n echo \"<img src= '../challenges2/img-2/cards/clubs/$cards.png' />\";\n }",
"function debug_draw($card_id) {\n if (self::getGameStateValue('debug_mode') == 0) {\n return; // Not in debug mode\n }\n $player_id = self::getCurrentPlayerId();\n $card = self::getCardInfo($card_id);\n $card['debug_draw'] = true;\n if ($card['location'] == 'deck') {\n self::transferCardFromTo($card, $player_id, 'hand');\n }\n else if ($card['location'] == 'achievements') {\n throw new BgaUserException(self::_(\"This card is used as an achievement\"));\n }\n else if ($card['location'] == 'removed') {\n throw new BgaUserException(self::_(\"This card is removed from the game\"));\n }\n else {\n throw new BgaUserException(self::format(self::_(\"This card is in {player_name}'s {location}\"), array('player_name' => self::getPlayerNameFromId($card['owner']), 'location' => $card['location'])));\n }\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 }",
"public function getDrawReward()\n {\n return $this->get(self::_DRAW_REWARD);\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 get_dealedcardnr() {\n return $this->dealed_cards;\n }",
"public function draw()\n {\n return;\n }",
"public function askForCard()\n {\n }",
"public function addCard()\n {\n }",
"function getPoints() :int{\n switch ($this->getNumber()){\n case 5: return 5; // queen of spades\n case 28: return 2; // jacks of clubs\n case 8:\n case 9:\n case 10:\n case 11:\n case 12:\n case 13:\n case 14:\n case 15:\n return 1; // all hearts\n default: return 0; // rest of cards\n }\n }",
"public function dealCardToDealer();",
"public function getIidCard()\n {\n return $this->iid_card;\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 }",
"public function getCardType()\n\t{\n\t\treturn 0;\n\t}",
"public function getCardcode()\n {\n return $this->cardcode;\n }",
"function fyxt_getCharCardData ( $charID ) {\n\tif ( !empty( $charID ) ){\n\t\tglobal $wpdb;\n\t\t$charCardInfoSQL = \"\n\t\tSelect\n\t\t fyxt_character_cards.*\n\t\tFrom\n\t\t fyxt_character_cards\n\t\tWhere\n\t\t fyxt_character_cards.fyxt_cc_charID = $charID\"; \n\t\t$charCardInfoResults = $wpdb->get_row( $charCardInfoSQL );\n\t\treturn $charCardInfoResults;\n\t} else {\n\t\treturn;\n\t}\n}",
"abstract public function getCard(int $card_id): ?array;",
"function cardIsAce($card) {\n\tif ($card == 'Ace') {\n\t\treturn true;\n\t} \n\t\treturn false;\n}",
"public function getCardAux() {\n\t\treturn $this->cardAux;\n\t}",
"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 draw();",
"public function ec_account_display_credit_card_images( ){\n\t\tif( get_option('ec_option_use_visa') || get_option('ec_option_use_delta') || get_option('ec_option_use_uke') ){\n\t\t\t\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/ec_cart_payment_information/visa.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/visa.png\") . \"\\\" alt=\\\"Visa\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_visa\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/visa_inactive.png\") . \"\\\" alt=\\\"Visa\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_visa_inactive\\\" />\";\n\t\t\t\n\t\t\telse if( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/images/visa.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/visa.png\") . \"\\\" alt=\\\"Visa\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_visa\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/visa_inactive.png\") . \"\\\" alt=\\\"Visa\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_visa_inactive\\\" />\";\n\t\t\t\n\t\t\telse\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/visa.png\") . \"\\\" alt=\\\"Visa\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_visa\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/visa_inactive.png\") . \"\\\" alt=\\\"Visa\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_visa_inactive\\\" />\";\n\t\t\n\t\t}// Visa Card\n\t\t\n\t\tif( get_option('ec_option_use_discover') ){\n\t\t\t\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/ec_cart_payment_information/discover.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/discover.png\") . \"\\\" alt=\\\"Discover\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_discover\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/discover_inactive.png\") . \"\\\" alt=\\\"Discover\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_discover_inactive\\\" />\";\n\t\t\t\n\t\t\telse if( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/images/discover.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/discover.png\") . \"\\\" alt=\\\"Discover\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_discover\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/discover_inactive.png\") . \"\\\" alt=\\\"Discover\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_discover_inactive\\\" />\";\n\t\t\t\n\t\t\telse\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/discover.png\") . \"\\\" alt=\\\"Discover\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_discover\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/discover_inactive.png\") . \"\\\" alt=\\\"Discover\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_discover_inactive\\\" />\";\n\t\t\n\t\t}// Discover\n\t\t\n\t\tif( get_option('ec_option_use_mastercard') || get_option('ec_option_use_mcdebit') ){\n\t\t\t\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/ec_cart_payment_information/mastercard.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/mastercard.png\") . \"\\\" alt=\\\"Mastercard\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_mastercard\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/mastercard_inactive.png\") . \"\\\" alt=\\\"Mastercard\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_mastercard_inactive\\\" />\";\n\t\t\t\n\t\t\telse if( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/images/mastercard.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/mastercard.png\") . \"\\\" alt=\\\"Mastercard\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_mastercard\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/mastercard_inactive.png\") . \"\\\" alt=\\\"Mastercard\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_mastercard_inactive\\\" />\";\n\t\t\t\n\t\t\telse\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/mastercard.png\") . \"\\\" alt=\\\"Mastercard\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_mastercard\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/mastercard_inactive.png\") . \"\\\" alt=\\\"Mastercard\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_mastercard_inactive\\\" />\";\n\t\t\n\t\t}// Mastercard\n\t\t\n\t\tif( get_option('ec_option_use_amex') ){\n\t\t\t\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/ec_cart_payment_information/american_express.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/american_express.png\") . \"\\\" alt=\\\"American Express\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_amex\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/american_express_inactive.png\") . \"\\\" alt=\\\"American Express\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_amex_inactive\\\" />\";\n\t\t\t\n\t\t\telse if( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/images/american_express.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/american_express.png\") . \"\\\" alt=\\\"American Express\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_amex\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/american_express_inactive.png\") . \"\\\" alt=\\\"American Express\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_amex_inactive\\\" />\";\n\t\t\t\n\t\t\telse\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/american_express.png\") . \"\\\" alt=\\\"American Express\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_amex\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/american_express_inactive.png\") . \"\\\" alt=\\\"American Express\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_amex_inactive\\\" />\";\n\t\t\n\t\t}// American Express\n\t\t\n\t\tif( get_option('ec_option_use_jcb') ){\n\t\t\t\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/ec_cart_payment_information/jcb.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/jcb.png\") . \"\\\" alt=\\\"JCB\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_jcb\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/jcb_inactive.png\") . \"\\\" alt=\\\"JCB\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_jcb_inactive\\\" />\";\n\t\t\t\n\t\t\telse if( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/images/jcb.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/jcb.png\") . \"\\\" alt=\\\"JCB\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_jcb\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/jcb_inactive.png\") . \"\\\" alt=\\\"JCB\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_jcb_inactive\\\" />\";\n\t\t\t\n\t\t\telse\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/jcb.png\") . \"\\\" alt=\\\"JCB\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_jcb\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/jcb_inactive.png\") . \"\\\" alt=\\\"JCB\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_jcb_inactive\\\" />\";\n\t\t\n\t\t}// JCB\n\t\t\n\t\tif( get_option('ec_option_use_diners') ){\n\t\t\t\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/ec_cart_payment_information/diners.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/diners.png\") . \"\\\" alt=\\\"Diners\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_diners\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/diners_inactive.png\") . \"\\\" alt=\\\"Diners\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_diners_inactive\\\" />\";\n\t\t\t\n\t\t\telse if( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/images/diners.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/diners.png\") . \"\\\" alt=\\\"Diners\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_diners\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/diners_inactive.png\") . \"\\\" alt=\\\"Diners\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_diners_inactive\\\" />\";\n\t\t\t\n\t\t\telse\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/diners.png\") . \"\\\" alt=\\\"Diners\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_diners\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/diners_inactive.png\") . \"\\\" alt=\\\"Diners\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_diners_inactive\\\" />\";\n\t\t\n\t\t}// Diners\n\t\t\n\t\tif( get_option('ec_option_use_maestro') || get_option('ec_option_use_laser') ){\n\t\t\t\n\t\t\tif( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/ec_cart_payment_information/maestro.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/maestro.png\") . \"\\\" alt=\\\"Maestro\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_maestro\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/ec_cart_payment_information/maestro_inactive.png\") . \"\\\" alt=\\\"Maestro\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_maestro_inactive\\\" />\";\n\t\t\t\n\t\t\telse if( file_exists( WP_PLUGIN_DIR . '/wp-easycart-data/design/theme/' . get_option( 'ec_option_base_theme' ) . '/images/maestro.png' ) )\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/maestro.png\") . \"\\\" alt=\\\"Maestro\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_maestro\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart-data/design/theme/\" . get_option( 'ec_option_base_theme' ) . \"/images/maestro_inactive.png\") . \"\\\" alt=\\\"Maestro\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_maestro_inactive\\\" />\";\n\t\t\t\n\t\t\telse\n\t\t\t\techo \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/maestro.png\") . \"\\\" alt=\\\"Maestro\\\" class=\\\"ec_cart_payment_information_credit_card_active\\\" id=\\\"ec_cart_payment_credit_card_icon_maestro\\\" />\" . \"<img src=\\\"\" . plugins_url( \"wp-easycart/design/theme/\" . get_option( 'ec_option_latest_theme' ) . \"/images/maestro_inactive.png\") . \"\\\" alt=\\\"Maestro\\\" class=\\\"ec_cart_payment_information_credit_card_inactive\\\" id=\\\"ec_cart_payment_credit_card_icon_maestro_inactive\\\" />\";\n\t\t\n\t\t}// Maestro\n\t\t\n\t}",
"function cardColor($card) {\n\tif (($index = strpos($card, \"-\")) !== false) {\n\t\treturn substr($card, 0, $index);\n\t}\n\n\treturn null;\n}",
"public function get_burnedcards() {\n return count($this->burned_cards);\n }",
"public function getIdCardImg()\n {\n return $this->id_card_img;\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 getNameCard()\n {\n return $this->get(self::_NAME_CARD);\n }",
"public function getCards()\n {\n return [\n 'WHITE' => self::WHITE_CARDS,\n 'BLACK' => self::BLACK_CARDS,\n ];\n }",
"function CardInfo(){\r\n }",
"function gameCard($pdo, $jeu, $option){\n $plateforms = recupPlatForGame($pdo, $jeu);\n if ($option == 1){\n $class = \"offset-s1 offset-m1 offset-l1 offset-xl1\";\n }\n else{\n $class = \"\";\n }\n ?>\n\n <div class=\"col s4 m4 l3 xl2 <?php $class ?>\" >\n <form action=\"../page/detaille_jeux.php\" method=\"post\">\n\n<button type=\"submit\" name=\"id\" value='<?php echo $jeu['id']?>' style=\"background-color:rgba(0,0,0,0); border: none\">\n\n <div class=\"card\"\n style= \"height: 260px ; width: 195px;\n border-radius: 15px;\n <?php if ($jeu['PEGI'] == 18):?>\n background: rgb(255,97,97);\n background: linear-gradient(180deg, rgba(255, 91 , 91,1) 0%, rgba(181,0,0,1) 100%);\n <?php elseif ($jeu['PEGI'] == 16):?>\n background: rgb(97,207,255);\n background: linear-gradient(0deg, rgba(68, 169 ,255,1) 0%, rgba(67 ,101 ,255,1) 100%);\n <?php elseif($jeu['PEGI'] == 12):?>\n background: rgb(97,207,255);\n background: linear-gradient(180deg, rgba(68, 169 ,255,1) 0%, rgba(73,76,255,1) 100%);\n <?php elseif($jeu['PEGI'] == 7):?>\n background: rgb(255,153,238);\n background: linear-gradient(180deg, rgba(164,84,255,1) 0%, rgba(219,91,255,1) 100%);\n <?php elseif($jeu['PEGI'] == 3):?>\n background: rgb(255,153,238);\n background: linear-gradient(180deg, rgba(219,91,255,1) 0%, rgba(164,84,255,1) 100%);\n <?php endif;?>\n \">\n\n <div class=\"card-image\">\n\n <div style=\"display:flex;align-items:center;justify-content:center\">\n <?php foreach($plateforms as $plateform): ?>\n <img src=\"../../../<?php echo $plateform['icon'] ?>\"\n style= \"height:30px; width:32px;\n margin-bottom: 5px ;margin-top: 5px;margin-right:5px;\n \">\n <?php endforeach; ?>\n </div>\n\n <div style= \"background-size: cover;\n width: 90%; height: 180px;\n margin:0 auto;margin-bottom:3px;\n background-image:url(../../../assets/imgJeu/<?php echo $jeu['image']?>);\n border-radius: 15px;\n \">\n </div>\n\n <div style=\"text-align:center\">\n <h2 style=\"font-size: 15px;\n color : white;\n margin:0 auto;\n font-weight:bold;\n margin-top:5px;\n margin-right:5px;\n margin-left:5px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n \">\n <?php echo $jeu['title']?>\n </h2>\n <p style = \"font-size: 12px;\n color : white;\n margin:0 auto;\n \">\n <?php echo $jeu['prix']?> €\n </p>\n\n </form>\n </div>\n\n\n\n\n</div>\n</div>\n</a>\n</div>\n</button>\n<?php }",
"public function getScorecard()\n {\n return $this->readOneof(3);\n }",
"public function draw($value = null)\n {\n return $value ? ['draw' => (int) $value] : 'draw';\n }",
"public function getCard(): bool {\n $result = $this->mysqli->query(\"SELECT * FROM cards WHERE id='{$this->id}'\");\n if($result->num_rows == 1) { # Card exists in database\n $card = $result->fetch_assoc();\n $this->cardNum = $card['card_num'];\n $this->name = $card['name'];\n $this->billingAddress = $card['billing_address'];\n $this->exp = $card['exp'];\n $this->securityCode = $card['security_code'];\n return true;\n } else { # Card doesn't exist yet\n return false;\n }\n }",
"protected function burn_card() {\n $this->burned_cards[] = array_pop($this->deck);\n return $this;\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 }",
"function card_get(){\n\t\tif ($this->get('idspbu') == NULL){\n\t\t\t$this->response(array( 'status' => \"ID SPBU not found\" ), 408);\n\t\t} else {\n\t\t\t$param['id_spbu'] = $this->get('idspbu');\n\t\t\t$param['id_pelanggan'] = $this->get('idpelanggan');\n\t\t\t$param['id_card'] = $this->get('idcard');\n\t\t\t$param['nik'] = $this->get('nik');\n\t\t\t\n\t\t\t$response = $this->rest_model->getCard($this->get('idspbu'), $param);\n\t\t\tif(!empty($response)){\n\t\t\t\t$this->response($response, 200);\n\t\t\t} else {\n\t\t\t\t$this->response(array( 'status' => \"NULL\" ), 406);\n\t\t\t}\n\t\t}\n\t}",
"public function draw()\n {\n if (null === $this->draw) {\n $this->draw = new Draw\\Imagick($this);\n }\n if (null === $this->draw->getImage()) {\n $this->draw->setImage($this);\n }\n return $this->draw;\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 }",
"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}",
"function displayCards() {\n global $deck;\n foreach ($deck as $card){\n $value = $card['value'];\n $suit = $card['suit'];\n }\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 }",
"abstract public function playCard(int $card_id);",
"public static function getCardById($id)\n {\n\t\t$key = 'CardById_' . $id;\n\t\t$cache = Hapyfish_Cache_Memcached::getInstance();\n\t\t$card = $cache->get($key);\n\t\tif ($card === false) {\n\t\t\t//load from database\n\t\t\t$db = Hapyfish_Island_Dal_Card::getDefaultInstance();\n\t\t\t$card = $db->getCardById($id);\n\t\t\tif ($card) {\n\t\t\t\t$cache->add($key, $card, Hapyfish_Cache_Memcached::LIFE_TIME_ONE_MONTH);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $card;\n }",
"function draw() {\n }",
"public function getCardCount()\n {\n return $this->count(self::CARD);\n }",
"public function show(Card $card)\n {\n //\n }",
"public function show(Card $card)\n {\n //\n }",
"public function show(Card $card)\n {\n //\n }",
"public function show(Card $card)\n {\n //\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 }",
"public function getDefaultCard(): ?string\n {\n return $this->defaultCard;\n }",
"public function card()\n {\n return $this->belongsTo(Card::class);\n }",
"public function card()\n {\n return $this->belongsTo(Card::class);\n }",
"public function card()\n {\n return $this->belongsTo(Card::class);\n }"
] | [
"0.73021245",
"0.7212572",
"0.68607736",
"0.6795838",
"0.6688588",
"0.66626126",
"0.65951407",
"0.65161854",
"0.6349048",
"0.6337755",
"0.62691665",
"0.62661743",
"0.620163",
"0.6134332",
"0.61262697",
"0.59650844",
"0.5953658",
"0.5836524",
"0.5834895",
"0.5786683",
"0.5778954",
"0.5769311",
"0.57599425",
"0.56811064",
"0.5621654",
"0.558263",
"0.5580252",
"0.5580252",
"0.5580252",
"0.55799025",
"0.55799025",
"0.556319",
"0.5558401",
"0.5553695",
"0.5553161",
"0.55444264",
"0.5518457",
"0.5465492",
"0.5449281",
"0.5447224",
"0.54382277",
"0.5423792",
"0.541371",
"0.54098237",
"0.54098237",
"0.540665",
"0.54055965",
"0.5405253",
"0.5399512",
"0.53843975",
"0.5369835",
"0.53577006",
"0.53537995",
"0.52996624",
"0.5293854",
"0.5291861",
"0.5272547",
"0.5269923",
"0.5258438",
"0.5242748",
"0.5242658",
"0.5231929",
"0.5221158",
"0.52171594",
"0.52045286",
"0.5195561",
"0.5191701",
"0.51877934",
"0.5169728",
"0.51666427",
"0.5162861",
"0.5162656",
"0.5162004",
"0.51585877",
"0.5157338",
"0.51543194",
"0.5143827",
"0.51384246",
"0.5132516",
"0.51317215",
"0.5128911",
"0.51238024",
"0.51207924",
"0.51202947",
"0.5116118",
"0.51122224",
"0.5110707",
"0.5109427",
"0.51079226",
"0.51052207",
"0.51049125",
"0.5093738",
"0.5093738",
"0.5093738",
"0.5093738",
"0.50887877",
"0.50828797",
"0.5082795",
"0.5082795",
"0.5082795"
] | 0.6515488 | 8 |
/ Returns whether the player has really won or not. | function screamUno($userId) {
if (count(getDeck($userId)) == 1) {
SQLUpdate("update users set uno = 1 where id = $userId");
return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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 }",
"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 gameWon()\n {\n return $this->countStones() === 1;\n }",
"function isOver()\n\t{\n\t\tif ($this->won)\n\t\t\treturn true;\n\t\t\t\n\t\tif ($this->over)\n\t\t\treturn true;\n\t\t\n\t\treturn false;\n\t}",
"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 hasGameFinished()\n {\n return $this->hasWon;\n }",
"public function gameOver() : bool\n {\n return $this->cpu->totalScore() >= 100 || $this->player->totalScore() >= 100;\n }",
"public function getWinner(){\n $this->game->UpdateStatus();\n if ($this->game->getWinner()!=$this->game->get_current_turn()){\n return false;\n }else{\n return true;\n }\n }",
"public function isUserWinner() {\n if($this->winnerType == \"player\" && $this->winnerID == CD()->id) {\n return true;\n }\n return false;\n }",
"public function testCheckWinner()\n {\n $gamestate = $this->game->getGamestate();\n $this->game->holdHand();\n $this->assertNull($gamestate[\"hasWon\"]);\n\n $gamestate[\"active\"]->addPoints(100);\n $exp = $gamestate[\"active\"];\n $this->game->holdHand();\n\n $gamestate = $this->game->getGamestate();\n $this->assertEquals($exp, $gamestate[\"hasWon\"]);\n }",
"public function isPlayer()\r\n\t{\r\n\t\t\treturn count($this->getPlayerProfiles()) > 0;\r\n\t}",
"public function checkWin() {\n\n $data = $this->getDeathRecord();\n $data = array_map(function($d) {\n return $d[key($d)];\n }, $data);\n\n if ($data) {\n if (in_array(\"FARMER\", $data)) {\n return FALSE;\n }\n if (in_array(\"COW_1\", $data) && in_array(\"COW_2\", $data)) {\n return FALSE;\n }\n if (in_array(\"BUNNY_1\", $data) && in_array(\"BUNNY_2\", $data) && in_array(\"BUNNY_4\", $data) && in_array(\"BUNNY_4\", $data)) {\n return FALSE;\n }\n }\n return true;\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 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 playing(): bool\n {\n\n return $this->state !== SELF::STATE_GAMEOVER;\n }",
"public function getWon(): ?bool\n {\n return $this->won;\n }",
"protected function winnerExists()\n\t{\n\t\treturn ($this->winner instanceof Blackbox_IWinner);\n\t}",
"public function getWon()\n {\n return $this->won;\n }",
"public function isplayer()\n\t{\n\t\treturn $this->Players->isplayer($this->SqueezePlyrID);\n\t}",
"function isReady($player) {\n\t// check if the player exists and has a username in the gamestate\n\treturn isset(readPlayerData($player)['username']);\n}",
"public function isWinner() {\n\t\t$winner = null;\n\t\t$rule = $this->getRule(); // note: rule is required for matches\n\t\tif($rule->rule_type == Rule::TYPE_MATCHPLAY) {\n\t\t\t// Get opponent scorecard\n\t\t\tif($opponent = $this->getOpponent()) {\n\t\t\t\tif($opponent_scorecard = $opponent->getScorecard()) {\n\t\t\t\t\t$this_total = $this->points_total($rule->handicap);\n\t\t\t\t\t$opponent_total = $opponent_scorecard->points_total($rule->handicap);\n\t\t\t\t\t//Yii::trace('tie:'.$this->tie_break.'vs.'.$opponent_scorecard->tie_break, 'Scorecard::isWinner');\n\t\t\t\t\t$winner = ($this_total > $opponent_total) ?\n\t\t\t\t\t\t\t\ttrue :\n\t\t\t\t\t\t\t\t($opponent_total > $this_total ?\n\t\t\t\t\t\t\t\t\tfalse :\n\t\t\t\t\t\t\t\t\t($this->tie_break > $opponent_scorecard->tie_break ?\n\t\t\t\t\t\t\t\t\t\ttrue :\n\t\t\t\t\t\t\t\t\t\t($this->tie_break < $opponent_scorecard->tie_break ?\n\t\t\t\t\t\t\t\t\t\t\tfalse :\n\t\t\t\t\t\t\t\t\t\t\tnull)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//Yii::trace('return:'.($winner ? 't' : 'f'), 'Scorecard::isWinner');\n\t\treturn $winner;\n\t}",
"public function isThereAWinner()\n {\n return $this->getWinningShip() !== null;\n }",
"public function isInGame() {\n return $this->onlineState == 'in-game';\n }",
"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 }",
"function checkWinner($shot){\r\n\t\t\tforeach ( $this->ships as $shipNumber => $ship ) {\r\n\t\t\t\tif( !$ship->isShipSunk() ){\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}",
"public function isFinished()\n {\n return $this->isWinner('X') || $this->isWinner('O') || $this->isDraw();\n }",
"public function isGameOver(): bool\n {\n return $this->getGameState() === SELF::STATE_GAMEOVER;\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 getWins()\n {\n return $this->wins;\n }",
"abstract protected function isGameOver();",
"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 checkForWinState() {\n $squares = $this->buildSquaresArray();\n foreach($this->winConditions as $strike => $cond) {\n if($this->conditionMet($cond, $squares)) {\n $this->winner = $squares[$cond[0]];\n $this->strike = $strike;\n $this->save();\n }\n }\n\n //check for Draw\n if($this->isDraw($squares)) {\n $this->winner = 'd';\n $this->save();\n }\n }",
"function isLost(){\n\tglobal $userid;\n\tif(!isConnected() && !isVisitor()) return true;\n\n\treturn false;\n}",
"public function canpoweroff()\n\t{\n\t\treturn $this->Players->canpoweroff($this->SqueezePlyrID);\n\t}",
"public function isOnline() {\n return ($this->onlineState == 'online') || ($this->onlineState == 'in-game');\n }",
"public function isEatenUp()\n {\n return $this->eaten >= 100;\n }",
"public function isUserPlayer()\n\t{\n\t\treturn (Bn::getValue('user_type') == 'P');\n\t}",
"public function isDraw()\n {\n return !$this->hasAvailableMoves() &&\n !$this->isWinner('X') &&\n !$this->isWinner('O');\n }",
"public function hasIsInBattle()\n {\n return $this->IsInBattle !== null;\n }",
"abstract protected function winnerExists();",
"public function battleFinished()\n {\n return ($this->_army1->isDefeated() or $this->_army2->isDefeated());\n }",
"public function isWinner($character) {\n if(is_numeric($character)) {\n $characterID = $character;\n } else {\n $characterID = $character->id;\n }\n if($this->winnerID == $characterID &&\n $this->winnerType == \"player\") {\n \n return true;\n } else {\n return false;\n }\n }",
"public function isAlive()\n {\n return $this->health > 0;\n }",
"public function hasW()\n {\n return isset($this->w);\n }",
"public function hasW()\n {\n return isset($this->w);\n }",
"public function isWinner(string $playerUnit)\n {\n return $this->winByRow($playerUnit) !== false ||\n $this->winByColumn($playerUnit) !== false ||\n $this->winByDiagonal($playerUnit) !== false;\n }",
"protected function checkEquipped()\r\n\t{\r\n\t\t$check = $this->db->getone(\"select count(*) as `count` from `player_items` where `type`=? and `player`=? and `equipped`=1\", array($this->item['type'], $this->item['player']));\r\n\t\t\r\n\t\tif ($check == 0)\r\n\t\t{\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}\r\n\t}",
"public function hasActivePokemon()\n {\n return $this->ActivePokemon !== null;\n }",
"public function isOnline()\n\t {\t\tdate_default_timezone_set('Pacific/Auckland');\n\t\t\t$to_time = strtotime(date('Y-m-d H:i:s'));\n\t\t\t$from_time = strtotime($this->last_online);\n\t\t\tif( round(abs($to_time - $from_time) / 60,2) < 10){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t }",
"private function check_players(){\n\t\tforeach($this->clients as $cli){\n\t\t\tif(null!==$cli){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public function winRound() {\n\n\t\t$this->points++;\n\n\t\t$this->output($this->name.' has won this round');\n\t}",
"public function hasNumPaused()\n {\n return $this->num_paused !== null;\n }",
"public function isOngoing() {\n return ($this->hasStarted() && !$this->isFinished());\n }",
"public function isPlaying()\n {\n return \\doing_action($this->tag);\n }",
"public function isOnline() {\n\t\tif ($this->lastActivityTime && $this->lastActivityTime > (TIME_NOW - USER_ONLINE_TIMEOUT) && (WCF::getUser()->userID == $this->userID || !$this->invisible || WCF::getUser()->getPermission('admin.general.canViewInvisible') || ($this->invisible == 2 && UserProfile::isBuddy($this->userID)))) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function testCheckNoWinner()\n {\n $this->_board[0][8] = \"O\";\n $this->_board[0][1] = \"O\";\n $this->_board[0][6] = \"X\";\n $this->_board[1][5] = \"X\";\n $this->_board[1][7] = \"X\";\n $this->_board[2][9] = \"O\";\n $this->_board[2][2] = \"O\";\n\n $playerOneAnswers = [];\n $playerTwoAnswers = [];\n foreach ($this->_board as $boardIndex => $boardRow) {\n foreach ($boardRow as $boardRowIndex => $boardRowValue) {\n if ($boardRowValue == \"X\") {\n $this->_scorePlayerOne += $boardRowIndex;\n $playerOneAnswers[] = $boardRowIndex;\n }\n if ($boardRowValue == \"O\") {\n $this->_scorePlayerTwo += $boardRowIndex;\n $playerTwoAnswers[] = $boardRowIndex;\n }\n }\n }\n\n $whoHasWon = 0;\n if ($this->_scorePlayerOne == 15) {\n $whoHasWon = 1;\n }\n\n if ($this->_scorePlayerTwo == 15) {\n $whoHasWon = 2;\n }\n\n if ($whoHasWon == 0) {\n foreach ($this->_winningConditions as $winningCondition) {\n\n $playerOneMatchResult = array_intersect(\n $playerOneAnswers, $winningCondition\n );\n if (count($playerOneMatchResult) ==3) {\n $whoHasWon = 1;\n }\n\n $playerTwoMatchResult = array_intersect(\n $playerTwoAnswers, $winningCondition\n );\n if (count($playerTwoMatchResult) ==3) {\n $whoHasWon = 2;\n }\n }\n }\n\n $this->assertNotEquals(1, $whoHasWon);\n $this->assertNotEquals(2, $whoHasWon);\n }",
"public function is_game_live()\n {\n return $this->status === 'live' ? true : false;\n }",
"public function totalPlayerWins()\n {\n $qb = $this->createQueryBuilder('r')\n ->select('COUNT(r)')\n ->where('r.win = true')\n ;\n\n return $qb->getQuery()->getSingleScalarResult();\n }",
"function is_twitch_online() {\n\t$twitch_stream = get_url_contents(\"https://api.twitch.tv/kraken/streams?channel=\" . get_theme_mod('twitch_profile') . \"\");\n\t$result = json_decode($twitch_stream, true);\n\tif ( $result['streams'] != null ) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}",
"public function hasHandstatus(){\n return $this->_has(7);\n }",
"public function canContinue()\n {\n return $this->number_of_rounds >= $this->getRoundsCount();\n }",
"public function hasAttackTimerS()\n {\n return $this->attack_timer_s !== null;\n }",
"public function hasIceAttack(){\r\n return $this->_has(13);\r\n }",
"public function play()\n {\n $this->spin();\n foreach ($this->bets as $bet_type => $wager)\n {\n if (method_exists(Game, $bet_type))\n {\n if ($payoff = $this->$bet_type())\n {\n $this->win = true;\n $money_won = ($wager * $payoff);\n $this->increment_money_won($money_won);\n $this->increment_money($money_won);\n }\n else\n {\n $this->increment_money_lost($wager);\n $this->decrement_money($wager);\n }\n }\n }\n return $this->win;\n }",
"private function checkWhoWon($att_lose, $deff_lose)\n {\n if ($att_lose && !$deff_lose)\n {\n $this->attackers->battleResult = BATTLE_LOSE;\n $this->defenders->battleResult = BATTLE_WIN;\n }\n elseif (!$att_lose && $deff_lose)\n {\n $this->attackers->battleResult = BATTLE_WIN;\n $this->defenders->battleResult = BATTLE_LOSE;\n }\n else\n {\n $this->attackers->battleResult = BATTLE_DRAW;\n $this->defenders->battleResult = BATTLE_DRAW;\n }\n }",
"function hasWon($winningspots, $spots, $size) {\n\t\tforeach($winningspots as $winspot) {\n\t\t\t$countX = 0;\n\t\t\t$countO = 0;\n\t\t\tforeach($winspot as $ws) {\n\t\t\t\tif($spots[$ws] == \"x\") {\n\t\t\t\t\t$countX++;\n\t\t\t\t} elseif($spots[$ws] == \"o\") {\n\t\t\t\t\t$countO++;\n\t\t\t\t}\n\t\t\t\tif ($countX > 0 && $countO > 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t} else if ($countX == $size || $countO == $size) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public function isOnline()\n {\n return Cache::has('user-is-online-' . $this->id);\n }",
"public function isOnline()\n {\n return Cache::has('user-is-online-' . $this->id);\n }",
"public function isWormhole() : bool {\n return ($this->scope === 'wh');\n }",
"public function hasServerGameTime()\n {\n return $this->server_game_time !== null;\n }",
"public function isAlive()\n {\n return $this->personState['alive'];\n }",
"public function hasScore() {\n\t\treturn $this->thru > 0;\n\t}",
"function hasHonors()\n {\n return ($this->gpa > 3) ? \"true\" : \"false\";\n }",
"public function getStillWanted() {\n $wanted = Event::fireReturn($this->getEventID(), $this->type, $this->filter, 'ping');\n if ($wanted || count($wanted)) {\n return true;\n }\n return false;\n }",
"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 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}",
"function isOnline() \n\t{\n\t\treturn ($this->status == self::STATUS_ONLINE) ? true : false;\n\t}",
"public function isAlive()\n {\n return !$this->isDead();\n }",
"public function hasAttackProbability()\n {\n return $this->attack_probability !== null;\n }",
"protected function winCheck($userMove){\r\n // Check if we have reached the minimum steps to have a win\r\n if($this->totalMoves < Board::COLUMNS){\r\n return false;\r\n }\r\n //check vertical Horizontal Positive Diagonal Negative Diagona win\r\n if(($this->checkVerticalWin($userMove)) \r\n || ($this->checkHorizontalWin($userMove))\r\n || ($this->checkPositiveDiagonalWin($userMove))\r\n || ($this->checkNegativeDiagonalWin($userMove))\r\n ){\r\n //winning message \r\n winningMsg($this->currentPlayer);\r\n $this->gameOver = true;\r\n return;\r\n }\r\n }",
"public function isOnline(): bool\n {\n return Cache::has('user-is-online-' . $this->id);\n }",
"public function hasGuardPokemonLevel()\n {\n return $this->GuardPokemonLevel !== null;\n }",
"private function isConected(){\n\t\treturn $this->m_IsConnected;\n\t}",
"public function isHot(): bool\n {\n return time() - $this->lastActivity() < 5 * 60;\n }",
"abstract public function hasAvailableMoves(): bool;",
"public function hasFighting(){\r\n return $this->_has(22);\r\n }",
"public function isAlive(): bool;",
"public function hasIceAttack(){\r\n return $this->_has(16);\r\n }",
"public function chargingHasStarted()\n {\n $chargingPower = $this -> getChargingPower();\n $kiloWattHourLine = $this -> kiloWattHourLine;\n\n return $chargingPower > $kiloWattHourLine;\n }",
"public function hasScore() \n {\n return count($this->score) > 0;\n }",
"private function isOnline()\n {\n return $this->online;\n }",
"function IsReady()\r\n\t{\r\n\t\treturn $this->IsConnected();\r\n\t}",
"public function isOnline(): bool\n {\n return $this->pluck('presences.0.onlineStatus') === 'online';\n }",
"public function isOnline(): bool\n {\n return $this->pluck('presences.0.onlineStatus') === 'online';\n }",
"public function isAlive();",
"public function isAlive();",
"public function isSkillsAvailable()\n {\n return $this->getXml()->getElementsByTagName('PlayerSkills')->item(0)->childNodes->length > 1;\n }",
"public static function isWinner(BingoCaller $caller, Card $card)\n {\n $cardNumber = $card->getNumbersInCard();\n\n foreach ($cardNumber as $cardNumber) {\n if (is_null($cardNumber)) // skip free value\n continue;\n\n if (!$caller->hasCalledNumber($cardNumber)) {\n return false;\n }\n }\n\n return true;\n }",
"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 hasUserConnected() {\n $accessToken = get_option(self::ACCESS_TOKEN_OPTION_NAME);\n\n return !empty($accessToken);\n }",
"public function hasLobby()\n {\n return $this->lobbies()->exists();\n }"
] | [
"0.85423005",
"0.8413764",
"0.7634838",
"0.756626",
"0.75569654",
"0.7500653",
"0.7442703",
"0.74108243",
"0.7317596",
"0.6951828",
"0.69191384",
"0.6883003",
"0.6874566",
"0.67927724",
"0.67880744",
"0.67042583",
"0.6697415",
"0.66900074",
"0.66669",
"0.66468066",
"0.6623643",
"0.6603052",
"0.6595223",
"0.6557173",
"0.6515658",
"0.649518",
"0.64891523",
"0.64677674",
"0.63588685",
"0.6335863",
"0.62874544",
"0.6285245",
"0.62685066",
"0.6237076",
"0.622117",
"0.6203027",
"0.6167424",
"0.61499625",
"0.6141196",
"0.6083145",
"0.6055708",
"0.60451084",
"0.5988487",
"0.5968058",
"0.5968058",
"0.5960785",
"0.5929695",
"0.59064686",
"0.5902568",
"0.5901434",
"0.5860297",
"0.5813042",
"0.57768655",
"0.5775125",
"0.57614416",
"0.57566935",
"0.57564116",
"0.5754717",
"0.5747431",
"0.5747406",
"0.5746384",
"0.5732186",
"0.5728871",
"0.57227105",
"0.5721851",
"0.5711305",
"0.56979907",
"0.56979907",
"0.56804425",
"0.56755954",
"0.5658702",
"0.56522715",
"0.56470823",
"0.5636512",
"0.563322",
"0.562393",
"0.5622859",
"0.5622772",
"0.5614619",
"0.5613729",
"0.5607484",
"0.56010455",
"0.55968887",
"0.55933",
"0.5588156",
"0.5587691",
"0.55749243",
"0.5564172",
"0.5560814",
"0.55583715",
"0.55570126",
"0.55489457",
"0.5542075",
"0.5542075",
"0.5537416",
"0.5537416",
"0.5534284",
"0.5532389",
"0.5530321",
"0.552855",
"0.5525027"
] | 0.0 | -1 |
/ Not right now, but like, later. Takes skips cards into account. | function nextToPlay($gameId, $direction = null) {
$sql = "select user_to_play, direction from games where id = $gameId";
$info = parcoursRs(SQLSelect($sql))[0];
$placed = getPlacedCards($gameId);
if ($direction !== null) {
$info["direction"] = $direction;
}
$direction = $info["direction"] == 1 ? 1 : -1;
$to_play = $info["user_to_play"];
$players = getPlayers($gameId);
$index = array_search($to_play, $players) + $direction;
$mod = count($players);
return $players[(abs($index * $mod) + $index) % $mod];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wpcom_vip_disable_likes() {\n\tadd_filter( 'wpl_is_likes_visible', '__return_false', 999 );\n}",
"public function unlike() {\r\n return $this->setLike(false);\r\n }",
"function userDisliked($post_id)\n{\n global $conn;\n global $user_id;\n $sql = \"SELECT * FROM vote_info WHERE user_id=$user_id \n \t\t AND idea_id=$post_id AND vote_action='dislike'\";\n $result = mysqli_query($conn, $sql);\n if (mysqli_num_rows($result) > 0) {\n \treturn true;\n }else{\n \treturn false;\n }\n}",
"public function CambiarLikeDislike()\n\t{\n\t\t$this->que_bda = \"UPDATE like_comentario SET\n\t\t\t\t\t\t\t\t\t\t\t\ttip_lik_vid = 'D'\n\t\t\t\t\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\t\t\t\t\tcod_lik_vid = '$this->cod_lik_vid';\";\n\t\t// echo json_encode($this->que_bda);\n\t\treturn $this->run();\n\t}",
"function wpcom_vip_enable_likes() {\n\tadd_filter( 'wpl_is_likes_visible', '__return_true', 999 );\n}",
"function wpcom_vip_disable_hovercards() {\n _deprecated_function( __FUNCTION__, '2.0.0' );\n}",
"public function verificarDislike()\n\t{\n\t\t$this->que_bda = \"SELECT * FROM like_comentario WHERE \n\t\t\t\t\t\t\t\t\t\t\t\tfky_usu_onl = '$this->fky_usu_onl' AND \n\t\t\t\t\t\t\t\t\t\t\t\tfky_com_vid = '$this->fky_com_vid' AND \n\t\t\t\t\t\t\t\t\t\t\t\ttip_lik_vid = 'D';\";\n\t\t// echo json_encode($this->que_bda);\n\t\treturn $this->run();\n\t}",
"public function unlike()\n {\n self::delete(\"photos/{$this->id}/like\");\n return true;\n }",
"public function CambiarDislikeLike()\n\t{\n\t\t$this->que_bda = \"UPDATE like_comentario SET\n\t\t\t\t\t\t\t\t\t\t\t\ttip_lik_vid = 'L'\n\t\t\t\t\t\t\t\t\t\t\tWHERE \n\t\t\t\t\t\t\t\t\t\t\t\tcod_lik_vid = '$this->cod_lik_vid';\";\n\t\t// echo json_encode($this->que_bda);\n\t\treturn $this->run();\n\t}",
"function userDisliked($post_id)\n{\n usersOnly();\n global $conn;\n $user_id=$_SESSION['id'];\n $sql = \"SELECT * FROM rating WHERE user_id=$user_id\n \t\t AND post_id=$post_id AND rating=0\";\n $result = mysqli_query($conn, $sql);\n if (mysqli_num_rows($result) > 0) {\n \treturn true;\n }else{\n \treturn false;\n }\n}",
"public function needCard() {\n return FALSE;\n }",
"public function unlike() {\n\n $review = Input::get('review');\n\n if (!$review == \"\") {\n\n DB::table('review_likes')\n ->where('review_id', $review)\n ->where('user_id', Auth::user()->id)\n ->delete();\n }\n }",
"function userDisliked($comment_id)\n {\n global $conn;\n global $user_id;\n $sql = \"SELECT * FROM rating_info WHERE user_id=$user_id \n AND comment_id=$comment_id AND rating_action='dislike'\";\n $result = mysqli_query($conn, $sql);\n if (mysqli_num_rows($result) > 0) {\n return true;\n }else{\n return false;\n }\n }",
"function alreadydislike($likeid,$cid,$uid,$disORmov){\n\t$response = array();\n\t$data = array(\n\t 'liked'=>'1',\n\t 'disliked'=>'0',\n\t 'DorM'=>$disORmov\n\t);\n\n\t$this->db->where('id',$likeid);\n\t$this->db->update('likedb',$data);\n\n\t//change dislike# and like# in \n//\t$sqlScript = 'UPDATE discuss SET dislike = dislike - 1,like = like +1\n//\t where id = \"'.$cid.'\"';\n//\t$this->db->query($sqlScript);\n\n\t$this->db->select('like,dislike');\n\tif($disORmov == 1){\n\t $isDisLikeObj = $this->db->get_where('discuss',array('id'=>$cid));\n\t}else{\n\t $isDisLikeObj = $this->db->get_where('movement_comment',array('id'=>$cid));\n\t}\n\t $isDisLikeResult = $isDisLikeObj->result();\n\t $isDisLike = $isDisLikeResult[0]->dislike;\n\t $isLike = $isDisLikeResult[0]->like;\n\n\t $isDisLike = $isDisLike-1;\n\t $isLike = $isLike+1;\n\n\t $likeUpdate = array(\n\t\t'like'=>$isLike,\n\t \t'dislike'=>$isDisLike\n\t );\n\n\t $this->db->where('id',$cid);\n\t if($disORmov == 1){\n\t $this->db->update('discuss',$likeUpdate);\n\t }else{\n\t $this->db->update('movement_comment',$likeUpdate);\n\t }\n\t $response['state'] = \"disliketolike\";\n\t $response['likeUpdated'] = $isLike;\n\t $response['dislikeUpdated'] = $isDisLike;\n\n\t return $response;\n }",
"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 AlreadyLiked( $post_id ) { // test if user liked before\n\tif ( is_user_logged_in() ) { // user is logged in\n\t\t$user_id = get_current_user_id(); // current user\n\t\t$meta_USERS = get_post_meta( $post_id, \"_user_liked\" ); // user ids from post meta\n\t\t$liked_USERS = \"\"; // set up array variable\n\t\t\n\t\tif ( count( $meta_USERS ) != 0 ) { // meta exists, set up values\n\t\t\t$liked_USERS = $meta_USERS[0];\n\t\t}\n\t\t\n\t\tif( !is_array( $liked_USERS ) ) // make array just in case\n\t\t\t$liked_USERS = array();\n\t\t\t\n\t\tif ( in_array( $user_id, $liked_USERS ) ) { // True if User ID in array\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t\t\n\t} else { // user is anonymous, use IP address for voting\n\t\n\t\t$meta_IPS = get_post_meta( $post_id, \"_user_IP\" ); // get previously voted IP address\n\t\t$ip = $_SERVER[\"REMOTE_ADDR\"]; // Retrieve current user IP\n\t\t$liked_IPS = \"\"; // set up array variable\n\t\t\n\t\tif ( count( $meta_IPS ) != 0 ) { // meta exists, set up values\n\t\t\t$liked_IPS = $meta_IPS[0];\n\t\t}\n\t\t\n\t\tif ( !is_array( $liked_IPS ) ) // make array just in case\n\t\t\t$liked_IPS = array();\n\t\t\n\t\tif ( in_array( $ip, $liked_IPS ) ) { // True is IP in array\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\t\n}",
"public function dislike() {\n if (isset($_POST) && !empty($_POST) && isset($_POST['dislike']) && !empty($_POST['dislike'])) {\n if (isset($_POST['token']) && $this->_model->compareTokens($_POST['token'])) {\n if (!$this->_model->dislike(explode(\"/\", $this->_url)[1])) {\n echo \"error\";\n }\n }\n }\n }",
"function alreadylike($dislikeid,$cid,$uid,$disORmov){\n\t$response = array();\n\t$data = array(\n\t 'liked'=>'0',\n\t 'disliked'=>'1',\n\t 'DorM'=>$disORmov\n\t);\n\n\t$this->db->where('id',$dislikeid);\n\t$this->db->update('likedb',$data);\n\n\t//change like# and dislike# in \n//\t$sqlScript = 'UPDATE discuss SET dislike = dislike + 1,like = like - 1\n//\t where id = \"'.$cid.'\"';\n//\t$this->db->query($sqlScript);\n\n\t$this->db->select('like,dislike');\n\tif($disORmov == 1){\n\t $isDisLikeObj = $this->db->get_where('discuss',array('id'=>$cid));\n\t}else{\n\t $isDisLikeObj = $this->db->get_where('movement_comment',array('id'=>$cid));\n\t}\n\t $isDisLikeResult = $isDisLikeObj->result();\n\t $isDisLike = $isDisLikeResult[0]->dislike;\n\t $isLike = $isDisLikeResult[0]->like;\n\n\t $isDisLike = $isDisLike+1;\n\t $isLike = $isLike-1;\n\n\t $likeUpdate = array(\n\t\t'like'=>$isLike,\n\t \t'dislike'=>$isDisLike\n\t );\n\n\t $this->db->where('id',$cid);\n\t if($disORmov == 1){\n\t $this->db->update('discuss',$likeUpdate);\n\t }else{\n\t $this->db->update('movement_comment',$likeUpdate);\n\t }\n\t $response['state'] = \"liketodislike\";\n\t $response['dislikeUpdated'] = $isDisLike;\n\t $response['likeUpdated'] = $isLike;\n\n\t return $response;\n }",
"public function unlike(\\Tuiter\\Models\\User $user,\\Tuiter\\Models\\Post $post):bool{\n $unLike=new \\Tuiter\\Models\\Like($post->getPostId(),$user->getUserId());\n if(!($this->likeExist($unLike))){\n return false;\n }\n $delete=$this->collection->deleteOne(array(\n 'likeId'=>$unLike->getLikeId()\n ));\n return true;\n }",
"public function agregarDislike()\n\t{\n\t\t$this->que_bda = \"INSERT INTO like_comentario \n\t\t(tip_lik_vid, fky_usu_onl, fky_com_vid)\n\t\tVALUES \n\t\t('D', '$this->fky_usu_onl','$this->fky_com_vid');\";\n\t\t// echo json_encode($this->que_bda);\n\t\treturn $this->run();\n\t}",
"public function disliked()\n {\n\t\t$user = $this->uri->segment(2, 0);;\n }",
"function wyz_bus_like_ajax() {\n\t$nonce = filter_input( INPUT_POST, 'nonce' );\n\n\tif ( ! wp_verify_nonce( $nonce, 'wyz_ajax_custom_nonce' ) ) {\n\t\twp_die( 'busted' );\n\t}\n\n\t$_post_id = intval( $_POST['post-id'] );\n\t$_act = $_POST['act'];\n\t$_user_id = get_current_user_id();\n\t\n\tif ( ! $_post_id || ! $_user_id || ! $_act || 0 === $_post_id || '' === $_user_id ) {\n\t\twp_die( false );\n\t}\n\n\t$_likes = get_post_meta( $_post_id, 'wyz_business_post_likes', true );\n\n\tif ( empty( $_likes ) ) {\n\t\t$_likes = array();\n\t}\n\t$likes_count = intval( get_post_meta( $_post_id, 'wyz_business_post_likes_count', true ) );\n\tif ( ! $likes_count ) {\n\t\t$likes_count = 0;\n\t}\n\tif ( $_act == 'like' ) {\n\t\tforeach ( $_likes as $like ) {\n\t\t\tif ( $like == $_user_id ) {\n\t\t\t\twp_die( -1 );\n\t\t\t}\n\t\t}\n\t\tarray_push( $_likes, $_user_id );\t\n\t\t$likes_count++;\n\t\t\n\t} elseif ( $_act == 'dislike' ) {\n\t\t$liked = false;\n\t\tforeach ( $_likes as $like ) {\n\t\t\tif ( $like == $_user_id ) {\n\t\t\t\t$liked = true;\n\t\t\t}\n\t\t}\n\t\tif ( ! $liked )\n\t\t\twp_die(-1);\n\t\t$_likes = array_diff( $_likes, [ $_user_id ] );\n\t\t$likes_count--;\n\t}\n\tupdate_post_meta( $_post_id, 'wyz_business_post_likes', $_likes );\n\tupdate_post_meta( $_post_id, 'wyz_business_post_likes_count', $likes_count );\n\n\twp_die( $likes_count );\n}",
"function Skip() {\n }",
"public function canSkipOrderReviewStep()\n {\n return !$this->_quote->getPayment()->getAdditionalInformation(self::PAYMENT_INFO_BUTTON);\n }",
"function the_champ_facebook_like_rec_enabled(){\r\n\tglobal $theChampCounterOptions, $theChampSharingOptions;\r\n\tif((the_champ_social_counter_enabled() && ((the_champ_horizontal_counter_enabled() && isset($theChampCounterOptions['horizontal_providers']) && ( in_array('facebook_share', $theChampCounterOptions['horizontal_providers']) || in_array('facebook_like', $theChampCounterOptions['horizontal_providers']) || in_array('facebook_recommend', $theChampCounterOptions['horizontal_providers']))) || (the_champ_vertical_counter_enabled() && isset($theChampCounterOptions['vertical_providers']) && ( in_array('facebook_share', $theChampCounterOptions['vertical_providers']) || in_array('facebook_like', $theChampCounterOptions['vertical_providers']) || in_array('facebook_recommend', $theChampCounterOptions['vertical_providers']))))) || (the_champ_social_sharing_enabled() && ((the_champ_horizontal_sharing_enabled() && isset($theChampSharingOptions['horizontal_re_providers']) && ( in_array('facebook_share', $theChampSharingOptions['horizontal_re_providers']) || in_array('facebook_like', $theChampSharingOptions['horizontal_re_providers']) || in_array('facebook_recommend', $theChampSharingOptions['horizontal_re_providers']))) || (the_champ_vertical_sharing_enabled() && isset($theChampSharingOptions['vertical_re_providers']) && ( in_array('facebook_share', $theChampSharingOptions['vertical_re_providers']) || in_array('facebook_like', $theChampSharingOptions['vertical_re_providers']) || in_array('facebook_recommend', $theChampSharingOptions['vertical_re_providers'])))))){\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}",
"public function like() {\n if (isset($_POST) && !empty($_POST) && isset($_POST['like']) && !empty($_POST['like'])) {\n if (isset($_POST['token']) && $this->_model->compareTokens($_POST['token'])) {\n if (!$this->_model->like(explode(\"/\", $this->_url)[1])) {\n echo \"error\";\n }\n }\n }\n }",
"public function likeCheck(Request $request)\n {\n $userID = auth()->user()->id;\n $likedCar = DB::select('SELECT id FROM carsLiked WHERE cars_id = '.$request->input('carID').' AND users_id = '.$userID.'');\n\n if (count($likedCar) == 0){\n // Means that the car has not been liked before\n return \"Car Not Liked\";\n }else{\n return \"Car Liked\";\n }\n }",
"function sw_add_twitter_card($info) {\n\t\t\t\tif(is_singular()):\n\t\t\t\t\t// Check if Twitter Cards are Activated\n\t\t\t\t\tif($info['sw_user_options']['sw_twitter_card']):\n\t\t\t\t\t\n\t\t\t\t\t\t/*****************************************************************\n\t\t\t\t\t\t* *\n\t\t\t\t\t\t* YOAST SEO: It rocks, so let's coordinate with it\t *\n\t\t\t\t\t\t* *\n\t\t\t\t\t\t******************************************************************/\n\t\t\t\t\t\n\t\t\t\t\t\t// Check if Yoast Exists so we can coordinate output with their plugin accordingly\n\t\t\t\t\t\tif (defined('WPSEO_VERSION')):\n\n\t\t\t\t\t\t\t// Collect their Social Descriptions as backups if they're not defined in ours\n\t\t\t\t\t\t\t$yoast_twitter_title \t\t= get_post_meta( $info['postID'] , '_yoast_wpseo_twitter-title' , true );\n\t\t\t\t\t\t\t$yoast_twitter_description \t= get_post_meta( $info['postID'] , '_yoast_wpseo_twitter-description' , true );\n\t\t\t\t\t\t\t$yoast_twitter_image \t\t= get_post_meta( $info['postID'] , '_yoast_wpseo_twitter-image' , true );\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Collect their SEO fields as 3rd string backups in case we need them\n\t\t\t\t\t\t\t$yoast_seo_title\t\t\t= get_post_meta( $info['postID'] , '_yoast_wpseo_title' , true );\n\t\t\t\t\t\t\t$yoast_seo_description\t\t= get_post_meta( $info['postID'] , '_yoast_wpseo_metadesc' , true );\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Cancel their output if ours have been defined so we don't have two sets of tags\n\t\t\t\t\t\t\tremove_action( 'wpseo_head' , array( 'WPSEO_Twitter' , 'get_instance' ) , 40 );\n\t\t\t\t\t\t\n\t\t\t\t\t\tendif;\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*****************************************************************\n\t\t\t\t\t\t* *\n\t\t\t\t\t\t* JET PACK: If ours are activated, disable theirs\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\tif ( class_exists( 'JetPack' ) ) :\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tadd_filter( 'jetpack_disable_twitter_cards', '__return_true', 99 );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tendif;\t\t\t\t\n\n\t\t\t\t\t\t/*****************************************************************\n\t\t\t\t\t\t* *\n\t\t\t\t\t\t* TWITTER TITLE\t\t\t\t\t\t\t\t\t\t *\n\t\t\t\t\t\t* *\n\t\t\t\t\t\t******************************************************************/\n\t\t\t\t\t\t\n\t\t\t\t\t\t// If the user defined a Social Media title, use it, otherwise check for Yoast's\n\t\t\t\t\t\tif(!$info['title'] && isset($yoast_twitter_title) && $yoast_twitter_title):\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$info['title'] = $yoast_twitter_title;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// If not title has been defined, let's check the SEO description as a 3rd string option\n\t\t\t\t\t\telseif(!$info['title'] && isset($yoast_seo_title) && $yoast_seo_title):\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$info['title'] = $yoast_seo_title;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// If not title has been defined, let's use the post title\n\t\t\t\t\t\telseif(!$info['title']):\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$info['title'] = convert_smart_quotes(htmlspecialchars_decode( get_the_title() ));\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tendif;\n\t\t\n\t\t\t\t\t\t/*****************************************************************\n\t\t\t\t\t\t* *\n\t\t\t\t\t\t* TWITTER DESCRIPTION\t\t\t\t\t\t\t\t *\n\t\t\t\t\t\t* *\n\t\t\t\t\t\t******************************************************************/\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Open Graph Description\n\t\t\t\t\t\tif(!$info['description'] && isset($yoast_twitter_description) && $yoast_twitter_description):\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$info['description'] = $yoast_twitter_description;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// If not title has been defined, let's check the SEO description as a 3rd string option\n\t\t\t\t\t\telseif(!$info['description'] && isset($yoast_seo_description) && $yoast_seo_description):\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$info['description'] = $yoast_seo_description;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// If not, then let's use the excerpt\n\t\t\t\t\t\telseif(!$info['description']):\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$info['description'] = convert_smart_quotes(htmlspecialchars_decode( sw_get_excerpt_by_id( $info['postID'] )) );\n\t\t\t\t\t\t\n\t\t\t\t\t\tendif;\n\t\n\t\t\t\t\t\t/*****************************************************************\n\t\t\t\t\t\t* *\n\t\t\t\t\t\t* TWITTER IMAGE\t\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\t\t\t\t\t\n\t\t\t\t\t\t// Open Graph Description\n\t\t\t\t\t\tif(!$info['imageURL'] && isset($yoast_twitter_image) && $yoast_twitter_image):\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$info['imageURL'] = $yoast_twitter_image;\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// If nothing else is defined, let's use the post Thumbnail as long as we have the URL cached\n\t\t\t\t\t\t\t$twitter_image = get_post_meta( $info['postID'] , 'sw_open_thumbnail_url' , true );\n\t\t\t\t\t\t\tif($twitter_image):\n\t\t\t\t\t\t\t\t$info['imageURL'] = $twitter_image;\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tendif;\n\n\t\t\t\t\t\t/*****************************************************************\n\t\t\t\t\t\t* *\n\t\t\t\t\t\t* PUT IT ALL TOGETHER\t\t\t\t\t\t \t\t *\n\t\t\t\t\t\t* *\n\t\t\t\t\t\t******************************************************************/\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Check if we have everything we need for a large image summary card\n\t\t\t\t\t\tif($info['imageURL']):\n\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta name=\"twitter:card\" content=\"summary_large_image\">';\n\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta name=\"twitter:title\" content=\"'.$info['title'].'\">';\n\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta name=\"twitter:description\" content=\"'.$info['description'].'\">';\n\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta name=\"twitter:image\" content=\"'.$info['imageURL'].'\">';\n\t\t\t\t\t\t\tif($info['sw_user_options']['twitterID']):\n\t\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta name=\"twitter:site\" content=\"@'.$info['sw_user_options']['twitterID'].'\">';\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\tif($info['user_twitter_handle']):\n\t\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta name=\"twitter:creator\" content=\"@'.str_replace('@','',$info['user_twitter_handle']).'\">';\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t// Otherwise create a small summary card\n\t\t\t\t\t\telse:\n\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta name=\"twitter:card\" content=\"summary\">';\n\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta name=\"twitter:title\" content=\"'.str_replace('\"','\\'',$info['title']).'\">';\n\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta name=\"twitter:description\" content=\"'.str_replace('\"','\\'',$info['description']).'\">';\n\t\t\t\t\t\t\tif($info['sw_user_options']['twitterID']):\n\t\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta name=\"twitter:site\" content=\"@'.$info['sw_user_options']['twitterID'].'\">';\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\tif($info['user_twitter_handle']):\n\t\t\t\t\t\t\t\t$info['header_output'] .= PHP_EOL .'<meta name=\"twitter:creator\" content=\"@'.str_replace('@','',$info['user_twitter_handle']).'\">';\n\t\t\t\t\t\t\tendif;\n\t\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\n\t\t\t\t\tendif;\n\t\t\t\tendif;\n\t\t\t\treturn $info;\n\t\t\t}",
"function like($idevent) {\n\n\t\t\t$method = WALL . \"/feeds/$idevent/like\";\n\n\t\t\t$verbmethod = \"POST\";\n\n\t\t\t$params = array();\n\n\t\t\t$params = array_filter($params, function($item) { return !is_null($item); });\n\n\t\t\t$response = $this->zyncroApi->callApi($method, $params, $verbmethod);\n\n\t\t\treturn $response;\n\t\t}",
"function unlike($idevent) {\n\n\t\t\t$method = WALL . \"/feeds/$idevent/unlike\";\n\n\t\t\t$verbmethod = \"POST\";\n\n\t\t\t$params = array();\n\n\t\t\t$params = array_filter($params, function($item) { return !is_null($item); });\n\n\t\t\t$response = $this->zyncroApi->callApi($method, $params, $verbmethod);\n\n\t\t\treturn $response;\n\t\t}",
"private function unlike($postDataArr){\n $access_token = isset($postDataArr['access_token']) ? filter_var($postDataArr['access_token'], FILTER_SANITIZE_STRING) : '';\n $device_type = isset($postDataArr['device_type']) ? filter_var($postDataArr['device_type'], FILTER_SANITIZE_NUMBER_INT) : '';\n $user_id = isset($postDataArr['user_id']) ? filter_var($postDataArr['user_id'],FILTER_SANITIZE_STRING) : '';\n if(!empty($access_token)){\n if(!empty($device_type) && $device_type!= 1 && $device_type!= 2){ //1 = ANDROID 2 = IOS\n //INVALID DEVICE TYPE ERROR\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('INVALID_ACCESS');\n $this->response($errorMsgArr);\n }\n //VALIDATE ACCESS\n $valid = $this->Api_model->validateAccess($access_token);\n if(isset($valid['STATUS']) && !$valid['STATUS']){\n //ACCESS TOKEN INVALID\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $valid['MESSAGE'];\n $this->response($errorMsgArr);\n }\n \n if(!empty($user_id)){\n $check = $this->Common_model->fetch_data('user_likes','id',array('where' => array('user_id' => $user_id,'liked_by' => $valid['VALUE']['user_id'], \"status\" => ACTIVE)),TRUE);\n if(empty($check)){\n //YOU HAVE ALREADY LIKED THIS USER\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = ALREADY_REG_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('NOT_LIKED');\n $this->response($errorMsgArr);\n }\n \n $this->Common_model->delete_data('user_likes',array('where' => array('id' => $check['id'])));\n //FETCH TOTAL LIKE COUNT\n $totalcount = $this->Common_model->fetch_count(\"user_likes\", array('where' => array(\"user_id\" => $user_id)));\n \n //SUCCESS\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = SUCCESS_CODE;\n $errorMsgArr['STATUS'] = TRUE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['VALUE']['count']= $totalcount;\n $this->response($errorMsgArr);\n }else{\n //PARAM MISSING\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = PARAM_MISSING_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('PARAM_MISSING');\n $this->response($errorMsgArr);\n }\n }else{\n //ACCESS TOKEN MISSING ERROR\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('ACCESSTOKEN_MISSING');\n $this->response($errorMsgArr);\n }\n \n }",
"public function testDeclined(){ \n\n $unBuyableProduct = Product::where('price', '>', 75)\n ->where('quantity','>',10)\n ->first();\n\n //test card 1\n $response = $this->checkoutAction($unBuyableProduct, $this->testVisaPan);\n $response->assertSee(\"Declined\");\n\n\n //test card 2\n $response = $this->checkoutAction($unBuyableProduct, $this->testMasterCardPan);\n $response->assertSee(\"Declined\"); \n \n }",
"public function unlike()\n {\n $this->likes()->where('user_id', auth()->id())->delete();\n }",
"public function unlike(){\n $this->likes()->where([\n 'user_id' => auth()->id()\n ])->delete();\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 }",
"private function like($postDataArr) {\n $access_token = isset($postDataArr['access_token']) ? filter_var($postDataArr['access_token'], FILTER_SANITIZE_STRING) : '';\n $device_type = isset($postDataArr['device_type']) ? filter_var($postDataArr['device_type'], FILTER_SANITIZE_NUMBER_INT) : '';\n $user_id = isset($postDataArr['user_id']) ? filter_var($postDataArr['user_id'],FILTER_SANITIZE_STRING) : '';\n if(!empty($access_token)){\n if(!empty($device_type) && $device_type!= 1 && $device_type!= 2){ //1 = ANDROID 2 = IOS\n //INVALID DEVICE TYPE ERROR\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('INVALID_ACCESS');\n $this->response($errorMsgArr);\n }\n //VALIDATE ACCESS\n $valid = $this->Api_model->validateAccess($access_token);\n if(isset($valid['STATUS']) && !$valid['STATUS']){\n //ACCESS TOKEN INVALID\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $valid['MESSAGE'];\n $this->response($errorMsgArr);\n }\n \n if(!empty($user_id)){\n //check if the user tries to like his own profile\n if($user_id == $valid['VALUE']['user_id']){\n //FORBIDDEN USE OF FEATURE\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = FORBIDDEN;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('INVALID_USE');\n $this->response($errorMsgArr);\n }\n //check the records exists\n $check = $this->Common_model->fetch_data('user_likes','id',array('where' => array('user_id' => $user_id,'liked_by' => $valid['VALUE']['user_id'], \"status\" => ACTIVE)),TRUE);\n if(!empty($check)){\n //YOU HAVE ALREADY LIKED THIS USER\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = ALREADY_REG_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('ALREADY_LIKED');\n $this->response($errorMsgArr);\n }\n //build insert array\n $insertArr = array(\n 'user_id' => $user_id,\n 'liked_by' => $valid['VALUE']['user_id'],\n 'created_on' => time(),\n );\n \n $this->Common_model->insert_single('user_likes',$insertArr);\n //FETCH TOTAL LIKE COUNT\n $totalcount = $this->Common_model->fetch_count(\"user_likes\", array('where' => array(\"user_id\" => $user_id)));\n //SUCCESS\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = SUCCESS_CODE;\n $errorMsgArr['STATUS'] = TRUE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['VALUE']['count'] = $totalcount;\n $this->response($errorMsgArr);\n }else{\n //PARAM MISSING\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = PARAM_MISSING_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('PARAM_MISSING');\n $this->response($errorMsgArr);\n }\n }else{\n //ACCESS TOKEN MISSING ERROR\n $errorMsgArr = array();\n $errorMsgArr['CODE'] = INVALID_ACCESS_CODE;\n $errorMsgArr['STATUS'] = FALSE;\n $errorMsgArr['APICODERESULT'] = $this->lang->line('APIRESULT_SUCCESS');\n $errorMsgArr['MESSAGE'] = $this->lang->line('ACCESSTOKEN_MISSING');\n $this->response($errorMsgArr);\n }\n }",
"function dislikeVideo() {\n if ($this->getRequestMethod() != \"POST\") {\n $this->response('', 406);\n }\n $data = json_decode(file_get_contents(\"php://input\"),true);\n $id = (int)$data['id'];\n if ($id > 0) {\n $query = \"select * from videos where id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $result = $r->fetch_assoc(); \n $query = \"update videos set dislikes = dislikes + 1 where id =$id;\";\n $r = $this->conn->query($query) or die($this->conn->error.__LINE__); \n $this->response('', 200);\n } else {\n $this->response('', 204);\n }\n } else {\n $this->response('', 400);\n }\n }",
"public function tellInvalidCard()\n {\n }",
"public function likes(){\n }",
"function grve_print_portfolio_like_counter() {\n\n\t$post_likes = grve_option( 'portfolio_social', '', 'grve-likes' );\n\tif ( !empty( $post_likes ) ) {\n\t\tglobal $post;\n\t\t$post_id = $post->ID;\n?>\n\t\t<div class=\"grve-like-counter grve-icon-heart\"><span><?php echo grve_likes( $post_id ); ?></span></div>\n<?php\n\t}\n\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 testProfilePrototypeGetLikes()\n {\n\n }",
"function moments_qodef_like_latest_posts() {\n\t\treturn moments_qodef_like()->add_like();\n\t}",
"function dp_likes_page_button() {\t\n\tif(get_option('dp_header_likes') && $likes_page_id = get_option('dp_post_likes_page')) {\n\t\t$dp_post_likes = get_option('dp_post_likes');\n\t\t$login_required = !empty($dp_post_likes['login_required']) ? true : false;\n\t\tif(!is_user_logged_in() && $login_required)\n\t\t\treturn false;\n\t\t\t\n\t\techo '<a class=\"btn btn-likes btn-red\" href=\"'.get_permalink($likes_page_id).'\">'.get_the_title($likes_page_id).'</a>';\n\t}\n}",
"function dislikeComment() {\n if ($this->getRequestMethod() != \"POST\") {\n $this->response('', 406);\n }\n $data = json_decode(file_get_contents(\"php://input\"),true);\n $id = (int)$data['id'];\n if ($id > 0) {\n $query = \"select * from comments where id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $query = \"update comments set dislikes = dislikes + 1 where id =$id;\";\n $r = $this->conn->query($query) or die($this->conn->error.__LINE__); \n $this->response('', 200);\n } else {\n $this->response('', 204);\n }\n } else {\n $this->response('', 400);\n }\n }",
"function unlike( $aParams, $aaData = NULL )\n\t{\n if( count( $aParams ) < 1 ) {\n $this->errorMessage( 'Need a minimum of 1 parameter' );\n }\n\n // check we have data\n if( !array_key_exists('id',$_POST) OR intval($_POST['id']) == '' ){\n $this->errorMessage( 'Missing required data' );\n }\n if( !array_key_exists('type',$_POST) OR $_POST['type'] == '' ){\n $this->errorMessage( 'Missing required data' );\n }\n\n // get variables ready\n $post_type = $_POST['type'];\n $post_id = $_POST['id'];\n $like_account_user_id = $_SESSION['authi']['user_settings']['active_pet_id']['setting_int'];\n $like_dt = date( 'Y-m-d H:i:s' );\n\n // update relevant table\n switch( strtolower($post_type) ) {\n \n case 'text':\n case 'album':\n $sSQL = \"\n UPDATE posts\n SET post_likes = post_likes - 1\n WHERE post_type = '$post_type'\n AND post_id = $post_id\n LIMIT 1\n \";\n break;\n\n case 'photo':\n $sSQL = \"\n UPDATE photos\n SET photo_likes = photo_likes - 1\n WHERE photo_id = $post_id\n LIMIT 1\n \";\n break;\n\n } // end switch\n\n #echo $sSQL;\n\t\t$aaData = $this->oDB->upd($sSQL, '');\n\n\n // update like table\n $sSQL = \"\n DELETE FROM likes\n WHERE like_type = '$post_type'\n AND like_item_id = $post_id\n AND like_account_user_id = $like_account_user_id\n LIMIT 1\n \";\n #echo $sSQL;\n\t\t$aaData = $this->oDB->del($sSQL, '');\n\n // return like count\n $iLikeCount = appFunctions::getLikeCount( $post_type, $post_id );\n if( $iLikeCount == 1 ) {\n $aaResponse['mobile'] = \"$iLikeCount pet likes this\";\n $aaResponse['non-mobile'] = \"$iLikeCount pet likes this\";\n } else {\n $aaResponse['mobile'] = \"$iLikeCount pets like this\";\n $aaResponse['non-mobile'] = \"$iLikeCount pets like this\";\n }\n echo json_encode( $aaResponse );\n\n\t}",
"function zp_post_like( $atts, $content = null ) {\n\textract( shortcode_atts( array(\n\t\t'text' => __( 'Like this post', 'novo' ),\n\t ), $atts ) );\n\t global $post;\n\t$likes = get_post_meta($post->ID,'zp_like',true);\n\t$like = ( $likes ) ? $likes: '0';\t\n\t\n\t$output = '<span class=\"post_like\"><span class=\"likes text-right '.$post->ID.'\"><span class=\"icon-heart '.$post->ID.'\">R</span><span class= \"textLike\">'.$text.'</span><span class=\"likes_value\"><em>( '.$like.')</em></span></span></span>';\t\n\treturn $output;\n}",
"public function globallikesAction() {\n\t$viewer = Engine_Api::_()->user()->getViewer();\n\t// GET THE CURRENT UESRID\n\t$loggedin_user_id = $viewer->getIdentity();\n\tif (empty($loggedin_user_id)) {\n\t return;\n\t}\n\t$ad_id = $this->_getParam('ad_id');\n\t$core_like = $this->_getParam('core_like');\n\t$ad_id = Engine_Api::_()->communityad()->getEncodeToDecode($ad_id);\n\t$resource_type = $this->_getParam('resource_type');\n\t// Make an 'Item Type' acording to the resource type.\n\t$resource_info = Engine_Api::_()->getDbtable('modules', 'communityad')->getModuleInfo($resource_type);\n\tif (!empty($resource_info)) {\n\t $resource_type = $resource_info['table_name'];\n\t}\n\t$resource_id = $this->_getParam('resource_id');\n\t$owner_id = $this->_getParam('owner_id');\n\t$like_id = $this->_getParam('like_id');\n\t$resource_obj = Engine_Api::_()->getItem($resource_type, $resource_id); // Resource Object.\n\t$is_like = Engine_Api::_()->getDbtable('likes', 'core')->getLike($resource_obj, $viewer); // Check from 'core_likes'.\n\t//Conditioon: If advertisment is not liked before.\n\tif (empty($like_id)) {\n\t //CHECKING IF USER HAS MAKING DUPLICATE ENTRY OF LIKING AN APPLICATION.\n\t $userads = Engine_Api::_()->getItem('userads', $ad_id);\n\t $like_id_temp = Engine_Api::_()->communityad()->check_availability($ad_id);\n\t if (empty($like_id_temp[0]['like_id']) || !empty($userads->story_type)) {\n\n\t\t// Condition : Only for 'Group' & 'Event' for the 'Activity Like'.\n\t\tif ($resource_type == 'group' || $resource_type == 'event') {\n\t\t $activityTable = Engine_Api::_()->getDbtable('actions', 'activity');\n\t\t $activityTableName = $activityTable->info('name');\n\t\t // Queary: Check that entry are already in data base or not.\n\t\t $selectContainer = $activityTable->select()\n\t\t\t\t\t\t ->from($activityTableName, array('action_id', 'like_count'))\n\t\t\t\t\t\t ->where('object_type =?', $resource_type)\n\t\t\t\t\t\t ->where('object_id =?', $resource_id)\n\t\t\t\t\t\t ->where('type =?', $resource_type . '_create')\n\t\t\t\t\t\t ->limit(1);\n\t\t $fetchPagesettings = $selectContainer->query()->fetchAll();\n\t\t if (!empty($fetchPagesettings)) {\n\t\t\t$activityTable->update(array('like_count' => $fetchPagesettings[0]['like_count'] + 1), array('action_id =?' => $fetchPagesettings[0]['action_id']));\n\t\t\t$activityTable = Engine_Api::_()->getDbtable('likes', 'activity');\n\t\t\t$likeActivity = $activityTable->createRow();\n\t\t\t$likeActivity->resource_id = $fetchPagesettings[0]['action_id'];\n\t\t\t$likeActivity->poster_type = $viewer->getType();\n\t\t\t$likeActivity->poster_id = $viewer->getIdentity();\n\t\t\t$likeActivity->save();\n\t\t }\n\t\t}\n\n\t\t$likesTable = Engine_Api::_()->getDbTable('likes', 'communityad');\n\t\t$isExist = $likesTable->isExist($ad_id, $viewer->getIdentity());\n\n\n\t\t// Increase the \"Click Count of the Sponsored story\"\n\t\tif( !empty($userads->story_type) ) {\n\t\t Engine_Api::_()->communityad()->ad_clickcount($ad_id, 0);\n\t\t}\n\n\n\t\tif (empty($userads->story_type) && empty($isExist)) {\n\t\t $likeTableData = $likesTable->createRow();\n\t\t $likeTableData->poster_id = $viewer->getIdentity();\n\t\t $likeTableData->ad_id = $ad_id;\n\t\t //DATA CAN SAVE IN THE TABLE\n\t\t $like_id = $likeTableData->save();\n\t\t}\n\n\t\t// Condition: If content is not 'Like' then insert row in 'like' table and from 'Notification' table.\n\t\tif (empty($is_like)) {\n\t\t if ( !empty($resource_obj) && !empty($viewer) && Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitelike')) {\n\t\t Engine_Api::_()->sitelike()->setLikeFeed($viewer, $resource_obj);\n\t\t }\n\n\t\t $likeTable = Engine_Api::_()->getItemTable('core_like');\n\t\t $likeData = $likeTable->createRow();\n\t\t $likeData->resource_type = $resource_type;\n\t\t $likeData->resource_id = $resource_id;\n\t\t $likeData->poster_type = $viewer->getType();\n\t\t $likeData->poster_id = $viewer->getIdentity();\n\t\t $likeData->save();\n\t\t //DATA CAN SAVE IN THE TABLE\n\t\t // Queary: For insert data in 'notification' table for display notifications of the advertisment owner.\n\t\t if (!empty($owner_id) && $owner_id != $viewer->getIdentity()) {\n\t\t\t$notify_table = Engine_Api::_()->getDbtable('notifications', 'activity');\n\t\t\t$label = '{\"label\":\"' . $resource_type . '\"}';\n\n\t\t\t$notifyData = $notify_table->createRow();\n\t\t\t$notifyData->user_id = $owner_id;\n\t\t\t$notifyData->subject_type = $viewer->getType();\n\t\t\t$notifyData->subject_id = $viewer->getIdentity();\n\t\t\t$notifyData->object_type = $resource_type;\n\t\t\t$notifyData->object_id = $resource_id;\n\t\t\t$notifyData->type = 'liked';\n\t\t\t$notifyData->params = $label;\n\t\t\t$notifyData->date = date('Y-m-d h:i:s', time());\n\t\t\t$notifyData->save();\n\t\t }\n\t\t}\n\n\t\t// Increase 'Count' in userad table.\n\t\t$userads->count_like = $userads->count_like + 1;\n\t\t$userads->save();\n\n\t\t//PASS THE VALUE TO .TPL FILE\n\t\t$sendLikeResponced = $like_id;\n\t\tif (!empty($userads->story_type)) {\n\t\t $sendLikeResponced = 1;\n\t\t}\n\t\t$this->view->like_id = $sendLikeResponced;\n\t\t$like_msg = 'Successfully Liked.';\n\t } else {\n\t\t$this->view->like_id = $like_id_temp[0]['like_id'];\n\t }\n\t} else { // Condition: If 'Like' before then delete from tables.\n\t // Condition: Only in the case of group and event delete from activity like.\n\t if ($resource_type == 'group' || $resource_type == 'event') {\n\t\t$activityTable = Engine_Api::_()->getDbtable('actions', 'activity');\n\t\t$activityTableName = $activityTable->info('name');\n\t\t// Queary: Check that entry are already in data base or not.\n\t\t$selectContainer = $activityTable->select()\n\t\t\t\t\t\t->from($activityTableName, array('action_id', 'like_count'))\n\t\t\t\t\t\t->where('object_type =?', $resource_type)\n\t\t\t\t\t\t->where('object_id =?', $resource_id)\n\t\t\t\t\t\t->where('type =?', $resource_type . '_create')\n\t\t\t\t\t\t->limit(1);\n\t\t$fetchPagesettings = $selectContainer->query()->fetchAll();\n\t\tif (!empty($fetchPagesettings) && empty($core_like)) {\n\t\t $activityPosterType = $fetchPagesettings[0]['action_id'];\n\t\t Engine_Api::_()->getDbtable('likes', 'activity')->delete(array('resource_id =?' => $activityPosterType, 'poster_type =?' => $viewer->getType(), 'poster_id =?' => $viewer->getIdentity()));\n\t\t $activityTable->update(array('like_count' => $fetchPagesettings[0]['like_count'] - 1), array('action_id =?' => $fetchPagesettings[0]['action_id']));\n\t\t}\n\t }\n\n\t // Increase 'Count' in userad table.\n\t $userads = Engine_Api::_()->getItem('userads', $ad_id);\n\t $userads->count_like = $userads->count_like - 1;\n\t $userads->save();\n\n\t // Delete from 'communityad_like' table.\n\t if (empty($userads->story_type)) {\n\t\tEngine_Api::_()->getDbTable('likes', 'communityad')->delete(array('poster_id =?' => $viewer->getIdentity(), 'ad_id =?' => $ad_id));\n\t }\n\t if (!empty($is_like) && empty($core_like)) {\n\t\tif ( !empty($resource_obj) && !empty($viewer) && Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitelike')) {\n\t\t Engine_Api::_()->sitelike()->removeLikeFeed($viewer, $resource_obj);\n\t\t}\n\t\tEngine_Api::_()->getDbTable('likes', 'core')->delete(array('like_id =?' => $is_like->like_id));\n\t }\n\t $like_msg = 'Successfully Unliked.';\n\t}\n }",
"public function down_one($id){\n\n\t\tif(!$this->sessions_manager->authorized()){\n\t\t\t$this->errors = array(\n\t\t\t\t'error'\t=> 'Not authorised to like.'\n\t\t\t);\n\t\t\t$this->output->set_status_header(401);\n\t\t\treturn false;\n\t\t}\n\n\t\t$author_id = $this->sessions_manager->get_user()['id'];\n\n\t\t$this->validator->set_data(array(\n\t\t\t'id'\t\t=> $id,\n\t\t\t'authorId'\t=> $author_id,\n\t\t));\n\n\t\t$this->validator->set_rules(array(\n\t\t\tarray(\n\t\t\t\t'field'\t=> 'id',\n\t\t\t\t'label'\t=> 'Idea ID',\n\t\t\t\t'rules'\t=> 'numeric',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'field'\t=> 'authorId',\n\t\t\t\t'label'\t=> 'Author ID',\n\t\t\t\t'rules'\t=> 'numeric',\n\t\t\t)\n\t\t));\n\n\t\tif($this->validator->run() == false){\n\n\t\t\t$this->errors = array(\n\t\t\t\t'validation_error'\t=> $this->validator->error_array()\n\t\t\t);\n\t\t\treturn false;\n\n\t\t}\n\n\t\tif(!$this->validate_idea_ids($id)){\n\t\t\t$this->errors = array(\n\t\t\t\t'error'\t=> 'Idea ID does not exist.'\n\t\t\t);\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->db->trans_start();\n\n\t\t//delete like record\n\t\t$this->db->delete('likes', array('ideaId' => $id, 'authorId' => $author_id));\n\n\t\t//decrease the like count for the idea\n\t\t//false third parameter prevents backticking the likes-1 which is a \"formula\" not a \"value\"\n\t\t$this->db->set('likes', 'likes-1', false);\n\t\t$this->db->where('id', $id);\n\t\t$this->db->update('ideas');\n\n\t\t$this->db->trans_complete();\n\n\t\tif($this->db->trans_status() === FALSE){\n\n\t\t\t$msg = $this->db->error()['message'];\n\t\t\t$num = $this->db->error()['code'];\n\t\t\t$last_query = $this->db->last_query();\n\t\t\t\n\t\t\tlog_message('error', 'Problem decreasing like count by one: ' . $msg . ' (' . $num . '), using this query: \"' . $last_query . '\"');\n\t\t\t\n\t\t\t$this->errors = array(\n\t\t\t\t'system_error'\t=> 'Problem decreasing like count.',\n\t\t\t);\n\t\t\t\n\t\t\treturn false;\n\n\t\t}\n\n\t\treturn '-1';\n\n\t}",
"function jptweak_remove_share() {\n remove_filter( 'the_content', 'sharing_display',19 );\n remove_filter( 'the_excerpt', 'sharing_display',19 );\n if ( class_exists( 'Jetpack_Likes' ) ) {\n remove_filter( 'the_content', array( Jetpack_Likes::init(), 'post_likes' ), 30, 1 );\n }\n}",
"function tm_pf_reset_like(){\n\t$screen = get_current_screen();\n\tif ( $screen->post_type == 'portfolio' && isset($_GET['action']) && $_GET['action']=='edit' && !isset($_GET['taxonomy']) ){\n\t\tglobal $post;\n\t\t$postID = $_GET['post'];\n\t\t$resetVal = get_post_meta($postID, '_thememount_portfolio_like_pflikereset' ,true );\n\t\tif( $resetVal=='on' ){\n\t\t\t// Do reset processs now\n\t\t\tupdate_post_meta($postID, 'thememount_likes' , '0' ); // Setting ZERO\n\t\t\tupdate_post_meta($postID, '_thememount_portfolio_like_pflikereset' ,'' ); // Removing checkbox\n\t\t}\n\t}\n\t\n}",
"function userLiked($post_id)\r\n {\r\n $db = connect(); //Datenbank verbindung\r\n\r\n $userid = $_SESSION['userdata']['ID_User']; //ID des aktuellen User\r\n \r\n $sql = \"SELECT count(*) FROM liken WHERE User_ID = ? AND Post_ID = ?;\";\r\n $statement = $db->prepare($sql);\r\n $statement->bind_param('ii',$userid,$post_id);\r\n $statement->execute();\r\n $statement->bind_result($userLikeCheck);\r\n\r\n while($statement->fetch()){\r\n $check = array('userLike' => $userLikeCheck);\r\n }\r\n //Wen er den Beitrag schon geliket hat, wird true zurück gegeben\r\n if ($check['userLike'] == 1) {\r\n return true;\r\n }\r\n else{ //Wen er den BEitrag noch nich geliket hat, wird false zurück gegeben \r\n return false;\r\n }\r\n }",
"public function unlike($user = null)\n {\n if (null === $user) {\n $user = auth()->user();\n }\n\n $like = $this->likes()->where('user_id', '=', $user->id)->first();\n\n if (! $like) {\n return;\n }\n\n $like->delete();\n\n if ($this->likes_count > 0) {\n $this->decrement('likes_count');\n }\n }",
"function cardIsAce($card) {\n\tif ($card == 'Ace') {\n\t\treturn true;\n\t} \n\t\treturn false;\n}",
"function checkLikeComment($userId, $commentId)\n{\n\n $sqlCheckLike = \"SELECT COUNT(commentId) as liked FROM `user_like_comment` WHERE userId = '$userId' AND commentId = '$commentId'\";\n $resultCheckLike = mysqli_query($GLOBALS[\"conn\"], $sqlCheckLike);\n $rowCheckLike = mysqli_fetch_assoc($resultCheckLike);\n //return $rowCheckLike['liked'];\n\n if ($rowCheckLike['liked'] == 0) { # 0 = not liked yet\n likeComment($userId, $commentId);\n } else {\n deLikeComment($userId, $commentId);\n }\n}",
"public static function needsCardUpFront()\n {\n return static::$cardUpFront;\n }",
"public function isLiked(){\n //es decir si este estado tiene un like del usuario actualmente autenticado y nos interesa si existe en la base de datos\n return $this->likes()->where('user_id', auth()->id())->exists();\n }",
"function mark_as_awarded()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tif(!empty($data['list'])) $result = $this->_bid->mark_as_awarded(explode('--',$data['list']));\n\t\t\n\t\t$data['msg'] = !empty($result['boolean']) && $result['boolean']? 'The selected bids have been marked as awarded.': 'ERROR: The selected bids could not be awarded.';\n\t\tif(!empty($result['not_awarded'])) {\n\t\t\t$data['msg'] .= \"<BR><BR>The following bids do not qualify to be awarded: \";\n\t\t\tforeach($result['not_awarded'] AS $row){\n\t\t\t\t$data['msg'] .= \"<BR>\".$row['provider'].\" (\".$row['bid_currency'].format_number($row['bid_amount'],3).\")\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$data['area'] = 'refresh_list_msg';\n\t\t$this->load->view('addons/basic_addons', $data);\n\t}",
"public function likePostAction() {\n\n }",
"public function like()\n {\n if (isLoggedIn() == false) {\n flash('login_to_post', 'Please, login to like post');\n redirect('/users/login');\n }\n\n if ($_SERVER['REQUEST_METHOD'] == 'GET') {\n\n // Sanitize array\n $_GET = filter_input_array(INPUT_GET, FILTER_SANITIZE_STRING);\n\n $data = [\n 'user_id' => $_SESSION['user_id'],\n 'post_id' => trim($_GET['id'])\n ];\n\n // Check if get request is correct\n if (!empty($data['post_id']) && !empty($data['user_id'])) {\n\n $post = $this->postModel->getPostById($data['post_id']);\n $user = $this->userModel->getUserById($data['user_id']);\n\n if ($post && $user) {\n $likes = $this->postModel->getLikesByUserId($data['user_id']);\n\n foreach ($likes as $like) {\n if ($like->post_id === $data['post_id']) {\n // Delete like if user pressed button twice\n $this->postModel->deleteLikeById($like->id);\n $this->postModel->postUpdateLikesCount($data['post_id']);\n redirect('/posts');\n exit;\n }\n }\n\n $this->postModel->like($data);\n $this->postModel->postUpdateLikesCount($data['post_id']);\n }\n }\n redirect('/posts');\n }\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 }",
"public function like(\\Tuiter\\Models\\User $user, \\Tuiter\\Models\\Post $post): bool\n {\n $unLike=new \\Tuiter\\Models\\Like($post->getPostId(),$user->getUserId());\n if($this->likeExist($unLike)){\n return false;\n }\n $insert = $this->collection->insertOne(array(\n 'likeId'=>$unLike->getLikeId(),\n 'postId'=>$unLike->getPostId(),\n 'userId'=>$unLike->getUserId()\n ));\n return !empty($insert);\n }",
"public function test_a_user_can_unlike_a_post(){\n \n //we have a signed in user\n \n //user likes the model\n $this->post->likes();\n\n $this->post->unlike();\n\n $this->assertFalse($this->post->isLiked());\n\n }",
"function DoLikeComment($action)\n {\n global $DB, $mainsettings, $sdlanguage, $userinfo;\n\n require_once(SD_INCLUDE_PATH.'class_sd_likes.php');\n\n //SD370: allow likes by Guests (not logged in)\n if(!CheckFormToken('securitytoken') || empty($this->plugin_id) ||\n !$this->hasPostAccess || #empty($userinfo['loggedin']) ||\n empty($userinfo['usergroupids']) || !@array_intersect($userinfo['usergroupids'], $this->like_groups) ||\n !in_array($action,array(SD_LIKED_TYPE_COMMENT_REMOVE,SD_LIKED_TYPE_COMMENT,SD_LIKED_TYPE_COMMENT_NO)) )\n {\n if(Is_Ajax_Request()) return false;\n echo '<strong>'.$sdlanguage['error_invalid_token'].'</strong><br />';\n return false;\n }\n\n if($comment_id = Is_Valid_Number(GetVar('cid', 0, 'whole_number'),0,1,99999999))\n {\n $DB->result_type = MYSQL_ASSOC;\n $comment_arr = $DB->query_first('SELECT commentid, pluginid, objectid, userid FROM {comments}'.\n ' WHERE commentid = %d AND pluginid = %d',\n $comment_id, $this->plugin_id);\n }\n if(!isset($comment_arr) || empty($comment_arr['commentid']))\n {\n $DB->result_type = MYSQL_BOTH;\n return false;\n }\n $this->object_id = $comment_arr['objectid'];\n\n $entries = SD_Likes::DoLikeElement($this->plugin_id, $comment_id,\n ($action===SD_LIKED_TYPE_COMMENT_REMOVE?SD_LIKED_TYPE_COMMENT_REMOVE:($action==SD_LIKED_TYPE_COMMENT?SD_LIKED_TYPE_COMMENT:SD_LIKED_TYPE_COMMENT_NO)),\n $userinfo['userid'], $userinfo['username'],\n $comment_arr['userid']);\n if(!empty($entries) && is_array($entries))\n {\n $c_likes = (empty($entries['total'])?0:$entries['total']) +\n (empty($entries['guests'])?0:$entries['guests']);\n $c_dislikes = (empty($entries['total_no'])?0:$entries['total_no']) +\n (empty($entries['guests_no'])?0:$entries['guests_no']);\n $DB->query(\"UPDATE {comments} SET user_likes = '%s', likes_count = %d , dislikes_count = %d WHERE commentid = %d\",\n $DB->escape_string(serialize($entries)),\n $c_likes, $c_dislikes, $comment_id);\n\n if(Is_Ajax_Request())\n {\n if($action==SD_LIKED_TYPE_COMMENT_REMOVE)\n {\n echo $sdlanguage['message_comment_like_removed'];\n }\n return true;\n }\n $msg = '';\n switch($action)\n {\n case SD_LIKED_TYPE_COMMENT: $msg = $sdlanguage['message_comment_liked']; break;\n case SD_LIKED_TYPE_COMMENT_NO: $msg = $sdlanguage['message_comment_disliked']; break;\n case SD_LIKED_TYPE_COMMENT_REMOVE: $msg = $sdlanguage['message_comment_like_removed']; break;\n }\n RedirectFrontPage($this->isArticle ? $this->url : RewriteLink($this->url), $msg);\n return true;\n }\n return false;\n\n }",
"public function cleanOldCards() {\r\n\t\t$cards = Mage::getModel('authnetcim/card')->getCollection()\r\n\t\t\t\t\t\t->addFieldToFilter( 'added', array( 'lt' => (time() - (120*86400)) ) );\r\n\t\t\r\n\t\tforeach( $cards as $card ) {\r\n\t\t\tif( $this->deletePaymentProfile( $card->getPaymentId(), $card->getProfileId() ) ) {\r\n\t\t\t\t$card->delete();\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function isLiked(){\n $likeKey = $this->getLikeKey();\n if ( Auth::check() ){\n $isLiked = $this->user_counters()->where('user_id', Auth::user()->id)->where('action', 'like')->count();\n return $isLiked;\n } else {\n $isLiked = session($likeKey);\n return !empty($isLiked);\n }\n }",
"public function unlike(User $user)\n {\n $redisKeyForLikes = 'post:' . $this->id . ':likes'; //the set will store user ids\n $redisKeyForUserLikedPosts = 'user:' . $user->id . ':likes'; //the set will store post ids\n \n //initialize redis connection\n $redis = Yii::$app->redis;\n \n $redis->srem($redisKeyForLikes, $user->id);\n $redis->srem($redisKeyForUserLikedPosts, $this->id);\n \n return true;\n }",
"function userLikedThisPost1($post_id = '') {\n //getting the user that like post\n $result = query(\"SELECT * FROM likes WHERE user_id=\" . loggedInUserId() .\" AND post_id={$post_id}\");\n confirmQuery($result);\n //using the tertiary operator instead of if\n // means if mysqli_num_rows($result) is greater than one return true if not return false\n return mysqli_num_rows($result) >= 1 ? true : false;\n}",
"function userLikes($interest) {\n global $PAGE;\n\tif(in_array($interest, $PAGE['chosen_interests'])) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}",
"public function liked()\n {\n\t\t$user = $this->uri->segment(2, 0);;\n }",
"public function _getSkip()\n {\n if (isset($this->m_postvars['atkreturnbehaviour']) && $this->m_postvars['atkreturnbehaviour'] == self::ATK_ACTION_BACK) {\n return 2;\n }\n\n return 1;\n }",
"function statusAfterNonPenalizedPlayerMove($currentPlayer, $currentPlace, $currentCategory) {\n\t}",
"public function dislikesCount()\n\t{\n\t\treturn $this->ratings()->where('value', -1)->count();\n\t}",
"function is_user_like_fangate(){\n\tglobal $gianism;\n\treturn $gianism->fb->is_user_like_me_on_fangate();\n}",
"public function likeCheck($review) {\n return DB::table('review_likes')\n ->where('review_id', $review)\n ->where('user_id', Auth::user()->id)\n ->first();\n }",
"public function testProfilePrototypeCountLikes()\n {\n\n }",
"public static function checkLike($user_id, $post_id){\n $yesterday = Carbon::yesterday();\n $like = Like::where(['user_id' => $user_id, 'post_id' => $post_id])->whereDate('created_at', '>', $yesterday)->first();\n if(!empty($like->id)){\n return true;\n }else{\n return false;\n }\n }",
"public static function update_reward_points_for_facebook_like() {\n $userid = get_current_user_id(); \n $banning_type = FPRewardSystem::check_banning_type($userid);\n if ($banning_type != 'earningonly' && $banning_type != 'both') {\n if (get_option('timezone_string') != '') {\n $timezonedate = date_default_timezone_set(get_option('timezone_string'));\n } else {\n $timezonedate = date_default_timezone_set('UTC');\n }\n\n if (isset($_POST['state']) && ($_POST['postid']) && ($_POST['currentuserid'])) {\n $getregularprice = RSFunctionForSavingMetaValues::rewardsystem_get_post_meta($_POST['postid'], '_regular_price');\n $postid = $_POST['postid'];\n $currentuserid = $_POST['currentuserid']; \n $getarrayids[] = $_POST['postid'];\n $oldoption = RSFunctionForSavingMetaValues::rewardsystem_get_user_meta($_POST['currentuserid'], '_rsfacebooklikes');\n if (!empty($oldoption)) {\n if (!in_array($_POST['postid'], $oldoption)) {\n $mergedata = array_merge((array) $oldoption, $getarrayids);\n RSFunctionForSavingMetaValues::rewardsystem_update_user_meta($_POST['currentuserid'], '_rsfacebooklikes', $mergedata);\n if ($_POST['state'] == 'on') {\n $checklevel = self::checklevel_for_facebook_like($postid);\n $orderid = '0';\n $totalearnedpoints = '0';\n $totalredeempoints = '0';\n $pointsredeemed = '0';\n $reasonindetail = '';\n self::rs_insert_facebook_like_points($pointsredeemed,$getregularprice,$postid, $checklevel,$currentuserid,$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail); \n }\n }else {\n _e('You already liked this post', 'rewardsystem');\n }\n }else {\n update_user_meta($_POST['currentuserid'], '_rsfacebooklikes', $getarrayids);\n if ($_POST['state'] == 'on') {\n $checklevel = self::checklevel_for_facebook_like($postid);\n $orderid = '0';\n $totalearnedpoints = '0';\n $totalredeempoints = '0';\n $pointsredeemed = '0';\n $reasonindetail = '';\n self::rs_insert_facebook_like_points($pointsredeemed,$getregularprice,$postid, $checklevel,$currentuserid,$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail); \n }\n } \n \n if ($_POST['state'] == 'off') {\n $getarrayunlikeids[] = $_POST['postid'];\n $oldunlikeoption = RSFunctionForSavingMetaValues::rewardsystem_get_user_meta($_POST['currentuserid'], '_rsfacebookunlikes');\n if (!empty($oldunlikeoption)) {\n if (!in_array($_POST['postid'], $oldunlikeoption)) {\n $mergedunlikedata = array_merge((array) $oldunlikeoption, $getarrayunlikeids);\n RSFunctionForSavingMetaValues::rewardsystem_update_user_meta($_POST['currentuserid'], '_rsfacebookunlikes', $mergedunlikedata);\n $checklevel = self::checklevel_for_facebook_like($postid);\n $orderid = '0';\n $totalearnedpoints = '0';\n $totalredeempoints = '0';\n $pointsredeemed = '0';\n $reasonindetail = '';\n self::rs_insert_facebook_like_revised_points($pointsredeemed,$getregularprice,$postid, $checklevel,$currentuserid,$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n }\n } else {\n RSFunctionForSavingMetaValues::rewardsystem_update_user_meta($_POST['currentuserid'], '_rsfacebookunlikes', $getarrayunlikeids);\n $checklevel = self::checklevel_for_facebook_like($postid);\n $orderid = '0';\n $totalearnedpoints = '0';\n $totalredeempoints = '0';\n $pointsredeemed = '0';\n $reasonindetail = '';\n self::rs_insert_facebook_like_revised_points($pointsredeemed,$getregularprice,$postid, $checklevel,$currentuserid,$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n }\n }\n \n echo \"Ajax Call Successfully Triggered\"; \n }\n do_action('fp_reward_point_for_facebook_like');\n exit();\n }\n }",
"function _reconfirm_cheat_code()\n\t{\n\t\t//If discount is applied, do a conditional-check again\n\t\tif($this->cart->is_discount_applied())\n\t\t{\n\t\t\t$coupon = $this->cart->discount_info();\n\t\t\tif($this->_can_apply_code($coupon) == false)\n\t\t\t{\n\t\t\t\t$this->cart->remove_discount();\n\t\t\t}\n\t\t}\n\t}",
"public function likeComment($commentId, $postId, $userId, $dbSrc)\n {\n\n $dbLike = $dbSrc == DB_COMMENTS_NEWS ? DB_COMMENTS_NEWS_LIKES : DB_COMMENTS_IMG_LIKES;\n\n $db = Database::getBdd();\n\n $sql = \"SELECT 1 FROM \". $dbLike . \" WHERE commentId = :commentId AND userId = :userId\";\n $req = $db->prepare($sql);\n $req->bindValue(':commentId', $commentId, PDO::PARAM_INT);\n $req->bindValue(':userId', $userId, PDO::PARAM_INT);\n $req->execute();\n $exist = (bool) $req->fetch();\n\n if (!$exist) \n { \n $sql = \"INSERT INTO \" . $dbLike . \" \n (commentId, postId, userId)\n VALUES\n (:commentId, :postId, :userId)\";\n \n $req = $db->prepare($sql);\n $req->bindValue(':commentId', $commentId, PDO::PARAM_INT);\n $req->bindValue(':postId', $postId, PDO::PARAM_INT); \n $req->bindValue(':userId', $userId, PDO::PARAM_INT); \n $req->execute();\n\n if ($req->rowCount() > 0) {\n $sql = \"UPDATE \" . $dbSrc . \" SET likes = likes + 1 WHERE id = :commentId\";\n $req = $db->prepare($sql);\n $req->bindValue(':commentId', $commentId, PDO::PARAM_INT);\n $req->execute();\n } \n } \n else\n { // Already exists -> dislike by deleting the row\n $sql = \"DELETE FROM \" . $dbLike . \" WHERE userId = :userId\";\n $req = $db->prepare($sql);\n $req->bindValue(':userId', $userId, PDO::PARAM_INT);\n $req->execute();\n\n if ($req->rowCount() > 0) {\n $sql = \"UPDATE \" . $dbSrc . \" SET likes = likes - 1 WHERE id = :commentId\";\n $req = $db->prepare($sql);\n $req->bindValue(':commentId', $commentId, PDO::PARAM_INT);\n $req->execute();\n } \n }\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 dealCardToDealer();",
"public function likeDado($id_obra){\n\t\t//$expo = Evento::buscaEvento($nombre_expo,'Expo');\n\t\t//$id_expo = $expo->id();\n\t\t$app = Aplicacion::getInstance();\n $conn = $app->conexionBd();\n\t\t$query = sprintf(\"SELECT * FROM Likes WHERE id_obra=%d AND id_usuario=%d\", $id_obra ,$this->id);\n $rs = $conn->query($query);\n $result = false;\n if ($rs) {\n\t\t\t$result = $rs->num_rows;\n \n $rs->free();\n } else {\n echo \"Error al consultar en la BD: (\" . $conn->errno . \") \" . utf8_encode($conn->error);\n exit();\n }\n\t\tif($result==0){\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}",
"public function askForCard()\n {\n }",
"function ts_save_post_like_func()\r\n{\r\n\tif (!isset($_GET['post_id']) || empty($_GET['post_id']))\r\n\t{\r\n\t\tdie(); //die on wrong get parameter\r\n\t}\r\n\t$post_id = $_GET['post_id'];\r\n\t$likes = intval(get_post_meta($post_id,'theme_like',true));\r\n\t\r\n\t//don't add new like if cookie exists\r\n\tif (isset($_COOKIE['saved_post_like_'.$post_id]) && $_COOKIE['saved_post_like_'.$post_id] == 1)\r\n\t{\r\n\t\techo $likes;\r\n\t\tdie(); \r\n\t}\r\n\t$likes++;\r\n\tsetcookie('saved_post_like_'.$post_id,1,time()+60*60*24*30,'/');\r\n\tupdate_post_meta($post_id, 'theme_like',$likes);\r\n\techo $likes;\r\n\tdie();\r\n}",
"function prev() { \n\n\t\tif ($this->XBMCCmd(\"PlayPrev\")!=\"OK\") { return false; }\n return true;\n\t\n\t}",
"public function unlike() {\n if (isset($_GET['post_id'])) {\n $post_id = $_GET['post_id'];\n Post::unlike($_GET['post_id']);\n }\n// redirect to gallery\n call('posts', 'index');\n }",
"public function testProfilePrototypeDeleteLikes()\n {\n\n }",
"function hkr_skip_featured_post() {\n global $post, $_hkr_displayed_ids;\n\n if ( in_array($post->ID, $_hkr_displayed_ids) ) {\n the_post(); // advance to the next post\n }\n}",
"public function ignore()\n {\n ++$this->ignored;\n }",
"public function like() {\n\n $review = Input::get('review');\n $check = $this->likeCheck($review);\n\n if (!$check) {\n if (!$review == \"\") {\n // inserting the review like\n DB::table('review_likes')->insert(\n array(\n 'review_id' => $review,\n 'user_id' => Auth::user()->id\n )\n );\n $user = DB::table('film_review')->where('fr_id', $review)->first();\n // creating a notification\n $noti = new Notification; // notification instance\n $noti->user_id = $user->fr_usr_id; // the user who will get this notification\n $noti->subject_type = 'user'; // user\n $noti->subject_id = Auth::user()->id; // the uset who liked the review\n $noti->object_type = 'review'; // object is review \n $noti->object_id = $review; // id of the review in picture\n $noti->type = 'liked'; // liked - notification type\n $noti->read = '0'; // default '0' as it is unread\n $noti->time = time(); // default '0' as it is unread\n $noti->save(); // saves notification\n\n $mail = $this->newLikeMail($user->fr_usr_id, $user->fr_fl_id, $user);\n }\n }\n }",
"public function testProfilePrototypeCreateLikes()\n {\n\n }",
"function ignore_media_credit_shortcode($atts, $content = null)\r\n{\r\n return $content;\r\n}",
"function wp_blacklist_check($author, $email, $url, $comment, $user_ip, $user_agent)\n {\n }",
"public static function update_reward_points_for_vk_like() {\n $userid = get_current_user_id();\n global $wpdb;\n $table_name = $wpdb->prefix . 'rspointexpiry'; \n $banning_type = FPRewardSystem::check_banning_type($userid);\n if ($banning_type != 'earningonly' && $banning_type != 'both') {\n if (get_option('timezone_string') != '') {\n $timezonedate = date_default_timezone_set(get_option('timezone_string'));\n } else {\n $timezonedate = date_default_timezone_set('UTC');\n }\n\n if (isset($_POST['state']) && ($_POST['postid']) && ($_POST['currentuserid'])) {\n $getregularprice = RSFunctionForSavingMetaValues::rewardsystem_get_post_meta($_POST['postid'], '_regular_price');\n $postid = $_POST['postid'];\n $currentuserid = $_POST['currentuserid']; \n $getarrayids[] = $_POST['postid'];\n $oldoption = RSFunctionForSavingMetaValues::rewardsystem_get_user_meta($_POST['currentuserid'], '_rsvklike');\n if (!empty($oldoption)) {\n if (!in_array($_POST['postid'], $oldoption)) {\n $mergedata = array_merge((array) $oldoption, $getarrayids);\n RSFunctionForSavingMetaValues::rewardsystem_update_user_meta($_POST['currentuserid'], '_rsvklike', $mergedata);\n if ($_POST['state'] == 'on') {\n $checklevel = self::checklevel_for_vk_like($postid);\n $orderid = '0';\n $totalearnedpoints = '0';\n $totalredeempoints = '0';\n $reasonindetail = '';\n $pointsredeemed= '0';\n self::rs_insert_vk_like_points($pointsredeemed,$getregularprice,$postid,$orderid, $checklevel,$currentuserid,$totalearnedpoints,$totalredeempoints,$reasonindetail); \n }\n }else {\n _e(\"You have already liked this post on VK.Com\",'rewardsystem');\n }\n }else {\n RSFunctionForSavingMetaValues::rewardsystem_update_user_meta($_POST['currentuserid'], '_rsvklike', $getarrayids);\n if ($_POST['state'] == 'on') {\n $checklevel = self::checklevel_for_vk_like($postid);\n $orderid = '0';\n $totalearnedpoints = '0';\n $totalredeempoints = '0';\n $pointsredeemed= '0';\n $reasonindetail = '';\n self::rs_insert_vk_like_points($pointsredeemed,$getregularprice,$postid, $checklevel,$currentuserid,$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail); \n }\n }\n \n if ($_POST['state'] == 'off') {\n $getarrayunlikeids[] = $_POST['postid'];\n $oldunlikeoption = RSFunctionForSavingMetaValues::rewardsystem_get_user_meta($_POST['currentuserid'], '_rsvkunlikes');\n if (!empty($oldunlikeoption)) {\n if (!in_array($_POST['postid'], $oldunlikeoption)) {\n $mergedunlikedata = array_merge((array) $oldunlikeoption, $getarrayunlikeids);\n RSFunctionForSavingMetaValues::rewardsystem_update_user_meta($_POST['currentuserid'], '_rsvkunlikes', $mergedunlikedata);\n $checklevel = self::checklevel_for_vk_like($postid);\n $orderid = '0';\n $totalearnedpoints = '0';\n $totalredeempoints = '0';\n $reasonindetail = '';\n $pointsredeemed= '0';\n self::rs_insert_vk_like_revised_points($pointsredeemed,$getregularprice,$postid,$orderid, $checklevel,$currentuserid,$totalearnedpoints,$totalredeempoints,$reasonindetail); \n }\n } else {\n RSFunctionForSavingMetaValues::rewardsystem_update_user_meta($_POST['currentuserid'], '_rsvkunlikes', $getarrayunlikeids);\n $checklevel = self::checklevel_for_vk_like($postid);\n $orderid = '0';\n $totalearnedpoints = '0';\n $totalredeempoints = '0';\n $reasonindetail = '';\n $pointsredeemed= '0';\n self::rs_insert_vk_like_revised_points($pointsredeemed,$getregularprice,$postid,$orderid, $checklevel,$currentuserid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n }\n }\n echo \"Ajax Call Successfully Triggered\"; \n }\n do_action('fp_reward_point_for_vk_like');\n exit();\n }\n }",
"public function like()\n {\n self::post(\"/photos/{$this->id}/like\");\n return true;\n }",
"public function like()\n {\n $this->likes += 1;\n $this->save();\n }",
"public function do_not_track()\n\t{\n\t\tstatic $shifted;\n\t\tif ($shifted !== TRUE)\n\t\t{\n\t\t\tarray_shift($this->tracker);\n\t\t\t$shifted = TRUE;\n\t\t}\n\t\t$this->set_tracker_cookie();\n\t}",
"public function like_or_dislike_odgovor() {\n // Ako nije pristupljeno funkciji klikom na dugme,\n // nego preko URL-a, vrati ga nazad\n if (!$this->request->isAJAX()) {\n return redirect()->back();\n }\n\n // Parametri iz sessiona i requesta\n $idKorisnik = $this->session->get('userid');\n $idOdgovor = $this->request->getPost('id');\n $isLike = $this->request->getPost('isLike');\n\n // Ako nisu prisutni, zahtev je loš, vrati grešku 400\n if (!$idKorisnik || !$idOdgovor || $isLike == null) {\n return $this->responseWithIspis(400,\n \"Parametar nije prisutan (idKorisnik = $idKorisnik; idSeansa = $idOdgovor, isLike = $isLike)\",\n 'Loše poslat zahtev, molimo probajte ponovo.<br/>Ako se ovaj problem desi više puta, molimo kontaktirajte administratora sajta.');\n }\n\n $isLike = $isLike == \"1\" ? true : false;\n\n $korisnikOcenioOdgovorModel = new KorisnikOcenioOdgovorModel();\n\n $postojecaOcena = $korisnikOcenioOdgovorModel->findOcena($idKorisnik, $idOdgovor);\n\n // Ako ne postoji ocena, onda daj novu ocenu\n if (!$postojecaOcena) {\n $novaOcena = [\n 'ocena' => $isLike,\n 'odgovor_idOdgovor' => $idOdgovor,\n 'korisnik_idKorisnik' => $idKorisnik\n ];\n $korisnikOcenioOdgovorModel->insert($novaOcena);\n\n return $this->responseWithIspis(210,\n \"Uspešna nova ocena!\",\n 'Uspešna nova ocena!');\n }\n // A ako postoji, onda je samo updatuj da matchuje novu\n else {\n if ($postojecaOcena->ocena == $isLike) {\n return $this->responseWithIspis(212,\n \"Već je data ista ocena.\",\n 'Već je data ista ocena.');\n }\n\n $postojecaOcena->ocena = $isLike;\n $korisnikOcenioOdgovorModel->save($postojecaOcena);\n\n return $this->responseWithIspis(211,\n \"Uspešna izmena ocene!\",\n 'Uspešna izmena ocene!');\n }\n }",
"function wpcom_vip_disable_sharing() {\n\t// Post Flair sets things up on init so we need to call on that if init hasn't fired yet.\n\t_wpcom_vip_call_on_hook_or_execute( function() {\n\t\tremove_filter( 'post_flair', 'sharing_display', 20 );\n\t\tremove_filter( 'the_content', 'sharing_display', 19 );\n \t\tremove_filter( 'the_excerpt', 'sharing_display', 19 );\n\n\t\twpcom_vip_disable_sharing_resources();\n\t}, 'init', 99 );\n}",
"function getPostLikeLink( $post_id, $btn_info = true ) {\n\n\t$like_count = get_post_meta( $post_id, \"_post_like_count\", true ); // get post likes\n\t$count = ( empty( $like_count ) || $like_count == \"0\" ) ? '0' : esc_attr( $like_count );\n\tif ( AlreadyLiked( $post_id ) ) {\n\t\t$class = esc_attr( ' liked' );\n\t\t$title = esc_attr( 'Unlike' );\n\t\t$heart = '<i class=\"fa fa-heart\"></i>';\n\t} else {\n\t\t$class = esc_attr( '' );\n\t\t$title = esc_attr( 'Like' );\n\t\t$heart = '<i class=\"fa fa-heart-o\"></i>';\n\t}\n\tif ( $btn_info ) {\n\t\t$count = '<span class=\"btn-info\">'.$count.'</span>';\n\t}\n\t$output = '<a href=\"#\" class=\"infinity-post-like'.$class.'\" data-post_id=\"'.$post_id.'\" title=\"'.esc_attr( $title ).'\">'.$heart.$count.'</a>';\n\treturn $output;\n}"
] | [
"0.5837771",
"0.58122045",
"0.55468416",
"0.5442333",
"0.54384893",
"0.54378736",
"0.5411125",
"0.5396633",
"0.5391006",
"0.53606445",
"0.535624",
"0.5346532",
"0.53181684",
"0.52923733",
"0.52758634",
"0.52693754",
"0.52231586",
"0.521481",
"0.51983273",
"0.5198026",
"0.51973224",
"0.5178066",
"0.5161249",
"0.51505274",
"0.509684",
"0.5092291",
"0.50799114",
"0.5074108",
"0.50698936",
"0.5041351",
"0.5039732",
"0.50183505",
"0.501665",
"0.5012422",
"0.50064343",
"0.50059885",
"0.4995259",
"0.49887127",
"0.49806142",
"0.49781188",
"0.49666443",
"0.49515837",
"0.49485728",
"0.49477553",
"0.49391273",
"0.49379462",
"0.49365088",
"0.49258465",
"0.49199158",
"0.49110812",
"0.4910206",
"0.49089652",
"0.49042562",
"0.48990634",
"0.48985314",
"0.4897927",
"0.48928744",
"0.48835656",
"0.48776665",
"0.4862767",
"0.48435587",
"0.48424608",
"0.48387545",
"0.48369318",
"0.48306432",
"0.4822388",
"0.48116764",
"0.48047867",
"0.48035595",
"0.48007098",
"0.48005432",
"0.47971153",
"0.4796034",
"0.4794924",
"0.47947976",
"0.4784801",
"0.47835654",
"0.4781014",
"0.47803238",
"0.47763687",
"0.4771995",
"0.47695127",
"0.47647935",
"0.47587356",
"0.4758536",
"0.47557917",
"0.47546273",
"0.474697",
"0.47458905",
"0.47424588",
"0.4740513",
"0.47373205",
"0.47338954",
"0.47278726",
"0.47239038",
"0.47134992",
"0.4713132",
"0.47098327",
"0.4708332",
"0.470118",
"0.47007826"
] | 0.0 | -1 |
Handle dynamic static method calls into the method. | public function __call($method, $parameters)
{
$user_generate_method = [
'getGenerateEmail',
'getGeneratePassword',
'getGenerateUserName',
'getUserHeaderImg',
'getUserName',
'setUserName',
'getIntegrateUser',
'getConnectPlugin',
'getPluginProfile',
];
// Check for scope method and call
if (in_array($method, $user_generate_method)) {
if (is_null(self::$userGenerateInstance)) {
self::$userGenerateInstance = new UserGenerate($this);
}
return call_user_func_array([self::$userGenerateInstance, $method], $parameters);
}
return parent::__call($method, $parameters);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function __callStatic($method, $parameters);",
"public static function __callStatic($method, $arguments=null) {}",
"protected static function __callStaticHook($method, array & $arguments)\n { }",
"public static function __callStatic($method, $args){ return null; }",
"final public static function __callStatic( $chrMethod, $arrArguments ) {\n\t\t\t\n\t\t$objInstance = self::getInstance();\n\t\t\n\t\tif($chrMethod == 'prepare'){\n\t\t\tself::$intQueryCount++;\n\t\t}\n\t\t\n\t\treturn call_user_func_array(array($objInstance, $chrMethod), $arrArguments);\n\t\t\n\t}",
"public function processApi(){\r\n\t\t\t$service = explode(\"/\", $_GET['x']);\r\n\t\t\t$this->entity = ucfirst($service[0]);\r\n\t\t\t$this->methode = $service[1];\r\n\t\t\t$func = $this->methode.$this->entity;\r\n\t\t\t$this->addLog('--'.$this->methode.$this->entity);\r\n\t\t\tif((int)method_exists($this,$func) > 0)\r\n\t\t\t\t$this->$func();\r\n\t\t\telse\r\n\t\t\t\t$this->response('',404); // If the method not exist with in this class \"Page not found\".\r\n\t\t\t\t\r\n\t\t}",
"public static function __callStatic($method, $argv) {\n $class = get_called_class();\n\n // If the method exists, return\n if (method_exists($class, $method)) {\n return;\n }\n\n // Check if the method exists\n if (!method_exists(\"Model\", $method)) {\n throw new Exception(\"Static method $class::$method does not exist\", 1);\n\n return;\n }\n\n $model = new Model($class, MODEL::STATIC_CALL);\n\n\n // call the method from the FlowingQuery and return the output\n return call_user_func_array([$model, $method], $argv);\n\n }",
"public function processApi() {\n\n $func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['rquest'])));\n\n if ((int) method_exists($this, $func) > 0) {\n $this->$func();\n } else {\n $this->response('Method not Found', 404); // If the method not exist with in this class, response would be \"Page not found\".*/\n\t}\n\n }",
"public static function __callStatic($_func,array $_args) {\n\t\tF3::$global['CONTEXT']=__CLASS__.'::'.$_func;\n\t\ttrigger_error(F3::TEXT_Method);\n\t}",
"public static function __callStatic($_func,array $_args) {\n\t\tF3::$global['CONTEXT']=__CLASS__.'::'.$_func;\n\t\ttrigger_error(F3::TEXT_Method);\n\t}",
"public static function __callStatic($_func,array $_args) {\n\t\tF3::$global['CONTEXT']=__CLASS__.'::'.$_func;\n\t\ttrigger_error(F3::TEXT_Method);\n\t}",
"final public static function __callStatic($chrMethod, $arrArguments)\n\t{\n\t\t$objInstance = self::getInstance();\n\n\t\treturn call_user_func_array(array($objInstance, $chrMethod), $arrArguments);\n\n\t}",
"public function processApi() {\n $func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['request'])));\n if ((int) method_exists($this, $func) > 0)\n $this->$func();\n else\n $this->response('', 404); // If the method not exist with in this class, response would be \"Page not found\".\n }",
"static public function __callStatic($name, $arguments) {}",
"public static function __callStatic($method, $args) {\n if(substr($method, 0, 5) === \"link_\") {\n return self::link(substr($method, 5), $args);\n } else if(substr($method, 0, 9) === \"redirect_\") {\n return self::redirect(substr($method, 9), $args);\n } else {\n throw new BadMethodCallException(\"no such method '$method'\");\n }\n }",
"function __call($method ,$params)\n {\n return self::handleCall($method ,$params);\n }",
"public function processApi(){\n\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['x'])));\n\tif((int)method_exists($this,$func) > 0)\n\t\t$this->$func();\n\telse\n\t\t$this->response('',404); // If the method not exist with in this class \"Page not found\".\n}",
"public function processApi(){\n\t\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['value'])));\n\t\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t\t$this->$func();\n\t\t\telse\n\t\t\t\t$this->response('',404);\t\t\t\t// If the method not exist with in this class, response would be \"Page not found\".\n\t\t}",
"public function processApi(){\n\t\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['x'])));\n//echo $func;\t\n\t\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t\t$this->$func();\n\t\t\telse\n\t\t\t\t$this->response('',404); // If the method not exist with in this class \"Page not found\".\n\t\t}",
"public static function invoke() {\n\t\tswitch ($_SERVER['REQUEST_METHOD']) {\n\t\t\tcase 'POST': \n\t\t\t\tstatic::post();\n\t\t\t\tbreak;\n\t\t\tcase 'PUT':\n\t\t\t\tstatic::put();\n\t\t\t\tbreak;\n\t\t\tcase 'DELETE':\n\t\t\t\tstatic::delete();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstatic::get();\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public function processApi(){\n\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['rquest'])));\n\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t$this->$func();\n\t\telse\n\t\t\t$this->response('',404);\t// If the method not exist with in this class, response would be \"Page not found\".\n\t}",
"public function processApi(){\n\t\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['x'])));\n\t\t\tif((int)method_exists($this,$func) > 0) {\n $this->$func();\n }\n\t\t\telse {\n $this->response('',404); // If the method not exist with in this class \"Page not found\". \n }\n\t\t\t\t\n\t\t}",
"abstract public function processMethod (ReflectionMethod $met, $className);",
"public function processApi() {\n if (isset($_REQUEST['x']) && $_REQUEST['x'] != \"\") {\n $func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['x'])));\n if ((int)method_exists($this, $func) > 0) {\n $this->$func();\n } else {\n echo 'method not exist';\n exit;\n }\n } else {\n echo 'method not exist';\n exit;\n }\n }",
"public function getMethod() {}",
"public function getMethod() {}",
"public function getMethod() {}",
"public function getMethod() {}",
"public function processApi() {\n\t\t$func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['rquest'])));\n\t\tif ((int) method_exists($this, $func) > 0)\n\t\t\t$this -> $func();\n\t\telse\n\t\t\t$this -> response('', 404);\n\t\t// If the method not exist with in this class, response would be \"Page not found\".\n\t}",
"public function processApi() {\n\t\t$func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['rquest'])));\n\t\tif ((int) method_exists($this, $func) > 0)\n\t\t\t$this -> $func();\n\t\telse\n\t\t\t$this -> response('', 404);\n\t\t// If the method not exist with in this class, response would be \"Page not found\".\n\t}",
"public function processApi(){\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['rquest'])));\n if((int)method_exists($this,$func) > 0)\n $this->$func();\n else\n $this->response('',404);\t\t\t\t// If the method not exist with in this class, response would be \"Page not found\".\n }",
"public function processApi(){\n\t\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['rquest'])));\n\t\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t\t$this->$func();\n\t\t\telse\n\t\t\t\t$this->response('',404);\t\t\t\t// If the method not exist with in this class, response would be \"Page not found\".\n\t\t}",
"public function processApi()\n {\n\n $func = strtolower(trim(str_replace(\"/\", \"\", $_REQUEST['x'])));\n if ((int) method_exists($this, $func) > 0) {\n $this->$func();\n }\n else {\n $this->response('', 404);\n }\n }",
"protected function _invokeStaticMethod($class, $method, $args) {\n\t\t\n\t\tswitch(count($args)) :\n\t\t\tcase 0 :\n\t\t\t\treturn $class::$method();\n\t\t\t\tbreak;\n\t\t\tcase 1 :\n\t\t\t\treturn $class::$method($args[0]);\n\t\t\t\tbreak;\n\t\t\tcase 2 :\n\t\t\t\treturn $class::$method($args[0], $args[1]);\n\t\t\t\tbreak;\n\t\t\tcase 3 :\n\t\t\t\treturn $class::$method($args[0], $args[1], $args[2]);\n\t\t\t\tbreak;\n\t\t\tcase 4 :\n\t\t\t\treturn $class::$method($args[0], $args[1], $args[2], $args[3]);\n\t\t\t\tbreak;\n\t\t\tcase 5 :\n\t\t\t\treturn $class::$method($args[0], $args[1], $args[2], $args[3], $args[4]);\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\treturn call_user_func_array(array(\n\t\t\t\t\t$class,\n\t\t\t\t\t$method\n\t\t\t\t), $args);\n\t\t\t\tbreak;\n\t\tendswitch;\n\n\t}",
"public static function __callStatic($method, $params) {\n\t\tswitch ($method) {\n\t\t\tcase 'authenticate':\n\t\t\tcase 'ping':\n\t\t\tcase 'send':\n\t\t\tcase 'query':\n\t\t\tcase 'startbatch':\n\t\t\tcase 'senditem':\n\t\t\tcase 'quicksend':\n\t\t\tcase 'endbatch':\n\t\t\tcase 'send_bulk':\n\t\t\t\t$self = static::_object();\n\t\t\t\t$conn = $self::connection();\n\t\t\t\treturn $conn->invokeMethod($method, $params); // forward\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn parent::__callStatic($method, $params); // ignore\n\t}",
"public static function __callStatic($methodName, $args)\n {\n $methodName = \\ltrim($methodName, '_');\n if (!self::$instance) {\n if ($methodName == 'setCfg') {\n /*\n Treat as a special case\n Want to initialize with the passed config vs initialize, then setCfg\n ie _setCfg(array('outputAs'=>'html')) via command line\n we don't want to first initialize with default STDERR output\n */\n $cfg = \\is_array($args[0])\n ? $args[0]\n : array($args[0] => $args[1]);\n new static($cfg);\n return;\n } else {\n new static();\n }\n }\n /*\n Add 'statically' meta arg\n Not all methods expect meta args... so make sure it comes after expected args\n */\n $defaultArgs = self::getMethodDefaultArgs($methodName);\n $args = \\array_replace($defaultArgs, $args);\n $args[] = self::meta('statically');\n return \\call_user_func_array(array(self::$instance, $methodName), $args);\n }",
"public static function __callStatic($method, $params) {\n\t\tarray_unshift($params, $method);\n\t\treturn self::invokeMethod('access', $params);\n\t}",
"public function callReflectHandler($msg) {\n \n // Check on valid params\n if (0 == strlen($msg->getMethod())) {\n throw new IllegalArgumentException('No method name passed.');\n }\n\n // Create message from request data\n $class= XPClass::forName($this->package.'.'.ucfirst($msg->getHandlerClass()).'Handler');\n\n // Check if method can be handled\n if (!$class->hasMethod($msg->getMethod())) {\n throw new IllegalArgumentException(\n $class->getName().' cannot handle method '.$msg->getMethod()\n );\n }\n\n with ($method= $class->getMethod($msg->getMethod())); {\n\n // Check if this method is a webmethod\n if (!$method->hasAnnotation('webmethod')) {\n throw new IllegalAccessException('Cannot access non-web method '.$msg->getMethod());\n }\n \n // Create instance and invoke method\n $inst= $class->newInstance();\n if ($this->cat && is('util.log.Traceable', $inst)) $inst->setTrace($this->cat);\n return $method->invoke($inst, $msg->getData());\n }\n }",
"public function testCallInvokesStaticMethod()\n {\n $method = '\\League\\Container\\Test\\Asset\\BazStatic::baz';\n $expected = 'qux';\n\n $c = new Container;\n $returned = $c->call($method, ['foo' => $expected]);\n $this->assertSame($returned, $expected);\n }",
"public static function __callStatic($method, $params)\n {\n if(!preg_match('/^(find|findOne|count)By(\\w+)$/', $method, $matches))\n {\n throw new \\Exception(\"Call to undefined method {$method}\");\n }\n\n $criteriaKeys = explode('_And_', preg_replace('/([a-z0-9])([A-Z])/', '$1_$2', $matches[2]));\n $criteriaKeys = array_map('strtolower', $criteriaKeys);\n $criteriaValues = array_slice($params, 0, count($criteriaKeys));\n $criteria = array_combine($criteriaKeys, $criteriaValues);\n\n $method = $matches[1];\n return static::$method($criteria);\n }",
"function processMethods( &$method, $key )\r\n{\r\n $method = $method->name;\r\n}",
"public static function __callStatic($method, $args) {\n $instance = static::getInstance();\n\n return call_user_func_array([$instance, $method], $args);\n }",
"static public function dispatch()\n {\n $request = Url::getURI();\n $method = Request::getMethod();\n foreach (self::$routes[$method] as $route)\n {\n preg_match($route['pattern'], $request, $params);\n if (isset($params[0]))\n {\n unset($params[0]);\n $controller = $route['controller'];\n $action = $route['action'];\n $class = new $controller();\n call_user_func_array([$class, $action], $params);\n return;\n }\n }\n }",
"public static function __callStatic($method, $arguments) {\n\t\treturn static::run($method,$arguments);\n\t}",
"public function processApi() {\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['x'])));\n if((int)method_exists($this, $func) > 0)\n $this->$func();\n else\n $this->response('',404);\n }",
"public function GetMethod ();",
"public static function __callStatic($method, $args)\n {\n $instance = static::getInstance();\n\n switch (count($args)) {\n case 0:\n return $instance->$method();\n\n case 1:\n return $instance->$method($args[0]);\n\n case 2:\n return $instance->$method($args[0], $args[1]);\n\n case 3:\n return $instance->$method($args[0], $args[1], $args[2]);\n\n case 4:\n return $instance->$method($args[0], $args[1], $args[2], $args[3]);\n\n default:\n return call_user_func_array([$instance, $method], $args);\n }\n }",
"public static function __callStatic($method, $args)\n {\n // $args: mang chua tat tham so\n // ham nay se tu dong chay khi truy cap vao phuong thuc la static khong ton tai trong class\n echo '<br/>';\n echo \"Ban vua truy cap vao phuong thuc static {$method} khong ton tai trong class\";\n print_r($args);\n echo '<br/>';\n }",
"public static function __callStatic($method, $parameters){\n if (method_exists(__CLASS__, $method)) {\n self::discoverEntity();\n forward_static_call_array(array(__CLASS__,$method),$parameters);\n }\n }",
"public static function __callStatic( $sMethod, $arrParameters )\n\t{\n\t\t$cFactory = static::getFactory();\n\t\treturn call_user_func_array( [ $cFactory, $sMethod ], $arrParameters );\n\t}",
"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 static function __callStatic($method, $args)\n {\n $instance = static::instance()->getInputSanitizer();\n switch (count($args)) {\n case 1:\n return $instance->{$method}($args[0]);\n\n case 2:\n return $instance->{$method}($args[0], $args[1]);\n\n case 3:\n return $instance->{$method}($args[0], $args[1], $args[2]);\n\n default:\n return call_user_func_array([$instance, $method], $args);\n }\n }",
"function getMethod()\r\n {\r\n }",
"public function handle($key,$method,$args){\n\n $instance = $this->with($key);\n\n $args = (!is_array($args)) ? Array() : array_values($args);\n switch (count($args)) {\n case 0:\n return $instance->$method();\n case 1:\n return $instance->$method($args[0]);\n case 2:\n return $instance->$method($args[0], $args[1]);\n case 3:\n return $instance->$method($args[0], $args[1], $args[2]);\n case 4:\n return $instance->$method($args[0], $args[1], $args[2], $args[3]);\n default:\n return call_user_func_array(array($instance, $method), $args);\n }//switch\n\n }",
"abstract protected function getMethodPattern(): string;",
"static function __callstatic($func,array $args) {\n\t\tif (!self::$fw)\n\t\t\tself::$fw=Base::instance();\n\t\treturn call_user_func_array(array(self::$fw,$func),$args);\n\t}",
"public static function __callStatic(x$method, $args)\n {\n if (method_exists(self::getInstance()->auth, $method)) {\n return call_user_func_array([self::getInstance()->auth, $method], $args);\n }\n\n return call_user_func_array([self::getInstance()->requests, $method], $args);\n }",
"public function any(){\n return call_user_func_array($this->fetchStaticClassName() . '::' . __FUNCTION__, func_get_args());\n }",
"public static function __callstatic($method, $params){\n \ttry {\n \t\treturn call_user_func_array(array(self::$Stripe, $method), $params);\n \t} catch (StripeApiException $e) {\n\t error_log($e);\n\t }\n }",
"public function processApi()\n {\n $data = array('404'=>'requested method not available');\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['mode'])));\n if((int)method_exists($this,$func) > 0)\n $this->$func();\n else\n $this->response($this->json($data),'404');\n // If the method not exist with in this class, response would be \"Page not found\".\n }",
"public static function __callstatic($method, $params)\n {\n if ($method == 'group') {\n // Seperate controller name and the method\n $segments = explode('@', $params[0]);\n\n // Instanitate controller\n self::$groupController = new $segments[0]();\n self::$groupMethodName = $segments[1];\n self::$isGroup = true;\n\n // Access route groups\n call_user_func($params[1]);\n\n self::runDispatcher();\n\n self::$groupController = null;\n self::$groupMethodName = null;\n self::$isGroup = false;\n } else {\n // remove leading slash which may cause problems in Linux servers\n $params[0] = trim($params[0], '/');\n $uri = dirname($_SERVER['SCRIPT_NAME']).'/'.$params[0];\n $callback = $params[1];\n array_push(self::$routes, $uri);\n array_push(self::$methods, strtoupper($method));\n array_push(self::$callbacks, $callback);\n self::runDispatcher();\n }\n }",
"public function processApi(){\n\t\tif(isset($_REQUEST['x']) && $_REQUEST['x']!=\"\"){\n\t\t\t$func = strtolower(trim(str_replace(\"/\",\"\", $_REQUEST['x'])));\n\t\t\tif((int)method_exists($this,$func) > 0) {\n\t\t\t\t$this->$func();\n\t\t\t} else {\n\t\t\t\techo 'processApi - method not exist';\n\t\t\t\texit;\n\t\t\t}\n\t\t} else {\n\t\t\techo 'processApi - method not exist';\n\t\t\texit;\n\t\t}\n\t}",
"public static function __callStatic($_func,array $_args) {\n\t\tforeach (explode('|',self::$global['AUTOLOAD']) as $_auto) {\n\t\t\t// Proxy for method in autoload class if found\n\t\t\tforeach (glob($_auto.'*.php') as $_file) {\n\t\t\t\t$_class=strstr(basename($_file),'.php',TRUE);\n\t\t\t\tinclude_once $_file;\n\t\t\t\tif (method_exists($_class,'onLoad'))\n\t\t\t\t\tcall_user_func(array($_class,'onLoad'));\n\t\t\t\tif (method_exists($_class,$_func))\n\t\t\t\t\treturn call_user_func_array(\n\t\t\t\t\t\tarray($_class,$_func),$_args\n\t\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tself::$global['CONTEXT']=__CLASS__.'::'.$_func;\n\t\ttrigger_error(self::TEXT_Method);\n\t\treturn FALSE;\n\t}",
"public static function &__callStatic($path, $args) {\n\t\t\n\t\tlog_this();\n\t\tif (strpos($path, '/') !== false)\n\t\t\terror(\"Calling a path statically not supported\");\n\t\t$key = $path;\n\t\t\n\t\t// TODO let functions turn on/off accessibility in configs via __function = false ?\n\t\tif (method_exists(get_called_class(), $key)) {\n\t\t\t$method = new \\ReflectionMethod(get_called_class(), $key);\n\t\t\tif ($method->isStatic())\n\t\t\t\treturn get_called_class()::$key(...$args);\n\t\t}\n\n\t\t$context = array_shift($args);\n\t\tif (!isset($context))\n\t\t\t$context = \\Root::default(); \n\t\t\t//error('Context not specified');\n\t\tif (!$context instanceof \\Service)\n\t\t\t$context = service($context);\n\t\tif (method_exists(get_called_class(), $key))\n\t\t\treturn $context->$key(...$args);\n\t\treturn ($context->$key)(...$args);\n\t\t// NOTE: let __invoke handle Not Found errors\n\t\t\n\n\t\t// TODO put this somewhere:\n\t\t// \\Some\\Service::$path($context, ...$args); == (service($context)->$path)(...$args);\n\t\t\t// e.g. \\User::login($user, $password) == $user->login($password)\n\t\t\t// e.g. \\Number::add($number1, $number2) == $number1->add($number2)\n\t\t\t// e.g. \\Service::get($resource1, $resource2) == $resource1->get($resource2);\n\t\t// \\Some\\Service::$path(null, ...$args); == (service('\\Some\\Service\\')->$path)(...$args);\n\t\t\t// e.g. \\User::login(null, $password) == $ROOT->user->login($password) HMMMMMMMMM\n\t\t\t// e.g. \\Number::add(null, $number2) == $ROOT->math->add($number2); HMMMMMM\n\t\t\t// e.g. \\Service::get(null, $resource2) == $ROOT->service->get($resource2); HMMMM kinda works here?\n\t\t// OR \\Some\\Service::$path(null, ...$args); == ((new \\Some\\Service())->$path)(...$args);\n\t\t\t// e.g. \\User::login(null, $password) == (new \\User())->login($password) HMMMMMMMMM kinda works\n\t\t\t// e.g. \\Number::add(null, $number2) == (new \\Number())->add($number2); HMMMMMM kinda works\n\t\t\t// e.g. \\Service::get(null, $resource2) == (new \\Service())->get($resource2); DOESNT WORK\n\t\t// ultimately though, each service should probably handle it itself. null might not be the only thing needing screening too:\n\t\t\t// e.g. \\User::login('bob', $password) == service('bob')->login($password) should be service('\\Users\\bob')->login($password)\n\t\t\t// e.g. \\Number::add([1,2,3,4], $number2) == service([1,2,3,4])->add($number2) should instead map add(number2) to each number in config \n\t\t\t// e.g. \\Service::get($resource1, $resource2) == $resource1->get($resource2);\n\t\t// soooo... can't screen these here. each function must make its own $context = service($context) if thats all it wants.\n\t\t\t\n\t}",
"private function _callControllerMethod()\n {\n $length = count($this->_url);\n\n // Make sure the method we are calling exists\n if ($length > 1) {\n if (!method_exists($this->_controller, $this->_url[1])) {\n //! error\n }\n }\n //var_dump($this->_controller);\n // Determine what to load\n switch ($length) {\n /*case 3:\n //Controller->Method(Param1, Param2)\n $this->_controller->{$this->_url[1]}($this->_url[2]);\n break;\n*/\n case 2:\n //Controller->Method(Param1, Param2)\n //$this->_controller->{$this->_url[1]}();\n $this->_controller->index($this->_url[1]);\n break;\n\n default:\n $this->_controller->index();\n break;\n }\n }",
"public static function __callStatic($method, $parameters)\n \t{\n \t\t$model = get_called_class();\n \t\treturn call_user_func_array(array(new $model, $method), $parameters);\n \t}",
"public function get_method();",
"public function processApi()\n {\n $func = strtolower(trim(str_replace(\"/\",\"\",$_REQUEST['mode'])));\n if((int)method_exists($this,$func) > 0)\n {\n $this->$func();\n } \n else\n {\n $data = array('code' => \"404\", 'status' => \"failure\", \"msg\" => \"requested method not available\", \"data\" => array());\n $this->response($this->json($data)); \n }\n \n // If the method not exist with in this class, response would be \"Page not found\".\n }",
"function staticCall($class, $function, $args = array()){\n if (class_exists($class) && method_exists($class, $function))\n return call_user_func_array(array($class, $function), $args);\n return null;\n}",
"public function processApi(){\n\t\t$words = explode(\"/\",$_REQUEST['rquest']);\n\t\t$func = strtolower(trim(str_replace(\"/\",\"\",$words[0])));\n\t\t\n \t\tif(strcmp(\"services\",$func) == 0)\n\t\t\t$this->$func($words[1],$words[2]);\t// you can set as many levels as you want\n\t\telse\n\t\t\t$this->response('',404);\t// response would be \"Page not found\"\n\t}",
"private function _callControllerMethod()\n\t{\n\t\t$length=count($this->_url);\n\t\t//Make sure the method we are calling exists\n\t\tif($length>1){\n\t\t\tif (!method_exists($this->_controller, $this->_url[1])) {\n\t\t\t\t$this->_error();\n\t\t\t}\n\t\t}\t\n\t\t\n\t\t//Determine what to load\n\t\tswitch($length){\n\t\t\tcase 5:\n\t\t\t\t//Controoller->Method(param1,param2,param3)\n\t\t\t\t$this->_controller->{$this->_url[1]}($this->_url[2],$this->_url[3],$this->_url[4]);\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t//Controoller->Method(param1,param2)\n\t\t\t\t$this->_controller->{$this->_url[1]}($this->_url[2],$this->_url[3]);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t//Controoller->Method(param1)\n\t\t\t\t$this->_controller->{$this->_url[1]}($this->_url[2]);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t//Controoller->Method()\n\t\t\t\t$this->_controller->{$this->_url[1]}();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->_controller->index();\n\t\t\t\tbreak;\t\t\t\t\n\t\t\t\n\t\t}\t\t\n\t\t// calling methods\n\t\t\n\t\t\n\t\t\t\n\t}",
"private function static_things()\n\t{\n\n\t\t# code...\n\t}",
"public function getMethod()\n {\n }",
"public function getMethod();",
"public function getMethod();",
"public function getMethod();",
"public function getMethod();",
"public function getMethod();",
"public function getMethod();",
"public function getMethod();",
"protected function handleMethod()\n {\n try {\n parent::$method = new ReflectionMethod(parent::$view->name, Request::$method);\n } catch(Exception $e) {\n self::jump(405);\n }\n }",
"public static function __callStatic($method, $parameters)\n\t{\n\t\treturn \\call_user_func_array(array(static::instance(), $method), $parameters);\n\t}",
"public function __callIntern($methodName);",
"public function callStatic($className, $methodName)\n {\n $parameters = func_get_args();\n $parameters = array_slice($parameters, 2); // Remove $className and $methodName\n\n return call_user_func_array($className . '::' . $methodName, $parameters);\n }",
"#[Pure]\n public function getMethod() {}",
"public function __invoke();",
"public function __invoke();",
"public function __invoke();",
"public function __invoke();",
"protected abstract function internalCall($params, $requestMethod = 'GET');",
"abstract public function __invoke(): void;",
"public function processApi(){\n\t\t\t$func = explode('/', trim($_SERVER['PATH_INFO'],'/'))[0];\n\n\t\t\t$good = false;\n\t\t\tforeach ($this->AUTHORIZED_FUNCTION as $authorizedFunc){\n\t\t\t\tif($authorizedFunc == $func){\n\t\t\t\t\t$good = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(! $good) $this->response('', 404);\n\n\t\t\tif((int)method_exists($this,$func) > 0)\n\t\t\t\t$this->$func();\n\t\t\telse\n\t\t\t\t$this->sendMessage('', 404);\n\t\t}",
"private function callControllerMethod() {\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tif (isset($this->url[1])) {\r\n\t\t\t\tif (method_exists($this->controller, $this->url[1])) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t$parameters = array();\r\n\t\t\t\t\tfor ($i = 2; $i < count($this->url); $i++)\r\n\t\t\t\t\t\tarray_push($parameters, $this->url[$i]);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t$countParam = count($parameters);\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($countParam == 0)\r\n\t\t\t\t\t\t$this->controller->{$this->url[1]}();\r\n\t\t\t\t\telse if ($countParam == 1)\r\n\t\t\t\t\t\t$this->controller->{$this->url[1]}($parameters[0]);\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$this->controller->{$this->url[1]}($parameters);\r\n\t\t\t\t\t\t\r\n\t\t\t\t} else { //Method not found.\r\n\t\t\t\t\t$this->error();\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t} else { //No method is specified.\r\n\t\t\t\t$this->controller->index(); \r\n\t\t\t}\r\n\t\t\t\t\t\r\n\t\t} catch (QueryException $e) {\r\n\t\t\t$this->error($e->getMessage() . \" ( \" . $e->getFile() . \": line \" . $e->getLine() . \")\");\r\n\t\t\t\r\n\t\t} catch (Exception $e) {\r\n\t\t\t$msg = $e->getMessage();\r\n\t\t\tif ($msg == \"\")\r\n\t\t\t\t$msg = \"An error occuring during execution\";\r\n\t\t\t\r\n\t\t\t$this->error($msg . \" ( \" . $e->getFile() . \": line \" . $e->getLine() . \")\");\r\n\t\t}\r\n\t}",
"public static function __callStatic($method, $args)\n {\n if (! isset(static::$extends['ext_'.$method])) {\n return null;\n }\n\n return call_user_func_array(static::$extends['ext_'.$method], $args);\n }",
"private function _callControllerMethod()\r\n {\r\n \r\n \r\n $length = count($this->_url);\r\n if($length > 1)\r\n {\r\n if(!method_exists($this->_controller, $this->_url[1]))\r\n {\r\n $this->_error();\r\n }\r\n }\r\n switch ($length) {\r\n case 5:\r\n //controller->method(param1,param2,param3)\r\n $this->_controller->{$this->_url[1]}($this->_url[2],$this->_url[3],$this->_url[4]);\r\n break;\r\n case 4:\r\n //controller->method(param1,param2)\r\n $this->_controller->{$this->_url[1]}($this->_url[2],$this->_url[3]);\r\n\r\n break;\r\n case 3:\r\n //controller->method(param1)\r\n $this->_controller->{$this->_url[1]}($this->_url[2]);\r\n\r\n break;\r\n case 2:\r\n\r\n //controller->method(param1,param2,param3)\r\n $this->_controller->{$this->_url[1]}();\r\n break;\r\n \r\n default:\r\n $this->_controller->index();\r\n break;\r\n }\r\n\r\n }",
"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 processApi(){\n\t\t\t$piece = explode(\"/\", $_SERVER['REQUEST_URI']); \n\t\t\t$func = end($piece);\n\t\t\tif((int)method_exists($this,$func) > 0){\n\t\t\t\t$con = mysqli_connect(\"localhost\",\"root\",\"\",\"playlist\"); \n\t\t\t\t// Check connection\n\t\t\t\tif (mysqli_connect_errno()){\n\t\t\t\t echo \"Failed to connect to MySQL: \" . mysqli_connect_error();\n\t\t\t\t }\n\t\t\t\t\t\n\t\t\t\t$this->$func($con); \n\t\t\t}else\n\t\t\t\t$this->response('',404);// If the method not exist with in this class, response would be \"Page not found\".\n\t\t}",
"public static function __callStatic($methodName, $arguments){\n\t\t$url = isset($arguments[0]) ? $arguments[0] : '';\n\t\t$body = isset($arguments[1]) ? $arguments[1] : null;\n\t\t$headers = isset($arguments[2]) ? $arguments[2] : [];\n\t\treturn self::send($url, $methodName, $body, $headers);\n\t}",
"public function get_method()\n {\n }",
"public static function __callStatic($method, $args)\n {\n //echo \"<BR>CALL satic $method<BR>\";\n switch ( $method ) {\n\n case \"reset\":\n case \"grant\":\n case \"revoke\":\n case \"login\":\n case \"allowed\":\n case \"flag\":\n case \"unflag\":\n $instance = self::getInstance();\n $_method = \"_$method\";\n return $instance->$_method(...$args);\n break;\n\n case \"build\":\n $builder = $args[0];\n if (isset($args[1])) {\n $object = new \\Reportico\\Engine\\ReporticoCriteria();\n $object->query = new Reportico();\n\n $builder->engine->setProjectEnvironment($builder->engine->initial_project, $builder->engine->projects_folder, $builder->engine->admin_projects_folder);\n $builder->engine->datasource = new ReporticoDataSource($builder->engine->external_connection, $builder->engine->available_connections);\n $builder->engine->datasource->connect();\n $object->criteriaItem = $builder->engine->setCriteriaLookup($args[1], $object->query);\n $object->criteriaItem->datasource = $builder->engine->datasource;\n\n $builder->stepInto(\"criteria\", $object, \"\\Reportico\\Engine\\ReportCriteria\");\n } else {\n trigger_error(\"criteria method requires 1 parameter<BR>\".$this->builderMethodUsage($level, \"criteria\"), E_USER_ERROR);\n }\n $object->builder = $builder;\n return $builder;\n break;\n\n }\n }",
"protected function callActionMethod() {}"
] | [
"0.65930265",
"0.651704",
"0.6474863",
"0.6405543",
"0.6341253",
"0.625352",
"0.6124201",
"0.60933346",
"0.6092328",
"0.6092328",
"0.6092328",
"0.6074769",
"0.60258573",
"0.601157",
"0.60054225",
"0.59978604",
"0.59908247",
"0.59851223",
"0.5966756",
"0.5941926",
"0.5893095",
"0.5882114",
"0.58677465",
"0.5861275",
"0.58429617",
"0.58429617",
"0.58429617",
"0.58429617",
"0.5823759",
"0.5823759",
"0.58174056",
"0.5800269",
"0.57961965",
"0.5792649",
"0.5783321",
"0.57580775",
"0.5742333",
"0.57414275",
"0.5734843",
"0.5734456",
"0.5718051",
"0.57137674",
"0.57122284",
"0.5700808",
"0.5700167",
"0.5693593",
"0.568733",
"0.5684154",
"0.5672699",
"0.567262",
"0.5665483",
"0.56581485",
"0.5655835",
"0.56532925",
"0.5649771",
"0.56479555",
"0.56406057",
"0.56380165",
"0.5636229",
"0.56352043",
"0.5633766",
"0.5614215",
"0.56141067",
"0.561339",
"0.56090796",
"0.5585302",
"0.55846643",
"0.55792934",
"0.55687976",
"0.555869",
"0.5554473",
"0.55511117",
"0.5547896",
"0.5547251",
"0.5547251",
"0.5547251",
"0.5547251",
"0.5547251",
"0.5547251",
"0.5547251",
"0.55472106",
"0.5545476",
"0.5541432",
"0.5534427",
"0.55306035",
"0.55117106",
"0.55117106",
"0.55117106",
"0.55117106",
"0.55020195",
"0.54998934",
"0.54803187",
"0.54780626",
"0.5476988",
"0.54684836",
"0.54427755",
"0.5408028",
"0.54048103",
"0.5402984",
"0.5386389",
"0.5383255"
] | 0.0 | -1 |
Create a new job instance. | public function __construct(AssigneeAddedEvent $event)
{
$this->event = $event;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function createJob( $creationParameters ){ return $this->APICallSub( '/jobs', array( 'create' => $creationParameters ), \"Could not create new job with query \" . $creationParameters['query'] . \" and operation \" . $creationParameters['operation'] ); }",
"abstract public function makeJob();",
"abstract public function makeJob();",
"private function createSearchJob() {\n $response = $this->client->request('POST','search/jobs', [\n 'json' => [\n 'query' => $this->getSumoQuery(),\n 'from' => $this->start->format(DateTime::ATOM),\n 'to' => $this->end->format(DateTime::ATOM),\n 'timeZone' => $this->profile->getTimezone()\n ]\n ]);\n $code = $response->getStatusCode();\n if ($code !== 202) {\n throw new \\Exception('Error getting data from Sumologic, error was HTTP ' . $code . ' - ' . $response->getBody() . '.');\n }\n $data = json_decode($response->getBody());\n $this->jobId = $data->id;\n if ($this->output->isVerbose()) {\n $this->output->writeln(\" > Debug: Search job ID {$this->jobId} created.\");\n }\n }",
"public function createJobObject($payload)\n {\n $job = new Job([\n 'title' => $payload['title'],\n 'name' => $payload['title'],\n 'description' => $payload['description'],\n 'url' => $payload['url'],\n 'location' => $payload['locations'],\n ]);\n\n $job->setCompany($payload['company'])\n ->setDatePostedAsString($payload['date'])\n ->setBaseSalary($payload['salary']);\n\n return $job;\n }",
"public function createJobExecution(JobInstance $job)\n {\n return new JobExecution();\n }",
"public function setJobName(string $jobName): JobInstanceInterface;",
"public function __construct(Job $job)\n {\n $this->job = $job;\n }",
"public static function createJob($project, $jobOptions, $parentJob = null) {\n\n // Check if the job must be CC\n $isCC = ($jobOptions->getProjectJobFileType() && $jobOptions->getProjectJobFileType() == ProjectJobFile::TYPE_CC);\n\n if ($jobOptions->getJobType())\n Subtitle::defineSubtitleExtension($jobOptions->getJobType());\n\n // Get job type service id\n $jobOptionsTypeService = JobTypeService::model()->byJobTypeAndService(\n $jobOptions->getJobType(),\n $jobOptions->getService()\n )->find();\n\n // Set attributes\n $projectJob = new PRMProjectJob();\n $projectJob->source_lang_id = $jobOptions->getSourceLanguage();\n $projectJob->target_lang_id = $jobOptions->getTargetLanguage();\n $projectJob->project_id = $project->id;\n $projectJob->job_type_id = $jobOptions->getJobType();\n $projectJob->job_type_service_id = $jobOptionsTypeService->id;\n $projectJob->subtitle_provided = $jobOptions->isSubtitleProvided() ? 1 : 0;\n $projectJob->status = parent::STATUS_NEW;\n $projectJob->due_date = $jobOptions->getDueDate();\n $projectJob->is_billable = ($jobOptions->getJobType() != JobType::TYPE_ACCEPTANCE) ? 1 : 0;\n $projectJob->is_cc = (int) $isCC;\n $projectJob->forced_subtitle = $jobOptions->getIsForced() ? 1 : 0;\n $projectJob->job_meta_type_id = $jobOptions->getMetaType();\n\n if($projectJob->save(false)) {\n\n $deliverySpecComponent = new DeliverySpecComponent();\n $projectJobPreference = $deliverySpecComponent->copyTerritoriesToJobPreferences($projectJob, $project->delivery_spec_id);\n // Set max_box_lines = 3 for CC jobs\n if($projectJobPreference instanceof ProjectJobPreference && $isCC) {\n $projectJobPreference->max_box_lines = 3;\n $projectJobPreference->save(false);\n }\n\n ProjectBreakdownReport::create(ProjectBreakdownReportActions::TASK_ADDED)\n ->forProjectJob($projectJob)\n ->save();\n\n if ($project->user_id){\n PUserJob::model()->assignJob($project->user_id, $projectJob->id);\n }\n\n ProjectJobParent::link($parentJob ? $parentJob->id : 0, $projectJob->id);\n\n if ($jobOptions->getOutputSupportedFile() instanceof ProjectSupportedFile) {\n $deliverableFile = new ProjectJobDeliverableFiles();\n $deliverableFile->project_job_id = $projectJob->id;\n $deliverableFile->project_supported_file_id = $jobOptions->getOutputSupportedFile()->id;\n $deliverableFile->file_name = $jobOptions->getOutputFileName();\n\n if ($jobOptions->getOutputPositioningType()){\n $deliverableFile->positioning_profile = \"0;{$jobOptions->getOutputPositioningType()};{$jobOptions->getOutputAspect()};{$jobOptions->getOutputAspectRatio()}\";\n }\n\n $deliverableFile->save(false);\n }\n\n // Return job\n return $projectJob;\n }\n\n return false;\n }",
"public function createJobObject($payload)\n {\n $job = new Job;\n\n $map = $this->getJobSetterMap();\n\n array_walk($map, function ($path, $setter) use ($payload, &$job) {\n try {\n $value = static::getValue(explode('.', $path), $payload);\n $job->$setter($value);\n } catch (\\OutOfRangeException $e) {\n // do nothing\n }\n });\n\n return $job;\n }",
"public function create(JobRequest $jobRequest)\n {\n $job = new Job();\n\n $job->business_person = $jobRequest->business_person;\n $job->principal_phone = $jobRequest->principal_phone;\n $job->optional_phone = $jobRequest->optional_phone;\n $job->init_date = $jobRequest->init_date;\n $job->finish_date = $jobRequest->finish_date;\n $job->city = $jobRequest->city;\n\n $job->save();\n\n return compact('job');\n }",
"public function createNewJob($jobBody, $queue)\n {\n $job = new Job($jobBody, $queue);\n\n if ($this->jobHasBeenAddedFromOutside($job)) {\n $this->addMissingJobTimeData($job);\n }\n\n return $job;\n }",
"protected function createJobFromPayload($payload = [])\n {\n return new Job([\n 'title' => $payload['jobTitle'],\n 'name' => $payload['jobTitle'],\n 'description' => $payload['descriptionFragment'],\n 'url' => $payload['jobViewUrl'],\n 'sourceId' => $payload['jobListingId'],\n 'location' => $payload['location'],\n 'industry' => $payload['jobCategory']\n ]);\n }",
"public function created(Job $job)\n {\n //\n }",
"protected function generateJob()\n\t{\n\t\t$name = $this->inflector->getJob();\n\n\t\t$this->call('make:job', compact('name'));\n\t}",
"public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}",
"static public function factory($job, $conn, $handle, $initParams=array())\n {\n if (empty($initParams['path'])) {\n $paths = explode(',', NET_GEARMAN_JOB_PATH);\n $file = null;\n\n foreach ($paths as $path) {\n $tmpFile = $path . '/' . $job . '.php';\n\n if (file_exists(realpath($tmpFile))) {\n $file = $tmpFile;\n break;\n }\n }\n }\n else {\n $file = $initParams['path'];\n }\n\n if ( ! file_exists($file) ) {\n throw new Net_Gearman_Job_Exception('Invalid Job class file: ' . (empty($file) ? '<empty>' : $file));\n }\n\n include_once $file;\n\n if (empty($initParams['class_name'])) {\n $class = NET_GEARMAN_JOB_CLASS_PREFIX . $job;\n }\n else {\n $class = $initParams['class_name'];\n }\n\n if (!class_exists($class)) {\n throw new Net_Gearman_Job_Exception('Invalid Job class: ' . (empty($class) ? '<empty>' : $class) . ' in ' . (empty($file) ? '<empty>' : $file) );\n }\n\n $instance = new $class($conn, $handle, $initParams);\n if (!$instance instanceof Net_Gearman_Job_Common) {\n throw new Net_Gearman_Job_Exception('Job is of invalid type: ' . get_class($instance));\n }\n\n return $instance;\n }",
"public function creating(Job $job)\n {\n $job->setTokenValue();\n $job->setExpiresAtValue();\n $job->is_activated = 1;\n }",
"private function createJob (string $cronTab) : CronJobInterface\n {\n return new class ($cronTab) implements CronJobInterface\n {\n /** @var string */\n private $cronTab;\n\n\n /**\n */\n public function __construct (string $cronTab)\n {\n $this->cronTab = $cronTab;\n }\n\n\n /**\n */\n public function getCronTab () : string\n {\n return $this->cronTab;\n }\n\n\n /**\n */\n public function getName () : string\n {\n return \"My Job\";\n }\n\n\n /**\n */\n public function execute (BufferedSymfonyStyle $io) : CronStatus\n {\n return new CronStatus(true);\n }\n };\n }",
"private function createJob(array $data = [])\n {\n $workflow = fake(WorkflowModel::class);\n $stage = fake(StageModel::class, [\n 'action_id' => 'info',\n 'workflow_id' => $workflow->id,\n 'required' => 1,\n ]);\n fake(StageModel::class, [\n 'action_id' => 'button',\n 'workflow_id' => $workflow->id,\n 'required' => 0,\n ]);\n\n $data = array_merge([\n 'workflow_id' => $workflow->id,\n 'stage_id' => $stage->id,\n ], $data);\n\n return fake(JobModel::class, $data);\n }",
"public function getNewJob() {\n # we can grab a locked job if we own the lock\n $rs = $this->runQuery(\"\n SELECT id\n FROM \" . self::$jobsTable . \"\n WHERE queue = ?\n AND (run_at IS NULL OR NOW() >= run_at)\n AND (locked_at IS NULL OR locked_by = ?)\n AND failed_at IS NULL\n AND attempts < ?\n ORDER BY created_at DESC\n LIMIT 10\n \", array($this->queue, $this->name, $this->max_attempts));\n\n // randomly order the 10 to prevent lock contention among workers\n shuffle($rs);\n\n foreach ($rs as $r) {\n $job = new DJJob($this->name, $r[\"id\"], array(\n \"max_attempts\" => $this->max_attempts,\n \"fail_on_output\" => $this->fail_on_output\n ));\n if ($job->acquireLock()) return $job;\n }\n\n return false;\n }",
"public function store(Request $request): JobResource\n {\n $jobTypes = Factory::listTypes();\n $validValues = $this->validate(\n $request,\n [\n 'sample_code' => ['filled', 'string', 'alpha_dash'],\n 'name' => ['required', 'string'],\n 'type' => ['required', 'string', Rule::in($jobTypes->pluck('id'))],\n 'parameters' => ['filled', 'array'],\n ]\n );\n $parametersValidation = $this->_prepareNestedValidation(\n Factory::validationSpec($validValues['type'], $request)\n );\n $validParameters = $this->validate($request, $parametersValidation);\n $type = $validValues['type'];\n $validParameters = $validParameters['parameters'] ?? [];\n $job = Job::create(\n [\n 'sample_code' => $validValues['sample_code'] ?? null,\n 'name' => $validValues['name'],\n 'job_type' => $type,\n 'status' => Job::READY,\n 'job_parameters' => [],\n 'job_output' => [],\n 'log' => '',\n 'user_id' => \\Auth::guard('api')->id(),\n ]\n );\n $job->setParameters(Arr::dot($validParameters));\n $job->save();\n $job->getJobDirectory();\n\n return new JobResource($job);\n }",
"public function __construct(JobPoster $job)\n {\n $this->job = $job;\n }",
"public function create()\n {\n // Display form to create a new job\n return view('jobs.create');\n }",
"public function __construct(Job $job)\n {\n parent::__construct();\n\n $this->job = $job;\n }",
"protected function getJobInstance(): JobInstance\n {\n if (!isset($this->jobInstance)) {\n $id = $this->argument('instanceId');\n /** @noinspection PhpIncompatibleReturnTypeInspection */\n $this->jobInstance = JobInstance::findOrFail(intval($id));\n }\n\n return $this->jobInstance;\n }",
"public function getInstance()\n {\n if (!is_null($this->instance)) {\n return $this->instance;\n }\n\n if (!class_exists($this->class)) {\n throw new \\RuntimeException('Could not find job class \"'.$this->class.'\"');\n }\n\n if (!method_exists($this->class, $this->method) or !is_callable(array($this->class, $this->method))) {\n throw new \\RuntimeException('Job class \"'.$this->class.'\" does not contain a public \"'.$this->method.'\" method');\n }\n\n $class = new \\ReflectionClass($this->class);\n\n if ($class->isAbstract()) {\n throw new \\RuntimeException('Job class \"'.$this->class.'\" cannot be an abstract class');\n }\n\n $instance = $class->newInstance();\n\n return $this->instance = $instance;\n }",
"static function createJobDescriptorFromInput()\n {\n $obj = b2input()->json();\n $job = new \\scheduler\\JobDescriptor();\n\n $job->group = trim($obj->group) ?: b2config()->scheduler['defaultGroupName'];\n $job->name = $obj->name;\n $job->type = $obj->type;\n $job->description = $obj->description;\n\n if ($obj->data) {\n $job->data = parse_ini_string($obj->data);\n }\n if (empty($job->data)) {\n $job->data = null;\n }\n\n// var_dump($job);\n\n return $job;\n }",
"public function create() {}",
"public function __construct()\n {\n $this->jobService = new JobService();\n }",
"public function create()\n {\n $job=new Job;\n return view('jobs.create',[\n 'job'=>$job,]);\n //\n }",
"public function store(CreateJobFormRequest $request)\n {\n $job = Job::create($request->input());\n\n return response()->json($job, 201);\n\n }",
"public function create()\n {\n return view('admin.job.create');\n }",
"public function createAction(Request $request)\n {\n $entity = new Job();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('job_show', array('id' => $entity->getId())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }",
"public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }",
"public function create(){}",
"public function create(Request $request) {\n $jobPost = new Job();\n $jobPost->user_id = Auth::user()->id;\n\n // Substract one credit from user's subscription\n $userPlans = Auth::user()->plans;\n\n foreach ($userPlans as $plan) {\n if ($plan->credits > 0) {\n $plan->credits = $plan->credits - 1;\n $plan->save();\n }\n }\n\n $jobPostData = $request::input('jobPost');\n foreach ($jobPostData as $key => $value) {\n $jobPost[$key] = $value;\n }\n\n $jobPost->save();\n\n return $jobPost;\n }",
"public function __construct($job)\n {\n $payload = [];\n $this->job = $job;\n $payload['data'] = json_encode($this->job);\n\n $payload['classname'] = $this->job->getNameOfClass();\n $this->payload = $payload;\n\n }",
"public function create()\n {\n return view('profile.job.create');\n }",
"public function create()\n {\n return view('job.add_job');\n }",
"public function store(CreateRequest $request, Job $job)\n {\n $newTask = $request->validated();\n $newTask['job_id'] = $job->id;\n $task = Task::create($newTask);\n\n flash(__('task.created'), 'success');\n\n return redirect()->route('jobs.show', $job);\n }",
"public static function create() {}",
"public static function create() {}",
"public static function create() {}",
"public function create()\n {}",
"public function createTask()\n {\n return factory($this->model)->create();\n }",
"public function newAction()\n {\n $entity = new Job();\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }",
"public function createJob(array $settings, $metaData = [], $priority = 0)\n {\n return $this->client->createJob([\n 'Role' => config('media-converter.iam_arn'),\n 'Settings' => $settings,\n 'Queue' => config('media-converter.queue_arn'),\n 'UserMetadata' => $metaData,\n 'StatusUpdateInterval' => $this->getStatusUpdateInterval(),\n 'Priority' => $priority,\n ]);\n }",
"public function addNewJobOpo()\n {\n }",
"public function insert($projectId, Google_Job $postBody, $optParams = array()) {\n $params = array('projectId' => $projectId, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n $data = $this->__call('insert', array($params));\n if ($this->useObjects()) {\n return new Google_Job($data);\n } else {\n return $data;\n }\n }",
"public function run()\n {\n Job::create([\n \"name\" => \"Wirausaha\"\n ]);\n\n Job::create([\n \"name\" => \"Wiraswasta\"\n ]);\n\n Job::create([\n \"name\" => \"Freelance\"\n ]);\n\n Job::create([\n \"name\" => \"Pelajar\"\n ]);\n }",
"public function create() {\n \n }",
"public function create() {\n \n }",
"public static function createJob($mysqli,$name, $jobdesc, $cust_email, $trade, $area, $jobcost, $jobdate, $estdate){\n $insert = \"INSERT INTO job (job_name,job_desc,cust_email,trade_name,area,preferred_cost,date_needed,offer_end_date) VALUES (?,?,?,?,?,?,?,?)\";\n $stmt = $mysqli->prepare($insert);\n $stmt->bind_param('sssssiss', $name, $jobdesc, $cust_email, $trade, $area, $jobcost, $jobdate, $estdate); \n $stmt->execute();\n $stmt->close();\n $job = new Job(['JobName'],['JobDesc'],['Email'],['Trade'],['Area'],['JobCost'],['JobDate'],['EstDate']);\n return $job;\n }",
"public function store(Request $request)\n {\n $job = new Job();\n $job->title = $request->title;\n $job->description = $request->description;\n $job->company_name = $request->company_name;\n $this->repo->save($job);\n return new JobsResources($job);\n }",
"public function create()\n {\n $fields = Field::all();\n $jobTypes = config('user.job_type');\n\n return view('job.create', [\n 'fields' => $fields,\n 'jobTypes' => $jobTypes,\n ]);\n }",
"public static function create($queue, $class, array $data = null, $run_at = 0)\n {\n $id = static::createId($queue, $class, $data, $run_at);\n\n $job = new static($queue, $id, $class, $data);\n\n if ($run_at > 0) {\n if (!$job->delay($run_at)) {\n return false;\n }\n } elseif (!$job->queue()) {\n return false;\n }\n\n Stats::incr('total', 1);\n Stats::incr('total', 1, Queue::redisKey($queue, 'stats'));\n\n return $job;\n }",
"public function create()\n {\n return $this->objectManager->create($this->className);\n }",
"public function create() {\r\n }",
"public function create()\n {\n //TODO\n }",
"public function submit(Job $job): JobResource\n {\n if (!$job->canBeModified()) {\n abort(400, 'Unable to submit a job that is already submitted.');\n }\n $job->setStatus(Job::QUEUED);\n JobRequest::dispatch($job);\n\n return new JobResource($job);\n }",
"public function __construct(int $status, Job $job)\n {\n $this->status = $status;\n $this->job = $job;\n\n $this->updateTask($this->status, $this->job);\n }",
"public function create()\n {\n return new $this->class;\n }",
"public function create() {\n }",
"public function create() {\n }",
"public function create() {\n\t \n }",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create();",
"public function create()\n {\n return view('admin.jobs.create');\n }",
"public function fake(Generator &$faker): Job\n {\n return new Job([\n 'name' => $faker->catchPhrase,\n 'summary' => $faker->sentence,\n 'workflow_id' => random_int(1, Fabricator::getCount('workflows') ?: 4),\n 'stage_id' => random_int(1, Fabricator::getCount('stages') ?: 99),\n ]);\n }",
"public function run()\n {\n Job::factory()->count(100)->create();\n \n }",
"public function create() {\n\t\t\t//\n\t\t}",
"public function create()\n {\n return view('admin.jobs.create');\n\n }",
"public function create() {\n\n\t\t\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"public function create() {\n\t\t//\n\t}",
"protected function _createJob($type, $job)\n\t{\n\t\treturn strtoupper($type) . ' ' . json_encode($job);\n\t}",
"public function createJobWithSalesPrices(array $inputData): Job;",
"public function create(Job $job)\n {\n $states = $job->prepareStates();\n $countries = $job->prepareCountries();\n $hours = $job->prepareHours();\n $minutes = $job->prepareMinutes();\n $ampm = $job->prepareAmpm();\n $open = $job->prepareOpen();\n return view('companies.create', compact(['states','countries','hours','minutes','ampm','open']));\n }",
"public function create()\n {\n return view('jobs.create');\n }",
"public function create()\n {\n return view('jobs.create');\n }",
"public function create()\n {\n return view('jobs.create');\n }"
] | [
"0.6920272",
"0.6905722",
"0.6905722",
"0.6869542",
"0.6808916",
"0.65271425",
"0.65184414",
"0.64918077",
"0.6489135",
"0.6468623",
"0.6425879",
"0.64058304",
"0.63938236",
"0.63899404",
"0.63753885",
"0.6304669",
"0.6256802",
"0.6241474",
"0.620155",
"0.61789167",
"0.60741454",
"0.60695714",
"0.6047274",
"0.60462874",
"0.6028435",
"0.6027225",
"0.6021894",
"0.60214204",
"0.59231514",
"0.58802027",
"0.5874528",
"0.58576655",
"0.58098435",
"0.5805053",
"0.58005697",
"0.5789109",
"0.57851434",
"0.57767034",
"0.5775661",
"0.5755982",
"0.5702295",
"0.5683395",
"0.5683395",
"0.5683395",
"0.5683376",
"0.5679739",
"0.5678496",
"0.5659406",
"0.56529284",
"0.56470996",
"0.5634536",
"0.5632702",
"0.5632702",
"0.5628215",
"0.5625956",
"0.5621957",
"0.56141514",
"0.56048644",
"0.5604791",
"0.5601149",
"0.5601067",
"0.5599652",
"0.5595376",
"0.55932534",
"0.55932534",
"0.55932015",
"0.55778396",
"0.55778396",
"0.55778396",
"0.55778396",
"0.55778396",
"0.55778396",
"0.55778396",
"0.55778396",
"0.55778396",
"0.55778396",
"0.55778396",
"0.55362236",
"0.5534658",
"0.5531583",
"0.55224913",
"0.5522197",
"0.5517534",
"0.55171794",
"0.55171794",
"0.55171794",
"0.55171794",
"0.55171794",
"0.55171794",
"0.55171794",
"0.55171794",
"0.55171794",
"0.55171794",
"0.55171794",
"0.55171794",
"0.5514842",
"0.549955",
"0.5497938",
"0.54876786",
"0.54876786",
"0.54876786"
] | 0.0 | -1 |
Takes token, validates it | public function validateToken($token)
{
//get user from password_resets table
$user = User::whereNotNull('password_resets.token')
->join('password_resets', 'users.email', '=', 'password_resets.email')->first();
//validate user
if ($this->broker()->tokenExists($user, $token)) {
return response()->json(['isValid' => true, 'token' => $token, 'user' => $user], 200);
}
return response()->json(['code' => 500, 'message' => 'Invalid Token ID', 'error' => []], 500);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function validate($token);",
"public function validate_token($token) {\n\t\t$splittedtoken = explode('-', $token);\n\t\t$offset = hexdec($splittedtoken[0]);\n\t\t$value = $splittedtoken[1];\n\t\treturn ($this->calculate_tokenvalue($offset) === $value);\n\t}",
"public function token_is_valid() {\n $token = $this->ci->input->post(\"token\");\n\n $this->ci->load->helper(\"access\");\n return check_token($token);\n }",
"private function _validate( string $token ): void {\n\t\t\tif ( $token === '' ) {\n\t\t\t\tUtil::error( \"SyntaxError\" );\n\t\t\t}\n\t\t\tif ( strlen( $token ) !== strcspn( $token, \"\\t\\r\\n\\f \" ) ) {\n\t\t\t\tUtil::error( \"InvalidCharacterError\" );\n\t\t\t}\n\t}",
"public function testValidateToken()\n {\n }",
"public function validate ( $token ) { return $this->server->token2uid( $token ) > 0; }",
"function validate_token($token, $procedure, $expiry = 5)\n\t{\n\t\t// parsing passed token, checking proper syntax\n\t\tif (is_array($strings = explode(\"\\n\", $token)))\n\t\t{\n\t\t\t[$token_time, $token_proc] = explode('|', $strings[0]);\n\t\t\t$token_mac = $strings[1];\n\n\t\t\t// something's wrong with the input\n\t\t\tif (!$token_time || !$token_proc || !$token_mac)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// recalculating MAC\n\t\t$new_mac = hash('sha1', $this->engine->db->system_seed . $this->sid . $token_time . $token_proc);\n\n\t\t// validating conditions. exact order is crucial!\n\t\tif ($token_mac !== $new_mac)\n\t\t{\n\t\t\t// MAC mismatch\n\t\t\treturn false;\n\t\t}\n\t\telse if ($token_proc !== $procedure)\n\t\t{\n\t\t\t// procedure mismatch\n\t\t\treturn false;\n\t\t}\n\t\telse if (time() > ($expiry * 60 + $token_time))\n\t\t{\n\t\t\t// token expired\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}",
"function validarToken($token)\n{\n\trequire_once \"api_conf.php\";\n\tif($token == $api_token)\n\t{\n\t\treturn true;\n\t}\n\n\t//cambiar a False en producción\n\treturn true;\n}",
"private function validate_token( $token ) {\n\t\t$order_id = $this->model->get_order_id_from_token( $token );\n\t\tif ( $order_id && md5( $order_id ) === $token ) {\n\t\t\treturn $order_id;\n\t\t}\n\t\treturn false;\n\t}",
"public final function verify($token)\n {\n }",
"public function verify($token):bool;",
"private function validateTokenRequest(): bool\n {\n $validator = new Validator([\n 'required' => ':attribute — обязательное поле.',\n 'numeric' => ':attribute — поле должно содержать только цифры.',\n ]);\n\n $validator->addValidator('plain', new PlainRule());\n\n $validation = $validator->make([\n 'shop_id' => $this->getRouteParam('id'),\n 'secret_key' => $this->http_request->query->get('secret_key'),\n ], [\n 'shop_id' => 'required|numeric',\n 'secret_key' => 'required|plain',\n ]);\n\n $validation->setAliases([\n 'shop_id' => 'Идентификатор магазина',\n 'secret_key' => 'Секретный ключ',\n ]);\n\n $validation->validate();\n\n if ($validation->fails()) {\n $errors = $validation->errors()->toArray();\n\n foreach ($errors as $key => $error) {\n foreach ($error as $message) {\n $this->errors[] = [\n 'code' => 'invalid-field',\n 'message' => $message,\n 'field' => $key,\n ];\n }\n }\n\n return false;\n }\n\n return true;\n }",
"public function validate($token)\n {\n if(!empty($token))\n {\n $decrypted = $this->crypt->decrypt($this->crypt->decryptBase64($token));\n $pieces = explode('|', $decrypted);\n if(count($pieces) === 3)\n {\n $user = Users::findFirstByUsername(strtolower($pieces[0]));\n if(is_object($user))\n {\n $stored_tokens = $user->getTokens(array('order' => 'created desc'));\n $stored_token = (count($stored_tokens) > 0 ? $stored_tokens[0] : null);\n if(!is_null($stored_token))\n {\n $vhash = hash_hmac('sha256', strtolower($user->username) . '|' . $stored_token->created, $this->crypt->decryptBase64($stored_token->secret_key), false);\n $received = trim($pieces[2]);\n if(strlen($vhash) === strlen($received))\n {\n $same = true;\n for($i = 0; $i < strlen($vhash); $i++)\n {\n if($vhash[$i] !== $received[$i])\n {\n $same = false;\n break;\n }\n }\n if($same)\n {\n return $user;\n }\n }\n }\n }\n }\n }\n return false;\n }",
"public function validateToken($token)\n {\n if (isset($_SESSION['MFW_csrf-token']) && $_SESSION['MFW_csrf-token'] == $token) {\n return true;\n }\n\n return false;\n }",
"public function validateToken(string $token): bool {\n $findToken = (new UserTokenModel())->findByToken($token);\n if (!$findToken) {\n return false;\n }\n\n $expirationDate = $findToken->expires_at;\n $dateNow = (new DateTime(\"Now\"))->format(\"Y-m-d H:i:s\");\n\n //checks if token is expired:\n if ($dateNow > $expirationDate) {\n //remove expired token from table:\n $findToken->destroy();\n return false;\n }\n\n return true;\n }",
"private static function validateAction($token){\n if( !isset($token) ) return false;\n //break down the csrf token into parts\n $parts = explode('-', $token);\n if( count($parts) != 3 ) return false;\n list($callback, $token, $hash) = $parts;\n \n $result = (sha1(config::$csrf_form_secret.'-'.$callback.'-'.$token) == $hash);\n if( $result ) $result = $callback;\n return $result;\n }",
"function isTokenValid($token){\n if(!empty($_SESSION['tokens'][$token])){\n unset($_SESSION['tokens'][$token]);\n return true;\n }\n return false;\n}",
"public function CheckValidToken($token=\"\"){\n\t\tif($token){\n\t\t\t try {\n\t\t\t\t $decoded = JWT::decode($token, JWTKEY, array('HS256'));\n\t\t\t\t $aVars=array(\n\t\t\t\t\t\t\"msg\" => \"Access granted.\",\n\t\t\t\t\t\t\"data\" => $decoded->data,\n\t\t\t\t\t\t\"status\" => 1\n\t\t\t\t\t);\n\t\t\t }catch (Exception $e){\n\t\t\t\t$aVars=array(\n\t\t\t\t\t\"msg\" => \"Access denied.\",\n\t\t\t\t\t\"status\" => 0,\n\t\t\t\t\t\"error\" => $e->getMessage()\n\t\t\t\t);\n\t\t\t}\n\t\t}else{\n\t\t\t$aVars=array(\"status\"=>0,\"msg\"=>\"Token Invalid\");\n\t\t}\n\n\t\treturn $aVars;\n\t}",
"public function validateToken($token)\n {\n $token = base64_decode($token);\n $tokenData = $this->encrypter->decrypt($this->secretKey, $token);\n\n if (empty($tokenData['key'])) {\n return false;\n }\n\n return $tokenData['key'];\n }",
"private function tokenExist() {\n if (!$this->webhook->token) {\n // throw an exception\n $this->missingEx('token');\n }\n }",
"public static function validateToken(string $token)\n\t{\n\t\t$ch = curl_init('https://id.twitch.tv/oauth2/validate');\n\t\tif ($ch === false)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, [\n\t\t\t'Authorization: OAuth ' . $token,\n\t\t]);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n\t\t$response = json_decode(curl_exec($ch), true);\n\n\t\tcurl_close($ch);\n\n\t\treturn (is_array($response) && isset($response['login'])) ? $response['login'] : false;\n\t}",
"public function checktoken(){\t\t\n\t\t$token=trim(strtoupper($this->input->post('tokenname')));\t\n\t\t$this->load->model('tokens');\t\n\t\t$data=$this->tokens->CheckToken($token);\n\t\tif(trim($data)==\"\"){\n\t\t\t\techo \"OK\";\n\t\t\t}else{\n\t\t\t\techo $data;\n\t\t\t\t}\n\t\t}",
"function is_valid_token($request)\n\t{\n\t\tif (!isset($request->token) || empty($request->token))\n\t\t\treturn [FALSE, ['message' => F::lang('err_token_invalid')]];\n\t\t// else\n\t\t\t// $request->token = urldecode($request->token);\n\t\t\n\t\tif ($request->agent == 'android') {\n\t\t\t$token = ['android_token' => $request->token];\n\t\t}\n\t\tif ($request->agent == 'ios') {\n\t\t\t$token = ['ios_token' => $request->token];\n\t\t}\n\t\tif ($request->agent == 'web') {\n\t\t\t$token = ['web_token' => $request->token];\n\t\t}\n\t\t\n\t\t$ci = &get_instance();\n\t\t$ci->load->model('auth_model');\n\t\t$row = $ci->auth_model->get_token($token);\n\t\tif (!$row)\n\t\t\treturn [FALSE, ['message' => F::lang('err_token_invalid')]];\n\n\t\tif ($request->agent == 'android') {\n\t\t\t$token = $row->android_token;\n\t\t\t$token_exp = $row->android_token_expired;\n\t\t}\n\t\tif ($request->agent == 'ios') {\n\t\t\t$token = $row->ios_token;\n\t\t\t$token_exp = $row->ios_token_expired;\n\t\t}\n\t\tif ($request->agent == 'web') {\n\t\t\t$token = $row->web_token;\n\t\t\t$token_exp = $row->web_token_expired;\n\t\t}\n\t\t\n\t\tif ($request->token != $token)\n\t\t\treturn [FALSE, ['result' => NULL, 'message' => F::lang('err_token_invalid')]];\n\t\t\n\t\tif ($token_exp < date('Y-m-d H:i:s'))\n\t\t\treturn [FALSE, ['result' => NULL, 'message' => F::lang('err_token_expired')]];\n\t\t\n\t\treturn [TRUE, ['result' => $row, 'message' => NULL]];\n\t}",
"function validate_token() {\n\n global $token;\n\n // If the user passed a username and password in this request\n // and did not login via a session, then token validation is not\n // necessary, so return true.\n if (defined('API_USERNAME')) {\n return true;\n }\n\n // If the token does not exist in the session,\n // or the passed token does not match the token from the session,\n // then this might be a CSRF attack so respond with an error.\n if (\n ($_SESSION['software']['token'] == '')\n || ($token != $_SESSION['software']['token'])\n ) {\n respond(array(\n 'status' => 'error',\n 'message' => 'Invalid token.'));\n }\n}",
"public function hasToken();",
"private function validateTokens()\n {\n $whoami = $this->getJson('/ping/whoami');\n if (isset($whoami['authenticated']) && $whoami['authenticated'])\n {\n syslog(LOG_DEBUG, \"Monzo: Token is still valid\");\n return true;\n }\n else\n {\n return false;\n }\n }",
"public function validateToken($token)\n\t{\n\t\t$valid = false;\n\t\t$passwordResetInfo = $this->entityManager->getRepository('BugglMainBundle:PasswordResetInfo')->findOneBy(array('token' => $token));\n\t\tif(!is_null($passwordResetInfo) and $token != ''){\n\t\t\t$valid = strtotime($passwordResetInfo->getTokenExpiration()->format('Y-m-d H:i:s')) >= strtotime(date('Y-m-d H:i:s'));\n\t\t}\n\n\t\treturn $valid;\n\t}",
"abstract public function token();",
"function check_token($token, $form_name)\n{\n if (is_bool($token)) {\n return false;\n }\n return $token === get_token($form_name);\n}",
"public function validateToken() \n {\n return API::response()->array(['status' => 'success'])->statusCode(200);\n }",
"public function tokenValidation(Request $request){\n $vldate=Validator::make($request->all(),[\n 'token'=>['required','string','exists:password_resets,token']\n ]);\n if($vldate->fails()){\n return response()->json([\n 'token' => null,\n 'data' => null,\n 'state' => '404',\n 'err' => $vldate->errors()->first()\n ]);\n }\n }",
"protected function ValidateToken(TokenInterface $token)\n {\n //If you want to debug in your dev pc change localhost to your synology dns or ip.\n\n $url = 'http://' . $this->synologyServerName . ':' . $this->synologyServerPort . '/webman/login.cgi?username='.$token->getUsername().'&passwd='.$token->getCredentials();\n\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_URL, $url);\n $data = curl_exec($ch);\n curl_close($ch);\n\n if(preg_match('#\\\"success\\\" \\: true#',$data)){\n return true;\n }\n else{\n return false;\n }\n }",
"public function isTokenValid() {\n if (!isset($_SESSION['token']) || $this->_token != $_SESSION['token'])\n \n\t\t\t$this->_errors[] = 'invalid submission';\n\n // return true or false \n return count($this->_errors) ? 0 : 1;\n }",
"function validateToken(){\n $CI = get_instance();\n if (array_key_exists('HTTP_AUTHORIZATION', $_SERVER) && !empty($_SERVER['HTTP_AUTHORIZATION'])) {\n $decodedToken = AUTHORIZATION::validateToken($_SERVER['HTTP_AUTHORIZATION']);\n if ($decodedToken != false) {\n return true;\n } else {\n return false;\n }\n }\n return false;\n}",
"public function validasiToken($token){\n\t\ttry {\n $user = JWTAuth::toUser($token);\n } catch (Exception $e) {\n if ($e instanceof \\Tymon\\JWTAuth\\Exceptions\\TokenInvalidException){\n return response()->json(['error'=>'Token is Invalid']);\n }else if ($e instanceof \\Tymon\\JWTAuth\\Exceptions\\TokenExpiredException){\n return response()->json(['error'=>'Token is Expired']);\n }else{\n return response()->json(['error'=>'Something is wrong']);\n }\n }\n\t}",
"static function validateToken($tokenString) {\n\t\t$token = \\App::model('user/token');\n\t\t$token->load(['token = ?', $tokenString]);\n\t\tif($token->get('id')) {\n\t\t\tif(strtotime($token->get('expires_at')) > time()) {\n\t\t\t\treturn $token->get('user_id');\n\t\t\t} else {\n\t\t\t\t$token->delete();\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"protected function validateTokenStructure(): void\n {\n foreach (['header', 'payload'] as $prop) {\n if (empty($this->$prop) || !is_array($this->$prop)) {\n throw new OidcInvalidTokenException(\"Could not parse out a valid {$prop} within the provided token\");\n }\n }\n\n if (empty($this->signature) || !is_string($this->signature)) {\n throw new OidcInvalidTokenException('Could not parse out a valid signature within the provided token');\n }\n }",
"public function validate(string $token): bool\n {\n $string = $this->numberArray($token);\n return $this->setNumberArray($string)->isValid();\n }",
"private function _process_token($token)\n\t{\n\t\t//check string format? Xyz.Xyz?\n\t\tif(is_string($token) && preg_match('#^[A-Z][a-z]*(?:\\.[A-Z][a-z]*)*$#', $token)) {\n\t\t\t$token = Token::getToken($token);\n\t\t}\n\t\t\n\t\tif(!(($token instanceof \\Phygments\\_TokenType) || is_callable($token))) {\n\t\t\tthrow new \\Exception(sprintf('token type must be simple type or callable, not %s', gettype($token)));\n\t\t}\n\n\t\t/*\n assert type(token) is _TokenType or callable(token), \\\n 'token type must be simple type or callable, not %r' % (token,)\n\t\t*/\n return $token;\n\t}",
"public function validateToken($token, $internal) {\n $options = $this->ssoHelper->getServerValidateOptions($token, $internal);\n if ($options['decrypt']) {\n if ($internal) {\n $this->ssoHelper->log('Attempting to validate service token using DB and service.');\n }\n else {\n $this->ssoHelper->log('Attempting to validate service token using URL: ' . $options['uri']);\n }\n try {\n $options += [\n 'form_params' => $options['params'],\n 'timeout' => 30,\n ];\n\n $response = $this->httpClient->request('POST', $options['uri'], $options);\n $response_data = $response->getBody()->getContents();\n $this->ssoHelper->log(\"Validation response received from PMMI SSO server: \" . htmlspecialchars($response_data));\n }\n catch (RequestException $e) {\n throw new PMMISSOValidateException(\"Error with request to validate token: \" . $e->getMessage());\n }\n if ($internal) {\n return $this->validate($response_data, TRUE);\n }\n else {\n return $this->validate($response_data);\n }\n }\n else {\n throw new PMMISSOValidateException('Token not decrypted!!!');\n }\n }",
"public static function checkTokenRequestParam(): void\n {\n global $token_mismatch, $token_provided;\n\n $token_mismatch = true;\n $token_provided = false;\n\n if (($_SERVER['REQUEST_METHOD'] ?? 'GET') !== 'POST') {\n return;\n }\n\n if (isset($_POST['token']) && is_scalar($_POST['token']) && strlen((string) $_POST['token']) > 0) {\n $token_provided = true;\n $token_mismatch = ! @hash_equals($_SESSION[' PMA_token '], (string) $_POST['token']);\n }\n\n if (! $token_mismatch) {\n return;\n }\n\n // Warn in case the mismatch is result of failed setting of session cookie\n if (isset($_POST['set_session']) && $_POST['set_session'] !== session_id()) {\n trigger_error(\n __(\n 'Failed to set session cookie. Maybe you are using HTTP instead of HTTPS to access phpMyAdmin.'\n ),\n E_USER_ERROR\n );\n }\n\n /**\n * We don't allow any POST operation parameters if the token is mismatched\n * or is not provided.\n */\n $allowList = ['ajax_request'];\n Sanitize::removeRequestVars($allowList);\n }",
"public function authenticate($token);",
"function validToken($name, $referer, $time)\n{\n\tif(isset($_SESSION[$name.'Token']) && isset($_SESSION[$name.'Token_time']) && isset($_POST['token']))\n\t\tif($_SESSION[$name.'Token']===$_POST['token'])\n\t\t\tif($_SESSION[$name.'Token_time']>=(time()-$time))\n\t\t\t\tif($_SERVER['HTTP_REFERER']==$referer)\n\t\t\t\t\treturn true;\n\treturn false;\n}",
"public function isValidSession(string $token):bool;",
"public function validateCsrfToken(string $id, string $token): void;",
"public static function validarTipoToken($token)\n {\n $retorno = false;\n $key = \"primerparcial\";\n\n try {\n //Esto devuelve un objeto de clase Standar\n $tokenDecoficado = JWT::decode($token, $key, array('HS256'));\n\n $tipoUser = strtolower($tokenDecoficado->tipo);\n\n if ($tipoUser == \"admin\") {\n $retorno = true;\n }\n } catch (\\Throwable $th) {\n //El token ya va a estar validado de antes asi que nunca va a devolver esto\n $retorno = \"No se pudo decodificar el token\";\n }\n\n return $retorno;\n }",
"function checkToken() {\n\t\t\t// Split the token up again to make sure the first 40 chars are the same (TOKEN)\n\t\t\t$splitToken = substr($this->tokenFromCookie, 0, 40);\n\t\t\t\n\t\t\t// Split the token up again to make sure the second 40 chars are the same (ZIPPED)\n\t\t\t$splitZipped = substr($this->tokenFromCookie, 40, 40);\n\t\t\t\n\t\t\t// Unzip the second 40 chars\n\t\t\t$result = $this->unzip($splitZipped);\n\n\t\t\t// Check if the sha of the zipped portion matches the token.\n\t\t\t// If so, no one has messed with the token\n\t\t\tif(strcmp($splitToken, sha1($splitZipped) == 0)) {\n\t\t\t\t// Grab all data from unzip\n\t\t\t\t$ip = base_convert($result[0], IP_ADDRESS, 10);\n\t\t\t\t$time = base_convert($result[1], REQUEST_TIME, 10);\n\t\t\t\t$user = $result[2];\n\t\t\t\t$random = $result[3];\n\t\t\t\t$expires = substr($this->tokenFromCookie, 80, strlen($this->tokenFromCookie));\n\n\t\t\t\t// Check if token is expired after one hour\n\t\t\t\tif(time() - $expires <= 3600) {\n\t\t\t\t\tif(strpos($_SERVER['REMOTE_ADDR'], \":\") !== false) {\n\t\t\t\t\t\t$userIpAddImp = implode(explode(\":\", $_SERVER['REMOTE_ADDR']));\n\t\t\t\t\t}\n\t\t\t\t\telseif(strpos($_SERVER['REMOTE_ADDR'], \".\") !== false) {\n\t\t\t\t\t\t$userIpAddImp = implode(explode(\".\", $_SERVER['REMOTE_ADDR']));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Check if userIp is the same as when s/he originally logged in\n\t\t\t\t\t$validity = (strcmp($ip, $userIpAddImp) == 0) ? true : false;\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\telse {\n\t\t\t\t\t$validity = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$validity = false;\n\t\t\t}\n\t\t\t\n\t\t\treturn $validity;\n\t\t}",
"public static function checkToken($ip, $token){\n require_once './svcLayer/security.php';\n return verify_token($ip,$token);\n }",
"public function isRoundValid(\\Gems_Tracker_Token $token);",
"public function isValidCSRFToken(string $token):bool;",
"function isValidToken($token){\r\n global $pdo;\r\n\t\t$select = $pdo->prepare(\"SELECT 1 FROM device_registry \r\n\t\t\tWHERE token = ?\");\r\n\t\t$select->execute(array($token));\r\n \tif($select->fetchColumn()){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function test_token_invalid() {\n\t\t$this->uri->rsegments[3] = 'b';\n\t\tset_valid_authorization();\n\t\t$out = run_action($this->c, 'token');\n\n\t\t$json = json_decode($out, true);\n\n\t\t$this->assertTrue($json['error']);\n\t\t$this->assertFalse(array_key_exists('opportunity', $json));\n\t\t$this->assertFalse(array_key_exists('opportunities', $json));\n\t}",
"public static function validFromToken($token) {\n\n try {\n $tokenResult = self::where('token', $token)\n ->where('created_at', '>', Carbon::parse(env('PIN_EXPIRE_TIME')))\n ->latest()\n ->firstOrFail();\n } catch (\\Illuminate\\Database\\Eloquent\\ModelNotFoundException $ex) {\n\n throw new NoEmailToken;\n }\n \n return $tokenResult;\n }",
"public function setup_check_security_token() {\n\t\tif ( ! $this->wsal->settings()->CurrentUserCan( 'edit' ) ) {\n\t\t\techo wp_json_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'success' => false,\n\t\t\t\t\t'message' => esc_html__( 'Access Denied.', 'wp-security-audit-log' ),\n\t\t\t\t)\n\t\t\t);\n\t\t\tdie();\n\t\t}\n\n\t\t$nonce = isset( $_POST['nonce'] ) ? sanitize_text_field( wp_unslash( $_POST['nonce'] ) ) : false;\n\t\t$token = isset( $_POST['token'] ) ? sanitize_text_field( wp_unslash( $_POST['token'] ) ) : false;\n\n\t\tif ( empty( $nonce ) || ! wp_verify_nonce( $nonce, 'wsal-verify-wizard-page' ) ) {\n\t\t\techo wp_json_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'success' => false,\n\t\t\t\t\t'message' => esc_html__( 'Nonce verification failed.', 'wp-security-audit-log' ),\n\t\t\t\t)\n\t\t\t);\n\t\t\tdie();\n\t\t}\n\n\t\tif ( empty( $token ) ) {\n\t\t\techo wp_json_encode(\n\t\t\t\tarray(\n\t\t\t\t\t'success' => false,\n\t\t\t\t\t'message' => esc_html__( 'Invalid input.', 'wp-security-audit-log' ),\n\t\t\t\t)\n\t\t\t);\n\t\t\tdie();\n\t\t}\n\n\t\techo wp_json_encode(\n\t\t\tarray(\n\t\t\t\t'success' => true,\n\t\t\t\t'token' => $token,\n\t\t\t\t'tokenType' => esc_html( $this->get_token_type( $token ) ),\n\t\t\t)\n\t\t);\n\t\tdie();\n\t}",
"public function verifyToken ($token) {\n $result = array(\n \"isValid\" => false,\n \"userId\" => \"\",\n \"expiredAt\" => \"\",\n );\n $token = Token::where('token', $token)\n ->where('expired_at', '>', Carbon::now()->timestamp)\n ->first();\n $expiredAt = Arr::get($token, 'expired_at', null);\n\n if ($expiredAt != null) {\n $result[\"isValid\"] = true;\n $result[\"userId\"] = $token->user_id;\n $result[\"expiredAt\"] = Carbon::createFromTimestamp($expiredAt)->toIso8601String();\n }\n\n return $result;\n\n }",
"private function isTokenReal(string $token)\n\t{\n\t\t$tokenData = $this->validationTokenFactory->create()\n\t\t\t\t\t\t->getCollection()\n\t\t\t\t\t\t->addFieldToFilter('token', ['eq' => $token])\n\t\t\t\t\t\t->getFirstItem();\n\n\t\treturn empty($tokenData->getData()) ? null : $tokenData;\n\t}",
"private function validateTokenData(Token $token): bool\n {\n if (false === $token->verify($this->signer, $this->secret)) {\n /* We were not able to verify the token, we will not be able to use it to authenticate the request */\n throw new AuthenticationException(\n sprintf('Unable to use JWT token using algorithm \"%s\" when expected is \"%s\"', $token->getHeader('alg'), $this->signer->getAlgorithmId())\n );\n }\n\n return true;\n }",
"function valida_token($token) {\n global $mdb2;\n global $log;\n global $type;\n\n $sql = \"SELECT token_id FROM public.token \" .\n \"WHERE token ='\" . $token . \"' AND extract(epoch from age(now(),fecha))<60\";\n $res = & $mdb2->query($sql);\n if (MDB2::isError($res)) {\n return false;\n }\n\n //SI ENCUENTRA EL TOKEN LO ELIMINA Y PROCEDE\n if ($row = $res->fetchRow()) {\n if ($type->content != 'pdf' or isset($_REQUEST[\"acceso_pdftohtml\"])) {\n $token_id = $row[\"token_id\"];\n $sql2 = \"DELETE FROM public.token WHERE token_id = \" . $token_id;\n $res2 = & $mdb2->query($sql2);\n if (MDB2::isError($res2)) {\n return false;\n }\n }\n return true;\n } else {\n return false;\n }\n}",
"public static function validToken()\r\n {\r\n $header = apache_request_headers();\r\n if(!isset($_SESSION['CSRF_TOKEN']) || !isset($header['CSRF_TOKEN']) || $header['CSRF_TOKEN'] != $_SESSION['CSRF_TOKEN']){\r\n return false;\r\n }\r\n\r\n return true;\r\n }",
"public function setToken($token);",
"public function validateTokenTime($token) {\n \t// get token validation\n \tif(Reset::where('token', $token)->count() > 0) {\n\t \t$reset = Reset::where('token', $token)->first();\n\n\t \tdate_default_timezone_set('UTC'); \n\t $date_two = date('Y-m-d H:i:s ', time());\n\n\t $minutes = round((strtotime($date_two) - strtotime($reset->updated_at)) / 60,2);\n\t $hours = round((strtotime($date_two) - strtotime($reset->updated_at))/(60*60));\n\n\t if($hours >= 24) {\n\t return \"expired\";\n\t } else {\n\t return \"working\";\n\t }\n\t } else {\n\t \treturn \"working\";\n\t }\n }",
"public function validateClientToken($param){\n\t\t$this->param = $param;\n\n\t\t$token = $this->getBearer();\n\n\t\t$result = [\n\t\t\t'error' => 1,\n\t\t\t'message' => '',\n\t\t\t'payload' => null\n\t\t];\n\t\t$method = $this->param->getServer('REQUEST_METHOD');\n\t\tif($method === 'OPTIONS' || $method === 'PUT'){\n\t\t\tdie;\n\t\t}\n\n\t\tif($token && is_array($token)){\n\t\t\tlist($header, $payload, $signature) = $token;\n\t\t\t$dataEncoded = $header . '.' . $payload;\n\n\t\t\t$rawSignature = hash_hmac(\"sha256\", utf8_encode($dataEncoded), utf8_encode($this->siteConfig->getData('site_api_key')));\n\n\t\t\t$isValid = hash_equals($rawSignature, $signature);\n\n\t\t\tif($isValid){\n\t\t\t\t$payloadDecode = json_decode(base64_decode($payload), true);\n\t\t\t\tif(isset($payloadDecode['tzoffset']) && isset($payloadDecode['tzname'])){\n\t\t\t\t\t$tzoffset = $payloadDecode['tzoffset'];\n\t\t\t\t\t$tzname = $payloadDecode['tzname'];\n\n\t\t\t\t\t$tz = $this->validateTimeZone($tzoffset, $tzname);\n\n\t\t\t\t\tif($tz){\n\t\t\t\t\t\tdate_default_timezone_set($tz);\n\n\t\t\t\t\t\t$now = time();\n\t\t\t\t\t\t$tokenTime = strtotime($payloadDecode['iat']);\n\t\t\t\t\t\t$max_valid_time = $this->siteConfig->getData('site_api_token_max_time', 60*3);\n\n\t\t\t\t\t\t$gap = $now - $tokenTime;\n\n\t\t\t\t\t\t$expEnabled = (int)$this->siteConfig->getData('site_api_exp_enabled', 0);\n\n\t\t\t\t\t\t$result['error'] = 0;\n\t\t\t\t\t\t$result['message'] = $this->_lang->getLang('success');\n\t\t\t\t\t\t$result['payload'] = $payloadDecode;\n\n\t\t\t\t\t\tif($expEnabled == 1){\n\t\t\t\t\t\t\tif($gap > $max_valid_time){\n\t\t\t\t\t\t\t\t$result['error'] = 1;\n\t\t\t\t\t\t\t\t$result['message'] = $this->_lang->getLang('api_expired_token');\n\t\t\t\t\t\t\t\t$result['payload'] = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn $result;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$result['message'] = $this->_lang->getLang('invalid_request');\n\t\t}\n\t}",
"public static function validate(string $token = null): bool\n {\n if ($token === null) {\n $postData = HTTPRequest::postData();\n $valid = isset($postData[self::INPUT_NAME]) && $postData[self::INPUT_NAME] === static::get();\n } else {\n $valid = $token === static::get();\n }\n if (!$valid) {\n static::destroy();\n throw new RuntimeException('CSRF token not valid');\n }\n return $valid;\n }",
"public function validate(string $token): bool\n {\n try {\n $parsedToken = $this->config->parser()->parse($token);\n } catch (InvalidArgumentException $e) {\n return false;\n }\n\n return $this->config->validator()->validate($parsedToken, ...$this->config->validationConstraints());\n }",
"public function hasToken(){\n return ( $this->token and $this->token->isValid() );\n }",
"public function validate()\n {\n // generate Token String\n $idTokenString = $this->getTokenString($this->_key);\n return ($idTokenString == $this->_tokenString);\n }",
"public function getToken()\n {\n $tokenValidator = new \\Paggi\\SDK\\TokenValidation(); //self::$container->get('TokenValidation');\n if (!$tokenValidator->isValidToken(self::$token)) {\n return false;\n }\n return self::$token;\n }",
"public function isTokenValid($token)\n {\n $pdo = static::getDB();\n\n $sql = \"select token, to_char(otp_last_date, 'YYYY-MM-DD HH24:MI:SS') as otp_last_date from users where email = :email\";\n $result = $pdo->prepare($sql);\n $result->execute([$this->email]);\n\n $result = $result->fetchObject();\n\n if($result->TOKEN !== $token){\n return false;\n }\n $currentTime = strtotime(Extra::getCurrentDateTime());\n $time = strtotime($result->OTP_LAST_DATE);\n\n $diff_in_seconds = ($currentTime - $time);\n\n // 7 days\n if($diff_in_seconds > 604800){\n return false;\n }\n return true;\n }",
"public function isTokenValid($token){\n $uri = $this->validateTokenUri;\n $curl = curl_init($uri);\n\n //define header settings\n curl_setopt($curl, CURLOPT_HTTPHEADER, [\n \"Accept: application/json; charset=utf-8\"\n ]);\n\n //collect post data\n $data = [\n 'secret' => $this->clientSecret,\n 'response' => $token\n ];\n\n //prepare and do request to google\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($curl, CURLINFO_HEADER_OUT, false);\n\n //response\n $jsonResponse = json_decode(curl_exec($curl));\n $curl_info = curl_getinfo($curl);\n $http_response_code = $curl_info['http_code'];\n $curl_error = curl_error($curl);\n curl_close($curl);\n\n //return\n if($jsonResponse->success == false || $curl_error || $http_response_code != 200){\n return false;\n }\n return true;\n }",
"protected function verifyToken($token)\n {\n $return = (object) [\n 'status' => TRUE,\n 'message' => ''\n ];\n\n $user_id = DB::table('email_phone_verify')\n ->where('token', '=', $token)\n ->value('user_id');\n if (!is_numeric($user_id)) {\n $return->status = FALSE;\n $return->message = __('Invalid phone verification token.');\n } else {\n $created_at = DB::table('email_phone_verify')\n ->where('token', '=', $token)\n ->value('created_at');\n if (!$created_at or ($created_at and $this->verifyTokenExpired($created_at))) {\n DB::table('email_phone_verify')->where('token', '=', $token)->delete();\n $return->status = FALSE;\n $return->message = __('Phone verification token is invalid or expired, please request new verification.');\n } else {\n $token_phone = support_decrypt_string($token);\n $user = DB::table('users')\n ->where('id', '=', $user_id)->first();\n if ($token_phone != $user->phone_number) {\n $return->status = FALSE;\n $return->message = __('There was something wrong, please contact administrator.');\n } elseif (!empty($user->phone_verified_at)) {\n $return->status = FALSE;\n $return->message = __('Your phone number is already verified.');\n }\n }\n }\n\n return $return;\n }",
"public function rules()\n {\n return [\n 'token' => 'required',\n ];\n }",
"public function isValid($token)\n {\n $expected = $this->getToken();\n return $expected === null || $expected === $token;\n }",
"public static function validate()\n {\n $request = Request::getInstance();\n $csrf = Session::get('csrf');\n\n if(!$csrf) self::rejectRequest();\n\n $isValid = hash_equals($request->csrf, $csrf);\n\n self::generateToken();\n\n if(!$isValid) {\n\n self::rejectRequest();\n\n }\n }",
"public static function check_xsrf_token_string($token = false) {\n\n\t\t// Verify there is a token, and that it matches the one in the session.\n\t\tif(!$token || Session::Data(self::Token_Variable) !== $token) {\n\t\t\t\t\n\t\t\tthrow new SecurityException('Token mismatch, possible cross-site request forgery');\n\t\t}\n\n\t}",
"function validate_delivery_registry_token($request, $flextype) : bool\n{\n return Filesystem::has(PATH['tokens'] . '/delivery/registry/' . $request->getQueryParams()['token'] . '/token.yaml');\n}",
"public static function check_token($token)\r\n {\r\n if ($token == $_SESSION['token'])\r\n return true;\r\n\r\n return false;\r\n }",
"public function validarToken(Request $request)\n {\n\n try {\n $user = JWTAuth::toUser($request->input('token'));\n } catch (Exception $e) {\n if ($e instanceof \\Tymon\\JWTAuth\\Exceptions\\TokenInvalidException){\n return 0;\n }else if ($e instanceof \\Tymon\\JWTAuth\\Exceptions\\TokenExpiredException){\n return 0;\n }else if ($e instanceof \\Tymon\\JWTAuth\\Exceptions\\JWTException){\n return 0;\n }else{\n return 0;\n }\n }\n\n return 1;\n }",
"public function validateToken($token, $maxAge = 300){\n $this->maxAge = $maxAge;\n if($token != $_SESSION['token'] || ((time() - (int)$_SESSION['tokenAge']) > (int)$this->maxAge)){\n return false;\n }else{\n unset($_SESSION['token'], $_SESSION['tokenAge']);\n return true;\n }\n }",
"protected function validateAction()\n {\n $token = (isset($this->validationToken)) ? $this->validationToken : get_class($this);\n if (!$this->app->make('token')->validate($token)) {\n $this->error->add($this->app->make('token')->getErrorMessage());\n\n return false;\n }\n if (!$this->canAccess()) {\n return false;\n }\n\n return true;\n }",
"private function validateToken(string $token, string $email, string $show)\n {\n $data = decrypt($token);\n if (! is_array($data)) {\n throw new DecryptException('The given token is not an array.');\n } elseif (! array_key_exists('show', $data) or ! array_key_exists('user', $data)) {\n throw new DecryptException('The token does not have the required components.');\n } elseif ($data['user'] != $email) {\n throw new DecryptException('The token does not belong to you.');\n } elseif ($data['show'] != $show) {\n throw new DecryptException('The token does not belong to this show.');\n }\n }",
"private static function isAccessLoginTokenValid($token)\n {\n if (empty($token)) {\n return false;\n }\n $expire = 10;//Validate on 10s\n $parts = explode('_', $token);\n $timestamp = (int)end($parts);\n return $timestamp + $expire >= time();\n }",
"public function verifyToken(Request $request)\n {\n return \"OK\";\n }",
"protected function validateToken($token,$email){\n if($token == ''||$email==''){\n return false;\n }\n\n list($usec, $sec) = explode(\" \", microtime());\n $now_timestamp=((float)$usec + (float)$sec);\n $token_timestamp = floatval(substr($token,40));\n $timeout = intval( Yii::app()->params['sso_timeout']);\n if($now_timestamp - $token_timestamp > $timeout){\n return false;\n }\n\n $email = trim(strtolower($email));\n $encrypted = substr($token , 0 , 40);\n\n $clientip = Yii::app()->request->getUserHostAddress();\n $secret_key = Yii::app()->params['secret_key'];\n\n return sha1($email.$secret_key.$clientip.$token_timestamp) == $encrypted ;\n }",
"public function authorizeToken($token) {\r\n return ($token===\"ZGV2czppZHNs\");\r\n }",
"public function requireValidToken($msg = 'Cross site request forgery detected. Request aborted!', $token = null) {\n\t\tif (is_null($token))\n\t\t\t$token = $this->createToken();\n\n\t\t$tokenName = is_array($token) ? $token['name'] : $token;\n\n\t\tif (Flight::request()->data[$tokenName] != $_SESSION[$tokenName])\n\t\t\tFlight::halt(403, $msg);\n\n\t\treturn true;\n\t}",
"public function is_valid($token) {\n\t\treturn ! empty($token) &&\n\t\t\t ! empty($_COOKIE[self::$csrf_cookie]) && \n\t\t\t hash_equals($_COOKIE[self::$csrf_cookie], $token);\n\t}",
"public static function validateStateToken($token) {\r\n\t\treturn ($token == self::generateStateToken());\r\n\t}",
"public function testIsValid()\n {\n $isValid = JWT::getInstance()->isValidToken('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnRfaWQiOiJyYWlsc19sZWdhY3kifQ.Dciipit-lh9N5FuPLNviTU-4Q5PUIdweJOCmPg7ucN4');\n $this->assertTrue($isValid);\n }",
"abstract protected function serverSideValidateToken($login): bool;",
"public function validateToken()\n {\n $user = auth()->user();\n $token = $user->token();\n $profileIds = [];\n $userProfiles = UserProfile::where(['user_id' => $user->id])->get(['profile_id']);\n\n foreach ($userProfiles as $profile) {\n $profileIds[] = $profile->profile_id;\n }\n\n return response()->json([\n 'message' => 'Usuário autenticado com sucesso!',\n 'data' => [\n 'token' => [\n 'profile_id' => $token->profile_id,\n 'expires_at' => Carbon::parse(\n $token->expires_at\n )->toDateTimeString()\n ],\n 'user' => User::find($user->id, ['login', 'name', 'email', 'last_access', 'created_at']),\n 'profiles' => Profile::whereIN('id', $profileIds)->get(['id', 'noun', 'description'])\n ]\n ]);\n }",
"public function getUserValidateToken($token)\n {\n $userTokenExist = DB::select('select * from al_token_user where token = \"' . $token . '\"');\n return $userTokenExist;\n }",
"public function validateToken(\n string $appId,\n string $indexId,\n string $tokenReference,\n string $referrer,\n string $path,\n string $verb\n ): Token {\n if ($tokenReference === $this->godToken) {\n return $this->createGodToken($appId);\n }\n\n if ($tokenReference === $this->pingToken) {\n return $this->createPingToken();\n }\n\n $endpoint = strtolower($verb.'~~'.trim($path, '/'));\n $token = $this\n ->tokenLocator\n ->getTokenByReference(\n $appId,\n $tokenReference\n );\n\n if (\n (!$token instanceof Token) ||\n (\n $appId !== $token->getAppId()\n ) ||\n (\n !empty($token->getHttpReferrers()) &&\n !in_array($referrer, $token->getHttpReferrers())\n ) ||\n (\n !empty($token->getIndices()) &&\n !in_array($indexId, $token->getIndices())\n ) ||\n (\n !empty($token->getEndpoints()) &&\n !in_array($endpoint, $token->getEndpoints())\n ) ||\n (\n $token->getSecondsValid() > 0 &&\n $token->getUpdatedAt() + $token->getSecondsValid() < Carbon::now('UTC')->timestamp\n )\n ) {\n throw InvalidTokenException::createInvalidTokenPermissions($tokenReference);\n }\n\n return $token;\n }",
"private function token_validate($user, $token)\n\t\t{\n\t\t\t// Token hash the user should have from the IP the cookie was given to\n\t\t\t$tok1 = $this->ip_lock($this->getAuthToken($user), $token[2]);\n\n\t\t\t// Token hash the user should have now\n\t\t\t$tok2 = $this->ip_lock($this->getAuthToken($user));\n\n\t\t\t// Token hash the user sent\n\t\t\t$tok3 = $token[1];\n\n\t\t\tif ($tok1 != $tok3)\n\t\t\t\treturn -1; // Invalid token, user session key changed, or cookie was edited\n\n\t\t\treturn $tok2 == $tok3 ? 1 : 0;\n\t\t}",
"function __validToken($token_created_at) {\n $expired = strtotime($token_created_at) + 86400;\n $time = strtotime(\"now\");\n if ($time < $expired) {\n return true;\n }\n return false;\n }",
"function checkToken($token){\n\t\tif(checkTimeout($token)){\n\t\t\treturn false;\n\t\t}else{\n\t\t\tif(isset($_SESSION[$token])){\n\t\t\t\tif($_SESSION[$token] == $_GET['token']){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"protected function validateTokenSignature(): void\n {\n if ($this->header['alg'] !== 'RS256') {\n throw new OidcInvalidTokenException(\"Only RS256 signature validation is supported. Token reports using {$this->header['alg']}\");\n }\n\n $parsedKeys = array_map(function ($key) {\n try {\n return new OidcJwtSigningKey($key);\n } catch (OidcInvalidKeyException $e) {\n throw new OidcInvalidTokenException('Failed to read signing key with error: ' . $e->getMessage());\n }\n }, $this->keys);\n\n $parsedKeys = array_filter($parsedKeys);\n\n $contentToSign = $this->tokenParts[0] . '.' . $this->tokenParts[1];\n /** @var OidcJwtSigningKey $parsedKey */\n foreach ($parsedKeys as $parsedKey) {\n if ($parsedKey->verify($contentToSign, $this->signature)) {\n return;\n }\n }\n\n throw new OidcInvalidTokenException('Token signature could not be validated using the provided keys');\n }",
"function valid_token($token = NULL)\n\t{\n\t\t$this->db->from('user_forgot_password');\n\t\t$this->db->where('token', $token);\n\t\t$token = $this->db->get();\n\n\t\tif ($token->num_rows() === 1)\n\t\t{\n\t\t\treturn $token->row_array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"public function verifyToken($clientId, $token);",
"function verifyFormToken($form) {\n\n\t\t// check if a session is started and a token is transmitted, if not return an error\n\tif(!isset($_SESSION[$form.'_token'])) {\n\t\treturn false;\n\t\t}\n\n\t// check if the form is sent with token in it\n\tif(!isset($_POST['token'])) {\n\t\treturn false;\n\t\t}\n\n\t// compare the tokens against each other if they are still the same\n\tif ($_SESSION[$form.'_token'] !== $_POST['token']) {\n\t\treturn false;\n\t\t}\n\n\treturn true;\n}",
"public static function checkValidateToken(array $decodedToken): bool {\n $expired_at = new \\DateTime($decodedToken['expired_at']);\n\n //Get actually time\n $now = new \\DateTime();\n\n //Check date validity\n return ($expired_at < $now);\n }"
] | [
"0.9018019",
"0.74569577",
"0.7435489",
"0.73838896",
"0.73342836",
"0.73121375",
"0.7285047",
"0.7222612",
"0.7162359",
"0.70722413",
"0.69772106",
"0.69735074",
"0.6930169",
"0.6826915",
"0.6790193",
"0.6783608",
"0.6750895",
"0.67254597",
"0.67092586",
"0.6696792",
"0.66624725",
"0.66598463",
"0.66567814",
"0.66534823",
"0.66401076",
"0.66329944",
"0.66290134",
"0.662078",
"0.6589322",
"0.6588763",
"0.6588088",
"0.6579587",
"0.6565532",
"0.6533438",
"0.65116847",
"0.65075195",
"0.64708126",
"0.6463242",
"0.64534926",
"0.6425203",
"0.63855374",
"0.6373549",
"0.63639224",
"0.6361607",
"0.63605917",
"0.6351112",
"0.634212",
"0.6333132",
"0.63223666",
"0.6286218",
"0.62683225",
"0.6256986",
"0.6256438",
"0.6254132",
"0.62464195",
"0.6232635",
"0.62307864",
"0.62271315",
"0.6217325",
"0.6211137",
"0.6206033",
"0.62023443",
"0.62021714",
"0.6165694",
"0.61642617",
"0.6163372",
"0.61633015",
"0.616294",
"0.61555314",
"0.61553574",
"0.61552995",
"0.61504436",
"0.61446106",
"0.6123614",
"0.6119432",
"0.61142176",
"0.6100723",
"0.60828555",
"0.6081923",
"0.60799694",
"0.60729504",
"0.6071667",
"0.6071381",
"0.6071029",
"0.6070161",
"0.6060263",
"0.60598665",
"0.60569406",
"0.60569304",
"0.60560936",
"0.60472006",
"0.6025869",
"0.60128456",
"0.5998028",
"0.5995792",
"0.5989883",
"0.5989868",
"0.59849024",
"0.59848225",
"0.5981206"
] | 0.6755088 | 16 |
Get the password reset validation rules. | protected function rules()
{
return [
'resetToken' => 'required',
'email' => 'required|email',
'password' => 'required|min:10',
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function retrievePasswordValidationRules()\n {\n return $this->startAnonymous()->uri(\"/api/tenant/password-validation-rules\")\n ->get()\n ->go();\n }",
"private function validationRules()\n {\n return [\n 'newPassword' => [\n new PasswordRule($this->newPasswordConfirmation),\n ],\n 'currentPassword' => [\n 'required',\n new PasswordCheckRule($this->user),\n ],\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 setUpResetPasswordValidationRules() {\n\t\treturn array(\n\t\t\t'new_password' => $this->validate['password'],\n\t\t\t'confirm_password' => array(\n\t\t\t\t'required' => array(\n\t\t\t\t\t'rule' => array('compareFields', 'new_password', 'confirm_password'),\n\t\t\t\t\t'message' => __d('users', 'The passwords are not equal.'))));\n\t}",
"public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\n }",
"public function getRules()\n {\n return $this->validation_rules;\n }",
"public function getRules()\n {\n return $this->validator->getRules();\n }",
"public function rules()\r\n {\r\n $route = \\Route::currentRouteName();\r\n switch ($route) {\r\n case 'api.v1.user.changePassword':\r\n $rules = [\r\n 'password' => 'required|min:3',\r\n 'new_password' => 'required|min:3',\r\n ];\r\n break;\r\n default:\r\n $rules = User::$rulesLogin;\r\n break;\r\n }\r\n\r\n return $rules;\r\n }",
"public function rules()\n {\n return [\n 'current_password' => ['required', new MatchOldPassword],\n 'new_password' => User::PASSWORD_RULES,\n 'new_confirm_password' => ['same:new_password'],\n ];\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 static function getRules()\n {\n return (new static)->getValidationRules();\n }",
"protected function get_validation_rules()\n {\n }",
"public function rules()\n {\n $validate = [\n 'current_password' => [\n 'required',\n new MatchOldPassword\n ],\n 'new_password' => [\n 'required',\n 'min:6'\n ],\n 're_new_password' => [\n 'required',\n 'same:new_password'\n ],\n ];\n\n return $validate;\n }",
"protected function getValidRules()\n {\n return $this->validRules;\n }",
"public function getValidationRules()\n {\n return [];\n }",
"public function rules()\n {\n $rules = [\n 'name' => ['nullable', 'min:3', 'string', 'max:100'],\n 'email' => ['sometimes', 'email:rfc', 'min:8'],\n 'current_password' => ['sometimes', 'nullable', 'min:8', new MatchOldPassword],\n 'new_password' => ['sometimes', 'nullable', 'min:8'],\n 'confirm_new_password' => ['sometimes', 'same:new_password']\n ];\n\n return $rules;\n }",
"public function rules(): array\n {\n return [\n 'token' => 'required|exists:password_resets,token',\n 'email' => 'required|email|exists:password_resets,email',\n 'newPassword' => 'required|confirmed',\n\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 //自定义验证规则,用来判断原密码是否相等\n $this->checkPassword();\n return [\n 'old_password' => 'required|check_password',\n 'password' => 'required|confirmed',\n 'password_confirmation' => 'required'\n ];\n }",
"public function rules()\n {\n return $this->validationRules;\n }",
"protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\n\n return $rules;\n }",
"public function rules()\n {\n $rules = [\n 'password' => 'required|min:6|max:60',\n 'password_confirmation' => 'same:password',\n ];\n\n if (Auth::user()->isSuperUser()) {\n return $rules;\n }\n\n return ['old_password' => 'required|min:6|max:60'] + $rules;\n }",
"protected function getValidationRules()\n {\n $class = $this->model;\n\n return $class::$rules;\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 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 $rules = [\n 'name' => 'required',\n 'email' => 'required|email',\n ];\n\n if($this->register_using == UserAccountProvider::SSO_PROVIDER){\n $rules = array_merge($rules, [\n 'password' => 'required|min:8',\n 'confirm_password' => 'required|same:password|min:8',\n ]);\n }\n\n return $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 return [\n 'userid' => 'required',\n 'fpwdotp' => 'required',\n 'reset_password' => 'required|confirmed',\n 'reset_password_confirmation' => 'required',\n ];\n }",
"public function rules()\n {\n return [\n 'token' => 'required',\n 'email' => 'required|email|exists:password_resets,email',\n 'password' => 'required|confirmed|min:8',\n 'password_confirmation' => 'required|min:8'\n ];\n }",
"public function rules(): array\n {\n $this->session()->flash('previous-route', 'change-password');\n\n return [\n 'old_password' => 'required',\n 'new_password' => 'required|confirmed|min:6',\n ];\n }",
"public function getValidationRules() : array;",
"public function rules()\n {\n $rules = [\n 'password' => [\n 'required',\n 'min:8',\n 'confirmed'\n ]\n ];\n if ($this->user()->password != 'not_set') {\n $rules['current_password'] = 'required';\n }\n\n return $rules;\n }",
"public function rules()\n {\n return [\n 'name' => 'required|string|max:255',\n 'email' => 'required|email|max:255',\n 'password' => 'sometimes|string|max:255',\n 'resetPassword' => 'sometimes|boolean'\n ];\n }",
"public function rules()\n {\n return [\n 'current_password' => ['required', new MatchOldPassword],\n 'new_password' => ['required', 'max:50', 'confirmed', Password::min(6)\n ->letters()\n ->numbers()\n ->symbols()\n ->uncompromised()]\n ];\n }",
"private function passwordRules() {\n return [\n 'password' => 'required|alpha_num|between:3,20|confirmed',\n 'password_confirmation' => 'required|alpha_num|between:3,20',\n ];\n }",
"public function rules(): array\n {\n return [\n 'oldPassword' => ['required', 'string'],\n 'newPassword' => [\n 'required',\n 'string',\n 'min:8',\n new ContainsNumeral(),\n new ContainsLowercase(),\n new ContainsUppercase(),\n ],\n ];\n }",
"public function rules()\n {\n return [\n 'old_password' => 'required',\n 'password' => 'required',\n 'confirm_password' => 'required|same:password',\n ];\n }",
"public function rules()\n {\n $rules = [\n 'email'=>'required',\n ];\n\n if ((Request::input('nip') !== null)) {\n $rules['nip'] = 'digits:10';\n }\n\n if (Request::input('new_password')!== null) {\n $rules['new_password'] = 'min:6|required_with:confirm_password|same:confirm_password';\n $rules['confirm_password'] = 'min:6';\n }\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 return [\n 'old_password' => 'required|min:6|max:12',\n 'new_password' => 'required|min:6|max:12',\n 'confirm_password' => 'required|min:6|max:12|same:new_password',\n ];\n }",
"public function rules()\n {\n return [\n 'new_password' => 'required',\n 'old_password' => 'required',\n ];\n }",
"public function getRules()\r\n\t{\r\n\t\treturn $this->rules;\r\n\t}",
"public function rules()\n {\n return [\n 'old_password' => 'required|min:6|max:15|',\n 'new_password' => 'required|min:6|max:15|',\n 'new_password_repeat' => 'required',\n ];\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 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 }",
"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 getRules()\n {\n return $this->rules;\n }",
"public function getRules()\n {\n return $this->rules;\n }",
"public function getRules()\n {\n return $this->rules;\n }",
"public function getRules()\n {\n return $this->rules;\n }",
"public function rules()\n { \n return $this->rules;\n }",
"public function validationRules()\n {\n return [];\n }",
"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 $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 {\n return [\n 'old_password' => ['required', 'regex:/^\\d{6}$/'],\n 'password' => ['required', 'regex:/^\\d{6}$/', 'confirmed']\n ];\n }",
"public function rules() {\n return array(\n array('password, passwordConfirmation', 'required'),\n array('passwordConfirmation', 'checkPasswordsAreMatched'),\n );\n }",
"protected function passwordRules()\n {\n return ['required', 'string', new Password, 'confirmed', new \\Valorin\\Pwned\\Pwned(300),];\n }",
"protected function rules()\n {\n return [\n 'token' => 'required',\n 'email' => 'required|email',\n 'password' => 'required|confirmed|min:'.config('db_limits.users.minPasswordLength'),\n ];\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 }",
"public static function getRules() \n {\n return self::$rules;\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 $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 rules()\n {\n return [\n 'current_password' => 'required|min:6',\n 'new_password' => 'required|min:6',\n 'confirm_password' => 'required|min:6|same:new_password'\n ];\n }",
"abstract protected function getValidationRules();",
"public function rules()\n {\n if (array_key_exists('password', request()->all())) {\n return [\n 'password.oldpass' => 'required',\n 'password.newpass' => 'required|min:6'\n ];\n }\n return [\n 'mobile.newmobile' => 'required|max:11',\n 'mobile.authcode' => 'required'\n ];\n }",
"public function rules(): array\n {\n return [\n 'email' => ['required', 'email', 'max:255'],\n 'verification_code' => ['required', 'digits:6']\n ];\n }",
"public function rules()\n {\n $rules = [\n 'first_name' => 'required|string|between:3,255',\n 'last_name' => 'required|string|between:3,255',\n 'avatar' => 'sometimes|mimes:png,jpg,jpeg|max:1024',\n 'email' => 'not_present',\n 'type' => 'not_present',\n 'status' => 'not_present',\n 'branches' => 'not_present',\n 'is_main_admin' => 'not_present',\n ];\n\n if ($this->has('current_password') && $this->current_password) {\n $rules['current_password'] = 'required|pass_check';\n $rules['new_password'] = 'required|alpha_num_pwd|confirmed';\n $rules['new_password_confirmation'] = 'required';\n }\n\n return $rules;\n }",
"public function getRules() {\n\t\treturn self::$rules;\n\t}",
"public function getRules()\r\n\t{\r\n\t\treturn $this->_rules;\r\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 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 return [\n 'old_password' => 'required',\n 'new_password' => 'required|string|min:6',\n 'password_confirmation' => 'required|string|min:6',\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 $actionMethod = $this->route()->getActionMethod();\n\n if ( $actionMethod == 'store') return [\n 'item.email' => 'required|email|max:50',\n 'item.roles' => 'array|required',\n 'item.name' => 'required|alpha_num|max:50',\n 'item.last_name' => 'required|alpha_num|max:50',\n 'item.password' => 'required|between:3,50',\n 'password_confirm' => 'same:item.password'\n ];\n\n if( $actionMethod == 'update' ) return [\n 'item.email' => 'required|email',\n 'item.roles' => 'array|required',\n 'item.name' => 'required|alpha_num',\n 'item.last_name' => 'required|alpha_num',\n 'password_confirm' => 'same:item.password'\n ];\n\n return [];\n }",
"public function rules()\n\t{\n\t\t\n\t\t$rules = $this->rules;\n\t\tif($this->current_password != '' || $this->newpassword != '' || $this->newpassword_confirmation != ''){\n\n\t\t\t$rules['current_password'] = 'required|max:60';\n\t\t\t$rules['newpassword'] = 'required|confirmed|max:60';\n\t\t\t$rules['newpassword_confirmation'] = 'required|different:current_password|max:60';\n\t\t\n\t\tif($this->admin == '1'){\n\t\t\t$rules['current_password'] = 'max:60';\n\t\t\t$rules['newpassword_confirmation'] = 'required|max:60';\n\t\t}\n\t\t}\n\t\t\treturn $rules;\n\n\t\t\n\t}",
"public function rules()\n {\n if ($this->isMethod('POST')) {\n return [\n 'email' => 'required|email|max:255|unique:users',\n 'current_password' => 'required|min:6',\n 'password' => 'required|confirmed|different:current_password|min:6',\n 'password_confirmation' => 'required|different:current_password|min:6|same:password'\n ];\n }\n return [];\n }",
"public function getRules() {\n\t\treturn $this->rules ?? [];\n\t}",
"public function rules(): array\n {\n return [\n 'email' => 'email|required',\n 'password' => 'required'\n ];\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 }",
"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 function rules()\n {\n $named = $this->route()->getName();\n switch ($named) {\n case 'admin.auth.change.password':\n return [\n 'password' => 'required|between:8,16',\n 'password_confirmation' => 'required|between:8,16'\n ];\n case 'admin.auth.edit.profile':\n return [\n 'email' => 'email',\n 'name' => 'between:1,128',\n ];\n default:\n return [\n //\n ];\n }\n }",
"public function getValidationRuleBag()\n {\n return $this->validationRuleBag;\n }",
"public function rules(): array\n {\n return [\n 'name' => 'required|max:50',\n 'email' => 'required|max:50|email',\n 'password' => [\n 'required',\n 'min:8',\n 'max:16',\n 'confirmed',\n new IsPasswordValid()\n ],\n 'password_confirmation' => 'required|min:8|max:16',\n ];\n }",
"public function rules()\n {\n return [\n 'old_password' => 'required|password',\n 'new_password' => 'required|password|different:old_password',\n 'password_confirm' => 'required|same:new_password',\n ];\n }",
"public function rules()\n {\n return [\n 'old_password' => [\n 'required', 'string', 'min:8',\n new MatchOldPassword,\n ],\n 'new_password' => ['required', 'string', 'min:8', 'confirmed', 'different:old_password'],\n ];\n }",
"public function getRules()\n {\n // Set the validation rules.\n $rules = [\n 'party_id' => 'integer|required|exists:pgsql.core.parties,id',\n 'bank_id' => 'integer|required|exists:pgsql.core.banks,id',\n 'currency_id' => 'integer|required|exists:pgsql.core.currencies,id',\n 'first_name' => 'string|required|max:50',\n 'last_name' => 'string|required|max:50',\n 'last_name' => 'string|nullable|max:255',\n 'type' => 'string|nullable|in:savings,current',\n 'class' => 'string|nullable|in:personal,business',\n ];\n\n // Add the account number check if it's a new record.\n if (!$this->exists) {\n $rules['account_number'] = 'string|required|max:100|unique:pgsql.core.bank_accounts,account_number,NULL,id,bank_id,' . $this->bank_id;\n }\n\n return $rules;\n }",
"public function getRules()\n {\n return $this->get(self::_RULES);\n }",
"public function rules()\n {\n return [\n 'old_password' => [\n 'required',\n function($attribute, $value, $fail) {\n if (!Hash::check($value, auth()->user()->password)) {\n $fail('Old Password didn\\'t match');\n }\n }\n ],\n 'password' => 'required|confirmed|min:8|different:old_password',\n ];\n }",
"public function rules()\n {\n switch ($this->method()) {\n // Hander Post \n case 'POST':\n return [\n 'name'=>'required',\n 'email'=>'required|email|unique:user,email',\n 'password'=>'required',\n 'Ag_password'=>'same:password',\n 'phone'=>'required|regex:/[0-9]{9}/',\n 'address'=>'required',\n 'image'=>'image|mimes:jpeg,png,gif|max:7000',\n 'birth_day'=>'date|before:today'\n ];\n break;\n // Hander Put \n case 'PUT':\n return [\n 'email'=>'required|email|unique:user,email,'.$this->id,\n 'name'=>'required',\n 'phone'=>'required|regex:/[0-9]{9}/',\n 'address'=>'required',\n 'birth_day'=>'date|before:today',\n 'repPassword'=>'same:newPassword',\n 'oldPassword'=> new checkPasswordUpdate()\n ];\n break;\n }\n }",
"public function rules()\n {\n return static::$rules;\n }",
"public function getRules(): array\n {\n return $this->rules;\n }",
"public function rules()\n {\n return [\n 'password' => 'required|valid_old_password:' . Auth::user()->id,\n 'new_password' => 'required|confirmed',\n 'new_password_confirmation' => 'required'\n ];\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 $data = $this->request->all();\n $rules['username'] = 'required|email';\n $rules['password'] = 'required'; \n\n return $rules;\n }",
"public function rules()\n {\n return [\n 'auth_title' => 'required',\n 'auth_btn_login' => 'required',\n 'auth_btn_register' => 'required',\n 'auth_reset_link' => 'required',\n /*'register_title' => 'required',\n 'register_btn_register' => 'required',\n 'register_rule' => 'required',\n 'reset_title' => 'required',\n 'reset_btn_reset' => 'required',\n 'new_password_title' => 'required',\n 'new_password_btn' => 'required',*/\n ];\n }",
"public function rules(): array\n {\n return [\n 'email' => 'required|email',\n 'password' => 'required'\n ];\n }"
] | [
"0.7697964",
"0.76810664",
"0.7573457",
"0.75676525",
"0.7446678",
"0.7397398",
"0.7349158",
"0.73256934",
"0.7252323",
"0.72143346",
"0.7177448",
"0.7172756",
"0.71625215",
"0.7133961",
"0.7125829",
"0.71037596",
"0.70725363",
"0.7067946",
"0.7064178",
"0.7042733",
"0.7030909",
"0.70252395",
"0.7009223",
"0.69914705",
"0.69867957",
"0.69817716",
"0.6974906",
"0.6961172",
"0.69396096",
"0.69262064",
"0.6909266",
"0.68911487",
"0.6887797",
"0.6860092",
"0.6851342",
"0.6849978",
"0.68432695",
"0.683949",
"0.6838503",
"0.6838503",
"0.6838503",
"0.6838503",
"0.6838503",
"0.6838503",
"0.68310994",
"0.6824176",
"0.68231046",
"0.6821654",
"0.68164384",
"0.681465",
"0.68135047",
"0.6810997",
"0.6810997",
"0.6810997",
"0.6810997",
"0.6808143",
"0.6806803",
"0.680572",
"0.6801686",
"0.6799928",
"0.6799551",
"0.6799126",
"0.6785079",
"0.6782656",
"0.6780961",
"0.67781574",
"0.67770845",
"0.67766196",
"0.67683727",
"0.67666316",
"0.67663676",
"0.67579925",
"0.6755215",
"0.67445624",
"0.6744152",
"0.67379546",
"0.6736025",
"0.6734926",
"0.6734149",
"0.6733713",
"0.6730698",
"0.671781",
"0.6710442",
"0.6709923",
"0.6707583",
"0.670724",
"0.669659",
"0.6694609",
"0.66885537",
"0.668738",
"0.6685743",
"0.66840655",
"0.66818976",
"0.6677858",
"0.667523",
"0.6668617",
"0.666433",
"0.66612625",
"0.664642",
"0.6646286",
"0.6640906"
] | 0.0 | -1 |
Get the password reset credentials from the request. | protected function credentials(Request $request)
{
$credentials = $request->only(
'email', 'password', 'resetToken'
);
$credentials['token'] = $credentials['resetToken'];
$credentials['password_confirmation'] = $credentials['password'];
unset($credentials['resetToken']);
return $credentials;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function credentials(ResetPasswordRequest $request)\n {\n return $request->only(\n 'email', 'password', 'password_confirmation', 'token'\n );\n }",
"function getRequestPassword()\n {\n return $this->_props['RequestPassword'];\n }",
"protected function getCredentials(Request $request)\n {\n return $request->only('email', 'password');\n }",
"public function getPasswordResetForm();",
"protected function credentials(Request $request)\n {\n return $request->only('email', 'password');\n }",
"protected function credentials(Request $request)\n {\n return $request->only('email', 'password');\n }",
"protected function credentials(Request $request)\n {\n return $request->only('email');\n }",
"public function getResetPasswordToken()\n {\n return $this->resetPasswordToken;\n }",
"protected function getCredentials(Request $request)\n\t{\n\t\treturn $request->all();\n\t}",
"public function getRequestPasswordCheck(){\n if(isset($_POST[self::$PasswordCheckID])){\n return trim($_POST[self::$PasswordCheckID]);\n }\n return null;\n }",
"protected function credentials(Request $request)\n {\n return $request->only(\n 'email', 'password', 'password_confirmation', 'token'\n );\n }",
"protected function credentials(Request $request)\n {\n return $request->only(\n 'email',\n 'password',\n 'password_confirmation',\n 'token'\n );\n }",
"public function getCredentials(Request $request)\n {\n return [\n// 'username' => trim($request->headers->get('X-DOMjudge-Login')),\n 'username' => $this->getEmailFromSchematics(trim($request->request->get('token', ''))),\n 'password' => $password = base64_decode(trim($request->request->get('token', ''))),\n ];\n }",
"public function getCredentials() {\n\t\t\n\t\treturn $this->_getResponse(self::URL_USERS_VERIFY_CREDENTIALS, $this->_query);\n\t}",
"protected function credentials(Request $request)\n\t{\n\t return $request->only($this->username(), 'password');\n\t}",
"public function requestPasswordReset()\n {\n /**\n * @var $validator Validator\n */\n $validator = app()->make('validator')->make($this->request->input(), [\n 'email' => 'required|email|exists:users,email',\n ]);\n\n if(!$validator->passes()) {\n $this->apiResponse->handleErrors($validator);\n }\n\n $email = $this->request->input('email', null);\n $email = htmlspecialchars(trim(strtolower($email)));\n\n /**\n * @var User $user\n */\n $user = User::where('email', $email)->first();\n\n if(!$user instanceof User) {\n $this->apiResponse->setError(\"No user with that Email found.\");\n } else {\n if (!$user->hasVerifiedEmail()) {\n $user->markEmailAsVerified();\n }\n\n if($this->request->has('callback_url') && $this->request->filled('callback_url')) {\n $user->setPasswordResetUrl($this->request->input('callback_url'));\n }\n\n $user->sendPasswordResetNotification();\n $this->apiResponse->setSuccess(['sent' => true]);\n }\n\n return $this->apiResponse->returnResponse();\n }",
"public function getCredentials(Request $request)\n {\n }",
"protected function getCredentials(Request $request)\n {\n return [\n 'email' => $request->get('email'),\n 'password'=>$request->get('password'),\n 'active'=> 1,\n 'confirmation_token'=> null\n ];\n\n }",
"protected function getCredentials(Request $request)\n \n {\n //if ('active' != false){\n return [\n 'email' => $request->input('email'),\n 'password' => $request->input('password')\n //'active' => 1\n ];\n }",
"public function getCredentials()\n { return $this->get('credentials'); }",
"protected function getCredentials(Request $request) {\n return [\n 'email' => $request->input('email'),\n 'password' => $request->input('password'),\n 'role_type' => 'admin'\n ];\n }",
"public function retrievePasswordAction() {\r\n\t\t$email = $this->getRequest()->getPost('email', false);\r\n\t\t$result = array();\r\n\t\tif ($email) {\r\n\t\t\t$customer = Mage::getModel('customer/customer')\r\n ->setWebsiteId(Mage::app()->getStore()->getWebsiteId())\r\n ->loadByEmail($email); \r\n\t\t\tif ($customer->getId()) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\t$newPassword = $customer->generatePassword();\r\n\t\t\t\t\t$customer->changePassword($newPassword, false);\r\n\t\t\t\t\t$customer->sendPasswordReminderEmail();\r\n\t\t\t\t\t$result = array('success' => true);\r\n\t\t\t\t}\r\n\t\t\t\tcatch (Exception $e){\r\n\t\t\t\t\t$result = array('success' => false, 'error' => $e->getMessage());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$result = array('success' => false, 'error' => 'This email address was not found in our records.');\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t$this->getResponse()->setBody(Zend_Json::encode($result));\r\n\t}",
"public function resetPassword(Request $request)\n {\n return $this->away($request, $this->base_url . '/reset-password');\n }",
"public function getPassword() {\n if (isset($_REQUEST['password']))\n return $_REQUEST['password'];\n else\n return false;\n }",
"protected function credentials(Request $request)\n {\n return $request->only($this->username(), 'pincode');\n }",
"public function getPasswordCredentials()\n {\n if (array_key_exists(\"passwordCredentials\", $this->_propDict)) {\n return $this->_propDict[\"passwordCredentials\"];\n } else {\n return null;\n }\n }",
"protected function credentials(Request $request)\n {\n return $request->only($this->username(), 'password');\n }",
"protected function credentials(Request $request)\n {\n return $request->only($this->username(), 'password');\n }",
"protected function credentials(Request $request)\n {\n return $request->only($this->username(), 'password');\n }",
"protected function credentials(Request $request)\n {\n return $request->only($this->username(), 'password');\n }",
"public function getPassword() {\n return $this->get('password', 'user');\n }",
"public function getPasswordResetEmail(){\n return $this->email;\n }",
"public function getIncomingMailServerPassword() {\n\t\treturn $this->ic_mail_server_password;\n\t}",
"public function postReset(Request $request)\n {\n $this->validate($request, [\n 'token' => 'required',\n 'email' => 'required|email|max:35',\n 'password' => 'required|confirmed|min:6|max:15',\n ]);\n\n print_r($request);\n die;\n\n $credentials = $request->only(\n 'email', 'password', 'password_confirmation', 'token'\n );\n\n $response = Password::reset($credentials, function ($user, $password) {\n $this->resetPassword($user, $password);\n });\n\n\n\n switch ($response) {\n case Password::PASSWORD_RESET:\n return redirect($this->redirectPath())->with('status', trans($response));\n\n default:\n return redirect()->back()\n ->withInput($request->only('email'))\n ->withErrors(['email' => trans($response)]);\n }\n }",
"public function reset(Request $request)\n {\n\n $form = \\Drupal::formBuilder()->getForm(PasswordLinkForm::class);\n\n $token = mt_rand(100000, 999999);\n $email = $request->get('email');\n\n\n\n if($email){\n $user = $this->service->createLead($email);\n if($user['Contact_Status__c'] == 'Client' || $user['Contact_Status__c'] == 'Lead'){\n\n $this->session->set('password-reset', $this->service->hashPassword($token));\n $this->session->set('password-reset-email', $email);\n $this->session->set('password-reset-verified', null);\n\n $this->service->passwordReset(\n $email,\n $token\n );\n drupal_set_message('Please check your email for your password reset code');\n } else {\n\n drupal_set_message('We could not find your account');\n\n return $this->redirect(\n 'reset-password',\n array()\n );\n }\n\n return $this->redirect(\n 'reset-password-enter',\n array()\n );\n }\n\n return [\n '#theme' => 'reset_password',\n '#form' => $form,\n ];\n }",
"public function getResetAuthentication() {\n return @$this->attributes['reset_authentication'];\n }",
"public function getPasswordReset(Request $request)\n {\n if ($request->input('token')) {\n $check = PasswordReset::where('token', $request->input('token'))->first();\n\n if ($check && strtotime($check->created_at) + (Config::get('auth.password.expire') * 60) >= strtotime('now')) {\n return view('users.password_reset', ['token' => $request->input('token')]);\n } else {\n flash()->warning(trans('users.token_expired'));\n\n return redirect('users/forgotten-password');\n }\n } else {\n flash()->warning(trans('users.invalid_token'));\n\n return redirect('users/forgotten-password');\n }\n }",
"public function getPassword() {}",
"public function getCredentials(Request $request): array\n {\n $credentials = [\n 'email' => $request->request->get('_email'),\n 'password' => $request->request->get('_password'),\n ];\n\n $request->getSession()->set(\n Security::LAST_USERNAME,\n $credentials['email']\n );\n\n return $credentials;\n }",
"public function getCredentials(Request $request): array\n {\n $credentials = [\n 'email' => $request->request->all(self::FORM_NAME)['email'],\n 'password' => $request->request->all(self::FORM_NAME)['password'],\n 'csrf_token' => $request->request->all(self::FORM_NAME)[self::CSRF_TOKEN_ID],\n 'public_token' => $request->attributes->all()['token'],\n 'user_id' => $request->attributes->all()['id'],\n ];\n\n $request->getSession()->set(\n Security::LAST_USERNAME,\n $credentials['email']\n );\n\n return $credentials;\n }",
"public function processpasswordrequest ()\n {\n if ($_POST)\n {\n try\n {\n // first verify requestID is valid\n $user = $this->welcome->getPasswordResetUser($_POST['requestID']);\n\n if (empty($user)) $this->functions->jsonReturn('ALERT', \"Unable to find a valid password reset request based upon that password request ID\");\n\n // first reset password\n $this->welcome->updateUserPassword($user, $_POST['password']);\n\n // deactivates all password reset requests for that user - they need to fill out the form again to reset their password again\n $this->welcome->deactivatePasswordRequests($user);\n \n $this->functions->jsonReturn('SUCCESS', \"Password has been reset\");\n }\n catch(Exception $e)\n {\n $this->functions->sendStackTrace($e);\n $this->functions->jsonReturn('ERROR', $e->getMessage());\n }\n }\n }",
"protected function submitPasswordResetRequest($password_reset = null)\n {\n\n $resourcePath = '/users/password-reset';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n if (isset($password_reset)) {\n $_tempBody = $password_reset;\n }\n\n if ($multipart) {\n $headers= $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n $httpBody = $_tempBody; // $_tempBody is the method argument, if present\n\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n $httpBody = new MultipartStream($multipartContents); // for HTTP post (form)\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams); // for HTTP post (form)\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n $url = $this->config->getHost() . $resourcePath . ($query ? '?' . $query : '');\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n return new Request(\n 'POST',\n $url,\n $headers,\n $httpBody\n );\n }",
"protected function credentials(Request $request)\n {\n return $request->only($this->username(), $this->password());\n }",
"private function getCredentials(AuthenticateRequest $request)\n {\n return [\n 'email' => $request->input('email'),\n 'password' => $request->input('password'),\n ];\n }",
"public function reset()\n {\n return $this->authService->reset(\n request()->input('email'),\n request()->input('token'),\n request()->input('password')\n );\n }",
"public static function GetForgotPasswordURL() {\n // TODO: when we implement other authentication providers (SAML/etc)\n // this URL will need to be configuable by the system administrator\n // since they likely will not want users attempting to reset ChurchCRM passwords\n // but rather redirect users to some other password reset mechanism.\n return SystemURLs::getRootPath() . \"/session/forgot-password/reset-request\";\n }",
"private function getPassword()\n {\n return $this->user->getPassword();\n }",
"public function getMerchantPassword()\n {\n return $this->getParameter('merchantPassword');\n }",
"public function forgotPassword($request)\n {\n return $this->start()->uri(\"/api/user/forgot-password\")\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }",
"protected function credentials(Request $request)\n {\n $credentials = $request->only($this->username(), 'password');\n $credentials['password'] .= UserService::STATIC_PASSWORD_SALT;\n\n return $credentials;\n }",
"public function reset(Request $request)\n {\n $v_code = \\Illuminate\\Support\\Facades\\Request::get('code');// get verification code from query string \n //which is appended with link on which we are on\n \n \n $email = \\Illuminate\\Support\\Facades\\Request::get('email');// get verification code from query string \n //which is appended with link on which we are on\n\n $password = $request->password;\n\n $tokenData = \\DB::table('password_resets')->where('token', $v_code)->first();//check if you are the true user by matching tokens\n if (!$tokenData)\n {\n return RESPONSE()->JSON([\n 'Message'=>'Failed unauthorize'\n ],401);\n }\n $user = User::where(['email'=>$email])->first();\n\n\n if($user!=null)\n {\n $user->password = bcrypt($request->password);\n $user->save();\n //deletes enteries from password_reset table\n \\DB::table('password_resets')->where('email', $user->email)->delete();\n\n\n return response(['Success'=>'Your password has been changed']);\n }\n return response (['Fail'=>'Something Went wrong'],400);\n }",
"public function getPasswordRequestedAt()\n {\n return $this->passwordRequestedAt;\n }",
"public function getPasswordRequestedAt()\n {\n return $this->passwordRequestedAt;\n }",
"public function getPasswordRequestedAt()\n {\n return $this->passwordRequestedAt;\n }",
"public function getPasswordRequestedAt()\n {\n return $this->passwordRequestedAt;\n }",
"public function getPasswordRequestedAt()\n {\n return $this->passwordRequestedAt;\n }",
"public function getPasswordRequestedAt()\n {\n return $this->passwordRequestedAt;\n }",
"protected function getCredentials(Request $request)\n {\n $credentials = $request->only($this->loginUsername(), 'password');\n \n return array_merge($credentials, ['site_id' => site()->getCurrent()->id]);\n }",
"public function getCredentials()\n {\n $credentials = parent::getCredentials();\n\n unset($credentials['password']);\n\n return $credentials;\n }",
"public function getEmailForPasswordReset()\n {\n return $this->email;\n }",
"protected function getPassword()\r\n {\r\n return $this->processor_data['processor_params']['password'];\r\n }",
"public function getPasswordRequestedAt()\r\n {\r\n return $this->password_requested_at;\r\n }",
"public function getCredentials()\n {\n return $this->credentials;\n }",
"public function getCredentials()\n {\n return $this->credentials;\n }",
"public function getPasswordSetForm();",
"function getCredentials()\r\n\t{\r\n\t\t$user = $this->makeRequest('http://api.twitter.com/account/verify_credentials.xml');\r\n\t\tif($user)\r\n\t\t\treturn simplexml_load_string($user);\r\n\t}",
"protected function credentials(Request $request)\n {\n return $request->only($this->username());\n }",
"protected function credentials(Request $request)\n {\n return $request->only($this->username());\n }",
"public function requestAction()\n {\n $form = $this->createForm(new UserForgotPassType());\n $form->bind($this->get('request'));\n $obj = $form->getData();\n\n $user = $this->getDoctrine()->getRepository('FOMUserBundle:User')->findOneByUsername($obj['search']);\n if ($user === null) {\n $user = $this->getDoctrine()->getRepository('FOMUserBundle:User')->findOneByEmail($obj['search']);\n }\n\n if (!$user) {\n $form->addError(new FormError($this->get(\"templating\")->render(\n 'FOMUserBundle:Password:request-error-nosuchuser.html.twig',\n array(\"search\" => $obj))));\n return array('form' => $form->createView());\n } elseif ($user->getRegistrationToken()) {\n $form->addError(new FormError($this->get(\"templating\")->render(\n 'FOMUserBundle:Password:request-error-userinactive.html.twig', array(\"user\" => $user))));\n return array(\n 'user' => $user,\n 'form' => $form->createView());\n }\n\n $this->setResetToken($user);\n\n return $this->redirect($this->generateUrl('fom_user_password_send'));\n }",
"function rest_get_authenticated_app_password()\n {\n }",
"public function requestPassword(Request $request)\n {\n $rules = [\n 'email' => 'required|email',\n 'security_question_answer' => 'required'\n ];\n\n $this->validate($request, $rules);\n\n $user = User::first();\n\n if ($user->security_question_answer != $request->security_question_answer) {\n return redirect()->back()->withErrors(['Your answer is not valid']);\n }\n\n $token = Helpers::generateRandomString();\n\n DB::table('password_resets')->delete();\n DB::table('password_resets')->insert([\n 'user_id' => $user->id,\n 'token' => $token,\n 'expiry_date' => Carbon::now()->addDay()->toDateTimeString()\n ]);\n\n event(new PasswordResetRequested($token, $request->email));\n\n return redirect('/reset_password');\n }",
"public function getPassword() : string\n {\n return explode(':', $this->uri->getUserInfo() ?: '')[1] ?? '';\n }",
"public function ResetPassword( )\n {\n\t\t\t$dataArray = array(\"email\"=>$this->email, \"password\"=>$this->password );\n \n $response = ServiceAPIUtils::CallAPIService( $dataArray,\"/User/ResetPassword/123\", \"json\" );\n\t\t\t\n\t\t\treturn $response;\n }",
"public function do_reset_password()\n {\n $input = array(\n 'token'=>Input::get( 'token' ),\n 'password'=>Input::get( 'password' ),\n 'password_confirmation'=>Input::get( 'password_confirmation' ),\n );\n\n // By passing an array with the token, password and confirmation\n if( Confide::resetPassword( $input ) )\n {\n $notice_msg = Lang::get('confide::confide.alerts.password_reset');\n return Redirect::action('UserController@login')\n ->with( 'notice', $notice_msg );\n }\n else\n {\n $error_msg = Lang::get('confide::confide.alerts.wrong_password_reset');\n return Redirect::action('UserController@reset_password', array('token'=>$input['token']))\n ->withInput()\n ->with( 'error', $error_msg );\n }\n }",
"private function getPassword()\n {\n return $this->password;\n }",
"public static function getRequest(){\n return \\Illuminate\\Auth\\Guard::getRequest();\n }",
"public function postReset()\n\t{\n\t\t$creds = [\n\t\t\t'email' => Input::get('email'),\n\t\t\t'password' => Input::get('password'),\n\t\t\t'password_confirmation' => Input::get('password_confirmation')\n\t\t];\n\n\t\treturn Password::reset($creds, function($user, $password)\n\t\t{\n\t\t\t$user->password = Hash::make($password);\n\t\t\t$user->save();\n\n\t\t\treturn Redirect::to('/');\n\t\t});\n\t}",
"public function getPassword()\n {\n return $this->__get(\"password\");\n }",
"public function requestPasswordReset_action()\n {\n PasswordResetModel::requestPasswordReset(Request::post('user_name_or_email'));\n Redirect::to('index');\n }",
"protected function credentials(Request $request)\n {\n // return $request->only($this->username(), 'password');\n $credentials = $request->only($this->username(), 'password'); \n $credentials['active'] = 1; \n return $credentials;\n }",
"protected function credentials(Request $request)\n {\n $domain = Domain::where('domain', getDomainOfEmailAddress($request->get('email')))->first();\n return [\n 'local_part' => getLocalPartOfEmailAddress($request->get('email')),\n 'domain_id' => $domain ? $domain->id : null,\n 'password' => $request->get('password'),\n 'password_confirmation' => $request->get('password_confirmation'),\n 'token' => $request->get('token'),\n 'active' => 1\n ];\n }",
"public function getPassword() {\r\n\t\treturn $this->options ['password'];\r\n\t}",
"public function esig_mail_get_password() {\n\n $esig_options = get_option('esig_mail_options');\n $temp_password = $esig_options['smtp_settings']['password'];\n $password = \"\";\n if (!$temp_password) {\n return $password;\n }\n\n $decoded_pass = base64_decode($temp_password);\n\n if (base64_encode($decoded_pass) === $temp_password) { //it might be encoded\n $password = base64_decode($temp_password);\n } else { //not encoded\n $password = $temp_password;\n }\n return $password;\n }",
"public function getAuthPassword()\n {\n }",
"public function getAuthPassword()\n {\n }",
"public function getAuthPassword()\n {\n }",
"public function postReset( Request $request )\n\t{\n\t\t$this->validate( $request, [\n\t\t\t'token' => 'required',\n\t\t\t'email' => 'required',\n\t\t\t'password' => 'required|confirmed',\n\t\t] );\n\n\t\t$credentials = $request->only(\n\t\t\t'email', 'password', 'password_confirmation', 'token'\n\t\t);\n\n\t\t$response = $this->passwords->reset( $credentials, function ( $user, $password ) {\n\t\t\t$user->password = $password; // Remove double encryption\n\n\t\t\t$user->save();\n\n\t\t\t$this->auth->login( $user );\n\t\t} );\n\n\t\tswitch( $response ) {\n\t\t\tcase PasswordBroker::PASSWORD_RESET:\n\t\t\t\treturn redirect( $this->redirectPath() );\n\n\t\t\tdefault:\n\t\t\t\treturn redirect()->back()\n\t\t\t\t\t->withInput( $request->only( 'email' ) )\n\t\t\t\t\t->withErrors( [ 'email' => trans( $response ) ] );\n\t\t}\n\t}",
"protected function credentials(Request $request)\n {\n $credentials = array('email' => $request->input('email'), 'password' => $request->input('password'), 'is_active' => 1);\n return $credentials;\n }",
"public function getAuthPassword() {\n //return 'hashed_password';\n return Credential::where('staffID', $this->staffID)->first()['hashed_password'];\n }",
"protected function credentials(Request $request): array\n {\n return $request->only('username', 'email', 'password');\n }",
"public function password_retrieval() {\n\n\t\t$_count = 0;\n\n\t\tif(Input::_method()) {\n\n\t\t\t$email = urldecode(Input::post(\"email\"));\n\t\t\t$token = Input::post('csrf_token');\n\t\t\t$key = $this->random_string('alnum',100);\n\n\t\t\t$res = $this->_password_reset->getData(urldecode($email));\n\t\t\t\n\t\t\t$question = $this->_question->getquestionByName(Input::post('question'));\n\n\t\t\t$data = array(\n\t\t\t\t'email' => $email,\n\t\t\t\t'question' => $question['security_id'],\n\t\t\t\t'answer' => strtolower(Input::post('answer'))\n\t\t\t);\n\n\t\t\t$row = $this->_password_reset->_employee_checked_qa($data);\n\n\t\t\t$this->_triggered_email($email,$res,$key);\n\n\t\t\t$_success = array(\n\t\t\t\t'userid' => $res['user_id'],\n\t\t\t\t'token' => $key,\n\t\t\t\t'datetime' => date(\"Y-m-d H:i:s\")\n\t\t\t);\n\n\t\t\tif($this->_token->_csrf_is_valid($token)){\n\n\t\t\t\t$_c = Session::userdata('error_login');\n\t\t\t\t$_s = Session::userdata('success_login');\n\t\t\t\t$femail = Session::userdata('femail');\n\t\t\t\t$_counter = $_c += 1;\n\t\t\t\t$success = $_s += 1;\n\n\t\t\t\tif($row > 0) {\n\n \t\tif($_s > 0) {\n\t\t\t\t\t\tif($_s > 2) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->_getLocked($femail);\n\n\t\t\t\t\t\t\tif($this->_email->send()) {\n\n\t\t\t\t\t\t\t\t$_arr = array('msg' =>Constant::RESET_FAILED);\n\n\t\t\t\t\t\t\t\techo json_encode($_arr);\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} else {\n\n\t\t\t\t\t\t\tif($_s > 1) {\n\t\t\t\t\t\t\t\t$_sess = array('success_login' => $success);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$_sess = array('success_login' => $_count += 1, 'femail' => $email);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tSession::put($_sess);\n\n\t\t\t\t\t\t\t$this->_password_reset->_insert_token($_success);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($this->_email->send()) {\n\n\t\t\t\t\t\t\t\t$_arr = array('msg' =>Constant::SUCCESS_RESET);\n\n\t\t\t\t\t\t\t\techo json_encode($_arr);\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\n\t\t\t\t} else {\n\n\t\t\t\t\tif($_c > 0) {\n\t\t\t\t\t\tif($_c > 2) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->_getLocked($femail);\n\n\t\t\t\t\t\t\t$_arr = array('msg' =>Constant::RESET_FAILED);\n\n\t\t\t\t\t\t\techo json_encode($_arr);\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif($_c > 1) {\n\t\t\t\t\t\t\t\t$_sess = array('error_login' => $_counter);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$_sess = array('error_login' => $_count += 1, 'femail' => $email);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tSession::put($_sess);\n\n\t\t\t\t\t\t\t$_arr = array('msg' =>Constant::SECURITY_ANSWER);\n\t\t\t\t\t\t\techo json_encode($_arr);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t$_arr = array('msg' =>Constant::CSRF_EXPIRED);\n\n\t\t\t\techo json_encode($_arr);\n\n\t\t\t}\n\t\t}\n\n\t}",
"public function resetpassword(Request $request) {\n $returnData = array();\n $response = \"OK\";\n $statusCode = 200;\n $result = null;\n $message = \"Reset password code sent.\";\n $isError = FALSE;\n $missingParams = null;\n\n $input = $request->all();\n $email = (isset($input['email'])) ? $input['email'] : null;\n\n if(!isset($email)) { $missingParams[] = \"email\"; }\n\n if(isset($missingParams)) {\n $isError = TRUE;\n $response = \"FAILED\";\n $statusCode = 400;\n $message = \"Missing parameters : {\".implode(', ', $missingParams).\"}\";\n }\n\n if(!$isError) {\n try {\n $user = User::where('email', $email)->first();\n $resetCode = str_random(30);\n $user->resetcode = $resetCode;\n $user->save();\n\n\n if (env('APP_ENV', 'local') !== 'local') {\n Mail::send('emails.resetpassword', ['resetCode'=>$resetCode], function($m) use ($user) {\n $m->from(env('MAIL_ADDRESS','translator-gator@pulselab.com'), env('MAIL_NAME','Translator-gator'));\n $m->to($user->email, $user->username)->subject(env('MAIL_SUBJECT','Translator-gator Confirmation'));\n });\n }\n } catch (\\Exception $e) {\n $response = \"FAILED\";\n $statusCode = 400;\n $message = $e->getMessage();\n }\n }\n\n $returnData = array(\n 'response' => $response,\n 'status_code' => $statusCode,\n 'message' => $message,\n 'result' => $result\n );\n\n return response()->json($returnData, $statusCode)->header('access-control-allow-origin', '*');\n }",
"public function getCredentials(Request $request)\n {\n $credentials = [\n 'username' => $request->request->get('_username'),\n 'password' => $request->request->get('_password'),\n 'csrf_token' => $request->request->get('_csrf_token'),\n ];\n\n $request->getSession()->set(\n Security::LAST_USERNAME,\n $credentials['username']\n );\n\n return $credentials;\n }",
"public function getUserCredential()\n {\n return $this->userCredentials;\n }",
"public static function getPassword() \n { \n return emailSettings::$password; \n }",
"public function postReset()\n {\n $input = array(\n 'token'=>Input::get( 'token' ),\n 'password'=>Input::get( 'password' ),\n 'password_confirmation'=>Input::get( 'password_confirmation' ),\n );\n\n // By passing an array with the token, password and confirmation\n if( Confide::resetPassword( $input ) )\n {\n $notice_msg = Lang::get('confide::confide.alerts.password_reset');\n return Redirect::to('user/login')\n ->with( 'notice', $notice_msg );\n }\n else\n {\n $error_msg = Lang::get('confide::confide.alerts.wrong_password_reset');\n return Redirect::to('user/reset/'.$input['token'])\n ->withInput()\n ->with( 'error', $error_msg );\n }\n }",
"protected function recoverPassword(Request $request)\n {\n $account = $this->adminRepository->get($request['accountId']);\n\n if ($account != null) {\n try {\n $password = $this->makePassword();\n $account['password'] = bcrypt($password);\n $this->adminRepository->save($account);\n\n Log::info('Sending');\n $mailer = SendEmail::getBaseMailer();\n $mailer->addAddress($account['email'], 'Customer');\n $mailer->Subject = 'Recover password';\n $mailer->Body = $password;\n\n// $job = (new SendEmail($mailer))\n// ->delay(Carbon::now()->addSeconds(10));\n// $this->dispatch($job);\n $mailer->send();\n Log::info('Sent');\n return response()->json([\n 'result' => true,\n 'message' => 'パスワード再発行が完了しました。'\n ]);\n } catch (Exception $exception) {\n Log::info($exception->errorMessage());\n return response()->json([\n 'result' => false,\n 'message' => 'パスワード再発行に失敗しました。'\n ]);\n }\n }\n return response()->json([\n 'result' => false,\n 'message' => 'パスワード再発行に失敗しました。'\n ]);\n\n }",
"public function getPassword() {\n return $this->getValue('password');\n }",
"public function executePasswordrecovering(HTTPRequest $request)\n {\n $login = $request->postData('login');\n $email = $request->postData('email');\n\n $author = $this->managers->getManagerOf('Authors')->getUnique($login); \n if(is_null($author) || $author->email() != $email)\n {\n $message = \"Le login ou l'email est incorrect\";\n }\n else\n {\n $message = \"Un email contenant votre mot de passe vous a été envoyé\";\n // envoi du mail\n mail($author['email'], 'Récupération du mot de passe', $author->email());\n $this->page->addVar('message', $message);\n }\n }",
"public function postReset()\n\t{ \n\t\t$credentials = Input::only('email', 'password', 'password_confirmation', 'token');\n\n\t\t$response = Password::reset($credentials, function($user, $password)\n\t\t{\n\t\t\t$user->password = Hash::make($password);\n\n\t\t\t$user->save();\n\t\t});\n\n\t\tswitch ($response)\n\t\t{\n\t\t\tcase Password::INVALID_PASSWORD: \n\t\t\tcase Password::INVALID_TOKEN:\n\t\t\tcase Password::INVALID_USER:\n\t\t\t\t//When anything wrong happens, back to the reset form with all the input there for the customer to modify\n\t\t\t\treturn Redirect::back()->with('error', Lang::get($response))\n ->withInput(Input::all());\n\t\t\t\t\t \n\t\t\tcase Password::PASSWORD_RESET:\n\t\t\t //Reset is done, redirect to the login page with empty password\n\t\t\t\t { Input::merge(array('password' => ''));\n\t\t\t\treturn Redirect::to('login')\n\t\t\t\t ->withErrors(array('password' => 'Your login password has been successfully reset.')) // Tell the customer reset is done.\n\t\t\t\t ->withInput(Input::all());}\n\t\t}\n\t\t\n\t}"
] | [
"0.75875694",
"0.6941066",
"0.6430689",
"0.63787794",
"0.6330609",
"0.6330609",
"0.62676007",
"0.6263194",
"0.6256812",
"0.62427086",
"0.61685264",
"0.61373",
"0.60599726",
"0.60483235",
"0.6028288",
"0.6006547",
"0.5948538",
"0.5945101",
"0.59418595",
"0.59301466",
"0.59263724",
"0.5913741",
"0.59134454",
"0.5905092",
"0.5904851",
"0.58944327",
"0.58591485",
"0.58591485",
"0.58591485",
"0.58591485",
"0.58468693",
"0.58438194",
"0.5841727",
"0.5807667",
"0.5801136",
"0.57950336",
"0.57773113",
"0.5776878",
"0.57650286",
"0.5747828",
"0.5747773",
"0.5744849",
"0.57396245",
"0.57250345",
"0.57193476",
"0.5694015",
"0.5679829",
"0.56625956",
"0.5656546",
"0.56479394",
"0.56406796",
"0.564066",
"0.564066",
"0.564066",
"0.564066",
"0.564066",
"0.564066",
"0.5628799",
"0.5620929",
"0.5615444",
"0.5612641",
"0.56092286",
"0.5608029",
"0.5608029",
"0.56029314",
"0.5602134",
"0.5594657",
"0.5594657",
"0.5590035",
"0.55861866",
"0.55860746",
"0.55859095",
"0.5579703",
"0.5576155",
"0.5572277",
"0.5570159",
"0.5565087",
"0.5563682",
"0.5561107",
"0.55590504",
"0.5545774",
"0.5537859",
"0.55335915",
"0.55271983",
"0.55271983",
"0.55271983",
"0.5526545",
"0.5522291",
"0.5519885",
"0.5518234",
"0.5515502",
"0.55145776",
"0.55110335",
"0.55040723",
"0.54930377",
"0.5492255",
"0.54907733",
"0.548605",
"0.54819626",
"0.5481959"
] | 0.65736973 | 2 |
Get the response for a successful password reset. | protected function sendResetResponse($response)
{
return response()->json(['isValid' => true], 200);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function completeResetPassword() {\n $validator = new ResetPasswordValidator(\\Input::all());\n if (!$validator->passes()) {\n return $this->json(array('status' => 'error',\n 'errors' => $validator->getValidator()->messages()->all()));\n }\n $data = $validator->getData();\n try {\n // Find the user using the user id\n $user = Sentry::findUserById($data['id']);\n\n // Check if the reset password code is valid\n if ($user->checkResetPasswordCode($data['reset_code'])) {\n // Attempt to reset the user password\n if ($user->attemptResetPassword($data['reset_code'], $data['new_password'])) {\n return $this->json(array(\"status\" => \"success\", \"message\" => \"Password reset successful\"));\n } else {\n return $this->json(array('status' => 'error',\n 'errors' => array('Password reset failed')));\n }\n } else {\n return $this->json(array('status' => 'error',\n 'errors' => array('The provided password reset code is Invalid')));\n }\n } catch (Cartalyst\\Sentry\\Users\\UserNotFoundException $e) {\n return $this->json(array('status' => 'error',\n 'errors' => array('User not found')));\n }\n }",
"public function resetPasswordAction()\n {\n // specify required fields\n $requirements = array(\n 'key'\n );\n\n // fech post json data\n $post = $this->fetchRequestData($requirements);\n\n $result = $params = array();\n\n $params['email'] = $post['key'];\n $params['notificationTwig'] = 'emails/user-email-forgot-password.html.twig';\n $params['changePassLink'] = '/user/password/forgot/emails/';\n $params['tellUsLink'] = '/user/tell-us/emails/';\n\n $reset = $this->get('UserServices')->userResetPassword($params);\n if (!$reset) {\n throw new HttpException(422, $this->translator->trans('Invalid credentials. Please try again.'));\n } else {\n $success = (isset($reset['status']) && $reset['status'] == 'ok') ? true : false;\n $message = $this->translator->trans(\"We've emailed you password reset instructions. Check your email\");\n }\n\n $result['success'] = $success;\n $result['message'] = $message;\n\n $response = new Response(json_encode($result));\n $response->setStatusCode(200);\n return $response;\n }",
"public function resetUserPassword()\n\t{\n\t\t# make the call to the API\n\t\t$response = App::make('ApiClient')->post('user/password?forgotten=true', Input::only('email'));\t\n\n\t\t# if the call was successful we'll want to give some feedback to the user\n\t\tif(isset($response['success'])) \n\t\t{\n\t\t\tSession::flash('success', $response['success']['data']);\n\t\t}\n\t\t# similarly if it failed, but this time also show the previous form data\n\t\telse {\n\t\t\t# save the API response to some flash data\n\t\t\tSession::flash('reset-errors', getErrors($response));\n\n\t\t\t# also flash the input so we can replay it out onto the reg form again\n\t\t\tInput::flash();\n\t\t}\t\t\n\n\t\t# ... and show the reset form again\n\t\treturn Redirect::to('forgotten-password');\n\t}",
"public function do_reset_password()\n {\n $input = array(\n 'token'=>Input::get( 'token' ),\n 'password'=>Input::get( 'password' ),\n 'password_confirmation'=>Input::get( 'password_confirmation' ),\n );\n\n // By passing an array with the token, password and confirmation\n if( Confide::resetPassword( $input ) )\n {\n $notice_msg = Lang::get('confide::confide.alerts.password_reset');\n return Redirect::action('UserController@login')\n ->with( 'notice', $notice_msg );\n }\n else\n {\n $error_msg = Lang::get('confide::confide.alerts.wrong_password_reset');\n return Redirect::action('UserController@reset_password', array('token'=>$input['token']))\n ->withInput()\n ->with( 'error', $error_msg );\n }\n }",
"public function sendResetPasswordInstruction() {\n $data = \\Input::all();\n /**\n * @todo Validate Email\n */\n if (!isset($data['email']) || !$data['email']) {\n return $this->json(array('status' => 'error',\n 'errors' => array('No email address supplied')));\n }\n\n try {\n\n // Find the user using the user email address\n $user = \\Sentry::findUserByLogin($data['email']);\n\n // Get the password reset code\n $resetCode = $user->getResetPasswordCode();\n\n // Send password reset email to the user\n $this->notificationService->sendEmail($data['email'], $user->getEmail(), 'Reset Your Password', 'email.resetpassword', compact('user', 'resetCode'));\n\n return $this->json(array(\"status\" => \"success\", \"message\" => \"Password reset instruction sent\"));\n } catch (Cartalyst\\Sentry\\Users\\UserNotFoundException $e) {\n return $this->json(array('status' => 'error',\n 'errors' => array('User was not found')));\n }\n }",
"public function postResetPassword()\n\t{\n\t\t$credentials = Input::only(\n\t\t\t'password', 'password_confirmation', 'token'\n\t\t);\n\n\t\t$response = Password::reset($credentials, function($user, $password)\n\t\t{\n\t\t\t$user->password = $password;\n\t\t\t$user->save();\n\t\t});\n\n\t\tswitch ($response)\n\t\t{\n\t\t\tcase Password::INVALID_PASSWORD:\n\t\t\tcase Password::INVALID_TOKEN:\n\t\t\tcase Password::INVALID_USER:\n\t\t\t\treturn Redirect::back()->with('error', Lang::get($response));\n\n\t\t\tcase Password::PASSWORD_RESET:\n\t\t\t\treturn Redirect::route('login')->with('success', 'Successfully reset password');\n\t\t}\n\t}",
"public function postResetPassword()\n\t{\n\t\t//check if valid token from the password_reminders table, if not show error message\n\t\t$rules = array(\t'password' =>$this->userService->getNewUserValidatorRule('password'),\n\t\t\t\t\t\t'password_confirmation'=>'Required|same:password');\n\t\t$token = Input::get('token');\n\t\t$v = Validator::make(Input::all(), $rules);\n\t\tif($v->passes())\n\t\t{\n\t\t\t$ret_msg = $this->userService->resetPassword(Input::all());\n\t\t\tif($ret_msg == '')\n\t\t\t{\n\t\t\t\treturn Redirect::to('user/login')->with('success_message', trans('auth/form.changepassword_success_message'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn Redirect::to('users/reset-password/'.$token)->withInput()->with('error', $ret_msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn Redirect::to('user/reset-password/'.$token)->withInput()->withErrors($v);\n\t\t}\n\t}",
"public function resetAction()\n {\n $data = $this->request->getParsedBody();\n $isReset = $this->auth->reset($data['code'] ?? null, $data['password'] ?? null);\n if (false === $isReset) {\n return $this->json([\n 'error' => [\n 'message' => 'User not found',\n 'fields' => [\n 'code' => 'Code incorrect',\n 'new_password' => 'Required',\n ],\n ],\n ]);\n }\n\n return $this->json([]);\n }",
"public function postReset()\n\t{\n\t\t$credentials = Input::only(\n\t\t\t'email', 'password', 'password_confirmation', 'token'\n\t\t);\n\n\t\t$response = Password::reset($credentials, function($user, $password)\n\t\t{\n\t\t\t$user->password = Hash::make($password);\n\n\t\t\t$user->save();\n\t\t});\n\n\t\tswitch ($response)\n\t\t{\n\t\t\tcase Password::INVALID_PASSWORD:\n\t\t\tcase Password::INVALID_TOKEN:\n\t\t\tcase Password::INVALID_USER:\n\t\t\t\treturn Redirect::back()->with('error', Lang::get($response));\n\n\t\t\tcase Password::PASSWORD_RESET:\n\t\t\t\treturn Redirect::route('login');\n\t\t}\n\t}",
"public function requestPasswordReset()\n {\n /**\n * @var $validator Validator\n */\n $validator = app()->make('validator')->make($this->request->input(), [\n 'email' => 'required|email|exists:users,email',\n ]);\n\n if(!$validator->passes()) {\n $this->apiResponse->handleErrors($validator);\n }\n\n $email = $this->request->input('email', null);\n $email = htmlspecialchars(trim(strtolower($email)));\n\n /**\n * @var User $user\n */\n $user = User::where('email', $email)->first();\n\n if(!$user instanceof User) {\n $this->apiResponse->setError(\"No user with that Email found.\");\n } else {\n if (!$user->hasVerifiedEmail()) {\n $user->markEmailAsVerified();\n }\n\n if($this->request->has('callback_url') && $this->request->filled('callback_url')) {\n $user->setPasswordResetUrl($this->request->input('callback_url'));\n }\n\n $user->sendPasswordResetNotification();\n $this->apiResponse->setSuccess(['sent' => true]);\n }\n\n return $this->apiResponse->returnResponse();\n }",
"public function postPasswordReset()\n {\n $this->validate($this->request, [\n 'email' => 'required'\n ]);\n\n $user = User::whereEmail($this->request->email);\n\n // If an invalid username has been entered we'll tell a white lie and say\n // that the email has been sent. This is a security measure to prevent\n // spamming of the form until a valid username is discovered.\n if ($user) {\n $resetter = new PasswordReset;\n $resetter->user($user);\n $resetter->redirect(route('login'));\n $resetter->send();\n }\n\n return back()->with('success', t('password_reset_sent'));\n }",
"public function postReset()\n {\n $input = array(\n 'token'=>Input::get( 'token' ),\n 'password'=>Input::get( 'password' ),\n 'password_confirmation'=>Input::get( 'password_confirmation' ),\n );\n\n // By passing an array with the token, password and confirmation\n if( Confide::resetPassword( $input ) )\n {\n $notice_msg = Lang::get('confide::confide.alerts.password_reset');\n return Redirect::to('user/login')\n ->with( 'notice', $notice_msg );\n }\n else\n {\n $error_msg = Lang::get('confide::confide.alerts.wrong_password_reset');\n return Redirect::to('user/reset/'.$input['token'])\n ->withInput()\n ->with( 'error', $error_msg );\n }\n }",
"public function verifyResetPassword()\n {\n $result['error'] = false;\n $result['message'] = '';\n $this->setRules([ 'token' => 'required']);\n $this->_validate();\n $customerInfo = $this->_customer->where('forgot_password', $this->request->token)->first();\n if (empty($customerInfo)) {\n $result['error'] = true;\n $result['message'] = trans('passwords.token_expired');\n }\n return $result;\n }",
"public function passwordResetWasSuccessful()\n {\n return $this->password_reset_was_successful;\n }",
"public function ResetPassword( )\n {\n\t\t\t$dataArray = array(\"email\"=>$this->email, \"password\"=>$this->password );\n \n $response = ServiceAPIUtils::CallAPIService( $dataArray,\"/User/ResetPassword/123\", \"json\" );\n\t\t\t\n\t\t\treturn $response;\n }",
"public function postReset()\n\t{ \n\t\t$credentials = Input::only('email', 'password', 'password_confirmation', 'token');\n\n\t\t$response = Password::reset($credentials, function($user, $password)\n\t\t{\n\t\t\t$user->password = Hash::make($password);\n\n\t\t\t$user->save();\n\t\t});\n\n\t\tswitch ($response)\n\t\t{\n\t\t\tcase Password::INVALID_PASSWORD: \n\t\t\tcase Password::INVALID_TOKEN:\n\t\t\tcase Password::INVALID_USER:\n\t\t\t\t//When anything wrong happens, back to the reset form with all the input there for the customer to modify\n\t\t\t\treturn Redirect::back()->with('error', Lang::get($response))\n ->withInput(Input::all());\n\t\t\t\t\t \n\t\t\tcase Password::PASSWORD_RESET:\n\t\t\t //Reset is done, redirect to the login page with empty password\n\t\t\t\t { Input::merge(array('password' => ''));\n\t\t\t\treturn Redirect::to('login')\n\t\t\t\t ->withErrors(array('password' => 'Your login password has been successfully reset.')) // Tell the customer reset is done.\n\t\t\t\t ->withInput(Input::all());}\n\t\t}\n\t\t\n\t}",
"public function reset_password()\n {\n $view_data = [\n 'form_errors' => []\n ];\n\n if ($this->input->is_post()) {\n $res = $this->_api('user')->update_password( [\n 'password' => $this->input->post('password'),\n 'confirm_password' => $this->input->post('confirm_password'),\n 'token' => $this->input->get('token'),\n 'id' => $this->input->get('id')\n ]);\n\n // Redirect if reset password successful\n if($res['submit']) {\n redirect('/login/reset_password_complete');\n return;\n }\n\n $view_data = [\n 'form_errors' => isset($res['invalid_fields']) ? $res['invalid_fields'] : [],\n 'errmsg' => isset($res['errmsg']) ? $res['errmsg'] : null,\n 'post' => $this->input->post()\n ];\n }\n\n $this->_render($view_data);\n }",
"private function forgotPassword()\n {\n try\n {\n $request = $_POST;\n\n if( !isset($request['username']) || $request['username']==\"\" )\n throw_error_msg(\"user name not provided\");\n\n global $userquery; \n $userquery->reset_password(1,$request['username']);\n\n if(error())\n {\n throw_error_msg(error('single'));\n }\n else\n { \n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'success', \"data\" => \"An Email Has Been Sent To You. Please Follow the Instructions there to Reset Your Password\");\n $this->response($this->json($data));\n }\n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }",
"public function resetNewPassword() {\r\n try {\r\n $post = $this->request->all();\r\n $token = $post['resetToken'];\r\n if ($data = $this->admin->checkPasswordToken($token)) {\r\n $email = $data->email;\r\n $user_id = $data->user_id;\r\n $secret = Hash::make($post['new_password']);\r\n $update = array(\r\n 'password' => $secret,\r\n );\r\n if ($this->user->update($update, $email, 'email')) {\r\n $where = array(\r\n 'email' => $email,\r\n 'user_id' => $user_id,\r\n );\r\n $this->admin->deleteResetPassToken($where);\r\n $arrResponse['http_status'] = Config::get('constants.HTTP_OK');\r\n $arrResponse['message'] = Lang::get('global.passwordSuccess');\r\n } else {\r\n $arrResponse['http_status'] = Config::get('constants.DB_ERROR');\r\n $arrResponse['message'] = Lang::get('global.somethingWentWrong');\r\n }\r\n } else {\r\n $arrResponse['http_status'] = Config::get('constants.DATA_NOT_MATCH');\r\n $arrResponse['message'] = Lang::get('global.passwordLinkExpire');\r\n }\r\n } catch (Exception $e) {\r\n throw new Exception(Lang::get('global.somethingWentWrong'), $e->getCode());\r\n }\r\n return response()->json($arrResponse, 200);\r\n }",
"public function resetPasswordAction()\n {\n // if the user is logged in, we can't reset password\n if ($this->cmsAuthentication()->hasIdentity()) {\n // redirect to the defualt user route\n return $this->redirect()->toRoute($this->getOptions()->getDefaultUserRoute());\n }\n\n if ($token = $this->params()->fromRoute('token')) {\n $identity = $this->getUserService()->confirmPasswordReset($token);\n if ($identity instanceof ResponseInterface) {\n \treturn $identity;\n } elseif ($identity) {\n $viewModel = new ViewModel(compact('identity'));\n $viewModel->setTemplate('cms-user/authentication/reset-password-success');\n \treturn $viewModel;\n }\n\n return $this->redirect()->toRoute();\n }\n\n $url = $this->url()->fromRoute();\n $prg = $this->prg($url, true);\n if ($prg instanceof ResponseInterface) {\n return $prg;\n }\n\n $post = $prg;\n $form = $this->getUserService()->getResetPasswordForm();\n $form->setAttribute('action', $url);\n\n if ($post && $form->setData($post)->isValid()) {\n\n $identity = $this->getUserService()->resetPassword($form->get('identity')->getValue());\n\n // Return early if an user service returned a response\n if ($identity instanceof ResponseInterface) {\n return $identity;\n } elseif ($identity) { // Password reset successfully\n $viewModel = new ViewModel(compact('identity'));\n $viewModel->setTemplate('cms-user/authentication/reset-password-warning');\n return $viewModel;\n }\n }\n\n return new ViewModel(compact('form'));\n }",
"public function forgotpasswordAction()\n {\n $user_service = $this->getServiceLocator()->get('user');\n $email_sent = false;\n\n if ($this->getRequest()->isPost())\n {\n $data = $this->getRequest()->getPost();\n\n $email = trim($data['email']);\n $email = strtolower($email);\n $user_service->emailPassword($email);\n $email_sent = true;\n }\n\n return ['email_sent' => $email_sent];\n }",
"public function doResetPassword()\r\n {\r\n $repo = App::make('UserRepository');\r\n $input = array(\r\n 'token' => Input::get('token'),\r\n 'password' => Input::get('password'),\r\n 'password_confirmation' => Input::get('password_confirmation'),\r\n );\r\n\r\n // By passing an array with the token, password and confirmation\r\n if ($repo->resetPassword($input)) {\r\n $notice_msg = Lang::get('confide::confide.alerts.password_reset');\r\n\r\n return Redirect::action('UserController@login')\r\n ->with('notice', $notice_msg);\r\n } else {\r\n $error_msg = Lang::get('confide::confide.alerts.wrong_password_reset');\r\n\r\n return Redirect::action('UserController@resetPassword', array('token' => $input['token']))\r\n ->withInput()\r\n ->with('error', $error_msg);\r\n }\r\n }",
"public function resetPassword()\n {\n if (!$this->request->is('patch')) {\n $this->_respondWithMethodNotAllowed();\n return;\n }\n\n $token = $this->request->getData('token');\n if (empty($token)) {\n $this->_respondWithBadRequest();\n return;\n }\n\n $user = $this->Users->findByToken($token, TokensTable::TYPE_LOST_PASSWORD);\n if (empty($user)) {\n $this->set('message', 'This password reset is no longer valid.');\n $this->set('_serialize', ['message']);\n $this->_respondWithBadRequest();\n return;\n }\n\n $user->unsetProperty('username');\n $user->unsetProperty('email');\n\n $user = $this->Users->patchEntity($user, [\n 'password' => $this->request->getData('password'),\n 'password_confirmation' => $this->request->getData('password_confirmation')\n ], ['validate' => 'resetPassword']);\n\n if ($this->Users->save($user)) {\n $this->Users->Tokens->expireTokens($user->id, TokensTable::TYPE_LOST_PASSWORD);\n $this->set('message', __('Your password has been reset.'));\n } else {\n $this->set('message', __('Please correct the marked errors.'));\n $this->set('errors', $user->getErrors());\n $this->_respondWithValidationErrors();\n }\n\n $this->set('_serialize', ['message', 'errors']);\n }",
"public function forgot_password() {\n if ($this->Auth->login()) {\n return $this->redirect($this->Auth->redirectUrl());\n }\n $this->layout = 'GtwUsers.users';\n if ($this->request->is('post')) {\n $arrResponse = $this->User->ForgotPasswordEmail($this->request->data['User']['email']);\n if (!empty($arrResponse)) {\n if ($arrResponse['status'] == 'fail') {\n $this->Session->setFlash($arrResponse['message'], 'alert', array(\n 'plugin' => 'BoostCake',\n 'class' => 'alert-danger'\n ));\n } else {\n $this->Session->setFlash($arrResponse['message'], 'alert', array(\n 'plugin' => 'BoostCake',\n 'class' => 'alert-success'\n ));\n return $this->redirect($this->Auth->redirectUrl());\n }\n }\n }\n }",
"public function processpasswordrequest ()\n {\n if ($_POST)\n {\n try\n {\n // first verify requestID is valid\n $user = $this->welcome->getPasswordResetUser($_POST['requestID']);\n\n if (empty($user)) $this->functions->jsonReturn('ALERT', \"Unable to find a valid password reset request based upon that password request ID\");\n\n // first reset password\n $this->welcome->updateUserPassword($user, $_POST['password']);\n\n // deactivates all password reset requests for that user - they need to fill out the form again to reset their password again\n $this->welcome->deactivatePasswordRequests($user);\n \n $this->functions->jsonReturn('SUCCESS', \"Password has been reset\");\n }\n catch(Exception $e)\n {\n $this->functions->sendStackTrace($e);\n $this->functions->jsonReturn('ERROR', $e->getMessage());\n }\n }\n }",
"public function post_forgotpassword() {\n try {\n $i = Input::post();\n\n $auth = new \\Craftpip\\OAuth\\Auth();\n $users = $auth->getByUsernameEmail($i['email']);\n if (!$users) {\n throw new \\Craftpip\\Exception('Email/Username not registered with us.');\n }\n\n $mail = new \\Craftpip\\Mail($users['id']);\n $mail->template_forgotpassword();\n $mail->send();\n\n $response = array(\n 'status' => true,\n 'message' => 'asdsa',\n );\n } catch (Exception $e) {\n $e = new \\Craftpip\\Exception($e->getMessage(), $e->getCode());\n $response = array(\n 'status' => false,\n 'reason' => $e->getMessage(),\n );\n }\n\n echo json_encode($response);\n }",
"public static function do_lost_password() {\n\t\tif ( ! self::is_global_reset_password_page_set() && ! FrmRegLoginController::is_global_login_page_set() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'POST' == $_SERVER[ 'REQUEST_METHOD' ] ) {\n\n\t\t\t// Attempt to send reset password email\n\t\t\t$errors = retrieve_password();\n\n\t\t\tif ( is_wp_error( $errors ) ) {\n\t\t\t\t// Errors found\n\t\t\t\tself::lost_password_redirect_with_errors( $errors );\n\n\t\t\t} else {\n\t\t\t\t// Email sent\n\t\t\t\tself::lost_password_redirect_no_errors();\n\t\t\t}\n\t\t}\n\t}",
"public function forgot_password_post()\n\t{\n\t\t$array['username'] = strtolower($this->post('username'));\n\n\t\t$error = [];\n\n\t\tif (filter_var($array['username'], FILTER_VALIDATE_EMAIL) \n\t\t\tOR preg_match('/^[A-Za-z][A-Za-z0-9]{5,100}$/', $array['username'])) {\n\n\t\t\tif (empty($array['username'])) {\n\t\t\t\t$this->response(['status' => FALSE, 'error' => 'Username is empty'], REST_Controller::HTTP_BAD_REQUEST);\n\t\t\t} else {\n\t\t\t\t$validate_user = $this->api_model->validate_user($array['username'], $array['username']);\n\t\t\t\t\n\t\t\t\tif ($validate_user) {\n\t\t\t\t\t$new_password = $this->get_random_string();\n\t\t\t\t\t$update_user = $this->api_model->update_password($validate_user, $new_password);\n\t\t\t\t\tif ($update_user) {\n\t\t\t\t\t\t$send_email = $this->send_email($validate_user['email'], $new_password);\n\t\t\t\t\t\tif ($send_email) {\n\t\t\t\t\t\t\t$this->response(['status' => TRUE, 'message' => 'New password sent to email'], REST_Controller::HTTP_OK);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->response(['status' => FALSE, 'error' => ['Something went wrong']], REST_Controller::HTTP_BAD_REQUEST);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->response(['status' => FALSE, 'error' => ['Password update failed']], REST_Controller::HTTP_BAD_REQUEST);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->response(['status' => FALSE, 'error' => ['Username or email is incorrect']], REST_Controller::HTTP_BAD_REQUEST);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$error[] = 'Invalid username format.';\n\t\t\t$this->response(['status' => FALSE, 'error' => $error], REST_Controller::HTTP_BAD_REQUEST);\n\t\t}\n\t}",
"public function postReset()\n {\n $credentials = Input::only(\n 'email', 'password', 'password_confirmation', 'token'\n );\n $validator = Validator::make(\n array('email' => Input::get('email'), 'password' => Input::get('password'), 'password_confirm' => Input::get('password_confirm')),\n array('email' => 'required|unique:users,email|email', 'password' => 'required|min:4|max:20|same:password_confirm')\n );\n $response = Password::reset($credentials, function ($user, $password) {\n $user->password = Hash::make($password);\n $user->save();\n });\n\n switch ($response) {\n case Password::INVALID_TOKEN:\n return Redirect::to('password/forgot')->with('error', Lang::get($response));\n\n case Password::INVALID_PASSWORD:\n case Password::INVALID_USER:\n return Redirect::back()->with('error', Lang::get($response));\n\n case Password::PASSWORD_RESET:\n return Redirect::to('/login')->with('success', 'Password was successfully reset!<br> You make now Log in.');\n }\n }",
"public function doForgetPassword(){\n $email = Input::get('email');\n $result = 0;\n\n if(!empty($email)){\n $token = User::createAccountToken();\n \tUser::where('email', '=',$email)->update(array('account_token' => $token));\n\n\t\t\t$user = User::getByEmail($email);\n if (!empty($user)) {\n $link_reset = URL::to('/').'/forgetPassword?email='.$email.'&token='.$token;\n\n $data = array(\n 'link_reset' => $link_reset,\n 'user' => $user->toArray()\n );\n\n Mail::send('emails.reset_password', $data, function($message) use($email) {\n $message->to($email, Config::get('constants.website_name'))\n ->subject('【'.Config::get('constants.website_name').'】Cấp lại mật khẩu!');\n });\n\n $result = 1;\n }\n }\n return json_encode($result);\n }",
"public function postForgotPassword()\n\t{\n\t\t$rules = ['email' => 'required|email'];\n\t\t$validator = Validator::make(Input::only('email'), $rules);\n\t\tif ($validator->fails()) return Redirect::back()->withInput()->withErrors($validator);\n\n\t\tif ( ! PasswordReminder::canSendReminderEmail(Input::get('email')))\n\t\t{\n\t\t\treturn Redirect::back()->withInput()\n\t\t\t\t->withError('A reminder email has already been sent for this email address.');\n\t\t}\n\n\t\tswitch ($response = Password::remind(Input::only('email'), function($message)\n\t\t{\n\t\t\t$message->subject('WebCMS Password Reminder');\n\t\t}))\n\t\t{\n\t\t\tcase Password::REMINDER_SENT:\n\t\t\t\treturn Redirect::back()->withSuccess(Lang::get($response));\n\n\t\t\tdefault:\n\t\t\t\treturn Redirect::back()->withError(Lang::get($response));\n\t\t}\n\t}",
"public function resetPasswordPostAction() {\n $request = Request::createFromGlobals();\n $userEmail = $request->request->get('_username', '');\n \n // Get the user object\n $user = $this->getDoctrine()\n ->getRepository('AppBundle:Users')\n ->findOneBy(array('email' => $userEmail));\n \n if (!$user)\n {\n $error = \"User not found!\";\n }\n else\n {\n // Generate a user hash\n $hash = $this->generateUserHash($user);\n \n // Send reset password email\n $mailer = $this->get('mailer');\n $message = $mailer->createMessage()\n ->setSubject('Tabulit Password Reset')\n ->setFrom('admin@tabulit.com') \n ->setTo($user->getEmail())\n ->setBody(\n $this->renderView(\n 'AppBundle:Email:resetPassword.html.twig', array(\n 'id' => $user->getId(),\n 'hash' => $hash->getRc4Key(),\n 'hash_time' => $hash->getCreated())\n ),\n 'text/html'\n );\n $mailer->send($message);\n $this->logAction(\"Reset password mail has been sent for \".$user->getId(), self::LOGTYPE_EDIT, $user->getId());\n $error = \"NONE\";\n }\n \n return $this->resetPasswordAction($error, $userEmail);\n }",
"public function passwordResetAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n $site = $this->view->site;\n $validator = $this->view->validator;\n\n // set the input params\n $requiredParams = array(\n 'code',\n );\n\n $input = $this->processInput( $requiredParams, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n // decode the hash and gets its parts, confirm all good and allow user to change password\n list( $userIdentification, $timestamp, $signature ) = explode( '|', base64_decode( urldecode( $input->code ) ) );\n\n // first assume userIdentification is a username\n $user = $site->getUserByUsername( $userIdentification );\n\n // if userIdentification is not a username, use userIdentification as an email address\n if ( ! $user ) {\n $user = $site->getUserByEmailAddress( $userIdentification );\n }\n\n $validator->checkValidUser( $user, $errors );\n $validator->checkValidResetPasswordCode( $site, $userIdentification, $timestamp, $signature, $errors );\n\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n return $this->renderPage( 'authPasswordReset' );\n }",
"public function actionRequestPasswordReset()\n {\n $model = new PasswordResetRequestForm();\n\n if (!$model->load(Yii::$app->request->post()) || !$model->validate()) {\n return $this->render('requestPasswordResetToken', ['model' => $model]);\n }\n\n if (!$model->sendEmail()) {\n Yii::$app->session->setFlash('error', Yii::t('app', \n 'Sorry, we are unable to reset password for email provided.'));\n return $this->refresh();\n }\n\n Yii::$app->session->setFlash('success', Yii::t('app', 'Check your email for further instructions.'));\n\n return $this->goHome();\n }",
"public function getResetPassword()\n {\n return view('admin.reset_password')->with(['success'=>'success message']);\n }",
"public function forgottenPassword()\n {\n\t\t// Load helpers and libraries\n\t\thelper(['form', 'url']);\n\t\t$M_User = new M_User();\n\n\t\t// Default return\n\t\t$ret = redirect()->to(base_url());\n\n $options = [\n\t\t\t'action' => 'Users/forgottenPassword' // Route\n ];\n \n\t\t$request = $this->request;\n \n\t\t// Retrieving the current step of the process\n\t\t$step = $request->getPostGet('step');\n\n switch ($step){\n\t\t\tcase 1:\n\t\t\t\t// Step 1: Display email form\n\t\t\t\t$ret = json_encode(view(FORM_FORGOTTEN_PWD_STEP_1, $options));\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t// Step 2: Send the email\n\t\t\t\t$postData = $request->getPostGet('forgottenPwd');\n\n\t\t\t\t$options['alert'] = 'Un problème est survenu lors de l\\'envoi de l\\'email.';\n\t\t\t\t$options['type'] = 'danger';\n\n\t\t\t\t$ret = json_encode(view(FORM_FORGOTTEN_PWD_STEP_1, $options));\n\n\t\t\t\tif(is_array($postData))\n {\n\t\t\t\t\t$email = $postData['email'];\n\t\t\t\t\t// Everything went well : sending the password reset email\n\t\t\t\t\tif ($M_User->sendPwdResetEmail($email) == SC_SUCCESS) {\n\t\t\t\t\t\t$options['alert'] = 'Un email vient de vous être envoyé. Merci de cliquer sur le lien qu\\'il contient.';\n $options['type'] = 'success';\n\t\t\t\t\t\t$ret = json_encode(view(FORM_FORGOTTEN_PWD_STEP_2, $options));\n }\n\t\t\t\t\t// TODO - User not found\n }\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t// Step 3 : Token verification\n\t\t\t\t$token = $request->getPostGet('token');\n\n\t\t\t\t$options = [\n\t\t\t\t\t'action' => 'Users/forgottenPassword', // Route\n\t\t\t\t\t'token' => $token, // Security token\n\t\t\t\t\t'script' => self::ENCRYPTION_URL // Script URL for SHA256 encryption\n\t\t\t\t];\n\n\t\t\t\tif ($M_User->findOneBy('securityToken', $token) != null) {\n\t\t\t\t\t// A corresponding security token has been found in the DB\n\t\t\t\t\t$ret = render(FORM_FORGOTTEN_PWD_STEP_3, $options);\n }\n\t\t\t\t// TODO - Token expired\n\t\t\t\t// TODO - Invalid Token\n\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t// Step 4 : Updating User password\n\t\t\t\t$postData = $request->getPostGet('pwdReset');\n\t\t\t\tif (is_array($postData)){\n\t\t\t\t\tif ($M_User->resetPassword($postData['token'],$postData['password']) != SC_SUCCESS){\n\t\t\t\t\t\t$options = [\n\t\t\t\t\t\t\t'action' => 'Users/forgottenPassword', // Route\n\t\t\t\t\t\t\t'token' => $postData['token'], // Security token\n\t\t\t\t\t\t\t'alert' => 'Une erreur interne est survenue', // Alert message\n\t\t\t\t\t\t\t'type' => 'danger' // Alert type\n\t\t\t\t\t\t];\n\n\t\t\t\t\t\t$ret = render(FORM_FORGOTTEN_PWD_STEP_3, $options);\n } \n }\n\t\t\t\tbreak;\n }\n \n\n return $ret;\n\t}",
"public function post_forgotpasswordconfirmed() {\n try {\n $i = Input::post();\n\n $user = new \\Craftpip\\OAuth\\Auth($i['user_id']);\n $key = $user->getAttr('forgotpassword_key');\n if ($key != $i['key']) {\n throw new Exception('Sorry, the token has expired.');\n }\n\n if (!(strlen($i['password']) > 5 && strlen($i['password']) < 12)) throw new Exception('Sorry, something went wrong.');\n\n $user->setPassword($i['password']);\n $user->removeAttr('forgotpassword_key');\n $user->setAttr('verified', true); // because password reset happened via email.\n if ($user->existAttr('verify_key')) $user->removeAttr('verify_key');\n $user->force_login($user->user_id);\n\n $response = array(\n 'status' => true,\n 'message' => 'Password has been changed successfully.',\n );\n } catch (Exception $e) {\n $response = array(\n 'status' => false,\n 'reason' => $e->getMessage(),\n );\n }\n echo json_encode($response);\n }",
"public function forgot_password() {\n $flash = null;\n // if the user has tried logging in\n if(isset($_POST['username'])){\n $email = $_POST['username'];\n $user = $this->User->getByEmail($email);\n $pass = rand(111111, 999999);\n if($this->User->setPassword($user['id'], $pass)) {\n $text = <<<END\nBecause of a request on our site, your password has been reset. To change your password, go to /users/change_password\nYour username is: {$email}\nYour password is: {$pass}\nEND;\n $email = self::getLib('email');\n $html = $email->text2html($text, email);\n $email->setSender('support');\n $email->setReplyTo('support');\n $email->setRecipients( array($recipient) );\n $email->setSubject(\"Your password has been reset\");\n $email->addMessagePart($text);\n $email->addMessagePart($html, \"html\");\n $email->send();\n $flash = \"An email with your new password has been sent to you. You should receive it shortly.\";\n } else {\n $flash = \"An error occured.\";\n }\n } else {\n $flash = \"Please enter a user name.\";\n }\n return array('flash' => $flash);\n }",
"public function resetPassword(){\n return $this->repository->resetPassword();\n }",
"public function postReset()\n\t{\n\t\t$creds = [\n\t\t\t'email' => Input::get('email'),\n\t\t\t'password' => Input::get('password'),\n\t\t\t'password_confirmation' => Input::get('password_confirmation')\n\t\t];\n\n\t\treturn Password::reset($creds, function($user, $password)\n\t\t{\n\t\t\t$user->password = Hash::make($password);\n\t\t\t$user->save();\n\n\t\t\treturn Redirect::to('/');\n\t\t});\n\t}",
"public function forgotPasswordSuccess()\n {\n return $this->loadPublicView('user.forgot-password-success');\n }",
"public function actionForgotPassword() {\n //validate webservice\n $requiredParams = ['email'];\n try {\n CommonApiHelper::validateRequestParameters($requiredParams);\n\n $response = [];\n $post = Yii::$app->request->bodyParams;\n $post = array_map('trim', $post);\n //Fetch user details\n $userdata = Users::findOne(['email' => $post['email'], 'status' => '1']);\n if (!empty($userdata)) {\n $userdata->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();\n if ($userdata->save(false)) {\n Users::sendPasswordResetEmail($userdata);\n }\n return CommonApiHelper::return_success_response(\"Reset Password link has been sent to your registered email id.\", \"\", []);\n } else {\n return CommonApiHelper::return_error_response(\"Failed:\", \"Email id is not registered or User is inactive.\", \"2\");\n }\n } catch (\\Exception $e) {\n return CommonApiHelper::return_error_response(\"Sorry, Please try again.\");\n }\n }",
"public function sendResetCode()\n {\n if (is_null($this->container)) {\n //we don't have a container, therefore no mail handler\n return false;\n }\n $code = $this->getResetCode()->getCode();\n\n $mailer = $this->container->mailer;\n\n $mailer->message->setSubject('Password Reset Code Request for ' . getenv('NAME'));\n $mailer->message->setFrom([getenv('APP_EMAIL_ADDRESS') => getenv('NAME')]);\n $mailer->message->setTo([$this->email]);\n\n $arguments = [\n 'home' => getenv('BASE_URL'),\n 'app_name' => getenv('NAME'),\n 'username' => $this->username,\n 'copyright_year' => date('Y'),\n 'reset_code_lifetime' => (int)getenv('RESET_CODE_LIFETIME'),\n 'action_url' => getenv('BASE_URL') . $this->container->router->pathFor('auth.login')\n . '?username=' . $this->username . '&code=' . $code,\n ];\n\n $mailer->htmlTemplate('password_reset.twig', $arguments);\n $mailer->inlineStyle('password_reset.css');\n $mailer->textTemplate('password_reset.txt', $arguments);\n\n return $mailer->send();\n }",
"Public Function resetPassword()\n\t{\n\t\t$Code = $this->generateResetCode();\n\t\t$Email = $this->email;\n\t\t$Subject = 'Reset Password Request from ' . $_SERVER['HTTP_HOST'];\n\t\t$Body = <<<END\nThis is an automatically generated email from $_SERVER[HTTP_HOST] regarding a password reset.<br/>\nIf you did not request a password reset then please disregard this email.<br/>\n<br/>\nOtherwise, follow this link to reset your password:<br/>\n<a href=\"http://$_SERVER[HTTP_HOST]/BevoMedia/Index/ResetPassword.html?EmailCode=$Code&Email=$Email\">http://$_SERVER[HTTP_HOST]/BevoMedia/Index/ResetPassword.html?EmailCode=$Code&Email=$Email</a>\nEND;\n\t\t\n\t\t$this->ClearResetCode();\n\t\t$this->InsertResetCode($Code);\n\t\t$this->SendEmail($Email, $Subject, $Body);\n\t}",
"public function forgot() {\n\n\n $credentials = request()->validate(['email' => 'required|email']);\n\n $sendResetLink = Password::sendResetLink($credentials);\n\n \n\n return $this->respondWithMessage('Reset password link sent on your email id.');\n }",
"public function forgotten_password() {\n $email = $this->input->post('email');\n if (!$this->users_model->fields(array('id'))->where('email', $email)->limit(1)->get()) {\n return $this->send_error('NOT_REGISTERED');\n }\n $this->load->helper('string');\n $this->load->library('email');\n $token = random_string('sha1');\n if (!$this->users_model->where('email', $email)->update(array('forgotten_password_code' => $token, 'forgotten_password_time' => time()))) {\n return $this->send_error('ERROR');\n }\n $this->email->from(config_item('email_from'), config_item('email_from_name'))\n ->to($email)\n ->subject('Passwrod reset | Go4Slam app')\n ->message('Hello, <br><br> Press the link below to set a new password. <br><br><a href=\"' . base_url() . 'user/reset_password/' . urlencode($email) . '/' . urlencode($token) . '\">Click here</a>')\n ->set_mailtype('html');\n if (!$this->email->send()) {\n return $this->send_error('UNABLE_TO_SEND_EMAIL');\n }\n return $this->send_success();\n }",
"public function resetPassword();",
"private function user_reset_password(){\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\n\t\t\tif(!isset($_POST['password']) ) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter password is require\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\tif(!isset($_POST['confirm_password']) ) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter confirm_password are require\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\n\t\t\t$user_id = $this->_request['table_doctor_id'];\n\t\t\t$password = $this->_request['password'];\n\t\t\t$cpassword = $this->_request['confirm_password'];\n\n\t\t\tif(!empty($password) && !empty($cpassword) ) {\n\n\t\t\t\tif($password!=$cpassword) {\n\t\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Password and Confirm password is not matched\");\n\t\t\t\t\t$this->response($this->json($error), 200);\n\n\t\t\t\t} else{\n\t\t\t\t\t\t$hashed_password = sha1($password);\n\t\t\t\t\t\t$sql = \"UPDATE table_user SET user_password='\".$hashed_password.\"' WHERE user_id='\".$user_id.\"' \";\n\t\t\t\t\t\t$stmt = $this->db->prepare($sql);\n\t\t\t\t\t\t$update = $stmt->execute();\n\t\t\t\t\t\t$fetchData = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t\t\t\t\tif(count($update)==1){\n\t\t\t\t\t\t\t$error = array('status' => \"Success\", \"msg\" => \"Profile Updated\");\n\t\t\t\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function passwordResetCode();",
"public function actionRequestpasswordreset() {\n\t\treturn $this->render('requestpasswordreset');\n\t}",
"public static function do_reset_password() {\n\t\tif ( ! self::is_global_reset_password_page_set() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'POST' == $_SERVER[ 'REQUEST_METHOD' ] && isset( $_REQUEST[ 'rp_key' ] ) && isset( $_REQUEST[ 'rp_login' ] ) ) {\n\t\t\t$rp_key = sanitize_text_field( $_REQUEST['rp_key'] );\n\t\t\t$rp_login = sanitize_text_field( $_REQUEST['rp_login'] );\n\n\t\t\t$user = check_password_reset_key( $rp_key, $rp_login );\n\n\t\t\tif ( ! $user || is_wp_error( $user ) ) {\n\t\t\t\t$query_args = self::get_reset_password_query_args_from_user( $user );\n\t\t\t\tFrmRegLoginController::redirect_to_selected_login_page( $query_args );\n\n\t\t\t} elseif ( isset( $_POST[ 'pass1' ] ) ) {\n\n\t\t\t\tself::redirect_if_passwords_not_equal( $rp_key, $rp_login );\n\t\t\t\tself::redirect_if_empty_password( $rp_key, $rp_login );\n\t\t\t\tself::reset_password_and_redirect( $user );\n\n\t\t\t} else {\n\t\t\t\tesc_html_e( 'Invalid request.', 'frmreg' );\n\t\t\t}\n\t\t}\n\t}",
"public function handleResetPassword()\n {\n $input = array(\n 'token' => \\Input::get('token'),\n 'password' => \\Input::get('password'),\n 'password_confirmation' => \\Input::get('password_confirmation'),\n );\n\n // By passing an array with the token, password and confirmation\n if ($this->repository->resetPassword($input)) {\n \\Notification::success(\n \\Notification::message(\\Lang::get('users::app.password.reset.succeeded'))->flash()\n );\n\n return \\Redirect::route('app.session.login');\n } else {\n \\Notification::error(\n \\Notification::message(\\Lang::get('users::app.password.reset.error'))->flash()\n );\n\n return \\Redirect::route('app.users.reset.password', array('token' => $input['token']));\n }\n }",
"public function sendPasswordResetRequest() {\r\n\t\t$user_model = $this->load_model('UserModel');\t\r\n\t\t$user_data = $user_model->getUserByEmail($this->params['forgotten_password_email']);\r\n\t\t\r\n\t\tif($user_data !== null){\r\n\t\t\t$password_reset = $this->generatePasswordResetLink($user_data['ID'], $this->params['forgotten_password_email']);\r\n\t\t\t\r\n\t\t\t$password_reset_model = $this->load_model('PasswordResetModel');\r\n\t\t\t$password_reset_model->insertHash($user_data['ID'], $password_reset['hash']);\r\n\t\t\t\r\n\t\t\tif(Utils::sendPasswordResetEmail($this->params['forgotten_password_email'], $password_reset['link'])){\r\n\t\t\t\t$this->sendResponse(1, true);\r\n\t\t\t} else {\r\n\t\t\t\t$this->sendResponse(0, ErrorCodes::EMAIL_ERROR);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t$this->sendResponse(0, array('field' => 'forgotten_password_email', 'error_code' => ErrorCodes::EMAIL_NOT_FOUND));\r\n\t\t}\r\n\t}",
"public function doResetPassword()\n {\n // if user is logged in, do not let him access this page\n if( Session::isLoggedIn() )\n {\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n return;\n }\n\n $userID = SCMUtility::cleanText($_POST['userID']);\n $userNewPassword = SCMUtility::stripTags($_POST['new_reset_password']);\n\n // validate\n $validator = Validator::make(array('password'=>$userNewPassword),User::$rulesPasswordChange,User::$rulesMessages);\n\n if($validator->fails())\n {\n SCMUtility::setFlashMessage('Password reset failed. Error: '.$validator->messages()->first(),'danger');\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n return;\n }\n\n // update user password\n $user = User::find($userID);\n\n if( ! $user )\n {\n SCMUtility::setFlashMessage('Sorry, we cannot find any user associated with that email address.','danger');\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n return;\n }\n\n $user->password = $userNewPassword;\n $user->save();\n\n SCMUtility::setFlashMessage('Your password have been reset. You can now login using your new password.','success');\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n return;\n }",
"public function sendResetLink()\n {\n return $this->authService->sendPasswordResetLink(request()->input('email'));\n }",
"public function post_reset_request()\n {\n $rules = array();\n $rules['email'] = 'required|email';\n\n $v = Validator::make( Input::all(), $rules );\n if ($v->fails()) {\n return Redirect::to( Config::get('user.reset_route', Config::get('user::config.reset_route')) )\n ->with_errors($v)\n ->with_input();\n }\n\n $user = User::where_email(Input::get('email'))->first();\n\n if(!$user && !Config::get('user.enable_reset_obfuscation', Config::get('user::config.enable_reset_obfuscation'))) {\n return Redirect::to( Config::get('user.reset_route', Config::get('user::config.reset_route')) )\n ->with('error', 'No account is registered with this e-mail address.'); \n } elseif($user) {\n $url = $user->get_pass_reset_url();\n\n $view = View::exists('user.email.reset_request') ? 'user.email.reset_request' : 'user::email.reset_request';\n $body = View::make( $view )->with('url', $url)->render(); \n $site_name = Config::get('application.site_name', Request::server('http_host'));\n $subject = '[' . $site_name . '] Password reset request';\n\n mail($user->email, $subject, $body);\n }\n\n Event::fire('user: password reset request');\n\n return Redirect::to( Config::get('user.reset_route', Config::get('user::config.reset_route')) )\n ->with('success', 'Check your e-mail for link to reset your password'); \n }",
"public function postAction()\n {\n try {\n // validate the form\n $validator = $this->form->getValidator();\n if ($validator->fails()) {\n return Redirect::back()\n ->withErrors($validator)\n ->withInput();\n }\n\n // Find the user using the user id\n $id = $this->form->getId();\n $user = $this->sentry->findUserById($id);\n\n // Check if the reset password code is valid\n $resetPasswordCode = $this->form->getResetPasswordCode();\n if ($user->checkResetPasswordCode($resetPasswordCode))\n {\n // Attempt to reset the user password\n $password = $this->form->getPassword();\n if ($user->attemptResetPassword($resetPasswordCode, $password))\n {\n // Password reset passed, log the user in!\n $pvsUser = $this->userRepo->getByUserId($user->getId(), true);\n if (!$pvsUser) {\n throw new UserNotFoundException();\n }\n\n // reset suspended account\n $email = $this->form->getEmail();\n $this->authenticationManager->unSuspendUser($email);\n\n $user = $this->authenticationManager->loginUser(\n $email,\n $password,\n false,\n $pvsUser->practice_id\n );\n\n return $this->makeView('login.password-reset-success', compact('user'));\n }\n else\n {\n // Password reset failed\n throw new \\Exception('Password reset failed. Please make a fresh request to reset your password.');\n }\n }\n else\n {\n // The provided password reset code is Invalid\n throw new \\Exception('The provided password reset code is invalid. Please make a fresh request to reset your password.');\n }\n }\n catch (UserNotFoundException $e)\n {\n return Redirect::route('login-form')->withErrors(\"We encountered errors resetting your password.\");\n } catch (UserBannedException $e) {\n return Redirect::route('login-form')->withErrors(\"We encountered errors resetting your password.\");\n }\n }",
"public function resetPassword()\n {\n $model_data = array(\n 'token' => $this->input->post('token'),\n 'password' => $this->input->post('password'),\n 'con_password' => $this->input->post('con_password'),\n );\n $status = $this->authentication_worker->resetPassword($model_data);\n \n if ($status == \"true\") {\n $this->mViewData['data'] = array(\n 'pageName' => \"LOGIN\",\n );\n $this->session->set_flashdata('success_msg', 'Senha alterada com sucesso');\n redirect('home/Entrar');\n } else {\n $this->session->set_flashdata('error_msg', 'Erro ao redefinir a senha');\n $this->mViewData['data'] = array(\n 'pageName' => \"LOGIN\",\n );\n redirect('home/Entrar');\n }\n }",
"public function forgotAction()\n {\n if (Zend_Auth::getInstance()->hasIdentity()) {\n $this->_helper->redirector->gotoRoute(array(), 'default', true);\n return;\n }\n\n $realm = $this->_getParam('realm', null);\n\n if (is_null($realm)) {\n throw new Ot_Exception_Input('msg-error-realmNotFound');\n }\n\n // Set up the auth adapter\n $authAdapter = new Ot_Model_DbTable_AuthAdapter();\n $adapter = $authAdapter->find($realm);\n\n if (is_null($adapter)) {\n\n throw new Ot_Exception_Data(\n $this->view->translate('ot-login-signup:realmNotFound', array('<b>' . $realm . '</b>'))\n );\n }\n\n if ($adapter->enabled == 0) {\n throw new Ot_Exception_Access('msg-error-authNotSupported');\n }\n\n $className = (string)$adapter->class;\n $auth = new $className();\n\n if (!$auth->manageLocally()) {\n throw new Ot_Exception_Access('msg-error-authNotSupported');\n }\n\n $form = new Ot_Form_ForgotPassword();\n\n if ($this->_request->isPost()) {\n if ($form->isValid($_POST)) {\n\n $account = new Ot_Model_DbTable_Account();\n\n $userAccount = $account->getByUsername($form->getValue('username'), $realm);\n\n if (!is_null($userAccount)) {\n $loginOptions = array();\n $loginOptions = Zend_Registry::get('applicationLoginOptions');\n\n // Generate key\n $text = $userAccount->username . '@' . $userAccount->realm . '-' . time();\n $key = $loginOptions['forgotpassword']['key'];\n $iv = $loginOptions['forgotpassword']['iv'];\n $cipher = $loginOptions['forgotpassword']['cipher'];\n\n $code = bin2hex(mcrypt_encrypt($cipher, $key, $text, MCRYPT_MODE_CBC, $iv));\n\n $this->_helper->messenger->addSuccess('msg-info-passwordResetRequest');\n\n $loggerOptions = array('attributeName' => 'accountId', 'attributeId' => $userAccount->accountId);\n\n $this->_helper->log(Zend_Log::INFO, 'User ' . $userAccount->username . ' sent a password reset request.', $loggerOptions);\n\n $dt = new Ot_Trigger_Dispatcher();\n $dt->setVariables(array(\n 'firstName' => $userAccount->firstName,\n 'lastName' => $userAccount->lastName,\n 'emailAddress' => $userAccount->emailAddress,\n 'username' => $userAccount->username,\n 'resetUrl' => Zend_Registry::get('siteUrl') . '/login/password-reset/?key=' . $code,\n 'loginMethod' => $userAccount->realm,\n ));\n\n $dt->dispatch('Login_Index_Forgot');\n\n $this->_helper->redirector->gotoRoute(array('realm' => $realm), 'login', true);\n } else {\n $this->_helper->messenger->addError('msg-error-userAccountNotFound');\n }\n } else {\n $this->_helper->messenger->addError('msg-error-invalidFormInfo');\n }\n }\n\n $this->_helper->pageTitle('ot-login-forgot:title');\n $this->view->assign(array(\n 'form' => $form,\n ));\n }",
"public function resetPassword()\n\t{\n\n\t\tif ($this->common->isLoggedIn()) {\n\t\t\t$this->url->redirect('dashboard');\n\t\t}\n\n\t\t$data['error'] = '';\n\t\tif (isset($this->session->data['error'])) {\n\t\t\t$data['error'] = $this->session->data['error'];\n\t\t\tunset($this->session->data['error']);\n\t\t}\n\n\t\t$data['success'] = '';\n\t\tif (isset($this->session->data['success'])) {\n\t\t\t$data['success'] = $this->session->data['success'];\n\t\t\tunset($this->session->data['success']);\n\t\t}\n\t\t$data['mail'] = $this->url->get('id');\n\t\t$data['hash'] = $this->url->get('temp');\n\t\t\n\t\tif (empty($data['mail']) && empty($data['hash']) ) {\n\t\t\t$this->url->redirect('login');\n\t\t}\n\t\t$this->loginModel = new Login();\n\t\tif (!$this->loginModel->checkEmailHash($data)) {\n\t\t\t$this->url->redirect('login');\n\t\t}\n\t\t\n\t\t$data['info'] = $this->commons->getInfo();\n\n\t\t/*Load Language File*/\n\t\trequire DIR_BUILDER.'language/'.$data['info']['language'].'/common.php';\n\t\t$data['lang']['common'] = $lang;\n\t\trequire DIR_BUILDER.'language/'.$data['info']['language'].'/login.php';\n\t\t$data['lang']['login'] = $login;\n\t\t\n\t\t$data['token'] = hash('sha512', TOKEN . TOKEN_SALT);\n\t\t$data['action'] = URL.DIR_ROUTE.'reset';\n\t\t$this->view->render('auth/reset_password.tpl', $data);\n\t}",
"public function test_admin_can_send_request_reset_password()\n {\n $postedEmail = $this->post(route('api.admin.auth.password.postEmail'), ['email' => $this->admin->email]);\n $postedEmail->assertResponseOk()->isJson();\n }",
"public function forgotPassword($post)\n {\n $response = array();\n\n //check phone No exist or not\n $userData = $this->getUserModel()->getLocalUserByPhoneNo($post['phoneNo']);\n\n if (count($userData) > 0) {\n \n $verifyCodeMatch = true;\n while ($verifyCodeMatch == true) {\n \n $verifyCode = rand('111111', '999999');\n $getUserInfo = $this->getUserModel()->passwordVerifyCodeExist($verifyCode);\n if (count($getUserInfo) == 0) {\n $verifyCodeMatch = false;\n }\n }\n \n $updateUserData['passVerifyCode'] = $verifyCode;\n\n $this->getUserModel()->updateUser($userData['Id'], $updateUserData);\n\n $message = \"Welcome To Mobile Yantra Game\\r\\n Hi,\".$userData['name'].\"\\r\\nYour verify code is:\".$verifyCode;\n //send SMS to user\n $this->getAppService()->sendSMS($userData['phoneNo'], $message);\n \n $response['status'] = 'success';\n $response['message'] = 'Password Reset code send success.';\n } else {\n $response['status'] = 'error';\n $response['message'] = 'Phone-No does not exist.Please check your Phone No.';\n }\n\n return $response;\n }",
"public function forgotpasswordAction() {\n $form = new Admin_Form_ResendPassword();\n if ($this->getRequest()->isPost()) {\n if ($form->isValid($this->_request->getPost())) {\n //check user is registered\n $values = $form->getValues();\n $siteUsersMapper = new Application_Model_Table_AdminUsers();\n $exists = $siteUsersMapper->fetchByUsername($values['email_address']);\n if($exists){\n //user exists\n $recoveryEmailsMapper = new Application_Model_Table_AdminUserRecoveryEmails();\n $recoveryEmail = $recoveryEmailsMapper->createRow();\n $recoveryEmail->admin_user_id = $exists->admin_user_id;\n $recoveryEmail->email_address = $exists->username;\n $recoveryEmail->hashActivationKey();\n $recoveryEmail->save();\n }\n $this->_helper->FlashMessenger->addMessage('You password has been reset, please check your email' , 'successful');\n $this->_helper->redirector->goToRouteAndExit(array(), 'admin-dashboard', true);\n }\n }\n $this->view->form = $form;\n }",
"public function resetPasswordAction()\n {\n $uid = $this->params()->fromRoute('id', null);\n $user=$this->getUserMapper()->getUserById($uid);\n $form = $this->getForm(UserFormService::CONFIRM_FORM);\n\n /* @var $request \\Zend\\Http\\Request */\n $request = $this->getRequest();\n if ($request->isPost()) {\n\n $postData = $request->getPost();\n //cancel\n if (isset($postData['cancel'])) {\n return $this->redirect()->toRoute('user');\n }\n if (isset($postData['submit'])) {\n\n $password = $this->getPasswordService()->generatePassword();\n $user->setPassword($password);\n $pwdPlain = $this->getPasswordService()->getPlainPassword();\n $user->setPasswordPlain($pwdPlain);\n $date = new \\DateTime();\n $user->setPwdChange($date);\n $this->getUserMapper()->save($user);\n\n /* @var $mail \\User\\Mail\\CredentialsMail */\n $mail = $this->getMailService()->getMail(MailService::CREDENTIALS_MAIL);\n $mail->setUser($user);\n $mail->sendMail($user);\n $this->flashMessenger()->addSuccessMessage('Password Reset');\n\n return $this->redirect()->toRoute('user');\n }\n }\n\n return new ViewModel(\n array(\n 'user' => $user,\n 'form'=> $form,\n )\n );\n }",
"public function retrievePasswordAction() {\r\n\t\t$email = $this->getRequest()->getPost('email', false);\r\n\t\t$result = array();\r\n\t\tif ($email) {\r\n\t\t\t$customer = Mage::getModel('customer/customer')\r\n ->setWebsiteId(Mage::app()->getStore()->getWebsiteId())\r\n ->loadByEmail($email); \r\n\t\t\tif ($customer->getId()) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\t$newPassword = $customer->generatePassword();\r\n\t\t\t\t\t$customer->changePassword($newPassword, false);\r\n\t\t\t\t\t$customer->sendPasswordReminderEmail();\r\n\t\t\t\t\t$result = array('success' => true);\r\n\t\t\t\t}\r\n\t\t\t\tcatch (Exception $e){\r\n\t\t\t\t\t$result = array('success' => false, 'error' => $e->getMessage());\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$result = array('success' => false, 'error' => 'This email address was not found in our records.');\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\t$this->getResponse()->setBody(Zend_Json::encode($result));\r\n\t}",
"protected function sendResetResponse($response)\n {\n return redirect()->route('password.resetcompleted')->with('status', trans($response));\n }",
"public function resetPassword()\n {\n $result['error'] = false;\n $result['message'] = '';\n $this->setRules([ 'token' => 'required', StringLiterals::PASSWORD => 'required|min:6',//'password_confirmation' => 'required|same:password|min:6' \n ]);\n $this->_validate();\n $customerInfo = $this->_customer->where('forgot_password', $this->request->token)->first();\n if (!empty($customerInfo)) {\n $customerInfo->forgot_password = null;\n $customerInfo->password = Hash::make($this->request->password);\n $customerInfo->save();\n } else {\n $result['error'] = true;\n $result['message'] = trans('passwords.token');\n }\n return $result;\n }",
"public function forgot_password()\n\t{\n\t\t$email = Input::get('email');\n\n\t\t//Get reset code and send email\n\t\tif($resetCode = $this->repo->getResetCode($email))\n\t\t{\n\t\t\treturn View::make('authentication.confirm_reset_code_sent')->with('email',$email)->with('resetCode',$resetCode);\n\t\t}\n\t\treturn View::make('authentication.forgot_password')->withInput(Input::all()); \n\t}",
"public function postRemind()\n\t{\n // Make sure the user has verified their email address\n $user = User::wherePendingEmail(Input::get('email'))->first();\n if($user && $user->email_verified == 0) {\n return Redirect::back()->with('error', Lang::get('reminders.unverified'));\n }\n\n\t\tswitch ($response = Password::remind(Input::only('email')))\n\t\t{\n\t\t\tcase Password::INVALID_USER:\n\t\t\t\treturn Redirect::back()->with('error', Lang::get($response));\n\n\t\t\tcase Password::REMINDER_SENT:\n\t\t\t\treturn Redirect::back()->with('status', Lang::get($response));\n\t\t}\n\t}",
"public function postRecover()\n\t{\n\t\t$inputs = Input::get('recover');\n\n\t\t$expires = Config::get('auth.reminder.expire');\n\t\t$reminder = Models\\PasswordReminder::whereToken($inputs['token'])->where(\"created_at\", \">\", DB::raw(\"NOW() - INTERVAL $expires MINUTE\"))->first();\n\t\tif (!$reminder) {\n\t\t\t$this->setFormErrors(\"recover.password\", \"Sorry, invalid or expired token\");\n\t\t}\n\n\t\tif (empty($this->formErrors)) {\n\t\t\t$user = Models\\User::whereEmail($reminder->email)->first();\n\t\t\tif (!$user) {\n\t\t\t\t$this->setFormErrors(\"recover.password\", \"Can't seem to find your email in the system\");\n\t\t\t}\n\t\t}\n\n\t\tif (empty($this->formErrors)) {\n\t\t\t$user->password = $inputs['password'];\n\t\t\tif ($user->isInvalid()) {\n\t\t\t\t$this->setFormErrors('recover', $user->getErrors());\n\t\t\t} else {\n\t\t\t\t$user->save();\n\t\t\t}\n\t\t}\n\n\t\tif (empty($this->formErrors)) {\n\n\t\t\tModels\\PasswordReminder::whereEmail($user->email)->delete();\n\n\t\t\tFlash::success('Your password has been successfully updated!');\n\n\t\t\treturn [\n\t\t\t\t'success' => true,\n\t\t\t];\n\t\t} else {\n\t\t\tthrow new ValidationException(['errors' => $this->formErrors]);\n\t\t}\n\n\t}",
"public function forgot_pwd()\r\n {\r\n //provided the correct combination of user name and email address\r\n\r\n $username = htmlspecialchars($_POST['username']);\r\n $email = htmlspecialchars($_POST['email']);\r\n\r\n require_once 'database/profile.php';\r\n require_once 'database/session.php';\r\n\r\n $usernameId = getUserId($username);\r\n if (!$usernameId) {\r\n return \"Username does not exist.\";\r\n }\r\n\r\n $userInfo = getProfile($usernameId);\r\n if ($userInfo[\"email\"] != $email) {\r\n return \"Email doesn't match the one we have on file.\";\r\n }\r\n\r\n $password = getPassword($userId);\r\n return $this->send_forgotten_pwd($username, $password, $email);\r\n \r\n }",
"public function passwordAction()\n {\n $token = $this->get('request')->get('token');\n if (!$token) {\n return $this->render('FOMUserBundle:Login:error-notoken.html.twig');\n }\n\n $user = $this->getDoctrine()->getRepository(\"FOMUserBundle:User\")->findOneByResetToken($token);\n if (!$user) {\n $mail = $this->container->getParameter('fom_user.mail_from_address');\n return $this->render('FOMUserBundle:Login:error-notoken.html.twig', array(\n 'site_email' => $mail));\n }\n\n $max_token_age = $this->container->getParameter(\"fom_user.max_reset_time\");\n if (!$this->checkTimeInterval($user->getResetTime(), $max_token_age)) {\n $form = $this->createForm('form');\n return $this->render('FOMUserBundle:Login:error-tokenexpired.html.twig', array(\n 'user' => $user,\n 'form' => $form->createView()\n ));\n }\n\n $form = $this->createForm(new UserResetPassType(), $user);\n $form->bind($this->get('request'));\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $user->setResetToken(null);\n\n $helper = new UserHelper($this->container);\n $helper->setPassword($user, $user->getPassword());\n\n $em->flush();\n\n return $this->redirect($this->generateUrl('fom_user_password_done'));\n }\n\n return array(\n 'user' => $user,\n 'form' => $form->createView());\n }",
"public function lostPassword()\n {\n if (!$this->request->is('post')) {\n $this->_respondWithMethodNotAllowed();\n return;\n }\n\n $user = $this->Users->findByEmail($this->request->getData('email'));\n\n if ($user) {\n $token = $this->Tokens->create($user, TokensTable::TYPE_LOST_PASSWORD);\n try {\n $this->getMailer('User')->send('lostPassword', [$user, $token->token]);\n $message = __('Please check your inbox and follow the instructions in the mail to reset your password.');\n } catch (\\Exception $e) {\n $this->_respondWithBadRequest();\n $message = 'Mailer not configured.';\n }\n }\n\n $this->set('message', $message);\n $this->set('_serialize', 'message');\n }",
"public function requestPassReset()\n {\n $this->form->addText('email', 'Email')\n ->setRequired('Email field is required')\n ->addRule(Form::EMAIL, 'Please write a valid email address')\n ->addRule(callback($this, 'checkEmailExists'), 'Sorry, the email %value does not exists on our registry', 'email');\n\n $this->form->addSubmit('send', 'Reset Password');\n\n $this->form->onSuccess[] = callback($this, 'requestPassResetProcess');\n return $this->form;\n }",
"public function lostPassword() {\n $this->form_validation->set_rules('email', 'Email', 'required');\n\n if ($this->form_validation->run() === FALSE) {\n \t$this->error(400, 'Validation error');\n }\n \n $this->loadUser();\n \n $this->user_model->setValue(\n \t'temp_code', $this->generateTempCode());\n $this->user_model->setValue(\n \t'temp_code_valid_until', date('Y-m-d H:i:s', strtotime('+ 2 days')));\n \t\n if (! $this->user_model->updateTempCode()) {\n \t$this->error(400, 'Something went wrong');\n }\n\n\t\t$this->sendEmail(\n\t\t\t$this->input->post('email'), \n\t\t\t'Set New Password', \n\t\t\t$this->getLostPasswordMailBody($this->user_model->getValue('temp_code')));\n\t\t$data['msg'] = 'New password mail for ' . $this->input->post('email') . ' sent.';\n\t\t$this->response($data);\n }",
"public function passwordResetCompleted() {\n\t\treturn view(\"pages.passwordreset.resetcompleted\");\n\t}",
"public function getForgotPassSuccess()\n {\n return view(\"Home::auth.forgotpasssuccess\");\n }",
"public function testResetPassword()\n\t{\n\t\t$return = $this->auth->requestReset($this->email);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang(\"Auth.email_incorrect\"));\n\n\t\t$return = $this->auth->requestReset($this->newEmail);\n\n\t\t$this->assertFalse($return['error']);\n\t\t$this->assertSame($return['message'], lang(\"Auth.reset_requested\"));\n\n\t\t$uid = $this->auth->getUID($this->newEmail);\n\t\t$token = $this->auth->getUserRequestToken($uid, 'reset');\n\n\t\t// test invalid token length\n\t\t$return = $this->auth->resetPass(substr($token, 0, 5), $this->password, $this->password);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.resetkey_invalid'));\n\n\t\t// test incorrect token value\n\t\t$return = $this->auth->resetPass('1234567890ABCDEFGHIJ', $this->password, $this->password);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.resetkey_incorrect'));\n\n\t\t// test reset with weak password\n\t\t$return = $this->auth->resetPass($token, $this->weakPassword, $this->weakPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.password_weak'));\n\n\t\t// test reset with unmacth password\n\t\t$return = $this->auth->resetPass($token, $this->password, $this->weakPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.newpassword_nomatch'));\n\n\t\t$currentPassword = 'user@PRO#123';\n\n\t\t// test reset with existing password\n\t\t$return = $this->auth->resetPass($token, $currentPassword, $currentPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.newpassword_match'));\n\n\t\t// test reset with existing password\n\t\t$return = $this->auth->resetPass($token, $this->password, $this->password);\n\n\t\t$this->assertFalse($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.password_reset'));\n\n\t\t$this->auth->login($this->newEmail, $this->password);\n\n\t\t$this->assertTrue($this->auth->isLogged());\n\t}",
"public function resetPasswordAction()\n\t{\n\n\t\t$data = $this->url->post;\n\t\tif (!isset($_POST['reset']) || !$this->validateReset($data)) {\n\t\t\t$this->session->data['error'] = 'Warning: Please enter valid data in input box.';\n\t\t\t$this->url->redirect('login');\n\t\t}\n\n\t\t$token = $this->url->post('_token');\n\t\t$token_check = hash('sha512', TOKEN . TOKEN_SALT);\n\t\tif (hash_equals($token_check, $token) === false ) {\n\t\t\t$this->session->data['error'] = 'Warning: Invalid token. Please try again.';\n\t\t\t$this->url->redirect('login');\n\t\t}\n\t\t$this->loginModel = new Login();\n\t\t$check = $this->loginModel->checkEmailHash($data);\n\t\tif (empty($check)) {\n\t\t\t$this->url->redirect('login');\n\t\t} else {\n\t\t\t$result = $this->loginModel->updatePassword($data);\n\t\t\t$this->session->data['success'] = 'Success: Your Password Changed Succesfully.';\n\t\t\t$this->url->redirect('login');\n\t\t}\n\n\t\t\n\t}",
"public function forgotPasswordAction()\n {\n $form = new ForgotPasswordForm();\n\n if ($this->request->isPost())\n {\n if($this->security->checkToken())\n {\n // Send emails only is config value is set to true\n if ($this->getDI()->get('config')->useMail) {\n\n if ($form->isValid($this->request->getPost()) == false) {\n foreach ($form->getMessages() as $message) {\n $this->flash->error($message);\n }\n } else {\n\n $user = Users::findFirstByEmail($this->request->getPost('email'));\n if (!$user) {\n $this->flash->success('There is no account associated to this email');\n } else {\n\n $resetPassword = new ResetPasswords();\n $resetPassword->usersId = $user->id;\n if ($resetPassword->save()) {\n // $this->flash->success('Success! Please check your messages for an email reset password');\n $this->flashSess->success(\"Success! Please check your messages for an email reset password\");\n $this->view->disable();\n return $this->response->redirect('');\n } else {\n foreach ($resetPassword->getMessages() as $message) {\n $this->flash->error($message);\n }\n }\n }\n }\n } else {\n $this->flash->warning('Emails are currently disabled. Change config key \"useMail\" to true to enable emails.');\n }\n }\n else {\n $this->flash->error('CSRF Validation is Failed');\n }\n }\n $this->view->form = $form;\n }",
"public function do_forgot_password()\n {\n if( Confide::forgotPassword( Input::get( 'email' ) ) )\n {\n $notice_msg = Lang::get('confide::confide.alerts.password_forgot');\n return Redirect::action('UserController@login')\n ->with( 'notice', $notice_msg );\n }\n else\n {\n $error_msg = Lang::get('confide::confide.alerts.wrong_password_forgot');\n return Redirect::action('UserController@forgot_password')\n ->withInput()\n ->with( 'error', $error_msg );\n }\n }",
"public function postReset(Request $request, $code)\n {\n $validator = \\Validator::make($request->all(),[\n 'password' => 'required|confirmed|min:6',\n ]);\n\n // Attempt the password reset\n $result = $this->authManager->resetPassword($code, $request->get('password'));\n\n if ($result->isFailure()) {\n $meta['message'] = $result->message;\n $meta['code'] = $result->statusCode;\n } else {\n $meta['message'] = $result->message;\n $meta['code'] = $result->statusCode;\n }\n $code = $result->statusCode;\n\n // Return the appropriate response\n return response()->json(compact('meta','data'),$code);\n // return $this->response->array(compact('meta'))->setStatusCode($code);\n }",
"public function passwordResetConfirmAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n $site = $this->view->site;\n $validator = $this->view->validator;\n\n // set the input params\n $requiredParams = array(\n 'code',\n 'password',\n );\n\n $input = $this->processInput( $requiredParams, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n $password = $input->getUnescaped( 'password' );\n\n // decode the hash and gets its parts, confirm all good and allow user to change password\n list( $userIdentification, $timestamp, $signature ) = explode( '|', base64_decode( urldecode( $input->code ) ) );\n\n // first assume userIdentification is a username\n $user = $site->getUserByUsername( $userIdentification );\n\n // if userIdentification is not a username, use userIdentification as an email address\n if ( ! $user ) {\n $user = $site->getUserByEmailAddress( $userIdentification );\n }\n\n $validator->checkValidUser( $user, $errors );\n $validator->checkValidResetPasswordCode( $site, $userIdentification, $timestamp, $signature, $errors );\n\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n // all passed, so lets change this user's password and log in\n $user->setPassword( $password );\n $user->save();\n\n // set the cookie/log the user in if they are a parent\n// if ( $user->getUserType() == BeMaverick_User::USER_TYPE_PARENT ) {\n// BeMaverick_Cookie::updateUserCookie( $user );\n// }\n\n if ( $user->getUserType() == BeMaverick_User::USER_TYPE_KID ) {\n $toEmailAddress = $user->getParentEmailAddress();\n } else {\n $toEmailAddress = $user->getEmailAddress();\n }\n\n // send mail to recover your password\n $vars = array(\n 'USERNAME' => $user->getUsername(),\n );\n\n BeMaverick_Email::sendTemplate( $site, 'user-reset-password', array( $toEmailAddress ), $vars );\n\n return $this->renderPage( 'authPasswordResetConfirm' );\n }",
"public function forgot_password() {\n\t\t$this->output->append_title('Forgot Password');\n\t\t$data = array();\n\t\tif($this->input->post())\n\t\t{\n\t\t\t$this->form_validation->set_rules('email', 'Email', 'trim|required');\n\t\t\tif($this->form_validation->run() == TRUE)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$email = $this->input->post('email');\n\t\t\t\t\t$subject = 'Password Reset Confirmation';\n\t\t\t\t\t\n\t\t\t\t\t// Find the user using the user email address\n\t\t\t\t\t$user = Sentry::findUserByLogin($email);\n\t\t\t\t\t\n\t\t\t\t\t// Get the password reset code\n\t\t\t\t\t$resetCode = $user->getResetPasswordCode();\n\t\t\t\t\t$url = website_url('auth/reset/'.$resetCode);\n\t\t\t\t\t$template_data = array(\n\t\t\t\t\t\t'email_title' => 'Forgot Password',\n\t\t\t\t\t\t'email_heading' => 'Hello',\n\t\t\t\t\t\t'email_body' => 'There was recently a request to reset your password.\n\t\t\t\t\t\t<br/>If you requested this password change, please click on the following link to reset your password:<br/> <a href=\"'.$url.'\">'.$url.'</a><br/>\n\t\t\t\t\t\tIf clicking the link does not work, please copy and paste the URL into your browser instead.<br/><br/>\n\t\t\t\t\t\tIf you didn\\'t make this request, you can ignore this message and your password will remail the same.\n\t\t\t\t\t\t'\n\t\t\t\t\t);\n\n\t\t\t\t\t$body = $this->parser->parse('emails/user_registration', $template_data,TRUE);\n\t\t\t\t\tif($this->common->sendEmail($email,$subject,$body))\n\t\t\t\t\t{\n\t\t\t\t\t\t$message = array('type' => 'success','message' => 'An email has been sent to your email address with instructions to reset your password.');\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$message = array('type' => 'warning','message' => 'Unable to send email, please try again later.');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (Cartalyst\\Sentry\\Users\\UserNotFoundException $e)\n\t\t\t\t{\n\t\t\t\t\t$message = array('type' => 'danger','message' => 'Email does not exists.');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$message = array('type' => 'danger','message' => $this->message->validation_errors());\n\t\t\t}\n\t\t\t\n\t\t\t$this->message->set($message['type'], $message['message']);\n\t\t}\n\t\t\n\t\t$data['email'] = array('name' => 'email',\n\t\t\t'autofocus' => 'autofocus',\n\t\t\t'id' => 'email',\n\t\t\t'placeholder' => 'Email',\n\t\t\t'class' => 'form-control',\n\t\t\t'type' => 'text',\n\t\t\t//'value' => $this->form_validation->set_value('email')\n\t\t);\n\t\t$this->load->view(parent::$module.'/forgot_password',$data);\n\t}",
"public function post_forgot_password() {\n $fields = array(\n 'code' => Input::get('code'), \n 'email' => Input::get('email'),\n );\n\n $account = Account::where_code(Input::get('code', 0))->first();\n $account_id = 0;\n if(!is_null($account)) {\n $account_id = $account->id;\n }\n \n $rules = array(\n 'code' => 'required|exists:accounts',\n 'email' => 'required|email|exists_in_account:users,email,'.$account_id,\n );\n \n $validation = Validator::make($fields, $rules);\n \n if( $validation->fails() ) {\n Input::flash();\n return Redirect::to_action('login@forgot_password')->with_errors($validation);\n //return $this->get_forgot_password()->with('errors', $validation);\n } else {\n $user = User::where('account_id', '=', $account_id)->where_email(Input::get('email'))->first();\n $new_password = Str::random(6, 'alnum');\n $user->change_password_request = 'Y';\n $user->password = $new_password;\n $user->save();\n \n //------------------------------------------------------------------------------------\n // Send email with the confirmation links\n $mailer = IoC::resolve('mailer');\n $message_body = Response::view('user.emails.password-reset', array('user' => $user, 'password' => $new_password))->render();\n\n // Construct the message\n $message = Swift_Message::newInstance('Password Reset')\n ->setFrom(array('no-reply@test.com'=>'test'))\n ->setTo(array($user->email => $user->name))\n ->setBody($message_body,'text/html');\n\n // Send the email\n $mailer->send($message);\n $this->warnings[] = \"An email with the new password has been sent to your email. Don't forget to check your junk/bulk/spam folder if it doesn't arrive in your inbox.\";\n //------------------------------------------------------------------------------------\n\n return $this->get_forgot_password()\n ->with('warnings', $this->warnings);\n\n }\n \n }",
"function reset_password() {\n $account_type = $this->input->post('account_type');\n if ($account_type == \"\") {\n redirect(base_url(), 'refresh');\n }\n $email = $this->input->post('email');\n $result = $this->email_model->password_reset_email($account_type, $email); //SEND EMAIL ACCOUNT OPENING EMAIL\n if ($result == true) {\n $this->session->set_flashdata('flash_message', get_phrase('password_sent'));\n } else if ($result == false) {\n $this->session->set_flashdata('flash_message', get_phrase('account_not_found'));\n }\n\n redirect(base_url(), 'refresh');\n }",
"public function testDisplaysPasswordResetForm()\n {\n $response = $this->get('/password/reset/token');\n $response->assertStatus(200);\n }",
"public static function lost_password() {\n\t\t/**\n\t\t * After sending the reset link, don't show the form again.\n\t\t */\n\t\tif ( ! empty( $_GET['reset-link-sent'] ) ) {\n\t\t\treturn ur_get_template( 'myaccount/lost-password-confirmation.php' );\n\n\t\t\t/**\n\t\t\t * Process reset key / login from email confirmation link\n\t\t\t */\n\t\t} elseif ( ! empty( $_GET['show-reset-form'] ) ) {\n\n\t\t\tif ( isset( $_COOKIE[ 'wp-resetpass-' . COOKIEHASH ] ) && 0 < strpos( $_COOKIE[ 'wp-resetpass-' . COOKIEHASH ], ':' ) ) {\n\t\t\t\tlist( $rp_login, $rp_key ) = array_map( 'ur_clean', explode( ':', wp_unslash( $_COOKIE[ 'wp-resetpass-' . COOKIEHASH ] ), 2 ) );\n\t\t\t\t$user = self::check_password_reset_key( $rp_key, $rp_login );\n\n\t\t\t\tif ( ! empty( $user ) ) {\n\t\t\t\t\t$form_id = ur_get_form_id_by_userid( $user->ID );\n\t\t\t\t\t$enable_strong_password = ur_get_single_post_meta( $form_id, 'user_registration_form_setting_enable_strong_password' );\n\t\t\t\t\t$minimum_password_strength = ur_get_single_post_meta( $form_id, 'user_registration_form_setting_minimum_password_strength' );\n\n\t\t\t\t\tif ( 'yes' === $enable_strong_password || '1' === $enable_strong_password ) {\n\n\t\t\t\t\t\t// Enqueue script.\n\t\t\t\t\t\twp_enqueue_script( 'ur-password-strength-meter' );\n\t\t\t\t\t\twp_localize_script( 'ur-password-strength-meter', 'enable_strong_password', $enable_strong_password );\n\t\t\t\t\t}\n\n\t\t\t\t\t// reset key / login is correct, display reset password form with hidden key / login values.\n\t\t\t\t\tif ( is_object( $user ) ) {\n\t\t\t\t\t\treturn ur_get_template(\n\t\t\t\t\t\t\t'myaccount/form-reset-password.php',\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'key' => $rp_key,\n\t\t\t\t\t\t\t\t'login' => $rp_login,\n\t\t\t\t\t\t\t\t'enable_strong_password' => $enable_strong_password,\n\t\t\t\t\t\t\t\t'minimum_password_strength' => $minimum_password_strength,\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\tself::set_reset_password_cookie();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Show lost password form by default.\n\t\tur_get_template(\n\t\t\t'myaccount/form-lost-password.php',\n\t\t\tarray(\n\t\t\t\t'form' => 'lost_password',\n\t\t\t)\n\t\t);\n\t}",
"public function reminder()\n {\n $credentials = array\n (\n 'email' => Input::get('email')\n );\n\n $remind = Password::remind($credentials, function($message)\n {\n $message->subject('Kweecker - Nieuw wachtwoord');\n });\n switch($remind)\n {\n case Password::INVALID_USER:\n $code = 400;\n $response = array('message' => 'invalid_user');\n break;\n\n case Password::REMINDER_SENT:\n $code = 200;\n $response = array('message' => 'reminder_sent');\n break;\n }\n\n\n // return the response\n return \\Response::json($response, $code);\n }",
"public function test_can_update_password_after_send_request_reset_password()\n {\n $postUpdatePassword = $this->makeResetPasswordData();\n $existsTokenData = array_only($postUpdatePassword, ['email', 'token']);\n\n $this->seeInDatabase($this->passwordsTable(), $existsTokenData);\n $changedPassword = $this->put(\n route('api.admin.auth.password.resetPassword', $this->token),\n $postUpdatePassword\n );\n $changedPassword->assertResponseOk()->isJson();\n $changedPassword->dontSeeInDatabase($this->passwordsTable(), $existsTokenData);\n }",
"public function resetPassword()\n {\n /**\n * @var User|MustVerifyEmail $user\n */\n $user = User::findOrFail($this->request->input('id', null));\n\n if(!$user instanceof User) {\n $this->apiResponse->setError(\"No user with that ID found.\");\n } else {\n if (! hash_equals((string) $this->request->input('id'), (string) $user->getKey())) {\n throw new AuthorizationException;\n }\n\n if (! hash_equals((string) $this->request->input('hash'), sha1($user->getEmailForVerification()))) {\n throw new AuthorizationException;\n }\n\n /**\n * @var $validator Validator\n */\n $validator = app()->make('validator')->make($this->request->input(), [\n 'password' => 'required|confirmed',\n 'password_confirmation' => 'required',\n ]);\n\n if ($validator->passes()) {\n $user->setPassword($this->request->input('password'));\n $this->apiResponse->setSuccess(['changed' => $user->save()]);\n } else {\n $this->apiResponse->handleErrors($validator);\n }\n }\n\n return $this->apiResponse->returnResponse();\n }",
"public function successPassword() {\n $this->loadFrontView('profile/after_password_reset');\n }",
"public function execute()\n {\n $email = (string)$this->getRequest()->getParam('email');\n $params = $this->getRequest()->getParams();\n\n /** @var \\Magento\\Framework\\Controller\\Result\\Redirect $resultRedirect */\n $resultRedirect = $this->resultRedirectFactory->create();\n if (!empty($email) && !empty($params)) {\n // Validate received data to be an email address\n if (\\Zend_Validate::is($email, EmailAddress::class)) {\n try {\n $this->securityManager->performSecurityCheck(\n PasswordResetRequestEvent::ADMIN_PASSWORD_RESET_REQUEST,\n $email\n );\n } catch (SecurityViolationException $exception) {\n $this->messageManager->addErrorMessage($exception->getMessage());\n return $resultRedirect->setPath('admin');\n }\n /** @var $collection \\Magento\\User\\Model\\ResourceModel\\User\\Collection */\n $collection = $this->userCollectionFactory->create();\n $collection->addFieldToFilter('email', $email);\n $collection->load(false);\n\n try {\n if ($collection->getSize() > 0) {\n foreach ($collection as $item) {\n /** @var \\Magento\\User\\Model\\User $user */\n $user = $this->_userFactory->create()->load($item->getId());\n if ($user->getId()) {\n $newPassResetToken = $this->backendDataHelper->generateResetPasswordLinkToken();\n $user->changeResetPasswordLinkToken($newPassResetToken);\n $user->save();\n $this->notificator->sendForgotPassword($user);\n }\n break;\n }\n }\n } catch (\\Exception $exception) {\n $this->messageManager->addExceptionMessage(\n $exception,\n __('We\\'re unable to send the password reset email.')\n );\n return $resultRedirect->setPath('admin');\n }\n // @codingStandardsIgnoreStart\n $this->messageManager->addSuccess(__('We\\'ll email you a link to reset your password.'));\n // @codingStandardsIgnoreEnd\n $this->getResponse()->setRedirect(\n $this->backendDataHelper->getHomePageUrl()\n );\n return;\n } else {\n $this->messageManager->addError(__('Please correct this email address:'));\n }\n } elseif (!empty($params)) {\n $this->messageManager->addError(__('Please enter an email address.'));\n }\n $this->_view->loadLayout();\n $this->_view->renderLayout();\n }",
"public function admin_reset() {\n\n\t\tif(Input::_method()) {\n\t\t\t$id = Input::post('uid');\n\n\t\t\t$res = $this->_password_reset->_validate_userid($id);\n\n\t\t\tif($res > 0) {\n\n\t\t\t\t$_res = $this->_password_reset->getData_id($id);\n\n\t\t\t\t$key = $this->random_string('alnum',100);\n\n\t\t\t\t$_success = array(\n\t\t\t\t\t'userid' => $_res['user_id'],\n\t\t\t\t\t'token' => $key,\n\t\t\t\t\t'datetime' => date(\"Y-m-d H:i:s\")\n\t\t\t\t);\n\n\t\t\t\t$body = $this->admin_mail_body($_res,$key);\n\n\t\t\t\t$subject = Constant::PASSWORD_RETRIEVAL;\n\n\t\t\t\t$from = 'reset-password@'.trim($_SERVER['SERVER_NAME']);\n\n\t\t\t\t$this->_email->setFrom($from,'Admin Inventory');\n\t\t\t\t$this->_email->setTo($_res['email']);\n\t\t\t\t$this->_email->setSubject(Constant::PASSWORD_RETRIEVAL);\n\t\t\t\t$this->_email->setMessage($body);\n\n\t\t\t\t$success = $this->_password_reset->_insert_token($_success);\n\n\t\t\t\tif($success) {\n\t\t\t\t\tif($this->_email->send()) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\t\t\t\t\texit;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\theader(\"HTTP/1.0 404 Not Found\");\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t}",
"function reset_password()\n {\n $account_type = $this->input->post('account_type');\n if ($account_type == \"\") {\n redirect(base_url(), 'refresh');\n }\n $email = $this->input->post('email');\n $result = $this->email_model->password_reset_email($account_type, $email); //SEND EMAIL ACCOUNT OPENING EMAIL\n if ($result == true) {\n $this->session->set_flashdata('flash_message', get_phrase('password_sent'));\n } else if ($result == false) {\n $this->session->set_flashdata('flash_message', get_phrase('account_not_found'));\n }\n\n redirect(base_url(), 'refresh');\n }",
"public function actionReset()\n {\n if (!$this->module->resetPassword) {\n throw new ForbiddenHttpException();\n }\n\n $this->registerAsset(Login::class);\n\n $model = new ResetPasswordForm();\n $error = false;\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n $user = User::findByEmail($model->email);\n if ($user) {\n $user->password_verification_token = Yii::$app->security->generateRandomString();\n $user->password_verification_token_timestamp = time() + $this->module->resetPasswordExpirationTime;\n if ($user->update(true, ['password_verification_token_timestamp' , 'password_verification_token'])) {\n // token and timestamp has been stored. send mail.\n $mail = Yii::$app->mail;\n $mail->layout = false; // ensure layout is disabled even when enabled in application config\n $send = $mail\n ->compose(Module::t('reset_email_subject'), User::generateResetEmail(\n Url::toRoute(['/admin/login/password-reset', 'token' => $user->password_verification_token, 'id' => $user->id], true),\n Module::t('reset_email_subject'),\n Module::t('reset_email_text')\n ))\n ->address($user->email)\n ->send();\n\n if (!$send) {\n $error = true;\n $model->addError('email', Module::t('reset_mail_error'));\n }\n }\n }\n\n if (!$error) {\n Yii::$app->session->setFlash('reset_password_success');\n return $this->refresh();\n }\n }\n\n return $this->render('reset', [\n 'model' => $model,\n ]);\n }",
"public function resetAction() {\n if ($this->request->isPost()) {\n //Gets the information from the request, sees if its an email, and sees if there is an email associated with that request. \n $email = $this->request->getPost('email');\n if(!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n $this->flash->error(\"This is not an email :(\");\n return $this->forward('session/tryreset');\n }\n $user = Users::findFirst(\n array( //emails are unique so its fine\n \"(email = :email:)\",\n 'bind' => array('email' => $email) \n )\n );\n //The idea with this is to not give the user an idea of whether that email is an account. \n if($user) { //This means there is a user with that email\n $user->verify = uniqid();; //Reset the verify string that was used upon registration\n $user->verify_timer = time();\n if($user->save() == false) {\n $this->flash->success(\"Internal error could not verify\");\n return $this->forward('session/index');\n }\n //Send verification email:\n $notice = new Mailer('scott@huson.com', 'Someone Reset Password', 'Name: '.$user->name.'<br/>Email: '.$user->email.'<br/>'.$user->verify.'<br/>END.');\n $email = new Mailer($user->email, 'Requested Password Reset', 'Hi '.$user->name.',<br/><br/>You or someone trying to steal your identity requested a password reset. We are happy to have you back!<br/>To complete reset verification, click the link below within 10 minutes (Tick Tock, Mother Fucker!).<br/>http://brownbytes.org/session/verifyreset/'.$user->verify.'<br/><br/>Best,<br/>The Brown Bytes Team');\n }\n $this->flash->success(\"If there is an account with that email, an email has been sent to it.\");\n }\n return $this->forward('session/index');\n }",
"public function sendEmail() {\n\t\t/* @var $user User */\n\t\t$user = User::findOne([\n\t\t\t'status' => User::STATUS_ACTIVE,\n\t\t\t'email' => $this->email,\n\t\t]);\n\n\t\tif (!$user) {\n\t\t\tYii::info(\"Send password reset email failed: user not found for {$this->email}.\", __METHOD__);\n\t\t\treturn false;\n\t\t}\n\t\tif (($token = $user->validPasswordResetToken) == null) {\n\t\t\t$token = new PasswordResetToken;\n\t\t\t$token->user_id = $user->id;\n\t\t\t$token->requestIP = Yii::$app->request->userIP;\n\t\t\t$token->expire = time() + Yii::$app->params['user.passwordResetTokenExpire'];\n\t\t\tdo {\n\t\t\t\t$token->token = Yii::$app->security->generateRandomString();\n\t\t\t} while (!$token->validate('token'));\n\t\t\tif (!$token->save()) {\n\t\t\t\tYii::error([\n\t\t\t\t\t\"Save new PasswordRestToken failed\",\n\t\t\t\t\t'error' => $token->errors,\n\t\t\t\t], __METHOD__);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn Yii::$app->mailer->compose([\n\t\t\t\t'html' => 'passwordResetToken-html',\n\t\t\t\t'text' => 'passwordResetToken-text'\n\t\t\t], [\n\t\t\t\t'username' => $user->username,\n\t\t\t\t'token' => $token->token,\n\t\t\t])->setFrom([Yii::$app->params['supportEmail'] => Yii::$app->name . ' robot'])\n\t\t\t->setTo($this->email)\n\t\t\t->setSubject('Password reset for ' . Yii::$app->name)\n\t\t\t->send();\n\t}",
"public function handleForgot()\n {\n if (! empty($_POST[\"username\"])) {\n $memberRecord = $this->getMember($_POST[\"username\"]);\n require_once __DIR__ . \"/PasswordReset.php\";\n $passwordReset = new PasswordReset();\n $token = $this->generateRandomString(97);\n if (! empty($memberRecord)) {\n $passwordReset->insert($memberRecord[0]['id'], $token);\n $this->sendResetPasswordEmail($memberRecord, $token);\n } else {\n // the input username is invalid\n // do not display a message saying 'username as invalid'\n // that is a security issue. Instead,\n // sleep for 2 seconds to mimic email sending duration\n sleep(2);\n }\n }\n // whatever be the case, show the same message for security purposes\n $displayMessage = array(\n \"status\" => \"success\",\n \"message\" => \"Check your email to reset password.\"\n );\n return $displayMessage;\n }",
"public function execute()\n {\n if ($this->lsr->isLSR($this->lsr->getCurrentStoreId())) {\n /** @var Redirect $resultRedirect */\n $resultRedirect = $this->resultRedirectFactory->create();\n $email = (string)$this->getRequest()->getPost('email');\n if ($email) {\n /** @var Entity\\ForgotPasswordResponse | null $result */\n try {\n $search = $this->contactHelper->searchWithUsernameOrEmail($email);\n if ($search) {\n $websiteId = $this->storeManager->getWebsite()->getWebsiteId();\n /** @var Customer $customer */\n $customer = $this->customerFactory->create()\n ->setWebsiteId($websiteId)\n ->loadByEmail($search->getEmail());\n $userName = ($customer->getData('lsr_username')) ?:$search->getUserName();\n $result = $this->contactHelper->forgotPassword($userName);\n if ($result) {\n if (!$customer->getId()) {\n // Check if customer is already created in magento or not.\n $customer = $this->contactHelper->createNewCustomerAgainstProvidedInformation(\n $search,\n LSR::LS_RESETPASSWORD_DEFAULT\n );\n }\n $customer->setData(\n 'attribute_set_id',\n CustomerMetadataInterface::ATTRIBUTE_SET_ID_CUSTOMER\n );\n $customer->setData('lsr_resetcode', $result);\n $this->customerResourceModel->save($customer);\n $this->customerAccountManagement->initiatePasswordReset(\n $search->getEmail(),\n AccountManagement::EMAIL_RESET\n );\n }\n } else {\n $this->session->setForgottenEmail($email);\n $this->messageManager->addErrorMessage(\n __('There is no account found with the provided email/username.')\n );\n return $resultRedirect->setPath('*/*/forgotpassword');\n }\n } catch (SecurityViolationException $exception) {\n $this->messageManager->addErrorMessage($exception->getMessage());\n return $resultRedirect->setPath('*/*/forgotpassword');\n } catch (Exception $exception) {\n $this->messageManager->addExceptionMessage(\n $exception,\n __('We\\'re unable to send the password reset email.')\n );\n return $resultRedirect->setPath('*/*/forgotpassword');\n }\n $this->messageManager->addSuccessMessage($this->getSuccessMessage($email));\n return $resultRedirect->setPath('*/*/');\n } else {\n $this->messageManager->addErrorMessage(__('Please enter your email.'));\n return $resultRedirect->setPath('*/*/forgotpassword');\n }\n } else {\n return parent::execute();\n }\n }",
"public function getResetPasswordToken()\n {\n return $this->resetPasswordToken;\n }"
] | [
"0.7363584",
"0.73476464",
"0.728257",
"0.7190303",
"0.7131655",
"0.70843375",
"0.70240545",
"0.7008574",
"0.70035994",
"0.6974559",
"0.6943094",
"0.69192195",
"0.6896523",
"0.6840337",
"0.6826271",
"0.6822732",
"0.677602",
"0.6774154",
"0.67708755",
"0.6731316",
"0.6719775",
"0.67000026",
"0.6632091",
"0.6630652",
"0.6615333",
"0.6609837",
"0.6607948",
"0.6606688",
"0.66016644",
"0.6590269",
"0.65893626",
"0.6578535",
"0.65778995",
"0.6573673",
"0.6573584",
"0.6570623",
"0.6557229",
"0.65518177",
"0.65468526",
"0.65403706",
"0.65216374",
"0.65094703",
"0.65065306",
"0.6500582",
"0.6494668",
"0.6492812",
"0.6483206",
"0.64816517",
"0.6478687",
"0.6455804",
"0.6451725",
"0.6442238",
"0.6436676",
"0.6427124",
"0.6420705",
"0.64205956",
"0.64167917",
"0.6414173",
"0.64137095",
"0.640213",
"0.6399995",
"0.63954514",
"0.63896245",
"0.63823473",
"0.63793105",
"0.6377364",
"0.63764375",
"0.63568234",
"0.63554895",
"0.63535434",
"0.6342619",
"0.6334678",
"0.633204",
"0.63262546",
"0.631987",
"0.63109446",
"0.6304502",
"0.6303475",
"0.6302786",
"0.6301542",
"0.62903583",
"0.62863034",
"0.62821424",
"0.62771225",
"0.6273857",
"0.62735736",
"0.6272506",
"0.6271134",
"0.6266487",
"0.62642294",
"0.6262081",
"0.62584436",
"0.62583613",
"0.62526864",
"0.62513804",
"0.62495446",
"0.6246746",
"0.62428313",
"0.6238616",
"0.62383217",
"0.6231735"
] | 0.0 | -1 |
Get the response for a failed password reset. | protected function sendResetFailedResponse(Request $request, $response)
{
$message = ($response == Password::INVALID_USER) ? 'User does not exist' : 'Reset token is invalid';
return response()->json(['code' => 500, 'message' => trans($message), 'error' => []], 500);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getFailedResetPasswordMessage()\r\n {\r\n return 'We can\\'t find a user with that e-mail address.';\r\n }",
"public function resetPasswordAction()\n {\n // specify required fields\n $requirements = array(\n 'key'\n );\n\n // fech post json data\n $post = $this->fetchRequestData($requirements);\n\n $result = $params = array();\n\n $params['email'] = $post['key'];\n $params['notificationTwig'] = 'emails/user-email-forgot-password.html.twig';\n $params['changePassLink'] = '/user/password/forgot/emails/';\n $params['tellUsLink'] = '/user/tell-us/emails/';\n\n $reset = $this->get('UserServices')->userResetPassword($params);\n if (!$reset) {\n throw new HttpException(422, $this->translator->trans('Invalid credentials. Please try again.'));\n } else {\n $success = (isset($reset['status']) && $reset['status'] == 'ok') ? true : false;\n $message = $this->translator->trans(\"We've emailed you password reset instructions. Check your email\");\n }\n\n $result['success'] = $success;\n $result['message'] = $message;\n\n $response = new Response(json_encode($result));\n $response->setStatusCode(200);\n return $response;\n }",
"protected function sendResetFailedResponse(Request $request, $response)\n {\n return $this->error(['email' => trans($response)], \"Password reset failed!\", 401);\n }",
"protected function sendResetFailedResponse(Request $request, $response)\n {\n return response()->json([\n 'status' => 'error',\n 'msg' => __('messages.password.fail')\n ], 400);\n //return response()->json(['message' => 'Failed, Invalid Token.']);\n }",
"public function verifyResetPassword()\n {\n $result['error'] = false;\n $result['message'] = '';\n $this->setRules([ 'token' => 'required']);\n $this->_validate();\n $customerInfo = $this->_customer->where('forgot_password', $this->request->token)->first();\n if (empty($customerInfo)) {\n $result['error'] = true;\n $result['message'] = trans('passwords.token_expired');\n }\n return $result;\n }",
"public function verifyCurrentPasswordFailed()\n {\n $message = \\trans('orchestra/foundation::response.account.password.invalid');\n\n return $this->redirectWithMessage(\\handles('orchestra::account/password'), $message, 'error');\n }",
"public function getErrorResponse()\n {\n $result['responseCode'] = self::RESPONSE_LOGIN_ERROR;\n return $result;\n }",
"protected function getFailedLoginMessage()\n {\n return \\Lang::has('auth.failed')\n ? \\Lang::get('auth.failed')\n : 'Email atau password anda salah';\n }",
"public function completeResetPassword() {\n $validator = new ResetPasswordValidator(\\Input::all());\n if (!$validator->passes()) {\n return $this->json(array('status' => 'error',\n 'errors' => $validator->getValidator()->messages()->all()));\n }\n $data = $validator->getData();\n try {\n // Find the user using the user id\n $user = Sentry::findUserById($data['id']);\n\n // Check if the reset password code is valid\n if ($user->checkResetPasswordCode($data['reset_code'])) {\n // Attempt to reset the user password\n if ($user->attemptResetPassword($data['reset_code'], $data['new_password'])) {\n return $this->json(array(\"status\" => \"success\", \"message\" => \"Password reset successful\"));\n } else {\n return $this->json(array('status' => 'error',\n 'errors' => array('Password reset failed')));\n }\n } else {\n return $this->json(array('status' => 'error',\n 'errors' => array('The provided password reset code is Invalid')));\n }\n } catch (Cartalyst\\Sentry\\Users\\UserNotFoundException $e) {\n return $this->json(array('status' => 'error',\n 'errors' => array('User not found')));\n }\n }",
"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 forgotPassword()\n {\n try\n {\n $request = $_POST;\n\n if( !isset($request['username']) || $request['username']==\"\" )\n throw_error_msg(\"user name not provided\");\n\n global $userquery; \n $userquery->reset_password(1,$request['username']);\n\n if(error())\n {\n throw_error_msg(error('single'));\n }\n else\n { \n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'success', \"data\" => \"An Email Has Been Sent To You. Please Follow the Instructions there to Reset Your Password\");\n $this->response($this->json($data));\n }\n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }",
"protected function getFailedLoginMessage()\n\t{\n\t\treturn 'These credentials do not match our records.';\n\t}",
"protected function sendFailedLoginResponse()\n {\n return response()->json([\n 'message' => $this->errorMessage,\n ], 401);\n }",
"public function getInvalidUserResponse()\n {\n $result['responseCode'] = self::RESPONSE_INVALID_USER;\n return $result;\n }",
"public function lostPassword()\n {\n if (!$this->request->is('post')) {\n $this->_respondWithMethodNotAllowed();\n return;\n }\n\n $user = $this->Users->findByEmail($this->request->getData('email'));\n\n if ($user) {\n $token = $this->Tokens->create($user, TokensTable::TYPE_LOST_PASSWORD);\n try {\n $this->getMailer('User')->send('lostPassword', [$user, $token->token]);\n $message = __('Please check your inbox and follow the instructions in the mail to reset your password.');\n } catch (\\Exception $e) {\n $this->_respondWithBadRequest();\n $message = 'Mailer not configured.';\n }\n }\n\n $this->set('message', $message);\n $this->set('_serialize', 'message');\n }",
"public static function do_lost_password() {\n\t\tif ( ! self::is_global_reset_password_page_set() && ! FrmRegLoginController::is_global_login_page_set() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'POST' == $_SERVER[ 'REQUEST_METHOD' ] ) {\n\n\t\t\t// Attempt to send reset password email\n\t\t\t$errors = retrieve_password();\n\n\t\t\tif ( is_wp_error( $errors ) ) {\n\t\t\t\t// Errors found\n\t\t\t\tself::lost_password_redirect_with_errors( $errors );\n\n\t\t\t} else {\n\t\t\t\t// Email sent\n\t\t\t\tself::lost_password_redirect_no_errors();\n\t\t\t}\n\t\t}\n\t}",
"public function getLoginFailedReason() {\n\t\treturn $this->error;\n\t}",
"public function authenticationFailure()\n {\n return $this->sendFailed(\"not authenticated\");\n }",
"protected function getFailedLoginMessage()\n\t{\n\t\treturn 'Địa chỉ email hoặc mật khẩu không đúng';\n\t}",
"public function getLostPassword()\n\t{\n\t\t// not permit anyone accessing its device to reset the password\n\t\tif (Auth::check()) {\n\t\t\treturn $this->redirectWhenLogged(); }\n\t\t$attemptEmail = Session::get('club.login_fail_email');\n\t\treturn View::make(\n\t\t\tConfig::get('club::views.lost_password'),\n\t\t\tarray('defaults' => array('email' => $attemptEmail))\n\t\t);\n\t}",
"public function lostPassword() {\n $this->form_validation->set_rules('email', 'Email', 'required');\n\n if ($this->form_validation->run() === FALSE) {\n \t$this->error(400, 'Validation error');\n }\n \n $this->loadUser();\n \n $this->user_model->setValue(\n \t'temp_code', $this->generateTempCode());\n $this->user_model->setValue(\n \t'temp_code_valid_until', date('Y-m-d H:i:s', strtotime('+ 2 days')));\n \t\n if (! $this->user_model->updateTempCode()) {\n \t$this->error(400, 'Something went wrong');\n }\n\n\t\t$this->sendEmail(\n\t\t\t$this->input->post('email'), \n\t\t\t'Set New Password', \n\t\t\t$this->getLostPasswordMailBody($this->user_model->getValue('temp_code')));\n\t\t$data['msg'] = 'New password mail for ' . $this->input->post('email') . ' sent.';\n\t\t$this->response($data);\n }",
"public function failed(string $tokenString): \\Inertia\\Response\n {\n $pageTitle = 'Invite failed';\n\n $token = $this->invitation->findToken($tokenString);\n\n return $this->response(\n compact('pageTitle', 'token'),\n 'auth.invitation.failed'\n );\n }",
"public function getInvalidChallengeResponse()\n {\n $result['responseCode'] = self::RESPONSE_INVALID_CHALLENGE;\n return $result;\n }",
"protected function sendResetFailedResponse(Request $request, $response)\n {\n return redirect()->back()\n ->withInput($request->only('email'))\n ->withErrors(['email' => trans($response)]);\n }",
"protected function sendResetFailedResponse(Request $request, $response)\n {\n return redirect()->back()\n ->withInput($request->only('email'))\n ->withErrors(['email' => trans($response)]);\n }",
"protected function sendResetFailedResponse(Request $request, $response)\n {\n return redirect()->back()\n ->withInput($request->only('email'))\n ->withErrors(['email' => trans($response)]);\n }",
"public function failPaymentMsg(){\n return $this->viewFailPaymentMsg();\n }",
"public function resetUserPassword()\n\t{\n\t\t# make the call to the API\n\t\t$response = App::make('ApiClient')->post('user/password?forgotten=true', Input::only('email'));\t\n\n\t\t# if the call was successful we'll want to give some feedback to the user\n\t\tif(isset($response['success'])) \n\t\t{\n\t\t\tSession::flash('success', $response['success']['data']);\n\t\t}\n\t\t# similarly if it failed, but this time also show the previous form data\n\t\telse {\n\t\t\t# save the API response to some flash data\n\t\t\tSession::flash('reset-errors', getErrors($response));\n\n\t\t\t# also flash the input so we can replay it out onto the reg form again\n\t\t\tInput::flash();\n\t\t}\t\t\n\n\t\t# ... and show the reset form again\n\t\treturn Redirect::to('forgotten-password');\n\t}",
"public function ResetPassword( )\n {\n\t\t\t$dataArray = array(\"email\"=>$this->email, \"password\"=>$this->password );\n \n $response = ServiceAPIUtils::CallAPIService( $dataArray,\"/User/ResetPassword/123\", \"json\" );\n\t\t\t\n\t\t\treturn $response;\n }",
"public function forget_password()\n {\n $view_data = [\n 'form_errors' => []\n ];\n\n if ($this->input->is_post()) {\n $res = $this->_api('user')->reset_password($this->input->post());\n\n if($res['submit']) {\n redirect('/login/forget_password_complete');\n return;\n }\n $view_data = [\n 'form_errors' => isset($res['invalid_fields']) ? $res['invalid_fields'] : [],\n 'errmsg' => isset($res['errmsg']) ? $res['errmsg'] : null,\n 'post' => $this->input->post()\n ];\n }\n\n $this->_render($view_data);\n }",
"public function forgotPassword($post)\n {\n $response = array();\n\n //check phone No exist or not\n $userData = $this->getUserModel()->getLocalUserByPhoneNo($post['phoneNo']);\n\n if (count($userData) > 0) {\n \n $verifyCodeMatch = true;\n while ($verifyCodeMatch == true) {\n \n $verifyCode = rand('111111', '999999');\n $getUserInfo = $this->getUserModel()->passwordVerifyCodeExist($verifyCode);\n if (count($getUserInfo) == 0) {\n $verifyCodeMatch = false;\n }\n }\n \n $updateUserData['passVerifyCode'] = $verifyCode;\n\n $this->getUserModel()->updateUser($userData['Id'], $updateUserData);\n\n $message = \"Welcome To Mobile Yantra Game\\r\\n Hi,\".$userData['name'].\"\\r\\nYour verify code is:\".$verifyCode;\n //send SMS to user\n $this->getAppService()->sendSMS($userData['phoneNo'], $message);\n \n $response['status'] = 'success';\n $response['message'] = 'Password Reset code send success.';\n } else {\n $response['status'] = 'error';\n $response['message'] = 'Phone-No does not exist.Please check your Phone No.';\n }\n\n return $response;\n }",
"public function do_reset_password()\n {\n $input = array(\n 'token'=>Input::get( 'token' ),\n 'password'=>Input::get( 'password' ),\n 'password_confirmation'=>Input::get( 'password_confirmation' ),\n );\n\n // By passing an array with the token, password and confirmation\n if( Confide::resetPassword( $input ) )\n {\n $notice_msg = Lang::get('confide::confide.alerts.password_reset');\n return Redirect::action('UserController@login')\n ->with( 'notice', $notice_msg );\n }\n else\n {\n $error_msg = Lang::get('confide::confide.alerts.wrong_password_reset');\n return Redirect::action('UserController@reset_password', array('token'=>$input['token']))\n ->withInput()\n ->with( 'error', $error_msg );\n }\n }",
"protected function getFailedLoginMessage()\n {\n //return Lang::has('auth.failed')\n //? Lang::get('auth.failed')\n //: '账号或密码错误';\n return '账号或密码错误';\n }",
"public function resetPassword()\n {\n if (!$this->request->is('patch')) {\n $this->_respondWithMethodNotAllowed();\n return;\n }\n\n $token = $this->request->getData('token');\n if (empty($token)) {\n $this->_respondWithBadRequest();\n return;\n }\n\n $user = $this->Users->findByToken($token, TokensTable::TYPE_LOST_PASSWORD);\n if (empty($user)) {\n $this->set('message', 'This password reset is no longer valid.');\n $this->set('_serialize', ['message']);\n $this->_respondWithBadRequest();\n return;\n }\n\n $user->unsetProperty('username');\n $user->unsetProperty('email');\n\n $user = $this->Users->patchEntity($user, [\n 'password' => $this->request->getData('password'),\n 'password_confirmation' => $this->request->getData('password_confirmation')\n ], ['validate' => 'resetPassword']);\n\n if ($this->Users->save($user)) {\n $this->Users->Tokens->expireTokens($user->id, TokensTable::TYPE_LOST_PASSWORD);\n $this->set('message', __('Your password has been reset.'));\n } else {\n $this->set('message', __('Please correct the marked errors.'));\n $this->set('errors', $user->getErrors());\n $this->_respondWithValidationErrors();\n }\n\n $this->set('_serialize', ['message', 'errors']);\n }",
"public function postResetPassword()\n\t{\n\t\t//check if valid token from the password_reminders table, if not show error message\n\t\t$rules = array(\t'password' =>$this->userService->getNewUserValidatorRule('password'),\n\t\t\t\t\t\t'password_confirmation'=>'Required|same:password');\n\t\t$token = Input::get('token');\n\t\t$v = Validator::make(Input::all(), $rules);\n\t\tif($v->passes())\n\t\t{\n\t\t\t$ret_msg = $this->userService->resetPassword(Input::all());\n\t\t\tif($ret_msg == '')\n\t\t\t{\n\t\t\t\treturn Redirect::to('user/login')->with('success_message', trans('auth/form.changepassword_success_message'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn Redirect::to('users/reset-password/'.$token)->withInput()->with('error', $ret_msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn Redirect::to('user/reset-password/'.$token)->withInput()->withErrors($v);\n\t\t}\n\t}",
"public function actionForgotPassword() {\n //validate webservice\n $requiredParams = ['email'];\n try {\n CommonApiHelper::validateRequestParameters($requiredParams);\n\n $response = [];\n $post = Yii::$app->request->bodyParams;\n $post = array_map('trim', $post);\n //Fetch user details\n $userdata = Users::findOne(['email' => $post['email'], 'status' => '1']);\n if (!empty($userdata)) {\n $userdata->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();\n if ($userdata->save(false)) {\n Users::sendPasswordResetEmail($userdata);\n }\n return CommonApiHelper::return_success_response(\"Reset Password link has been sent to your registered email id.\", \"\", []);\n } else {\n return CommonApiHelper::return_error_response(\"Failed:\", \"Email id is not registered or User is inactive.\", \"2\");\n }\n } catch (\\Exception $e) {\n return CommonApiHelper::return_error_response(\"Sorry, Please try again.\");\n }\n }",
"public function postResetPassword()\n\t{\n\t\t$credentials = Input::only(\n\t\t\t'password', 'password_confirmation', 'token'\n\t\t);\n\n\t\t$response = Password::reset($credentials, function($user, $password)\n\t\t{\n\t\t\t$user->password = $password;\n\t\t\t$user->save();\n\t\t});\n\n\t\tswitch ($response)\n\t\t{\n\t\t\tcase Password::INVALID_PASSWORD:\n\t\t\tcase Password::INVALID_TOKEN:\n\t\t\tcase Password::INVALID_USER:\n\t\t\t\treturn Redirect::back()->with('error', Lang::get($response));\n\n\t\t\tcase Password::PASSWORD_RESET:\n\t\t\t\treturn Redirect::route('login')->with('success', 'Successfully reset password');\n\t\t}\n\t}",
"public function getInvalidRequestResponse()\n {\n $result['responseCode'] = self::RESPONSE_INVALID_REQUEST;\n return $result;\n }",
"public function getBattleCheckFail()\n {\n return $this->get(self::_BATTLE_CHECK_FAIL);\n }",
"public function getResetPassword($reset_token)\n {\n $passwordReset = PasswordReset::where('token', $reset_token)->first();\n\n //is password reset token in db and does user exist\n if ($passwordReset && $passwordReset->token === $reset_token) {\n $user = User::where('email', $passwordReset->email)->first();\n if ($user) {\n if (($adminUser = AdminCreatedUser::where('user_id', $user->id)->first())) {\n $user->update(['is_active' => 1]);\n $adminUser->delete();\n }\n //reset_token exists, respond ok with reset_token,\n // for the user to be shown form\n\n return $this->response->accepted(null, ['status' => 'ok', 'reset_token' => $reset_token]);\n }\n }\n //token invalid\n throw new AccessDeniedHttpException('Invalid or expired reset link');\n }",
"public function resetNewPassword() {\r\n try {\r\n $post = $this->request->all();\r\n $token = $post['resetToken'];\r\n if ($data = $this->admin->checkPasswordToken($token)) {\r\n $email = $data->email;\r\n $user_id = $data->user_id;\r\n $secret = Hash::make($post['new_password']);\r\n $update = array(\r\n 'password' => $secret,\r\n );\r\n if ($this->user->update($update, $email, 'email')) {\r\n $where = array(\r\n 'email' => $email,\r\n 'user_id' => $user_id,\r\n );\r\n $this->admin->deleteResetPassToken($where);\r\n $arrResponse['http_status'] = Config::get('constants.HTTP_OK');\r\n $arrResponse['message'] = Lang::get('global.passwordSuccess');\r\n } else {\r\n $arrResponse['http_status'] = Config::get('constants.DB_ERROR');\r\n $arrResponse['message'] = Lang::get('global.somethingWentWrong');\r\n }\r\n } else {\r\n $arrResponse['http_status'] = Config::get('constants.DATA_NOT_MATCH');\r\n $arrResponse['message'] = Lang::get('global.passwordLinkExpire');\r\n }\r\n } catch (Exception $e) {\r\n throw new Exception(Lang::get('global.somethingWentWrong'), $e->getCode());\r\n }\r\n return response()->json($arrResponse, 200);\r\n }",
"public function postReset()\n\t{\n\t\t$credentials = Input::only(\n\t\t\t'email', 'password', 'password_confirmation', 'token'\n\t\t);\n\n\t\t$response = Password::reset($credentials, function($user, $password)\n\t\t{\n\t\t\t$user->password = Hash::make($password);\n\n\t\t\t$user->save();\n\t\t});\n\n\t\tswitch ($response)\n\t\t{\n\t\t\tcase Password::INVALID_PASSWORD:\n\t\t\tcase Password::INVALID_TOKEN:\n\t\t\tcase Password::INVALID_USER:\n\t\t\t\treturn Redirect::back()->with('error', Lang::get($response));\n\n\t\t\tcase Password::PASSWORD_RESET:\n\t\t\t\treturn Redirect::route('login');\n\t\t}\n\t}",
"public function post_forgotpassword() {\n try {\n $i = Input::post();\n\n $auth = new \\Craftpip\\OAuth\\Auth();\n $users = $auth->getByUsernameEmail($i['email']);\n if (!$users) {\n throw new \\Craftpip\\Exception('Email/Username not registered with us.');\n }\n\n $mail = new \\Craftpip\\Mail($users['id']);\n $mail->template_forgotpassword();\n $mail->send();\n\n $response = array(\n 'status' => true,\n 'message' => 'asdsa',\n );\n } catch (Exception $e) {\n $e = new \\Craftpip\\Exception($e->getMessage(), $e->getCode());\n $response = array(\n 'status' => false,\n 'reason' => $e->getMessage(),\n );\n }\n\n echo json_encode($response);\n }",
"public function forgot_pwd()\r\n {\r\n //provided the correct combination of user name and email address\r\n\r\n $username = htmlspecialchars($_POST['username']);\r\n $email = htmlspecialchars($_POST['email']);\r\n\r\n require_once 'database/profile.php';\r\n require_once 'database/session.php';\r\n\r\n $usernameId = getUserId($username);\r\n if (!$usernameId) {\r\n return \"Username does not exist.\";\r\n }\r\n\r\n $userInfo = getProfile($usernameId);\r\n if ($userInfo[\"email\"] != $email) {\r\n return \"Email doesn't match the one we have on file.\";\r\n }\r\n\r\n $password = getPassword($userId);\r\n return $this->send_forgotten_pwd($username, $password, $email);\r\n \r\n }",
"public function forgot_password() {\n if ($this->Auth->login()) {\n return $this->redirect($this->Auth->redirectUrl());\n }\n $this->layout = 'GtwUsers.users';\n if ($this->request->is('post')) {\n $arrResponse = $this->User->ForgotPasswordEmail($this->request->data['User']['email']);\n if (!empty($arrResponse)) {\n if ($arrResponse['status'] == 'fail') {\n $this->Session->setFlash($arrResponse['message'], 'alert', array(\n 'plugin' => 'BoostCake',\n 'class' => 'alert-danger'\n ));\n } else {\n $this->Session->setFlash($arrResponse['message'], 'alert', array(\n 'plugin' => 'BoostCake',\n 'class' => 'alert-success'\n ));\n return $this->redirect($this->Auth->redirectUrl());\n }\n }\n }\n }",
"public function resetPassword(ResetPasswordRequest $request)\n {\n $status = $this->repository->resetPassword($request);\n\n if(!$status)\n throw new Exception(__('controller.auth.email_or_token_invalid'), 401);\n\n return $this->respondWithMessage(__('controller.auth.password_reset'));\n }",
"public function doForgetPassword(){\n $email = Input::get('email');\n $result = 0;\n\n if(!empty($email)){\n $token = User::createAccountToken();\n \tUser::where('email', '=',$email)->update(array('account_token' => $token));\n\n\t\t\t$user = User::getByEmail($email);\n if (!empty($user)) {\n $link_reset = URL::to('/').'/forgetPassword?email='.$email.'&token='.$token;\n\n $data = array(\n 'link_reset' => $link_reset,\n 'user' => $user->toArray()\n );\n\n Mail::send('emails.reset_password', $data, function($message) use($email) {\n $message->to($email, Config::get('constants.website_name'))\n ->subject('【'.Config::get('constants.website_name').'】Cấp lại mật khẩu!');\n });\n\n $result = 1;\n }\n }\n return json_encode($result);\n }",
"public function forgetPassword() {\n $postdata = file_get_contents(\"php://input\");\n $request = json_decode($postdata, TRUE);\n //print_r($request['email_id']);die();\n\n $result = $this->Adminlogin_model->getAdminInfo($request['email_id']);\n // print_r($result);die();\n if ($result['status'] == 200) {\n echo '<div class=\"alert alert-success\">\n ' . $result['status_message'] . ' \n </div>';\n } elseif ($result['status'] == 412) {\n echo '<div class=\"alert alert-danger\">\n ' . $result['status_message'] . ' \n </div>';\n } else {\n echo '<div class=\"alert alert-danger\">\n ' . $result['status_message'] . ' \n </div>';\n }\n }",
"protected function sendResetLinkFailedResponse(Request $request, $response)\n {\n return back()->withErrors(\n ['email' => trans($response)]\n );\n }",
"public function postForgotPassword()\n\t{\n\t\t$rules = ['email' => 'required|email'];\n\t\t$validator = Validator::make(Input::only('email'), $rules);\n\t\tif ($validator->fails()) return Redirect::back()->withInput()->withErrors($validator);\n\n\t\tif ( ! PasswordReminder::canSendReminderEmail(Input::get('email')))\n\t\t{\n\t\t\treturn Redirect::back()->withInput()\n\t\t\t\t->withError('A reminder email has already been sent for this email address.');\n\t\t}\n\n\t\tswitch ($response = Password::remind(Input::only('email'), function($message)\n\t\t{\n\t\t\t$message->subject('WebCMS Password Reminder');\n\t\t}))\n\t\t{\n\t\t\tcase Password::REMINDER_SENT:\n\t\t\t\treturn Redirect::back()->withSuccess(Lang::get($response));\n\n\t\t\tdefault:\n\t\t\t\treturn Redirect::back()->withError(Lang::get($response));\n\t\t}\n\t}",
"public function getLastErrorResponse() {\n if (!empty($this->rawResponses)) {\n foreach (array_reverse($this->rawResponses) as $x) {\n if (isset($x['error'])) {\n return $x;\n }\n }\n }\n }",
"public function testUpdateMethodGivenFailed()\n {\n $listener = m::mock('\\Orchestra\\Contracts\\Auth\\Listener\\PasswordReset');\n $validator = m::mock('\\Orchestra\\Foundation\\Validations\\AuthenticateUser');\n $password = m::mock('\\Illuminate\\Contracts\\Auth\\PasswordBroker');\n\n $input = $this->getUpdateInput();\n\n $stub = new PasswordBroker($validator, $password);\n\n $password->shouldReceive('reset')->once()\n ->with($input, m::type('Closure'))\n ->andReturnUsing(function ($d, $c) {\n return Password::INVALID_TOKEN;\n });\n $listener->shouldReceive('passwordResetHasFailed')->once()->with(Password::INVALID_TOKEN)->andReturn('reset.failed');\n\n $this->assertEquals('reset.failed', $stub->update($listener, $input));\n }",
"public function forget_password_post()\n {\n $admin = User::where('email', request('email'))->first();\n if(!empty($admin))\n {\n $token = app('auth.password.broker')->createToken($admin);\n $data = DB::table('password_resets')->insert([\n 'email' => $admin->email,\n 'token' => $token,\n 'created_at' => Carbon::now()\n ]);\n\n Mail::to($admin->email)->send(new reset_password(['data' => $admin, 'token' => $token]));\n return back();\n }\n }",
"public static function failed()\n\t{\n\t\treturn Request::$failed;\n\t}",
"public function testInvalidRegisterPasswordFailed()\n {\n $this->json('post', '/register', [\n 'email' => 'valid@email.com',\n 'password' => 'testing123',\n 'password_confirmation' => 'testing',\n ])->seeJson([\n 'status' => 'failed'\n ])->assertResponseStatus(422);\n }",
"public function getFailureReason();",
"public function onResetPassword()\n {\n $rules = [\n 'code' => 'required',\n 'password' => 'required|between:' . UserModel::getMinPasswordLength() . ',255'\n ];\n\n $validation = Validator::make(post(), $rules);\n if ($validation->fails()) {\n throw new ValidationException($validation);\n }\n\n $errorFields = ['code' => Lang::get(/*Invalid activation code supplied.*/'rainlab.user::lang.account.invalid_activation_code')];\n\n /*\n * Break up the code parts\n */\n $parts = explode('!', post('code'));\n if (count($parts) != 2) {\n throw new ValidationException($errorFields);\n }\n\n list($userId, $code) = $parts;\n\n if (!strlen(trim($userId)) || !strlen(trim($code)) || !$code) {\n throw new ValidationException($errorFields);\n }\n\n if (!$user = Auth::findUserById($userId)) {\n throw new ValidationException($errorFields);\n }\n\n if (!$user->attemptResetPassword($code, post('password'))) {\n throw new ValidationException($errorFields);\n }\n Flash::success('Password has been changed successfuly');\n }",
"protected function sendResetLinkFailedResponse(Request $request, $response)\n {\n return response()->json(['message' => 'Email could not be sent to this email address.']);\n }",
"public function getErrorMsg()\r\n {\r\n return $this->lastErrorMsg;\r\n }",
"protected function failedToAuthenticateUserMessage(): string\n {\n return 'Unable to authenticate with invalid token.';\n }",
"public function getFailReason()\n {\n return $this->get(self::_FAIL_REASON);\n }",
"public static function resetPassword($data)\n {\n $msgValidate = [];\n $rule = [\n 'email' => 'required|email'\n ];\n $validateRs = Frontend::validateForm($data, $rule, $msgValidate);\n if ($validateRs['rs'] == System::FAIL) {\n return $validateRs;\n } else {\n $rs = self::sendEmailToResetPassword($data);\n return $rs;\n }\n }",
"public function testGetResetPasswordPageEmailWasNotSentError()\n\t{\n\t\t$meta = \\Orchestra\\Memory::make('user');\n\t\t$hash = \\Str::random(32);\n\t\t$meta->put('reset_password_hash.1', $hash);\n\n\t\t$this->getMailerMock();\n\t\t$this->call('orchestra::forgot@reset', array(1, $hash));\n\t\t$this->assertRedirectedTo(handles('orchestra::login'));\n\t\t$this->assertTrue(is_string(\\Session::get('message')));\n\t}",
"public function getFailureReason()\n {\n return $this->failure_reason;\n }",
"public function test_admin_can_send_request_reset_password()\n {\n $postedEmail = $this->post(route('api.admin.auth.password.postEmail'), ['email' => $this->admin->email]);\n $postedEmail->assertResponseOk()->isJson();\n }",
"public function getEmail()\r\n\t{\r\n\t\t$errors = [];\r\n\t\treturn view('core::users.reset-password', compact('errors'));\r\n\t}",
"protected function sendResetLinkFailedResponse(Request $request, $response)\n {\n return response()->json([\n 'status' => 'error',\n 'msg' => __('messages.email.fail')\n ], 400);\n\n //return response()->json(['message' => 'Email could not be sent to this email address.']);\n }",
"public function testLoginIncorrectPassword()\n {\n $this->createUser();\n\n $response = $this->post($this->getLoginSubmitUrl(), [\n 'email' => $this->getCorrectEmail(),\n 'password' => 'incorrectPassword'\n ]);\n\n //Regardless of incorrect email/password, email is sent as error key.\n $response->assertSessionHasErrors(['email']);\n }",
"public function getPasswordReset($token)\n {\n $reset = $this->resets->getByToken($token);\n\n if (empty($reset)) {\n return \\Error::abort(404);\n }\n\n $this->nav('navbar.logged.out.login');\n $this->title('auth.reset.title');\n\n return $this->view('auth.password.reset', compact('reset'));\n }",
"function alt_failed_login()\n {\n return 'The login information you have entered is incorrect.';\n }",
"public function postReset()\n {\n $input = array(\n 'token'=>Input::get( 'token' ),\n 'password'=>Input::get( 'password' ),\n 'password_confirmation'=>Input::get( 'password_confirmation' ),\n );\n\n // By passing an array with the token, password and confirmation\n if( Confide::resetPassword( $input ) )\n {\n $notice_msg = Lang::get('confide::confide.alerts.password_reset');\n return Redirect::to('user/login')\n ->with( 'notice', $notice_msg );\n }\n else\n {\n $error_msg = Lang::get('confide::confide.alerts.wrong_password_reset');\n return Redirect::to('user/reset/'.$input['token'])\n ->withInput()\n ->with( 'error', $error_msg );\n }\n }",
"protected function sendResetLinkFailedResponse( Request $request, $response )\n {\n return response( [ 'errors' => [trans( $response )] ], 422 );\n }",
"public function requestPasswordReset()\n {\n /**\n * @var $validator Validator\n */\n $validator = app()->make('validator')->make($this->request->input(), [\n 'email' => 'required|email|exists:users,email',\n ]);\n\n if(!$validator->passes()) {\n $this->apiResponse->handleErrors($validator);\n }\n\n $email = $this->request->input('email', null);\n $email = htmlspecialchars(trim(strtolower($email)));\n\n /**\n * @var User $user\n */\n $user = User::where('email', $email)->first();\n\n if(!$user instanceof User) {\n $this->apiResponse->setError(\"No user with that Email found.\");\n } else {\n if (!$user->hasVerifiedEmail()) {\n $user->markEmailAsVerified();\n }\n\n if($this->request->has('callback_url') && $this->request->filled('callback_url')) {\n $user->setPasswordResetUrl($this->request->input('callback_url'));\n }\n\n $user->sendPasswordResetNotification();\n $this->apiResponse->setSuccess(['sent' => true]);\n }\n\n return $this->apiResponse->returnResponse();\n }",
"public function message()\n {\n return 'The password you entered is incorrect. Click on the link in your email so you don\\'t have to enter the password';\n }",
"public function payment_status_denied()\n {\n return $this->payment_status_failed();\n }",
"public function getResetPassword($token)\n\t{\n\t\t$is_valid = $this->userService->isValidPasswordToken($token);\n\t\tif($is_valid)\n\t\t{\n\t\t\treturn View::make('auth/changePassword')->with('token', $token);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn View::make('auth/changePassword')->with('token', $token)->with('error', trans('auth/form.change_password.invalid_token'));\n\t\t}\n\t}",
"public function sendResetPasswordInstruction() {\n $data = \\Input::all();\n /**\n * @todo Validate Email\n */\n if (!isset($data['email']) || !$data['email']) {\n return $this->json(array('status' => 'error',\n 'errors' => array('No email address supplied')));\n }\n\n try {\n\n // Find the user using the user email address\n $user = \\Sentry::findUserByLogin($data['email']);\n\n // Get the password reset code\n $resetCode = $user->getResetPasswordCode();\n\n // Send password reset email to the user\n $this->notificationService->sendEmail($data['email'], $user->getEmail(), 'Reset Your Password', 'email.resetpassword', compact('user', 'resetCode'));\n\n return $this->json(array(\"status\" => \"success\", \"message\" => \"Password reset instruction sent\"));\n } catch (Cartalyst\\Sentry\\Users\\UserNotFoundException $e) {\n return $this->json(array('status' => 'error',\n 'errors' => array('User was not found')));\n }\n }",
"public function postReset()\n\t{ \n\t\t$credentials = Input::only('email', 'password', 'password_confirmation', 'token');\n\n\t\t$response = Password::reset($credentials, function($user, $password)\n\t\t{\n\t\t\t$user->password = Hash::make($password);\n\n\t\t\t$user->save();\n\t\t});\n\n\t\tswitch ($response)\n\t\t{\n\t\t\tcase Password::INVALID_PASSWORD: \n\t\t\tcase Password::INVALID_TOKEN:\n\t\t\tcase Password::INVALID_USER:\n\t\t\t\t//When anything wrong happens, back to the reset form with all the input there for the customer to modify\n\t\t\t\treturn Redirect::back()->with('error', Lang::get($response))\n ->withInput(Input::all());\n\t\t\t\t\t \n\t\t\tcase Password::PASSWORD_RESET:\n\t\t\t //Reset is done, redirect to the login page with empty password\n\t\t\t\t { Input::merge(array('password' => ''));\n\t\t\t\treturn Redirect::to('login')\n\t\t\t\t ->withErrors(array('password' => 'Your login password has been successfully reset.')) // Tell the customer reset is done.\n\t\t\t\t ->withInput(Input::all());}\n\t\t}\n\t\t\n\t}",
"public function forgotten_password() {\n $email = $this->input->post('email');\n if (!$this->users_model->fields(array('id'))->where('email', $email)->limit(1)->get()) {\n return $this->send_error('NOT_REGISTERED');\n }\n $this->load->helper('string');\n $this->load->library('email');\n $token = random_string('sha1');\n if (!$this->users_model->where('email', $email)->update(array('forgotten_password_code' => $token, 'forgotten_password_time' => time()))) {\n return $this->send_error('ERROR');\n }\n $this->email->from(config_item('email_from'), config_item('email_from_name'))\n ->to($email)\n ->subject('Passwrod reset | Go4Slam app')\n ->message('Hello, <br><br> Press the link below to set a new password. <br><br><a href=\"' . base_url() . 'user/reset_password/' . urlencode($email) . '/' . urlencode($token) . '\">Click here</a>')\n ->set_mailtype('html');\n if (!$this->email->send()) {\n return $this->send_error('UNABLE_TO_SEND_EMAIL');\n }\n return $this->send_success();\n }",
"public function forgot_password_post()\n\t{\n\t\t$array['username'] = strtolower($this->post('username'));\n\n\t\t$error = [];\n\n\t\tif (filter_var($array['username'], FILTER_VALIDATE_EMAIL) \n\t\t\tOR preg_match('/^[A-Za-z][A-Za-z0-9]{5,100}$/', $array['username'])) {\n\n\t\t\tif (empty($array['username'])) {\n\t\t\t\t$this->response(['status' => FALSE, 'error' => 'Username is empty'], REST_Controller::HTTP_BAD_REQUEST);\n\t\t\t} else {\n\t\t\t\t$validate_user = $this->api_model->validate_user($array['username'], $array['username']);\n\t\t\t\t\n\t\t\t\tif ($validate_user) {\n\t\t\t\t\t$new_password = $this->get_random_string();\n\t\t\t\t\t$update_user = $this->api_model->update_password($validate_user, $new_password);\n\t\t\t\t\tif ($update_user) {\n\t\t\t\t\t\t$send_email = $this->send_email($validate_user['email'], $new_password);\n\t\t\t\t\t\tif ($send_email) {\n\t\t\t\t\t\t\t$this->response(['status' => TRUE, 'message' => 'New password sent to email'], REST_Controller::HTTP_OK);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->response(['status' => FALSE, 'error' => ['Something went wrong']], REST_Controller::HTTP_BAD_REQUEST);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->response(['status' => FALSE, 'error' => ['Password update failed']], REST_Controller::HTTP_BAD_REQUEST);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->response(['status' => FALSE, 'error' => ['Username or email is incorrect']], REST_Controller::HTTP_BAD_REQUEST);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$error[] = 'Invalid username format.';\n\t\t\t$this->response(['status' => FALSE, 'error' => $error], REST_Controller::HTTP_BAD_REQUEST);\n\t\t}\n\t}",
"public function getInvalidResponse($attemptsLeft = null)\n {\n $result['responseCode'] = self::RESPONSE_INVALID;\n if (!is_null($attemptsLeft)) {\n $result['attemptsLeft'] = $attemptsLeft;\n }\n return $result;\n }",
"public function postRecover()\n\t{\n\t\t$inputs = Input::get('recover');\n\n\t\t$expires = Config::get('auth.reminder.expire');\n\t\t$reminder = Models\\PasswordReminder::whereToken($inputs['token'])->where(\"created_at\", \">\", DB::raw(\"NOW() - INTERVAL $expires MINUTE\"))->first();\n\t\tif (!$reminder) {\n\t\t\t$this->setFormErrors(\"recover.password\", \"Sorry, invalid or expired token\");\n\t\t}\n\n\t\tif (empty($this->formErrors)) {\n\t\t\t$user = Models\\User::whereEmail($reminder->email)->first();\n\t\t\tif (!$user) {\n\t\t\t\t$this->setFormErrors(\"recover.password\", \"Can't seem to find your email in the system\");\n\t\t\t}\n\t\t}\n\n\t\tif (empty($this->formErrors)) {\n\t\t\t$user->password = $inputs['password'];\n\t\t\tif ($user->isInvalid()) {\n\t\t\t\t$this->setFormErrors('recover', $user->getErrors());\n\t\t\t} else {\n\t\t\t\t$user->save();\n\t\t\t}\n\t\t}\n\n\t\tif (empty($this->formErrors)) {\n\n\t\t\tModels\\PasswordReminder::whereEmail($user->email)->delete();\n\n\t\t\tFlash::success('Your password has been successfully updated!');\n\n\t\t\treturn [\n\t\t\t\t'success' => true,\n\t\t\t];\n\t\t} else {\n\t\t\tthrow new ValidationException(['errors' => $this->formErrors]);\n\t\t}\n\n\t}",
"public function getResetPasswordToken()\n {\n return $this->resetPasswordToken;\n }",
"public function testResetPassword()\n\t{\n\t\t$return = $this->auth->requestReset($this->email);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang(\"Auth.email_incorrect\"));\n\n\t\t$return = $this->auth->requestReset($this->newEmail);\n\n\t\t$this->assertFalse($return['error']);\n\t\t$this->assertSame($return['message'], lang(\"Auth.reset_requested\"));\n\n\t\t$uid = $this->auth->getUID($this->newEmail);\n\t\t$token = $this->auth->getUserRequestToken($uid, 'reset');\n\n\t\t// test invalid token length\n\t\t$return = $this->auth->resetPass(substr($token, 0, 5), $this->password, $this->password);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.resetkey_invalid'));\n\n\t\t// test incorrect token value\n\t\t$return = $this->auth->resetPass('1234567890ABCDEFGHIJ', $this->password, $this->password);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.resetkey_incorrect'));\n\n\t\t// test reset with weak password\n\t\t$return = $this->auth->resetPass($token, $this->weakPassword, $this->weakPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.password_weak'));\n\n\t\t// test reset with unmacth password\n\t\t$return = $this->auth->resetPass($token, $this->password, $this->weakPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.newpassword_nomatch'));\n\n\t\t$currentPassword = 'user@PRO#123';\n\n\t\t// test reset with existing password\n\t\t$return = $this->auth->resetPass($token, $currentPassword, $currentPassword);\n\n\t\t$this->assertTrue($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.newpassword_match'));\n\n\t\t// test reset with existing password\n\t\t$return = $this->auth->resetPass($token, $this->password, $this->password);\n\n\t\t$this->assertFalse($return['error']);\n\t\t$this->assertSame($return['message'], lang('Auth.password_reset'));\n\n\t\t$this->auth->login($this->newEmail, $this->password);\n\n\t\t$this->assertTrue($this->auth->isLogged());\n\t}",
"public function postReset()\n {\n $credentials = Input::only(\n 'email', 'password', 'password_confirmation', 'token'\n );\n $validator = Validator::make(\n array('email' => Input::get('email'), 'password' => Input::get('password'), 'password_confirm' => Input::get('password_confirm')),\n array('email' => 'required|unique:users,email|email', 'password' => 'required|min:4|max:20|same:password_confirm')\n );\n $response = Password::reset($credentials, function ($user, $password) {\n $user->password = Hash::make($password);\n $user->save();\n });\n\n switch ($response) {\n case Password::INVALID_TOKEN:\n return Redirect::to('password/forgot')->with('error', Lang::get($response));\n\n case Password::INVALID_PASSWORD:\n case Password::INVALID_USER:\n return Redirect::back()->with('error', Lang::get($response));\n\n case Password::PASSWORD_RESET:\n return Redirect::to('/login')->with('success', 'Password was successfully reset!<br> You make now Log in.');\n }\n }",
"public function getEnrollmentErrorResponse()\n {\n $result['responseCode'] = self::RESPONSE_ENROLLMENT_ERROR;\n return $result;\n }",
"public function testGetResetPasswordPageInvalidHashError()\n\t{\n\t\t$meta = \\Orchestra\\Memory::make('user');\n\t\t$hash = \\Str::random(32);\n\t\t$meta->put('reset_password_hash.1', $hash);\n\n\t\t$this->call('orchestra::forgot@reset', array(1, \\Str::random(30)));\n\t\t$this->assertResponseNotFound();\n\t}",
"public function reset_password()\n {\n $view_data = [\n 'form_errors' => []\n ];\n\n if ($this->input->is_post()) {\n $res = $this->_api('user')->update_password( [\n 'password' => $this->input->post('password'),\n 'confirm_password' => $this->input->post('confirm_password'),\n 'token' => $this->input->get('token'),\n 'id' => $this->input->get('id')\n ]);\n\n // Redirect if reset password successful\n if($res['submit']) {\n redirect('/login/reset_password_complete');\n return;\n }\n\n $view_data = [\n 'form_errors' => isset($res['invalid_fields']) ? $res['invalid_fields'] : [],\n 'errmsg' => isset($res['errmsg']) ? $res['errmsg'] : null,\n 'post' => $this->input->post()\n ];\n }\n\n $this->_render($view_data);\n }",
"public function payment_status_failed()\n {\n return $this->order->update_status(\n 'failed',\n sprintf(\n esc_html__('Payment %s via IPN.', 'woo-paypalplus'),\n $this->request->get(Request::KEY_PAYMENT_STATUS, FILTER_SANITIZE_STRING)\n )\n );\n }",
"public function passwordResetCode();",
"public function forgottenPassword()\n {\n\t\t// Load helpers and libraries\n\t\thelper(['form', 'url']);\n\t\t$M_User = new M_User();\n\n\t\t// Default return\n\t\t$ret = redirect()->to(base_url());\n\n $options = [\n\t\t\t'action' => 'Users/forgottenPassword' // Route\n ];\n \n\t\t$request = $this->request;\n \n\t\t// Retrieving the current step of the process\n\t\t$step = $request->getPostGet('step');\n\n switch ($step){\n\t\t\tcase 1:\n\t\t\t\t// Step 1: Display email form\n\t\t\t\t$ret = json_encode(view(FORM_FORGOTTEN_PWD_STEP_1, $options));\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t// Step 2: Send the email\n\t\t\t\t$postData = $request->getPostGet('forgottenPwd');\n\n\t\t\t\t$options['alert'] = 'Un problème est survenu lors de l\\'envoi de l\\'email.';\n\t\t\t\t$options['type'] = 'danger';\n\n\t\t\t\t$ret = json_encode(view(FORM_FORGOTTEN_PWD_STEP_1, $options));\n\n\t\t\t\tif(is_array($postData))\n {\n\t\t\t\t\t$email = $postData['email'];\n\t\t\t\t\t// Everything went well : sending the password reset email\n\t\t\t\t\tif ($M_User->sendPwdResetEmail($email) == SC_SUCCESS) {\n\t\t\t\t\t\t$options['alert'] = 'Un email vient de vous être envoyé. Merci de cliquer sur le lien qu\\'il contient.';\n $options['type'] = 'success';\n\t\t\t\t\t\t$ret = json_encode(view(FORM_FORGOTTEN_PWD_STEP_2, $options));\n }\n\t\t\t\t\t// TODO - User not found\n }\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t// Step 3 : Token verification\n\t\t\t\t$token = $request->getPostGet('token');\n\n\t\t\t\t$options = [\n\t\t\t\t\t'action' => 'Users/forgottenPassword', // Route\n\t\t\t\t\t'token' => $token, // Security token\n\t\t\t\t\t'script' => self::ENCRYPTION_URL // Script URL for SHA256 encryption\n\t\t\t\t];\n\n\t\t\t\tif ($M_User->findOneBy('securityToken', $token) != null) {\n\t\t\t\t\t// A corresponding security token has been found in the DB\n\t\t\t\t\t$ret = render(FORM_FORGOTTEN_PWD_STEP_3, $options);\n }\n\t\t\t\t// TODO - Token expired\n\t\t\t\t// TODO - Invalid Token\n\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t// Step 4 : Updating User password\n\t\t\t\t$postData = $request->getPostGet('pwdReset');\n\t\t\t\tif (is_array($postData)){\n\t\t\t\t\tif ($M_User->resetPassword($postData['token'],$postData['password']) != SC_SUCCESS){\n\t\t\t\t\t\t$options = [\n\t\t\t\t\t\t\t'action' => 'Users/forgottenPassword', // Route\n\t\t\t\t\t\t\t'token' => $postData['token'], // Security token\n\t\t\t\t\t\t\t'alert' => 'Une erreur interne est survenue', // Alert message\n\t\t\t\t\t\t\t'type' => 'danger' // Alert type\n\t\t\t\t\t\t];\n\n\t\t\t\t\t\t$ret = render(FORM_FORGOTTEN_PWD_STEP_3, $options);\n } \n }\n\t\t\t\tbreak;\n }\n \n\n return $ret;\n\t}",
"public static function lost_password() {\n\t\t/**\n\t\t * After sending the reset link, don't show the form again.\n\t\t */\n\t\tif ( ! empty( $_GET['reset-link-sent'] ) ) {\n\t\t\treturn ur_get_template( 'myaccount/lost-password-confirmation.php' );\n\n\t\t\t/**\n\t\t\t * Process reset key / login from email confirmation link\n\t\t\t */\n\t\t} elseif ( ! empty( $_GET['show-reset-form'] ) ) {\n\n\t\t\tif ( isset( $_COOKIE[ 'wp-resetpass-' . COOKIEHASH ] ) && 0 < strpos( $_COOKIE[ 'wp-resetpass-' . COOKIEHASH ], ':' ) ) {\n\t\t\t\tlist( $rp_login, $rp_key ) = array_map( 'ur_clean', explode( ':', wp_unslash( $_COOKIE[ 'wp-resetpass-' . COOKIEHASH ] ), 2 ) );\n\t\t\t\t$user = self::check_password_reset_key( $rp_key, $rp_login );\n\n\t\t\t\tif ( ! empty( $user ) ) {\n\t\t\t\t\t$form_id = ur_get_form_id_by_userid( $user->ID );\n\t\t\t\t\t$enable_strong_password = ur_get_single_post_meta( $form_id, 'user_registration_form_setting_enable_strong_password' );\n\t\t\t\t\t$minimum_password_strength = ur_get_single_post_meta( $form_id, 'user_registration_form_setting_minimum_password_strength' );\n\n\t\t\t\t\tif ( 'yes' === $enable_strong_password || '1' === $enable_strong_password ) {\n\n\t\t\t\t\t\t// Enqueue script.\n\t\t\t\t\t\twp_enqueue_script( 'ur-password-strength-meter' );\n\t\t\t\t\t\twp_localize_script( 'ur-password-strength-meter', 'enable_strong_password', $enable_strong_password );\n\t\t\t\t\t}\n\n\t\t\t\t\t// reset key / login is correct, display reset password form with hidden key / login values.\n\t\t\t\t\tif ( is_object( $user ) ) {\n\t\t\t\t\t\treturn ur_get_template(\n\t\t\t\t\t\t\t'myaccount/form-reset-password.php',\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'key' => $rp_key,\n\t\t\t\t\t\t\t\t'login' => $rp_login,\n\t\t\t\t\t\t\t\t'enable_strong_password' => $enable_strong_password,\n\t\t\t\t\t\t\t\t'minimum_password_strength' => $minimum_password_strength,\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\tself::set_reset_password_cookie();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Show lost password form by default.\n\t\tur_get_template(\n\t\t\t'myaccount/form-lost-password.php',\n\t\t\tarray(\n\t\t\t\t'form' => 'lost_password',\n\t\t\t)\n\t\t);\n\t}",
"public function forgotPassword(Request $request)\n {\n $requestParams = $request->all();\n\n $rules = [\n 'phone' => 'required',\n ];\n\n $validator = Validator::make($requestParams, $rules);\n\n if ($validator->fails()) {\n \n $errorMessages = current($validator->messages());\n \n foreach ($errorMessages as $key => $value) {\n \\Log::info(__CLASS__.' '.__FUNCTION__.' Error Message '.current($value).' Response Code '.HttpStatusCodesConsts::HTTP_BAD_REQUEST);\n\n $responseArr = ResponseUtil::buildErrorResponse(['errors' => [current($value)]], HttpStatusCodesConsts::HTTP_BAD_REQUEST, HttpStatusCodesConsts::HTTP_MANDATE_STRING);\n\n return response($responseArr, HttpStatusCodesConsts::HTTP_BAD_REQUEST);\n }\n }\n try {\n \n $validatePhone = UserHelper::getUserByDefaultPhone($requestParams['phone']);\n\n\n if (empty($validatePhone)) {\n $responseArr = ResponseUtil::buildErrorResponse(['errors' => ['No User Data Found']], HttpStatusCodesConsts::HTTP_NOT_FOUND, 'No Data Found');\n\n return response($responseArr, HttpStatusCodesConsts::HTTP_NOT_FOUND);\n }\n\n \n\n $smsText = 'Use this One time pass password ~SMS_OTP~ to reset your password . Valid till ~VALIDITY~';\n\n $otpData = UserHelper::sendOtp($validatePhone[0]['linkable_id'], $requestParams['phone'],SmsTypeConst::SMS_TYPE_ACCOUNT_FORGOT_PASSWORD, $smsText);\n\n if(empty($otpData))\n {\n $responseArr = ResponseUtil::buildErrorResponse(['errors' => ['No User Data Found']], HttpStatusCodesConsts::HTTP_NOT_FOUND, 'No Data Found');\n\n return response($responseArr, HttpStatusCodesConsts::HTTP_NOT_FOUND);\n }\n\n return response(ResponseUtil::buildSuccessResponse($otpData), HttpStatusCodesConsts::HTTP_OK);\n\n } catch (\\Exception $e) {\n\n \\Log::info(__CLASS__.' '.__FUNCTION__.' Exception Occured '.print_r($e->getMessage(), true));\n \n $responseArr = ResponseUtil::buildErrorResponse(['errors' => [HttpStatusCodesConsts::HTTP_INTERNAL_SERVER_ERROR_STRING]], HttpStatusCodesConsts::HTTP_INTERNAL_SERVER_ERROR, HttpStatusCodesConsts::HTTP_INTERNAL_SERVER_ERROR_STRING);\n\n return response($responseArr, HttpStatusCodesConsts::HTTP_INTERNAL_SERVER_ERROR);\n }\n }",
"public function getPasswordResetEmail(){\n return $this->email;\n }",
"public function forgotAction()\n {\n if (Zend_Auth::getInstance()->hasIdentity()) {\n $this->_helper->redirector->gotoRoute(array(), 'default', true);\n return;\n }\n\n $realm = $this->_getParam('realm', null);\n\n if (is_null($realm)) {\n throw new Ot_Exception_Input('msg-error-realmNotFound');\n }\n\n // Set up the auth adapter\n $authAdapter = new Ot_Model_DbTable_AuthAdapter();\n $adapter = $authAdapter->find($realm);\n\n if (is_null($adapter)) {\n\n throw new Ot_Exception_Data(\n $this->view->translate('ot-login-signup:realmNotFound', array('<b>' . $realm . '</b>'))\n );\n }\n\n if ($adapter->enabled == 0) {\n throw new Ot_Exception_Access('msg-error-authNotSupported');\n }\n\n $className = (string)$adapter->class;\n $auth = new $className();\n\n if (!$auth->manageLocally()) {\n throw new Ot_Exception_Access('msg-error-authNotSupported');\n }\n\n $form = new Ot_Form_ForgotPassword();\n\n if ($this->_request->isPost()) {\n if ($form->isValid($_POST)) {\n\n $account = new Ot_Model_DbTable_Account();\n\n $userAccount = $account->getByUsername($form->getValue('username'), $realm);\n\n if (!is_null($userAccount)) {\n $loginOptions = array();\n $loginOptions = Zend_Registry::get('applicationLoginOptions');\n\n // Generate key\n $text = $userAccount->username . '@' . $userAccount->realm . '-' . time();\n $key = $loginOptions['forgotpassword']['key'];\n $iv = $loginOptions['forgotpassword']['iv'];\n $cipher = $loginOptions['forgotpassword']['cipher'];\n\n $code = bin2hex(mcrypt_encrypt($cipher, $key, $text, MCRYPT_MODE_CBC, $iv));\n\n $this->_helper->messenger->addSuccess('msg-info-passwordResetRequest');\n\n $loggerOptions = array('attributeName' => 'accountId', 'attributeId' => $userAccount->accountId);\n\n $this->_helper->log(Zend_Log::INFO, 'User ' . $userAccount->username . ' sent a password reset request.', $loggerOptions);\n\n $dt = new Ot_Trigger_Dispatcher();\n $dt->setVariables(array(\n 'firstName' => $userAccount->firstName,\n 'lastName' => $userAccount->lastName,\n 'emailAddress' => $userAccount->emailAddress,\n 'username' => $userAccount->username,\n 'resetUrl' => Zend_Registry::get('siteUrl') . '/login/password-reset/?key=' . $code,\n 'loginMethod' => $userAccount->realm,\n ));\n\n $dt->dispatch('Login_Index_Forgot');\n\n $this->_helper->redirector->gotoRoute(array('realm' => $realm), 'login', true);\n } else {\n $this->_helper->messenger->addError('msg-error-userAccountNotFound');\n }\n } else {\n $this->_helper->messenger->addError('msg-error-invalidFormInfo');\n }\n }\n\n $this->_helper->pageTitle('ot-login-forgot:title');\n $this->view->assign(array(\n 'form' => $form,\n ));\n }",
"public function getFailed(): int\n {\n return $this->failed;\n }",
"protected function sendResetLinkFailedResponse(Request $request, $response)\n {\n return response()->json(['status' => false,'message' => 'Email could not be sent to this email address.']);\n }",
"public function checkresetcode($resetcode) {\n $returnData = array();\n $response = \"OK\";\n $statusCode = 200;\n $result = null;\n $message = \"Checking user by reset code $resetcode success.\";\n $isError = FALSE;\n $missingParams = null;\n\n if(!$isError) {\n try {\n $user = User::where('resetcode', $resetcode)->first();\n if ($user) {\n $result = array(\"resetcode\" => $resetcode);\n } else { throw new \\Exception(\"User with reset code $resetcode not found.\"); }\n } catch (\\Exception $e) {\n $response = \"FAILED\";\n $statusCode = 400;\n $message = $e->getMessage();\n }\n }\n\n $returnData = array(\n 'response' => $response,\n 'status_code' => $statusCode,\n 'message' => $message,\n 'result' => $result\n );\n\n return response()->json($returnData, $statusCode)->header('access-control-allow-origin', '*');\n }",
"public function post_forgotpasswordconfirmed() {\n try {\n $i = Input::post();\n\n $user = new \\Craftpip\\OAuth\\Auth($i['user_id']);\n $key = $user->getAttr('forgotpassword_key');\n if ($key != $i['key']) {\n throw new Exception('Sorry, the token has expired.');\n }\n\n if (!(strlen($i['password']) > 5 && strlen($i['password']) < 12)) throw new Exception('Sorry, something went wrong.');\n\n $user->setPassword($i['password']);\n $user->removeAttr('forgotpassword_key');\n $user->setAttr('verified', true); // because password reset happened via email.\n if ($user->existAttr('verify_key')) $user->removeAttr('verify_key');\n $user->force_login($user->user_id);\n\n $response = array(\n 'status' => true,\n 'message' => 'Password has been changed successfully.',\n );\n } catch (Exception $e) {\n $response = array(\n 'status' => false,\n 'reason' => $e->getMessage(),\n );\n }\n echo json_encode($response);\n }",
"public function post_forgot_password() {\n $fields = array(\n 'code' => Input::get('code'), \n 'email' => Input::get('email'),\n );\n\n $account = Account::where_code(Input::get('code', 0))->first();\n $account_id = 0;\n if(!is_null($account)) {\n $account_id = $account->id;\n }\n \n $rules = array(\n 'code' => 'required|exists:accounts',\n 'email' => 'required|email|exists_in_account:users,email,'.$account_id,\n );\n \n $validation = Validator::make($fields, $rules);\n \n if( $validation->fails() ) {\n Input::flash();\n return Redirect::to_action('login@forgot_password')->with_errors($validation);\n //return $this->get_forgot_password()->with('errors', $validation);\n } else {\n $user = User::where('account_id', '=', $account_id)->where_email(Input::get('email'))->first();\n $new_password = Str::random(6, 'alnum');\n $user->change_password_request = 'Y';\n $user->password = $new_password;\n $user->save();\n \n //------------------------------------------------------------------------------------\n // Send email with the confirmation links\n $mailer = IoC::resolve('mailer');\n $message_body = Response::view('user.emails.password-reset', array('user' => $user, 'password' => $new_password))->render();\n\n // Construct the message\n $message = Swift_Message::newInstance('Password Reset')\n ->setFrom(array('no-reply@test.com'=>'test'))\n ->setTo(array($user->email => $user->name))\n ->setBody($message_body,'text/html');\n\n // Send the email\n $mailer->send($message);\n $this->warnings[] = \"An email with the new password has been sent to your email. Don't forget to check your junk/bulk/spam folder if it doesn't arrive in your inbox.\";\n //------------------------------------------------------------------------------------\n\n return $this->get_forgot_password()\n ->with('warnings', $this->warnings);\n\n }\n \n }"
] | [
"0.7468882",
"0.6679239",
"0.6547944",
"0.6545718",
"0.6514435",
"0.64671266",
"0.6401218",
"0.6348882",
"0.6323448",
"0.6320657",
"0.63100183",
"0.6305281",
"0.62862825",
"0.6279374",
"0.62683797",
"0.6262106",
"0.62468404",
"0.6239811",
"0.6170976",
"0.6169413",
"0.61547285",
"0.6147851",
"0.6139624",
"0.61309904",
"0.61309904",
"0.61173385",
"0.6109327",
"0.61026263",
"0.6089897",
"0.60751414",
"0.6074594",
"0.60634065",
"0.6061324",
"0.60254014",
"0.60162485",
"0.60142004",
"0.6003899",
"0.60031927",
"0.59863687",
"0.59713304",
"0.5970658",
"0.594959",
"0.5948372",
"0.593416",
"0.593282",
"0.5908152",
"0.59077555",
"0.58920854",
"0.58897513",
"0.588973",
"0.58866405",
"0.5881576",
"0.5864651",
"0.58447224",
"0.5844156",
"0.5836457",
"0.58265316",
"0.5823778",
"0.582058",
"0.58123857",
"0.58063436",
"0.57899976",
"0.57771355",
"0.57765704",
"0.5775834",
"0.57738596",
"0.57693255",
"0.5762202",
"0.5758354",
"0.574034",
"0.5733603",
"0.5731796",
"0.5729686",
"0.5729661",
"0.5729498",
"0.5727752",
"0.572767",
"0.5722524",
"0.5719204",
"0.57182515",
"0.57145965",
"0.57077014",
"0.5700179",
"0.5698612",
"0.56934154",
"0.56926996",
"0.5688691",
"0.568546",
"0.5676944",
"0.56749505",
"0.5672029",
"0.56689364",
"0.5666372",
"0.5656922",
"0.5650101",
"0.5648257",
"0.5647586",
"0.5645921",
"0.56435114",
"0.56414074"
] | 0.6508438 | 5 |
browse show list of matakuliah | function _browse()
{
if ($this->_access === 'BAAK')
{
return $this->MatakuliahModel->browse();
}
else
{
redirect(base_url('/auth/logout'));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexmatakuli()\n {\n $matakuliah = DB::table('tabel_matakuliah')->paginate(5);\n\n // lempar data dari db\n return view('/admin/input/distmk',['matakuliah' => $matakuliah]);\n }",
"public function listing();",
"function index() {\n\t\t$this->show_list();\n\t}",
"function index() {\r\n \t\r\n // The default action is the showall action\r\n $this->browse();\r\n }",
"public function index()\n {\n $mata_kuliah = mata_kuliah::all();\n return view('matakuliah-list',compact(['mata_kuliah']));\n }",
"function index(){\n\t\t$list = $this->user->ambil_semua_data();\n\n\t\t/* hasil data */\n\t\t$data['result'] = $list;\n\n\t\t/* Load view */\n\t\t$this->template->write_view('list', $data);\n\t}",
"public function listdataKeuAction() {\n $this->view->dataList = $this->adm_listdata_serv->getDataList('KEUANGAN');\n }",
"public function mata_kuliah_jurusan(){\n\t\t\t$data['content'] = \"mk_jurusan/mata_kuliah_jurusan\";\n\t\t\t$mk = \"t_mk\";\n\t\t\t$data['mk'] = $this->m_aka->get_all($mk);\n\t\t\t$this->load->view(\"content\", $data);\n\t\t}",
"public function listdataTAPAction() {\n $this->view->dataList = $this->adm_listdata_serv->getDataList('TATA PERSURATAN');\n }",
"public function input_mata_kuliah(){\n\t\t$mk = \"t_mk\";\n\t\t$data['content'] = 'mata_kuliah/input_mata_kuliah';\n\t\t$data['mata_kuliah'] = $this->m_aka->get_all($mk);\n\t\t$this->load->view('content',$data);\n\t}",
"public function indexAction()\n {\n // Рандом видео из лучших\n $model_files = new Model_Files();\n\n $_arr = $model_files->fetchRandomTopFile();\n $this->view->model_file_obj = $_arr;\n \n // Топ (видео)\n $_arr = $model_files->fetchTopSelect(ST_REQUEST_TOP_TYPE_ALL);\n $this->view->top_video_array = $_arr;\n \n unset($model_files);\n \n// dump($this->_helper->viewRenderer->getResponse()->getBody());\n\n }",
"public function listpgAction()\n { \n $form = new Formulario(\"form\");\n // valores iniciales formulario (C)\n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $d=new AlbumTable($this->dbAdapter);\n // -- \n if($this->getRequest()->isPost()) // Si es por busqueda\n {\n $request = $this->getRequest();\n $data = $this->request->getPost();\n if ($request->isPost()) \n {\n $orden = (int) $data->orden;\n $d->modGeneral(\"update n_turnos_g_h \n set orden=\".$orden.\" \n where id = \".$data->id); \n }\n }\n $view = new ViewModel(); \n $this->layout(\"layout/blancoC\");\n return $view; \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}",
"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 show(MataKuliah $mataKuliah)\n {\n //\n }",
"public function index()\n { \n $this->locate(inlink('browse'));\n }",
"public function index()\n {\n $data = Mahasiswa::mhskp();\n // dd($data);\n return view('admin.kp.pembimbing.list_pembimbing',compact('data'));\n }",
"public function actionHTUselisting()\n {\n \t ob_start();\n \t Yii::app()->theme='back';\n \t $rec=HtuseHome::model()->findAll();\n \t $this->render('htuselisting',array('list'=>$rec));\n }",
"public function index(){\n $field=array(\n \"*\",\n \"case\n when cat_isshow=0 then '不可用'\n else '可用' end\"\n =>\"cat_isshow\",\n \"case\n when cat_show_in_front=1 then '展示'\n else '不展示' end\"\n =>\"cat_show_in_front\",\n \"case\n when cat_grade=0 then '没有价格范围'\n else cat_grade end\"\n =>\"cat_grade\"\n );\n $this->lists=M('PaimaiCategory')->field($field)->where(\"cat_isdelete=0\")->select();\n //p($this->lists);\n $this->display();\n }",
"public function actionIndex()\n {\n $pages=new Pagination([\n 'totalCount'=>MediaComp::getInstance()->getMediaCount(),\n ]);\n $dataList=MediaComp::getInstance()->getMediaList($pages->offset,$pages->limit);\n return $this->render('index',['dataList'=>$dataList,'pages'=>$pages]);\n }",
"public function actionList() {\n $this->_getList();\n }",
"function browse()\n {\n $sort = $this->GET('sort');\n if ($sort)\n $this->table->sort($sort . \" SORT_NULL\");\n $rows = (int) $this->GET('rows');\n if (empty($rows) || $rows < 1)\n $rows = 50;\n\n if ($this->table->count() > $rows) {\n $id = $this->GET('id');\n if (empty($id))\n $id = $this->table->first();\n $this->table->limit($rows, $id);\n\n $form = '<form action=\"' . $this->SELF . '\" method=\"get\"><p>';\n $aHref = '<a href=\"' . $this->SELF . '?method=browse&table=' . $this->table->tablename() . '&sort=' . urlencode($sort) . '&rows=' . $rows . '&id=';\n $first = $this->table->first();\n $prev = $this->table->prev($id, $rows);\n $next = $this->table->next($id, $rows);\n $last = $this->table->prev($this->table->last(), ($this->table->count() - 1) % $rows);\n if (strcmp($first, $id) == 0)\n $form .= '<< First | ';\n else\n $form .= $aHref . urlencode($first) . '\"><< First</a> | ';\n if ($prev === false)\n $form .= '< Previous | ';\n else\n $form .= $aHref . urlencode($prev) . '\">< Previous</a> | ';\n $form .= '<input name=\"method\" type=\"hidden\" value=\"browse\">';\n $form .= '<input name=\"table\" type=\"hidden\" value=\"' . $this->table->tablename() . '\">';\n $form .= '<input name=\"sort\" type=\"hidden\" value=\"' . htmlspecialchars($sort) . '\">';\n $form .= '<input type=\"submit\" value=\"Show\"> ';\n $form .= '<input name=\"rows\" size=\"4\" type=\"text\" value=\"' . $rows . '\"> rows starting from <span class=\"primary\" title=\"Row identifier\">id</span> ';\n $form .= '<input name=\"id\" size=\"12\" type=\"text\" value=\"' . htmlspecialchars($id) . '\"> | ';\n if ($next === false)\n $form .= 'Next > | ';\n else\n $form .= $aHref . urlencode($next) . '\">Next ></a> | ';\n if (strcmp($last, $id) == 0)\n $form .= 'Last >>';\n else\n $form .= $aHref . urlencode($last) . '\">Last >></a>';\n $form .= '</p></form>';\n }\n\n $this->displayHead();\n if (! empty($form))\n echo $form;\n\n echo '<table>';\n echo '<tr><th colspan=\"2\"></th>';\n foreach ($this->table->fields as $i => $field) {\n $field = $this->htmlQuote($field);\n echo '<th><a href=\"' . $this->SELF;\n echo '?method=browse&table=' . $this->table->tablename() . '&sort=' . urlencode($field);\n if ($sort == $field)\n echo urlencode(' DESC');\n echo '&rows=' . urlencode($rows);\n echo '\" title=\"Order\"';\n if (! $i)\n echo ' class=\"primary\"';\n echo '>' . $field . '</a>';\n if (strcmp($sort, $field) == 0)\n echo '+';\n elseif (substr($sort, 0, - 5) == $field)\n echo '-';\n echo '</th>';\n }\n echo '</tr>';\n\n while ($row = $this->table->each()) {\n echo '<tr><td>';\n if ($this->priv & PRIV_UPDATE)\n echo '<a href=\"' . $this->SELF . '?method=change&table=' . $this->table->tablename() . '&id=' . urlencode($row['id']) . '\">Edit</a>';\n echo '</td><td>';\n if ($this->priv & PRIV_DELETE)\n echo '<a class=\"danger\" href=\"' . $this->SELF . '?method=delete&table=' . $this->table->tablename() . '&id=' . urlencode($row['id']) . '\">Delete</a>';\n echo '</td>';\n foreach ($this->table->fields as $field) {\n if (! isset($row[$field]))\n $row[$field] = \"\";\n switch ($this->types[$field]) {\n case \"bool\":\n echo '<td align=\"center\">' . ($row[$field] ? '×' : '') . '</td>';\n break;\n case \"int\":\n case \"float\":\n echo '<td align=\"right\">' . $row[$field] . '</td>';\n break;\n case \"blob\":\n echo '<td><a href=\"' . $this->SELF;\n echo '?method=download&table=' . $this->table->tablename();\n echo '&id=' . urlencode($row['id']) . '&field=' . $field . '\"';\n echo ' class=\"download\" title=\"Download binary file\">';\n echo $this->htmlQuote($row[$field]) . '</a></td>';\n break;\n default:\n echo '<td>' . $this->htmlQuote($row[$field]) . '</td>';\n }\n }\n echo '</tr>';\n }\n echo '</table>';\n\n if (! empty($form))\n echo $form;\n if ($this->priv & PRIV_INSERT)\n echo '<p><a href=\"' . $this->SELF . '?method=change&table=' . $this->table->tablename() . '\">Insert new row</a></p>';\n }",
"function listChaptersBackend() {\r\n \r\n $chapterManager = new \\Alaska2\\Model\\ChapterManager();\r\n $chapters = $chapterManager->getChapters();\r\n\r\n include 'view/backend/listChaptersViewBackend.php';\r\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 browseAction()\n {\n $table = $this->_helper->db->getTable();\n $select = $table->getSelect();\n $select->where('job_id IS NULL');\n $this->view->batch_upload_mapping_sets = $table->fetchObjects($select);\n }",
"public function actionMultaList()\n {\n $data = [];\n $objectUser = Multas::getInstancia();\n $users = $objectUser->getAllMultas();\n\n $this->renderHtml('../views/listMultas_view.php', $users);\n }",
"public function index(){\n //获取语言\n $lang = LANG;\n $data = M('Website_index_images')->where(\"lang='$lang' and used=1\")->order('num asc,id asc')->select();\n foreach($data as $v){\n $description=json_decode($v['description']);\n $v['description'] = array('p1'=>stripslashes($description->p1),'p2'=>stripslashes($description->p2),\n 'p3'=>stripslashes($description->p3),'p4'=>stripslashes($description->p4),\n 'p5'=>stripslashes($description->p5));\n $res[] = $v;\n }\n $device = device();\n $this->assign('device',$device);\n $this->assign('list',$res);\n $this->display();\n\t}",
"public function _index(){\n\t $this->_list();\n\t}",
"public function index()\n {\n $data = array(\n 'matakuliah' => Matakuliah::where('status', '=', 1)->get(),\n 'title' => 'mata kuliah'\n );\n\n return view('backend.pages.backend-show-matakuliah')->with($data);\n }",
"public function index()\n {\n $this->locate(inlink('browse'));\n }",
"public function index()\n {\n $this->locate(inlink('browse'));\n }",
"public function listagemAction()\n\t{\n\t\n\t}",
"public function show()\n {\n\t\t//$result = $a->selectAll();\n include(\"view/bureau.html\");\n }",
"public function index()\n {\n $model = static::queryAll()->where( 'name' , '!=' , 'root' )->where( 'name' , '!=' , 'farm' );\n $this->_list( $model );\n $this->layout->title = '查看' . static::$name;\n }",
"function browse() {\r\n \t$this->user_group_model->can_access(VIEW_LIST_MENU, null, null);\r\n $start = $this->uri->segment(3,0);\r\n $limit_per_page = 20;\r\n// $menuId = $this->uri->segment(3,0);\r\n\t\r\n $this->load->model('menu_model'); // Instantiate the model\r\n \r\n\t\t//list all menuergories\r\n\t\t$aryNewsTypesList = array();\r\n\t\t$this->menu_model->getMenuegoryTree($aryNewsTypesList);\r\n\t\t$the_results['aryNewsTypesList'] = $aryNewsTypesList;\r\n \r\n $this->load->library('pagination');\r\n $this->load->helper('url');\r\n\r\n $config['total_rows'] = $this->menu_model->table_record_count;\r\n $config['per_page'] = $limit_per_page;\r\n $config['uri_segment'] = 4;\r\n $config['num_links'] = 3;\r\n $config['base_url'] = base_url().'menu/browse/';\r\n\r\n $this->pagination->initialize($config);\r\n\r\n $the_results['page_links'] = $this->pagination->create_links();\r\n $the_results['title'] = 'Danh sách tin';\r\n \t\t\r\n $this->_display('/menu/menu_grid', $the_results);\r\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 return $this->collection(Matakuliah::all(), new MatakuliahTransformer);\n }",
"public function browseAction() {\n $this->validateRequestMethod();\n // Prepare the response\n $params = $response = array();\n $params = $this->_getAllParams();\n Engine_Api::_()->getApi('Core', 'siteapi')->setView();\n\n //GET PAGINATOR\n $params['pagination'] = 1;\n $paginator = Engine_Api::_()->getDbtable('wishlists', 'sitereview')->getBrowseWishlists($params);\n $page = $this->_getParam('page', 1);\n $limit = $this->_getParam('limit', 20);\n $paginator->setItemCountPerPage($limit);\n $paginator->setCurrentPageNumber($page);\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n\n $totalItemCount = $paginator->getTotalItemCount();\n $totalPages = ceil(($totalItemCount) / $limit);\n $response['totalItemCount'] = $totalItemCount;\n if (!empty($totalItemCount)) {\n foreach ($paginator as $wishlistObj) {\n $wishlist = $wishlistObj->toArray();\n if (isset($wishlist['body']) && !empty($wishlist['body']))\n $wishlist['body'] = strip_tags($wishlist['body']);\n $lists = $wishlistObj->getWishlistMap(array('orderby' => 'listing_id'));\n $count = $lists->getTotalItemCount();\n $tempListings = array();\n $counter = 0;\n if (_ANDROID_VERSION >= '1.8.6' || _IOS_VERSION >= '1.8.0') {\n if (empty($count) || !isset($count) || $count == 0) {\n $tempListings['images_' . $counter] = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($wishlistObj);\n } else {\n foreach ($lists as $listings) {\n if ($counter >= 3)\n break;\n else {\n $counter++;\n $tempListings['images_' . $counter] = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($listings);\n }\n }\n }\n } else {\n if (empty($count) || !isset($count) || $count == 0) {\n $tempListings['listing_images_' . $counter] = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($wishlistObj);\n } else {\n foreach ($lists as $listings) {\n if ($counter >= 3)\n break;\n else {\n $counter++;\n $tempListings['listing_images_' . $counter] = Engine_Api::_()->getApi('Core', 'siteapi')->getContentImage($listings);\n }\n }\n }\n }\n $wishlist = array_merge($wishlist, $tempListings);\n $check_availability = Engine_Api::_()->sitereview()->check_availability('sitereview_wishlist', $wishlistObj->wishlist_id);\n $checkFollowAvailablity = $wishlistObj->follows()->isFollow($viewer);\n $tempMenu = array();\n if (!empty($viewer_id)) {\n if (empty($check_availability)) {\n $wishlist['isLike'] = 0;\n $tempMenu[] = array(\n 'name' => 'like',\n 'label' => $this->translate('Like'),\n 'url' => '/like',\n 'urlParams' => array(\n \"subject_type\" => 'sitereview_wishlist',\n 'subject_id' => $wishlistObj->getIdentity()\n )\n );\n } else {\n $wishlist['isLike'] = 1;\n $tempMenu[] = array(\n 'name' => 'like',\n 'label' => $this->translate('Unlike'),\n 'url' => '/unlike',\n 'urlParams' => array(\n \"subject_type\" => 'sitereview_wishlist',\n 'subject_id' => $wishlistObj->getIdentity()\n )\n );\n }\n\n if (!empty($checkFollowAvailablity)) {\n $wishlist['followed'] = 1;\n $tempMenu[] = array(\n 'name' => 'follow',\n 'label' => $this->translate('Unfollow'),\n 'url' => '/listings/wishlist/follow/' . $wishlistObj->getIdentity(),\n 'urlParams' => array()\n );\n } else {\n $wishlist['followed'] = 0;\n $tempMenu[] = array(\n 'name' => 'follow',\n 'label' => $this->translate('Follow'),\n 'url' => '/listings/wishlist/follow/' . $wishlistObj->getIdentity(),\n 'urlParams' => array()\n );\n }\n\n $wishlist['gutterMenu'] = $tempMenu;\n }\n $tempResponse[] = $wishlist;\n }\n }\n if (!empty($viewer_id)) {\n $level_id = $viewer->level_id;\n } else {\n $level_id = Engine_Api::_()->getDbtable('levels', 'authorization')->fetchRow(array('type = ?' => \"public\"))->level_id;\n }\n $can_create = ($viewer_id) ? 1 : 0;\n $response['canCreate'] = $can_create;\n if (!empty($tempResponse))\n $response['response'] = $tempResponse;\n $this->respondWithSuccess($response, true);\n }",
"public function listavAction() \n {\n if($this->getRequest()->isPost()) // Actulizar datos\n {\n $request = $this->getRequest();\n if ($request->isPost()) { \n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $data = $this->request->getPost(); \n $d = new AlbumTable($this->dbAdapter); \n $form = new Formulario(\"form\"); \n $datos = $d->getGeneral1(\"select count(idFor) as num from n_conceptos where id = \".$data->id);\n $conFor = $datos['num']; \n \n $valores=array\n (\n \"form\" => $form,\n \"conFor\" => $conFor,\n 'url' => $this->getRequest()->getBaseUrl(),\n ); \n $view = new ViewModel($valores); \n $this->layout('layout/blancoC'); // Layout del login\n return $view; \n }\n } \n }",
"function listing() {\r\n\r\n }",
"public function listdataAction() {\n $this->view->dataList = $this->adm_listdata_serv->getDataList('%');\n }",
"function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}",
"public function listmobilisateurAction() {\n\n $sessionmembre = new Zend_Session_Namespace('membre');\n //$this->_helper->layout->disableLayout();\n $this->_helper->layout()->setLayout('layoutpublicesmcperso');\n\n if (!isset($sessionmembre->code_membre)) {\n $this->_redirect('/');\n }\n\n $mobilisateur = new Application_Model_EuMobilisateurMapper();\n $this->view->entries = $mobilisateur->fetchAllByMembre($sessionmembre->code_membre);\n\n $this->view->tabletri = 1;\n }",
"public function showall()\n {\n }",
"public function index(){\n $this->setData('seo_title', 'Spisak korisnika | Aplikacija za vođenje ličnih finansija');\n $korisnici = HomeModel::getAll();\n $this->setData('korisnici', $korisnici);\n }",
"public function listtabelKeuAction() {\n $this->view->tableList = $this->adm_listtabel_serv->getTableList('KEUANGAN');\n }",
"public function printlist(){\r\n\t\t$parishID = Convert::raw2sql($this->request->getVar('ParishID'));\t\t\r\n\t\tif(!$this->canAccess($parishID)){\r\n\t\t\treturn $this->renderWith(array('Unathorised_access', 'App'));\r\n\t\t}\r\n\t\t\r\n\t\t$this->title = 'Media list';\t\t\r\n\t\treturn $this->renderWith(array('Media_printresults','Print'));\r\n\t}",
"public function actionIndex()\n {\n $searchModel = new BukuSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function listar() {\n\t\t//Esta funcion solo la puede hacer el organizador, hay que poner al inicio de todo una comprobacion\n\t\t//de sesion, falta cambiar\n\t\t$juradoL = $this -> JuradoMapper -> findAll();\n\t\t$this -> view -> setVariable(\"jurado\", $juradoL);\n\t\t//falta agregar la vista, no se continuar\n\t\t$this -> view -> render(\"jurado\", \"listar\");\n\t\t//falta cambiar\n\t}",
"public function actionBrowse()\n\t{\n\t\t$categoriesModel = new Category;\n\t\t$categoriesData = $categoriesModel->getCategoryBrowseTree();\n\t\t$data['categoriesData'] = $categoriesData;\n\t\t$this->page = 'BrowseCategories';\n if (!Yii::app()->user->isGuest) {\n\t\t $avatar = $this->user['avatar']; \n\t\t $this->layoutParams['avatarUrl'] = getProfileImageUrl($avatar, \"sqr\", Yii::app()->user->getName());\n \t\t$this->layoutParams['author'] = Yii::app()->user->name;\n\t\t $this->layoutParams['profileUrl'] = Yii::app()->request->getBaseUrl() . \"/\" . Yii::app()->user->username . \"/profile\";\n }\n\t\t$this->render('clap/browse',$data);\n\t}",
"public function index()\n {\n return $this->showList(ObjectMuseum::where('deleted','=',ObjectMuseum::ACTIVE)->get());\n }",
"public function liste()\n {\n $discs = $this->LoadModel('Disc');\n $discDetail = $discs->info_record();\n $this->render('liste', [\n 'discs' => $discDetail\n ]);\n }",
"public function indexAction()\n {\n\n $manager = $this->container->get('app_manager_listkdo');\n $data = array(\n 'manager' => $manager,\n 'dir' => 'AppBundle:ListKdo',\n 'show' => 'appbundle_listkdo_show',\n 'edit' => 'appbundle_listkdo_edit'\n );\n\n return $this->gridList($data);\n }",
"public function index()\n {\n return Mahasiswa::all();\n }",
"public function index()\n {\n $mataKuliah = MataKuliah::get();\n return view('matakuliah.index', compact('mataKuliah'));\n }",
"public function movie_list() {\n $data[\"movies\"] = $this->Movie->findAll();\n\n // Capa de la Vista\n $view['body'] = $this->load->view(\"core/movies/list\", $data, TRUE);\n $view['title'] = \"Listado de películas\";\n $this->parser->parse('core/templates/body', $view);\n }",
"public function action_index() {\r\n $count = ORM::factory('documentos')->where('original', '=', 1)->and_where('id_user', '=', $this->user->id)->count_all();\r\n $pagination = Pagination::factory(array(\r\n 'total_items' => $count,\r\n 'current_page' => array('source' => 'query_string', 'key' => 'page'),\r\n 'items_per_page' => 50,\r\n 'view' => 'pagination/floating',\r\n ));\r\n $oNur = New Model_Hojasruta();\r\n $result = $oNur->hojasruta($this->user->id, $pagination->offset, $pagination->items_per_page);\r\n $page_links = $pagination->render();\r\n $oDoc = New Model_Tipos();\r\n $documentos = $oDoc->misTipos($this->user->id);\r\n $options = array();\r\n foreach ($documentos as $d) {\r\n $options[$d->id] = $d->tipo;\r\n }\r\n $this->template->title .= ' | Lista de HR creadas';\r\n $this->template->styles = array('media/css/tablas.css' => 'all', 'media/css/modal.css' => 'screen');\r\n $this->template->scripts = array('media/js/jquery.tablesorter.min.js');\r\n $this->template->content = View::factory('hojaruta/index')\r\n ->bind('result', $result)\r\n ->bind('page_links', $page_links)\r\n ->bind('count', $count)\r\n ->bind('options', $options);\r\n }",
"public function index()\n {\n $data = Buku::paginate(10);\n $tampil['data'] = $data;\n return view('buku.index', $tampil);\n }",
"function show_list_nominee()\n {\n // $id = $_SESSION['UsEmp_ID'];\n $this->load->model('M_pef_file_present', 'list');\n $data['emp_nominee'] = $this->list->get_nominee()->result();\n\n $this->load->model('M_pef_file_present', 'file');\n $data['emp_file'] = $this->file->get_all()->result();\n\n $this->output('consent/v_add_file_present', $data);\n }",
"public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }",
"function jslist(){\r\n\t\t//list all albums and put into a proper array\r\n\t\t$this->checkSessionAjax();\r\n\t\t$albums = $this->Album->findAll();\r\n\t\t$out = array();\r\n\t\t\r\n\t\tforeach($albums as $al){\r\n\t\t\t$al['Album']['extendname'] = $al['Album']['name'].\"(\".sizeof($al['Image']).\")\";\r\n\t\t\t$out[] = $al['Album'];\r\n\t\t}\r\n\t\t\r\n\t\t$ident = Array();\r\n\t\t$ident['identifier'] = \"name\";\r\n\t\t$ident['items'] = $out;\r\n\t\t\r\n\t\t$this->set('output',$ident);\r\n\t\t$this->render('json','ajax');\r\n\t}",
"public function index()\n {\n $host = new Host();\n $url = $host->host('api') . 'matkul';\n $reqApi = new Request_api();\n $response = $reqApi->request('GET', $url);\n\n $data = [];\n $data['mata_kuliah'] = [];\n if ($response['status'] == 200) {\n $matakuliah = $response['data'];\n $matakuliah = collect($matakuliah);\n $matakuliah = $matakuliah->map(function ($item, $index) {\n $item = collect($item)->toArray();\n return $item;\n });\n $data['mata_kuliah'] = $matakuliah;\n }\n\n // call modal name\n $data['modal_name'] = \"MATKUL\";\n return view('matkul', $data);\n }",
"public function index()\n\t{\n\t\t$this->data['bmjc_list'] = $this->bmjc_mdl->getbmjclist(); \n\t\t$this->load->view('bmjc_list',$this->data);\n\t}",
"public function actionWelcomeListing()\n {\n \tob_start();\n \tYii::app()->theme='back';\n \t$rec=HomeWelcome::model()->findAll();\n //echo \"<pre>\";print_r($rec);die; \n \t$this->render('welcomelisting',array('list'=>$rec));\n }",
"public function indexAction ()\n {\n $em = $this->getDoctrine()->getManager();\n\n $maileguaks = $em->getRepository( 'AppBundle:Maileguak' )->findAll();\n\n return $this->render(\n 'maileguak/index.html.twig',\n array (\n 'maileguaks' => $maileguaks,\n )\n );\n }",
"public function listnAction()\n {\n $form = new Formulario(\"form\"); \n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $d = new AlbumTable($this->dbAdapter); // ---------------------------------------------------------- 1 FUNCION DENTRO DEL MODELO (C)\n $request = $this->getRequest();\n $data = $this->request->getPost();\n\n $dia = \"a.t\".$data->diasMes;\n \n $con = \" and a.nombre like '%\".ltrim($data->nombre).\"%' \n or b.nombre like '%\".ltrim($data->nombre).\"%' \";\n\n $valores=array\n (\n \"form\" => $form,\n \"datos\" => $d->getPuesSuper($con),\n \"lin\" => $this->lin,\n ); \n $view = new ViewModel($valores); \n $this->layout('layout/blancoC'); \n return $view; \n }",
"public function list_wilayah()\n\t{\n\t\tif($this->is_login){\n\t\t\t$products = $this->M_region->getAll();\n\t\t\t// Set Response\n\t\t\t$this->response_code = 200;\n\t\t\t$this->response['status'] = TRUE;\n\t\t\t$this->response['data'] = $products;\n\t\t}\n\n\t\t// Run the Application\n\t\t$this->run(SECURED);\n\t}",
"public function actionIndex()\n\t{\n\t\t$searchModel = new WiMasterlistSearch;\n\t\t$dataProvider = $searchModel->search($_GET);\n\n\t\tTabs::clearLocalStorage();\n\n Url::remember();\n \\Yii::$app->session['__crudReturnUrl'] = null;\n\n\t\treturn $this->render('index', [\n\t\t\t'dataProvider' => $dataProvider,\n\t\t\t'searchModel' => $searchModel,\n\t\t\t'sectionDropdown' => ArrayHelper::map(DocSection::find()->orderBy('section_name')->all(), 'doc_section_id', 'section_name'),\n\t\t\t'docTypeDropdown' => ArrayHelper::map(DocType::find()->orderBy('type_name')->all(), 'doc_type_id', 'type_name'),\n\t\t\t'wiMakerDropdown' => ArrayHelper::map(User::find()->where(['role_id' => 4])->orderBy('name')->all(), 'id', 'name'),\n\t\t]);\n\t}",
"function detail_ambil_paket_isi_perawatan_list(){\r\n\t\t$query = isset($_POST['query']) ? $_POST['query'] : \"\";\r\n\t\t$start = (integer) (isset($_POST['start']) ? $_POST['start'] : $_GET['start']);\r\n\t\t$end = (integer) (isset($_POST['limit']) ? $_POST['limit'] : $_GET['limit']);\r\n\t\t$master_id = (integer) (isset($_POST['master_id']) ? $_POST['master_id'] : $_GET['master_id']);\r\n\t\t$result=$this->m_master_ambil_paket->detail_ambil_paket_isi_perawatan_list($master_id,$query,$start,$end);\r\n\t\techo $result;\r\n\t}",
"function index() {\t\n\t $this->account();\t \n\t // $conditions=array('Catproduct.status'=>1);\t\n\t $this->paginate = array('limit' => '15','order' => 'Album.id ASC');\n\t $this->set('Album', $this->paginate('Album',array()));\n $list_cat = $this->Album->generatetreelist(null,null,null,\" _ \");\n\t $this->set(compact('list_cat'));\n\t}",
"public function actionIndex()\n {\n $searchModel = new CapaianMahasiswaSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function index()\n\t{\n\t\t$data = array(\n\t\t\t'body' => 'browse/index',\n\t\t\t'na_servers' => $this->browse_model->get_shards('na'),\n\t\t\t'eu_servers' => $this->browse_model->get_shards('eu')\n\t\t);\n\t\t$this->load->view('template', $data);\n\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 buku()\n\t{\n $respon = $this->curl->simple_get($this->API . '/buku');\n $buku = json_decode($respon, true);\n $data['buku'] = $buku['values'];\n $data['title'] = 'Admin Perpustakaan | Halaman Buku';\n\t\t$this->load->view('admin/include/head', $data);\n\t\t$this->load->view('admin/include/header');\n\t\t$this->load->view('admin/include/sidebar');\n\t\t$this->load->view('admin/buku', $data);\n\t\t$this->load->view('admin/include/script');\n\t\t$this->load->view('admin/include/footer');\n\t}",
"public function list();",
"public function list();",
"public function list();",
"public function Listar(){\n\n $motorista = new Motorista();\n\n return $motorista::Select();\n\n }",
"public function index()\n\t{\n //ambil data lalu simpan di var data\n $data=$this->mymodel-> Get (\"film\");\n $data= array('data' => $data);\n //var data diubah menjadi var tipe data\n\t\t$this->load->view('hal_depan', $data);\n }",
"public function browseAction() {\r\n\r\n //GET PAGE OBJECT\r\n $pageTable = Engine_Api::_()->getDbtable('pages', 'core');\r\n $pageSelect = $pageTable->select()->where('name = ?', \"sitestoreproduct_wishlist_browse\");\r\n $pageObject = $pageTable->fetchRow($pageSelect);\r\n\r\n //GET SEARCH TEXT\r\n if ($this->_getParam('search', null)) {\r\n $metaParams['search'] = $this->_getParam('search', null);\r\n\r\n //SET META KEYWORDS\r\n Engine_Api::_()->sitestoreproduct()->setMetaKeywords($metaParams);\r\n }\r\n\r\n if(Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\r\n $this->_helper->content\r\n ->setContentName($pageObject->page_id)\r\n ->setNoRender()\r\n ->setEnabled();\r\n }else{\r\n $this->_helper->content\r\n ->setNoRender()\r\n ->setEnabled();\r\n } \r\n }",
"public function show(MJasa $mJasa)\n {\n //\n }",
"public function show(Maklumbalas $maklumbalas)\n {\n //\n }",
"public function index()\n {\n $data['pageTitle'] = 'Dikirim';\n $data['dikirim'] = $this->model_dikirim->get_dikirim()->result();\n $data['pageContent'] = $this->load->view('dikirim/dikirimList', $data, TRUE);\n\n // Jalankan view template/layout\n $this->load->view('template/layout', $data);\n }",
"public function browseAction(){\n\n\t\t$modelStatic = new Application_Model_Static();\n\n\t\t$images = $modelStatic->getMedia();\n \n\t\t$this->view->images = $images;\n \t\t\n\t\t$this->_helper->layout->setLayout('media');\n\t\t//$this->_helper->layout->disableLayout(0);\n\t\t$this->_helper->viewRenderer->setNoRender(true);\n\t\t\n \t}",
"public function index() {\n\t\t$data = $this->load_module_info ();\n\t\t\n\t\t$this->layout->display_admin ( $this->folder . $this->module . \"-list\", $data );\n\t}",
"public function listarAction()\n {\n// Config::$mvc_bd_clave, Config::$mvc_bd_hostname);\n\n// $m = $this->get('jamab.model');\n\n $em = $this->getDoctrine()->getManager();\n $alimentos = $em->getRepository('JazzywebAulasMentorAlimentosBundle:Alimento')->dameAlimentos();\n\n $params = array(\n 'alimentos' => $alimentos,\n );\n\n return $this->render(\n 'JazzywebAulasMentorAlimentosBundle:Default:mostrarAlimentos.html.twig',\n $params\n );\n }",
"public function listoAction()\n {\n $form = new Formulario(\"form\");\n $id = (int) $this->params()->fromRoute('id', 0);\n $form->get(\"id\")->setAttribute(\"value\",\"$id\"); \n \n $this->dbAdapter=$this->getServiceLocator()->get('Zend\\Db\\Adapter');\n $u=new AlbumTable($this->dbAdapter); // ---------------------------------------------------------- 1 FUNCION DENTRO DEL MODELO (C) \n\n $dat = $u->getGeneral1(\"Select * from t_nivel_cargo where id = \".$id); \n\n $valores=array\n (\n \"titulo\" => 'Lista de chequeo asociada a '.$dat['nombre'],\n 'url' => $this->getRequest()->getBaseUrl(),\n \"datos\" => $u->getLcheq($id), \n \"datos2\" => $u->getLcheqTcon($id),\n \"form\" => $form,\n \"lin\" => $this->lin\n ); \n return new ViewModel($valores); \n \n }",
"public function data_bahan_kuliah()\n\t{\n\t\t$this->load->model(\"m_aka\");\n\t\t$data['data'] = $this->m_aka->data_bahan_kuliah(); \n\t\t$data['pagination'] = $this->pagination->create_links();\n\t\t$data['content'] = 'posting_pengumuman/data_bahan_kuliah';\n\t\t$this->load->view('content', $data);\n\t}",
"public function index()\n {\n $buku = Buku::all();\n return view('adminbackend.buku.index', compact('buku'));\n }",
"public function actionIndex()\n {\n $importer = new CsvImporter(dirname(__DIR__).'/import/karafuncatalog.csv',true,\";\",0);\n\t\t$data = $importer->get(0);\n\t\tforeach($data AS $song)\n\t\t{\n\t\t\t$ARSong = new Songs();\n\t\t\t$ARSong->title = Html::encode($song['Title']);\n\t\t\t$ARSong->artist = Html::encode($song['Artist']);\n\t\t\t$ARSong->year = $song['Year'];\n\t\t\t$ARSong->duo = $song['Duo'];\n\t\t\t$ARSong->save();\n\n\t\t\tunset($ARSong);\n\t\t}\n\t\techo \"All Records from the Songlist have been imported\";\n }",
"public function listView(): void\n {\n $this->_data = $this->_entity->fetch();\n if (!$this->special) {\n $newData = $this->_builder->submitCreate();\n if ($newData) {\n array_push($this->_data, $newData);\n }\n }\n require VF . \"{$this->route}/list.php\";\n require VF . \"{$this->route}/create.php\";\n }",
"public function index()\n {\n $data = BukuTamu::all();\n return view('admin.bukutamu.view', compact('data'));\n }",
"public function listdataSDMAction() {\n $this->view->dataList = $this->adm_listdata_serv->getDataList('SDM');\n }",
"public function indexAction() {\n\n\t\t//GET NAVIGATION\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')\n ->getNavigation('list_admin_main', array(), 'list_admin_main_viewlist');\n\n\t\t//MAKE FORM\n $this->view->formFilter = $formFilter = new List_Form_Admin_Manage_Filter();\n\n\t\t//GET PAGE NUMBER\n $page = $this->_getParam('page', 1);\n\n\t\t//GET USER TABLE NAME\n $tableUserName = Engine_Api::_()->getItemTable('user')->info('name');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = $tableCategory = Engine_Api::_()->getDbtable('categories', 'list');\n\n\t\t//GET LISTING TABLE\n $tableListing = Engine_Api::_()->getDbtable('listings', 'list');\n $listingTableName = $tableListing->info('name');\n\n\t\t//MAKE QUERY\n $select = $tableListing->select()\n ->setIntegrityCheck(false)\n ->from($listingTableName)\n ->joinLeft($tableUserName, \"$listingTableName.owner_id = $tableUserName.user_id\", 'username');\n\n $values = array();\n\n if ($formFilter->isValid($this->_getAllParams())) {\n $values = $formFilter->getValues();\n }\n foreach ($values as $key => $value) {\n\n if (null == $value) {\n unset($values[$key]);\n }\n }\n\n // searching\n $this->view->owner = '';\n $this->view->title = '';\n $this->view->sponsored = '';\n $this->view->approved = '';\n $this->view->featured = '';\n $this->view->status = '';\n $this->view->listingbrowse = '';\n $this->view->category_id = '';\n $this->view->subcategory_id = '';\n $this->view->subsubcategory_id = '';\n\n if (isset($_POST['search'])) {\n\n if (!empty($_POST['owner'])) {\n $this->view->owner = $_POST['owner'];\n $select->where($tableUserName . '.username LIKE ?', '%' . $_POST['owner'] . '%');\n }\n\n if (!empty($_POST['title'])) {\n $this->view->title = $_POST['title'];\n $select->where($listingTableName . '.title LIKE ?', '%' . $_POST['title'] . '%');\n }\n\n if (!empty($_POST['sponsored'])) {\n $this->view->sponsored = $_POST['sponsored'];\n $_POST['sponsored']--;\n\n $select->where($listingTableName . '.sponsored = ? ', $_POST['sponsored']);\n }\n\n if (!empty($_POST['approved'])) {\n $this->view->approved = $_POST['approved'];\n $_POST['approved']--;\n $select->where($listingTableName . '.approved = ? ', $_POST['approved']);\n }\n\n if (!empty($_POST['featured'])) {\n $this->view->featured = $_POST['featured'];\n $_POST['featured']--;\n $select->where($listingTableName . '.featured = ? ', $_POST['featured']);\n }\n\n if (!empty($_POST['status'])) {\n $this->view->status = $_POST['status'];\n $_POST['status']--;\n $select->where($listingTableName . '.closed = ? ', $_POST['status']);\n }\n\n if (!empty($_POST['listingbrowse'])) {\n $this->view->listingbrowse = $_POST['listingbrowse'];\n $_POST['listingbrowse']--;\n if ($_POST['listingbrowse'] == 0) {\n $select->order($listingTableName . '.view_count DESC');\n } else {\n $select->order($listingTableName . '.creation_date DESC');\n }\n }\n\n if (!empty($_POST['category_id']) && empty($_POST['subcategory_id']) && empty($_POST['subsubcategory_id'])) {\n $this->view->category_id = $_POST['category_id'];\n $select->where($listingTableName . '.category_id = ? ', $_POST['category_id']);\n } \n\t\t\telseif (!empty($_POST['category_id']) && !empty($_POST['subcategory_id']) && empty($_POST['subsubcategory_id'])) {\n $this->view->category_id = $_POST['category_id'];\n $this->view->subcategory_id = $_POST['subcategory_id'];\n $this->view->subcategory_name = $tableCategory->getCategory($this->view->subcategory_id)->category_name;\n \n $select->where($listingTableName . '.category_id = ? ', $_POST['category_id'])\n ->where($listingTableName . '.subcategory_id = ? ', $_POST['subcategory_id']);\n }\n\t\t\telseif(!empty($_POST['category_id']) && !empty($_POST['subcategory_id']) && !empty($_POST['subsubcategory_id'])) {\n $this->view->category_id = $_POST['category_id'];\n $this->view->subcategory_id = $_POST['subcategory_id'];\n $this->view->subsubcategory_id = $_POST['subsubcategory_id'];\n $this->view->subcategory_name = $tableCategory->getCategory($this->view->subcategory_id)->category_name;\n $this->view->subsubcategory_name = $tableCategory->getCategory($this->view->subsubcategory_id)->category_name;\n \n $select->where($listingTableName . '.category_id = ? ', $_POST['category_id'])\n ->where($listingTableName . '.subcategory_id = ? ', $_POST['subcategory_id'])\n\t\t\t\t\t\t->where($listingTableName . '.subsubcategory_id = ? ', $_POST['subsubcategory_id']);\n\t\t\t}\n\t\t\t\n }\n\n $values = array_merge(array(\n 'order' => 'listing_id',\n 'order_direction' => 'DESC',\n ), $values);\n\n $this->view->assign($values);\n\n $select->order((!empty($values['order']) ? $values['order'] : 'listing_id' ) . ' ' . (!empty($values['order_direction']) ? $values['order_direction'] : 'DESC' ));\n\n //MAKE PAGINATOR\n $this->view->paginator = Zend_Paginator::factory($select);\n $this->view->paginator->setItemCountPerPage(40);\n $this->view->paginator = $this->view->paginator->setCurrentPageNumber($page);\n }",
"public function index()\n {\n $manu_list = manufacturer::all()->sortByDesc(\"name\");\n $list_item = [];\n foreach ($manu_list as $manu){\n $motor_types = MotorTypeController::get_motor_type_by_mft_id($manu->id);\n $bike_types = $this->parse_motor_type($motor_types);\n $list_item[] = array(\n 'id'=>$manu->id,\n 'name'=>$manu->name,\n 'bike_types'=>$bike_types,\n );\n }\n $data['form'] = BasicForm::init_form('add-manufacturer','manufacturerForm');\n $fields = BasicForm::manufacturer_add_form();\n $data['manu_list'] = $list_item;\n $data = $data + $fields;\n return view('admin/manufacturer', $data);\n }",
"public function index() \n {\n\t\t$this->papar->senaraiPegawai['biodata'] = $this->tanya->cariMedan('nama_pegawai', \n\t\t\t'namaPegawai,Nama_Penuh,email,nohp,unit', \n\t\t\tarray('medan'=>'unit', 'id'=>'ekonomi'));\n\t\n\t\t//\n\t\t$this->papar->ralat = null;\n\t\t\n\t\t$this->papar->pegawai = senarai_kakitangan();\n $this->papar->baca($this->_folder . '/index', 0);\n }",
"public function indexShowSet()\n {\n $navid = I('get.nav') ? I('get.nav') : 0;\n $pid = M('admin_nav')->where('id=' . $navid)->find()['pid'];\n $navpname = M('admin_nav')->where('id=' . $pid)->find()['name'];\n $navname = M('admin_nav')->where('id=' . $navid)->find()['name'];\n $re = M('category')->where('navid=' . $navid)->select();\n $arr = array();\n foreach ($re as $k => $v) {\n $arr[] = $v['id'];\n }\n $where['cateid'] = array('in', $arr);\n $where['status'] = 1;\n $data = M('ziliao')->where($where)->order('order_number')->select();\n $assign = array(\n 'data' => $data,\n 'navname' => $navname,\n 'navpname' => $navpname,\n );\n // var_dump($data);die;\n $this->assign($assign);\n $this->display();\n\n }",
"function lists()\n {\n $data[\"data\"] = $this->RapatModel->get();\n $this->load->view('rapat/lists', $data);\n }"
] | [
"0.6585432",
"0.6556157",
"0.6531069",
"0.6512181",
"0.646323",
"0.6462662",
"0.6458836",
"0.620735",
"0.6199737",
"0.61956936",
"0.61841923",
"0.6181279",
"0.6178897",
"0.61165166",
"0.61036044",
"0.610115",
"0.6096473",
"0.6093606",
"0.6089512",
"0.6078423",
"0.6061738",
"0.60542446",
"0.6048057",
"0.6041593",
"0.6040904",
"0.6035459",
"0.60281307",
"0.6024898",
"0.60090864",
"0.5997932",
"0.5997932",
"0.59978426",
"0.5994805",
"0.59943056",
"0.5985471",
"0.5982731",
"0.5977746",
"0.59771943",
"0.5975871",
"0.59707963",
"0.5952413",
"0.5948537",
"0.59419024",
"0.59301245",
"0.5928446",
"0.59248894",
"0.59220666",
"0.59217244",
"0.5919916",
"0.5915218",
"0.5905968",
"0.59043294",
"0.5904058",
"0.58994585",
"0.5892859",
"0.5891809",
"0.5887559",
"0.58862823",
"0.58860713",
"0.5885003",
"0.587842",
"0.58767444",
"0.5873629",
"0.58667105",
"0.58592504",
"0.5850904",
"0.5849427",
"0.58468056",
"0.58447737",
"0.5843099",
"0.5836139",
"0.58328444",
"0.5832156",
"0.5832156",
"0.5832156",
"0.5830789",
"0.58295757",
"0.58295757",
"0.58295757",
"0.5827982",
"0.58277214",
"0.5819596",
"0.58182883",
"0.58128715",
"0.5804168",
"0.5801611",
"0.57955205",
"0.5793273",
"0.5792852",
"0.579224",
"0.57857037",
"0.57777166",
"0.57776606",
"0.5771254",
"0.5758054",
"0.5757163",
"0.5754513",
"0.57542765",
"0.57512677",
"0.575048"
] | 0.60628116 | 20 |
read search data use fullname or read data use single username user | public function read($id_matakuliah)
{
if ($this->_access === 'BAAK')
{
$matakuliahData = $this->MatakuliahModel->read($id_matakuliah);
foreach ($matakuliahData as $data)
{
$jurusans = $this->jurusan->browse();
echo "
<div class='modal-header'>
<h1 class='modal-title'>Edit matakuliah</h1>
</div>
<div id='error_form_matakuliah'></div>
<form class='form-horizontal' method='post' id='edit_form_matakuliah'>
<div class='modal-body'>
<div class='form-group'>
<label class='col-xs-4 control-label'>Kode matakuliah</label>
<label class='col-xs-4 control-label'>".$data->id_matakuliah."</label>
</div>
<div class='form-group'>
<label class='col-xs-4 control-label'>Jurusan</label>
<div class='col-xs-7'>
<select name='id_jurusan' id='id_jurusan_add' type='text' class='form-control' required>
<option></option>";
foreach ($jurusans as $jurusan)
{
echo "<option value='".$jurusan->id_jurusan."'".($data->id_jurusan === $jurusan->id_jurusan ? 'selected' : NULL).">".$jurusan->nama."</option>";
}
echo "
</select>
</div>
</div>
<div class='form-group'>
<label class='col-xs-4 control-label'>Nama</label>
<div class='col-xs-7'>
<input name='namamatakuliah' id='namamatakuliah_edit' type='text' class='form-control' value='".$data->nama."' required>
</div>
</div>
<div class='form-group'>
<label class='col-xs-4 control-label'>Jumlah SKS</label>
<div class='col-xs-7'>
<input name='sks' id='sks_edit' type='text' class='form-control' value='".$data->sks."' required>
</div>
</div>
<div class='form-group'>
<label class='col-xs-4 control-label'>Semester</label>
<div class='col-xs-7'>
<input name='semester' id='semester_edit' type='text' class='form-control' value='".$data->semester."' required>
</div>
</div>
</div>
<div class='modal-footer'>
<div class='col-xs-6'>
<button class='btn btn-success' type='submit' id='save_edit_matakuliah'><i class='fa fa-save'></i> Save</button>
</div>
<div class='col-xs-6 push-left'>
<button class='btn btn-danger push-left' type='button' data-dismiss='modal'><i class='fa fa-times'></i> Cancel</button>
</div>
</div>
</form>";
}
}
else
{
echo "!LOGIN";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function searchReader()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t$text = $_POST['text'];\n\t\t\t$type = $_POST['type'];\n\t\t\t//$return = array();\n\t\t\t$book = D('User');\n\n\t\t\t$sql = \"SELECT * FROM lib_user\n\t\t\t\t\t where {$type} like '%{$text}%' ORDER BY register_time DESC;\";\n\t\t\t$return = $book->query($sql);\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'success',\n\t\t\t\t\t'data' => json_encode($return)\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'No Result'\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t}\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\n\t}",
"function search_user(){\n\t\trequire_once(\"dbconnection.php\");\n\t\t$obj=new dbconnection();\n\t\t$con=$obj->getcon();\n\t\t\n\t\t\n\t\t$dbh=$obj->get_pod();\n\n\t\t$search_by = $_POST['search_by'];\n\n\t\t$sqlget = \"SELECT * FROM users WHERE uname='$search_by';\";\n\t\t$resultget = mysqli_query($con,$sqlget) or die(\"SQL Error : \".mysqli_error($con));\n\t\t$recget= mysqli_fetch_assoc($resultget);\n\n\t\techo json_encode($recget);\n\t\t\n\t}",
"function findusers() {\n $this->auth(SUPPORT_ADM_LEVEL);\n $search_word = $this->input->post('search');\n if($search_word == '-1'){ //initial listing\n $data['records'] = $this->m_user->getAll(40);\n } else { //regular search\n $data['records'] = $this->m_user->getByWildcard($search_word);\n }\n $data['search_word'] = $search_word;\n $this->load->view('/admin/support/v_users_search_result', $data);\n }",
"function getmoname($data)\r\n {\r\n \r\n $query = $this->db->query(\"SELECT username,user_id,firstname FROM `oc_user` where user_group_id='4' and firstname like '%\".$data[\"filter_name\"].\"%' order by firstname asc limit 5 \");\r\n \r\n return $query->rows; \r\n }",
"public function read($username=null)\n {\n }",
"public function searchUsers()\n {\n # Set tables to search to a variable.\n $tables = $this->getTables();\n # Set fields to search to a variable.\n $fields = $this->getFields();\n # Set search terms to a variable.\n $search_terms = $this->getSearchTerms();\n # Perform search.\n $this->performSearch($search_terms, $tables, $fields);\n }",
"public static function search($name) {\n return DB::table('users AS u')\n ->where('u.fullname', 'LIKE', '%'.$name.'%')\n ->orWhere('u.username', 'LIKE', '%'.$name.'%')\n ->selectRaw('u.id, u.fullname, u.profile_image')\n ->get();\n }",
"public function readUserAuth(){\n $user = new \\Filebase\\Database([\n 'dir' => $this->getDataSource()\n ]);\n\n if ($user->has($this->username)) {\n $item = $user->get($this->username);\n $data = [\n 'result' => $item->auth,\n 'attribute' => [\n 'username' => $this->username\n ],\n 'status' => 'success',\n 'message' => 'Data found!'\n ];\n } else {\n $data = [\n 'status' => 'error',\n 'message' => 'User not found!'\n ];\n }\n return $data;\n }",
"public function getClientByNameOrSurnameOrDni() {\n $term = Request::input('term', '');\n $results = array();\n $queries = User::where('role_id', 6)\n ->where(function($query) use ($term){\n $query->where('name', 'LIKE', '%'.$term.'%');\n $query->orWhere('surname', 'LIKE', '%'.$term.'%');\n $query->orWhere('dni', 'LIKE', '%'.$term.'%');\n })\n ->take(10)->get();\n foreach ($queries as $query)\n $results[] = ['id' => $query->id,\n 'value' => $query->fullname().' ['.$query->dni.']'];\n return response()->json($results);\n }",
"function FindUser($User) {\n $User = str_replace('ZZ ', '', $User);\n\n //separa o primeiro nome do sobrenome\n $name_complete = explode(' ', $User);\n $user_name = array_shift($name_complete);\n $user_lastname = implode(' ', $name_complete);\n\n $Read = new WsUsers();\n\n $Read->setUser_name($user_name);\n $Read->setUser_lastname($user_lastname);\n $Result = $Read->Execute()->Query(\"user_name like '%{$user_name}%' AND user_lastname like '%{$user_lastname}%'\");\n\n if (!empty($Result)):\n return $Result[0]->user_id;\n endif;\n}",
"function lendingform_search_user($search = NULL) {\r\n \r\n $users = array();\r\n if (empty($search)) {\r\n $users = entity_load('user');\r\n } else {\r\n // Search users\r\n $users = entity_get_controller(PROJECT_ENTITY)->search_users($search);\r\n }\r\n \r\n $users_name_and_id = array();\r\n foreach ($users as $user) {\r\n $users_name_and_id[] = array(\r\n 'uid' => $user->uid,\r\n 'name' => lendingform_siemens_format_username($user),\r\n );\r\n }\r\n\r\n echo json_encode($users_name_and_id);\r\n \r\n exit();\r\n}",
"function searchUserName($userId) {\n\n\t\t// INFORMACION RESPONSABLE\n $detailsResponsable = \"https://intranet.idex.cc/rest/117/w0qdwl5fbr0hpuf1/user.get?ID=\".$userId;\n // OBTIENE LA RESPUESTA DE LA API REST BITRIX\n $responseAPI = file_get_contents($detailsResponsable);\n\n // CAMPOS DE LA RESPUESTA\n $responsable = json_decode($responseAPI, true);\n // FIN INFORMACION RESPOSABLE\n return $responsable[\"result\"];\n\t}",
"private function searchMembers() {\n $searchStr = $this->postVars['memberSearch'];\n $searchStrArr = array();\n if(preg_match('/\\s/',$searchStr)) {\n $searchStrArr = explode(\" \", $searchStr);\n }\n \n if(empty($searchStrArr)) {\n $query = \"SELECT u.id\n FROM {$this->db->prefix}users AS u\n WHERE u.user_email = '$searchStr'\n UNION\n SELECT u.id\n FROM {$this->db->prefix}users AS u\n JOIN {$this->db->prefix}nhc n ON u.id = n.user_id AND n.nhc_pin = '$searchStr'\n JOIN {$this->db->prefix}usermeta um1 ON um1.user_id = u.id AND um1.meta_key = 'first_name'\n JOIN {$this->db->prefix}usermeta um2 ON um2.user_id = u.id AND um2.meta_key = 'last_name'\n UNION\n SELECT u.id\n FROM {$this->db->prefix}users AS u\n JOIN {$this->db->prefix}nhc n ON u.id = n.user_id\n JOIN {$this->db->prefix}usermeta um1 ON um1.user_id = u.id AND um1.meta_key = 'first_name' AND um1.meta_value like '%$searchStr%'\n JOIN {$this->db->prefix}usermeta um2 ON um2.user_id = u.id AND um2.meta_key = 'last_name'\n UNION\n SELECT u.id\n FROM {$this->db->prefix}users AS u\n JOIN {$this->db->prefix}nhc n ON u.id = n.user_id\n JOIN {$this->db->prefix}usermeta um1 ON um1.user_id = u.id\n JOIN {$this->db->prefix}usermeta um2 ON um2.user_id = u.id AND um2.meta_key = 'last_name' AND um2.meta_value like '%$searchStr%'\";\n //JOIN {$this->db->prefix}usermeta um4 ON um4.user_id = u.id AND um4.meta_key = 'expiration_date' AND um4.meta_value = '$expireDate'\";\n }\n else { // looking specifically for a full name\n $query = \"SELECT u.id\n FROM {$this->db->prefix}users AS u\n JOIN {$this->db->prefix}nhc n ON u.id = n.user_id\n JOIN {$this->db->prefix}usermeta um1 ON um1.user_id = u.id AND um1.meta_key = 'first_name' AND um1.meta_value like '%{$searchStrArr[0]}%'\n JOIN {$this->db->prefix}usermeta um2 ON um2.user_id = u.id AND um2.meta_key = 'last_name' AND um2.meta_value like '%{$searchStrArr[1]}%'\";\n \n }\n \n $membersArr = $this->db->get_results($query, ARRAY_A);\n \n // filter through to weed out any duplicates\n $showArr = array();\n foreach($membersArr as $member) {\n if(!in_array($member['id'], $showArr)) {\n $showArr[] = $member['id'];\n }\n }\n $idStr = implode(\",\", $showArr);\n \n $query = \"SELECT DISTINCT u.id, n.nhc_pin, um1.meta_value AS first_name, um2.meta_value AS last_name, u.user_email, um3.meta_value AS level\n FROM {$this->db->prefix}users AS u\n JOIN {$this->db->prefix}nhc n ON u.id = n.user_id\n JOIN {$this->db->prefix}usermeta um1 ON um1.user_id = u.id AND um1.meta_key = 'first_name'\n JOIN {$this->db->prefix}usermeta um2 ON um2.user_id = u.id AND um2.meta_key = 'last_name'\n JOIN {$this->db->prefix}usermeta um3 ON um3.user_id = u.id AND um3.meta_key = 'member_level'\n WHERE u.id IN ($idStr)\n ORDER BY n.nhc_pin\";\n \n $this->showResults($query, 'search', true);\n }",
"public function search()\n {\n if (!$this->current_user->has_permission('USER_LIST')) {\n return redirect();\n }\n\n $view_data = [\n 'menu_active' => 'li_user'\n ];\n\n $pagination = [\n 'page' => (int) $this->input->get_or_default('p', 1),\n 'limit' => (int) $this->input->get_or_default('limit', PAGINATION_DEFAULT_LIMIT)\n ];\n\n $pagination['offset'] = ($pagination['page'] - 1) * $pagination['limit'];\n\n // Get list users\n $users = $this->_api('user')->search_list(array_merge($this->input->get(), [\n 'limit' => $pagination['limit'],\n 'offset' => $pagination['offset'],\n 'sort_by' => 'id',\n 'sort_position' => 'desc'\n ]), [\n 'with_deleted' => TRUE,\n 'point_remain_admin' => TRUE\n ]);\n\n if (isset($users['result'])) {\n $view_data['users'] = $users['result']['items'];\n $pagination['total'] = $users['result']['total'];\n }\n\n $view_data['search'] = $pagination['search'] = $this->input->get();\n $view_data['pagination'] = $pagination;\n $view_data['csv_download_string'] = '/user/download_csv?' . http_build_query($this->input->get());\n\n $this->_breadcrumb = [\n [\n 'link' => '/user/search',\n 'name' => 'ユーザー検索'\n ]\n ];\n\n return $this->_render($view_data);\n }",
"function get_user_by_username($username) {\n $read_json = file_get_contents(__DIR__ . '/data_users.json');\n $data = json_decode($read_json, JSON_OBJECT_AS_ARRAY);\n\n // iterate over db, if username is found, return user\n foreach ($data as $user){\n if ($user[\"username\"] == $username){\n return $user;\n }\n }\n return false;\n}",
"public function search($name) {\n return $this->db->query(\"SELECT * FROM `user` WHERE `firstname` ='$name' or `lastname`='$name'\")->result();\n //return $this->db->last_query();\n //return $query->result(); \n }",
"public function read_user_information($username) {\n\n $condition = \"uname =\" . \"'\" . $username . \"'\";\n $this->db->select('*');\n $this->db->from('registration');\n $this->db->where($condition);\n $this->db->limit(1);\n $query = $this->db->get();\n\n if ($query->num_rows() == 1) {\n return $query->result();\n } else {\n return false;\n }\n }",
"public function searchUserByName($name){\r\n $result = $this->DB->fetchAll('select * from user where name like ?',array(\"%{$name}%\"));\r\n return $this->formatResult($result);\r\n }",
"public abstract function find_users($search);",
"private static function get_user_data($username)\n {\n }",
"function search($text){\ninclude '../imp/call.php';\n \n // let's filter the data that comes in\n $text = htmlspecialchars($text);\n \n\n // prepare the mysql query to select the users \n /* $get_name = $conn->prepare(\"SELECT * FROM u WHERE name LIKE concat('%', :name, '%')\");*/\n $stmtSelect = $conn->prepare(\"SELECT * FROM tbl_user WHERE user_age LIKE concat(:user_age ,'%')\");\n // execute the query\n $stmtSelect -> execute(array('user_age' => $text));\n // show the users on the page\n echo'<div class=\"scrollable\">\n <table>\n <thead>\n <tr>\n <th>S.N</th>\n <th>Name</th>\n <th>Age</th>\n <th>Action</th>\n </tr>\n </thead>\n <tbody>\n ';\n while($names = $stmtSelect->fetch(PDO::FETCH_ASSOC)){\n // show each user as a link\n \n echo ' <tr>\n <td>'.$names['user_name'].'</td>\n <td>'.$names['user_email'].'</td>\n <td>'.$names['user_age'].'</td>\n <td>\n <div align=\"center\">\n <a href=\"\" data-toggle=\"modal\" data-target=\"#mailModal'.$names['id'].'\"><i class=\"fa fa-envelope\" aria-hidden=\"true\"></i>\n </a>\n </div>\n </td>\n </tr>';\n \n }\n echo '</tbody>';\n}",
"public function readByUser(){\n //select all query\n $query = \"SELECT * FROM \" . $this->table_name . \" WHERE id_user=:id_user\";\n\n //perpare query\n $stmt = $this->conn->prepare($query);\n\n //sanitize\n $this->id_user=htmlspecialchars(strip_tags($this->id_user));\n\n //bind given value\n $stmt->bindparam(\":id_user\", $this->id_user);\n\n $stmt->execute();\n\n return $stmt;\n }",
"public function retrieve($username);",
"function getUserInformationByUsername($username)\n\t{\n\t\t$response = '';\n\n\t\tif( $this->token != '' )\n\t\t{\n\t\t\t$filter_arguments = array(\n\t\t\t\t\"filter\" => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t\"portal_name\" => array(\n\t\t\t\t\t\t\t'$equals' => $username,\n\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\t\"offset\" => 0,\n\t\t\t\t\"fields\" => \"id,portal_name,portal_password,email,treat_hematology_patients_c,specialty_c\",\n\t\t\t);\n\t\t\t$url = $this->url . \"/Contacts/filter\";\n\t\t\t$response = self::call($url, $this->token, 'GET', $filter_arguments);\n\t\t}\n\n\t\t$isUser = $response->records[0]->portal_name;\n\n\t\tif( $isUser == $username )\n\t\t{\n\t\t\treturn $response;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function users() {\n $matches = array();\n if ($name = $this->input->get('q')) {\n $users = ORM::factory('user')->where('site_id', $this->site->id)->like('searchname', text::searchable($name))->where('status', 1)->find_all();\n foreach ($users as $user) {\n if ($user->id != $this->user->id) { // Can't send a message to yourself.\n $matches[] = (object) array('id' => $user->id, 'name' => $user->name());\n }\n }\n }\n print json_encode($matches);\n die();\n }",
"public function getUserByTabName($search)\n {\n\n $objDataBase = $this->_connectSuperDataBase();\n\n $arraySetVariable = array('@InSearch');\n\n $arrayValueVariable = array($search);\n $arrayTypeDataVariable = array(Class_Object::DATA_STRING);\n $arraySizeDataVariable = array(35);\n\n $result = $objDataBase->executeQueryStoreProcedure('search_userByTabName', $arraySetVariable,\n $arrayValueVariable, $arrayTypeDataVariable, $arraySizeDataVariable);\n\n while ($tempRows = $objDataBase->exploreRowSelect($result)) {\n $dato[] = $tempRows;\n }\n if (!empty($dato))\n return $dato;\n return null;\n \n }",
"public function admin_get_users(){\n $limit = $this->input->get('length');\n $offset = $this->input->get('start');\n $search = $this->input->get('search')['value'];\n echo $this->usm->get_users($limit, $offset, $search);\n }",
"static public function mdlReadUsers($item, $value){\n $sql = \"SELECT * FROM Usuarios \";\n \n if($item == null){\n $stmt = Conexion::connect() -> prepare($sql);\n $stmt -> execute();\n return $stmt -> fetchALl();\n }else{\n $sql .= \"WHERE $item LIKE :item \";\n $stmt = Conexion::connect() -> prepare($sql);\n $stmt -> bindParam(\":item\", $value);\n $stmt -> execute();\n return $stmt -> fetch();\n }\n }",
"function readSearchView(){\n\t\t// fe_user access management can read \n\t\t$rec = $this->model->get_fecruserid($this->rec_id); \n\t\t$access = $this->accessObj->checkAccess($rec,'pageSearch','read');\n\t\tif(!(bindec($access) & bindec('0100'))){\n\t\t\t$this->cmd = 'canNotRead';\n\t\t\t// Get the FORM\n\t\t\t$content = $this->get_include_contents('view_canNotAccess.php');\n\t\t\treturn $content; \n\t\t}\n\t\t$queryConf['startingPoint'] = $this->startingPoint;\t\n\t\t// template for the view\n\t\t$lot = $this->model->select($this->rec_id,$queryConf);\n\t\tif($lot){ \n\t\t\t// fe_user access management\n\t\t\t$access = $this->accessObj->checkAccess($lot[$this->rec_id],'pageSearch','read');\n\t\t\tif(!(bindec($access) & bindec('0100'))){\n\t\t\t\t$this->cmd = 'readForbidden';\n\t\t\t\t$this->data = '';\t\t\t\n\t\t\t}else{\n\t\t\t\t$this->cmd = 'read';\n\t\t\t\t$this->data = $lot[$this->rec_id];\n\t\t\t}\n\t\t}\n\t\t$content = $this->get_include_contents('view_searchDetails.php');\n\t\t\n\t\treturn $content;\n\t}",
"public function read_user(){\n\n\t\t$sudah_login = $this->session->userdata('sudah_login');\n\t $data['role'] = $this->session->userdata('role');\n\t $data['jk'] = $this->session->userdata('jk');\n\t $data['email'] = $this->session->userdata('email');\n\t $data['fullname'] = strtoupper($this->session->userdata('fullname'));\n\t\t$data['user'] = $this->Superadmin_model->get_listuser();\n\t\t$data['page'] = 'Data User';\n\t\t$data['info'] = ' Anda dapat menambah,mengedit dan menghapus data user';\n\t\t$data['judul'] = ' Dakwah Islam | Data User';\n\t\t$logo = $this->db->query('select * from setting_web where id_setting = \"9\"')->result_array();\n\t\t$data['logo'] = $logo;\n\t\t$logofav = $this->db->query('select * from setting_web where id_setting = \"10\"')->result_array();\n\t\t$data['logofav'] = $logofav;\n\n\t\t\n\t if (!$sudah_login) { // jika $sudah_login == false atau belum login maka akan kembali ke redirect yang di tuju\n\t redirect(base_url('Login'));\n\t } else { \n\t\t\t$this->load->view('superadmin/header',$data);\n\t\t\t$this->load->view('superadmin/read_user');\n\t\t\t$this->load->view('superadmin/footer');\n\t\t}\n\t}",
"function get_2fa_user_data($username)\n\t{\n\t\t//my_debug_print(debug_string_backtrace(), __FILE__, __LINE__, \"on\");\n\n\t\t//Admin login\n\t\t$dn=\"cn=\".$this->admin_username.\",\".$this->ldapconfig['basedn'];\n\t\t$bind=ldap_bind($this->ldap_link, $dn, $this->admin_password);\n\n\t\t//User to read value from\n\t\t$dn=\"cn=\".$username.\",\".$this->ldapconfig['usersdn'].\",\".$this->ldapconfig['basedn'];\n\n\t\t$filter = \"(objectclass=*)\"; // this command requires some filter\n\t\t$filter_types = array(\"description\");\n\t\t$sr = ldap_read($this->ldap_link, $dn, $filter, $filter_types);\n\t\t$entry = ldap_get_entries($this->ldap_link, $sr);\n\n\t\tif (isset($entry[0][\"description\"])) \n\t\t{\n\t\t\t$ldap_description_write;\n\t\t\tforeach ($entry[0][\"description\"] as $key => $value) \n\t\t\t{\n\t\t\t\tif ($key === \"count\") \n\t\t\t\t{\n\t\t\t\t\t//do not do anyting for count\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$description = json_decode($value, true);\n\t\t\t\t\tif (json_last_error() === JSON_ERROR_NONE) \n\t\t\t\t\t{\n\t\t\t\t\t // Valid JSON\n\t\t\t\t\t\tif (isset($description[\"2fa\"]) && $description[\"2fa\"] != \"\") \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//my_debug_print($description, __FILE__, __LINE__, \"on\");\n\n\t\t\t\t\t\t\treturn $description[\"2fa\"];\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\treturn \"false\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function post_search(){\n\n\t\t$income_data \t\t= \tFiledb::_rawurldecode(json_decode(stripcslashes(Input::get('data')), true));\n\t\t$data \t\t\t\t= \tarray();\n\t\t$data[\"page\"] \t\t= \t'admin.users.search';\n\t\t$data[\"listing_columns\"] = static::$listing_fields;\n\t\t$data[\"users\"] \t\t= \tarray();\n\n\t\tif($income_data[\"value\"] && $income_data[\"field\"]){\n\n\t\t\t$type = (in_array($income_data[\"type\"], array('all', 'equal', 'like', 'soundex', 'similar'))) ? $income_data[\"type\"] : 'all';\n\t\t\t$type = ($type == 'equal') ? '=' : $type;\n\n\t\t\tif($type == 'all'){\n\t\t\t\t\n\t\t\t\t$data[\"users\"] \t= \tUsers::where($income_data[\"field\"], 'like', $income_data[\"value\"])\n\t\t\t\t\t\t\t\t\t->or_where($income_data[\"field\"], 'soundex', $income_data[\"value\"])\n\t\t\t\t\t\t\t\t\t->or_where($income_data[\"field\"], 'similar', $income_data[\"value\"])\n\t\t\t\t\t\t\t\t\t->get(array_merge(static::$listing_fields, array('id')));\n\t\t\t\n\t\t\t}else{\n\n\t\t\t\t$data[\"users\"] \t= \tUsers::where($income_data[\"field\"], $type, $income_data[\"value\"])\n\t\t\t\t\t\t\t\t\t->get(array_merge(static::$listing_fields, array('id')));\n\t\t\t}\n\n\n\t\t\tif(Admin::check() != 777 && $data[\"users\"]){\n\t\t\t\t\n\t\t\t\tforeach($data[\"users\"] as $row => $column) {\n\n\t\t\t\t\tif(isset($column->email)){\n\n\t\t\t\t\t \tlist($uemail, $domen) \t\t\t= \texplode(\"@\", $column->email);\n\t\t\t\t\t\t$data[\"users\"][$row]->email \t= \t\"******@\".$domen;\n\t\t\t\t\t\t$data[\"users\"][$row]->name \t\t= \t\"***in\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(!$data[\"users\"]){\n\n\t\t\t\t$data[\"message\"] = Utilites::fail_message(__('forms_errors.search.empty_result'));\n\t\t\t}\n\n\t\t}else{\n\n\t\t\t$data[\"message\"] = Utilites::fail_message(__('forms_errors.search.empty_request'));\n\t\t}\n\n\t\treturn (Request::ajax()) ? View::make($data[\"page\"], $data) : View::make('admin.assets.no_ajax', $data);\n\t}",
"public function searchUser($input) {\n $q = User::query()\n ->with('profilepic')\n ->with('UserInfo')\n ->with('roles');\n $q->OfKeyword($input);\n $roles = array('ServiceProvider', 'Distributor');\n $q->OfRolesin($roles);\n return $q->get();\n }",
"public function get_user_serach_info($searchId){\n $sql = \"SELECT s.searchName,u.firstName,u.deviceToken FROM searchcriteria s,users u WHERE s.userId = u.userId AND s.searchId = $searchId\";\n $record = $this->db->query($sql); \n if($record->num_rows() > 0)\n {\n return $record->result_array();\n }\n }",
"protected function getUser($name){\r\n\t\t\r\n\t\t$sql = \"SELECT * FROM users WHERE users_firstname = ?\";\r\n\t\t\r\n\t\t//asking to prepare the statement inside the database instead of query\r\n\t\t$stmt = $this->connect()->prepare($sql);\r\n\t\t\r\n\t\t//filling the blanks left by the ?\r\n\t\t//using the execute method to actually run the data\r\n\t\t$stmt->execute([$name]);\r\n\t\t\r\n\t\t$results = $stmt->fetchALL();\r\n\t\treturn $results;\r\n\t}",
"public function get_user_info($userId,$searchId){\n $sql = \"SELECT u.firstName,s.searchName from users u,searchcriteria s where u.userId = s.userId AND u.userId =$userId AND s.searchId =$searchId AND s.deleteFlag !=1 AND u.deleteFlag !=1\";\n $result = $this->db->query($sql);\n return $result->result_array(); \n }",
"function _search_user($params, $fields = array(), $return_sql = false) {\n\t\t$params = $this->_cleanup_input_params($params);\n\t\t// Params required here\n\t\tif (empty($params)) {\n\t\t\treturn false;\n\t\t}\n\t\t$fields = $this->_cleanup_input_fields($fields, \"short\");\n\n\t\t$result = false;\n\t\tif ($this->MODE == \"SIMPLE\") {\n\t\t\t$result = $this->_search_user_simple($params, $fields, $return_sql);\n\t\t} elseif ($this->MODE == \"DYNAMIC\") {\n\t\t\t$result = $this->_search_user_dynamic($params, $fields, $return_sql);\n\t\t}\n\t\treturn $result;\n\t}",
"function ReadUser($usu_documento){\n\n $pdo = MIDAS_DataBase::Connect();\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n $sql = \"SELECT usu_codigo, usu_nombre, usu_apellido_1, usu_apellido_2, usu_estado, acc_codigo, acc_clave, ges_perfiles_per_codigo, ges_sede_sed_codigo, usu_foto, acc_tour, acc_primeravez, usu_sexo, emp_codigo, sed_codigo\n FROM ges_acceso\n INNER JOIN ges_usuarios ON usu_codigo = ges_usuarios_usu_codigo\n INNER JOIN ges_sedes ON sed_codigo = ges_sede_sed_codigo\n INNER JOIN ges_empresa ON emp_codigo = ges_empresa_emp_codigo\n WHERE usu_documento = ?\";\n\n $query = $pdo->prepare($sql);\n $query->execute(array($usu_documento));\n\n $results = $query->fetch(PDO::FETCH_BOTH);\n\n MIDAS_DataBase::Disconnect();\n return $results;\n }",
"function searchUser()\t{\n\t\t$position = mt_rand(1, $this->rnd_users_number);\n $query = \"select user from \".self::RNDUSERSC_NAME.\" where id=\".$position;\n if ($result = $this->db_conn->query($query)) {\n $row = $result->fetch_assoc();\n return $row[\"user\"];\n }\n else {\n die (\"Error sending the query '\".$query.\"' to MySQL\");\n }\n\t}",
"function getInfoById($username){\n $db=new connect();\n $select=\"select * from users where Username='$username'\";\n $result=$db->getList($select);\n $quest=$result->fetch();\n return $quest;\n }",
"function getUser($data){\r\n\t\t$email = stripslashes($data['email']);\r\n\t\t$password = stripslashes($data['password']);\r\n//\t\t$username = $conn->real_escape_string($username);\r\n//\t\t$password = $conn->real_escape_string($password);\r\n\r\n\t\t\r\n\t\t$query=\"SELECT name, email, phone, address FROM users \r\n\t\t\t\twhere email like '\".$email.\"' and password like '\".$password.\"'\";\r\n\t\t$result = $this->connection->query($query);\r\n\t\t$outp = \"\";\r\n\t\tif( $rs= mysqli_fetch_assoc($result)) {\r\n\t\t\tif ($outp != \"\") {$outp .= \",\";}\r\n\t\t\t$outp .= '{\"u_name\":\"' . $rs[\"name\"] . '\",';\r\n\t\t\t$outp .= '\"is_user\":\"true\",';\r\n\t\t\t$outp .= '\"u_phone\":\"' . $rs[\"phone\"] . '\",';\r\n\t\t\t$outp .= '\"u_address\":\"'. $rs[\"address\"] . '\"}';\r\n \r\n\t\t}\r\n else {\r\n $outp = '{\"is_user\":\"false\"}';\r\n }\r\n $outp ='{\"records\":'.$outp.'}';\r\n\r\n\t\t$this->connection->close();\r\n\r\n\t\treturn $outp;\r\n \r\n }",
"function get_user($username = ''){\n\t\t\t\n\t\t\tif($username != '' && $username != null){\n\t\t\t\t$this->db->where('admin_username', $username);\n\t\t\t}\n\t\t\t\n\t\t\t$q = $this->db->get($this->table);\n\t\t\t\n\t\t\tif($q->num_rows() > 0){\n\t\t\t\t\n\t\t\t // we will store the results in the form of class methods by using $q->result()\n\t\t\t // if you want to store them as an array you can use $q->result_array()\n\t\t\t foreach ($q->result() as $row)\n\t\t\t {\n\t\t\t\t$data[] = $row;\n\t\t\t }\n\t\t\t return $data;\n\t\t\t}\n\n\t\t}",
"function get_searchbyemailid($username,$emailaddress)\n{\n\tglobal $log;\n\tglobal $current_user;\n\trequire_once(\"modules/Users/Users.php\");\n\t$seed_user=new Users();\n\t$user_id=$seed_user->retrieve_user_id($username);\n\t$current_user=$seed_user;\n\t$current_user->retrieve_entity_info($user_id, 'Users');\n\trequire('user_privileges/user_privileges_'.$current_user->id.'.php');\n\trequire('user_privileges/sharing_privileges_'.$current_user->id.'.php');\n\t$log->debug(\"Entering get_searchbyemailid(\".$username.\",\".$emailaddress.\") method ...\");\n\t$query = \"select vtiger_contactdetails.lastname,vtiger_contactdetails.firstname,\n\t\t\t\t\tvtiger_contactdetails.contactid, vtiger_contactdetails.salutation,\n\t\t\t\t\tvtiger_contactdetails.email,vtiger_contactdetails.title,\n\t\t\t\t\tvtiger_contactdetails.mobile,vtiger_account.accountname,\n\t\t\t\t\tvtiger_account.accountid as accountid from vtiger_contactdetails\n\t\t\t\t\t\tinner join vtiger_crmentity on vtiger_crmentity.crmid=vtiger_contactdetails.contactid\n\t\t\t\t\t\tinner join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid\n\t\t\t\t\t\tleft join vtiger_account on vtiger_account.accountid=vtiger_contactdetails.accountid\n\t\t\t\t\t\tleft join vtiger_contactaddress on vtiger_contactaddress.contactaddressid=vtiger_contactdetails.contactid\n\t\t\t LEFT JOIN vtiger_groups ON vtiger_groups.groupid = vtiger_crmentity.smownerid\";\n\t$query .= getNonAdminAccessControlQuery('Contacts',$current_user);\n\t$query .= \"where vtiger_crmentity.deleted=0\";\n\tif(trim($emailaddress) != '') {\n\t\t$query .= \" and ((vtiger_contactdetails.email like '\". formatForSqlLike($emailaddress) .\n\t\t\"') or vtiger_contactdetails.lastname REGEXP REPLACE('\".$emailaddress.\n\t\t\"',' ','|') or vtiger_contactdetails.firstname REGEXP REPLACE('\".$emailaddress.\n\t\t\"',' ','|')) and vtiger_contactdetails.email != ''\";\n\t} else {\n\t\t$query .= \" and (vtiger_contactdetails.email like '\". formatForSqlLike($emailaddress) .\n\t\t\"' and vtiger_contactdetails.email != '')\";\n\t}\n\n\t$log->debug(\"Exiting get_searchbyemailid method ...\");\n\treturn $this->plugin_process_list_query($query);\n}",
"public function read_user_information($username) \n\t{\n\n\t\t$condition = \"username =\" . \"'\" . $username . \"'\";\n\t\t$this->db->select('*');\n\t\t$this->db->from('users');\n\t\t$this->db->where($condition);\n\t\t$this->db->limit(1);\n\t\t$query = $this->db->get();\n\n\t\tif ($query->num_rows() == 1) {\n\t\t\treturn $query->result();\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function get_user_search_info($userId,$searchId){\n $sql = \"SELECT u.firstName,s.searchName from users u,searchcriteria s where u.userId =$userId AND s.searchId =$searchId AND s.deleteFlag !=1 AND u.deleteFlag !=1 \";\n $result = $this->db->query($sql);\n return $result->result_array(); \n }",
"public function searchUser(){\n $this->validate(request(),[\n 'name' => 'required'\n ]);\n $users =User::where('name',request('name'))->orWhere('name', 'like', '%' . request('name') . '%')->get();\n return response()->json($users);\n }",
"function dataGetDataByUsername($p_username)\n {\n $p_username = parent::escape($p_username);\n \n $sql = 'SELECT id, ';\n $sql .= 'fkusertypeid,';\n $sql .= 'userpwd, ';\n $sql .= 'saltpwd, ';\n $sql .= 'firstname, ';\n $sql .= 'lastname, ';\n $sql .= 'email, ';\n $sql .= 'DATE_FORMAT(datelastlogin, \\'%d %b %Y %H:%i\\'), ';\n $sql .= 'isactive ';\n $sql .= 'FROM user ';\n $sql .= 'WHERE username = \\'' . $p_username . '\\' ';\n $sql .= 'AND isdeleted = 0 '; \n \n $result_mysqli = parent::query($sql);\n $result = parent::fetchAllRows($result_mysqli);\n parent::clear($result_mysqli); \n\n return $result; \n }",
"function cicleinscription_get_user_by_username($username){\n\tglobal $DB;\n\treturn $DB->get_record('user', array('username'=>$username));\n}",
"function searchMentor($name, $genre, $instrument)\r\n\t{\r\n\t\t$users = array();\r\n\t\ttry\r\n\t\t{\r\n\t\t\t$pdo = new PDO(DBCONNSTRING,DBUSER,DBPASS);\r\n\t\t\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\t\t\t//Prepare a statement by setting parameters\r\n\r\n\t\t\t//SQL STATEMENTS\r\n\t\t\tif ($genre == \"*\" && $instrument != \"*\")\t\t//Genre ANY\r\n\t\t\t\t$sql_user = 'SELECT id FROM mm_users INNER JOIN mm_user_instruments ON mm_user_instruments.user_id = id WHERE mm_user_instruments.instrument_id = :inst AND mm_users.type = 1 AND mm_users.username LIKE :name';\r\n\t\t\telse if ($genre != \"*\" && $instrument == \"*\")\t//Instrument ANY\r\n\t\t\t\t$sql_user = 'SELECT id FROM mm_users INNER JOIN mm_user_genres ON mm_user_genres.user_id = id WHERE mm_user_genres.genre_id = :genre AND mm_users.type = 1 AND mm_users.username LIKE :name';\r\n\t\t\telse if ($genre == \"*\" && $instrument == \"*\")\t//Genre and Instrument ANY\r\n\t\t\t\t$sql_user = 'SELECT id FROM mm_users WHERE mm_users.type = 1 AND mm_users.username LIKE :name';\r\n\t\t\telse if ($genre != \"*\" && $instrument != \"*\")\t//Genre and Instrument SET\r\n\t\t\t\t$sql_user = 'SELECT id FROM mm_users INNER JOIN mm_user_instruments ON mm_user_instruments.user_id = id INNER JOIN mm_user_genres ON mm_user_genres.user_id = id WHERE mm_user_instruments.instrument_id = :inst AND mm_user_genres.genre_id = :genre AND mm_users.type = 1 AND mm_users.username LIKE :name';\r\n\t\t\t$sql_name = 'SELECT username FROM mm_users WHERE id = :id';\r\n\t\t\t$sql_genre = 'SELECT genre FROM mm_genres INNER JOIN mm_user_genres ON mm_genres.id = mm_user_genres.genre_id WHERE mm_user_genres.user_id = :id';\r\n\t\t\t$sql_inst = 'SELECT instrument FROM mm_instruments INNER JOIN mm_user_instruments ON mm_instruments.id = mm_user_instruments.instrument_id WHERE mm_user_instruments.user_id = :id';\r\n\r\n\t\t\t//PREPARE STATEMENTS\r\n\t\t\t$statement_user = $pdo->prepare($sql_user);\r\n\t\t\t$statement_name = $pdo->prepare($sql_name);\r\n\t\t\t$statement_genre = $pdo->prepare($sql_genre);\r\n\t\t\t$statement_inst = $pdo->prepare($sql_inst);\r\n\r\n\t\t\t//BIND VALUES FOR INITIAL QUERY and EXECUTE\r\n\t\t\t$statement_user->bindValue(':name', $name);\r\n\t\t\tif ($genre != \"*\") $statement_user->bindValue(':genre', $genre);\r\n\t\t\tif ($instrument != \"*\") $statement_user->bindValue(':inst', $instrument); //Bind value of sql statement with value of id in query string\r\n\r\n\t\t\t$statement_user->execute();\r\n\t\t\twhile ($row = $statement_user->fetch())\r\n\t\t\t{\r\n\t\t\t\t$users[] = new User($row[\"id\"], null);\r\n\t\t\t}\r\n\r\n\t\t\t//BIND VALUES FOR USERNAME, GENRES, INSTRUMENTS AND EXECUTE THE RESPECTIVE STATEMENTS\r\n\t\t\tforeach ($users as $u)\r\n\t\t\t{\r\n\t\t\t\t$genres = array();\r\n\t\t\t\t$inst = array();\r\n\t\t\t\t$statement_name->bindValue(':id', $u->getID());\r\n\t\t\t\t$statement_genre->bindValue(':id', $u->getID());\r\n\t\t\t\t$statement_inst->bindValue(':id', $u->getID());\r\n\t\t\t\t$statement_name->execute();\r\n\t\t\t\twhile ($row = $statement_name->fetch())\r\n\t\t\t\t{\r\n\t\t\t\t\t$u->setUsername($row[\"username\"]);\r\n\t\t\t\t}\r\n\t\t\t\t$statement_genre->execute();\r\n\t\t\t\twhile ($row = $statement_genre->fetch())\r\n\t\t\t\t{\r\n\t\t\t\t\t$genres[] = $row[\"genre\"];\r\n\t\t\t\t}\r\n\t\t\t\t$statement_inst->execute();\r\n\t\t\t\twhile ($row = $statement_inst->fetch())\r\n\t\t\t\t{\r\n\t\t\t\t\t$inst[] = $row[\"instrument\"];\r\n\t\t\t\t}\r\n\t\t\t\t$u->setGenres($genres);\r\n\t\t\t\t$u->setInstruments($inst);\r\n\t\t\t}\r\n\t\t\t$pdo = null;\r\n\t\t}\r\n\r\n\t\tcatch (PDOException $e) {\r\n\t\t\tdie( $e->getMessage() );\r\n\t\t}\r\n\t\treturn $users;\r\n\t}",
"function get_user_by_user_name($user_name)\n{\n global $conn;\n $q['query'] = \"SELECT * FROM `user_master` WHERE `user_name`='$user_name'\";\n $q['run'] = $conn->query($q['query']);\n $q['result'] = $q['run']->fetch_assoc();\n\n return $q['result'];\n}",
"function get_user_details($username)\n {\n }",
"public function get_fullname($uid)\n {\n $conn = db();\n $sql=\"SELECT first_name,last_name FROM users WHERE id = $uid\";\n $result = $conn->query($sql);\n $user_data = $result->fetch_assoc();\n echo $user_data['first_name'];\n }",
"public function get_by_name($name)\n {\n $this->db->select('\n b.user_id id,\n b.full_name nama,\n ');\n $this->db->from($this->_table . ' a');\n $this->db->join('users_profile b', 'a.user_id = b.user_id', 'left');\n $this->db->join('hr_role c', 'a.hr_id = c.hr_id', 'left');\n // $this->db->join('hr_departments d', 'a.hr_id = d.id_hr', 'left');\n \n $this->db->where('a.is_del', '0');\n $this->db->where('a.status', '1');\n $this->db->where('c.id_role_group', '7');\n $this->db->like('b.full_name', $name);\n $this->db->group_by('b.user_id');\n\n $query = $this->db->get()->result_array();\n\n return $query;\n }",
"function ap ($nama)\n\t\t\t{\n\t\t\t\treturn $this->db->order_by('apa', 'ASC')->like('nama', $nama)->or_like('ic', $nama)->get_where('user_data', array('id <>' => 1, 'nama' => 'Admin'));\n\t\t\t}",
"public function search()\n\t{\n\t\t$search=$this->input->post('search');\n\t\t$data_rows=get_role_manage_table_data_rows($this->Role->search($search),$this);\n\t\techo $data_rows;\n\t}",
"public function advance_search($request,$user_id)\n\t{\n\t\t\t\n\t\t // USER/ANALYST NOT ABLE TO ACCESS THIS \n\t\t//\taccess_denied_user_analyst();\n\t\t\t$number_of_records =$this->per_page;\n\t\t\t$name = $request->name;\n\t\t\t$business_name = $request->business_name;\n\t\t\t$email = $request->email;\n\t\t\t$role_id = $request->role_id;\n\t\t\t\n\t\t\t//pr($request->all());\n\t\t\t//USER SEARCH START FROM HERE\n\t\t\t$result = User::where(`1`, '=', `1`);\n\t\t//\t$result = User::where('id', '!=', user_id());\n\t\t\t$roleIdArr = Config::get('constant.role_id');\n\t\t\t\n\t\t\t\n\t\t\tif($business_name!='' || $name!='' || $email!=''|| trim($role_id)!=''){\n\t\t\t\t\n\t\t\t\t$user_name = '%' . $request->name . '%';\n\t\t\t\t$business_name = '%' . $request->business_name . '%';\n\t\t\t\t$email_q = '%' . $request->email .'%';\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// check email \n\t\t\t\tif(isset($email) && !empty($email)){\n\t\t\t\t\t$result->where('email','LIKE',$email_q);\n\t\t\t\t} \n\t\t\t\t// check name \n\t\t\t\tif(isset($name) && !empty($name)){\n\t\t\t\t\t\n\t\t\t\t\t$result->where('owner_name','LIKE',$user_name);\n\t\t\t\t}\n\t\t\t\tif(isset($business_name) && !empty($business_name)){\n\t\t\t\t\t\n\t\t\t\t\t$result->where('business_name','LIKE',$business_name);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//If Role is selected \n\t\t\t\tif(isset($role_id) && !empty($role_id)){\n\t\t\t\t\t$result->where('role_id',$role_id);\n\t\t\t\t}\n\t\t\t\n\t\t\t\t\n\t\t\t\t//\techo $result->toSql();\n\t\t\t\t\n\t\t\t // USER SEARCH END HERE \n\t\t\t }\n\t\t\t\n\t\t\tif($user_id){\n\t\t\t\t$result->where('created_by', '=', $user_id);\n\t\t\t}\n\t\t\t\n\t\t\t\t\n\t\t\t $users = $result->orderBy('created_at', 'desc')->paginate($number_of_records);\n\t\t\t\n\t\t\treturn $users ;\n\t}",
"public function getUserDetails() {\n $where = [];\n $this->usersModel->setTableName(\"cvd_users\");\n $username = $this->request->input(\"username\");\n if ($username) {\n $where[] = [\"username\", \"=\", $username];\n }\n\n $userIdEqual = $this->request->input(\"user_id_equal\");\n if ($userIdEqual) {\n $where[] = [\"user_id\", \"=\", $userIdEqual];\n }\n\n $userIdNotEqual = $this->request->input(\"user_id_not_equal\");\n if ($userIdNotEqual) {\n $where[] = [\"user_id\", \"!=\", $userIdNotEqual];\n }\n\n\n $this->usersModel->setWhere($where);\n $users = $this->usersModel->getData();\n\n return $users;\n }",
"function lookupUser($username)\n { \n try {\n $connection = Doctrine_Manager::connection();\n $query = \"SELECT username, access_token FROM constant_contact WHERE username='\".$username.\"' ORDER BY id DESC LIMIT 1\";\n $statement = $connection->execute($query);\n $statement->execute();\n\n $resultset = $statement->fetch(PDO::FETCH_OBJ);\n \n if (empty($resultset)) {\n $returnUser = false;\n throw new Exception('Username '.$username.' not found in datastore');\n }\n else {\n $fields = array();\n foreach ($resultset as $k => $v) $fields[$k] = $v;\n $returnUser = $fields;\n }\n\n }\n catch(Exception $e) {\n echo 'OAuth Exception: '.$e->getMessage();\n }\n return $returnUser;\n }",
"public function searchUserAction($header_data,$unique_id){\n try {\n if(empty($unique_id)) {\n Library::output(false, '0', WRONG_UNIQUE_ID, null);\n } else {\n $db = Library::getMongo();\n \n $user_info = $db->execute('return db.users.find({ $or:[ {\"unique_id\" : \"'.$unique_id.'\"},{\"unique_id\" : \"'.strtolower($unique_id).'\"}], is_searchable : 1, is_active:1, is_deleted : 0 }).toArray()');\n if($user_info['ok'] == 0) {\n Library::logging('error',\"API : searchUser (user info) , mongodb error: \".$user_info['errmsg'].\" \".\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_REQUEST, null);\n }\n if(isset($user_info['retval'][0])) {\n if( empty($user_info['retval'][0][\"hidden_contacts\"]) || !in_array( $header_data['id'], $user_info['retval'][0][\"hidden_contacts\"]) ){\n $isFriend = false;\n $result['id'] = (string)$user_info['retval'][0]['_id'];\n $result['username'] = $user_info['retval'][0]['username'];\n $result['profile_pic'] = FORM_ACTION.$user_info['retval'][0][\"profile_image\"];\n if(isset($user_info['retval'][0][\"running_groups\"])) {\n foreach($user_info['retval'][0][\"running_groups\"] as $user_ids) {\n if($user_ids['user_id'] == $header_data['id']) {\n $isFriend = true; \n break;\n }\n }\n }\n $result['isFriend'] = $isFriend;\n Library::output(true, '1', \"No Error\", $result);\n }\n }\n Library::output(false, '0', NO_USER_FOUND, null);\n }\n } catch(Exception $e) {\n Library::logging('error',\"API : searchUser : \".$e.\" \".\": user_id : \".$header_data['id']);\n Library::output(false, '0', ERROR_REQUEST, null);\n }\n }",
"abstract protected function getUserInfo($username);",
"public function getUserList($data)\n {\n $return = [];\n foreach(UserModel::where(\"first_name\",\"like\", \"%{$data->value}%\")->get() as $q)\n {\n $return[][\"username\"] = $q->first_name;\n }\n if(!empty($return))\n {\n return $return;\n }\n return false;\n }",
"function viewData($username){\n global $conn;\n\n $data = array();\n\n $username = mysqli_real_escape_string($conn, $username);\n\n # search for Usernames\n $sql = \"SELECT username, userId FROM user WHERE username LIKE '%\" . $username . \"%';\";\n $result = mysqli_query($conn, $sql);\n\n while ($row = mysqli_fetch_assoc($result)) {\n\n $data[] = $row;\n\n }\n\n return $data;\n}",
"function mentionMeXMLHTTPnameSearch()\n{\n\tglobal $mybb, $db, $cache;\n\n\tif (!$mybb->input['search']) {\n\t\texit;\n\t}\n\n\t$originalName = trim($mybb->input['search']);\n\t$name = $db->escape_string($originalName);\n\t$name = strtr($name,\n\t\tarray(\n\t\t\t'%' => '=%',\n\t\t\t'=' => '==',\n\t\t\t'_' => '=_')\n\t\t);\n\n\t$fieldList = 'username';\n\tif ($mybb->settings['mention_show_avatars']) {\n\t\t$fieldList .= ', avatar';\n\t}\n\n\t$fullText = '';\n\tif ($mybb->settings['mention_full_text_search']) {\n\t\t$fullText = '%';\n\t}\n\n\t$query = $db->simple_select('users', $fieldList, \"username LIKE '{$fullText}{$name}%' ESCAPE '='\");\n\n\tif ($db->num_rows($query) == 0) {\n\t\texit;\n\t}\n\n\t$names = array();\n\twhile ($user = $db->fetch_array($query)) {\n\t\t$username = mb_strtolower($user['username']);\n\t\tif (($fullText === '' &&\n\t\t\tsubstr($username, 0, strlen($originalName)) === $originalName) ||\n\t\t\t($fullText &&\n\t\t\tstrpos($username, $originalName) !== -1)) {\n\t\t\t$names[$username] = $user;\n\t\t}\n\t}\n\n\tif (empty($names)) {\n\t\texit;\n\t}\n\t$json = json_encode($names);\n\n\t// send our headers.\n\theader('Content-type: application/json');\n\techo($json);\n\texit;\n}",
"function GetUsers($strRole='A',$strValue='',$strOrder='name')\n{\n global $oDB;\n \n $strQ = 'SELECT id,name FROM '.TABUSER.' WHERE role=\"A\" ORDER BY '.$strOrder;\n\n if ( $strRole=='M' ) $strQ = 'SELECT id,name FROM '.TABUSER.' WHERE role=\"A\" OR role=\"M\" ORDER BY '.$strOrder;\n if ( $strRole=='M-' ) $strQ = 'SELECT id,name FROM '.TABUSER.' WHERE role=\"M\" ORDER BY '.$strOrder;\n if ( $strRole=='name') $strQ = 'SELECT id,name FROM '.TABUSER.' WHERE name=\"'.$strValue.'\" ORDER BY '.$strOrder;\n if ( substr($strRole,-1,1)=='*' )\n {\n $like = 'LIKE'; if ( $oDB->type=='pg' ) $like = 'ILIKE';\n $strQ = 'SELECT id,name FROM '.TABUSER.' WHERE name '.$like.' \"'.substr($strRole,0,-1).'%\" ORDER BY '.$strOrder;\n }\n\n $oDB->Query($strQ);\n\n $arrUsers = array();\n $i=1;\n while ($row=$oDB->Getrow())\n {\n $arrUsers[$row['id']]=$row['name'];\n $i++;\n if ( $i>200 ) break;\n }\n return $arrUsers;\n}",
"public function get_fullname($uid){\n $sql3=\"SELECT fullname FROM users WHERE uid = $uid\";\n $result = mysqli_query($this->db,$sql3);\n $user_data = mysqli_fetch_array($result);\n echo $user_data['fullname'];\n }",
"private function consultar_usuario_por_nombre() {\n $sentencia = \"select id,nombrecompleto ,correo,token \"\n . \"from usuario u where u.nombrecompleto ilike '%{$this->referencia_a_buscar}%'; \";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n }",
"private function search_user_by($column,$data,$db,$start=0,$limit=10){\n\t\tif (empty($column) || strlen($data)<3){\n\t\t\treturn null;\n\t\t}\n\t\t$data=strtolower($data);\n\t\t$data=Db::escapee($data,true);\n\t\t$sql=Db::create_sql(array(\n\t\t\t\t\"user_id\",\n\t\t\t\t\"first_name\",\n\t\t\t\t\"last_name\"\n\t\t),\n\t\t\t\t'users',\n\t\t\t\t\"$column LIKE '%$data%' AND\n\t\t\t\tstatus=1\",\n\t\t\t\tnull,null,\n\t\t\t\t\"$start,$limit\");\n\t\t\t\treturn empty($db)?$sql:Db::fetch_array($db, $sql);\n\t}",
"public function GetSearchNameList(){\n if($this->get_request_method()!= \"POST\"){\n $this->response('',406);\n }\n $type = $_POST['type'];\n $user_auth_key = $_POST['user_auth_key'];\n $format = $_POST['format'];\n $db_access = $this->dbConnect();\n $conn = $this->db;\n $res = new getService();\n if(!empty($type) && !empty($user_auth_key)){\n $result = $res->CheckAuthentication('', $user_auth_key, $conn);\n if($result != false){\n $res->get_search_name_list($type, $conn);\n $this->dbClose();\n }\n else{\n $this->dbclose();\n $error = array('status' => \"0\", \"msg\" => \"Not Authorised To get detail\");\n ($_REQUEST['format']=='xml')?$this->response($this->xml($error), 200):$this->response($res->json($error), 200);\n }\n }\n else{\n $error = array('status' => \"0\", \"msg\" => \"Fill All Fields\");\n ($_REQUEST['format']=='xml')?$this->response($this->xml($error), 200):$this->response($res->json($error), 200);\n }\n }",
"function search($username) {\n $user = $this->user->getByUsername($username);\n\n //if not exists on database, search on api\n if($user === null) {\n $url = 'https://api.github.com/users/' . $username;\n $output = self::makeRequest($url);\n\n return $this->user->create(json_decode($output, true));\n } else {\n //return the user on database using get method\n return $user;\n }\n }",
"function findSortingDatas($username)\r\n\t{\r\n\t\t$username = funcs::check_input($username);\r\n\r\n\t\t$sql = \"SELECT \".TABLE_MEMBER_FLAG.\" AS flag,\"\r\n\t\t\t\t .TABLE_MEMBER_GENDER.\" AS gender,\"\r\n\t\t\t\t .TABLE_MEMBER_BIRTHDAY.\" AS birthday,\"\r\n\t\t\t\t .TABLE_MEMBER_COUNT.\" AS count1,\"\r\n\t\t\t\t .TABLE_MEMBER_CITY.\" AS city,\"\r\n\t\t\t\t .TABLE_MEMBER_PICTURE.\" AS pic,\"\r\n\t\t\t\t .TABLE_MEMBER_ISACTIVE.\" AS isactive\r\n\t\t\t\t FROM \".TABLE_MEMBER.\" WHERE \".TABLE_MEMBER_USERNAME.\"= '$username' \";\r\n\t\t$rec = DBconnect::assoc_query_1D ($sql);\r\n\t\treturn $rec;\r\n\t}",
"public function retrieveByUsername($username);",
"public function UserDataShort($nickname = '') {\n // return $this->userClass->UserDataShort($nickname);\n /*$root = $_SERVER['DOCUMENT_ROOT'];\n $visitor = $_SESSION['nickname'];\n $dirname = $root . '/users/_' . $nickname . '/';\n\n if ($nickname = ''){\n $userClassFile = glob('*.txt');\n } else {\n $userClassFile = glob($dirname . '*.txt');\n }\n $contents = file_get_contents($userClassFile['0']);\n return $owner = unserialize($contents);*/\n }",
"public function search_user($username,$surname,$email,$phone){\n if(!empty($username)){$this->db->like('username', $username);}\n if(!empty($surname)){$this->db->where('surname', $surname);}\n\t if(!empty($email)){$this->db->where('email', $email);}\n\t if(!empty($phone)){$this->db->where('phone', $phone);}\n\t // if(!empty($acc_company_name)){$this->db->where('acc_company_name', $acc_company_name);}\n\t \n\t //two not empty with username\n \n if(!empty($username) && !empty($surname)){$this->db->where(array('username' => $username, 'surname' => $surname));}\n if(!empty($username) && !empty($email)){$this->db->where('username',$username); $this->db->where('email', $email);}\n\t if(!empty($username) && !empty($phone)){$this->db->where(array('username' => $username, 'phone' => $phone));}\n\t // if(!empty($username) && !empty($acc_company_name)){$this->db->where(array('username' => $username, 'acc_company_name' => $acc_company_name));}\n\t \n\t //two not empty with surname\n if(!empty($surname) && !empty($username) ){$this->db->where('surname', $surname);$this->db->where('username', $username);}\n\t if(!empty($surname) && !empty($email) ){$this->db->where('surname', $surname);$this->db->where('email', $email);}\n\t if(!empty($surname) && !empty($phone) ){$this->db->where('surname', $surname);$this->db->where('phone', $phone);}\n\t// if(!empty($surname) && !empty($acc_company_name) ){$this->db->where('surname', $surname);$this->db->where('acc_company_name', $acc_company_name;}\n\t \n\t //two not empty with phone\n if(!empty($phone) && !empty($username) ){$this->db->where('phone', $phone);$this->db->where('username', $username);}\n\t if(!empty($phone) && !empty($email) ){$this->db->where('phone', $phone);$this->db->where('email', $email);}\n\t if(!empty($phone) && !empty($surname) ){$this->db->where('phone', $phone);$this->db->where('surname', $surname);}\n//\t if(!empty($phone) && !empty($acc_company_name) ){$this->db->where('phone', $phone);$this->db->where('acc_company_name', $acc_company_name;}\n\t \n\t //two not empty with email\n if(!empty($surname) && !empty($email)){$this->db->where('email' , $email);$this->db->where('surname', $surname);}\n\t if(!empty($username) && !empty($email)){$this->db->where('email' , $email);$this->db->where('username', $username);}\n\t if(!empty($phone) && !empty($email)){$this->db->where('email' , $email);$this->db->where('phone', $phone);}\n\t // if(!empty($acc_company_name) && !empty($email)){$this->db->where('email' , $email);$this->db->where('acc_company_name', $acc_company_name);}\n\t \n\t \n\t //three not empty with username\n if(!empty($username) && !empty($surname) && !empty($email) ){$this->db->like('username', $username);$this->db->where(array('surname' => $surname, 'email' => $email));}\n\t \n\t if(!empty($username) && !empty($surname) && !empty($phone) ){$this->db->like('username', $username);$this->db->where(array('surname' => $surname, 'phone' => $phone));}\n\t \n\t //three not empty with email\n\t if(!empty($username) && !empty($phone) && !empty($email) ){$this->db->like('username', $username); $this->db->or_like('email', $email); $this->db->where('phone', $phone); }\n\t \n\t if(!empty($username) && !empty($surname) && !empty($email) ){$this->db->like('username', $username); $this->db->or_like('email', $email); $this->db->where('surname', $surname); }\n\t \n\t if(!empty($surname) && !empty($phone) && !empty($email) ){$this->db->where('surname', $surname); $this->db->or_like('email', $email); $this->db->where('phone', $phone); }\n\t \n\t \n\t //All Not Empty\n\t \n if(!empty($username)){$this->db->like('username', $username);}\n if(!empty($surname) && empty($username) ){$this->db->like('surname', $surname);}\n if(!empty($username) && !empty($surname) ){$this->db->or_like('surname', $surname);} \n if(empty($surname) && empty($username) && !empty($email)){$this->db->like('email', $email);}\n if(!empty($username) || !empty($surname) ){ if(!empty($email)){$this->db->or_like('email', $email);}}\n if(empty($surname) && empty($username) && empty($email) && !empty($phone) ){$this->db->like('phone', $phone);}\n if(!empty($username) || !empty($surname) || !empty($email) ){ if(!empty($phone)){$this->db->or_like('phone', $phone);}}\n $query = $this->db->get('user');\n return $query->result_array();\n }",
"public function recherche_user() {\n\t\t$this->onDebug ( __METHOD__, 1 );\n\t\t$userdata = $this->creer_definition_user_get_ws ();\n\t\t$this->onDebug ( $userdata, 1 );\n\t\treturn $this->getObjetZabbixWsclient ()\n\t\t\t->userGet ( $userdata );\n\t}",
"public function search_user($data)\r\n\t{\r\n\t\t$telp = $data['telp'];\r\n\t\t$ada = $this->db->get_where('tb_juragan',array('telp' => $telp))->num_rows();\r\n\t\tif ($ada != 1) {\r\n\t\t\t# code...\r\n\t\t\treturn TRUE;\r\n\t\t} else {\r\n\t\t\treturn FALSE;\r\n\t\t}\r\n\t}",
"public function index()\n {\n return $this->users->getAll('first_name', 'asc', ['departments', 'sectors', 'meta']);\n }",
"function getAllPerson($sw,$usePre=true) {\n if ($usePre) $Pre=$_SESSION[\"pre\"];\n $rechte=berechtigung(\"cp_\");\n if (!$sw[0]) { $where=\"cp_phone1 like '$Pre\".$sw[1].\"%' or cp_mobile1 like '$Pre\".$sw[1].\"%' \"; }\n else { $where=\"cp_name ilike '$Pre\".$sw[1].\"%' or cp_givenname ilike '$Pre\".$sw[1].\"%' or cp_stichwort1 ilike '$Pre\".$sw[1].\"%'\"; }\n $sql=\"select *,'P' as tab,cp_id as id,cp_name as name from contacts where ($where) and $rechte\";\n $rs=$GLOBALS['dbh']->getAll($sql);\n if($rs) return $rs;\n //Was geschieht wenn nach einer Person mit Vor- und Zuname gesucht wird??\n //Fall 1: Nachname wird zuerst eingeben \"Byron Augusta Ada\"\n $sw_array=explode(\" \",$sw[1],9);\n if (!isset($sw_array[1])) return false;\n $name=array_shift($sw_array);\n $givenname=implode(\" \",$sw_array);\n $where=\"cp_name ilike '$Pre\".$name.\"%' and cp_givenname ilike '$Pre\".$givenname.\"%'\";\n $sql=\"select *,'P' as tab,cp_id as id,cp_name as name from contacts where ($where) and $rechte\";\n $rs=$GLOBALS['dbh']->getAll($sql);\n if ($rs) return $rs;\n //Fall 2: Vorname wird zuerst eingegeben \"Augusta Ada Byron\"\n $sw_array=explode(\" \",$sw[1],9);\n $name=array_pop($sw_array);\n $givenname=implode(\" \", $sw_array);\n $where=\"cp_name ilike '$Pre\".$name.\"%' and cp_givenname ilike '$Pre\".$givenname.\"%'\";\n $sql=\"select *,'P' as tab,cp_id as id,cp_name as name from contacts where ($where) and $rechte\";\n $rs=$GLOBALS['dbh']->getAll($sql);\n if ($rs) return $rs;\n return false;\n}",
"public function getByUsername($username)\r\n {\r\n }",
"public function search($args)\n {\n // Security check\n if (!SecurityUtil::checkPermission('Users::', '::', ACCESS_READ)) {\n return false;\n }\n\n if (!isset($args['q']) || empty($args['q'])) {\n return true;\n }\n\n // decide if we have to load the DUDs from the Profile module\n $profileModule = System::getVar('profilemodule', '');\n $useProfileMod = (!empty($profileModule) && ModUtil::available($profileModule));\n\n // get the db and table info\n $dbtable = DBUtil::getTables();\n $userscolumn = $dbtable['users_column'];\n\n $q = DataUtil::formatForStore($args['q']);\n $q = str_replace('%', '\\\\%', $q); // Don't allow user input % as wildcard\n\n // build the where clause\n $where = array();\n $where[] = \"({$userscolumn['activated']} != \" . Users_Constant::ACTIVATED_PENDING_REG . ')';\n\n $unameClause = Search_Api_User::construct_where($args, array($userscolumn['uname']));\n\n // invoke the current profilemodule search query\n if ($useProfileMod) {\n $uids = ModUtil::apiFunc($profileModule, 'user', 'searchDynadata',\n array('dynadata' => array('all' => $q)));\n\n $tmp = $unameClause;\n if (is_array($uids) && !empty($uids)) {\n $tmp .= \" OR {$userscolumn['uid']} IN (\" . implode(', ', $uids) . ')';\n }\n $where[] = \"({$tmp}) \";\n } else {\n $where[] = $unameClause;\n }\n\n $where = implode(' AND ', $where);\n\n $users = DBUtil::selectObjectArray ('users', $where, '', -1, -1, 'uid');\n\n if (!$users) {\n return true;\n }\n\n $sessionId = session_id();\n\n foreach ($users as $user) {\n if ($user['uid'] != 1 && SecurityUtil::checkPermission('Users::', \"$user[uname]::$user[uid]\", ACCESS_READ)) {\n if ($useProfileMod) {\n $qtext = $this->__(\"Click the user's name to view his/her complete profile.\");\n } else {\n $qtext = '';\n }\n $items = array('title' => $user['uname'],\n 'text' => $qtext,\n 'extra' => $user['uid'],\n 'module' => 'Users',\n 'created' => null,\n 'session' => $sessionId);\n $insertResult = DBUtil::insertObject($items, 'search_result');\n if (!$insertResult) {\n $this->registerError($this->__(\"Error! Could not load the results of the user's search.\"));\n return false;\n }\n }\n }\n return true;\n }",
"public function getUsersMatching($keyword) {\n $sql = 'SELECT id, firstname, mail, role, isAdmin FROM user WHERE firstname LIKE ? OR mail LIKE ? OR role LIKE ?';\n $sth = $this->db->prepare($sql);\n $sth-> execute(array(\"%$keyword%\", \"%$keyword%\", \"%$keyword%\"));\n if ($row = $sth->fetchAll()) {\n return $row;\n }\n\n }",
"function find_user($email = \"\"){\n\n\t\tif(!$email){\n\t\t\tset_alert('error', 'User Email is not set');\n\t\t\tdie(); \n\t\t}\n\n\t\t \t$allUsers = scandir(\"db/users/\");\n\t\t \t$countAllUsers = count($allUsers);\n\n\t \tfor ($counter=0; $counter < $countAllUsers; $counter++) {\n\n \t\t\t$currentUser = $allUsers[$counter];\n \t\t \n \t\t\tif($currentUser == $email . \".json\"){\n\n \t\t\t\t//check Password\n\t \t\t \t$userString = file_get_contents(\"db/users/\". $currentUser); \n\t \t\t\t$userObject = json_decode($userString);\n\t \t\t\t\n\t \t\t\t\n\t \t\t\treturn $userObject;\n \t\t\t\t\n\t\t\t} \t\t\t\n \t\t\t\n \t\t} \t\t\t\n \t}",
"function getItems($data = '')\n {\n\n $filter_addr = '';\n $provider_id = $data['provider_id'];\n if($provider_id != '0') {\n $result = $this->db->select('address')\n ->from('tbl_userinfo')\n ->where('id', $provider_id)\n ->get()->result();\n\n if (count($result) > 0) {\n $filter_addr = $result[0]->address;\n $ss = explode(',', $filter_addr);\n unset($ss[count($ss) - 1]);\n $filter_addr = implode(',', $ss);\n }\n }\n\n $type = $data['searchType'];\n $name = $data['searchName'];\n $status = $data['searchStatus'];\n $shoptype = $data['searchShoptype'];\n if ($provider_id == '0') {\n $address = $data['address'];\n $auth = $data['searchAuth'];\n }\n $this->db->select('*');\n $this->db->from('tbl_userinfo');\n $this->db->where('type', 3);\n if(isset($data['start_date'])){\n if($data['start_date'] != '')\n $this->db->where('date(created_time)>=\\''. $data['start_date'] . '\\'');\n if($data['end_date'] != '')\n $this->db->where('date(created_time)<=\\''. $data['end_date'] . '\\'');\n }\n switch (intval($type)) {\n case 0: // account\n $likeCriteria = $name != '' ? (\"(userid LIKE '%\" . $name . \"%')\") : '';\n break;\n case 1: // name\n $likeCriteria = $name != '' ? (\"(username LIKE '%\" . $name . \"%')\") : '';\n break;\n case 2: // contact\n $likeCriteria = $name != '' ? (\"(address LIKE '%\" . $name . \"%')\") : '';\n break;\n case 3: // recommend\n $likeCriteria = $name != '' ? (\"(saleman_mobile LIKE '%\" . $name . \"%')\") : '';\n break;\n }\n if ($likeCriteria != '') $this->db->where($likeCriteria);\n\n if ($status != '0') $this->db->where('status', $status);\n if ($shoptype != '0') $this->db->where('shop_type', $shoptype);\n if ($provider_id == '0') {\n $likeCriteria = ($address != '') ? (\"(filter_addr LIKE '%\" . $address . \"%')\") : '';\n if ($address != '') $this->db->where($likeCriteria);\n\n if ($auth != '0') $this->db->where('auth', $auth);\n }else{\n $this->db->where('status', 1);\n $this->db->where('auth', 3);\n // range limitation\n if($filter_addr != '')\n $this->db->where('filter_addr', $filter_addr);\n }\n\n $this->db->order_by('id', 'desc');\n $query = $this->db->get();\n $result = $query->result();\n\n if (count($result) == 0) $result = NULL;\n return $result;\n }",
"public function search()\n {\n $user = UserAccountController::getCurrentUser();\n if ($user === null) {\n return;\n }\n $view = new View('search');\n echo $view->render();\n }",
"function getFullUserList($search=\"\", $start=0, $end=0) {\n if ($search !=\"\") {\n\tif (strpos($search, \" \")) {\n\t $split = explode(\" \", $search, 2);\n\t $fname = $split[0];\n\t $lname = $split[1];\n\t} else {\n\t $fname = $search;\n\t $lname = '%';\n\t}\n }\n\n $query = \"SELECT agents.*, users.username, users.lastname, regions.regionName FROM agents LEFT JOIN users ON agents.UUID = users.UUID LEFT JOIN regions ON agents.currentRegion = regions.uuid\";\n\n if ($search != \"\") $query .= $this->cleanQuery(\" WHERE users.username LIKE '$fname' AND users.lastname LIKE '$lname'\");\n $query .= \" ORDER BY users.username, users.lastname\";\n\n if ($start || $end)\t$query .= $this->cleanQuery(\" LIMIT $start, $end\");\n\n if ($result = $this->queryDatabase($query)) {\n if (mysql_numrows($result)) {\n while($row=mysql_fetch_assoc($result)) {\n $array[] = $row;\n }\n }\n }\n\n return $array;\n }",
"function fetchUserDetails($username=NULL,$token=NULL, $id=NULL){\n\tif($username!=NULL) {\n\t\t$column = \"username\";\n\t\t$data = $username;\n\t}elseif($id!=NULL) {\n\t\t$column = \"id\";\n\t\t$data = $id;\n\t}\n\t$db = DB::getInstance();\n\t$query = $db->query(\"SELECT * FROM users WHERE $column = $data LIMIT 1\");\n\t$results = $query->first();\n\treturn ($results);\n}",
"public function getRemainingUsersByNameOrSurnameOrDni() {\n $term = Request::input('term', '');\n $ids = Request::input('ids', '');\n $users_id = ($ids ? array_map('intval', explode(',', $ids)) : []);\n\n $results = array();\n $queries = User::whereNotIn('id', $users_id)\n ->where(function($query) use ($term){\n $query->where('name', 'LIKE', '%'.$term.'%');\n $query->orWhere('surname', 'LIKE', '%'.$term.'%');\n $query->orWhere('dni', 'LIKE', '%'.$term.'%');\n })\n ->take(10)->get();\n\n foreach ($queries as $query)\n $results[] = ['id' => $query->id,\n 'value' => $query->fullname().' ['.$query->dni.']'];\n return response()->json($results);\n }",
"public function getUser($username) {\r\n $sql = $this->db->query(\"SELECT * FROM ms_karyawan LEFT JOIN ms_cabang ON \r\n cbid = kr_cbid LEFT JOIN ms_kota ON kotaid = cb_kotaid WHERE kr_username = '$username'\");\r\n if ($sql->num_rows() > 0) {\r\n return $sql->row_array();\r\n }\r\n// $this->db->close();\r\n return null;\r\n }",
"function get_admin_info($username) {\n $result = db_fetch_row(\"SELECT * FROM `tbl_admin` WHERE `username` = '{$username}'\");\n return $result['fullname'];\n}",
"function scorm_get_user_data($userid) {\n/// for report.php\n\n return get_record('user','id',$userid,'','','','','firstname, lastname, picture');\n}",
"public function getUserBio();",
"protected function readSearchResult() {\n\t\t// get user search from database\n\t\t$sql = \"SELECT\tsearchData\n\t\t\tFROM\twcf\".WCF_N.\"_search\n\t\t\tWHERE\tsearchID = \".$this->searchID.\"\n\t\t\t\tAND userID = \".WCF::getUser()->userID.\"\n\t\t\t\tAND searchType = 'users'\";\n\t\t$search = WCF::getDB()->getFirstRow($sql);\n\t\tif (!isset($search['searchData'])) {\n\t\t\tthrow new IllegalLinkException();\n\t\t}\n\t\t\n\t\t$data = unserialize($search['searchData']);\n\t\t$this->userIDs = $data['matches'];\n\t\t$this->itemsPerPage = $data['itemsPerPage'];\n\t\t$this->columns = $data['columns'];\n\t\tunset($data);\n\t}",
"function search(){\n global $conn;\n $key = $_GET['search_key'];\n $query = \"SELECT * FROM user_details WHERE username LIKE '%$key%' OR fname LIKE '%$key%' OR lname LIKE '%$key%' OR email LIKE '%$key%'\";\n $result = mysqli_query($conn, $query);\n $array = array();\n while($row=mysqli_fetch_array($result)){\n $array[] = trim($row['fname']) . ' ' . trim($row['lname']) . '#'. trim($row['u_id']);\n }\n $output = json_encode($array);\n print $output;\n}",
"public function getUserWithUsername($username);",
"static function searchUserByName() : string\n {\n return \"SELECT *\n FROM users\n WHERE LOCATE( :Name , nickname) > 0;\";\n }",
"public function search_by_username($username) {\n\n // first, get all users\n $method = \"users.list\";\n $payload = array();\n $result = $this->apicall($method, $payload);\n $users = $result['members'];\n\n $this->debug(\"userlist.json\", json_encode($users));\n\n $key = array_search($username, array_column($users, 'name'));\n\n $this->debug(\"user.json\", json_encode($users[$key]));\n\n return $users[$key];\n\n\n }",
"public function index(Request $request)\n {\n if(Auth::user()->level == 1) {\n $keyword = '';\n if($keyword=$request->search){\n $list=User::orderBy('id','ASC')\n ->where(function ($query) use ($keyword){\n $query->orwhere('name','like',\"%$keyword%\")\n ->orwhere('email','like',\"%$keyword%\"); \n })\n ->paginate(5);\n } else {\n $list=User::orderBy( 'id', 'ASC' )\n ->paginate(5);\n }\n \n return view('admin.user.list',['list'=>$list,'keyword'=>$keyword]);\n } else {\n return redirect('admin');\n }\n }",
"function search_for_users($needle)\n {\n $needle = trim($needle);\n if ($needle != '')\n {\n $user = $this->ion_auth->get_user();\n\n $query_string = \"SELECT user_meta.user_id, user_meta.first_name, user_meta.last_name, user_meta.grad_year, school_data.school\n FROM user_meta LEFT JOIN school_data ON user_meta.school_id = school_data.id\n WHERE MATCH(user_meta.first_name, user_meta.last_name) AGAINST (? IN BOOLEAN MODE)\n AND user_meta.user_id <> ?\";\n\n // Generate a string to exclude people the user is already following.\n $following_ids = $this->get_following_ids();\n if (count($following_ids) > 0)\n {\n $query_string .= \" AND user_meta.user_id <> '\" . implode(\"' AND user_meta.user_id <> '\", $following_ids) . \"'\";\n }\n $query_string .= ' LIMIT 15';\n\n $query = $this->db->query($query_string, array(str_replace(' ', '* ', $needle) . '*', $user->id));\n\n // Echo the results\n foreach ($query->result() as $row)\n {\n $this->echo_user_entry($row, 'add following', $profile_links_enabled = false);\n }\n }\n }",
"public function userDetail()\n {\n inputs([\n 'userName'=>[\n 'type'=>\"array\",\n 'value'=>$this->input->post('username'), \n 'validation'=>\"required|notEmpty\"]\n ], $this);\n\n $userDetails = $this->UserDetails->where([\"roleId\"=>$this->getUserRoleId()]);\n if(!in_array(\"ALL\", $this->inputs['userName'])) {\n $this->UserDetails->where_in( \"userName\",$this->inputs['userName']);\n } else {\n $this->UserDetails->where_not_in( \"userName\",$this->inputs['userName']);\n }\n $userDetails = $this->UserDetails->read();\n \n foreach($userDetails as $key=>$userDetail) {\n $contactDetails = $this->getContactDetails([$userDetail['_id']]); \n\n if(!empty($contactDetails)) {\n $userDetails[$key]['contact'] = $contactDetails;\n }\n $documentDetails = $this->getDocumentDetails([$userDetail['_id']]);\n\n if(!empty($documentDetails)) {\n $userDetails[$key]['document'] = $documentDetails; \n }\n }\n return output($userDetails,'success','SM001','api call success',\"\");\n }",
"public function getUser( $data )\r\n\t\t{\r\n\t\t\treturn DB::query( \"SELECT * FROM user WHERE username=:username AND password_hash=:password_hash AND status=1\", $data, true );\t\t\r\n\t\t}",
"function search(){\n if ( $this->RequestHandler->isAjax() ) {\n Configure::write ( 'debug', 0 );\n $this->autoRender=false;\n $users=$this->User->find('all',array('conditions'=>array('User.name LIKE'=>'%'.$_GET['term'].'%')));\n $i=0;\n foreach($users as $user){\n $response[$i]['value']=$user['User']['name'];\n $response[$i]['label']=$user['User']['name'];\n $i++;\n }\n echo json_encode($response);\n }else{\n if (!empty($this->data)) {\n $this->set('users',$this->paginate(array('User.name LIKE'=>'%'.$this->data['User']['name'].'%')));\n }\n }\n }",
"public function findUsers();"
] | [
"0.6911216",
"0.65676785",
"0.6391177",
"0.6355805",
"0.6269937",
"0.62493885",
"0.6201419",
"0.61375695",
"0.6131841",
"0.6127572",
"0.6126675",
"0.6121554",
"0.6105776",
"0.6101659",
"0.6091019",
"0.6071242",
"0.6065023",
"0.6057099",
"0.60393584",
"0.60151047",
"0.60013837",
"0.59939766",
"0.5991919",
"0.59841913",
"0.5968501",
"0.59398717",
"0.5930914",
"0.59256834",
"0.59032965",
"0.5898817",
"0.5880066",
"0.5856288",
"0.5853579",
"0.5847293",
"0.58443844",
"0.58414567",
"0.5832517",
"0.58271176",
"0.5818474",
"0.58100605",
"0.58067966",
"0.57999414",
"0.57982016",
"0.5796628",
"0.5789676",
"0.57859385",
"0.5785717",
"0.5785018",
"0.5775922",
"0.57730293",
"0.57658595",
"0.5765555",
"0.57643306",
"0.5756705",
"0.5744514",
"0.57441145",
"0.5737381",
"0.5734881",
"0.57269865",
"0.57249457",
"0.572483",
"0.57214975",
"0.5720805",
"0.57172203",
"0.56935555",
"0.5688663",
"0.56858087",
"0.56768864",
"0.56756043",
"0.56705",
"0.56642187",
"0.5660016",
"0.56592447",
"0.5655684",
"0.5654921",
"0.56500924",
"0.5648166",
"0.56476206",
"0.56462944",
"0.5644873",
"0.5644788",
"0.56424546",
"0.56420887",
"0.5641267",
"0.56407994",
"0.56405884",
"0.5639982",
"0.5638906",
"0.5629133",
"0.562401",
"0.56201065",
"0.560718",
"0.5606306",
"0.56041",
"0.5601543",
"0.5601069",
"0.55979204",
"0.55944145",
"0.55893445",
"0.55862045",
"0.5585524"
] | 0.0 | -1 |
edit edit data from a single username of user | public function edit($id_matakuliah)
{
if ($this->_access === 'BAAK')
{
if ($this->MatakuliahModel->dataExists('matakuliah', array('id_matakuliah' => $id_matakuliah)) === 1)
{
$matakuliahData = array(
'id_jurusan' => $this->input->post('id_jurusan'),
'nama' => $this->input->post('namamatakuliah'),
'sks' => $this->input->post('sks'),
'semester' => $this->input->post('semester'),
'edited_at' => mdate('%Y-%m-%d', now()),
);
echo ($this->MatakuliahModel->edit($id_matakuliah, $matakuliahData) === TRUE ? 'TRUE' : 'FALSE');
}
else
{
echo "ERROR";
}
}
else
{
echo "!LOGIN";
redirect(base_url('/auth/logout'));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit($username)\n {\n //\n }",
"public function editUser()\n {\n\n $this->displayAllEmployees();\n $new_data = [];\n $id = readline(\"Unesite broj ispred zaposlenika čije podatke želite izmjeniti: \");\n\n $this->displayOneEmployees( $id);\n\n foreach ( $this->employeeStorage->getEmployeeScheme() as $key => $singleUser) { //input is same as addUser method\n\n $userInput = readline(\"$singleUser : \");\n $validate = $this->validateInput($userInput, $key);\n\n while (!$validate)\n {\n $userInput = readline(\"Unesite ispravan format : \");\n $validate = $this->validateInput($userInput, $key);\n\n }\n if ($key === 'income'){\n $userInput = number_format((float)$userInput, 2, '.', '');\n }\n\n $new_data[$key] = $userInput;\n\n }\n $this->employeeStorage->updateEmployee($id, $new_data); //sends both id and data to updateEmployee so the chosen employee can be updated with new data\n\n echo \"\\033[32m\". \"## Izmjene za \". $new_data['name'].\" \". $new_data['lastname'].\" su upisane! \\n\\n\".\"\\033[0m\";\n\n }",
"function user_edit($user_info)\n {\n }",
"public function edituser(){\n\t\t$id = $this->uri->segment(3);\n\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/edit_londontec_users';\n\t\t$mainData = array(\n\t\t\t'pagetitle' => 'Edit Londontec users',\n\t\t\t'londontec_users' => $this->setting_model->Get_Single('londontec_users','user_id',$id)\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n\t}",
"public function edit() {\r\n \tif (isset($_SESSION['userid'])) {\n \t $user=$this->model->getuser($_SESSION['userid']);\n \t $this->view->set('user', $user[0]);\n \t $this->view->edit();\r\n \t} else {\r\n \t $this->redirect('?v=index&a=show');\r\n \t}\r\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 edit(){\n\t\t\tif(isset($_POST['submit'])){\n\t\t\t\t//MAP DATA\n\t\t\t\t$user = $this->_map_posted_data();\n\t\t\t\t$user->set_user_id($_POST['id']);\n\t\t\t\t$this->userrepository->update($user);\n\t\t\t\theader(\"Location: index.php/admin/index/edit\");\n\t\t\t}else{\n\t\t\t\t$view_page = \"adminusersview/edit\";\n\t\t\t\t$id = $_GET['id'];\n\t\t\t\t$user = $this->userrepository->get_by_id($id);\n\t\t\t\tif(is_null($user)){\n\t\t\t\t\theader(\"Location: index.php/admin/index\");\n\t\t\t\t}\n\t\t\t\tinclude_once(ROOT_PATH.\"admin/views/admin/container.php\");\n\t\t\t}\n\t\t}",
"protected function edit() {\n\t\t// Make sure a user exists.\n\t\tif (empty($this->user)) {\n\t\t\t$_SESSION['title'] = 'Error';\n\t\t\t$_SESSION['data'] = array(\n\t\t\t\t'error' => 'The selected user was invalid.',\n\t\t\t\t'link' => 'management/users'\n\t\t\t);\n\t\t\tredirect(ABSURL . 'error');\n\t\t}\n\n\t\t// Prepare data for contents.\n\t\tnonce_generate();\n\t\t$data = array(\n\t\t\t'user' =>& $this->user\n\t\t);\n\t\t$this->title = 'Edit User: ' . $this->user['username'];\n\t\t$this->content = $this->View->getHtml('content-users-edit', $data, $this->title);\n\t}",
"public function edit($user_id)\n\t{\n\t\t//\n\t}",
"function editUserName($data){\n\t\t\t$conn = $this->connect();\n\t\t\t$fname = $this->modify(mysqli_real_escape_string($conn, $data['fname']));\n\t\t\t$lname = $this->modify(mysqli_real_escape_string($conn, $data['lname']));\n\t\t\tif(empty($fname) || empty($lname)) {\n\t\t\t\t$this->re_direct(\"profile\", \"input=empty\");\n\t\t\t} else {\n\t\t\t\tif(preg_match(\"/^[a-z]+(\\.)?( )?[a-z]*$/i\", $fname) && preg_match(\"/^[a-z]+$/i\", $lname)) {\n\t\t\t\t\tif($this->length($fname, 25, 4) && $this->length($lname, 25, 4)) {\n\t\t\t\t\t\t$result = $this->change(\"user_login\", \"user_fname\", $fname , $_SESSION['userid']);\n\t\t\t\t\t\t$result1 = $this->change(\"user_login\", \"user_lname\", $lname , $_SESSION['userid']);\n\t\t\t\t\t\tif($result == false || $result1 == false) {\n\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"Failed\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->re_direct(\"profile\", \"Successfull\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->re_direct(\"profile\", \"Error=toobigOrtooSmall\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->re_direct(\"profile\", \"invalid=name\");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"function get_user_to_edit($user_id)\n {\n }",
"public function edituser($username) {\n $users = DB::table('users')->where('username', $username)->get();\n \n\t // passing data santri yang didapat ke view editsantri.blade.php\n\t return view('users.edituser', compact('users'));\n }",
"public function edit($user_id) {\n if ($_POST){\n #izmena vrednosti\n #redirekcija na listu\n \n $username = filter_input(INPUT_POST, 'username');\n $lastname = filter_input(INPUT_POST, 'lastname');\n $email = filter_input(INPUT_POST, 'email');\n \n if (!preg_match('/^[a-z0-9]{4,}$/', $username) or !preg_match('[A-z 0-9\\-]+', $fullname) or $email == '') {\n $this->setData('message', 'Izmene nisu tačno unete.');\n } else {\n $res = HomeModel::editById($user_id, $username, $lastname, $email);\n if ($res){\n Misc::redirect('homepage');\n } else {\n $this->setData('message', 'Došlo je do greške prilikom izmene.');\n }\n }\n \n }\n \n $user = HomeModel::getById($user_id);\n $this->setData('korisnik', $user);\n }",
"public function actionEdit()\r\n {\r\n $userId = User::checkLogged();\r\n\r\n $user = User::getUserById($userId);\r\n\r\n // new user info valiables\r\n $name = $user['name'];\r\n $password = $user['password'];\r\n\r\n $result = false;\r\n\r\n // form processing\r\n if (isset($_POST['submit'])) {\r\n $name = $_POST['name'];\r\n $password = $_POST['password'];\r\n\r\n $errors = false;\r\n\r\n // validate fields\r\n if (!User::checkName($name))\r\n $errors[] = 'Имя должно быть длиннее 3-х символов';\r\n\r\n if (!User::checkPassword($password))\r\n $errors[] = 'Пароль должен быть длиннее 5-ти символов';\r\n\r\n // save new data \r\n if ($errors == false)\r\n\r\n $result = User::edit($userId, $name, $password);\r\n }\r\n\r\n // attach specified view\r\n require_once(ROOT . '/app/views/cabinet/edit.php');\r\n return true;\r\n }",
"public function edit(){\r\n\t\t$id = $this->uri->segment(2);\r\n\r\n\t\t$data = $this->admin_users_model->get_by(array('id'=>$id)); \r\n\t\tif($data){ \r\n\t\t\tforeach($data as $row){\r\n\t\t\t $data['id'] = $row->id;\r\n\t\t\t\t$data['name'] = $row->name;\t\r\n\t\t\t $data['userName'] = $row->LoginName;\r\n\t\t\t\t$data['email'] = $row->UserEmail;\r\n\t\t\t\t$data['mobile'] = $row->UserMobile;\r\n\t\t\t\t$data['avatar'] = $row->UserAvatar;\r\n\t\t\t $data['yahoo'] = $row->yahoo;\r\n\t\t\t\t$data['twitter'] = $row->twitter;\r\n\t\t\t\t$data['facebook'] = $row->facebook;\r\n\t\t\t\t$data['instagram'] = $row->instagram;\t\r\n\t\t\t\t$data['about'] = $row->about;\t\t\t\r\n\t\t\t\t}\r\n\t\t\t$this->out('adminUser','editUser',$data);\t\r\n\t\t\t} else{\r\n\t\t\t\tredirect('admin-users-list');\r\n\t\t\t\t}\r\n\t\t}",
"public function editUser(){\n\n\t\t$username = filter_input(INPUT_POST, 'newusername', FILTER_SANITIZE_STRING);\n\t\t$id = $_POST[\"id\"];\n\t\ttry {\n\t\t\trequire CONTROLLER_DIR . '/dbConnecterController.php';\n\t\t\t$result = $db->query('SELECT * FROM users WHERE id=\"'.$id.'\"');\n\n\t\t\t$row = $result->fetchColumn();\n\t\t\t\tif(!$row == 0){\n\t\t\t\t\t$statement = $db->prepare(\"UPDATE users SET username=:username WHERE id=:id\");\n\t\t\t\t\t$statement->bindParam(':username', $username, PDO::PARAM_STR);\n\t\t\t\t\t$statement->bindParam(':id', $id, PDO::PARAM_INT);\n\t\t\t\t\t$statement->execute();\n\t\t\t\t\t$db = null;\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\tdie(\"No data present.\");\n\t\t\t\t}\t\n\n\t\t} catch (PDOException $e) {\n\t\t\tprint \"Error!: \" . $e->getMessage() . \"<br/>\";\n\t\t\tdie();\n\t\t}\n\t}",
"public function edit() \n\t{\n UserModel::authentication();\n\n //get the user's information \n $user = UserModel::user();\n\n\t\t$this->View->Render('user/edit', ['user' => $user]);\n }",
"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 edit() {\n $token = $this->require_authentication();\n $user = $token->getUser();\n require \"app/views/user/user_edit.phtml\";\n }",
"function a_edit() {\n\t\tif (isset($_POST[\"btSubmit\"])) {\n\t\t\t$_POST['use_passw']=password_hash($_POST['use_passw'], PASSWORD_DEFAULT);\n\t\t\t$u=new User();\n\t\t\t$u->chargerDepuisTableau($_POST);\n\t\t\t$u->sauver();\n\t\t\theader(\"location:index.php?m=documents\");\n\t\t} else {\t\t\t\t\n\t\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t\t$u=new User($id);\n\t\t\textract($u->data);\t\n\t\t\trequire $this->gabarit;\n\t\t}\n\t}",
"public function edit($id)\n {\n // show form edit user info\n }",
"public function p_edit() { if(!$this->user) {\n Router::redirect('/');\n }\n \n $this->user->user_id = DB::instance(DB_NAME)->sanitize($this->user->user_id);\n $q = 'SELECT first_name, last_name, email\n FROM users\n WHERE user_id = \"'.$this->user->user_id.'\"';\n $user = DB::instance(DB_NAME)->select_row($q);\n \n $_POST = DB::instance(DB_NAME)->sanitize($_POST);\n \n $_POST['first_name'] = htmlspecialchars($_POST['first_name'], ENT_QUOTES, 'UTF-8');\n $_POST['last_name'] = htmlspecialchars($_POST['last_name'], ENT_QUOTES, 'UTF-8');\n \n $q = 'SELECT count(*)\n FROM users\n WHERE email = \"'.$_POST['email'].'\"'; \n $count = DB::instance(DB_NAME)->select_rows($q); \n //if the user enters an email which already exists in the data base kick them back\n if(intval($count[0]['count(*)']) >= 1) {\n Router::redirect('/users/edit/error');\n } else {\n \n if($_POST['first_name'] != NULL)\n {\n $user['first_name'] = $_POST['first_name'];\n }\n if($_POST['last_name'] != NULL )\n {\n $user['last_name'] = $_POST['last_name'];\n }\n if($_POST['email'] != NULL )\n {\n $user['email'] = $_POST['email'];\n }\n \n \n \n DB::instance(DB_NAME)->update(\"users\", $user, \"WHERE user_id =\".$this->user->user_id);\n Router::redirect('/users/profile/'.$this->user->user_id);\n }\n \n \n }",
"public function editName($id,$name){\n\t\t$query = \"UPDATE final_usuario set name='\".$name.\"' WHERE idUser ='\".$id.\"'\";\n\t\treturn $this->con->action($query);\n\t}",
"function edit(){\n\t\t$arr = $this->uri->uri_to_assoc(3);\n\t\t$data['arr'] = $arr['id'];\n\t\t\n\t\t/* membuat value */\n\t\t$this->user->setID($arr['id']);\n\n\t\t/* fungsi ambil data */\n\t\t$result = $this->user->ambil_data();\n\n\t\t/* data dropdown */\n\t\t$data['role'] = role_dropdown();\n\t\t$data['result'] = $result;\n\n\t\t/* load view */\n\t\t$this->template->write_view('edit', $data);\n\t}",
"public function editAction() {\n $uid = $this->getInput('uid');\n $userInfo = Admin_Service_User::getUser(intval($uid));\n list(, $groups) = Admin_Service_Group::getAllGroup();\n $this->assign('userInfo', $userInfo);\n $this->assign('groups', $groups);\n $this->assign('status', $this->status);\n $this->assign(\"meunOn\", \"sys_user\");\n }",
"public function edit()\n {\n $userId = Helper::getIdFromUrl('user');\n\n Helper::checkUrlIdAgainstLoginId($userId);\n\n View::render('users/edit.view', [\n 'method' => 'POST',\n 'action' => '/user/' . $userId . '/update',\n 'user' => UserModel::load()->get($userId),\n 'roles' => RoleModel::load()->all(),\n ]);\n }",
"public function editUser(UserEditForm $form, User $user);",
"public function edit($id)\n {\n $user = User::find($id); //BUAT QUERY UTK PENGAMBILAN DATA\n //LALU ASSIGN KE DALAM MASING-MASING PROPERTI DATANYA\n $this->idz = $user->id;\n $this->name = $user->name;\n $this->username = $user->username;\n $this->email = $user->email;\n $this->password = $user->password;\n\n $this->openUser(); //LALU BUKA User\n }",
"public function edit($id=0)\n\t{\t\n\t\tvalid_company('users','company_id',$id);\n\t\t$this->action_id = $id;\n\t\t$this->actionType = 'update';\n\t\t$this->viewData['user'] = $this->Users_model->getUserById($this->action_id);\n\t\t$this->viewData['title'] = 'Edit User';\n\t\t$this->add_user();\n\t}",
"function editusername_action()\n {\n $login_model = $this->loadModel('Login');\n $login_model->editUserName();\n $this->view->render('login/editusername');\n }",
"function edit()\n\t{\n\t\t// Find the logged-in client details\n\t\t$userId = $this->Auth->user('id');\n\t\t$user = $this->User->findById($userId);\n\n\t\t// Save the POSTed data\n\t\tif (!empty($this->data)) {\n\t\t\t$this->data['User']['id'] = $userId;\n\t\t\tif ($this->User->save($this->data)) {\n\t\t\t\t$this->Session->setFlash(__('Profile has been updated', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Profile could not be saved. Please, try again.', true));\n\t\t\t}\n\t\t} else {\n\t\t\t// Set the form data (display prefilled data) \n\t\t\t$this->data = $user;\n\t\t}\n\n\t\t// Set the view variable\n\t\t$this->set(compact('user'));\n\t}",
"static public function mdlEditUser($table, $data){\n\n\t\t$stmt = Connection::connect()->prepare(\"UPDATE $table set name = :name, email = :email, password = :password, role = :role, photo = :photo WHERE userName = :userName\");\n\n\t\t$stmt -> bindParam(\":name\", $data[\"name\"], PDO::PARAM_STR);\n\t\t$stmt -> bindParam(\":userName\", $data[\"userName\"], PDO::PARAM_STR);\n\t\t$stmt -> bindParam(\":email\", $data[\"email\"], PDO::PARAM_STR);\n\t\t$stmt -> bindParam(\":password\", $data[\"password\"], PDO::PARAM_STR);\n\t\t$stmt -> bindParam(\":role\", $data[\"role\"], PDO::PARAM_STR);\n\t\t$stmt -> bindParam(\":photo\", $data[\"photo\"], PDO::PARAM_STR);\n\n\t\tif ($stmt->execute()) {\n\t\t\t\n\t\t\treturn 'ok';\n\t\t\n\t\t} else {\n\t\t\t\n\t\t\treturn 'error';\n\t\t\n\t\t}\n\t\t\n\t\t$stmt -> close();\n\n\t\t$stmt = null;\n\t}",
"function edit($id_user)\n {\n // check if the user exists before trying to edit it\n $data['user'] = $this->User_model->get_user($id_user);\n\n if (isset($data['user']['id_user'])) {\n if (isset($_POST) && count($_POST) > 0) {\n $params = array(\n 'password' => md5($this->input->post('password')),\n 'nama' => $this->input->post('nama'),\n 'foto' => $this->input->post('foto'),\n 'username' => $this->input->post('username'),\n 'level' => $this->input->post('level'),\n 'foto' => $this->_uploadImage()\n );\n\n $this->User_model->update_user($id_user, $params);\n redirect('user/index');\n } else {\n $data['_view'] = 'user/edit';\n if ($this->session->userdata(\"level\") == 'admin') {\n $this->load->view('layouts/main', $data);\n } else {\n $this->load->view('layouts/main_user', $data);\n }\n }\n } else\n show_error('The user you are trying to edit does not exist.');\n }",
"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 actionEdit() {\n\n\t\t$userId = User::checkLogged();\n\t\t$user = User::getUserById($userId);\n\t\t$first_name = $user['first_name'];\n\t\t$last_name = $user['last_name'];\n\t\t$result = false;\n\n\t\tif (isset($_POST['submit'])) {\n\t\t\t$first_name = $_POST['first_name'];\n\t\t\t$last_name = $_POST['last_name'];\n\n\t\t\t$errors = array();\n\n\t\t\tif ($error = Validator::checkName($first_name)) $errors['first_name'] = $error;\n\t\t\tif ($error = Validator::checkName($last_name)) $errors['last_name'] = $error;\n\n\t\t\tif (empty($errors)) {\n\t\t\t\t$result = User::edit($userId, $first_name, $last_name);\n\t\t\t}\n\t\t}\n\t\t$pageTitle = \"Edit Details\";\n\t\trequire_once(ROOT . '/views/account/edit.php');\n\n\t\treturn true;\n\t}",
"function editUser($id, $fname, $username, $password, $email) {\n\t\tinclude('connect.php');\n// Update user with edit query\n\t\t$updatestring = \"UPDATE tbl_user SET user_fname='{$fname}', user_name='{$username}', user_pass='{$password}', user_email='{$email}' WHERE user_id={$id}\";\n\t\t$updatequery = mysqli_query($link, $updatestring);\n\n\t\tif($updatequery) {\n\t\t\tredirect_to(\"admin_index.php\");\n\t\t}else{\n\t\t\t$message = \"Something went wrong; you are not allowed to change the information.\";\n\t\t\treturn $message;\n\t\t}\n mysqli_close($link);\n\t}",
"public function editUsername($uname)\n\t{\n\t\tglobal $username;\n\t\tglobal $user_id;\n\t\n\t\t$uname = addslashes($uname);\n\t\n\t\tif(strlen($uname) <= 32)\n\t\t{\n\t\t\t$qry = 'UPDATE admin_table SET username = \"' . $uname;\n\t\t\t$result = mysql_query($qry, $GLOBALS['connection']);\n\t\t}\n\t\n\t\t$username = $uname;\n\t}",
"public function editAction()\n {\n // Check logged\n $userId = UserModel::checkLogged();\n \n //We get user data\n $user = UserModel::getUserById($userId);\n \n \n $name = $user['name'];\n \n \n $result = false;\n \n // Form processing\n if (isset($_POST['submit'])) {\n \n // Getting data from the form\n $name = $_POST['name'];\n $password = $_POST['password'];\n \n \n // Form error flag\n $errors = false;\n \n // If necessary, you can validate the values as needed\n if (!UserModel::checkName($name)) {\n $errors[] = 'The name must not be shorter than 2 characters';\n }\n \n if (!UserModel::checkPassword($password)) {\n $errors[] = 'Password must not be shorter than 6 characters';\n }\n \n if ($errors == false) {\n $result = UserModel::edit($userId, $name, $password);\n }\n }\n \n // Connect the view\n $this->view('header.tpl');\n $this->view('view.tpl', ['user' => $user,\n 'result' => $result]\n );\n $this->view('footer.tpl');\n \n return true;\n }",
"function editusername()\n {\n // Auth::handleLogin() makes sure that only logged in users can use this action/method and see that page\n Auth::handleLogin();\n $this->view->render('login/editusername');\n }",
"function edit(){\n if (!empty($this->data)){\n if ($this->User->save($this->data)){\n $this->Session->setFlash(\"Your account has been updated successfully\");\n $this->go_back();\n } \n }else{\n $this->User->id = $this->Session->read(\"Auth.User.id\");\n $this->data = $this->User->read();\n }\n }",
"function editInfo($user) {\n\n if (isset ($_POST ['submit'])) {\n $newUsername = trim(strip_tags($_POST['username']));\n $newFirstName = trim(strip_tags($_POST['firstname']));\n $newLastName = trim(strip_tags($_POST['lastname']));\n $newEmail = trim(strip_tags($_POST['email']));\n\n if(!empty($_POST['username']) AND !empty($_POST['email']) AND !empty($_POST['firstname'] AND !empty($_POST['lastname']))) {\n\n if(strlen($newUsername) <= 100 && strlen($newFirstName) <= 100 && strlen($newLastName) <= 100) {\n\n if (filter_var($newEmail, FILTER_VALIDATE_EMAIL)){\n\n $bdd = dbConnect();\n $reqmail = $bdd->prepare(\"SELECT * FROM user WHERE email = ?\");\n $reqmail->execute(array($newEmail));\n\n if ($reqmail->rowCount() > 0){\n $result = $reqmail->fetch(PDO::FETCH_ASSOC);\n if ($result['username'] == $user) // We can replace its old mail with the same one\n $mailexist = 0;\n else\n $mailexist = 1;\n }\n\n $requsername = $bdd->prepare(\"SELECT * FROM user WHERE username = ?\");\n $requsername->execute(array($newUsername));\n\n if ($requsername->rowCount() > 0){\n $result = $requsername->fetch(PDO::FETCH_ASSOC);\n if ($result['username'] == $user) // We can replace its old username with the same one\n $usernameexist = 0;\n else\n $usernameexist = 1;\n }\n\n if($mailexist == 0) {\n if($usernameexist == 0) {\n try {\n $stmt = $bdd->prepare(\"UPDATE user SET username=:newUsername, first_name=:newFirstName, last_name=:newLastName, email=:newEmail WHERE username=:username\");\n $stmt->execute(array(\n 'newUsername' => $newUsername,\n 'newFirstName' => $newFirstName,\n 'newLastName' => $newLastName,\n 'newEmail' => $newEmail,\n 'username' => $user\n ));\n $_SESSION['username'] = $newUsername;\n }\n catch(PDOException $e) {\n echo $sql . \"<br>\" . $e->getMessage();\n }\n return 0;\n\n } else\n return -3; // Username already used\n } else\n return -2; // Mail already used\n }\n }\n }\n }\n\n return -1;\n\n }",
"public function edit(User $user)\n {\n \n }",
"function edit_user($data=array())\n {\n if ($data)\n {\n $sql = \"\n UPDATE {$this->_db}\n SET\n username = \" . $this->db->escape($data['username']) . \",\n \";\n\n if ($data['password'] != '')\n {\n // secure password\n $salt = hash('sha512', uniqid(mt_rand(1, mt_getrandmax()), TRUE));\n $password = hash('sha512', $data['password'] . $salt);\n\n $sql .= \"\n password = \" . $this->db->escape($password) . \",\n salt = \" . $this->db->escape($salt) . \",\n \";\n }\n\n $sql .= \"\n first_name = \" . $this->db->escape($data['first_name']) . \",\n last_name = \" . $this->db->escape($data['last_name']) . \",\n email = \" . $this->db->escape($data['email']) . \",\n\t\t\t\t\t\t\t\t\t\tverify_status = \" . $this->db->escape($data['verify_status']) . \",\n language = \" . $this->db->escape($data['language']) . \",\n is_admin = \" . $this->db->escape($data['is_admin']) . \",\n status = \" . $this->db->escape($data['status']) . \",\n updated = '\" . date('Y-m-d H:i:s') . \"'\n WHERE id = \" . $this->db->escape($data['id']) . \"\n AND deleted = '0'\n \";\n\n $this->db->query($sql);\n\n if ($this->db->affected_rows())\n {\n return TRUE;\n }\n }\n\n return FALSE;\n }",
"public function edit($id){\n $outData['script']= CONTROLLER_NAME.\"/add\";\n $model = M('user');\n $result = $model->field('id,username,email,realname')->where('id='.$id)->find();\n $outData['info'] = $result;\n $this->assign(\"pageName\",'编辑用户');\n $this->assign('output',$outData);\n $this->display();\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}",
"function edituser($UserID = null){\n \t\t\t$UserID = base64_decode($UserID);\n \t\t\t$this->set('GetUserQ', $this->Users->GetUsers($UserID));\n \t\t\t$this->set('GetLevelsQ', $this->AccessLevels->index());\n \t\t}",
"private function updateUser(){\n\t\t$data['datosUsuario'] = $this->users->get($_REQUEST[\"idusuario\"]);\n\t\t$data['tipoUsuario'] = Seguridad::getTipo(); \n\t\tView::show(\"user/updateForm\", $data);\n\t}",
"public function getPostEditUser()\n {\n // Render login page if not logged in.\n if (!$this->di->get(\"session\")->has(\"account\")) {\n $this->di->get(\"response\")->redirect(\"user/login\");\n }\n\n $title = \"Edit\";\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 $form = new EditUserForm($this->di, $user);\n\n $form->check();\n\n $data = [\n \"form\" => $form->getHTML(),\n ];\n\n $view->add(\"user/edit\", $data);\n\n $pageRender->renderPage([\"title\" => $title]);\n }",
"public function edit(user $user)\n {\n //\n }",
"public function edit(user $user)\n {\n //\n }",
"public function edit_info($user_id){\n\t\t$this->load->model('dashboard');\n\t\t$update=$this->dashboard->update_info($this->input->post(),$user_id);\n\t\tredirect(\"/\");//temp, TODO:need to figure out redirect here\n\t}",
"public function actionEditUserProfile()\n {\n $userID = $_GET['userid'];\n $data = $this->model->getUserProfile($userID);\n $this->view = new ViewIndex(\"EditUserProfile\", $data);\n $this->view->render();\n //$this->view->generate('viewEditProfile.php', 'viewTemplate.php', $data);\n }",
"public function edit($id)\n {\n //\n echo \"updating user\";\n die;\n }",
"public function edita()\n\t {\t\n\t\t$car=$_REQUEST['car'];\n\t\t$per=$_REQUEST['per'];\n\t\t$logi=$_REQUEST['logi'];\n\t\t$pas=$_REQUEST['pas'];\n\t\t$obs=$_REQUEST['obs'];\n\t\t$est=$_REQUEST['est'];\n\t\t\t//$usu=$_REQUEST['usu'];\n\t\t$user_data=array();\n\t\t$user_data['carnet']=$car;\n\t\t$user_data['login']=$logi;\n\t\t$user_data['password']=$pas;\n\t\t$user_data['estado']=$est;\n\t\t$user_data['observacion']=$obs;\n\t\t$user_data['perfil']=$per;\n\t\t\n\t\t//print_r($user_data);\n\t\t$usuario=new Usuarios;\n\t\t$usuario->edit($user_data);\n\t\t$data1=$usuario->lista();\n\t\t$this->principal();\n\t }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"public function edit(User $user)\n {\n //\n }",
"function edit($userCode)\n {\n // check if the data_user exists before trying to edit it\n $data['data_user'] = $this->Data_user_model->get_data_user($userCode);\n\n if (isset($data['data_user']['userCode'])) {\n $this->load->library('form_validation');\n\n $this->form_validation->set_rules('userNama', 'UserNama', 'required');\n\n if ($this->form_validation->run()) {\n $params = array(\n 'userNama' => $this->input->post('userNama'),\n );\n\n $this->Data_user_model->update_data_user($userCode, $params);\n redirect('data_user/index');\n } else {\n $data['_view'] = 'data_user/edit';\n $this->load->view('layouts/main', $data);\n }\n } else\n show_error('The data_user you are trying to edit does not exist.');\n }",
"public function edit(User $user)\n {\n }",
"function editOld($userId = NULL)\n {\n if($this->isAdmin() == TRUE || $userId == 1)\n {\n $this->loadThis();\n }\n else\n {\n if($userId == null)\n {\n redirect('userListing');\n }\n \n $data['roles'] = $this->user_model->getUserRoles();\n $data['userInfo'] = $this->user_model->getUserInfo($userId);\n \n $this->global['pageTitle'] = 'Garuda Informatics : Edit User';\n \n $this->loadViews($this->view.\"editOld\", $this->global, $data, NULL);\n }\n }",
"public function edit($id){\n $where=array(\n 'id'=>$id\n );\n $user=$this->Mdl_user->getRecord($where);\n $data=array(\n 'user'=>$user\n );\n $this->load->view('users/edit',$data);\n }"
] | [
"0.8177034",
"0.8097481",
"0.7906151",
"0.77309227",
"0.757009",
"0.7566514",
"0.7563302",
"0.75299776",
"0.7474551",
"0.7457438",
"0.7401386",
"0.73831826",
"0.73800683",
"0.7344664",
"0.7316913",
"0.7296272",
"0.7293069",
"0.72908115",
"0.72899014",
"0.72792023",
"0.7271986",
"0.72692245",
"0.72296244",
"0.7206514",
"0.7174823",
"0.7162515",
"0.71600837",
"0.7150681",
"0.7142276",
"0.7127469",
"0.71230215",
"0.7109045",
"0.70998675",
"0.7089748",
"0.70848674",
"0.70680904",
"0.7064972",
"0.70619744",
"0.70576435",
"0.7054945",
"0.70527637",
"0.7049731",
"0.7033458",
"0.7021659",
"0.70154446",
"0.7003872",
"0.6997913",
"0.6990679",
"0.6990472",
"0.6990472",
"0.69810385",
"0.6966706",
"0.69641155",
"0.6959879",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.69575715",
"0.6951637",
"0.6950286",
"0.69451797",
"0.6943288"
] | 0.0 | -1 |
add add new data of user | public function add()
{
if ($this->_access === 'BAAK')
{
if (empty($this->input->post('id_matakuliah')))
{
$jurusans = $this->jurusan->browse();
echo "
<div class='modal-header'>
<h1 class='modal-title'>Add Mata Kuliah</h1>
</div>
<div id='error_form_matakuliah'></div>
<form class='form-horizontal' method='post' id='add_form_matakuliah'>
<div class='modal-body'>
<div class='form-group'>
<label class='col-xs-4 control-label'>Kode matakuliah</label>
<div class='col-xs-7'>
<input name='id_matakuliah' id='idmatakuliah_add' type='text' class='form-control' required>
</div>
</div>
<div class='form-group'>
<label class='col-xs-4 control-label'>Jurusan</label>
<div class='col-xs-7'>
<select name='id_jurusan' id='id_jurusan_add' type='text' class='form-control' required>
<option></option>";
foreach ($jurusans as $jurusan)
{
echo "<option value='".$jurusan->id_jurusan."'>".$jurusan->nama."</option>";
}
echo "
</select>
</div>
</div>
<div class='form-group'>
<label class='col-xs-4 control-label'>Nama</label>
<div class='col-xs-7'>
<input name='namamatakuliah' id='namamatakuliah_add' type='text' class='form-control' required>
</div>
</div>
<div class='form-group'>
<label class='col-xs-4 control-label'>Jumlah SKS</label>
<div class='col-xs-7'>
<input name='sks' id='sks_add' type='text' class='form-control' required>
</div>
</div>
<div class='form-group'>
<label class='col-xs-4 control-label'>Semester</label>
<div class='col-xs-7'>
<input name='semester' id='semester_add' type='text' class='form-control' required>
</div>
</div>
</div>
<div class='modal-footer'>
<div class='col-xs-6'>
<button class='btn btn-success' type='submit' id='save_add_matakuliah'><i class='fa fa-save'></i> Save</button>
</div>
<div class='col-xs-6 push-left'>
<button class='btn btn-danger push-left' type='button' data-dismiss='modal'><i class='fa fa-times'></i> Cancel</button>
</div>
</div>
</form>";
}
else
{
if ($this->MatakuliahModel->dataExists('matakuliah', array('id_matakuliah' => $this->input->post('id_matakuliah'))) === 0)
{
$matakuliahData = array(
'id_matakuliah' => $this->input->post('id_matakuliah'),
'id_jurusan' => $this->input->post('id_jurusan'),
'nama' => $this->input->post('namamatakuliah'),
'sks' => $this->input->post('sks'),
'semester' => $this->input->post('semester'),
'created_at' => mdate('%Y-%m-%d', now()),
);
echo ($this->MatakuliahModel->add($matakuliahData) === TRUE ? 'TRUE' : 'FALSE');
}
else
{
echo "ERROR";
}
}
}
else
{
echo "!LOGIN";
// redirect(base_url('/auth/logout'));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addUser($data)\n{\n\t$this->insert($data);\n}",
"public function addUser(){}",
"public static function addUser()\n {\n // ADD NEW DATA TO A TABLE\n // MAKE SURE TO SEND USERS TO THE /users page when a user is added\n }",
"public function addUser(){\n\t}",
"public function add($data){\n \t\t\t$result = $this->db->insert(\"user\",$data);\n \t\t}",
"function user_add($data, $data1) {\n $id = $data['uid'];\n $name = $data['first_name'].' '.$data['last_name'];\n $email = $data['email'];\n $phone = $data['mobile_phone'].' '.$data['home_phone'];\n\n //add id and name of user to sesstion\n $this->add_session($id, $name);\n\n if (!$this->user_is($id)) {\n $query =\"INSERT INTO users VALUES('$id', '$name', '$email', '$phone');\";\n $result = $this->conn->query($query);\n if (!$result) die (\"Database access failed: \" . $this->conn->error);\n //add friends of current user\n for ($j = 0 ; $j < count($data1) ; ++$j) {\n $this->addFriend($data1[$j], $id);\n }\n }\n }",
"public function add($data) {\n if (isset($data['id_user'])) {\n $this->db->where('id_user', $data['id_user']);\n $this->db->update('user', $data);\n } else {\n $this->db->insert('user', $data);\n return $this->db->insert_id();\n }\n }",
"public function add_user($data){\n return $this->db->insert('user', $data);\n }",
"public function addUser($data){\n\t\t//inserta el array desde el service\n\t\t$this->insert($data);\n\t\treturn $data;\n\t}",
"function addnewuser() {\n \t\t\t$this->set('GetUserQ', $this->Users->GetUsers(0));\n \t\t\t$this->set('GetLevelsQ', $this->AccessLevels->index());\n \t\t}",
"public function insertUser($data) {\n\t\t\n\t\t\n\t}",
"public function add() {\n\t\t$user = $this->User->read(null, $this->Auth->user('id'));\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->User->create();\n\t\t\t$this->request->data['User']['password'] = AuthComponent::password($this->request->data['User']['password']);\n\t\t\tif ($this->User->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('The user has been saved'));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('The user could not be saved. Please, try again.'));\n\t\t\t}\n\t\t} else {\n\t\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t\t$lookupSupported = isset($queryURL) && \"\" <> $queryURL;\r\n\t\t\t$this->set('lookupSupported', $lookupSupported);\n\t\t\t$this->set('userType', $user['User']['type']);\n\t\t}\n\t}",
"public function add() {\n $user = $this->Users->newEntity();\n if ($this->request->is('post')) {\n $user = $this->Users->patchEntity($user, $this->request->data);\n if ($this->Users->save($user)) {\n $this->Flash->success(__('The user has been saved.'));\n \n return $this->redirect(['action' => 'login']);\n } else {\n $this->Flash->error(__('The user could not be saved. Please, try again.'));\n }\n }\n \n $this->set(compact('user'));\n $this->set('_serialize', ['user']);\n }",
"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}",
"public function addUser()\n {\n\n foreach ($this->employeeStorage->getEmployeeScheme() as $key => $singleUser) {\n\n $userInput = readline(\"$singleUser : \");\n $validate = $this->validateInput($userInput, $key); // Each input is sent for validation using validateInput method\n\n while (!$validate) // loop that forces user to enter valid input\n {\n $userInput = readline(\"Unesite ispravan format : \");\n $validate = $this->validateInput($userInput, $key);\n\n }\n if ($key === 'income'){\n $userInput = number_format((float)$userInput, 2, '.', ''); // formats income input so it always has 2 decimal points\n }\n\n $data[$key] = $userInput;\n\n }\n\n $this->employeeStorage->setEmployee( $data ); // After every input is validated data is stored using setEmployee method\n\n echo \"\\033[32m\". \"## Novi zaposlenik \". $data['name'].\" \". $data['lastname'].\" je dodan! \\n\\n\".\"\\033[0m\";\n\n\n }",
"public function action_add()\r\n\t{\r\n\t\tif ( Request::current()->method() == Request::POST )\r\n\t\t{\r\n\t\t\treturn $this->_add();\r\n\t\t}\r\n\t\t\r\n\t\t$this->template->title = __('Add user');\r\n\t\t$this->breadcrumbs\r\n\t\t\t->add($this->template->title);\r\n\r\n\t\t// check if user have already enter something\r\n\t\t$data = Flash::get( 'post_data', array() );\r\n\r\n\t\t$user = new User( $data );\r\n\r\n\t\t$this->template->content = View::factory( 'user/edit', array(\r\n\t\t\t'action' => 'add',\r\n\t\t\t'user' => $user,\r\n\t\t\t'permissions' => Model_Permission::get_all()\r\n\t\t) );\r\n\t}",
"public function addUser($data)\n {\n $request = $this->bdd->prepare('INSERT INTO users(Name, FirstName, Mail, Password, Phone, Subcription_ID) VALUES (:name, :firstname, :mail, :password, :phone, :subid)');\n $request->execute([\n 'name' => $data['lastName'],\n 'firstname' => $data['firstName'],\n 'mail' => $data['mail'],\n 'password' => sha1($data['password']),\n 'phone' => $data['tel'],\n 'subid' => (int) $data['radio']\n ]);\n return true;\n }",
"public function add($user){\n\n $this->builder->insert($user);\n\n }",
"function add_user(MJKMH_User $user): void {\r\n\t\t$this->users[$user->id()] = $user;\r\n\t}",
"public function addUser($data) {\n\t\tglobal $db;\n\t\t$db->type = 'site';\n\t\t\n\t\tforeach ($data as $key=>$val) {\n\t\t\tif ($key != 'password') {\n\t\t\t\t$values[$key] = $db->sqlify($val);\n\t\t\t} else {\n\t\t\t\t$values[$key] = $db->sqlify(crypt($val)); \n\t\t\t}\n\t\t}\n\t\t$values['date_created'] = $db->sqlify(date('Y-m-d H:i:s')); \n\t\t\n\t\t$check = false;\n\t\tif (!empty($data['email'])) {\n\t\t\t$check = $this->getUserByEmail($data['email']);\n\t\t} elseif (!empty($data['twitter_id'])) {\n\t\t\t$check = $this->getUserByTwitterId($data['twitter_id']);\n\t\t}\n\t\t\n\t\tif (!$check) {\n\t\t\t$db->insert('users', $values);\n\t\t\t$db->doCommit();\n\t\t}\n\t}",
"protected function _addUser($data = null){\n $this->tempData['User'] = $data['User'];\n unset($this->tempData['User']['id']);\n if($this->tempData['User']) {\n return array('success' => true);\n } else {\n return array('success' => false);\n }\n }",
"public function add(){\r\n\t\t//$this->auth->set_access('add');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}",
"public function add_user($id) {\n UserToPres::create_entry($id,$this->id);\n }",
"function addUser($data)\n { \n $this->query(\"INSERT INTO `{$this->userTable}` (`{$this->tbFields1['first_name']}`, `{$this->tbFields1['last_name']}`, `{$this->tbFields1['gender']}`, `{$this->tbFields1['dob']}`, `{$this->tbFields1['telephone']}`, `{$this->tbFields1['fax']}`, `{$this->tbFields1['email']}`, `{$this->tbFields1['newsletter_flag']}`, `{$this->tbFields1['password']}`, `{$this->tbFields1['date_created']}`) VALUES ('\".$data[$this->dataFields['first_name']].\"', '\".$data[$this->dataFields['last_name']].\"', '\".$data[$this->dataFields['gender']].\"', '\".$data[$this->dataFields['dob']].\"', '\".$data[$this->dataFields['telephone']].\"', '\".$data[$this->dataFields['fax']].\"', '\".$data[$this->dataFields['email']].\"', '\".$data[$this->dataFields['newsletter_flag']].\"', '\".$data[$this->dataFields['password']].\"', CURRENT_TIMESTAMP)\"); \n \n $data[$this->dataFields['customer_id']] = mysql_insert_id($this->dbConn);\n \n if($data[$this->dataFields['address']] != \"\"){\n $this->addAddress($data);\n }\n \n }",
"function add() {\n $this->layout = \"no_header\";\n if (!empty($this->data)) {\n if ($this->User->save($this->data)) {\n $this->Session->setFlash(\"Your account has been created successfully\");\n $this->go_back(\"login\");\n }\n }\n }",
"private function addUser()\n {\n $this->online->addUser($this->user, $this->place, $this->loginTime);\n }",
"public function add_post()\n {\n $response = $this->UserM->add_user(\n $this->post('email'),\n $this->post('nama'),\n $this->post('nohp'),\n $this->post('pekerjaan')\n );\n $this->response($response);\n }",
"public function addUser($data) {\n\t\t$user = $this->findByUnique($data['name'], $data['email'], $data['mobile']);\n\t\tif (!isset($user)) {\n\t\t\t$user = $this->createRow($data);\n\t\t\t$user->save();\n\t\t}\n\t\treturn $user;\n\t}",
"public function addUser($data)\n\t{\n\t\t$this->db->insert($this->pro->prifix.$this->pro->user,$data);\n\t\treturn $this->db->insert_id();\n\t\t\n\t}",
"public function addUser($user_data) {\n\n Yii::$app->db->createCommand()->insert('users', [\n 'username' => $user_data['username'],\n 'password' => $user_data['password'],\n 'authKey' => $user_data['authKey'],\n 'accessToken' => $user_data['accessToken'],\n ])->execute();\n }",
"public function add(array $user);",
"public function add_user_get(){\r\n if (!$this->pronet_model->add_user('Fname Lname', '7711223344553', 'djdj3hdhy2hshsj2@gmail.com', '31111225', '1990-01-01','134091830-2')) {\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => FALSE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_BAD_REQUEST);\r\n } else {\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => TRUE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_OK);\r\n }\r\n }",
"public function add(){\n\t\t// if we got a post information, do add else do nothing\n\t\tif($this->request->is('post')){\n\t\t\t$this->User->create();\n\t\t\tif($this->User->save($this->request->data)){\n\t\t\t\t// if the information is successfully saved\n\t\t\t\t$this->Session->setFlash(__('Congratulation, the user has been created.'));\n\t\t\t\t$this->redirect(array('controller'=>'jobs', 'action'=>'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Sorry, the user can not be created.'));\n\t\t\t}\n\t\t}\n\t}",
"public function actionAdd() {\n\t\treturn $this->txSave ( \"app\\models\\User\" );\n\t}",
"public static function addUser($data)\n\t{\n\t\t$first_name = $data['first_name'];\n\t\t$last_name = $data['last_name'];\n\t\t$emailaddress = $data['emailaddress'];\n\n\t\t$user_name = sanitize_user(sprintf(\"%s %s\", $first_name, $last_name), true);\n\t\t$base_name = $user_name;\n\t\t$i = 0;\n\t\twhile(username_exists( $user_name )) {\n\t\t\t$user_name = $base_name . (++$i);\n\t\t}\n\t\t$password = wp_generate_password();\n\t\t$user_args = [\n\t\t\t'user_login' => $user_name,\n\t\t\t'first_name' => sanitize_text_field( $first_name ),\n\t\t\t'last_name' => sanitize_text_field( $last_name ),\n\t\t\t'nickname' => sanitize_text_field( $user_name ),\n\t\t\t'user_email' => sanitize_text_field( $emailaddress ),\n\t\t\t'user_pass' => $password,\n\t\t];\n\t\t$user_id = wp_insert_user($user_args);\n\t\treturn ['user_id' => $user_id, 'user_name' => $user_name, 'emailaddress' => $emailaddress, 'password' => $password];\n\t}",
"public function post_add_users() {\n\t}",
"public function add(){\n $data = array(\n \"user_nim\" => $this->input->post('user_nim'),\n \"user_fullname\" => $this->input->post('user_fullname'),\n \"user_password\" => md5($this->input->post('user_password')),\n \"user_email\" => $this->input->post('user_email'),\n \"user_semester\" => $this->input->post('user_semester'),\n \"user_level\" => $this->input->post('user_level'),\n \"user_aktif\" => $this->input->post('user_aktif'),\n \"user_creator\" => $this->session->userdata('nim')\n );\n \n $this->db->insert('tbl_users', $data); // Untuk mengeksekusi perintah insert 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{\n\t\t$nama = html_escape($this->input->post('nama', true));\n\t\t$username = html_escape(str_replace(' ', '', strtolower($this->input->post('username', true))));\n\t\t$password = html_escape(sha1($this->input->post('password', true)));\n\t\t$level = html_escape($this->input->post('level', true));\n\n\t\t$data = [\n\t\t\t'username' => $username,\n\t\t\t'password' => $password,\n\t\t\t'nama_user' => $nama,\n\t\t\t'level' => $level\n\t\t];\n\n\t\t$this->User_m->insert('users', $data);\n\t\t$this->session->set_flashdata('pesan', '<div class=\"alert alert-success\">Data User Berhasil Ditambahkan.</div>');\n\t\tredirect('admin/user');\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 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 useradd(){\n $arr=Input::get();\n unset($arr['_token']);\n unset($arr['checkbox']);\n\n $arr['password'] = password_hash($arr['pwd'],PASSWORD_DEFAULT);\n unset($arr['pwd']);\n $students = DB::select('select * from DS_User where account = '.$arr[\"account\"]);\n if (!empty($students)){\n alert('该用户已存在!','/account',2);\n }\n $ls = DB::table('User')->insert($arr);\n if($ls === false){\n alert('注册失败!','/account',2);\n }\n alert('注册成功!','/login',1);\n }",
"public function add()\n {\n $storedPassword = password_hash($_POST['password'], PASSWORD_DEFAULT);\n\n $data = [];\n $data['username'] = $_POST[\"username\"];\n $data['password'] = $storedPassword;\n $data['email'] = $_POST['email'];\n $data['profile_picture'] = $_FILES['profile']['tmp_name'];\n $data['mime'] = $_FILES['profile']['type'];\n $data['phone_num'] = $_POST['phone-number'];\n\n if ($this->model('User')->addNewUser($data) > 0) {\n $this->redirect(BASE_URL . \"/home/index/{$data['username']}\");\n }\n }",
"public function add(){\n\t\tif($this->request->is('post'))\n\t\t{\n\t\t\t$this->User->create();\n\t\t\t$this->request->data['User']['role'] = 'user';\n\t\t\tif($this->User->save($this->request->data))\n\t\t\t{\n\t\t\t\t$this->Session->setFlash('Usuario creado');\n\t\t\t\treturn $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('Usuario no creado');\n\t\t\t}\n\t\t}\n\n\t}",
"public function add($user){\n if (!isset($user['name'])) throw new Exception(\"Name is missing\");\n if (!isset($user['mail'])) throw new Exception(\"Mail is missing\");\n if (!isset($user['password'])) throw new Exception(\"Password is missing\");\n $user['created_at'] = date(Config::DATE_FORMAT);\n $user['token'] = md5(random_bytes(16));\n return parent::add($user);\n}",
"function newUser($data){\n\t\t$this->db->insert('usuarios', array(\n\t\t\t\t\t\t\t\t\t\t\t'rol' \t\t=> $data['rol'],\n\t\t\t\t\t\t\t\t\t\t\t'nombre' \t=> $data['nombre'],\n\t\t\t\t\t\t\t\t\t\t\t'empresa' \t=> $data['empresa'],\n\t\t\t\t\t\t\t\t\t\t\t'direccion' => $data['direccion'],\n\t\t\t\t\t\t\t\t\t\t\t'tel' \t\t=> $data['tel'],\n\t\t\t\t\t\t\t\t\t\t\t'cif' \t\t=> $data['cif'],\n\t\t\t\t\t\t\t\t\t\t\t'mail' \t\t=> $data['mail'],\n\t\t\t\t\t\t\t\t\t\t\t'password' \t=> $data['password']\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t}",
"public function add()\n {\n $this->request->allowMethod(['post']);\n\n $user = $this->Users->newEmptyEntity();\n\n if ($this->request->is('post')) {\n $user = $this->Users->patchEntity($user, $this->request->getData());\n\n if (!$this->Users->save($user)) {\n throw new ValidationErrorException($user);\n }\n }\n\n $this->set('data', $user);\n }",
"public function add()\n\t{\n\t\t// Initialize variables.\n\t\t$app = &JFactory::getApplication();\n\n\t\t// Clear the level edit information from the session.\n\t\t$app->setUserState('com_users.edit.user.id', null);\n\t\t$app->setUserState('com_users.edit.user.data', null);\n\n\t\t// Redirect to the edit screen.\n\t\t$this->setRedirect(JRoute::_('index.php?option=com_users&view=user&layout=edit', false));\n\t}",
"public function add($data) {\n if (isset($data['id'])) {\n $this->db->where('id', $data['id']);\n $this->db->update('users', $data);\n } else {\n $this->db->insert('users', $data);\n $insert_id = $this->db->insert_id();\n return $insert_id;\n }\n }",
"public function addUser($data)\r\n\t{\r\n\t\t$db = $this->getDbConnection();\r\n\t\t$result = $db->insert($this->_tablename, $data);\r\n\t\t\r\n\t\t$lastid = 0;\r\n\t\tif($result)\r\n\t\t{\r\n\t\t\t$lastid = $db->lastInsertId();\r\n\t\t}\r\n\t\treturn $lastid;\r\n\t}",
"public function addAction() {\r\n\t\tif ($this->request->isPost ()) {\r\n\t\t\t$user = new Users ();\r\n\t\t\t$user->firstname = $this->request->get ( \"first_name\" );\r\n\t\t\t$user->lastname = $this->request->get ( \"last_name\" );\r\n\t\t\t$user->bithday = $this->request->get ( \"date\" );\r\n\t\t\t$user->save ();\r\n\t\t}\r\n\t}",
"public function insert() {\n\t\t$this->insert_user();\n\t}",
"public function addUser($data, $setRole = true)\n {\n return parent::addUser($data, $setRole);\n }",
"public function add($data)\n {\n }",
"public function user_add()\n\t{\n\t\t$data = array( 'isi' \t=> 'admin/user/v_user_add',\n\t\t\t\t\t\t'nav'\t=>\t'admin/nav',\n\t\t\t\t\t\t'title' => 'Tampil Dashboard Admin');\n\t\t$this->load->view('layout/wrapper',$data);\n\t}",
"function addUser(){\n $name = $_REQUEST['name'];\n $pword = $_REQUEST['pword'];\n $num = $_REQUEST['number'];\n include(\"../model/user.php\");\n $obj=new user();\n\n if($obj->addUser($name, $pword, $num)) {\n echo '{\"result\":1}';\n }else {\n echo '{\"result\":0}';\n }\n }",
"public function addUser(UserAddForm $form);",
"public function add($data)\r\n {\r\n // Adds a user into the database.\r\n global $db;\r\n // Get what we need.\r\n $stamp = time();\r\n if (isset($_SERVER['REMOTE_ADDR'])) {\r\n $user_ip = $_SERVER['REMOTE_ADDR'];\r\n } else {\r\n $user_ip = false;\r\n }\r\n if (!isset($data['admin'])) {\r\n $admin = false;\r\n } else {\r\n $admin = $data['admin'];\r\n }\r\n $name = $data['name'];\r\n $username = $data['username'];\r\n $email = $data['email'];\r\n $password = $data['password'];\r\n $key = md5($email . $stamp . rand(0, 999));\r\n\r\n // Play with our food.\r\n $salted = $this->salt($password);\r\n // We only want letters and numbers.\r\n $username = preg_replace(\"/[^A-Za-z0-9 ]/\", '', $username);\r\n\r\n // Scrub up and clean up.\r\n $sql = array();\r\n $sql['name'] = $name;\r\n $sql['username'] = $username;\r\n $sql['email'] = $email;\r\n $sql['password'] = $salted;\r\n $sql['regstamp'] = $stamp;\r\n $sql['regip'] = $user_ip;\r\n $sql['verified'] = false;\r\n $sql['verifykey'] = $key;\r\n\r\n $users_uname = db::get_array(\"users\", array(\"username\" => $username));\r\n $users_email = db::get_array(\"users\", array(\"email\" => $email));\r\n $users = (count($users_uname) + count($users_email));\r\n\r\n if ($users > 0) {\r\n if (count($users_uname) > 0) {\r\n return array(\"res\" => false, \"msg\" => \"A user with that Username already exists!\");\r\n } else {\r\n return array(\"res\" => false, \"msg\" => \"A user with that E-Mail already exists!\");\r\n }\r\n } else {\r\n // Insert the data.\r\n db::insert(\"users\", $sql);\r\n do_email($email, $username, \"Email Validation\", \"To begin using your SmallURL account, you need your email verifying. <br /> Please visit <a href='http://account.smallurl.in/verify/{$key}'> http://account.smallurl.in/verify/{$key} </a> to validate your account.\");\r\n\t\t\treturn array(\"res\" => true, \"msg\" => \"Registered!\");\r\n }\r\n }",
"function addUser($data){\n\t$username = secure($data['username']);\n\t$password = secure($data['password']);\n\t$level = secure($data['level']);\n\t$users = getJSON(USERS);\n\t$id = getId($users);\n\t$callback = \"LOGIN_CHECKCHAR_FAILED\";\n\tif(!checkChar($username)){\n\t\n\t\t$salt = \"bb764938100a6ee139c04a52613bd7c1\";\n\t\t//password encryption\t\t\n\t\t$password= md5($password.$salt);\n\t\t$newUser= array(\n\t\t\t\"id\" => $id,\n\t\t\t\"username\" => $username,\n\t\t\t\"password\" => $password,\n\t\t\t\"level\" => $level\n\t\t);\n\t\tarray_push($users,$newUser);\n\t\texport($users, USERS);\n\t\t$callback=\"\";\n\t}\n\treturn $callback; \n}",
"public function set_user_info($data){\n\t\t\treturn $result=$this->save($data);\n\t\t}",
"function add()\n\t{\n\t\t$this->_updatedata();\n\t}",
"public function add_post(){\n $response = $this->BayiM->add(\n $this->post('iduser'),\n $this->post('nama'),\n $this->post('gender')\n );\n $this->response($response);\n }",
"function addUser($user)\n {\n $connection = Doctrine_Manager::connection();\n $query = \"INSERT INTO constant_contact (username, access_token, created_at) VALUES ('\".$user['username'].\"', '\".$user['access_token'].\"', '\".date('Y-m-d H:i:s').\"')\";\n $statement = $connection->execute($query);\n }",
"public function add()\n {\n if($this->Auth->user('level') != \"Officer\" && $this->Auth->user('level') != \"Admin\")\n $this->redirect(\n array('controller' => 'Users', 'action' => 'profilehub/' . $this->Auth->user('id')));\n \n if($this->request->is('post'))\n {\n $this->Event->create();\n \n if($this->Event->save($this->request->data))\n {\n $this->redirect('announcements');\n }\n }\n \n $this->loadModel('User');\n $users = $this->User->find('all');\n\n $this->set('user', $users);\n \n $this->layout = 'hero-ish';\n $this->Session->write('Page', 'Hub');\n }",
"function add_user($data=array())\n {\n if ($data)\n {\n // secure password\n $salt = hash('sha512', uniqid(mt_rand(1, mt_getrandmax()), TRUE));\n $password = hash('sha512', $data['password'] . $salt);\n\n $sql = \"\n INSERT INTO {$this->_db} (\n username,\n password,\n salt,\n first_name,\n last_name,\n email,\n language,\n is_admin,\n status,\n deleted,\n created,\n updated\n ) VALUES (\n \" . $this->db->escape($data['username']) . \",\n \" . $this->db->escape($password) . \",\n \" . $this->db->escape($salt) . \",\n \" . $this->db->escape($data['first_name']) . \",\n \" . $this->db->escape($data['last_name']) . \",\n \" . $this->db->escape($data['email']) . \",\n \" . $this->db->escape($this->config->item('language')) . \",\n \" . $this->db->escape($data['is_admin']) . \",\n \" . $this->db->escape($data['status']) . \",\n '0',\n '\" . date('Y-m-d H:i:s') . \"',\n '\" . date('Y-m-d H:i:s') . \"'\n )\n \";\n\n $this->db->query($sql);\n\n if ($id = $this->db->insert_id())\n {\n return $id;\n }\n }\n\n return FALSE;\n }",
"function register_user($new) {\n \n $this->db->insert('users', $new);\n }",
"function _add_user()\n {\n if (!$this->has_arg('PROJECTID'))\n $this->_error('No project id specified');\n if (!$this->has_arg('PERSONID'))\n $this->_error('No user specified');\n\n $proj = $this->db->pq(\"SELECT p.projectid FROM project p WHERE p.personid LIKE :1 AND p.projectid=:2\", array($this->user->personId, $this->arg('PROJECTID')));\n\n if (!sizeof($proj))\n $this->_error('No such project');\n $proj = $proj[0];\n\n $person = $this->db->pq(\"SELECT CONCAT(CONCAT(givenname, ' '), familyname) as fullname FROM person WHERE personid=:1\", array($this->arg('PERSONID')));\n if (!sizeof($person))\n $this->_error('No such person');\n $person = $person[0];\n\n $this->db->pq(\"INSERT INTO project_has_person (projectid, personid) VALUES (:1, :2)\", array($this->arg('PROJECTID'), $this->arg('PERSONID')));\n\n $this->_output(array('FULLNAME' => $person['FULLNAME']));\n }",
"public function addNew()\n {\n $this->load->model('user_model');\n $data['roles'] = $this->user_model->getUserRoles();\n $data['divisi'] = $this->user_model->getUserDivisi();\n $data['pangkat'] = $this->user_model->getUserPangkat();\n $this->global['pageTitle'] = 'Tambahkan Data Rescuer';\n $this->load->view('includes/header', $this->global);\n $this->load->view('rescuer/addNew', $data);\n $this->load->view('includes/footer');\n }",
"function adminadduser()\n {\n //Check Login\n if ($this->cek_login() != true) {\n return redirect()->to(base_url('login'));\n }\n //Check Role\n if ($this->cek_role() != true) {\n return redirect()->to(base_url('login'));\n }\n $email = $this->request->getPost('email_add');\n $email = esc($email);\n $password = $this->request->getPost('password_add');\n $password = esc($password);\n $name = $this->request->getPost('name_add');\n $name = esc($name);\n $birthdate = $this->request->getPost('birthdate_add');\n $role = $this->request->getPost('role_add');\n $link_foto = '';\n\n $addresult = $this->user_model->addUser($email, $password, $name, $birthdate, $role, $link_foto);\n if ($addresult) {\n session()->setFlashdata('sekolah.project_uas.success', 'User created successfully');\n return redirect()->to(base_url('adminuser'));\n } else {\n //kalo gagal ngapain\n session()->setFlashdata('sekolah.project_uas.fail', 'User cannot created');\n return redirect()->to(base_url('adminuser'));\n }\n }",
"function add_newuser($user) {\n global $DB;\n $DB->insert_record('report_user_statistics', $user, false);\n}",
"function add_user(array $user){\n $json = file_get_contents(FILE_USERS);\n $user['id']= uniqid();\n // 2 convertir contenu en tableau\n $arrayuser = json_decode($json, true);\n // 3 ajouter new user\n $arrayuser[] = $user;\n // convertir le tableau en json\n $json =json_encode($arrayuser);\n file_put_contents(FILE_USERS, $json); \n}",
"public function addUser() {\n $db = new ClassDB();\n $db->connect();\n\n $result = $db->getConnection()->prepare('INSERT INTO users (user_email,\n user_password,\n user_first_name,\n user_last_name) \n VALUES (:email,\n :pass,\n :firstName,\n :lastName)');\n\n $result->bindParam(':email', $this->user_email); \n $result->bindParam(':pass', $this->user_password); \n $result->bindParam(':firstName', $this->user_first_name);\n $result->bindParam(':lastName', $this->user_last_name);\n \n $result->execute();\n $db->disconnect();\n }",
"public function insert_user_details($data)\n\t{\n\t\t\t\n\t\t$this->db->insert('ag_users', $data);\n\t\n\t}",
"function registerUser($data){\n\t\t\tprint($this->db->insert('users', $data));\n\t\t}",
"public function add()\n {\n $originalInput = Request::input();\n $request = Request::create('/users/add', 'POST', array('email'=>Input::get('email'),'name'=>Input::get('name')));\n Request::replace($request->input());\n $userId = Route::dispatch($request)->getContent();\n Request::replace($originalInput);\n\n Task::create(array('user_id'=>$userId,'title'=>Input::get('title'),'description'=>Input::get('description'),'priority'=>Input::get('priority'),'flag'=>'n','duedate'=>Input::get('duedate')));\n\n echo true;\n }",
"public function add_data($data)\n {\n }",
"public static function addUser($userData) {\n $db = DB::getInstance();\n $columns = \"admin, date_created, first_name, last_name, lump, password, username\";\n $placeholders = \":admin, :date_created, :first_name, :last_name, :lump, :password, :username\";\n $sorted = $userData;\n uksort($sorted, function ($val1, $val2) {\n return strncmp($val1, $val2, 2);\n });\n $mssg = \"\";\n\n // Insert form data into database\n try {\n $statement = $db->prepare(\"INSERT INTO `users` ($columns) VALUES ($placeholders)\");\n $statement->execute($sorted);\n // Grab the id of the newly inserted record and pass it back to client\n $mssg = $db->lastInsertId();\n }\n catch (Exception $e) {\n $db->rollBack();\n $mssg = $e->getMessage();\n }\n return $mssg;\n }",
"public function insert_new_user($data)\n {\n foreach($data as $key=>$val) $$key=get_magic_quotes_gpc()?$val:addslashes($val);\n $password = md5($password);\n $query = new Query;\n $count = $query->select('COUNT(*) as count')->from('core_users')->where(\"email = '$email'\")->orWhere(\"phone_number = '$phone_number'\")->All();\n if($count[0]['count']==0)\n {\n $query = Yii::$app->db;\n $result = $query->createCommand()->insert('core_users', [\n \"user_name\"=>$user_name,\n \"email\"=>$email,\n \"password\"=>$password,\n \"phone_number\"=>$phone_number,\n //\"phone_prefix\"=>'91',\n \"user_status\"=>'1',\n \"company_name\"=>$company_name,\n \"designation\"=>$designation,\n \"company_email\"=>$company_email,\n \"company_address\"=>$address,\n \"user_type\"=>1\n ])->execute();\n \n \n $subject=\"Big Equipments India | User Registration\";\n //get message to send to user\n $message = Mail_settings::get_registration_message();\n //send email to user\n Mail_settings::send_email_notification($email,$subject,$message);\n \n if($result)\n {\n return true;\n }\n return false;\n }\n return false;\n \n }",
"static public function mdlAddUser($table, $data){\n\n\t\n\n\n\t\t$stmt = Connection::connect()->prepare(\"INSERT INTO $table (name, userName, email, password, role, photo) VALUES (:name, :userName, :email, :password, :role, :photo)\");\n\n\t\t\n\t\t\n\t\t$stmt -> bindParam(\":name\", $data[\"name\"], PDO::PARAM_STR);\n\t\t$stmt -> bindParam(\":userName\", $data[\"userName\"], PDO::PARAM_STR);\n\t\t$stmt -> bindParam(\":email\", $data[\"email\"], PDO::PARAM_STR);\n\t\t$stmt -> bindParam(\":password\", $data[\"password\"], PDO::PARAM_STR);\n\t\t$stmt -> bindParam(\":role\", $data[\"role\"], PDO::PARAM_STR);\n\t\t$stmt -> bindParam(\":photo\", $data[\"photo\"], PDO::PARAM_STR);\n\t\t\n\n\n\t\tif ($stmt->execute()) {\n\t\t\t\n\t\t\treturn 'ok';\n\t\t\n\t\t} else {\n\t\t\t\n\t\t\treturn 'error';\n\t\t}\n\t\t\n\t\t$stmt -> close();\n\n\t\t$stmt = null;\n\t}",
"function insert_users_info($data = array()) {\n $data += array(\n \"created_on\" => $this->current_dts,\n );\n return $this->create_data($data);\n }",
"function addUser(){\n $data= array(\n 'title'=>$this->security->xss_clean($this->input->post('title')),\n 'fname'=>$this->security->xss_clean($this->input->post('fname')),\n 'lname'=>$this->security->xss_clean($this->input->post('lname')),\n 'gender'=>$this->security->xss_clean($this->input->post('gender')),\n 'email'=>$this->security->xss_clean($this->input->post('email')),\n 'password'=>$this->security->xss_clean(md5($this->input->post('password'))),\n 'mobile'=>$this->security->xss_clean($this->input->post('mobile')),\n 'work_phone'=>$this->security->xss_clean($this->input->post('work_phone')),\n 'address'=>$this->security->xss_clean($this->input->post('address')),\n 'type'=>$this->security->xss_clean($this->input->post('type'))\n );\n \n $this->db->insert('user', $data);\n }",
"public static function addUser()\n {\n if(empty($_POST))\n {\n require_once(__DIR__.'/../views/form.php');\n exit;\n }\n\n // add user to database\n $user = UserModel::addUser();\n\n if (!$user)\n {\n session_start();\n $_SESSION['message'] = 'Error occurred while saving user. Please try again later.';\n header('Location: /form');\n exit;\n }\n\n // update text file\n if (!self::updateTextFile($_SERVER['DOCUMENT_ROOT'] . $user['about'], $user['euro2016']))\n {\n header('Location: /form');\n exit;\n }\n\n session_start();\n $_SESSION['message'] = 'Successfully saved user';\n\n require_once(__DIR__.'/../views/form.php');\n }",
"public function addNewUser($user)\n {\n $conn = $this->MySQL->getConn();\n $sql = \"INSERT INTO `\".DB::TBL_USERS.\"` \".\n \"SET `fio`=?,`login`=?,`loginHash`=?,`phone`=?,\n `email`=?, `emailHash`=?,`pass`=?,`photo`=?\";\n $st = $conn->prepare($sql);\n $st->execute([\n $user->fio, $user->login, $user->loginHash, $user->phone,\n $user->email, $user->emailHash, $user->pass, $user->photo\n ]);\n $user->id = $conn->lastInsertId();\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 }",
"function addUser()\n {\n $this->db->trans_begin();\n\n $table = ( $this->input->post('user_level') != \"parent\" )? \"teacher\":\"parent\";\n \n $IDuser = $this->model->addUser();\n $this->model->saveUserInfo( $IDuser, $table );\n\n if ( $this->db->trans_status() === FALSE ) $this->db->trans_rollback();\n else $this->db->trans_commit();\n\n redirect( 'guidance_user' );\n }",
"public function registerUser($data);",
"static function mdlAddUser($table, $data) {\r\n\r\n\t\t$stmt = Conection::conect()->prepare(\"INSERT INTO $table(nombre, usuario, password, perfil, foto) VALUES (:nombre, :usuario, :password, :perfil, :foto)\");\r\n\t\t\r\n\t\t$stmt->bindParam(\":nombre\", $data[\"nombre\"], PDO::PARAM_STR); \r\n\t\t$stmt->bindParam(\":usuario\", $data[\"usuario\"], PDO::PARAM_STR); \r\n\t\t$stmt->bindParam(\":password\", $data[\"password\"], PDO::PARAM_STR); \r\n\t\t$stmt->bindParam(\":perfil\", $data[\"perfil\"], PDO::PARAM_STR); \r\n\t\t$stmt->bindParam(\":foto\", $data[\"foto\"], PDO::PARAM_STR); \r\n\r\n\r\n\t\tif ($stmt->execute()) {\r\n\t\t\t\r\n\t\t\treturn \"ok\";\r\n\r\n\t\t}else {\r\n\r\n\t\t\treturn \"error\";\r\n\r\n\t\t}\r\n\r\n\t\t$stmt->close();\t\t\r\n\r\n\t\t$stmt = null; \r\n\r\n\t}",
"function add_user ($User_name, $User_password, $User_email, $user_type)\n\t{\n\t\tglobal $conn;\n\n $sql_i = \"INSERT INTO login_db(user_name, user_password, user_email, user_type) VALUES \" .\n \"('$User_name', '$User_password', '$User_email', '$user_type')\";\n\n run_update($sql_i);\n\t}",
"function addUser($userid) {\n $users = $this->getUsers();\n if (!is_array($users)) {\n $users = array();\n }\n array_push($users, $userid);\n $this->setUsers($users);\n }",
"private function insertUser(){\n\t\t$data['tipoUsuario'] = Seguridad::getTipo();\n\t\tView::show(\"user/insertForm\", $data);\n\t}",
"public function addUser()\n {\n $categoryList = $this->itemModel->getCategories();\n\n //Check that register button exists and was clicked\n if (isset($_POST[\"user_submit\"])) { \n\n //Insert new row in Account and setting the User's name in database using values inputted in the HTML form\n $username = $_POST['username']; \n\n $newly_registered_account_id = $this->accountModel->registerAccount($username,$_POST[\"password\"],$_POST[\"sfsu_id\"]);\n\n $this->userModel->setUser($newly_registered_account_id,$_POST[\"firstname\"], \n $_POST[\"lastname\"],$_POST[\"country\"],$_POST[\"state\"],\n $_POST[\"address\"],$_POST[\"city\"],$_POST[\"zipcode\"],$_POST[\"phoneNumber\"]);\n\n } else {\n echo '<script language=\"javascript\">';\n echo 'alert(\"accounts.php registerUser bad.\")';\n echo '</script>';\n }\n\n header('location: ' . URL . 'home/index');\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 user_insert($data = array())\n\t{\n\t\t// Hashed password should not get logged\n\t\tunset($data['user']['u_password']);\n\t\t\n\t\t$this->CI->logger->add('users/user_insert', $data);\n\t}",
"function newuser(){\n\t\t\tif(!empty($_POST['newemail']) && !empty($_POST['newpassword']) && !empty($_POST['newnombre']) && !empty($_POST['newpoblacion']) && !empty($_POST['newrol'])){\n\t\t\t\t$poblacion = filter_input(INPUT_POST,'newpoblacion',FILTER_SANITIZE_STRING);\n\t\t\t\t$nombre = filter_input(INPUT_POST,'newnombre',FILTER_SANITIZE_STRING);\n\t\t\t\t$password = filter_input(INPUT_POST,'newpassword',FILTER_SANITIZE_STRING);\n\t\t\t\t$email = filter_input(INPUT_POST,'newemail',FILTER_SANITIZE_STRING);\n\t\t\t\t$rol = filter_input(INPUT_POST,'newrol',FILTER_SANITIZE_STRING);\n\t\t\t\t$list = $this -> model -> adduser($nombre,$password,$email,$poblacion,$rol);\n \t\t$this -> ajax_set(array('redirect'=>APP_W.'admin'));\n\t\t\t}\n\t\t}",
"public function add($id=null){\n \t$this->layout = 'largeLayout';\n \t\n if($this->request->is('post')){\n $this->User->create();\n\n //Add missing data on the request object before save to the database\n //Set default user role when register is: author.\n $this->request->data['User']['role']= 'author';\n\n // Set default user status is: 1(actived) 1(deleted)\n $this->request->data['User']['status'] = 1;\n\n //Set default user ban status is: 0 (actived) 1(banned)\n $this->request->data['User']['banned'] = 0;\n\n //If user is not submit an avatar then set avatar to default\n // if(isset($this->request->data['User']['avatar'])){\n // $this->request->data['User']['avatar']='avatar.png';\n // $this->request->data['User']['avatar_dir']='default';\n // }\n\n if($this->User->save($this->request->data)){\n\n $this->Session->setFlash(__('User have been saved'));\n $this->redirect(array('action'=>'login'));\n\n } else {\n $this->Session->setFlash(__('User cannot be saved'));\n }\n\n }\n\n }",
"public function insert_user($data)\n\t{\n\n\t\t/**\n\t\t * Insert all the form information in the user table\n\t\t */\n\t\t$this->db->insert(\"users\", $data);\n\n\t}",
"public function addUser($id){\n $this->users()->sync([$id]);\n }",
"public function add()\n\t{\n\t\tif (! $this->is_admin) {\n\t\t\t$this->redirect('admin/error/deny');\n\t\t}\n\n\t\t$authModel = M('auth');\n\t\t$userModel = M('user');\n\n\t\t$authArr = $authModel->field('user_id')->where(array('level' => 1))->select();\n\t\t$leaderUids = makeImplode($authArr, 'user_id');\n\n\t\t$userArr = $userModel\n\t\t\t->field('id, truename')\n\t\t\t->where(array('id' => array('IN', \"$leaderUids\")))\n\t\t\t->select();\n\n\t\t$leaderIdsList = makeIndex($userArr, 'id');\n\n\t\t$this->assign('leader_list', $userArr);\n\t\t$this->display();\n\t}",
"public function saveUser()\n {\n $connection = \\Yii::$app->db;\n $command = $connection->createCommand()\n ->update('users', [\n 'name' => $this->name,\n 'email' => $this->email,\n ], 'id='.$this->id);\n $command->execute();\n }",
"function addUser ($user) {\n\n $conn = \\Database\\Connection::connect();\n\n try {\n $sql = \"INSERT INTO user (_user_FirstName, _user_Email, _user_Password) VALUES (?, ?, ?)\";\n $query = $conn->prepare($sql);\n $query->execute(array($user->_user_FirstName, $user->_user_Email, $user->_user_Password));\n }\n catch(\\PDOException $e)\n {\n echo $sql . \"<br>\" . $e->getMessage();\n }\n\n \\Database\\Connection::disconnect();\n }",
"public function addUser($data){\n\t\t\t$obj_user=array();\n\t\t\t$obj_chkapi = new App_Model_Chkapi();\n\t\t\t$validation_result = $obj_chkapi->chkAPI($data);\n\t\t\t$obj_create = new App_Model_Objcreation();\n\t\t\tif($validation_result==1)\n\t\t\t{\n\n\t\t\t\t try\n\t\t\t\t\t{\n\t\t\t\t\t\t$obj = new App_Model_User();\n\t\t\t\t\t\t$result= $obj->addUserModel($data);\n\t\t\t\t\t\t$result_arr = split(\"~\", $result);\n\t\t\t\t\t\tif($result_arr[0]!=0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$obj_user=$obj_create->createObjUser($data,$result_arr);\n\t\t\t\t\t\t\t}//edn of if($result!=0)\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$obj_user=$obj_create->createObjfalse(3);\n\t\t\t\t\t\t\t}//end of else\n\t\t\t\t\t}//end of try\n\t\t\t\t\tcatch(exception $e)\n\t\t\t\t\t{\n\t\t\t\t\t\t$msg= $e->getMessage();\n\t\t\t\t\t\t$obj_user=$obj_create->createObjfalse(3, $msg);\n\t\t\t\t\t}//end of try\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t $obj_user=$obj_create->createObjfalse(2);\n\t\t\t\t}\n\n\t\treturn $obj_user;\n\t\t}"
] | [
"0.8081852",
"0.8060037",
"0.8041902",
"0.77860093",
"0.7721111",
"0.7613323",
"0.7598796",
"0.75038767",
"0.74760294",
"0.7458764",
"0.74248195",
"0.73906946",
"0.73738205",
"0.73395324",
"0.72912884",
"0.7267677",
"0.7258352",
"0.7246416",
"0.7232921",
"0.7229681",
"0.7227124",
"0.7225454",
"0.7176906",
"0.7149363",
"0.7145027",
"0.7140459",
"0.71357924",
"0.712415",
"0.71168315",
"0.70882636",
"0.7080009",
"0.7072482",
"0.70655996",
"0.702497",
"0.70192015",
"0.6988006",
"0.6987887",
"0.69754297",
"0.6959783",
"0.693826",
"0.6935743",
"0.69044745",
"0.6885217",
"0.6882655",
"0.6872212",
"0.6871314",
"0.68663216",
"0.68649614",
"0.68564475",
"0.6853009",
"0.68491894",
"0.6843842",
"0.6840445",
"0.68388015",
"0.6835689",
"0.6831845",
"0.68077135",
"0.680712",
"0.6805594",
"0.68053246",
"0.67912877",
"0.6790026",
"0.6789198",
"0.6775103",
"0.67692626",
"0.676575",
"0.6746911",
"0.67343",
"0.67323565",
"0.67308605",
"0.6722235",
"0.6718237",
"0.6708256",
"0.6706335",
"0.67027724",
"0.6701462",
"0.67011505",
"0.6700044",
"0.6699274",
"0.6684562",
"0.6680631",
"0.6667419",
"0.6652082",
"0.664296",
"0.6642192",
"0.66326755",
"0.6623442",
"0.66101855",
"0.66063374",
"0.6596964",
"0.6593299",
"0.6588211",
"0.6587448",
"0.6586455",
"0.6567277",
"0.6566307",
"0.65598476",
"0.6549003",
"0.6544385",
"0.65292335",
"0.65272415"
] | 0.0 | -1 |
fix it delete delete user data by username | public function delete($id_matakuliah)
{
if ($this->_access === 'BAAK')
{
if ($this->MatakuliahModel->dataExists('matakuliah', array('id_matakuliah' => $id_matakuliah)) === 1)
{
echo ($this->MatakuliahModel->delete($id_matakuliah) === TRUE ? 'TRUE' : 'FALSE');
}
else
{
echo "ERROR";
}
}
else
{
echo "!LOGIN";
redirect(base_url('/auth/logout'));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteUser($username)\r\n {\r\n $this->querySimpleExecute('delete from t_user where useUsername = ' . $username);\r\n }",
"public function delete() {\n try {\n $db = Database::getInstance();\n $sql = \"DELETE FROM `User` WHERE username = :username\";\n $stmt = $db->prepare($sql);\n $stmt->execute([\"username\" => $this->username]);\n } catch (PDOException $e) {\n exitError(500, \"Internal error.\");\n }\n }",
"public function delete($username)\n {\n }",
"function deleteUsuario($username){\r\n\r\n\t\t$sql = \"DELETE FROM \" . $this->_tablename . \" WHERE usuario = '\" . $username . \"'\";\r\n\r\n\t\t$rs = $this->_db->leer($sql);\r\n\t}",
"public function deleteUser()\n {\n\n $this->displayAllEmployees();\n $id = readline(\"Unesite broj ispred zaposlenika kojeg želite izbrisati :\");\n $check = readline(\"Jeste li sigurni? da/ne: \");\n\n if ($check === 'da'){\n $this->employeeStorage->deleteEmployee($id);\n }\n\n }",
"public function delete() {\n\t\t$query = \"DELETE FROM Users WHERE userId = :id\";\n\t\t$query_params = array(':id' => $this->userData['userId']);\n\t\texecuteSQL($query, $query_params);\n\t}",
"public function delete_user($user);",
"public function deleteUser()\n {\n $this->delete();\n }",
"protected function _destroyUser($username) {}",
"function mysql_deluser($username)\n{\n $user_id = mysql_auth_user_id($username);\n\n dbDelete('entity_permissions', \"`user_id` = ?\", array($user_id));\n dbDelete('users_prefs', \"`user_id` = ?\", array($user_id));\n dbDelete('users_ckeys', \"`username` = ?\", array($username));\n\n return dbDelete('users', \"`username` = ?\", array($username));\n}",
"function deleteuser(){\n\n\t\t$id = $this->input->post('id');\n\n\t\t$this->setting_model->delete('londontec_users','user_id',$id);\n\t\n\t}",
"function deleteUser(){\n\t\t\tif($this->rest->getRequestMethod() != \"DELETE\"){\n\t\t\t\t$this->rest->response('',406);\n\t\t\t}\n\t\t\t//Validate the user\n\t\t\t$validUser = $this->validateUser(\"admin\", \"basic\");\n\t\t\tif ($validUser) {\n\t\t\t\tif (isset($_POST['_id'])){\n\t\t\t\t\t$where = \"_id='\".$_POST['_id'].\"'\";\n\t\t\t\t\t$delete = $this->model->getUser('*',$where);\n\t\t\t\t\t$result = $this->model->deleteUser($where);\n\t\t\t\t\tif($result) {\n\t\t\t\t\t\t$response_array['status']='success';\n\t\t\t\t\t\t$response_array['message']='One record deleted.';\n\t\t\t\t\t\t$response_array['data']=$delete;\n\t\t\t\t\t\t$this->rest->response($response_array, 200);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$response_array['status']='fail';\n\t\t\t\t\t\t$response_array['message']='The record does not exist';\n\t\t\t\t\t\t$data['user_id'] = $_POST['_id'];\n\t\t\t\t\t\t$response_array['data']=$data;\n\t\t\t\t\t\t$this->rest->response($response_array, 404);\n\t\t\t\t\t}\n\n\t\t\t\t}else{\n\t\t\t\t\t$this->rest->response('No parameters given',204);\t// If no records \"No Content\" status\n\t\t\t\t}\n\n\t\t\t}else{\n\t\t\t\t$this->rest->response('Unauthorized Access ',401);\n\t\t\t}\n\t\t\t\n\t\t}",
"function delete_user($username) {\n\n $qDelete = \"DELETE FROM authuser WHERE uname='$username'\";\n\n\n\n if ($username == \"sa\") {\n\n return \"User sa cannot be deleted.\";\n } elseif ($username == \"admin\") {\n\n return \"User admin cannot be deleted.\";\n } elseif ($username == \"test\") {\n\n return \"User test cannot be deleted.\";\n }\n\n $link = new mysqli($this->HOST, $this->USERNAME, $this->PASSWORD, $this->DBNAME);\n if ($link->connect_error) {\n die(\"Error al conectarse a la BD $dbname: \" . $mysqli->connect_error);\n }\n\n $result = $link->query($qDelete);\n\n\n\n return $result->error;\n }",
"public function deleteUser()\n {\n \n $headers = getallheaders();\n $token = $headers['Authorization'];\n $key = $this->key;\n $userData = JWT::decode($token, $key, array('HS256'));\n $id_user = Users::where('email', $userData->email)->first()->id;\n $id_users = $_POST['idUser'];\n $id = $id_users;\n\n $user = Users::find($id);\n\n $rolUser = Users::where('email', $userData->email)->first();\n \n\n if ($rolUser->rol_id == 1){\n\n $user_name = Users::where('id', $id_users)->first()->name;\n Users::destroy($id);\n\n return $this->success('Acabas de borrar a', $user_name);\n\n }else{\n return $this->error(403, 'No tienes permisos');\n }\n \n\n if (is_null($user)) \n {\n return $this->error(400, 'El lugar no existe');\n }\n // }else{\n\n // $user_name = Users::where('id', $id_users)->first()->name;\n // Users::destroy($id);\n\n // return $this->success('Carlos he borrado el usuario', $user_name);\n // }\n }",
"public function delete_user($username)\n\t{\n\t\t$this->db->where('username', $username);\n\t\t$this->db->delete('ag_users');\n\t}",
"public function delete($user)\n {\n $user->deleteProfilePhoto();\n $user->tokens->each->delete();\n\n // $user->delete(); csak logikai törlés a megngedett\n $user->update([\"name\" => \"deleted\".$user->id,\n \"email\" => \"deleted\".$user->id.\"@deleted.com\",\n \"password\" => \"psw\".rand(100000,999999)]);\n\n \\DB::table('members')\n ->where('user_id','=',$user->id)\n ->delete();\n\n }",
"function delete() {\n db_begin_work();\n $delete = parent::delete();\n if($delete && !is_error($delete)) {\n unlink($this->getAvatarPath());\n \tunlink($this->getAvatarPath(true));\n\n ProjectUsers::deleteByUser($this);\n Assignments::deleteByUser($this);\n Subscriptions::deleteByUser($this);\n StarredObjects::deleteByUser($this);\n PinnedProjects::deleteByUser($this);\n UserConfigOptions::deleteByUser($this);\n Reminders::deleteByUser($this);\n\n search_index_remove($this->getId(), 'User');\n\n $cleanup = array();\n event_trigger('on_user_cleanup', array(&$cleanup));\n\n if(is_foreachable($cleanup)) {\n foreach($cleanup as $table_name => $fields) {\n foreach($fields as $field) {\n $condition = '';\n if(is_array($field)) {\n $id_field = array_var($field, 'id');\n $name_field = array_var($field, 'name');\n $email_field = array_var($field, 'email');\n $condition = array_var($field, 'condition');\n } else {\n $id_field = $field . '_id';\n $name_field = $field . '_name';\n $email_field = $field . '_email';\n } // if\n\n if($condition) {\n db_execute('UPDATE ' . TABLE_PREFIX . \"$table_name SET $id_field = 0, $name_field = ?, $email_field = ? WHERE $id_field = ? AND $condition\", $this->getName(), $this->getEmail(), $this->getId());\n } else {\n db_execute('UPDATE ' . TABLE_PREFIX . \"$table_name SET $id_field = 0, $name_field = ?, $email_field = ? WHERE $id_field = ?\", $this->getName(), $this->getEmail(), $this->getId());\n } // if\n } // foreach\n } // foreach\n } // if\n\n db_commit();\n return true;\n } else {\n db_rollback();\n return $delete;\n } // if\n }",
"function delUser($username){\n // Reading names from file\n $file=fopen($path.$this->fPasswd,\"r\");\n $i=0;\n while($line=fgets($file,200)){\n $lineArr=explode(\":\",$line);\n if($username!=$lineArr[0]){\n $newUserlist[$i][0]=$lineArr[0];\n $newUserlist[$i][1]=$lineArr[1];\n $i++;\n }else{\n $deleted=true;\n }\n }\n fclose($file);\n\n // Writing names back to file (without the user to delete)\n $file=fopen($path.$this->fPasswd,\"w\");\n for($i=0;$i<count($newUserlist);$i++){\n fputs($file,$newUserlist[$i][0].\":\".$newUserlist[$i][1].\"\\n\");\n }\n fclose($file);\n \n if($deleted==true){\n return true;\n }else{\n return false;\n }\n }",
"public function user_delete($data = array())\n\t{\n\t\tunset($data['user']['u_password']);\n\t\t\n\t\t$this->CI->logger->add('users/user_delete', $data);\n\t}",
"public function delete($user){\n }",
"public function delete($id_user){\n\t\t\t \n\t\t\t$this -> query = \"DELETE FROM usuari WHERE id='$id_user'\";\n\t\t\t$this -> executa_query();\n\t\t}",
"function delUser($username){\n // Reading names from file\n $file=fopen($this->fPasswd,\"r\");\n $i=0;\n while($line=fgets($file,200)){\n $lineArr=explode(\":\",$line);\n if($username!=$lineArr[0]){\n $newUserlist[$i][0]=$lineArr[0];\n $newUserlist[$i][1]=$lineArr[1];\n $i++;\n }else{\n $deleted=true;\n }\n }\n fclose($file);\n\n // Writing names back to file (without the user to delete)\n $file=fopen($path.$this->fPasswd,\"w\");\n for($i=0;$i<count($newUserlist);$i++){\n fputs($file,$newUserlist[$i][0].\":\".$newUserlist[$i][0].\"\\n\");\n }\n fclose($file);\n \n if($deleted==true){\n return true;\n }else{\n return false;\n }\n }",
"function deleteUser()\n {\n $validateF = new ValidateFunctions();\n if ($_SESSION['id'] == $_GET['']) {\n logUserOut();\n }\n $id = $validateF->sanitize($_GET['id']);\n $userRp = new UserRepository();;\n $hasUser = $userRp->getOneFromDB($id);\n if ($hasUser != 0) {\n $this->deleteUserImage($id);\n $this->removeUser($id);\n $_SESSION['success'] = ['User deleted successfully'];\n } else {\n $_SESSION['error'] = ['No user found.'];\n }\n header('Location:index.php?action=adminUsers');\n }",
"public function deleteData()\n {\t\t\n \t$arrayId = $this->getAllUserId($this->readFromLocalFile());\n \tforeach($arrayId as $id)\n \t{\n \t\t$user = User::find()->where(['id' => $id])->one();\n \t\tif($user)\n \t\t{\n \t\t\t$user->delete();\n \t\t}\n \t}\n \t$this->deleteSelectedLocalItems('user');\n }",
"public function delete(): void\n {\n $id = $this->id;\n $this->fetch(\n 'DELETE FROM user WHERE id = ?;',\n [$id]\n );\n }",
"function delete($user_id) {\n $oldName = get_user_by_id($user_id['id']);\n $oldImage = 'img/demo/avatars/' . $oldName['image'];\n if(!empty($oldName['image'])) {\n if(file_exists($oldImage)) {\n unlink($oldImage);\n }\n }\n\n $db = new PDO(\"mysql:host=localhost; dbname=registration\", \"root\", \"root\");\n $sql = \"DELETE FROM users WHERE id=:id\";\n $statement = $db->prepare($sql);\n $statement->execute([\n 'id' => $user_id['id'],\n ]);\n\n}",
"function hapus_pengguna($id){\n\n $this->db->where('id_user', $id);\n $this->db->delete('tb_user'); \n\n \n \n\t}",
"function user_remove($user_info)\n {\n }",
"function hapus_user($id){\n\t\tmysql_query(\"DELETE FROM users where id ='$id'\");\n\t}",
"function delete(){\n $user_id = $this->uri->rsegment('3');\n $this->_del($user_id);\n redirect(admin_url('user'));\n\n }",
"public function Delete(){\n $query = \"DELETE FROM user where id=\".$this->id;\n\n $result = $this->dbh->exec($query);\n if ($result) {\n Message::setMessage(\"<div class='yes'>Removed Permanently</div>\");\n } else {\n\n Message::setMessage(\"<div class='no'>Failed to Remove</div>\");\n }\n Utility::redirect(\"volunteers.php\");\n }",
"public function deleteFromDb($user) {\n $sql = \"DELETE FROM users WHERE username = ?\";\n $stmt = $this->dbh->prepare($sql);\n $succ = $stmt->execute(array($user->getUsername()));\n }",
"function delUser($username){\r\n\t\t// Reading names from file\r\n\t\t$file=fopen($this->fPasswd,\"r\");\r\n\t\t$i=0;\r\n\t\t$newUserlist = array();\r\n\t\twhile($line=fgets($file,200)){\r\n\t\t\t$lineArr=explode(\":\",$line);\r\n\t\t\tif($username!=$lineArr[0]){\r\n\t\t\t\t$newUserlist[$i][0]=$lineArr[0];\r\n\t\t\t\t$newUserlist[$i][1]=$lineArr[1];\r\n\t\t\t\t$i++;\r\n\t\t\t}else{\r\n\t\t\t\t$deleted=true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfclose($file);\r\n\r\n\t\t// Writing names back to file (without the user to delete)\r\n\t\t$file=fopen($this->fPasswd,\"w\");\r\n\t\tfor($i=0;$i<count($newUserlist);$i++){\r\n\t\t\tfputs($file,$newUserlist[$i][0].\":\".$newUserlist[$i][1]);\r\n\t\t}\r\n\t\tfclose($file);\r\n\r\n\t\tif($deleted==true){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public function delete($user)\n {\n\n }",
"public function delete(){\n\t\t$user_id = $this->input->post(\"user_id\");\n\t\t$username = $this->input->post(\"username\");\n\n\t\t$condition = array(\n\t\t\t\"user_id\" => $user_id\n\t\t);\n\n\t\t$this->load->model(\"User_model\", \"users\", true);\n\n\t\t$this->users->delete($condition);\n\n\t\t$toast = array('state' => true, 'msg' => $username.' is Deleted Successfully!');\n\t\t$this->session->set_flashdata('toast', $toast);\n\n\t\techo \"success\";\n\t}",
"function deleteUser($id){\n\t\t$this->db->where('id_usuario', $id);\n\t\t$this->db->delete('usuarios');\n\t}",
"public function hapus($user_id){\n $this->db->where('user_id', $user_id);\n $this->db->delete('tbl_users'); // Untuk mengeksekusi perintah delete data\n }",
"public static function setDeleteUser($request,$id){\r\n\t\t// Obtem o feedback do banco de dados pelo id\r\n\t\t$obUser = EntityUser::getUserById($id);\r\n\r\n\t\t//VALIDANDO A INSTANCIA\r\n\t\tif(!$obUser instanceof EntityUser){\r\n\t\t\t$request->getRouter()->redireect('/admin/users');\r\n\t\t}\r\n\r\n\t\t//Exclui o deedback\r\n\t\t$obUser->excluir();\r\n\r\n\t\t\r\n\r\n\t\t//REDIRECIONA O USUARIO\r\n\t\t$request->getRouter()->redirect('/admin/users?status=deleted');\r\n \t}",
"public function userDeleted();",
"public function user_delete_post()\n { \n $pdata = file_get_contents(\"php://input\");\n $data = json_decode($pdata,true);\n \n $id = $data['id'];\n $where = array(\n 'id' => $id\n );\n $this->model->delete('users', $where);\n $resp = array('rccode' => 200,'message' =>'success');\n $this->response($resp);\n }",
"private function deleteUser()\n {\n try \n {\n $request = $_REQUEST;\n\n if(!isset($request['userid']) || $request['userid']==\"\")\n throw_error_msg(\"user id not provided\");\n else if(!is_numeric($request['userid']))\n throw_error_msg(\"invalid user id\");\n else\n $userid = (int)$request['userid'];\n\n global $userquery;\n $user = $userquery->delete_user($userid);\n \n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg() )\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'user deleted successfully', \"data\" => array());\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage()); \n } \n }",
"public function deleteUsuario(){\n $conexion = new Database();\n\t\tif ($this->codigo){\n $sql = sprintf('DELETE FROM agenda_usuario WHERE usuario_id = %d',\n $this->codigo);\n $conexion->exec( $sql );\n }\n }",
"public function delete_user() {\n $query = 'DELETE FROM ' . $this->table_name . ' WHERE vendor_id = :vendor_id';\n\n // Prepare statement\n $stmt = $this->conn->prepare($query);\n\n // Clean data\n\n // Bind data\n $stmt->bindParam(':vendor_id', $this->vendor_id);\n\n // Execute query\n if($stmt->execute()) {\n return true;\n }\n\n //Error $stmt->error;\n return false;\n }",
"function User_Remove($UserIDorUsername)\n\t{\n\t\t$UserID=$this->GetUserID($UserIDorUsername);\n\t\tj::SQL(\"DELETE FROM jfp_xuser WHERE ID=?\",$UserID);\n\t\tj::SQL(\"DELETE FROM jf_users WHERE ID=?\",$UserID);\n\t}",
"function system_delete_user($uid)\n{\n}",
"public function delete()\n {\n foreach ($this->users as $user) {\n $uid = $user->id;\n // delete whole website info for this user\n if ((bool)$this->delete) {\n $model = new FormUserClear($user);\n $model->comments = true;\n $model->content = true;\n $model->feedback = true;\n $model->wall = true;\n $model->make();\n }\n\n // delete avatars\n File::remove('/upload/user/avatar/big/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/medium/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/small/' . $uid . '.jpg');\n File::remove('/upload/user/avatar/original/' . $uid . '.jpg');\n // delete user profile and auth data\n $user->profile()->delete();\n // delete user provider data\n $user->provider()->delete();\n // delete user object\n $user->delete();\n }\n }",
"function deleteuser_vizitki($user_id) {\n\tglobal $database;\n\n\t// DELETE vizitki ENTRIES AND COMMENTS\n\t$database->database_query(\"DELETE FROM se_vizitkientries, se_vizitkicomments USING se_vizitkientries LEFT JOIN se_vizitkicomments ON se_vizitkientries.vizitkientry_id=se_vizitkicomments.vizitkicomment_vizitkientry_id WHERE se_vizitkientries.vizitkientry_user_id='$user_id'\");\n\n\t// DELETE COMMENTS POSTED BY USER\n\t$database->database_query(\"DELETE FROM se_vizitkicomments WHERE vizitkicomment_authoruser_id='$user_id'\");\n\n\t// DELETE STYLE\n\t$database->database_query(\"DELETE FROM se_vizitkistyles WHERE vizitkistyle_user_id='$user_id'\");\n\n}",
"public function deleteUserById($user_id){\n $this->dao->deleteUserByid($user_id);\n }",
"function deleteAccount(){\n try{\n $bdd = dbConnect();\n $stmt = $bdd->prepare(\"DELETE FROM user WHERE username=:username\");\n $stmt->execute(array(\n 'username' => $_SESSION['username']\n ));\n }\n catch(PDOException $e){\n echo \"<br>\" . $e->getMessage();\n }\n }",
"function wp_delete_signup_on_user_delete($id, $reassign, $user)\n {\n }",
"public function delete()\n {\n\n $update['id'] = $this->session->userdata('user_id');\n $update['data']['enabled'] = 0;\n $update['data']['active'] = 0;\n $update['table'] = 'users';\n $this->Application_model->update($update);\n\n redirect('/logout','refresh');\n\n }",
"public function destroy()\n {\n $id=$this->seguridad->verificateInt($_REQUEST['delete_id']);\n $token = $_REQUEST['token'];\n $usuario = parent::showImgUser($id);\n if($id && $token)\n {\n if($usuario->img_usuario != 'assets/uploud/profile/default.svg')\n {\n unlink($usuario->img_usuario);\n }\n parent::deleteUser($id,$token);\n }\n }",
"function cvs_delete_user($cvs_user, $cvs_project) {\r\n $all_cvs_users = cvs_read_passwd($cvs_project);\r\n $cvs_fields=$all_cvs_users[$cvs_user];\r\n if (!is_null($cvs_fields)) {\r\n\tunset($all_cvs_users[$cvs_user]);\r\n\tcvs_write_file($all_cvs_users, $cvs_project);\r\n\tcvs_log(1, \"Deleted user $cvs_user\");\r\n } else {\r\n\tcvs_log(3, \"User $cvs_user does not exist\");\r\n } \r\n}",
"function d4os_io_db_070_os_user_delete($uuid) {\n // TODO : delete all assets (impossible ?)\n // TODO : delete groups\n\n // delete offline messages\n drupal_set_message(t('Deleting offline messages.'));\n d4os_io_db_070_offline_message_user_delete($uuid);\n/*\n // delete search\n drupal_set_message(t('Deleting search info.'));\n d4os_io_db_070_os_search_user_delete($uuid);\n*/\n // delete profile\n drupal_set_message(t('Deleting profile info.'));\n d4os_io_db_070_os_profile_user_delete($uuid);\n\n // delete attachments and inventory\n drupal_set_message(t('Deleting inventory.'));\n d4os_io_db_070_os_inventory_user_delete($uuid);\n\n // delete sessions\n drupal_set_message(t('Deleting sessions.'));\n d4os_io_db_070_set_active('os_robust');\n db_query(\"DELETE FROM {Presence} WHERE UserID='%s'\", $uuid);\n d4os_io_db_070_set_active('default');\n/*\n // delete friends\n drupal_set_message(t('Deleting friends.'));\n d4os_io_db_070_set_active('os_users');\n db_query(\"DELETE FROM {userfriends} WHERE ownerID='%s' OR friendID = '%s'\", array($uuid, $uuid));\n d4os_io_db_070_set_active('default');\n*/\n // delete user entry in the grid\n drupal_set_message(t('Deleting user.'));\n d4os_io_db_070_set_active('os_robust');\n db_query(\"DELETE FROM {UserAccounts} WHERE PrincipalID='%s'\", $uuid);\n d4os_io_db_070_set_active('default');\n d4os_io_db_070_set_active('os_robust');\n db_query(\"DELETE FROM {auth} WHERE UUID='%s'\", $uuid);\n d4os_io_db_070_set_active('default');\n d4os_io_db_070_set_active('os_robust');\n db_query(\"DELETE FROM {GridUser} WHERE UserID='%s'\", $uuid);\n d4os_io_db_070_set_active('default');\n\n // delete the user drupal link \n db_query(\"DELETE FROM {d4os_ui_users} WHERE UUID='%s'\", $uuid);\n}",
"function procDeleteUser() {\n global $session, $database, $form;\n /* Username error checking */\n $subuser = $this->checkUsername(\"deluser\");\n\n /* Errors exist, have user correct them */\n if ($form->num_errors > 0) {\n $_SESSION['value_array'] = $_POST;\n $_SESSION['error_array'] = $form->getErrorArray();\n header(\"Location: \" . $session->referrer);\n }\n /* Delete user from database */ else {\n $q = \"DELETE FROM \" . TBL_USERS . \" WHERE username = '$subuser'\";\n $database->query($q);\n header(\"Location: \" . $session->referrer);\n }\n }",
"function deleteUser($userinfo)\r\n {\r\n $status = array();\r\n $status['debug'] = array();\r\n $status['error'] = array();\r\n\r\n \t\t$user[$userinfo->username] = $userinfo->username;\r\n $share = Dokuwiki::getInstance();\r\n if (!$share->auth->deleteUsers($user)) {\r\n \t\t$status['error'][] = JText::_('USER_DELETION_ERROR') . ' ' . 'No User Deleted';\r\n } else {\r\n\t\t\t$status['error'] = false;\r\n\t\t\t$status['debug'][] = JText::_('USER_DELETION'). ' ' . $userinfo->username;\r\n\t\t}\r\n\t\treturn $status;\r\n }",
"public function destroy($username)\n {\n //\n }",
"private function deleteUser()\r\n {\r\n if (isset($_GET['id'])) {\r\n\r\n $id_user = $_GET['id'];\r\n UserDAO::deleteUser($id_user);\r\n $_SESSION['deleteUser'] = '';\r\n header('Location:' . BASE_URL . \"users\");\r\n exit();\r\n }\r\n }",
"public function destroy(){\n $query = 'delete from Usuario where\n user_id = \"'.$this->getUser_id().'\"';\n $this->driver->exec($query);\n }",
"function delete_user()\n {\n\n //return true if successful\n }",
"public function delete()\n{\n $query = \"DELETE FROM \" . $this->table_name . \" WHERE `user_id`=:user_id\";\n \n // prepare the query\n $stmt = $this->conn->prepare( $query );\n // unique ID of record to be edited\n $this->user_id=htmlspecialchars(strip_tags($this->user_id));\n $stmt->bindParam(':user_id', $this->user_id);\n\n \n if($stmt->execute()){\n return true;\n }\n \n // return false if email does not exist in the database\n $this->errmsg=implode(\",\",$stmt->errorInfo());\n return false;\n}",
"public function doDeleteUser (request $request) {\n\t\t$userInfo = resolve('userInfo');\n\n\t\tif ($userInfo->usr_role != \"AD\") {\n\t\t\treturn redirect('error');\n\t\t}\n\n\t\t$user = User::getUserById($request->user_id);\n\t\t//check user first\n\t\t$check = DB::table('jobs')\n\t\t\t\t\t\t\t ->where('job_owner', $request->user_id)\n\t\t\t\t\t\t\t ->orWhere('job_mooring_master', $request->user_id)\n\t\t\t\t\t\t\t ->orWhere('job_poac1', $request->user_id)\n\t\t\t\t\t\t\t ->orWhere('job_poac2', $request->user_id)\n\t\t\t\t\t\t\t ->count();\n\n\t\tif ($request->tab != '') {\n\t\t\t$tab = $request->tab;\n\t\t} else {\n\t\t\t$tab = '';\n\t\t}\n\n\t\tif ($check == 0) {\n\t\t\tDB::table('users')->where('usr_id', $request->user_id)->delete();\n\t\t\tLog::doAddLog (\"Delete user\", 0, $user->usr_firstname.' '.$user->usr_lastname);\n\t\t\treturn redirect('personnelboard'.$tab)->with('success', \"Successfully delete user.\");\n\t\t} else {\n\t\t\tDB::table('users')->where('usr_id', $request->user_id)->update(array('usr_delete'=>'Yes'));\n\t\t\tLog::doAddLog (\"Delete user\", 0, $user->usr_firstname.' '.$user->usr_lastname);\n\t\t\treturn redirect('personnelboard'.$tab)->with('success', \"Successfully delete user.\");\n\t\t}\n\n\t}",
"function procDeleteUser(){\r\n\t\t\tglobal $session, $database, $form;\r\n\t\t\t/* Username error checking */\r\n\t\t\t$subuser = $this->checkUsername(\"deluser\");\r\n\t\t\t\r\n\t\t\t/* Errors exist, have user correct them */\r\n\t\t\tif($form->num_errors > 0){\r\n\t\t\t\t$_SESSION['value_array'] = $_POST;\r\n\t\t\t\t$_SESSION['error_array'] = $form->getErrorArray();\r\n\t\t\t\theader(\"Location: \".$session->referrer);\r\n\t\t\t}\r\n\t\t\t/* Delete user from database */\r\n\t\t\telse{\r\n\t\t\t\t$q = \"DELETE FROM \".TBL_USERS.\" WHERE username = '$subuser'\";\r\n\t\t\t\t$database->query($q);\r\n\t\t\t\theader(\"Location: \".$session->referrer);\r\n\t\t\t}\r\n\t\t}",
"public function delete() {\n\t\t$db = Database::getInstance();\n\t\t$stmt = $db->prepare(\"UPDATE users SET state='DELETED' WHERE id = ?\");\n\t\t$stmt->execute(array($this->id));\n\t}",
"public function deleteUser($userId);",
"public function deleteUser(request $request){\n \n $afi = User::find($request->id);\n $afi->delete();\n \n }",
"static public function ctrBorrarUsuario(){\n\t\tif (isset($_POST['idUsuario'])) {\n\t\t\tif ($_POST['fotoUsuario'] != \"\") {\n\t\t\t\tunlink($_POST[\"fotoUsuario\"]);\n\t\t\t\trmdir('Views/img/usuarios/'.$_POST['usuario']);\n\t\t\t}\n\t\t$answer=adminph\\User::find($_POST['idUsuario']);\n\t\t$answer->delete();\n\t\t}\n\t}",
"public function deleteUser ($username)\n\t{\n\t\t$this->_delUserKey($username, self::SETTINGS);\n\t\t$this->_delUserKey($username, self::COOKIES);\n\t}",
"public function hapususer($username) {\n DB::table('users')->where('username',$username)->delete();\n \n // alihkan halaman ke halaman santri\n return redirect('/users')->with('sukses', 'Data berhasil dihapus!');\n }",
"Public Function PermanentDelete()\n\t{\n\t\t$this->_db->delete('bevomedia_user', 'ID = ' . $this->id);\n\t\t$this->_db->delete('bevomedia_user_info', 'ID = ' . $this->id);\n\t}",
"function deleteUser( $sessionID, $username ) {\r\n\t\t//@session_start();\r\n\t\tif( $this->userCanDeleteUser( $sessionID, $username ) ) {\r\n\t\t\t//mysql_select_db('students');\r\n\t\t\t$query = \"UPDATE `users` SET AccessLevel=0 WHERE ID='\".$username.\"'\";\r\n\t\t\t//echo $query;\r\n\t\t\treturn mysql_query( $query );\r\n\t\t}\r\n\t}",
"function deleteUserDB($id){\n $data = User::find($id);\n session()->flash('deleteUser',$data['username']);\n $data->delete();\n return redirect('user/rabin?age=20');\n }",
"public function deleteAction(){\n \n $req=$this->getRequest();\n $user=Doctrine::getTable('Users')->find($req->getParam('id')); \n\n // Gli utenti developer non possono essere eliminati \n if ($user->Role->developer){\n $this->errors->addError(\"L'utente Developer non può essere cancellato.\");\n $this->emitSaveData();\n return;\n }\n \n $q=Doctrine_Query::create()\n ->delete()\n ->from('Users')\n ->addWhere('ID = ?',$this->getRequest()->getParam('id'))\n ->execute();\n \n $this->emitJson(array(\"success\"=>true));\n }",
"public function deleting(User $user)\n {\n //\n }",
"public function deleting(User $user)\n {\n //\n }",
"public function deleting(User $user)\n {\n //\n }",
"static public function mdlDeleteUser($table, $data) {\r\n\r\n\t\t\t$stmt = Conection::conect()->prepare(\"DELETE FROM $table WHERE id = :id\");\r\n\r\n\t\t\t$stmt -> bindParam(\":id\", $data, PDO::PARAM_STR);\r\n\r\n\t\t\tif($stmt -> execute()){\r\n\r\n\t\t\t\treturn \"ok\";\r\n\t\t\t\r\n\t\t\t}else{\r\n\r\n\t\t\t\treturn \"error\";\t\r\n\r\n\t\t\t}\r\n\r\n\t\t\t$stmt -> close();\r\n\r\n\t\t\t$stmt = null;\r\n\r\n\r\n\t}",
"function delete_user($ci) {\n\t\t$qDelete = \"DELETE FROM alumno WHERE ci='$ci'\";\t\n\t\treturn \"Alumno Eliminado\";\n\t\t\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($qDelete); \n\t\n\t\treturn mysql_error();\n\t\t\n\t}",
"function remove_existing(){\n $db = DB::connect(DB_CONNECTION_STRING);\n \n $sql = \"delete from user \n where postcode = \" . $db->quote($this->postcode) . \"\n and email = \" . $db->quote($this->email) .\"\n and user_id <> \" . $db->quote($this->user_id);\n $db->query($sql); \n }",
"public function procDeleteUser() {//IF time permits, re-implement using new User classes\r\n global $session;\n\r\n /* uid error checking */\n $field = \"deluser\"; //Use the field for uid\r\n $subuid = $_POST[$field];\r\n\r if($subuid == $session->user->getUID()) { /* Make sure no one tries and delete themselves */\n $session->form->setError($field, \"* You can't delete yourself!<br />\");\n }\n\n if($session->form->num_errors > 0) { /* Errors exist, have user correct them */\n $_SESSION['value_array'] = $_POST;\r\n $_SESSION['error_array'] = $session->form->getErrorArray();\r\n } else { /* Delete user from database */\r\n $session->database->removeUser($subuid, DB_TBL_ADMINS);\r\n $session->database->removeUser($subuid, DB_TBL_TELLERS);\r\n $session->database->removeUser($subuid, DB_TBL_CUSTOMERS);\n }\n header(\"Location: \".$session->referrer);\r\n }",
"protected function deleteAdminUserFixture()\n {\n if ($this->userName) {\n $users = Mage::getModel('admin/user')->getCollection();\n $users->addFieldToFilter('username', array( 'eq' => $this->userName));\n $users->load();\n foreach ( $users as $user ) {\n $user->delete();\n }\n }\n \n if ($this->roleName) {\n $roles = Mage::getModel('api/roles')->getCollection();\n $roles->addFieldToFilter('role_name', array('eq' => $this->roleName));\n $roles->load();\n foreach ( $roles as $role ) {\n $role->delete();\n }\n }\n }",
"public function supprime_user() {\n\t\t$this->onDebug ( __METHOD__, 1 );\n\t\t$userdata = $this->creer_definition_user_delete_ws ();\n\t\t$this->onDebug ( $userdata, 1 );\n\t\treturn $this->getObjetZabbixWsclient ()\n\t\t\t->userDelete ( $userdata );\n\t}",
"static public function mdlDeleteUser($table, $data){\n\n\t\t$stmt = Connection::connect()->prepare(\"DELETE FROM $table WHERE id = :id\");\n\n\t\t$stmt -> bindParam(\":id\", $data, PDO::PARAM_STR);\n\n\t\tif ($stmt->execute()) {\n\t\t\t\n\t\t\treturn 'ok';\n\t\t\n\t\t} else {\n\n\t\t\treturn 'error';\n\t\t\n\t\t}\n\t\t\n\t\t$stmt -> close();\n\n\t\t$stmt = null;\n\t}",
"public function deleteAction() {\n $uid = $this->getInput('uid');\n $info = Admin_Service_User::getUser($uid);\n if ($info && $info['groupid'] == 0) $this->output(-1, '此用户无法删除');\n if ($uid < 1) $this->output(-1, '参数错误');\n $result = Admin_Service_User::deleteUser($uid);\n if (!$result) $this->output(-1, '操作失败');\n $this->output(0, '操作成功');\n }",
"function removeUser($username, $conn) {\n\t\t\t$sql = 'DELETE FROM users WHERE ( user_name =\\''.$username.'\\')';\n\t\t\t// echo $sql.'<br>';\n\t\t\t//Prepare sql using conn and returns the statement identifier\n\t\t\t$stid = oci_parse($conn, $sql);\n\t\t\t//Execute a statement returned from oci_parse()\n\t\t\t$res=oci_execute($stid);\n\t\t\t//if error, retrieve the error using the oci_error() function & output an error message\n\t\t\tif (!$res) {\n\t\t\t\t$err = oci_error($stid); \n\t\t\t\techo htmlentities($err['message']);\n\t\t\t}\n\t\t\telse{\n\t\t\t\techo '<ul class=\"list-group\">\n\t\t\t\t\t\t<li class=\"list-group-item list-group-item-success\">User: '.$username.' deleted! <br>\n\t\t\t\t\t\t</li>\n\t\t\t\t\t </ul>';\n\t\t\t}\n\t\t\t// Free the statement identifier when closing the connection\n\t\t\toci_free_statement($stid);\n\t\t}",
"function delete_user($user_id = 0)\n\t{\n\t\t//delete user\n\t\t$this->db->where('user_id', $user_id);\n\t\t$this->db->delete('ci_users');\n\t}",
"public function deleteUser(){\n\t\t$sql = \"SELECT COUNT(aid) AS theCount FROM administrator where uid=:uid\";\n\n\t\tif($stmt = $this->_db->prepare($sql)){\n\t\t\t$stmt->bindParam(\":uid\", $_SESSION['UID'], PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t\t$row = $stmt->fetch();\n\t\t\tif($row['theCount']==0){\n\t\t\t\treturn \"<h2> Error </h2>\" . \n\t\t\t\t\t\"<p> Only administrators can do this. </p>\";\n\t\t\t}\n\t\t\t$stmt ->closeCursor();\n\t\t}\n\t\telse{\n\t\t\treturn \"Something went wrong checking the admin table.\";\n\t\t}\n\t\t\n\t\t//TODO: send the deleted user an email telling them they have been deleted\n\t\t\n\t\t$sql = \"DELETE FROM user WHERE uid=:uid\";\n\t\tif($stmt = $this->_db->prepare($sql)){\n\t\t\t$stmt->bindParam(\":uid\", $_GET['u'], PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t}\n\t\telse{\n\t\t\treturn \"Something went wrong deleting the user.\";\n\t\t}\n\n\t\treturn \"done\";\n\t}",
"function deleteUser(){\n $bdd = bdd();\n $bdd->prepare(\"DELETE from postSujet where propri=?\")->execute(array($_GET['del']));\n $bdd->prepare(\"DELETE from membres where id=?\")->execute(array($_GET['del']));\n}",
"public function delete_user($con, $username) {\n $query = \"DELETE FROM user WHERE username = '$username'\";\n $result = mysqli_query($con,$query);\n if ($result) {\n return true;\n }\n else {\n return false;\n }\n }",
"public function deleted_user_action($id) {\r\n $this->db->delete_by_user_id($id);\r\n }",
"public function delExpApp($username)\n { \n $values=array();\n $dateNow=date('Y-m-d');\n $timeNow=date('H:i:s');\n $sqlDel=\"DELETE FROM appointment WHERE (username = '\".$username.\"') AND ((appointment_date < '\".$dateNow.\"') OR (appointment_date < '\".$dateNow.\"' AND appointment_time<'\".$timeNow.\"'))\";\n $this->execute($sqlDel,$values);\n }",
"function delUser() // Renomeada para n�o ser usada. Antiga delUser() \n{\n\tglobal $xoopsDB, $myts, $xoopsConfig, $xoopsModule;\n\n\t$query = \"SELECT * FROM \". $xoopsDB->prefix('xmail_newsletter') .\" WHERE user_email='\" . $myts->makeTboxData4Save($_POST['user_mail']) . \"' \";\n\t$result = $xoopsDB->query($query);\n\t$myarray = $xoopsDB->fetchArray($result);\n\n\t$mymail = $myts->makeTboxData4Save($_POST['user_mail']);\n\tif ($myarray) {\n\t\tif ($myarray['confirmed'] == '0')\n\t\t\treturn -1;\n\n\t\t$query = \"DELETE from \" . $xoopsDB->prefix('xmail_newsletter') . \" WHERE user_email='$mymail'\";\n\t\t$result = $xoopsDB->queryF($query);\n\t\t\n\t\t// eliminar o perfil\n\t\t$sql=' delete from '.$xoopsDB->prefix('xmail_perfil_news').' where user_id='.$myarray['user_id'];\n\t\t$result2=$xoopsDB->queryf($sql);\n\t\tif(!$result2){\n\t\t\txoops_error('Erro ao eliminar perfil'.$xoopsDB->error());\n\t\t}\n\t\t\t\n\t\t\n\t\treturn 1;\n\t} else {\n\t\treturn -2;\n\t}\n}",
"public function delete(){\t\t\tif( is_null( $this->id ) ) trigger_error( \"User::delete(): Attempt to delete a user object that does not have its ID property set.\", E_USER_ERROR );\r\n\t\t\t\r\n\t\t\t//Delete the object\r\n\t\t\t$conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\r\n\t\t\t$st = $conn->prepare ( \"DELETE FROM \".TABLENAME_GROUPS.\" WHERE id = :id LIMIT 1\" );\r\n\t\t\t$st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n\t\t\t$st->execute();\r\n\t\t\t$conn = null;\t\t\r\n\t\t}",
"public function deleteUser($id){\n$sql = \"DELETE FROM utilisateurs WHERE id = :id\";\n $stmt= $this->pdo->prepare($sql);\n $stmt->execute([\n 'id' => $id\n ]);\n}",
"public function softdelete()\n {\n\n $user = User::findOrFail(request()->id);\n\n $user->first_name = NULL;\n $user->middle_name = NULL;\n $user->last_name = NULL;\n $user->email = NULL;\n $user->address = NULL;\n $user->postal = NULL;\n $user->city = NULL;\n $user->phone = NULL;\n\n $user->save();\n $user->delete();\n // Session::flash('success', 'Gebruiker verwijderd');\n return redirect('/users');\n\n }",
"function delete()\n {\n if($this->isManager() == TRUE)\n {\n echo(json_encode(array('status'=>'access')));\n }\n else\n {\n $id = $this->input->post('userId');\n $userInfo = array('isDeleted'=> 1,'updatedBy'=>$this->vendorId, 'field' => $id,'updatedDtm'=>date('Y-m-d H:i:s'));\n \n $result = $this->model->deleteUser($id);\n \n if ($result > 0) { echo(json_encode(array('status'=>TRUE, 'id' => $id))); }\n else { echo(json_encode(array('status'=>FALSE, 'id' => $id))); }\n }\n }",
"public function destroy($username)\n {//chưa làm\n if (Session::has('admin')) {\n $model = Users::where('username',$username)->first();\n $model->delete();\n\n return redirect('/danh_muc/tai_khoan/list_user?&madv='.$model->madv);\n\n } else\n return view('errors.notlogin');\n }",
"public function removeUser()\n\t{\n\t\tif(isset($this->primarySearchData[$this->ref_user]))\n\t\t{\n\t\t\tunset($this->primarySearchData[$this->ref_user]);\n\t\t}\n\t}",
"protected function deleteUser()\n {\n $userId = $this->request->variable('user_id',0);\n\n if($userId === 0)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'Invalid data supplied',\n 'error' => ['User ID was not supplied']\n ]);\n }\n\n // Determine if this user is an administrator\n $arrUserData = $this->auth->obtain_user_data($userId);\n $this->auth->acl($arrUserData);\n $isAdmin = $this->auth->acl_get('a_');\n\n if($isAdmin)\n {\n $this->sendResponse([\n 'status' => 'failed',\n 'message' => 'User was not deleted because they are an admin',\n 'error' => ['phpBB admin accounts cannot be automatically deleted. Please delete via ACP.']\n ]);\n }\n\n user_delete('remove', $userId);\n\n // Send success response\n $this->sendResponse([\n 'status' => 'success',\n 'message' => 'phpBB user was deleted',\n 'data' => [\n 'user_id' => $userId\n ]\n ]);\n }",
"function removeActiveUser($username){\r\n if(!TRACK_VISITORS) return;\r\n $sql = $this->connection->prepare(\"DELETE FROM \".TBL_ACTIVE_USERS.\" WHERE username = '$username'\");\r\n $sql->execute();\r\n $this->calcNumActiveUsers();\r\n }",
"public function delete_user($id)\n\t{\n\t\t$termination_date = date(\"Y-m-d H:i\");\n\t\t$dbres = $this->db->query(\"update user SET delete_status='1',termination_date='$termination_date' where id = $id \");\n\t\tredirect(site_url() . 'sys/get_employees?msg_del=success');\n\t}"
] | [
"0.7897824",
"0.7664261",
"0.7628001",
"0.75153863",
"0.74352586",
"0.7389769",
"0.73874515",
"0.7365762",
"0.73305196",
"0.7242954",
"0.723207",
"0.71599376",
"0.71176",
"0.70891833",
"0.70626605",
"0.70572025",
"0.70435417",
"0.7038207",
"0.70345604",
"0.70335776",
"0.7026372",
"0.70152813",
"0.69980794",
"0.69917417",
"0.6975902",
"0.69743216",
"0.6959442",
"0.6945113",
"0.69394034",
"0.6929687",
"0.6908585",
"0.6906262",
"0.68998176",
"0.68974257",
"0.68920696",
"0.68854314",
"0.68832076",
"0.6869561",
"0.68676966",
"0.6859923",
"0.68564844",
"0.6855513",
"0.6850704",
"0.6842002",
"0.6828318",
"0.68279827",
"0.6826292",
"0.68236506",
"0.6817344",
"0.680672",
"0.6802163",
"0.67958945",
"0.6794926",
"0.67816556",
"0.67705554",
"0.67638755",
"0.6756157",
"0.6748631",
"0.67416954",
"0.6738984",
"0.6736203",
"0.6725814",
"0.6723804",
"0.6721394",
"0.6716783",
"0.6706418",
"0.6701294",
"0.6701203",
"0.66999125",
"0.66842103",
"0.66800827",
"0.66758454",
"0.66698736",
"0.66599584",
"0.66599584",
"0.66599584",
"0.6659447",
"0.6650984",
"0.6645303",
"0.66433054",
"0.6639093",
"0.6637537",
"0.6633973",
"0.66293746",
"0.6622714",
"0.6621907",
"0.66197747",
"0.6613943",
"0.66133803",
"0.6597601",
"0.6590676",
"0.6589514",
"0.6588968",
"0.65875655",
"0.6587456",
"0.65852785",
"0.6582814",
"0.6579744",
"0.65741235",
"0.6563399",
"0.65611506"
] | 0.0 | -1 |
Run the database seeds. | public function run()
{
DB::table('operacaos')->insert([
'nome' => 'Depósito',
]);
DB::table('operacaos')->insert([
'nome' => 'Saque',
]);
} | {
"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' => 'simpleadressemail@mail.com', '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'=> \"admin@admin.com\"\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' => 'admin@petstore.com',\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' => 'prosales@researchmobile.co',\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' => 'movil@researchmobile.co',\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'=>'test@yandex.ru'\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' => 'admin@yahoo.com',\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' => 'programmerlemar@gmail.com',\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' => 'qwerty@gmail.com',\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=> 'admin@example.com',\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' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\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' => 'admin@admin.com',\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(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(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(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' => 'ignacio@dh.com',\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' => 'admin@gmail.com',\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\"=>'alice@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'bob@gmail.com',\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 = your.email@domain.com\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 // $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 // 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 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' => 'admin@gmail.com',\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'=>'papesambandour@hotmail.com',\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' => 'rognales@gmail.com',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => 'sonic21danger@gmail.com',\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' => 'sovon.kucse@gmail.com']);\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'=>'abada@gmail.com',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','abada@gmail.com')->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' => 'eddyjaair@gmail.com']);\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' => 'barbozagonzalesjose@gmail.com',\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' => 'russell@gmail.com',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => 'bitfumes@gmail.com',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => 'paul@gmail.com',\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' => 'pkw@pkw.com',\n 'password' => bcrypt('secret'),\n 'type' => '1'\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 // $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 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' => 'empresa02@gmail.com',\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' => 'carlos@email.com',\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'=>'izzanniroshlei@gmail.com',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'aina@gmail.com',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'sab@gmail.com',\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' => 'pedrito@juase.com',\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'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', '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.8014072",
"0.7980389",
"0.7977261",
"0.79545176",
"0.7951285",
"0.7949779",
"0.79447794",
"0.79427236",
"0.7938544",
"0.7937133",
"0.7933888",
"0.7892658",
"0.78813094",
"0.7879304",
"0.78790134",
"0.7875582",
"0.78718805",
"0.7870327",
"0.7851507",
"0.78506047",
"0.7841656",
"0.7834773",
"0.782799",
"0.7819246",
"0.7809116",
"0.7803176",
"0.7802559",
"0.7800953",
"0.7799208",
"0.77958846",
"0.77905864",
"0.7788729",
"0.7786444",
"0.7778857",
"0.7777666",
"0.7765372",
"0.77626014",
"0.7762562",
"0.77622634",
"0.77615577",
"0.7760895",
"0.77596897",
"0.7757152",
"0.7753893",
"0.77497184",
"0.77495176",
"0.77468747",
"0.77301675",
"0.77291715",
"0.772798",
"0.7716827",
"0.77145964",
"0.7714208",
"0.7713344",
"0.77125347",
"0.771253",
"0.7711237",
"0.77112275",
"0.77108705",
"0.7710304",
"0.7705747",
"0.77048707",
"0.770442",
"0.77041996",
"0.77028614",
"0.77021116",
"0.77008957",
"0.7698864",
"0.76987725",
"0.7697583",
"0.76966494",
"0.76945114",
"0.7692977",
"0.7691408",
"0.76907796",
"0.7688464",
"0.7687695",
"0.7686974",
"0.7686826",
"0.76851374",
"0.7684132",
"0.7679417",
"0.7678492",
"0.76778567",
"0.76769906",
"0.76728696",
"0.7671034",
"0.76692134",
"0.7668971",
"0.7668952",
"0.7666531",
"0.7662757",
"0.7662455",
"0.76616526",
"0.765996",
"0.7656754",
"0.765413",
"0.76537156",
"0.76526105",
"0.76523715",
"0.7652133"
] | 0.0 | -1 |
Getter for firewall's FQDN. | public function getHostname() {
return $this->hostname;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getFirewallName(): string;",
"public function getFIp()\n {\n return $this->f_ip;\n }",
"public function getFqdn(): string;",
"public function getFQN(): string\n {\n return DomainLocator::concatFQN($this->name, $this->parent);\n }",
"public function getFQN()\n {\n return $this->namespace.$this->name;\n }",
"public function get_domain(): string\n {\n return $this->domain;\n }",
"public function domain()\n {\n return isset($this->action['domain'])\n ? str_replace(['http://', 'https://'], '', $this->action['domain']) : null;\n }",
"function getFullyQualifiedHostName() {\n\t\treturn $this->getHostName() . '.' . $this->domain->getFullyQualifiedDomainName();\n\t}",
"public function getFloatedDomain() {\n\t\t\tif(!is_null($domain_floated = getRequest('domain'))) {\n\t\t\t\t$domain_floated = urldecode($domain_floated);\n\t\t\t\t$domain_floated_id = domainsCollection::getInstance()->getDomainId($domain_floated);\n\t\t\t\tif($domain_floated_id) {\n\t\t\t\t\treturn $domain_floated_id;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}",
"public function getDomain(): string\n {\n return $this->domain;\n }",
"public function getDomain(): string\n {\n return $this->domain;\n }",
"public function domain()\n {\n return $this->protocol() . \"://\" . $this->host();\n }",
"public function get_external_domain(): string;",
"public function getDomain(): string\r\n {\r\n return $this->domain;\r\n }",
"public function getDN()\n\t{\n\t\treturn $this->dn;\n\t}",
"public static function getHost(): ?string {\r\n return $_SERVER['HTTP_X_FORWARDED_HOST'] ?? $_SERVER['HTTP_HOST'] ?? null;\r\n }",
"public function getTargetFQCN()\n {\n return is_object($this->target) ? get_class($this->target) : (string) $this->target;\n }",
"public function getDomain(): ?string\n {\n return $this->sDomain;\n }",
"public function getNickname() {\n return $this->nickname;\n }",
"public function get_domain()\r\n\t\t{\r\n\t\t\treturn $_SERVER[ 'SERVER_NAME' ];\r\n\t\t}",
"public function getNickname(): string {\n return $this->nickname;\n }",
"public function getNickname()\n {\n return $this->attributes['nickname'] ?? null;\n }",
"public function getNickname()\n {\n return $this->nickname;\n }",
"public function getNickname()\n {\n return $this->nickname;\n }",
"public function getNickname()\n {\n return $this->nickname;\n }",
"public function getNickname()\n {\n return $this->nickname;\n }",
"public function getNickname()\n {\n return $this->nickname;\n }",
"public function getDnsOrigin()\n {\n return $this->getValue('nb_domain_zone_dns_origin');\n }",
"public function getDomain(): string {\n return $this->context->domain;\n }",
"public function getRemoteAddress()\n {\n return stream_socket_get_name($this->socket, true);\n }",
"public function getNickname()\n {\n return $this->_nickname;\n }",
"public function getFqName(){\n return $this->fq_u_name;\n }",
"public function getDomain()\n {\n return substr($this->email, strpos($this->email, '@'));\n }",
"public function getDomain(): string;",
"public function getRootDseDnsHostName()\n {\n return $this->getRootDse()->getDnsHostName();\n }",
"public function getHostname()\n {\n if (is_null($this->hostname)) {\n $server = provider::access('server');\n\n if ($server->isExist('HTTP_HOST') && $server->isValid('HTTP_HOST', validate::T_PRINTABLE)) {\n $this->hostname = $server->getValue('HTTP_HOST');\n }\n\n if ($this->hostname === false) {\n $this->hostname = '';\n }\n }\n\n return $this->hostname;\n }",
"public function getDomainName() {\n return self::DOMAIN_NAME;\n }",
"public function getDomain(){\n\t\treturn $_SERVER['SERVER_NAME'];\n\t}",
"public function getDomain(): string\n {\n $domain = php_uname('n');\n if ($this->from) {\n $email = $this->from[0];\n list(, $domain) = explode('@', $email);\n }\n\n return $domain;\n }",
"public function getDomain()\n {\n return Session::get(self::DOMAIN) ?? self::$domain;\n }",
"public function getBaseDn()\n {\n if (isset($this->url['base_dn']) === false) {\n return null;\n }\n\n return $this->url['base_dn'];\n }",
"public function getNickname(): ?string\n {\n return $this->_nickname;\n }",
"public function getDomain(): string\n {\n /** @var WebstoreHelper $webstoreHelper */\n $webstoreHelper = pluginApp(WebstoreHelper::class);\n\n return $webstoreHelper->getCurrentWebstoreConfiguration()->domainSsl;\n }",
"public static function domain()\n\t{\n\t\tif (isset($_SERVER['SERVER_NAME']) && isset($_SERVER['SERVER_PORT']))\n\t\t{\n\t\t\treturn $_SERVER['SERVER_NAME'] . ((integer) $_SERVER['SERVER_PORT'] === 80 ? '' : ':' . $_SERVER['SERVER_PORT']);\n\t\t}\n\n\t\treturn null;\n\t}",
"public function GetDnsValidation () {\n\t\treturn $this->dnsValidation;\n\t}",
"protected function getAdfsServer()\n {\n return config('services.Adfs.adfs_server');\n }",
"public static function proxyForwardedFor() {\n\t\tif (isset($_SERVER) && isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n\t\t\treturn $_SERVER['HTTP_X_FORWARDED_FOR'];\n\t\t}\n\n\t\treturn null;\n\t}",
"public static function hostNameDomain() {\n\t\tif (!isset($_SERVER['HTTP_HOST'])) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ($_SERVER['HTTP_HOST'] == $_SERVER['REMOTE_ADDR']) {\n\t\t\treturn $_SERVER['REMOTE_ADDR'];\n\t\t}\n\n\t\t$domain = explode('.', $_SERVER['HTTP_HOST']);\n\t\t$size = count($domain);\n\n\t\tif ($size <= 2) {\n\t\t\treturn $_SERVER['HTTP_HOST'];\n\t\t} else {\n\t\t\treturn \"{$domain[$size -2]}.{$domain[$size -1]}\";\n\t\t}\n\t}",
"public function getHost(): string\n {\n return $this->configuration[ConfigurationInterface::HOST];\n }",
"protected static function getFacadeAccessor(): string\n {\n return 'pdp.tld';\n }",
"public function getDomain()\n {\n return $this->domain;\n }",
"public function getDomain()\n {\n return $this->domain;\n }",
"public function getDomain()\n {\n return $this->domain;\n }",
"public function getDomain()\n {\n return $this->domain;\n }",
"public function getDomain()\n {\n return $this->domain;\n }",
"public function getDomain()\n {\n return $this->domain;\n }",
"public function getDomain()\n {\n return $this->domain;\n }",
"public function getDomain()\n {\n return $this->domain;\n }",
"public static function getUserHost()\n {\n return isset($_SERVER['REMOTE_HOST']) ? $_SERVER['REMOTE_HOST'] : isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : null;\n }",
"public function getDomainName()\n {\n return $this->_fields['DomainName']['FieldValue'];\n }",
"public function getDomain()\r\n {\r\n return $this->domain;\r\n }",
"public function getDomain()\n\t{\n\t\treturn substr(strrchr($this->email, \"@\"), 1);\n\t}",
"public function domainName()\n\t{\n\t\treturn isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'];\n\t}",
"public static function getDomain()\r\n\t{\r\n\t\t$port = $_SERVER['SERVER_PORT'];\r\n\t\t$port = ( $port == 80 ) ? '' : \":$port\";\r\n\t\treturn 'http://' . $_SERVER['SERVER_NAME']. \"$port/\";\r\n\t}",
"public function getHostname()\n {\n return $this->get(self::HOSTNAME);\n }",
"public static function hostName() {\n\t\t$siteUrl = Application::getConfig('application', 'site_url');\n\t\treturn substr($siteUrl, strpos($siteUrl, '//') +2);\n\t}",
"public function getHost()\n {\n return $this->decode($this->host);\n }",
"public function\n\tGetFullDomain():\n\t?String {\n\n\t\treturn $this->Domain;\n\t}",
"public function host() \n\t{\n\t\treturn $this->server( 'HTTP_X_FORWARDED_HOST', $this->server( 'HTTP_HOST', $this->server( 'SERVER_NAME' ) ) );\n\t}",
"public function base(): string|null\n\t{\n\t\tif ($domain = $this->domain()) {\n\t\t\treturn $this->scheme ? $this->scheme . '://' . $domain : $domain;\n\t\t}\n\n\t\treturn null;\n\t}",
"public function getDomain() {\n return $this->domain;\n }",
"public function getAddr() : string\n {\n return $this->addr;\n }",
"public static function getHost() {\n\t\tif(!isset(self::$host)) {\n\t\t\tif(self::$trust && isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {\n \tself::$host = $_SERVER['HTTP_X_FORWARDED_HOST'];\n \t} else if(isset($_SERVER['HTTP_HOST'])) {\n \tself::$host = $_SERVER['HTTP_HOST'];\n \t} else if(isset($_SERVER['SERVER_NAME'])) {\n \tself::$host = $_SERVER['SERVER_NAME'];\n \t}\n\t }\n\t return self::$host;\n\t}",
"public static function getRemoteAddr() {\n if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) AND $_SERVER['HTTP_X_FORWARDED_FOR'] AND ( !isset($_SERVER['REMOTE_ADDR']) OR preg_match('/^127\\..*/i', trim($_SERVER['REMOTE_ADDR'])) OR preg_match('/^172\\.16.*/i', trim($_SERVER['REMOTE_ADDR'])) OR preg_match('/^192\\.168\\.*/i', trim($_SERVER['REMOTE_ADDR'])) OR preg_match('/^10\\..*/i', trim($_SERVER['REMOTE_ADDR'])))) {\n if (strpos($_SERVER['HTTP_X_FORWARDED_FOR'], ',')) {\n $ips = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n return $ips[0];\n } else\n return $_SERVER['HTTP_X_FORWARDED_FOR'];\n }\n return $_SERVER['REMOTE_ADDR'];\n }",
"public function domain(): string|null\n\t{\n\t\tif (empty($this->host) === true || $this->host === '/') {\n\t\t\treturn null;\n\t\t}\n\n\t\t$auth = $this->auth();\n\t\t$domain = '';\n\n\t\tif ($auth !== null) {\n\t\t\t$domain .= $auth . '@';\n\t\t}\n\n\t\t$domain .= $this->host;\n\n\t\tif ($this->port !== null && in_array($this->port, [80, 443]) === false) {\n\t\t\t$domain .= ':' . $this->port;\n\t\t}\n\n\t\treturn $domain;\n\t}",
"public function getFallbackAddr()\n {\n return $this->fallback_addr;\n }",
"public function getIpv6(): string;",
"public function getDomain()\n {\n return $this->_domain;\n }",
"public function getForename() {\r\n return $this->forename;\r\n }",
"function getHostName() {\n\t\treturn $this->hostInfo[0]['dc'][0];\n\t}",
"public function remoteAddress(): ?string\n {\n $serverParams = $this->request()->getServerParams();\n\n return $serverParams['REMOTE_ADDR'] ?? null;\n }",
"public function getFullDomainAttribute()\n {\n return $this->attributes['full_domain'] = $this->attributes['subdomain'].'.'.DomainEnum::getDescription($this->attributes['domain_id']);\n }",
"public function getUserHost()\n {\n return isset($_SERVER['REMOTE_HOST']) ? $_SERVER['REMOTE_HOST'] : null;\n }",
"public function get_domain()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $this->_load_config();\n\n $domain = (empty($this->config['domain'])) ? '' : $this->config['domain'];\n\n if (empty($domain))\n $domain = $this->convert_domain();\n\n return $domain;\n }",
"static function obtenerDireccionIP() {\n if (isset($_SERVER[\"HTTP_CLIENT_IP\"])) {\n return $_SERVER[\"HTTP_CLIENT_IP\"];\n } elseif (isset($_SERVER[\"HTTP_X_FORWARDED_FOR\"])) {\n return $_SERVER[\"HTTP_X_FORWARDED_FOR\"];\n } elseif (isset($_SERVER[\"HTTP_X_FORWARDED\"])) {\n return $_SERVER[\"HTTP_X_FORWARDED\"];\n } elseif (isset($_SERVER[\"HTTP_FORWARDED_FOR\"])) {\n return $_SERVER[\"HTTP_FORWARDED_FOR\"];\n } elseif (isset($_SERVER[\"HTTP_FORWARDED\"])) {\n return $_SERVER[\"HTTP_FORWARDED\"];\n } else {\n return $_SERVER[\"REMOTE_ADDR\"];\n }\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 }",
"public function getFsSocial(): ?string {\n return $this->fsSocial;\n }",
"public function get_dest_msisdns()\n {\n return $this->dest_msisdns;\n }",
"public function getDomain()\n {\n $hostParts = explode('.', $this->getHost());\n array_shift($hostParts);\n\n return implode('.', $hostParts);\n }",
"public function hostname() {\n $host = $this->client(\"origin\")?? $this->client(\"host\")?? $this->uri(\"host\");\n $host = parse_url($host);\n\n return $host[\"host\"]?? $host[\"path\"];\n }",
"public function getEndpointDomain()\n {\n return $this->endpoint_domain;\n }",
"public static function only_ff_host() \n {\n return $_SESSION['_user_vision']['host_where_ff'];\n }",
"public function getCustomNetHost() {\n return (string) $this->getValue('customnethost');\n }",
"public function getHost()\n {\n $host = $this->getHostname();\n\n return sprintf('http%s://%s', ($this->isSSL() ? 's' : ''), $host);\n }",
"public function getAdresseServeur() {\n $ad = (@$_SERVER['SERVER_ADDR'] == '::1') ? \"localhost\" : @$_SERVER['SERVER_ADDR'];\n\n return $ad;\n }",
"private static function _getConfig()\n\t{\n\t\treturn \\Config::get('app.fqdn', '');\n\t}",
"public function getHostname()\n {\n return $this->hostname;\n }",
"public function getHostname()\n {\n return $this->hostname;\n }",
"public function getHostname()\n {\n return $this->hostname;\n }",
"public function __toString()\n {\n $domain = '';\n $domain .= $this->scheme ? $this->scheme . '://' : '';\n $domain .= $this->hostname;\n if ($this->port !== null) {\n switch ($this->scheme) {\n case 'http':\n $domain .= ($this->port !== 80 ? ':' . $this->port : '');\n break;\n case 'https':\n $domain .= ($this->port !== 443 ? ':' . $this->port : '');\n break;\n default:\n $domain .= (isset($this->port) ? ':' . $this->port : '');\n }\n }\n return $domain;\n }",
"public function getAddress() : string\n {\n return $_SERVER[\"REMOTE_ADDR\"] ?? \"\";\n }"
] | [
"0.70161164",
"0.6217314",
"0.62065583",
"0.61110544",
"0.603489",
"0.5859223",
"0.5835207",
"0.58127993",
"0.5787254",
"0.57771677",
"0.57771677",
"0.57706726",
"0.5757147",
"0.5746668",
"0.57421577",
"0.5735328",
"0.5722173",
"0.5700741",
"0.56621677",
"0.56438243",
"0.56378096",
"0.56368273",
"0.56355476",
"0.56355476",
"0.56355476",
"0.56355476",
"0.56355476",
"0.56331307",
"0.56229496",
"0.5620584",
"0.55883896",
"0.55859333",
"0.55665606",
"0.55590683",
"0.5556048",
"0.55452764",
"0.55344945",
"0.5495327",
"0.5493231",
"0.54881185",
"0.5482694",
"0.5477394",
"0.5475047",
"0.5468749",
"0.5448459",
"0.5445645",
"0.5434196",
"0.5417197",
"0.5416984",
"0.54096806",
"0.54043114",
"0.54043114",
"0.54043114",
"0.54043114",
"0.54043114",
"0.54043114",
"0.54043114",
"0.54043114",
"0.5398545",
"0.53837335",
"0.5378865",
"0.537635",
"0.5376148",
"0.53731763",
"0.5361771",
"0.53591764",
"0.53579575",
"0.5354257",
"0.5353565",
"0.53459203",
"0.5340471",
"0.5336781",
"0.5333326",
"0.53269565",
"0.5321976",
"0.531704",
"0.531339",
"0.53095907",
"0.5309399",
"0.5307744",
"0.5307249",
"0.5292715",
"0.52921027",
"0.528838",
"0.5279452",
"0.5267552",
"0.5265476",
"0.52634037",
"0.5262481",
"0.5257145",
"0.5256833",
"0.5245739",
"0.52453554",
"0.5240804",
"0.52308995",
"0.52159065",
"0.5209921",
"0.5209921",
"0.5209921",
"0.5206141",
"0.52025723"
] | 0.0 | -1 |
Getter for API autorized user. | public function getUsername() {
return $this->username;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getApiUser()\n {\n return $this->security->getToken()->getUser()->getUser();\n }",
"function get_user()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_USER);\r\n }",
"function get_user()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_USER);\r\n }",
"public function get_user() {\r\n\t\treturn ($this->user);\r\n\t}",
"public function get_user() {\n\t\treturn $this->user;\n\t}",
"public function getAuthenticatedUser()\n {\n // get the web-user\n $user = Auth::guard()->user();\n\n // get the api-user\n if(!isset($user) && $user == null) {\n $user = Auth::guard('api')->user();\n }\n return $user;\n }",
"public function getApiUser()\n {\n return Mage::getStoreConfig('magebridge/settings/api_user');\n }",
"public function getUser()\n {\n return $this->get(self::_USER);\n }",
"public function getUser()\n {\n return $this->get(self::_USER);\n }",
"public function getUser()\n {\n return $this->get(self::_USER);\n }",
"public function getUser()\n {\n return $this->get(self::_USER);\n }",
"public function user()\n {\n return $this->authUserService__();\n }",
"public function getAuthenticatedUser()\n {\n return $this->getUnsplashClient()->sendRequest('GET', 'me');\n }",
"protected function getUser()\n {\n return $this->user_provider->getHydratedUser();\n }",
"public static function getUser()\n {\n return self::getInstance()->_getUser();\n }",
"public function getAuthenticatedUser()\n {\n return response()->json($this->guard('api')->user());\n }",
"public function getUser() {\n\t\treturn $this->api->getUserById($this->getUserId());\n\t}",
"protected function _user() {\n return $this->_adapter_user->user();\n }",
"protected function getUser()\n {\n return $this->user;\n }",
"function get_user () {\n\t\treturn $this->user_id;\n\t}",
"public function user()\n {\n return $this->app->auth->user();\n }",
"public function user()\n {\n return $this->app->auth->user();\n }",
"public function fetchUser() {\n return $this->QueryAPI(\"current_user\");\n }",
"public function user()\n {\n return $this->auth->user();\n }",
"public function getAuthUserDetail()\n {\n return $this->user;\n }",
"public function user()\n {\n return call_user_func($this->getUserResolver());\n }",
"public function user()\n {\n return $this->user;\n }",
"public function user()\n {\n return $this->user;\n }",
"public function user() { return $this->user; }",
"private function getUser()\n {\n return $this->user->getUser();\n }",
"function getUser() {\n return user_load($this->uid);\n }",
"public function getUser() {\n\t\treturn User::newFromName( $this->params['user'], false );\n\t}",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\r\n {\r\n return $this->user;\r\n }",
"public final function getUser()\n {\n return $this->user;\n }",
"public function getUser() {\r\n return $this->user;\r\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser()\n {\n return $this->user;\n }",
"public function getUser ()\r\n\t{\r\n\t\treturn $this->user;\r\n\t}",
"protected function getUser()\n {\n return $this->loadUser(array(\n 'user_name' => $this->context['admin'],\n ));\n }",
"public function getUser();",
"public function getUser();",
"public function getUser();",
"public function getUser();",
"public function getUser();",
"public function getUser();",
"public function getUser();",
"public function user()\n {\n return $this->request('get', '/api/user');\n }",
"public function getUser() {\n return $this->user;\n }",
"public function getUser() {\n return $this->user;\n }",
"public function getUser() {\n return $this->user;\n }",
"public function getUser() {\n return $this->user;\n }",
"public function user()\n {\n return $this->response_json($this->guard()->user());\n }",
"public function getUser() {\n\t\treturn $this->user;\n\t}",
"public function getUser() {\n\t\treturn $this->user;\n\t}",
"public function getUser()\n {\n return $this->_user;\n }",
"protected function getAuthUser () {\n return Auth::user();\n }",
"public function getUser()\n {\n RETURN $this->user;\n }",
"public function user()\n {\n\n //Check if the user exists\n if (! is_null($this->user)) {\n return $this->user;\n }\n\n //Retrieve token from request and authenticate\n return $this->getTokenForRequest();\n }",
"public static function user ()\n {\n return self::$user;\n }",
"public function getUser()\n {\n $attributes = $this->getUserAttributes();\n\n // Try to load user by ldap id attribute\n if ($this->idAttribute !== null && isset($attributes['authclient_id'])) {\n $user = User::findOne(['authclient_id' => $attributes['authclient_id'], 'auth_mode' => $this->getId()]);\n if ($user !== null) {\n return $user;\n }\n }\n\n return $this->getUserAuto();\n }",
"public function user()\n {\n if (!$this->user) {\n $identifier = $this->getToken();\n $this->user = $this->provider->retrieveByToken($identifier, '');\n }\n return $this->user;\n }",
"public function user() {\n\t\tif ( ! is_null($this->user)) return $this->user;\n\t\treturn $this->user = $this->retrieve($this->token);\n\t}",
"public function user()\n {\n if (!is_null($this->user)) {\n return $this->user;\n }\n $user = null;\n try {\n $resourceId = Authorizer::getResourceOwnerId();\n $resourceType = Authorizer::getResourceOwnerType();\n } catch (\\Exception $e) {\n $resourceId = null;\n $resourceType = null;\n // throw $e;\n }\n if ($resourceType !== $this->id) {\n return null;\n }\n if (!empty($resourceId)) {\n $user = $this->getProvider()->retrieveById($resourceId);\n }\n return $this->user = $user;\n\n }",
"public function getBackendUser() {}",
"public function getUser()\n {\n return $this->_user;\n }",
"public function getUser() {}",
"public function getUser( ) {\n\t\treturn $this->user;\n\t}",
"public function getUser( ) {\n\t\treturn $this->user;\n\t}",
"public function user() {\n\t\tif (!Auth::check()) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn Auth::getUser();\n\t}",
"function getUser() \n {\n\t\t\treturn $this->user;\n\t\t}",
"public function user()\n {\n return $this->app->auth->guard('admin')->user();\n }",
"public static function getUser();",
"protected function user(): User|Authenticatable\n {\n return Auth::guard('api')->user();\n }"
] | [
"0.8063729",
"0.7763377",
"0.7763377",
"0.7711069",
"0.7705783",
"0.7589543",
"0.75548947",
"0.75350547",
"0.75350547",
"0.75350547",
"0.75350547",
"0.75303143",
"0.751932",
"0.7509684",
"0.7477085",
"0.7456816",
"0.74527943",
"0.7448125",
"0.74176306",
"0.74174875",
"0.7417387",
"0.7417387",
"0.74154764",
"0.73896503",
"0.73868775",
"0.73597014",
"0.73550206",
"0.73550206",
"0.7350344",
"0.7348021",
"0.73456675",
"0.7335073",
"0.7335002",
"0.7335002",
"0.7335002",
"0.7328352",
"0.7317967",
"0.73173803",
"0.7316126",
"0.7316126",
"0.7316126",
"0.7316126",
"0.7316126",
"0.7316126",
"0.7316126",
"0.7316126",
"0.7316126",
"0.7316126",
"0.7316126",
"0.7316126",
"0.7316126",
"0.7316126",
"0.7316126",
"0.7316126",
"0.7316126",
"0.7316126",
"0.7316126",
"0.7316126",
"0.7316126",
"0.7316126",
"0.7316126",
"0.7316126",
"0.7316126",
"0.7316126",
"0.7316126",
"0.73102003",
"0.7308125",
"0.7306346",
"0.7306346",
"0.7306346",
"0.7306346",
"0.7306346",
"0.7306346",
"0.7306346",
"0.7300523",
"0.7300066",
"0.7300066",
"0.7300066",
"0.7300066",
"0.72932035",
"0.72706026",
"0.72706026",
"0.72682303",
"0.7268158",
"0.72658134",
"0.7263371",
"0.7262443",
"0.7254771",
"0.72535676",
"0.72492677",
"0.7245212",
"0.723176",
"0.72228086",
"0.72177327",
"0.721643",
"0.721643",
"0.7211839",
"0.7205879",
"0.7193084",
"0.7182137",
"0.7180858"
] | 0.0 | -1 |
Getter for API autorized user's password. | public function getPassword() {
return $this->password;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPassword() {\n return $this->get('password', 'user');\n }",
"public function getAuthPassword()\n {\n return $this->user_pass;\n }",
"public function getAuthPassword()\n {\n return $this->user_pass;\n }",
"public function getUserPassword()\n {\n return $this->user_password;\n }",
"private function getPassword()\n {\n return $this->user->getPassword();\n }",
"public function getPassword()\n {\n return $this->getUserPassword();\n }",
"public function getAuthPassword()\n\t{\n\t\treturn $this->user_password;\n\t}",
"public function getPassword()\n {\n return $this->Password_user;\n }",
"public function getAuthPassword() {\r\n return $this -> password;\r\n }",
"public function getAuthPassword()\n {\n \treturn $this->getGuarded('password');\n }",
"public function getAuthPassword()\n {\n return $this->getPassword();\n }",
"public function getAuthPassword()\n {\n return $this->password;\n }",
"public function getPassword() {\n return $this->getValue('password');\n }",
"public function getAuthPassword()\n {\n return $this->password;\n }",
"public function getAuthPassword()\n {\n return $this->password;\n }",
"public function getAuthPassword()\n {\n return $this->password;\n }",
"public function getAuthPassword()\n {\n return $this->password;\n }",
"public function getAuthPassword()\n {\n return $this->password;\n }",
"public function getAuthPassword()\n {\n return $this->password;\n }",
"public function getAuthPassword()\n {\n return $this->password;\n }",
"public function getAuthPassword()\n {\n return $this->password;\n }",
"public function getAuthPassword()\n {\n return $this->password;\n }",
"public function getAuthPassword()\n {\n return $this->password;\n }",
"public function getAuthPassword()\n {\n return $this->password;\n }",
"public function getAuthPassword()\n {\n return $this->password;\n }",
"public function getAuthPassword()\n {\n return $this->password;\n }",
"public function getAuthPassword()\n {\n return $this->password;\n }",
"public function getAuthPassword() {\n return $this->password;\n }",
"public function getAuthPassword() {\n\t\treturn $this -> password;\n\t}",
"public function getAuthPassword() {\n return $this->password;\n }",
"public function getAuthPassword() {\n return $this->password;\n }",
"public function getAuthPassword()\n {\n return $this->password;\n }",
"public function getAuthPassword(){\n return $this->password;\n }",
"public function getAuthPassword(){\n return $this->password;\n }",
"public function getAuthPassword()\n {\n }",
"public function getAuthPassword()\n {\n }",
"public function getAuthPassword()\n {\n }",
"public function getAuthPassword()\n\t{\n\t\treturn $this->password;\n\t}",
"public function getAuthPassword()\n\t{\n\t\treturn $this->password;\n\t}",
"public function getAuthPassword()\n\t{\n\t\treturn $this->password;\n\t}",
"public function getAuthPassword()\n\t{\n\t\treturn $this->password;\n\t}",
"public function getAuthPassword()\n\t{\n\t\treturn $this->password;\n\t}",
"public function getAuthPassword()\n\t{\n\t\treturn $this->password;\n\t}",
"public function getAuthPassword()\n\t{\n\t\treturn $this->password;\n\t}",
"public function getAuthPassword()\n\t{\n\t\treturn $this->password;\n\t}",
"public function getAuthPassword()\n\t{\n\t\treturn $this->password;\n\t}",
"public function getAuthPassword()\n\t{\n\t\treturn $this->password;\n\t}",
"public function getAuthPassword()\n\t{\n\t\treturn $this->password;\n\t}",
"public function getAuthPassword()\n\t{\n\t\treturn $this->password;\n\t}",
"public function getAuthPassword()\n\t{\n\t\treturn $this->password;\n\t}",
"public function getAuthPassword()\n\t{\n\t\treturn $this->password;\n\t}",
"public function getAuthPassword()\n\t{\n\t\treturn $this->password;\n\t}",
"public function getAuthPassword()\n\t{\n\t\treturn $this->password;\n\t}",
"public function getAuthPassword()\n\t{\n\t\treturn $this->password;\n\t}",
"public function getAuthPassword()\n\t{\n\t\treturn $this->password;\n\t}",
"public function getAuthPassword()\n\t{\n\t\treturn $this->password;\n\t}",
"public function getAuthPassword()\n\t{\n\t\treturn $this->password;\n\t}",
"public function getAuthPassword()\n\t{\n\t\treturn $this->password;\n\t}",
"public function getAuthPassword()\n\t{\n\t\treturn $this->password;\n\t}",
"public function getAuthPassword()\n\t{\n\t\treturn $this->password;\n\t}",
"public function getAuthPassword()\n\t{\n\t\treturn $this->password;\n\t}",
"public function getAuthPassword()\n {\n // TODO: Implement getAuthPassword() method.\n return $this->password;\n }",
"public function getPassword() {}",
"public function getAuthPassword() {\n return $this->bcrypt_password;\n }",
"public function getPassword()\n {\n return $this->userData[$this->passwordField];\n }",
"private function getPassword()\n {\n return $this->password;\n }",
"public function getPassword()\n {\n return $this->__get(\"password\");\n }",
"public function getAuthPassword()\n {\n // TODO: Implement getAuthPassword() method.\n }",
"public function getAuthPassword()\n\t{\n\t return $this->password;\n\t}",
"public function getPassword(): string\n {\n return $this->password;\n }",
"public function get_password()\n {\n return $this->_password;\n }",
"public function get_password()\n {\n return $this->_password;\n }",
"public function getPassword()\n {\n return $this->password;\n }",
"public function getPassword()\n {\n return $this->password;\n }",
"function getPassword() {\n return $this->password;\n }",
"function getPassword() {\n return $this->password;\n }",
"public function getAuthPassword()\n\t{\n\t\treturn $this->pass;\n\t}",
"public function getAuthPassword() {\n return $this -> GP_PASSWORD;\n //return Hash::make($this -> GP_PASSWORD);\n }",
"private function getPassword(): string {\n return $this->password;\n }",
"public function getPassword()\n {\n return $this->password;\n }",
"public function getPassword()\n {\n return $this->password;\n }",
"public function getPassword()\n {\n return $this->password;\n }",
"public function getPassword()\n {\n return $this->password;\n }",
"public function getPassword()\n {\n return $this->password;\n }",
"public function getPassword()\n {\n return $this->password;\n }",
"public function getPassword()\n {\n return $this->password;\n }",
"public function getPassword()\n {\n return $this->password;\n }",
"public function getPassword()\n {\n return $this->password;\n }",
"public function getPassword()\n {\n return $this->password;\n }",
"public function getPassword()\n {\n return $this->password;\n }",
"public function getPassword()\n {\n return $this->password;\n }",
"public function getPassword()\n {\n return $this->password;\n }",
"public function getPassword()\n {\n return $this->password;\n }",
"public function getPassword()\n {\n return $this->password;\n }",
"public function getPassword()\n {\n return $this->password;\n }",
"public function getPassword()\n {\n return $this->password;\n }",
"public function getPassword()\n {\n return $this->password;\n }",
"public function getPassword()\n {\n return $this->password;\n }",
"public function getPassword()\n {\n return $this->password;\n }",
"public function getPassword()\n {\n return $this->password;\n }",
"public function getPassword()\n {\n return $this->password;\n }"
] | [
"0.8484643",
"0.8447342",
"0.8447342",
"0.8426809",
"0.83746016",
"0.83532757",
"0.8346173",
"0.8312889",
"0.82929105",
"0.82579833",
"0.8250493",
"0.8244037",
"0.8234663",
"0.8226177",
"0.8226177",
"0.8226177",
"0.8226177",
"0.8226177",
"0.8226177",
"0.8226177",
"0.8226177",
"0.8226177",
"0.8226177",
"0.8226177",
"0.8226177",
"0.8226177",
"0.8226177",
"0.82195604",
"0.81639075",
"0.8153632",
"0.8153632",
"0.81395024",
"0.81009454",
"0.81009454",
"0.8098056",
"0.8098056",
"0.8098056",
"0.8097643",
"0.8097643",
"0.8097643",
"0.8097643",
"0.8097643",
"0.8097643",
"0.8097643",
"0.8097643",
"0.8097643",
"0.8097643",
"0.8097643",
"0.8097643",
"0.8097643",
"0.8097643",
"0.8097643",
"0.8097643",
"0.8097643",
"0.8097643",
"0.8097643",
"0.8097643",
"0.8097643",
"0.8097643",
"0.8097643",
"0.8097643",
"0.8095207",
"0.80926955",
"0.8092333",
"0.8083056",
"0.80730927",
"0.80567575",
"0.8048259",
"0.80459875",
"0.8012756",
"0.8001648",
"0.8001648",
"0.79960555",
"0.79960555",
"0.79951227",
"0.79951227",
"0.7980907",
"0.7972412",
"0.79593897",
"0.79591525",
"0.79591525",
"0.79591525",
"0.79591525",
"0.79591525",
"0.79591525",
"0.79591525",
"0.79591525",
"0.79591525",
"0.79591525",
"0.79591525",
"0.79591525",
"0.79591525",
"0.79591525",
"0.79591525",
"0.79591525",
"0.79591525",
"0.79591525",
"0.79591525",
"0.79591525",
"0.79591525",
"0.79591525"
] | 0.0 | -1 |
Setter for curl's timeout in ms. | public function setTimeout(int $timeout) {
$this->timeout = $timeout;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setTimeout($timeout){\n curl_setopt($this->ch, CURLOPT_TIMEOUT_MS, $timeout);\n curl_setopt($this->ch, CURLOPT_CONNECTTIMEOUT_MS, $timeout);\n }",
"public function setTimeout($timeout) {\n\t\t\tcurl_setopt($this->_curl, CURLOPT_TIMEOUT, $timeout);\n\t\t}",
"public function getCurlTimeout()\n {\n return $this->curlTimeout;\n }",
"public function getCurlTimeout()\n {\n return $this->curlTimeout;\n }",
"public function getCurlTimeout() {\n return $this->curlTimeout;\n }",
"public function set_timeout($timeout)\n {\n // Sanitize the timeout, and save to instance.\n \n $this->timeout = (int)$timeout;\n }",
"public function setCurlTimeout($seconds)\n {\n if (!is_numeric($seconds) || $seconds < 0) {\n throw new \\InvalidArgumentException('Timeout value must be numeric and a non-negative number.');\n }\n\n $this->curlTimeout = $seconds;\n return $this;\n }",
"public function setCurlTimeout($seconds)\n {\n if (!is_numeric($seconds) || $seconds < 0) {\n throw new \\InvalidArgumentException('Timeout value must be numeric and a non-negative number.');\n }\n\n $this->curlTimeout = $seconds;\n return $this;\n }",
"public function setCurlTimeout($seconds) {\n if (!is_numeric($seconds) || $seconds < 0) {\n throw new \\coding_exception('Timeout value must be numeric and a non-negative number.');\n }\n\n $this->curlTimeout = $seconds;\n return $this;\n }",
"public function timeout()\n {\n return 300;\n }",
"public function setConnectionTimeout($timeout);",
"public function getCurlConnectTimeout()\n {\n return $this->curlConnectTimeout;\n }",
"function setRequestTimeout($value)\n {\n $this->_props['RequestTimeout'] = $value;\n }",
"public function set_timeout($timeout = 10)\n {\n }",
"public function setTimeout($timeout = null)\r\n {\r\n if ($timeout === null) {\r\n $timeout = 30000;\r\n }\r\n if (!is_int($timeout)) {\r\n throw new \\InvalidArgumentException('Parameter is not an integer');\r\n }\r\n if ($timeout < 0) {\r\n throw new \\InvalidArgumentException('Parameter is negative. Only positive timeouts accepted.');\r\n }\r\n\r\n $this->timeout = $timeout;\r\n return $this;\r\n }",
"function setTimeout($timeout = 0) {\r\n\t\tif ( !is_int($timeout) || ($timeout < 0) ) {\r\n\t\t\tthrow new ftpException('Timeout '.$timeout.' is invalid, has to be an integer >= 0');\r\n\t\t}\r\n\t\t$this->getOptionsSet()->setOptions(array(self::OPTION_TIMEOUT => $timeout));\r\n\t\tif ( isset($this->_handle) && is_resource($this->_handle) ) {\r\n\t\t\t$res = @ftp_set_option($this->_handle, FTP_TIMEOUT_SEC, $timeout);\r\n\t\t} else {\r\n\t\t\t$res = true;\r\n\t\t}\r\n\t\tif ( !$res ) {\r\n\t\t\tthrow new ftpException(\"Set timeout failed.\");\r\n\t\t}\r\n\t\treturn $this;\r\n\t}",
"public function setTimeout(int $timeout): self\n {\n $this->options['timeout'] = $timeout;\n return $this;\n }",
"public function setTimeout(int $timeout): self\n {\n $this->options['timeout'] = $timeout;\n return $this;\n }",
"public function setTimeout($timeout)\n {\n $this->timeout = $timeout;\n }",
"public function setTimeout($timeout)\n {\n $this->requestTimeout = intval($timeout);\n return $this;\n }",
"public function setTimeout($timeout)\n {\n static::$timeout = $timeout;\n }",
"public function timeout($timeout);",
"public function setTimeOut($timeout){\n\t\t$this->_timeout = $timeout;\n\t\t$this->setMessage(\"Setting time out: \".$this->_timeout);\n\t}",
"function set_timeout($timeout) {\n if (!is_integer($timeout)) {\n if (is_numeric($timeout)) {\n $this->timeout = (integer($timeout));\n return true;\n }\n return false;\n }\n $this->timeout = $timeout;\n return true;\n }",
"public function setTimeout($timeout)\n {\n $this->_param['timeout'] = (int)$timeout;\n return $this;\n }",
"public function setTimeout( $timeout )\n\t{\n\t\t$this->config['timeout'] = $timeout;\n\t}",
"public function timeout(): int\n {\n return $this->timeout;\n }",
"public function setTimeout($timeout)\n\t{\n\t\t$this->timeout = (int)$timeout;\n\t\treturn $this;\n\t}",
"public function setTimeout( $timeout ) {\n $this->_timeout = $timeout;\n return $this;\n }",
"public function setTimeout(int $timeout)\n {\n $this->timeout = $timeout;\n return $this;\n }",
"public function setTimeout($nTimeout){\n\t\t\tself::$timeout = $nTimeout;\n\t\t}",
"public function setTimeout($timeout)\n {\n $this->timeout = (int) $timeout;\n\n return $this;\n }",
"public function setConnectTimeoutMs(int $timeout): void;",
"public function setReadTimeout(float $timeout): void\n {\n }",
"public function setConnectTimeout($seconds) {\n\t\t$this->connectionTimeout = $seconds;\n\t\t$this->curl->setConnectTimeout($seconds);\n\t}",
"public function testSetTimeout()\n {\n $container = [];\n $handler = $this->getMockHandler([new Response(200), new Response(200), new Response(200)], $container);\n $client = new Client(\n [\n 'base_uri' => 'http://example.org',\n 'handler' => $handler,\n ]\n );\n\n $this->assertArrayHasKey('timeout', $client->getConfig());\n $this->assertEquals(Client::DEFAULT_REQUEST_TIMEOUT, $client->getConfig('timeout'));\n\n $client->setAuth('test', 'test', 'test');\n\n $client->get('/test', ['timeout' => 2]);\n $this->assertEquals(2, end($container)['options']['timeout']);\n\n $this->assertEquals(Client::DEFAULT_REQUEST_TIMEOUT, $client->getConfig('timeout'));\n \n $client->setTimeout(5);\n $client->get('/test');\n \n $this->assertEquals(Client::DEFAULT_REQUEST_TIMEOUT, $client->getConfig('timeout'));\n $this->assertEquals(5, end($container)['options']['timeout']);\n\n $client->get('/test', ['timeout' => 2]);\n $this->assertEquals(2, end($container)['options']['timeout']);\n }",
"public function getTimeout() {\r\n return $this->timeout;\r\n }",
"public function setTimeout($timeout)\n {\n $timeout = (float) $timeout;\n if ($timeout) {\n $this->timeout = $timeout;\n }\n return $this;\n }",
"public function getTimeout(): int\n {\n return $this->timeout;\n }",
"function Timeout ( $nTimeout )\n{\n if ( isset($nTimeout) ) {\n $this->_Timeout = ($nTimeout < 5) ? 5 : (int)$nTimeout;\n return true;\n } else {\n return $this->_Timeout;\n }\n}",
"function setTimeOut($timeout=60){\n $this->platform->setTimeOut($timeout);\n }",
"public function setTimeout($timeout)\n {\n $this->getHttpClient()->setTimeout($timeout);\n return $this;\n }",
"public function setTimeout(int $timeout)\n {\n $this->_timeout = $timeout;\n\n return $this;\n }",
"public function timeout($ms);",
"public function setConnectionTimeout($timeout)\n {\n // do nothing\n }",
"public function setAttackTimeout($value)\n {\n return $this->set(self::_ATTACK_TIMEOUT, $value);\n }",
"public function getTimeout()\n {\n return $this->timeout;\n }",
"public function getTimeout() {\r\n\t\treturn $this->timeout;\r\n\t}",
"public function setCurlConnectTimeout($seconds)\n {\n if (!is_numeric($seconds) || $seconds < 0) {\n throw new \\InvalidArgumentException('Connect timeout value must be numeric and a non-negative number.');\n }\n\n $this->curlConnectTimeout = $seconds;\n return $this;\n }",
"public function http_timeout( $req ) {\n\t\t$req['timeout'] = 300;\n\t\treturn $req;\n\t}",
"public function setTimeout($timeout)\n {\n $this->provider->timeout = $timeout;\n }",
"public function getTimeout()\n {\n return $this->timeout;\n }",
"public function getTimeout()\n {\n return $this->timeout;\n }",
"public function getTimeout()\n {\n return $this->timeout;\n }",
"public function getTimeout()\n {\n return $this->timeout;\n }",
"public function getTimeout()\n {\n return $this->timeout;\n }",
"public function setRequestTimeOut($requestTimeOut) {\n $this->requestTimeOut = $requestTimeOut;\n }",
"public function setTimeOut($timeOut)\n {\n self::$timeOut = $timeOut;\n }",
"public function setTimeout($timeout)\n {\n if (0 > $timeout) {\n throw new InvalidArgumentException('Timeout must be a positive value');\n }\n\n $this->timeout = $timeout;\n\n return $this;\n }",
"public function setTimeout($value)\n {\n return $this->set('Timeout', $value);\n }",
"public function getTimeout()\n {\n return $this->Timeout;\n }",
"public function timeout()\n\t{\n\t\treturn $this->timeout;\n\t}",
"public function setTimeout($secs)\n {\n $this->timeout = (int)$secs;\n }",
"public function getTimeout()\n {\n return self::$timeout;\n }",
"public function setTimeout($timeout);",
"public function setTimeOut($seconds)\r\n {\r\n $this->timeout = $seconds;\r\n }",
"public function getTimeout() {\n return $this->_timeout;\n }",
"public function setTimeout($connect, $timeout = null)\n {\n if (!$timeout) {\n $timeout = $connect;\n }\n\n $this->optionManager->set(['CONNECTTIMEOUT' => $connect, 'TIMEOUT' => $timeout]);\n\n return $this;\n }",
"public function setTimeoutMs(int $timeout): void;",
"public function setTimeOut($timeOut)\n {\n $this->timeOut = $this->limitLength($timeOut, 10);\n return $this;\n }",
"public function getTimeout()\n {\n return $this->getHttpClient()->getTimeout();\n }",
"public function getTimeout()\n\t{\n\t\treturn $this->timeout;\n\t}",
"public function setRpcTimeout(float $timeout): void\n {\n }",
"public function setSessionTimeout($timeout)\n {\n $this->sessionTimeout = abs($timeout);\n }",
"public function setTimeout($var)\n {\n GPBUtil::checkInt32($var);\n $this->Timeout = $var;\n\n return $this;\n }",
"public function timeout();",
"public function setReadTimeout(float $timeout): void\n {\n $this->readTimeout = $this->validateTimeoutValue($timeout);\n }",
"public function getTimeout()\n {\n return $this->_timeout;\n }",
"public function getTimeout()\n {\n return $this->_timeout;\n }",
"public function setTimeout($timeout)\n {\n if ( ! is_numeric($timeout) || $timeout < 0) {\n throw new \\InvalidArgumentException(\n 'Invalid timeout provided to Command::setTimeout.'\n );\n }\n\n $this->timeout = 1000000 * $timeout;\n\n return $this;\n }",
"function _SetTimeout() \r\n{ \r\n//** if a connection is available set the socket timeout. Get the number of \r\n//** seconds and microseconds form the instance 'Timeout' property. \r\n\r\nif($this->isOpen()) \r\n{ \r\nstream_set_timeout($this->Socket, intval($this->Timeout / 1000), \r\nintval(($this->Timeout % 1000) * 1000)); \r\n} \r\n}",
"public function __construct($timeout = null) {\n $this->timeout = $timeout;\n }",
"public function setTimeout($timeout)\n {\n if (0 > $timeout) {\n /**\n * @uses Parsonline_Exception_ValueException\n */\n require_once('Parsonline/Exception/ValueException.php');\n throw new Parsonline_Exception_ValueException(\"SSH stream data transfere timeout should not be negative\");\n }\n $this->_timeout = intval($timeout);\n return $this;\n }",
"public function setCallTimeout(int $callTimeout): self\n {\n $this->options['callTimeout'] = $callTimeout;\n return $this;\n }",
"public function setTimeout($var)\n {\n GPBUtil::checkUint32($var);\n $this->timeout = $var;\n\n return $this;\n }",
"public function setConnectTimeout($seconds);",
"public function setTimeout($value)\n {\n return $this->set(self::_TIMEOUT, $value);\n }",
"public function testTimeoutOption()\n {\n $container = [];\n $handler = $this->getMockHandler([new Response(200), new Response(200)], $container);\n\n $client = new Client(\n [\n 'base_uri' => 'http://example.org',\n 'handler' => $handler,\n 'timeout' => 2\n ]\n );\n\n $this->assertArrayHasKey('timeout', $client->getConfig());\n $this->assertEquals(2, $client->getConfig('timeout'));\n\n $client->setAuth('test', 'test', 'test');\n\n $client->get('/test');\n $this->assertEquals(2, end($container)['options']['timeout']);\n \n $client->get('/test', ['timeout' => 5]);\n $this->assertEquals(5, end($container)['options']['timeout']);\n }",
"public function getTimeout()\n {\n return isset($this->timeout) ? $this->timeout : 0;\n }",
"function getTimeoutOption() {\r\n\t\treturn $this->getOptionsSet()->getOptions(self::OPTION_TIMEOUT, 20);\r\n\t}",
"public function getTimeout();",
"public function getTimeout();",
"public function getTimeout();",
"public function getTimeout();",
"public function getTimeout();",
"public function getTimeout();",
"public function setConnTimeout($milliseconds) {\n if($milliseconds >= 1000 || $milliseconds <= 0) {\n throw new \\InvalidArgumentException(\"milliseconds must be < 1000 and > 0\");\n }\n\n $this->connTimeout = $milliseconds / 1000.0; // convert to float seconds\n }",
"public function setTimeout(int $timeout): void {}",
"protected function setStreamTimeout()\n {\n if(Configuration::getIsOnLoopEnabled()) {\n stream_set_timeout($this->getRemote(), 0, Configuration::getOnLoopXMicroseconds());\n } else {\n stream_set_timeout($this->getRemote(), Configuration::getOnLoopXMicroseconds());\n }\n }",
"public function setTimeout(float $timeout): void\n {\n }"
] | [
"0.7814167",
"0.7599739",
"0.74715817",
"0.74715817",
"0.74628955",
"0.7011938",
"0.6977306",
"0.6977306",
"0.6949746",
"0.6912299",
"0.6851381",
"0.68273747",
"0.6777008",
"0.67673594",
"0.6744462",
"0.668816",
"0.66812575",
"0.66812575",
"0.66635853",
"0.65858835",
"0.6571609",
"0.6518136",
"0.6493427",
"0.6493116",
"0.6487888",
"0.6457228",
"0.64166486",
"0.6412454",
"0.63717747",
"0.6359553",
"0.63585204",
"0.634862",
"0.6332704",
"0.6292468",
"0.6285866",
"0.6274488",
"0.62712246",
"0.62712115",
"0.6270762",
"0.6269912",
"0.62685966",
"0.62618345",
"0.6248891",
"0.62359834",
"0.6199875",
"0.61878407",
"0.6187613",
"0.6177488",
"0.61574894",
"0.6151201",
"0.61489964",
"0.6148645",
"0.6148645",
"0.6148645",
"0.6148645",
"0.6148645",
"0.61451936",
"0.61340165",
"0.6113141",
"0.61100936",
"0.6103294",
"0.6084392",
"0.60700375",
"0.6064454",
"0.6060421",
"0.60598093",
"0.60569775",
"0.60504085",
"0.6047148",
"0.60422856",
"0.60261416",
"0.60221756",
"0.6008869",
"0.60073394",
"0.60052645",
"0.6003823",
"0.59966826",
"0.5991906",
"0.5991906",
"0.59702593",
"0.5969564",
"0.59434897",
"0.59280485",
"0.5923765",
"0.5923535",
"0.589098",
"0.58845663",
"0.588224",
"0.5870576",
"0.5867279",
"0.58602214",
"0.58602214",
"0.58602214",
"0.58602214",
"0.58602214",
"0.58602214",
"0.58593976",
"0.5855929",
"0.58535916",
"0.5833543"
] | 0.63452166 | 32 |
Getter for curl's timeout in ms. | public function getTimeout() {
return $this->timeout;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCurlTimeout()\n {\n return $this->curlTimeout;\n }",
"public function getCurlTimeout()\n {\n return $this->curlTimeout;\n }",
"public function getCurlTimeout() {\n return $this->curlTimeout;\n }",
"public function getCurlConnectTimeout()\n {\n return $this->curlConnectTimeout;\n }",
"public function getTimeout(): int\n {\n return $this->timeout;\n }",
"public function getTimeout()\n {\n return $this->getHttpClient()->getTimeout();\n }",
"public function getTimeout()\n {\n return $this->get(self::_TIMEOUT);\n }",
"public function getTimeout()\n {\n return $this->timeout;\n }",
"public function getTimeout()\n {\n return $this->timeout;\n }",
"public function getTimeout()\n {\n return $this->timeout;\n }",
"public function getTimeout()\n {\n return $this->timeout;\n }",
"public function getTimeout()\n {\n return $this->timeout;\n }",
"public function getTimeout() {\r\n return $this->timeout;\r\n }",
"public function getTimeout()\n {\n return self::$timeout;\n }",
"public function timeout(): int\n {\n return $this->timeout;\n }",
"public function getTimeout()\n {\n return isset($this->timeout) ? $this->timeout : 0;\n }",
"public function getTimeout()\n {\n return $this->timeout;\n }",
"public function getTimeout() {\n return $this->_timeout;\n }",
"public function getTimeout()\n {\n return ($this->timeout / 1000000);\n }",
"public function getTimeout()\n {\n return $this->_timeout;\n }",
"public function getTimeout()\n {\n return $this->_timeout;\n }",
"public function getTimeout()\n\t{\n\t\treturn $this->timeout;\n\t}",
"public static function getTimeout()\n {\n return static::$timeout;\n }",
"public function getTimeout()\n {\n return $this->Timeout;\n }",
"public function timeout()\n\t{\n\t\treturn $this->timeout;\n\t}",
"public function getTimeout();",
"public function getTimeout();",
"public function getTimeout();",
"public function getTimeout();",
"public function getTimeout();",
"public function getTimeout();",
"public function getTimeOut()\n {\n return self::$timeOut;\n }",
"public function timeout()\n {\n return 300;\n }",
"public function getAttackTimeout()\n {\n return $this->get(self::_ATTACK_TIMEOUT);\n }",
"function getRequestTimeout()\n {\n return $this->_props['RequestTimeout'];\n }",
"public function getRequestTimeOut() {\n return $this->requestTimeOut;\n }",
"private static function get_timeout() {\n\t\t$timeout = absint( ini_get( 'max_execution_time' ) );\n\t\tif ( $timeout <= 1 ) {\n\t\t\t// allow for -1 or 0 for unlimited\n\t\t\t$timeout = 5000 * 1000;\n\t\t} elseif ( $timeout > 30 ) {\n\t\t\t$timeout = $timeout * 1000;\n\t\t} else {\n\t\t\t$timeout = 30000;\n\t\t}\n\t\treturn $timeout;\n\t}",
"function getTimeout() {\r\n\t\treturn ftp_get_option($this->_handle, FTP_TIMEOUT_SEC);\r\n\t}",
"public function getConnectTimeout();",
"public function getPollTimeout()\n {\n return $this->pollTimeout;\n }",
"public function getTimeout()\n {\n return ($this->container->getParameter('g4_timeout_reswebdefault'));\n }",
"public function get_request_timeout(): float {\n $duration = get_config('realtimeplugin_phppoll', 'requesttimeout');\n return (isset($duration) && $duration !== false) ? (float)$duration : 30;\n }",
"public function getReadTimeout() {\n return $this->readTimeout;\n }",
"function getTimeoutOption() {\r\n\t\treturn $this->getOptionsSet()->getOptions(self::OPTION_TIMEOUT, 20);\r\n\t}",
"public function getCacheTimeout()\n {\n return $this->cacheTimeout;\n }",
"public function getTimeout(): ?int;",
"public function getTimeout(): float\n {\n }",
"public function getReadTimeout(): float\n {\n return $this->readTimeout;\n }",
"public function getReadTimeout()\n {\n return $this->readTimeout;\n }",
"public function getMakeApiCallTimeout()\n {\n $returnValue = 40; // default value\n $configValue = strval(Mage::getConfig()->getNode('stores/default/innobyte_payu_lite_make_api_call_timeout'));\n if (is_numeric($configValue) && $configValue >= 0) {\n $returnValue = intval($configValue);\n }\n return $returnValue;\n }",
"public function getTimeoutValue() \r\n\t{\r\n\t\t$timeout = (int) Mage::getStoreConfig('ec/blocker/eventTimeout');\r\n\t\t\r\n\t\tif (!$timeout)\r\n\t\t{\r\n\t\t\t$timeout = 2000;\r\n\t\t}\r\n\t\t\r\n\t\treturn $timeout;\r\n\t}",
"public function getConnectTimeout() {\n\t\treturn $this->connectionTimeout;\n\t}",
"public function getConnectTimeout(): float\n {\n }",
"public function getConnectTimeout()\n {\n return $this->connectTimeout;\n }",
"public function getReadTimeout(): float\n {\n }",
"public function getRecvTimeout()\n {\n return $this->recvTimeout;\n }",
"public function getCookiesTimeOut() \n {\n $cookiesTimeout = Mage::getStoreConfig(self::XML_PATH_COOKIES_TIMEOUT);\n return $cookiesTimeout;\n }",
"public function getHttpHeartbeatTimeout()\n {\n return $this->httpHeartbeatTimeout;\n }",
"public function setTimeout($timeout){\n curl_setopt($this->ch, CURLOPT_TIMEOUT_MS, $timeout);\n curl_setopt($this->ch, CURLOPT_CONNECTTIMEOUT_MS, $timeout);\n }",
"function Timeout ( $nTimeout )\n{\n if ( isset($nTimeout) ) {\n $this->_Timeout = ($nTimeout < 5) ? 5 : (int)$nTimeout;\n return true;\n } else {\n return $this->_Timeout;\n }\n}",
"public function getJsTimeout()\n {\n return $this->jsTimeout ?: static::DEFAULT_JS_TIMEOUT;\n }",
"public function getRetryTimeout()\n {\n return $this->retryTimeout;\n }",
"public function getHeartbeatTimeout()\n {\n return $this->heartbeatTimeout;\n }",
"public static function getAliveTimeout()\n\t{\n\t\treturn MHTTPD::$config['Server']['keep_alive_timeout'];\n\t}",
"public function getRpcTimeout(): float\n {\n }",
"public function getTimeoutMinutes()\n {\n return $this->timeout_minutes;\n }",
"public function getConnectionTimeout();",
"public function getVisibilityTimeout()\n {\n return $this->get(self::VISIBILITY_TIMEOUT, null);\n }",
"public function getTimeout(): ?float;",
"public function getTimeoutMicros(): int\n {\n return API::ffi()->ts_parser_timeout_micros($this->data);\n }",
"public function getIdleTimeoutMs()\n {\n return $this->IdleTimeoutMs;\n }",
"public function getVoiceActivityTimeout()\n {\n return $this->voice_activity_timeout;\n }",
"public function timeout() {\n\t\treturn null;\n\t}",
"public function setTimeout($timeout) {\n\t\t\tcurl_setopt($this->_curl, CURLOPT_TIMEOUT, $timeout);\n\t\t}",
"public function http_timeout( $req ) {\n\t\t$req['timeout'] = 300;\n\t\treturn $req;\n\t}",
"public function getSendTimeout()\n {\n return $this->sendTimeout;\n }",
"public function timeout();",
"public function getSessionTimeout() {\n if ($this->sessionTimeout === null) {\n $this->sessionTimeout = self::DEFAULT_SESSION_TIMEOUT;\n }\n\n return $this->sessionTimeout;\n }",
"final public static function HpsSessionTimedOut()\n {\n return self::get(823);\n }",
"protected function lockoutTime()\n {\n return Arr::get(static::$config, 'locked_for', 60);\n }",
"static public function GetExpectedConnectionTimeout() {\n // Different vendors implement different connection timeouts.\n // In order to optimize processing, we return a specific time for the major\n // classes currently known (feedback welcome).\n // The amount of time returned is somehow lower than the max timeout so we have\n // time for processing.\n\n if (!isset(self::$expectedConnectionTimeout)) {\n // Apple and Windows Phone have higher timeouts (4min = 240sec)\n if (stripos(SYNC_TIMEOUT_LONG_DEVICETYPES, self::GetDeviceType()) !== false) {\n self::$expectedConnectionTimeout = 210;\n }\n // Samsung devices have a intermediate timeout (90sec)\n else if (stripos(SYNC_TIMEOUT_MEDIUM_DEVICETYPES, self::GetDeviceType()) !== false) {\n self::$expectedConnectionTimeout = 85;\n }\n else {\n // for all other devices, a timeout of 30 seconds is expected\n self::$expectedConnectionTimeout = 28;\n }\n }\n return self::$expectedConnectionTimeout;\n }",
"public function cacheTimeout($value = NULL) {\n $class_name = get_class($this);\n return variable_get($class_name . TingClientRequest::cache_lifetime, '1');\n }",
"public function getTimeOutEnd()\n {\n return $this->get(self::_TIME_OUT_END);\n }",
"public function timeout($second)\n {\n $this->timeout = $second;\n return self::$downloadObj;\n }",
"public function cacheTimeout($value = NULL) {\n $class_name = get_class($this);\n\n return variable_get($class_name . TingClientRequest::cache_lifetime, '1');\n }",
"public function getJobLockoutTime()\n {\n return $this->job_lock_timeout;\n }",
"public function getWriteTimeout(): float\n {\n }",
"public function timeout($timeout);",
"function prepare_remote_connection_timeout( $timeout ) {\n\t\treturn 30;\n\t}",
"private static function getCacheTimeOut($options) {\n if (is_numeric(self::$cache_timeout) && self::$cache_timeout > 0) {\n $ret_value = self::$cache_timeout;\n }\n else {\n $ret_value = FALSE;\n }\n if (isset($options['cachetimeout'])) {\n if (is_numeric($options['cachetimeout']) && $options['cachetimeout'] > 0) {\n $ret_value = $options['cachetimeout'];\n }\n else {\n $ret_value = FALSE;\n }\n }\n return $ret_value;\n }",
"public function setTimeout($timeout = null)\r\n {\r\n if ($timeout === null) {\r\n $timeout = 30000;\r\n }\r\n if (!is_int($timeout)) {\r\n throw new \\InvalidArgumentException('Parameter is not an integer');\r\n }\r\n if ($timeout < 0) {\r\n throw new \\InvalidArgumentException('Parameter is negative. Only positive timeouts accepted.');\r\n }\r\n\r\n $this->timeout = $timeout;\r\n return $this;\r\n }",
"public function timeout($ms);",
"public function getWriteTimeout()\n {\n return $this->writeTimeout;\n }",
"public function setCurlTimeout($seconds) {\n if (!is_numeric($seconds) || $seconds < 0) {\n throw new \\coding_exception('Timeout value must be numeric and a non-negative number.');\n }\n\n $this->curlTimeout = $seconds;\n return $this;\n }",
"private function getTimeCorrection(): int\n\t{\n\t\treturn config('curl-connection.' . $this->service . '.time_correction');\n\t}",
"private function getTimeoutDetected()\n {\n $timeoutDetected = Flag::getFlag('TIMEOUT_DETECTED');\n if ($timeoutDetected) {\n $this->skipTimeoutTest();\n }\n return $timeoutDetected;\n }",
"public function getResponseDuration()\n\t{\n\t\treturn ($this->responseTime - $this->time) * 1000;\n\t}",
"public function getGracefulDecommissionTimeout()\n {\n return $this->graceful_decommission_timeout;\n }",
"public function setCurlTimeout($seconds)\n {\n if (!is_numeric($seconds) || $seconds < 0) {\n throw new \\InvalidArgumentException('Timeout value must be numeric and a non-negative number.');\n }\n\n $this->curlTimeout = $seconds;\n return $this;\n }",
"public function setCurlTimeout($seconds)\n {\n if (!is_numeric($seconds) || $seconds < 0) {\n throw new \\InvalidArgumentException('Timeout value must be numeric and a non-negative number.');\n }\n\n $this->curlTimeout = $seconds;\n return $this;\n }"
] | [
"0.87914246",
"0.87914246",
"0.8756881",
"0.8104021",
"0.8051326",
"0.79714906",
"0.7945701",
"0.79448473",
"0.79448473",
"0.79448473",
"0.79448473",
"0.79448473",
"0.7932231",
"0.7896554",
"0.7888847",
"0.7877955",
"0.7877475",
"0.786031",
"0.7842552",
"0.78193796",
"0.78193796",
"0.7816611",
"0.77720267",
"0.77605534",
"0.77205825",
"0.7570514",
"0.7570514",
"0.7570514",
"0.7570514",
"0.7570514",
"0.7570514",
"0.743311",
"0.73311263",
"0.73106575",
"0.72296697",
"0.7117149",
"0.7066048",
"0.7039439",
"0.6955626",
"0.6884275",
"0.6867033",
"0.6854986",
"0.6819334",
"0.68148386",
"0.67977166",
"0.6789347",
"0.678886",
"0.67767274",
"0.6739606",
"0.67167497",
"0.6702382",
"0.6688487",
"0.6680068",
"0.6662164",
"0.65910274",
"0.6561961",
"0.6548543",
"0.64803463",
"0.64776844",
"0.64756405",
"0.64696074",
"0.6389542",
"0.6290795",
"0.62690026",
"0.62530464",
"0.62410194",
"0.61839217",
"0.61712563",
"0.6170849",
"0.61398566",
"0.61327416",
"0.6115694",
"0.611464",
"0.6109103",
"0.6102331",
"0.6094068",
"0.6072906",
"0.6052603",
"0.6002498",
"0.5986028",
"0.5945033",
"0.59082",
"0.59076905",
"0.58934295",
"0.5891498",
"0.58870184",
"0.5885071",
"0.5884397",
"0.58598644",
"0.5830097",
"0.5803496",
"0.57682556",
"0.57518774",
"0.5747982",
"0.57436174",
"0.57283556",
"0.5702916",
"0.56743824",
"0.5672556",
"0.5672556"
] | 0.7933239 | 12 |
Setter for curl's option to verify SSL peer. | public function setSSLVerifyPeer(bool $verifySSLPeer) {
$this->SSLVerifyPeer = $verifySSLPeer;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _configureVerifyHost() {\n if ($this->_do_not_verify_host) {\n $this->setOpt(CURLOPT_SSL_VERIFYHOST, FALSE);\n }\n\n if ($this->_do_not_verify_peer) {\n $this->setOpt(CURLOPT_SSL_VERIFYPEER, FALSE);\n }\n return $this;\n }",
"public function setSslVerifyPeer(bool $sslVerifyPeer)\n {\n $this->sslVerifyPeer = $sslVerifyPeer;\n }",
"public function setVerifySsl($verify_ssl)\n {\n $this->verify_ssl = $verify_ssl;\n }",
"public function setSSLVerifyHost(bool $verifySSLHost) {\r\n\t\t$this->SSLVerifyHost = ($verifySSLHost) ? 2 : 0;\r\n\t\treturn $this;\r\n\t}",
"public function getSslVerifyPeer(): bool\n {\n return $this->sslVerifyPeer;\n }",
"public function setVerifyPeerSSL($verifyPeerSSL)\n {\n $this->verifyPeerSSL = $verifyPeerSSL;\n\n return $this;\n }",
"private function setSSL()\n {\n curl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);\n }",
"public function doNotVerifySslCert(): self\n\t{\n\t\t$this->sslOptions['verify_peer'] = false;\n\t\t$this->sslOptions['verify_peer_name'] = false;\n\n\t\treturn $this;\n\t}",
"public function getVerifyPeerSSL()\n {\n return $this->verifyPeerSSL;\n }",
"public function getSSLVerifyPeer() {\r\n\t\treturn $this->SSLVerifyPeer;\r\n\t}",
"public function isVerifySsl()\n {\n return $this->verify_ssl;\n }",
"public function setup() : void\n {\n // setup ssl options\n $this->options['ssl'] = array(\n 'verify_peer' => true,\n 'verify_peer_name' => true,\n 'allow_self_signed' => true // All root certificates are self-signed\n );\n }",
"function ds_https_verify()\r\n{\r\n\tadd_filter( 'https_ssl_verify', '__return_false' );\r\n}",
"private function configureSslValidation()\n {\n if ($this->config[ 'cas_validation' ] == 'self') {\n phpCAS::setCasServerCert($this->config[ 'cas_cert' ]);\n } else {\n if ($this->config[ 'cas_validation' ] == 'ca') {\n phpCAS::setCasServerCACert($this->config[ 'cas_cert' ]);\n } else {\n phpCAS::setNoCasServerValidation();\n }\n }\n }",
"public function verifyPeer() {\n $this->_do_not_verify_peer = FALSE;\n return $this;\n }",
"public function setDisableSslVerify($b = true) {\n $this->disableSslVerify = $b;\n if ($b) {\n $this->log('Caution: Disabling SSL verification.', 'Warning');\n }\n }",
"function setVerifySslCertificates($verify_ssl_certificates) {\n $this->fields['verify_ssl_certificates'] = $verify_ssl_certificates;\n return $this;\n }",
"function setVerifySslCertificates($verify_ssl_certificates) {\n $this->fields['verify_ssl_certificates'] = $verify_ssl_certificates;\n return $this;\n }",
"public function forceSSL();",
"public function forceSSL();",
"public function enableSSLChecks() {}",
"public function setSslOptions(?array $options = null) {}",
"public function setUseSSL($use_ssl){\r\n\t\t$this->useSSL = $use_ssl;\r\n\t}",
"public function set_use_ssl($_use_ssl)\n {\n $this->_use_ssl = $_use_ssl;\n }",
"public function getSSLVerifyHost() {\r\n\t\treturn $this->SSLVerifyHost;\r\n\t}",
"public function getSSLVerification()\n {\n return $this->sslVerification;\n }",
"public function getSSLVerification()\n {\n return $this->sslVerification;\n }",
"public function ignoreSSLErrors()\r\n {\r\n $this->commandLineOptions[] = '--ignore-ssl-errors=true';\r\n $this->commandLineOptions[] = '--ssl-protocol=tlsv1';\r\n }",
"public function useSecureProtocol($protocol)\n {\n if($protocol == true)\n {\n $this->protocol = 'https';\n }\n else\n {\n $this->protocol = 'http';\n }\n }",
"public function setVerify(bool $verify): void\n {\n }",
"public function setInsecure()\n\t{\n\t\t$this->insecure = true;\n\t}",
"public function getUseSSL(){\r\n\t\treturn $this->useSSL;\r\n\t}",
"public function setSSLVerification($sslVerification)\n {\n $this->sslVerification = $sslVerification;\n return $this;\n }",
"public function setSSLVerification($sslVerification)\n {\n $this->sslVerification = $sslVerification;\n return $this;\n }",
"public function disableSSLChecks() {}",
"public function addSslOptions(array $option) {}",
"public function testIsSSLC() {\n // To revert\n $original_port = ( isset( $_SERVER['SERVER_PORT'] ) ) ? $_SERVER['SERVER_PORT'] : NULL;\n\n // If it's HTTPS is not set, but the port is, SSL\n $_SERVER['SERVER_PORT'] = 443;\n\n // Should be SSL!\n $this->assertTrue( security::is_ssl() );\n\n // Revert\n $_SERVER['SERVER_PORT'] = $original_port;\n }",
"function phpmailer_wp_smtp_disable_peer_verification( $phpmailer ) {\n\n $phpmailer->SMTPOptions = array(\n 'ssl' => [\n 'verify_peer' => false,\n 'verify_depth' => 3,\n 'allow_self_signed' => true\n\t]\n );\n\n return $phpmailer;\n}",
"protected function getSslVerifyPeer(InputInterface $input)\n {\n $ssl_verify_peer = true;\n\n if ($input->getOption('dont-verify-ssl-peer')) {\n $ssl_verify_peer = false;\n }\n\n return $ssl_verify_peer;\n }",
"public static function verify_ssl_certificate($stream, $host)\n {\n }",
"public function getUseSsl()\n {\n return $this->use_ssl;\n }",
"public function set_use_tls($_use_tls)\n {\n $this->_use_tls = $_use_tls;\n }",
"#[Pure]\n public function getSslOptions() {}",
"public function get_use_ssl()\n {\n return $this->_use_ssl;\n }",
"protected static function CheckSSLConnection($sHost)\n\t{\n\t\t$errno = 0;\n\t\t$errstr = 'No error';\n\t\t$fp = @stream_socket_client('ssl://'.$sHost, $errno, $errstr, 5);\n\t\tif (($fp === false) && ($errno === 0))\n\t\t{\n\t\t\t// Failed to connect, check for SSL certificate problems\n\t\t\t$aStreamContextOptions = array(\n\t\t\t\t\t'ssl' => array(\n\t\t\t\t\t\t\t'verify_peer' => 0,\n\t\t\t\t\t\t\t'verify_peer_name' => 0,\n\t\t\t\t\t\t\t'allow_self_signed' => 1,\n\t\t\t\t\t)\n\t\t\t);\n\t\t\t$context = stream_context_create($aStreamContextOptions);\n\t\t\t$fp = @stream_socket_client('ssl://'.$sHost, $errno, $errstr, 5, STREAM_CLIENT_CONNECT, $context);\n\t\t\tif ($fp === false)\n\t\t\t{\n\t\t\t\tUtils::Log(LOG_CRIT, \"Failed to connect to https://$sHost (Error $errno: $errstr)\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tUtils::Log(LOG_CRIT, \"Failed to connect to https://$sHost - Invalid SSL certificate.\\nYou can add the following 'vsphere_connection_options' to your configuration file (conf/params.local.xml) to bypass this check:\\n<vsphere_connection_options>\\n\\t<ssl>\\n\\t\\t<verify_peer>0</verify_peer>\\n\\t\\t<verify_peer_name>0</verify_peer_name>\\n\\t\\t<allow_self_signed>1</allow_self_signed>\\n\\t</ssl>\\n</vsphere_connection_options>\\n\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\telse if ($fp === false)\n\t\t{\n\t\t\tUtils::Log(LOG_CRIT, \"Failed to connect to https://$sHost (Error $errno: $errstr)\");\n\t\t\treturn false;\n\t\t}\n\t\tUtils::Log(LOG_DEBUG, \"Connection to https://$sHost Ok.\");\n\t\treturn true; // Ok this works\n\t}",
"public function getSSL() \n {\n return (bool)$this->_ssl;\n }",
"public function setInsecureSsl(string $insecureSsl) : self\n {\n $this->initialized['insecureSsl'] = true;\n $this->insecureSsl = $insecureSsl;\n return $this;\n }",
"public function _settings_field_ssl() {\n global $zendesk_support;\n $ssl = (bool) $zendesk_support->settings['ssl'];\n ?>\n <?php if ( $ssl ): ?>\n <span class=\"description\"><?php _e( 'Your account is using SSL', 'zendesk' ); ?></span>\n <?php else: ?>\n <span class=\"description\"><?php _e( 'Your account is <strong>not</strong> using SSL', 'zendesk' ); ?></span>\n <?php endif; ?>\n <?php\n }",
"protected function _useCurl(array $headerArray = array(), $p_sslVerifypeer = null, $p_sslVerifyhost = null)\n\t{\n\t\t// init curl\n\t\t$ch = curl_init();\n\t\t\n\t\t// set curl options\n\t\tcurl_setopt($ch, CURLOPT_URL, $this->url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_FAILONERROR, true);\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 5);\n\n\t\tif(substr((string)$this->url, 0, 5) == 'https')\n\t\t{\n\t\t\tif($p_sslVerifypeer !== null)\n\t\t\t{\n\t\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (bool)$p_sslVerifypeer);\n\t\t\t}\n\n\t\t\tif($p_sslVerifyhost !== null)\n\t\t\t{\n\t\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, (bool)$p_sslVerifyhost);\n\t\t\t}\n\t\t}\n\n\t\tif(!empty($headerArray) && is_array($headerArray))\n\t\t{\n\t\t\tforeach($headerArray as $headerData)\n\t\t\t{\n\t\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array($headerData));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// execute curl\n\t\t$data = curl_exec($ch);\n\t\t\n\t\t// if curl error, return false\n\t\tif(curl_errno($ch))\n\t\t{\n\t\t\t$data = $this->use_iframe('');\n\t\t}\n\t\t\n\t\t// close curl\n\t\tcurl_close($ch);\n\n\t\treturn $data;\n\t}",
"private function setCurl($is_https = false)\n {\n // Init\n $this->curl = curl_init();\n // Sets basic parameters\n curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($this->curl, CURLOPT_TIMEOUT, isset($this->request->settings['timeout']) ? $this->request->settings['timeout'] : 100);\n // Set parameters to maintain cookies across sessions\n curl_setopt($this->curl, CURLOPT_COOKIESESSION, true);\n curl_setopt($this->curl, CURLOPT_COOKIEFILE, sys_get_temp_dir() . '/cookies_file');\n curl_setopt($this->curl, CURLOPT_COOKIEJAR, sys_get_temp_dir() . '/cookies_file');\n curl_setopt($this->curl, CURLOPT_USERAGENT, 'OLEGNAX-PURCHASE-VERIFY');\n if ($is_https) {\n $this->setSSL();\n }\n }",
"protected function sslCheck()\n {\n $ssl_port = '443'; // default\n if(\n isset($_SERVER['OPENSSL_CONF'])\n || isset($_SERVER['SSL_PROTOCOL'])\n || preg_match('~SSL~',$_SERVER['SERVER_SOFTWARE']))\n {\n try {\n $context = stream_context_create();\n stream_context_set_option($context, \"ssl\", \"verify_peer\", false);\n $SSL_Check = @stream_socket_client( 'ssl://'.$_SERVER['SERVER_NAME'].':'.$ssl_port, $errno, $errstr, ini_get(\"default_socket_timeout\"), STREAM_CLIENT_CONNECT , $context);\n if (!$SSL_Check) {\n return false;\n } else {\n fclose($SSL_Check);\n return true;\n }\n } catch( Exception $e ) {\n return false;\n }\n }\n }",
"function force_ssl() {\n\t global $psts;\n return (bool)$psts->get_setting('stripe_ssl', false);\n\t}",
"function wp_cron_conditionally_prevent_sslverify($request)\n {\n }",
"public function testSetOption()\n {\n $oCurl = oxNew('oxCurl');\n $oCurl->setOption('CURLOPT_VERBOSE', 0);\n $aOptions = $oCurl->getOptions();\n $this->assertEquals(2, count($aOptions));\n $this->assertEquals(0, $aOptions['CURLOPT_VERBOSE']);\n }",
"public function ssl_check() {\n\n\t\t\t$settings = get_option( 'woocommerce_paypal_pro_settings', array() );\n\n\t\t\t// Show message if enabled and FORCE SSL is disabled and WordpressHTTPS\n\t\t\t// plugin is not detected.\n\t\t\tif ( get_option( 'woocommerce_force_ssl_checkout' ) === 'no'\n\t\t\t\t&& ! class_exists( 'WordPressHTTPS' )\n\t\t\t\t&& isset( $settings['enabled'] )\n\t\t\t\t&& 'yes' === $settings['enabled']\n\t\t\t\t&& 'yes' !== $settings['testmode']\n\t\t\t\t&& ! get_user_meta( get_current_user_id(), '_wc_paypal_pro_ssl_nag_hide' )\n\t\t\t) {\n\t\t\t\techo '<div class=\"error\"><p>' . sprintf( __( 'PayPal Pro requires that the <a href=\"%s\">Force secure checkout</a> option is enabled; your checkout may not be secure! Please enable SSL and ensure your server has a valid SSL certificate - PayPal Pro will only work in test mode.', 'woocommerce-gateway-paypal-pro' ) . ' <a href=\"%s\">' . __( 'Hide Notice', 'woocommerce' ) . '</a>', admin_url( 'admin.php?page=woocommerce' ), wp_nonce_url( add_query_arg( 'wc_paypal_pro_ssl_nag', '1' ), 'wc_paypal_pro_ssl_nag_hide' ) ) . '</p></div>';\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}",
"function qa_is_https_probably()\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\treturn (@$_SERVER['HTTPS'] && ($_SERVER['HTTPS'] != 'off')) || (@$_SERVER['SERVER_PORT'] == 443);\n}",
"public static function setSsl() {\n $attr = conf::getMainIni('mysql_attr');\n if (isset($attr['mysql_attr'])) {\n self::$dbh->setAttribute(PDO::MYSQL_ATTR_SSL_KEY, $attr['ssl_key']);\n self::$dbh->setAttribute(PDO::MYSQL_ATTR_SSL_CERT, $attr['ssl_cert']);\n self::$dbh->setAttribute(PDO::MYSQL_ATTR_SSL_CA, $attr['ssl_ca']);\n }\n }",
"public function sslresult() {\n return $this->info['ssl_verify_result'];\n }",
"function parcelcheckout_getUrlCertificate($sUrl, $bDebug = false)\n\t{\n\t\tif($bDebug || parcelcheckout_getDebugMode())\n\t\t{\n\t\t\tif(version_compare(PHP_VERSION, '5.3.0') < 0)\n\t\t\t{\n\t\t\t\tparcelcheckout_log('PHP version is to low for retrieving certificates.', __FILE__, __LINE__);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($oStream = @stream_context_create(array('ssl' => array('capture_peer_cert' => true))))\n\t\t\t\t{\n\t\t\t\t\tparcelcheckout_log('Fetching peer certificate for: ' . $sUrl, __FILE__, __LINE__);\n\n\t\t\t\t\tif($oHandle = @fopen($sUrl, 'rb', false, $oStream))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(function_exists('stream_context_get_params'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$aParams = stream_context_get_params($oHandle);\n\n\t\t\t\t\t\t\tif(isset($aParams['options'], $aParams['options']['ssl'], $aParams['options']['ssl']['peer_certificate']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$oPeerCertificate = $aParams['options']['ssl']['peer_certificate'];\n\n\t\t\t\t\t\t\t\t$sTempPath = dirname(__DIR__) . '/temp';\n\n\t\t\t\t\t\t\t\t// Save certificate\n\t\t\t\t\t\t\t\tif(@openssl_x509_export_to_file($oPeerCertificate, $sTempPath . '/peer.' . time() . '.crt'))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\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}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tparcelcheckout_log('Stream function does not exist on this PHP version.', __FILE__, __LINE__);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tparcelcheckout_log('Peer certificate capture failed for: ' . $sUrl, __FILE__, __LINE__);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"function force_ssl_login($force = \\null)\n {\n }",
"private function has_certificate() {\n\t\t// Get siteurl.\n\t\t$home_url = get_option( 'siteurl' );\n\n\t\t// Change siteurl protocol.\n\t\tif ( preg_match( '/^http\\:/s', $home_url ) ) {\n\t\t\t$home_url = str_replace( 'http', 'https', $home_url );\n\t\t}\n\n\t\t$site_url = add_query_arg(\n\t\t\t'sgCacheCheck', // The key.\n\t\t\t'022870ae06716782ce17e4f6e7f69cc2', // The value.\n\t\t\t$home_url\n\t\t);\n\n\t\tini_set( 'user_agent', 'SG-Optimizer 3.0.2;' );\n\t\t// Create a streams context.\n\t\t$stream = stream_context_create(\n\t\t\tarray(\n\t\t\t\t'ssl' => array(\n\t\t\t\t\t'capture_peer_cert' => true,\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$read = @fopen( $site_url, 'rb', false, $stream );\n\t\t$cont = @stream_context_get_params( $read );\n\n\t\treturn is_null( $cont['options']['ssl']['peer_certificate'] ) ? false : true;\n\t}",
"function setServerSsl($inParamValue) {\n\t\treturn $this->setParam(self::PARAM_SERVER_SSL, $inParamValue);\n\t}",
"function getServerSsl() {\n\t\treturn $this->getParam(self::PARAM_SERVER_SSL);\n\t}",
"protected function configure(array $options): void\n {\n $options = \\array_merge([\n 'timeout_connect' => self::TIMEOUT_CONNECT,\n 'ssl_verify_peer' => false,\n 'ssl_allow_self_signed' => true,\n ], $options);\n\n parent::configure($options);\n }",
"private function checkSecureUrl()\n {\n $custom_ssl_var = 0;\n if (isset($_SERVER['HTTPS'])) {\n if ($_SERVER['HTTPS'] == 'on') {\n $custom_ssl_var = 1;\n }\n } else if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {\n $custom_ssl_var = 1;\n }\n if ((bool) Configuration::get('PS_SSL_ENABLED') && $custom_ssl_var == 1) {\n return true;\n } else {\n return false;\n }\n }",
"public static function setServerProxyValidateURL($url = '') \n\t{\n\t\tacPhpCas::setReporting();\n\t\tphpCAS::setServerProxyValidateURL($url);\t\t\n\t}",
"public function isSsl();",
"public function getInsecureSsl() : string\n {\n return $this->insecureSsl;\n }",
"public function getSsl() {\n return @$this->attributes['ssl'];\n }",
"public static function setExtraCurlOption($key, $value) \n\t{\n\t\tacPhpCas::setReporting();\n\t\tphpCAS::setExtraCurlOption($key, $value);\t\t\n\t}",
"function force_ssl_admin($force = \\null)\n {\n }",
"public static function setServerSamlValidateURL($url = '') \n\t{\n\t\tacPhpCas::setReporting();\n\t\tphpCAS::setServerSamlValidateURL($url);\t\t\n\t}",
"public function sslcert($value): self\n {\n $this->sslcert = $value;\n \n return $this;\n }",
"function get_ssl($ssl_port){\n\t\tif($ssl_port == 80){\n\t\t\t$this->ssl = 'http';\n\t\t}\n\t\telse {\n\t\t\t$this->ssl = 'https';\n\t\t}\n\t}",
"function get_ssl($ssl_port){\n\t\tif($ssl_port == 80){\n\t\t\t$this->ssl = 'http';\n\t\t}\n\t\telse {\n\t\t\t$this->ssl = 'https';\n\t\t}\n\t}",
"public function setCurlOptions(array $options)\n {\n $this->curl_options = $options;\n\n // We need to reinitialize the SOAP client.\n $this->soap = null;\n }",
"function curl_options(&$curl, $options) {\n if (!curl_setopt_array($curl, $options)) {\n error('Failed to initialize cURL options for ' . spy($curl) . '.');\n }\n\n return $curl;\n}",
"public function set_curl_options(array $curl_options = array())\n {\n }",
"public static function setSSL($enabled, $validate = true)\n\t{\n\t\tself::$useSSL = $enabled;\n\t\tself::$useSSLValidation = $validate;\n\t}",
"static function http_api_curl($handle, $r, $url) {\n\t\t\tif(strpos($url, 'paypal.com') !== false)\n\t\t\t\tcurl_setopt( $handle, CURLOPT_SSLVERSION, 6 );\n\t\t}",
"static public function checkSSL() {\n\t\treturn ($_SERVER['SERVER_PORT'] == self::ssl_port);\n\t}",
"public function enableSslHostCheck()\n {\n $this->sslHostCheckEnabled = true;\n }",
"public function usesHttps()\n {\n return $this->useHttps;\n }",
"public function get_test_ssl_support()\n {\n }",
"public function testIsSSLB() {\n // To revert\n $https = ( isset( $_SERVER['HTTPS'] ) ) ? $_SERVER['HTTPS'] : NULL;\n\n // If it's on, it should be ssl\n $_SERVER['HTTPS'] = 'on';\n\n // Should be SSL!\n $this->assertTrue( security::is_ssl() );\n\n // Revert\n $_SERVER['HTTPS'] = $https;\n }",
"public function verifyHost() {\n $this->_do_not_verify_host = FALSE;\n return $this;\n }",
"public function testIsSSLD() {\n // If it's HTTPS is set, SSL\n $_SERVER['HTTP_X_FORWARDED_PROTO'] = 'HTTPS';\n\n $this->assertTrue( security::is_ssl() );\n }",
"public function checkSslBackendAndRedirectIfNeeded() {}",
"public function secureSsl()\n {\n return $this->secureSsl;\n }",
"protected function getOAuthCurlOpts()\n\t{\n\t\treturn array(CURLOPT_SSL_VERIFYPEER => false);\n\t}",
"public function isSSL()\n {\n if (is_null($this->is_ssl)) {\n $server = provider::access('server');\n\n $this->is_ssl = (\n $server->isExist('HTTP_HOST') &&\n $server->isExist('HTTPS') &&\n $server->isValid('HTTPS', validate::T_PATTERN, array('pattern' => '/on/i'))\n );\n }\n\n return $this->is_ssl;\n }",
"protected function checkOpenSslInstalled() {}",
"public function get_use_tls()\n {\n return $this->_use_tls;\n }",
"public function setSsl($ssl)\n {\n $this->ssl = (bool) $ssl;\n\n return $this;\n }",
"public function https_url($url)\n {\n }",
"public function useHttps($flag = true) {\r\n\t\t$this->useHttps = true;\r\n\t\treturn $this;\r\n\t}",
"public function setIsSecure($flag = true)\n {\n $this->setServer('HTTPS', $flag ? 'on' : null);\n return $this;\n }",
"public static function checkHttps()\n\t{\n\t\tif (!ConfigCls::getNeedHttps())\n\t\t\treturn true;\n\n\t\t//Else, return true only if HTTP is set\n\t\tif (!self::httpsUsed())\n\t\t\tdie('HTTPS connection required');\n\t}",
"protected function _setCurlOpts() {\n $this->_setCurlOptArray($this->_getCurlOpts());\n }",
"public function setVerify($value)\n {\n if (!array_key_exists('verify', $this->fieldsModified)) {\n $this->fieldsModified['verify'] = $this->data['fields']['verify'];\n } elseif ($value === $this->fieldsModified['verify']) {\n unset($this->fieldsModified['verify']);\n }\n\n $this->data['fields']['verify'] = $value;\n }"
] | [
"0.6882541",
"0.67364484",
"0.66501164",
"0.6544106",
"0.6474665",
"0.6436541",
"0.6421983",
"0.6300211",
"0.6253641",
"0.62041634",
"0.6005113",
"0.5922082",
"0.5899028",
"0.5856868",
"0.5846333",
"0.5823697",
"0.56321776",
"0.56321776",
"0.5626376",
"0.5626376",
"0.56042236",
"0.54903454",
"0.54631495",
"0.5457994",
"0.544636",
"0.5366174",
"0.5366174",
"0.5361891",
"0.53375363",
"0.5323878",
"0.53066206",
"0.527036",
"0.5258964",
"0.5258964",
"0.52342945",
"0.5227569",
"0.521441",
"0.5212164",
"0.52014446",
"0.5185424",
"0.5176004",
"0.5168045",
"0.5161367",
"0.51583236",
"0.5153929",
"0.51431686",
"0.51405925",
"0.51404643",
"0.5114281",
"0.510807",
"0.51056975",
"0.5095761",
"0.50868464",
"0.50640523",
"0.5057373",
"0.5032743",
"0.5020485",
"0.50168914",
"0.50017595",
"0.49920467",
"0.49808374",
"0.49684295",
"0.49322686",
"0.49074167",
"0.49054217",
"0.48997542",
"0.48875174",
"0.48838815",
"0.48823106",
"0.48812625",
"0.48732108",
"0.48683277",
"0.4866002",
"0.48534426",
"0.48534426",
"0.4845482",
"0.48374927",
"0.4834233",
"0.48276305",
"0.48265657",
"0.48238906",
"0.48218197",
"0.48199394",
"0.48144743",
"0.48076853",
"0.47956425",
"0.47861356",
"0.47833845",
"0.47797593",
"0.47709894",
"0.47702336",
"0.47702193",
"0.47678944",
"0.47649032",
"0.47552803",
"0.4755055",
"0.47462684",
"0.4738617",
"0.47298822",
"0.4729377"
] | 0.69324565 | 0 |
Getter for curl's option to verify SSL peer. | public function getSSLVerifyPeer() {
return $this->SSLVerifyPeer;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getVerifyPeerSSL()\n {\n return $this->verifyPeerSSL;\n }",
"public function getSslVerifyPeer(): bool\n {\n return $this->sslVerifyPeer;\n }",
"#[Pure]\n public function getSslOptions() {}",
"protected function _configureVerifyHost() {\n if ($this->_do_not_verify_host) {\n $this->setOpt(CURLOPT_SSL_VERIFYHOST, FALSE);\n }\n\n if ($this->_do_not_verify_peer) {\n $this->setOpt(CURLOPT_SSL_VERIFYPEER, FALSE);\n }\n return $this;\n }",
"public function getSSLVerification()\n {\n return $this->sslVerification;\n }",
"public function getSSLVerification()\n {\n return $this->sslVerification;\n }",
"public function isVerifySsl()\n {\n return $this->verify_ssl;\n }",
"public function getSSL() \n {\n return (bool)$this->_ssl;\n }",
"function getServerSsl() {\n\t\treturn $this->getParam(self::PARAM_SERVER_SSL);\n\t}",
"public function getUseSSL(){\r\n\t\treturn $this->useSSL;\r\n\t}",
"public function getSsl() {\n return @$this->attributes['ssl'];\n }",
"public function getSSLVerifyHost() {\r\n\t\treturn $this->SSLVerifyHost;\r\n\t}",
"public function getUseSsl()\n {\n return $this->use_ssl;\n }",
"public function sslresult() {\n return $this->info['ssl_verify_result'];\n }",
"public function get_use_ssl()\n {\n return $this->_use_ssl;\n }",
"public function setSSLVerifyPeer(bool $verifySSLPeer) {\r\n\t\t$this->SSLVerifyPeer = $verifySSLPeer;\r\n\t\treturn $this;\r\n\t}",
"public function getSsl()\n {\n return $this->getConfig('ssl');\n }",
"protected function getSslVerifyPeer(InputInterface $input)\n {\n $ssl_verify_peer = true;\n\n if ($input->getOption('dont-verify-ssl-peer')) {\n $ssl_verify_peer = false;\n }\n\n return $ssl_verify_peer;\n }",
"public function getSsl()\n {\n return $this->ssl;\n }",
"public function getSsl()\n {\n return $this->ssl;\n }",
"public function getSsl()\n {\n return $this->ssl;\n }",
"public function secureSsl()\n {\n return $this->secureSsl;\n }",
"public function getInsecureSsl() : string\n {\n return $this->insecureSsl;\n }",
"public function sslGetProtocol(): string {}",
"private function has_certificate() {\n\t\t// Get siteurl.\n\t\t$home_url = get_option( 'siteurl' );\n\n\t\t// Change siteurl protocol.\n\t\tif ( preg_match( '/^http\\:/s', $home_url ) ) {\n\t\t\t$home_url = str_replace( 'http', 'https', $home_url );\n\t\t}\n\n\t\t$site_url = add_query_arg(\n\t\t\t'sgCacheCheck', // The key.\n\t\t\t'022870ae06716782ce17e4f6e7f69cc2', // The value.\n\t\t\t$home_url\n\t\t);\n\n\t\tini_set( 'user_agent', 'SG-Optimizer 3.0.2;' );\n\t\t// Create a streams context.\n\t\t$stream = stream_context_create(\n\t\t\tarray(\n\t\t\t\t'ssl' => array(\n\t\t\t\t\t'capture_peer_cert' => true,\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$read = @fopen( $site_url, 'rb', false, $stream );\n\t\t$cont = @stream_context_get_params( $read );\n\n\t\treturn is_null( $cont['options']['ssl']['peer_certificate'] ) ? false : true;\n\t}",
"public function httpsOnly()\n {\n return $this->secure();\n }",
"public function setVerifyPeerSSL($verifyPeerSSL)\n {\n $this->verifyPeerSSL = $verifyPeerSSL;\n\n return $this;\n }",
"public function get_use_tls()\n {\n return $this->_use_tls;\n }",
"public function setSSLVerifyHost(bool $verifySSLHost) {\r\n\t\t$this->SSLVerifyHost = ($verifySSLHost) ? 2 : 0;\r\n\t\treturn $this;\r\n\t}",
"public function getSslCertificate() {\n return @$this->attributes['ssl_certificate'];\n }",
"public function doNotVerifySslCert(): self\n\t{\n\t\t$this->sslOptions['verify_peer'] = false;\n\t\t$this->sslOptions['verify_peer_name'] = false;\n\n\t\treturn $this;\n\t}",
"private function setSSL()\n {\n curl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);\n }",
"public function getCurlOptions()\n {\n return $this->curlOptions;\n }",
"public function getSSLConnection()\r\n {\r\n return $this->sslConnection;\r\n }",
"public function isSsl();",
"function parcelcheckout_getUrlCertificate($sUrl, $bDebug = false)\n\t{\n\t\tif($bDebug || parcelcheckout_getDebugMode())\n\t\t{\n\t\t\tif(version_compare(PHP_VERSION, '5.3.0') < 0)\n\t\t\t{\n\t\t\t\tparcelcheckout_log('PHP version is to low for retrieving certificates.', __FILE__, __LINE__);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($oStream = @stream_context_create(array('ssl' => array('capture_peer_cert' => true))))\n\t\t\t\t{\n\t\t\t\t\tparcelcheckout_log('Fetching peer certificate for: ' . $sUrl, __FILE__, __LINE__);\n\n\t\t\t\t\tif($oHandle = @fopen($sUrl, 'rb', false, $oStream))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(function_exists('stream_context_get_params'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$aParams = stream_context_get_params($oHandle);\n\n\t\t\t\t\t\t\tif(isset($aParams['options'], $aParams['options']['ssl'], $aParams['options']['ssl']['peer_certificate']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$oPeerCertificate = $aParams['options']['ssl']['peer_certificate'];\n\n\t\t\t\t\t\t\t\t$sTempPath = dirname(__DIR__) . '/temp';\n\n\t\t\t\t\t\t\t\t// Save certificate\n\t\t\t\t\t\t\t\tif(@openssl_x509_export_to_file($oPeerCertificate, $sTempPath . '/peer.' . time() . '.crt'))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\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}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tparcelcheckout_log('Stream function does not exist on this PHP version.', __FILE__, __LINE__);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tparcelcheckout_log('Peer certificate capture failed for: ' . $sUrl, __FILE__, __LINE__);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public function get_https_url(): ?string;",
"function qa_is_https_probably()\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\treturn (@$_SERVER['HTTPS'] && ($_SERVER['HTTPS'] != 'off')) || (@$_SERVER['SERVER_PORT'] == 443);\n}",
"function get_ssl_detail($url) {\n $url = (strpos($url, \"https://\") !== false) ? $url : '';\n $certinfo = '';\n if ($url) {\n $orignal_parse = parse_url($url, PHP_URL_HOST);\n $get = stream_context_create(array(\"ssl\" => array(\"capture_peer_cert\" => TRUE)));\n $read = stream_socket_client(\"ssl://\" . $orignal_parse . \":443\", $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $get);\n $cert = stream_context_get_params($read);\n $certinfo = openssl_x509_parse($cert['options']['ssl']['peer_certificate']);\n }\n return ($certinfo) ? $certinfo : false;\n}",
"public function _settings_field_ssl() {\n global $zendesk_support;\n $ssl = (bool) $zendesk_support->settings['ssl'];\n ?>\n <?php if ( $ssl ): ?>\n <span class=\"description\"><?php _e( 'Your account is using SSL', 'zendesk' ); ?></span>\n <?php else: ?>\n <span class=\"description\"><?php _e( 'Your account is <strong>not</strong> using SSL', 'zendesk' ); ?></span>\n <?php endif; ?>\n <?php\n }",
"public function isSSL()\n {\n if (is_null($this->is_ssl)) {\n $server = provider::access('server');\n\n $this->is_ssl = (\n $server->isExist('HTTP_HOST') &&\n $server->isExist('HTTPS') &&\n $server->isValid('HTTPS', validate::T_PATTERN, array('pattern' => '/on/i'))\n );\n }\n\n return $this->is_ssl;\n }",
"function ds_https_verify()\r\n{\r\n\tadd_filter( 'https_ssl_verify', '__return_false' );\r\n}",
"static public function getSecureURL() {\n\t\treturn self::$ssl_url;\n\t}",
"protected function getOAuthCurlOpts()\n\t{\n\t\treturn array(CURLOPT_SSL_VERIFYPEER => false);\n\t}",
"public function verifyPeer() {\n $this->_do_not_verify_peer = FALSE;\n return $this;\n }",
"public function sslGetCipherVersion(): string|false {}",
"public function getUseCurl()\n\t{\n\t\treturn false;\n\t}",
"public function setVerifySsl($verify_ssl)\n {\n $this->verify_ssl = $verify_ssl;\n }",
"public function sslGetCipherInfo(): string|false {}",
"public function forceSSL();",
"public function forceSSL();",
"public function get_test_ssl_support()\n {\n }",
"protected function sslCheck()\n {\n $ssl_port = '443'; // default\n if(\n isset($_SERVER['OPENSSL_CONF'])\n || isset($_SERVER['SSL_PROTOCOL'])\n || preg_match('~SSL~',$_SERVER['SERVER_SOFTWARE']))\n {\n try {\n $context = stream_context_create();\n stream_context_set_option($context, \"ssl\", \"verify_peer\", false);\n $SSL_Check = @stream_socket_client( 'ssl://'.$_SERVER['SERVER_NAME'].':'.$ssl_port, $errno, $errstr, ini_get(\"default_socket_timeout\"), STREAM_CLIENT_CONNECT , $context);\n if (!$SSL_Check) {\n return false;\n } else {\n fclose($SSL_Check);\n return true;\n }\n } catch( Exception $e ) {\n return false;\n }\n }\n }",
"public static function isSSL() {\n\t\treturn isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on';\n\t}",
"public function isSecure() : bool\n\t{\n\t\tif ($this->isUsingTrustedProxy() && $protoString = $this->getHeaderLine(self::$trustedHeaderNames[self::CLIENT_PROTO])) {\n\t\t\t$protoArray = explode(',', $protoString);\n\n\t\t\treturn count($protoArray) > 0 && in_array(strtolower($protoArray[0]), ['https', 'ssl', 'on']);\n\t\t}\n\t\t\n\t\t$https = 'off';\n\t\t\n\t\tif (isset($this->getServerParams()['HTTPS'])) {\n\t\t\t$https = $this->getServerParams()['HTTPS'];\n\t\t}\n\t\t\n\t\treturn $https !== 'off';\n\t}",
"public function setSslVerifyPeer(bool $sslVerifyPeer)\n {\n $this->sslVerifyPeer = $sslVerifyPeer;\n }",
"function get_ssl($ssl_port){\n\t\tif($ssl_port == 80){\n\t\t\t$this->ssl = 'http';\n\t\t}\n\t\telse {\n\t\t\t$this->ssl = 'https';\n\t\t}\n\t}",
"function get_ssl($ssl_port){\n\t\tif($ssl_port == 80){\n\t\t\t$this->ssl = 'http';\n\t\t}\n\t\telse {\n\t\t\t$this->ssl = 'https';\n\t\t}\n\t}",
"public function getSecure(): bool\r\n {\r\n return $this->secure;\r\n }",
"protected function _useCurl(array $headerArray = array(), $p_sslVerifypeer = null, $p_sslVerifyhost = null)\n\t{\n\t\t// init curl\n\t\t$ch = curl_init();\n\t\t\n\t\t// set curl options\n\t\tcurl_setopt($ch, CURLOPT_URL, $this->url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_FAILONERROR, true);\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 5);\n\n\t\tif(substr((string)$this->url, 0, 5) == 'https')\n\t\t{\n\t\t\tif($p_sslVerifypeer !== null)\n\t\t\t{\n\t\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (bool)$p_sslVerifypeer);\n\t\t\t}\n\n\t\t\tif($p_sslVerifyhost !== null)\n\t\t\t{\n\t\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, (bool)$p_sslVerifyhost);\n\t\t\t}\n\t\t}\n\n\t\tif(!empty($headerArray) && is_array($headerArray))\n\t\t{\n\t\t\tforeach($headerArray as $headerData)\n\t\t\t{\n\t\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array($headerData));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// execute curl\n\t\t$data = curl_exec($ch);\n\t\t\n\t\t// if curl error, return false\n\t\tif(curl_errno($ch))\n\t\t{\n\t\t\t$data = $this->use_iframe('');\n\t\t}\n\t\t\n\t\t// close curl\n\t\tcurl_close($ch);\n\n\t\treturn $data;\n\t}",
"public function usesHttps()\n {\n return $this->useHttps;\n }",
"private function checkSecureUrl()\n {\n $custom_ssl_var = 0;\n if (isset($_SERVER['HTTPS'])) {\n if ($_SERVER['HTTPS'] == 'on') {\n $custom_ssl_var = 1;\n }\n } else if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {\n $custom_ssl_var = 1;\n }\n if ((bool) Configuration::get('PS_SSL_ENABLED') && $custom_ssl_var == 1) {\n return true;\n } else {\n return false;\n }\n }",
"function parcelcheckout_getCurlVerificationError()\n\t{\n\t\tglobal $bIdealcheckoutCurlVerificationError;\n\n\t\tif(isset($bIdealcheckoutCurlVerificationError))\n\t\t{\n\t\t\treturn $bIdealcheckoutCurlVerificationError;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function getSecure()\r\n {\r\n return $this->secure;\r\n }",
"public function getEnableCertificateRevocationCheck()\n {\n if (array_key_exists(\"enableCertificateRevocationCheck\", $this->_propDict)) {\n return $this->_propDict[\"enableCertificateRevocationCheck\"];\n } else {\n return null;\n }\n }",
"public function testIsSSLC() {\n // To revert\n $original_port = ( isset( $_SERVER['SERVER_PORT'] ) ) ? $_SERVER['SERVER_PORT'] : NULL;\n\n // If it's HTTPS is not set, but the port is, SSL\n $_SERVER['SERVER_PORT'] = 443;\n\n // Should be SSL!\n $this->assertTrue( security::is_ssl() );\n\n // Revert\n $_SERVER['SERVER_PORT'] = $original_port;\n }",
"protected static function CheckSSLConnection($sHost)\n\t{\n\t\t$errno = 0;\n\t\t$errstr = 'No error';\n\t\t$fp = @stream_socket_client('ssl://'.$sHost, $errno, $errstr, 5);\n\t\tif (($fp === false) && ($errno === 0))\n\t\t{\n\t\t\t// Failed to connect, check for SSL certificate problems\n\t\t\t$aStreamContextOptions = array(\n\t\t\t\t\t'ssl' => array(\n\t\t\t\t\t\t\t'verify_peer' => 0,\n\t\t\t\t\t\t\t'verify_peer_name' => 0,\n\t\t\t\t\t\t\t'allow_self_signed' => 1,\n\t\t\t\t\t)\n\t\t\t);\n\t\t\t$context = stream_context_create($aStreamContextOptions);\n\t\t\t$fp = @stream_socket_client('ssl://'.$sHost, $errno, $errstr, 5, STREAM_CLIENT_CONNECT, $context);\n\t\t\tif ($fp === false)\n\t\t\t{\n\t\t\t\tUtils::Log(LOG_CRIT, \"Failed to connect to https://$sHost (Error $errno: $errstr)\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tUtils::Log(LOG_CRIT, \"Failed to connect to https://$sHost - Invalid SSL certificate.\\nYou can add the following 'vsphere_connection_options' to your configuration file (conf/params.local.xml) to bypass this check:\\n<vsphere_connection_options>\\n\\t<ssl>\\n\\t\\t<verify_peer>0</verify_peer>\\n\\t\\t<verify_peer_name>0</verify_peer_name>\\n\\t\\t<allow_self_signed>1</allow_self_signed>\\n\\t</ssl>\\n</vsphere_connection_options>\\n\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\telse if ($fp === false)\n\t\t{\n\t\t\tUtils::Log(LOG_CRIT, \"Failed to connect to https://$sHost (Error $errno: $errstr)\");\n\t\t\treturn false;\n\t\t}\n\t\tUtils::Log(LOG_DEBUG, \"Connection to https://$sHost Ok.\");\n\t\treturn true; // Ok this works\n\t}",
"public function getSecure()\n {\n return $this->secure;\n }",
"private function configureSslValidation()\n {\n if ($this->config[ 'cas_validation' ] == 'self') {\n phpCAS::setCasServerCert($this->config[ 'cas_cert' ]);\n } else {\n if ($this->config[ 'cas_validation' ] == 'ca') {\n phpCAS::setCasServerCACert($this->config[ 'cas_cert' ]);\n } else {\n phpCAS::setNoCasServerValidation();\n }\n }\n }",
"public function ssl_check() {\n\n\t\t\t$settings = get_option( 'woocommerce_paypal_pro_settings', array() );\n\n\t\t\t// Show message if enabled and FORCE SSL is disabled and WordpressHTTPS\n\t\t\t// plugin is not detected.\n\t\t\tif ( get_option( 'woocommerce_force_ssl_checkout' ) === 'no'\n\t\t\t\t&& ! class_exists( 'WordPressHTTPS' )\n\t\t\t\t&& isset( $settings['enabled'] )\n\t\t\t\t&& 'yes' === $settings['enabled']\n\t\t\t\t&& 'yes' !== $settings['testmode']\n\t\t\t\t&& ! get_user_meta( get_current_user_id(), '_wc_paypal_pro_ssl_nag_hide' )\n\t\t\t) {\n\t\t\t\techo '<div class=\"error\"><p>' . sprintf( __( 'PayPal Pro requires that the <a href=\"%s\">Force secure checkout</a> option is enabled; your checkout may not be secure! Please enable SSL and ensure your server has a valid SSL certificate - PayPal Pro will only work in test mode.', 'woocommerce-gateway-paypal-pro' ) . ' <a href=\"%s\">' . __( 'Hide Notice', 'woocommerce' ) . '</a>', admin_url( 'admin.php?page=woocommerce' ), wp_nonce_url( add_query_arg( 'wc_paypal_pro_ssl_nag', '1' ), 'wc_paypal_pro_ssl_nag_hide' ) ) . '</p></div>';\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}",
"static public function checkSSL() {\n\t\treturn ($_SERVER['SERVER_PORT'] == self::ssl_port);\n\t}",
"public function getSSLHost()\n {\n return preg_replace('|^http://|i', 'https://', $this->getHost());\n }",
"public function getSecure() {\n return $this->secure;\n }",
"function curl_options(&$curl, $options) {\n if (!curl_setopt_array($curl, $options)) {\n error('Failed to initialize cURL options for ' . spy($curl) . '.');\n }\n\n return $curl;\n}",
"function ssl_cert_found($url) {\n\n\t// First, strip the subfolder from the passed url, if any\n\t$parsedurl = parse_url($url);\n\t$url = 'ssl://' . $parsedurl['host'] . ':443'; \n\t\n\t// Next, check the ssl stream context for certificate info \n\t$result = false;\n\t$context = stream_context_create (array(\"ssl\" => array(\"capture_peer_cert\" => true, \"verify_peer\" => true, \"allow_self_signed\" => true)));\n\t$stream = @stream_socket_client($url, $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $context);\n\tif ($stream !== false)\n\t{\n\t\t$params = stream_context_get_params($stream);\n\t\t$result = isset($params[\"options\"][\"ssl\"][\"peer_certificate\"]) ? true : false;\n\t}\n return $result;\n}",
"public function getSecure()\n\t{\n\t\treturn $this->secure;\n\t}",
"function getSecure()\n {\n return $this->secure;\n }",
"public function isSecure(){\n if(array_key_exists('HTTPS', $this->server)){\n return true;\n }\n return false;\n }",
"public function isSecure(): bool\n {\n //Double check though attributes?\n return $this->request()->getUri()->getScheme() === 'https';\n }",
"public function getServerCertificate() {\n return @$this->attributes['server_certificate'];\n }",
"protected function isSSLEnabled()\n {\n return GeneralUtility::getIndpEnv('TYPO3_SSL');\n }",
"function is_ssl()\n {\n }",
"public function getVerify()\n {\n return $this->data['fields']['verify'];\n }",
"public function isCurlSupported()\n {\n $checking_result = function_exists('curl_init') ? true : false;\n\n if (!$checking_result) {\n App::instance()->setNotification('E', App::instance()->t('error'), App::instance()->t('text_curl_support_notice'), true, 'validator');\n }\n\n return $checking_result;\n }",
"protected function _checkTLSVersion()\n {\n $return = array(\n 'status' => false,\n 'error_message' => ''\n );\n if (defined('CURL_SSLVERSION_TLSv1_2')) {\n $tls_server = $this->context->link->getModuleLink($this->module->name, 'tlscurltestserver');\n $curl = curl_init($tls_server);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);\n $response = curl_exec($curl);\n if ($response != 'ok') {\n $return['status'] = false;\n $curl_info = curl_getinfo($curl);\n if ($curl_info['http_code'] == 401) {\n $return['error_message'] = $this->module->l('401 Unauthorized. Please note that the TLS verification can not be done if you have a htaccess password protection enabled on your website.', 'AdminPayPalController');\n } else {\n $return['error_message'] = curl_error($curl);\n }\n } else {\n $return['status'] = true;\n }\n } else {\n $return['status'] = false;\n if (version_compare(curl_version()['version'], '7.34.0', '<')) {\n $return['error_message'] = $this->module->l('You are using an old version of cURL. Please update your cURL extension to version 7.34.0 or higher.', 'AdminPayPalController');\n } else {\n $return['error_message'] = $this->module->l('TLS version is not compatible', 'AdminPayPalController');\n }\n }\n return $return;\n }",
"public function getIsSecureConnection()\n {\n return isset($_SERVER['HTTPS']) && (strcasecmp($_SERVER['HTTPS'], 'on') === 0 || $_SERVER['HTTPS'] == 1)\n || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strcasecmp($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') === 0;\n }",
"public function isSSL(){\n\n if( !empty( $_SERVER['HTTPS'] ) && ($_SERVER['HTTPS'] != 'off') )\n return true;\n\n if( !empty( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' )\n return true;\n\n return false;\n\n }",
"public function isUsingHttps() {\r\n\t\treturn $this->useHttps;\r\n\t}",
"public function enableSSLChecks() {}",
"public function testSetOption()\n {\n $oCurl = oxNew('oxCurl');\n $oCurl->setOption('CURLOPT_VERBOSE', 0);\n $aOptions = $oCurl->getOptions();\n $this->assertEquals(2, count($aOptions));\n $this->assertEquals(0, $aOptions['CURLOPT_VERBOSE']);\n }",
"public static function get() {\n if (isset($_SERVER['X_PAPAYA_HTTPS'])) {\n $header = $_SERVER['X_PAPAYA_HTTPS'];\n } elseif (isset($_SERVER['HTTP_X_PAPAYA_HTTPS'])) {\n $header = $_SERVER['HTTP_X_PAPAYA_HTTPS'];\n } else {\n $header = NULL;\n }\n if (isset($header) &&\n defined('PAPAYA_HEADER_HTTPS_TOKEN') &&\n strlen(PAPAYA_HEADER_HTTPS_TOKEN) == 32 &&\n $header == PAPAYA_HEADER_HTTPS_TOKEN) {\n return 443;\n }\n return empty($_SERVER['SERVER_PORT']) ? 80 : (int)$_SERVER['SERVER_PORT'];\n }",
"public function getSSLUrl()\n {\n return preg_replace('|^http://|i', 'https://', $this->getUrl());\n }",
"public static function checkHttps()\n\t{\n\t\tif (!ConfigCls::getNeedHttps())\n\t\t\treturn true;\n\n\t\t//Else, return true only if HTTP is set\n\t\tif (!self::httpsUsed())\n\t\t\tdie('HTTPS connection required');\n\t}",
"function curl_option(&$curl, $option, $value) {\n return curl_options($curl, [$option => $value]);\n}",
"static public function getSecurePort() {\n\t\treturn self::ssl_port;\n\t}",
"protected function checkOpenSslInstalled() {}",
"public function https($https) {\n if (is_string($https)) {\n $this->https = $https;\n }\n return $this->https;\n }",
"public function https($https) {\n if (is_string($https)) {\n $this->https = $https;\n }\n return $this->https;\n }",
"public function setup() : void\n {\n // setup ssl options\n $this->options['ssl'] = array(\n 'verify_peer' => true,\n 'verify_peer_name' => true,\n 'allow_self_signed' => true // All root certificates are self-signed\n );\n }",
"public static function getIsSecureConnection()\n {\n return isset($_SERVER['HTTPS']) && (strcasecmp($_SERVER['HTTPS'], 'on') === 0 || $_SERVER['HTTPS'] == 1)\n || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strcasecmp($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') === 0;\n }"
] | [
"0.7294176",
"0.6806716",
"0.65023905",
"0.6446547",
"0.6419565",
"0.6419565",
"0.6323359",
"0.63040197",
"0.62865126",
"0.62145185",
"0.6202334",
"0.6133987",
"0.6125497",
"0.61195713",
"0.6062529",
"0.60503244",
"0.5997765",
"0.59941584",
"0.59659374",
"0.59659374",
"0.59659374",
"0.5878216",
"0.5867702",
"0.581266",
"0.574244",
"0.57289135",
"0.5721285",
"0.57061356",
"0.57061136",
"0.56815106",
"0.5572992",
"0.5566938",
"0.55498576",
"0.5506755",
"0.5506161",
"0.550454",
"0.5491316",
"0.54804677",
"0.5469961",
"0.5444964",
"0.54423666",
"0.54169273",
"0.53929573",
"0.53365",
"0.5329876",
"0.53282624",
"0.53252673",
"0.53162485",
"0.5312831",
"0.530418",
"0.530418",
"0.52999353",
"0.52969474",
"0.5281587",
"0.5279628",
"0.52745605",
"0.52721417",
"0.52721417",
"0.527009",
"0.5265674",
"0.52647144",
"0.5258475",
"0.5246259",
"0.52206826",
"0.5220353",
"0.52133137",
"0.520155",
"0.51980454",
"0.519804",
"0.5195426",
"0.51924574",
"0.51725525",
"0.5164001",
"0.51537496",
"0.5152586",
"0.51475453",
"0.5143348",
"0.51319265",
"0.5116608",
"0.51021785",
"0.50900435",
"0.50895715",
"0.50783265",
"0.5075262",
"0.50731057",
"0.5070636",
"0.50678825",
"0.50635237",
"0.50590885",
"0.5058277",
"0.5047976",
"0.50452125",
"0.50320005",
"0.50278705",
"0.50229806",
"0.50167286",
"0.50117517",
"0.50117517",
"0.5009532",
"0.50037605"
] | 0.68446076 | 1 |
Setter for curl's option to verify SSL peer. | public function setSSLVerifyHost(bool $verifySSLHost) {
$this->SSLVerifyHost = ($verifySSLHost) ? 2 : 0;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setSSLVerifyPeer(bool $verifySSLPeer) {\r\n\t\t$this->SSLVerifyPeer = $verifySSLPeer;\r\n\t\treturn $this;\r\n\t}",
"protected function _configureVerifyHost() {\n if ($this->_do_not_verify_host) {\n $this->setOpt(CURLOPT_SSL_VERIFYHOST, FALSE);\n }\n\n if ($this->_do_not_verify_peer) {\n $this->setOpt(CURLOPT_SSL_VERIFYPEER, FALSE);\n }\n return $this;\n }",
"public function setSslVerifyPeer(bool $sslVerifyPeer)\n {\n $this->sslVerifyPeer = $sslVerifyPeer;\n }",
"public function setVerifySsl($verify_ssl)\n {\n $this->verify_ssl = $verify_ssl;\n }",
"public function getSslVerifyPeer(): bool\n {\n return $this->sslVerifyPeer;\n }",
"public function setVerifyPeerSSL($verifyPeerSSL)\n {\n $this->verifyPeerSSL = $verifyPeerSSL;\n\n return $this;\n }",
"private function setSSL()\n {\n curl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);\n }",
"public function doNotVerifySslCert(): self\n\t{\n\t\t$this->sslOptions['verify_peer'] = false;\n\t\t$this->sslOptions['verify_peer_name'] = false;\n\n\t\treturn $this;\n\t}",
"public function getVerifyPeerSSL()\n {\n return $this->verifyPeerSSL;\n }",
"public function getSSLVerifyPeer() {\r\n\t\treturn $this->SSLVerifyPeer;\r\n\t}",
"public function isVerifySsl()\n {\n return $this->verify_ssl;\n }",
"public function setup() : void\n {\n // setup ssl options\n $this->options['ssl'] = array(\n 'verify_peer' => true,\n 'verify_peer_name' => true,\n 'allow_self_signed' => true // All root certificates are self-signed\n );\n }",
"function ds_https_verify()\r\n{\r\n\tadd_filter( 'https_ssl_verify', '__return_false' );\r\n}",
"private function configureSslValidation()\n {\n if ($this->config[ 'cas_validation' ] == 'self') {\n phpCAS::setCasServerCert($this->config[ 'cas_cert' ]);\n } else {\n if ($this->config[ 'cas_validation' ] == 'ca') {\n phpCAS::setCasServerCACert($this->config[ 'cas_cert' ]);\n } else {\n phpCAS::setNoCasServerValidation();\n }\n }\n }",
"public function verifyPeer() {\n $this->_do_not_verify_peer = FALSE;\n return $this;\n }",
"public function setDisableSslVerify($b = true) {\n $this->disableSslVerify = $b;\n if ($b) {\n $this->log('Caution: Disabling SSL verification.', 'Warning');\n }\n }",
"function setVerifySslCertificates($verify_ssl_certificates) {\n $this->fields['verify_ssl_certificates'] = $verify_ssl_certificates;\n return $this;\n }",
"function setVerifySslCertificates($verify_ssl_certificates) {\n $this->fields['verify_ssl_certificates'] = $verify_ssl_certificates;\n return $this;\n }",
"public function forceSSL();",
"public function forceSSL();",
"public function enableSSLChecks() {}",
"public function setSslOptions(?array $options = null) {}",
"public function setUseSSL($use_ssl){\r\n\t\t$this->useSSL = $use_ssl;\r\n\t}",
"public function set_use_ssl($_use_ssl)\n {\n $this->_use_ssl = $_use_ssl;\n }",
"public function getSSLVerifyHost() {\r\n\t\treturn $this->SSLVerifyHost;\r\n\t}",
"public function getSSLVerification()\n {\n return $this->sslVerification;\n }",
"public function getSSLVerification()\n {\n return $this->sslVerification;\n }",
"public function ignoreSSLErrors()\r\n {\r\n $this->commandLineOptions[] = '--ignore-ssl-errors=true';\r\n $this->commandLineOptions[] = '--ssl-protocol=tlsv1';\r\n }",
"public function useSecureProtocol($protocol)\n {\n if($protocol == true)\n {\n $this->protocol = 'https';\n }\n else\n {\n $this->protocol = 'http';\n }\n }",
"public function setVerify(bool $verify): void\n {\n }",
"public function setInsecure()\n\t{\n\t\t$this->insecure = true;\n\t}",
"public function getUseSSL(){\r\n\t\treturn $this->useSSL;\r\n\t}",
"public function setSSLVerification($sslVerification)\n {\n $this->sslVerification = $sslVerification;\n return $this;\n }",
"public function setSSLVerification($sslVerification)\n {\n $this->sslVerification = $sslVerification;\n return $this;\n }",
"public function disableSSLChecks() {}",
"public function addSslOptions(array $option) {}",
"public function testIsSSLC() {\n // To revert\n $original_port = ( isset( $_SERVER['SERVER_PORT'] ) ) ? $_SERVER['SERVER_PORT'] : NULL;\n\n // If it's HTTPS is not set, but the port is, SSL\n $_SERVER['SERVER_PORT'] = 443;\n\n // Should be SSL!\n $this->assertTrue( security::is_ssl() );\n\n // Revert\n $_SERVER['SERVER_PORT'] = $original_port;\n }",
"function phpmailer_wp_smtp_disable_peer_verification( $phpmailer ) {\n\n $phpmailer->SMTPOptions = array(\n 'ssl' => [\n 'verify_peer' => false,\n 'verify_depth' => 3,\n 'allow_self_signed' => true\n\t]\n );\n\n return $phpmailer;\n}",
"protected function getSslVerifyPeer(InputInterface $input)\n {\n $ssl_verify_peer = true;\n\n if ($input->getOption('dont-verify-ssl-peer')) {\n $ssl_verify_peer = false;\n }\n\n return $ssl_verify_peer;\n }",
"public static function verify_ssl_certificate($stream, $host)\n {\n }",
"public function getUseSsl()\n {\n return $this->use_ssl;\n }",
"public function set_use_tls($_use_tls)\n {\n $this->_use_tls = $_use_tls;\n }",
"#[Pure]\n public function getSslOptions() {}",
"public function get_use_ssl()\n {\n return $this->_use_ssl;\n }",
"protected static function CheckSSLConnection($sHost)\n\t{\n\t\t$errno = 0;\n\t\t$errstr = 'No error';\n\t\t$fp = @stream_socket_client('ssl://'.$sHost, $errno, $errstr, 5);\n\t\tif (($fp === false) && ($errno === 0))\n\t\t{\n\t\t\t// Failed to connect, check for SSL certificate problems\n\t\t\t$aStreamContextOptions = array(\n\t\t\t\t\t'ssl' => array(\n\t\t\t\t\t\t\t'verify_peer' => 0,\n\t\t\t\t\t\t\t'verify_peer_name' => 0,\n\t\t\t\t\t\t\t'allow_self_signed' => 1,\n\t\t\t\t\t)\n\t\t\t);\n\t\t\t$context = stream_context_create($aStreamContextOptions);\n\t\t\t$fp = @stream_socket_client('ssl://'.$sHost, $errno, $errstr, 5, STREAM_CLIENT_CONNECT, $context);\n\t\t\tif ($fp === false)\n\t\t\t{\n\t\t\t\tUtils::Log(LOG_CRIT, \"Failed to connect to https://$sHost (Error $errno: $errstr)\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tUtils::Log(LOG_CRIT, \"Failed to connect to https://$sHost - Invalid SSL certificate.\\nYou can add the following 'vsphere_connection_options' to your configuration file (conf/params.local.xml) to bypass this check:\\n<vsphere_connection_options>\\n\\t<ssl>\\n\\t\\t<verify_peer>0</verify_peer>\\n\\t\\t<verify_peer_name>0</verify_peer_name>\\n\\t\\t<allow_self_signed>1</allow_self_signed>\\n\\t</ssl>\\n</vsphere_connection_options>\\n\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\telse if ($fp === false)\n\t\t{\n\t\t\tUtils::Log(LOG_CRIT, \"Failed to connect to https://$sHost (Error $errno: $errstr)\");\n\t\t\treturn false;\n\t\t}\n\t\tUtils::Log(LOG_DEBUG, \"Connection to https://$sHost Ok.\");\n\t\treturn true; // Ok this works\n\t}",
"public function getSSL() \n {\n return (bool)$this->_ssl;\n }",
"public function setInsecureSsl(string $insecureSsl) : self\n {\n $this->initialized['insecureSsl'] = true;\n $this->insecureSsl = $insecureSsl;\n return $this;\n }",
"public function _settings_field_ssl() {\n global $zendesk_support;\n $ssl = (bool) $zendesk_support->settings['ssl'];\n ?>\n <?php if ( $ssl ): ?>\n <span class=\"description\"><?php _e( 'Your account is using SSL', 'zendesk' ); ?></span>\n <?php else: ?>\n <span class=\"description\"><?php _e( 'Your account is <strong>not</strong> using SSL', 'zendesk' ); ?></span>\n <?php endif; ?>\n <?php\n }",
"protected function _useCurl(array $headerArray = array(), $p_sslVerifypeer = null, $p_sslVerifyhost = null)\n\t{\n\t\t// init curl\n\t\t$ch = curl_init();\n\t\t\n\t\t// set curl options\n\t\tcurl_setopt($ch, CURLOPT_URL, $this->url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_FAILONERROR, true);\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 5);\n\n\t\tif(substr((string)$this->url, 0, 5) == 'https')\n\t\t{\n\t\t\tif($p_sslVerifypeer !== null)\n\t\t\t{\n\t\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (bool)$p_sslVerifypeer);\n\t\t\t}\n\n\t\t\tif($p_sslVerifyhost !== null)\n\t\t\t{\n\t\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, (bool)$p_sslVerifyhost);\n\t\t\t}\n\t\t}\n\n\t\tif(!empty($headerArray) && is_array($headerArray))\n\t\t{\n\t\t\tforeach($headerArray as $headerData)\n\t\t\t{\n\t\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array($headerData));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// execute curl\n\t\t$data = curl_exec($ch);\n\t\t\n\t\t// if curl error, return false\n\t\tif(curl_errno($ch))\n\t\t{\n\t\t\t$data = $this->use_iframe('');\n\t\t}\n\t\t\n\t\t// close curl\n\t\tcurl_close($ch);\n\n\t\treturn $data;\n\t}",
"private function setCurl($is_https = false)\n {\n // Init\n $this->curl = curl_init();\n // Sets basic parameters\n curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($this->curl, CURLOPT_TIMEOUT, isset($this->request->settings['timeout']) ? $this->request->settings['timeout'] : 100);\n // Set parameters to maintain cookies across sessions\n curl_setopt($this->curl, CURLOPT_COOKIESESSION, true);\n curl_setopt($this->curl, CURLOPT_COOKIEFILE, sys_get_temp_dir() . '/cookies_file');\n curl_setopt($this->curl, CURLOPT_COOKIEJAR, sys_get_temp_dir() . '/cookies_file');\n curl_setopt($this->curl, CURLOPT_USERAGENT, 'OLEGNAX-PURCHASE-VERIFY');\n if ($is_https) {\n $this->setSSL();\n }\n }",
"protected function sslCheck()\n {\n $ssl_port = '443'; // default\n if(\n isset($_SERVER['OPENSSL_CONF'])\n || isset($_SERVER['SSL_PROTOCOL'])\n || preg_match('~SSL~',$_SERVER['SERVER_SOFTWARE']))\n {\n try {\n $context = stream_context_create();\n stream_context_set_option($context, \"ssl\", \"verify_peer\", false);\n $SSL_Check = @stream_socket_client( 'ssl://'.$_SERVER['SERVER_NAME'].':'.$ssl_port, $errno, $errstr, ini_get(\"default_socket_timeout\"), STREAM_CLIENT_CONNECT , $context);\n if (!$SSL_Check) {\n return false;\n } else {\n fclose($SSL_Check);\n return true;\n }\n } catch( Exception $e ) {\n return false;\n }\n }\n }",
"function force_ssl() {\n\t global $psts;\n return (bool)$psts->get_setting('stripe_ssl', false);\n\t}",
"function wp_cron_conditionally_prevent_sslverify($request)\n {\n }",
"public function testSetOption()\n {\n $oCurl = oxNew('oxCurl');\n $oCurl->setOption('CURLOPT_VERBOSE', 0);\n $aOptions = $oCurl->getOptions();\n $this->assertEquals(2, count($aOptions));\n $this->assertEquals(0, $aOptions['CURLOPT_VERBOSE']);\n }",
"public function ssl_check() {\n\n\t\t\t$settings = get_option( 'woocommerce_paypal_pro_settings', array() );\n\n\t\t\t// Show message if enabled and FORCE SSL is disabled and WordpressHTTPS\n\t\t\t// plugin is not detected.\n\t\t\tif ( get_option( 'woocommerce_force_ssl_checkout' ) === 'no'\n\t\t\t\t&& ! class_exists( 'WordPressHTTPS' )\n\t\t\t\t&& isset( $settings['enabled'] )\n\t\t\t\t&& 'yes' === $settings['enabled']\n\t\t\t\t&& 'yes' !== $settings['testmode']\n\t\t\t\t&& ! get_user_meta( get_current_user_id(), '_wc_paypal_pro_ssl_nag_hide' )\n\t\t\t) {\n\t\t\t\techo '<div class=\"error\"><p>' . sprintf( __( 'PayPal Pro requires that the <a href=\"%s\">Force secure checkout</a> option is enabled; your checkout may not be secure! Please enable SSL and ensure your server has a valid SSL certificate - PayPal Pro will only work in test mode.', 'woocommerce-gateway-paypal-pro' ) . ' <a href=\"%s\">' . __( 'Hide Notice', 'woocommerce' ) . '</a>', admin_url( 'admin.php?page=woocommerce' ), wp_nonce_url( add_query_arg( 'wc_paypal_pro_ssl_nag', '1' ), 'wc_paypal_pro_ssl_nag_hide' ) ) . '</p></div>';\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}",
"function qa_is_https_probably()\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\treturn (@$_SERVER['HTTPS'] && ($_SERVER['HTTPS'] != 'off')) || (@$_SERVER['SERVER_PORT'] == 443);\n}",
"public static function setSsl() {\n $attr = conf::getMainIni('mysql_attr');\n if (isset($attr['mysql_attr'])) {\n self::$dbh->setAttribute(PDO::MYSQL_ATTR_SSL_KEY, $attr['ssl_key']);\n self::$dbh->setAttribute(PDO::MYSQL_ATTR_SSL_CERT, $attr['ssl_cert']);\n self::$dbh->setAttribute(PDO::MYSQL_ATTR_SSL_CA, $attr['ssl_ca']);\n }\n }",
"public function sslresult() {\n return $this->info['ssl_verify_result'];\n }",
"function parcelcheckout_getUrlCertificate($sUrl, $bDebug = false)\n\t{\n\t\tif($bDebug || parcelcheckout_getDebugMode())\n\t\t{\n\t\t\tif(version_compare(PHP_VERSION, '5.3.0') < 0)\n\t\t\t{\n\t\t\t\tparcelcheckout_log('PHP version is to low for retrieving certificates.', __FILE__, __LINE__);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($oStream = @stream_context_create(array('ssl' => array('capture_peer_cert' => true))))\n\t\t\t\t{\n\t\t\t\t\tparcelcheckout_log('Fetching peer certificate for: ' . $sUrl, __FILE__, __LINE__);\n\n\t\t\t\t\tif($oHandle = @fopen($sUrl, 'rb', false, $oStream))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(function_exists('stream_context_get_params'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$aParams = stream_context_get_params($oHandle);\n\n\t\t\t\t\t\t\tif(isset($aParams['options'], $aParams['options']['ssl'], $aParams['options']['ssl']['peer_certificate']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$oPeerCertificate = $aParams['options']['ssl']['peer_certificate'];\n\n\t\t\t\t\t\t\t\t$sTempPath = dirname(__DIR__) . '/temp';\n\n\t\t\t\t\t\t\t\t// Save certificate\n\t\t\t\t\t\t\t\tif(@openssl_x509_export_to_file($oPeerCertificate, $sTempPath . '/peer.' . time() . '.crt'))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\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}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tparcelcheckout_log('Stream function does not exist on this PHP version.', __FILE__, __LINE__);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tparcelcheckout_log('Peer certificate capture failed for: ' . $sUrl, __FILE__, __LINE__);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"function force_ssl_login($force = \\null)\n {\n }",
"private function has_certificate() {\n\t\t// Get siteurl.\n\t\t$home_url = get_option( 'siteurl' );\n\n\t\t// Change siteurl protocol.\n\t\tif ( preg_match( '/^http\\:/s', $home_url ) ) {\n\t\t\t$home_url = str_replace( 'http', 'https', $home_url );\n\t\t}\n\n\t\t$site_url = add_query_arg(\n\t\t\t'sgCacheCheck', // The key.\n\t\t\t'022870ae06716782ce17e4f6e7f69cc2', // The value.\n\t\t\t$home_url\n\t\t);\n\n\t\tini_set( 'user_agent', 'SG-Optimizer 3.0.2;' );\n\t\t// Create a streams context.\n\t\t$stream = stream_context_create(\n\t\t\tarray(\n\t\t\t\t'ssl' => array(\n\t\t\t\t\t'capture_peer_cert' => true,\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$read = @fopen( $site_url, 'rb', false, $stream );\n\t\t$cont = @stream_context_get_params( $read );\n\n\t\treturn is_null( $cont['options']['ssl']['peer_certificate'] ) ? false : true;\n\t}",
"function setServerSsl($inParamValue) {\n\t\treturn $this->setParam(self::PARAM_SERVER_SSL, $inParamValue);\n\t}",
"function getServerSsl() {\n\t\treturn $this->getParam(self::PARAM_SERVER_SSL);\n\t}",
"protected function configure(array $options): void\n {\n $options = \\array_merge([\n 'timeout_connect' => self::TIMEOUT_CONNECT,\n 'ssl_verify_peer' => false,\n 'ssl_allow_self_signed' => true,\n ], $options);\n\n parent::configure($options);\n }",
"private function checkSecureUrl()\n {\n $custom_ssl_var = 0;\n if (isset($_SERVER['HTTPS'])) {\n if ($_SERVER['HTTPS'] == 'on') {\n $custom_ssl_var = 1;\n }\n } else if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {\n $custom_ssl_var = 1;\n }\n if ((bool) Configuration::get('PS_SSL_ENABLED') && $custom_ssl_var == 1) {\n return true;\n } else {\n return false;\n }\n }",
"public static function setServerProxyValidateURL($url = '') \n\t{\n\t\tacPhpCas::setReporting();\n\t\tphpCAS::setServerProxyValidateURL($url);\t\t\n\t}",
"public function isSsl();",
"public function getInsecureSsl() : string\n {\n return $this->insecureSsl;\n }",
"public function getSsl() {\n return @$this->attributes['ssl'];\n }",
"public static function setExtraCurlOption($key, $value) \n\t{\n\t\tacPhpCas::setReporting();\n\t\tphpCAS::setExtraCurlOption($key, $value);\t\t\n\t}",
"function force_ssl_admin($force = \\null)\n {\n }",
"public static function setServerSamlValidateURL($url = '') \n\t{\n\t\tacPhpCas::setReporting();\n\t\tphpCAS::setServerSamlValidateURL($url);\t\t\n\t}",
"public function sslcert($value): self\n {\n $this->sslcert = $value;\n \n return $this;\n }",
"function get_ssl($ssl_port){\n\t\tif($ssl_port == 80){\n\t\t\t$this->ssl = 'http';\n\t\t}\n\t\telse {\n\t\t\t$this->ssl = 'https';\n\t\t}\n\t}",
"function get_ssl($ssl_port){\n\t\tif($ssl_port == 80){\n\t\t\t$this->ssl = 'http';\n\t\t}\n\t\telse {\n\t\t\t$this->ssl = 'https';\n\t\t}\n\t}",
"public function setCurlOptions(array $options)\n {\n $this->curl_options = $options;\n\n // We need to reinitialize the SOAP client.\n $this->soap = null;\n }",
"function curl_options(&$curl, $options) {\n if (!curl_setopt_array($curl, $options)) {\n error('Failed to initialize cURL options for ' . spy($curl) . '.');\n }\n\n return $curl;\n}",
"public function set_curl_options(array $curl_options = array())\n {\n }",
"public static function setSSL($enabled, $validate = true)\n\t{\n\t\tself::$useSSL = $enabled;\n\t\tself::$useSSLValidation = $validate;\n\t}",
"static function http_api_curl($handle, $r, $url) {\n\t\t\tif(strpos($url, 'paypal.com') !== false)\n\t\t\t\tcurl_setopt( $handle, CURLOPT_SSLVERSION, 6 );\n\t\t}",
"static public function checkSSL() {\n\t\treturn ($_SERVER['SERVER_PORT'] == self::ssl_port);\n\t}",
"public function enableSslHostCheck()\n {\n $this->sslHostCheckEnabled = true;\n }",
"public function usesHttps()\n {\n return $this->useHttps;\n }",
"public function get_test_ssl_support()\n {\n }",
"public function testIsSSLB() {\n // To revert\n $https = ( isset( $_SERVER['HTTPS'] ) ) ? $_SERVER['HTTPS'] : NULL;\n\n // If it's on, it should be ssl\n $_SERVER['HTTPS'] = 'on';\n\n // Should be SSL!\n $this->assertTrue( security::is_ssl() );\n\n // Revert\n $_SERVER['HTTPS'] = $https;\n }",
"public function verifyHost() {\n $this->_do_not_verify_host = FALSE;\n return $this;\n }",
"public function testIsSSLD() {\n // If it's HTTPS is set, SSL\n $_SERVER['HTTP_X_FORWARDED_PROTO'] = 'HTTPS';\n\n $this->assertTrue( security::is_ssl() );\n }",
"public function checkSslBackendAndRedirectIfNeeded() {}",
"public function secureSsl()\n {\n return $this->secureSsl;\n }",
"protected function checkOpenSslInstalled() {}",
"protected function getOAuthCurlOpts()\n\t{\n\t\treturn array(CURLOPT_SSL_VERIFYPEER => false);\n\t}",
"public function isSSL()\n {\n if (is_null($this->is_ssl)) {\n $server = provider::access('server');\n\n $this->is_ssl = (\n $server->isExist('HTTP_HOST') &&\n $server->isExist('HTTPS') &&\n $server->isValid('HTTPS', validate::T_PATTERN, array('pattern' => '/on/i'))\n );\n }\n\n return $this->is_ssl;\n }",
"public function get_use_tls()\n {\n return $this->_use_tls;\n }",
"public function setSsl($ssl)\n {\n $this->ssl = (bool) $ssl;\n\n return $this;\n }",
"public function https_url($url)\n {\n }",
"public function useHttps($flag = true) {\r\n\t\t$this->useHttps = true;\r\n\t\treturn $this;\r\n\t}",
"public function setIsSecure($flag = true)\n {\n $this->setServer('HTTPS', $flag ? 'on' : null);\n return $this;\n }",
"public static function checkHttps()\n\t{\n\t\tif (!ConfigCls::getNeedHttps())\n\t\t\treturn true;\n\n\t\t//Else, return true only if HTTP is set\n\t\tif (!self::httpsUsed())\n\t\t\tdie('HTTPS connection required');\n\t}",
"public function setVerify($value)\n {\n if (!array_key_exists('verify', $this->fieldsModified)) {\n $this->fieldsModified['verify'] = $this->data['fields']['verify'];\n } elseif ($value === $this->fieldsModified['verify']) {\n unset($this->fieldsModified['verify']);\n }\n\n $this->data['fields']['verify'] = $value;\n }",
"protected function _setCurlOpts() {\n $this->_setCurlOptArray($this->_getCurlOpts());\n }"
] | [
"0.69328046",
"0.6882348",
"0.67372304",
"0.6650963",
"0.64770794",
"0.64371765",
"0.64217913",
"0.6301226",
"0.6255012",
"0.620653",
"0.60062057",
"0.5923588",
"0.58986413",
"0.5856279",
"0.5849234",
"0.5824339",
"0.5633482",
"0.5633482",
"0.56257474",
"0.56257474",
"0.5603582",
"0.54879194",
"0.54610306",
"0.5456075",
"0.5447989",
"0.53671217",
"0.53671217",
"0.5360848",
"0.5335813",
"0.5325356",
"0.53068197",
"0.526876",
"0.5258722",
"0.5258722",
"0.5233455",
"0.5225094",
"0.52149403",
"0.5212633",
"0.52034533",
"0.51871324",
"0.51746064",
"0.5166694",
"0.516013",
"0.5156863",
"0.5154779",
"0.5142405",
"0.51399523",
"0.5139331",
"0.51128304",
"0.5106693",
"0.51056474",
"0.50943893",
"0.50858176",
"0.50624305",
"0.5056432",
"0.5030619",
"0.5019946",
"0.50179887",
"0.5002632",
"0.4990357",
"0.4980112",
"0.49672186",
"0.4931397",
"0.4906867",
"0.4904847",
"0.48987734",
"0.4888111",
"0.48849636",
"0.48819256",
"0.48789638",
"0.48726392",
"0.48673522",
"0.48670125",
"0.4852373",
"0.4852373",
"0.4843875",
"0.4835444",
"0.48335394",
"0.48255658",
"0.48248166",
"0.4824289",
"0.4821295",
"0.48178115",
"0.48144737",
"0.48080894",
"0.47970003",
"0.47857815",
"0.47827378",
"0.47797048",
"0.47704133",
"0.47698307",
"0.47687885",
"0.47669476",
"0.4763313",
"0.47541246",
"0.47525644",
"0.4745122",
"0.47375363",
"0.4730573",
"0.47279483"
] | 0.6544286 | 4 |
Getter for curl's option to verify SSL peer. | public function getSSLVerifyHost() {
return $this->SSLVerifyHost;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getVerifyPeerSSL()\n {\n return $this->verifyPeerSSL;\n }",
"public function getSSLVerifyPeer() {\r\n\t\treturn $this->SSLVerifyPeer;\r\n\t}",
"public function getSslVerifyPeer(): bool\n {\n return $this->sslVerifyPeer;\n }",
"#[Pure]\n public function getSslOptions() {}",
"protected function _configureVerifyHost() {\n if ($this->_do_not_verify_host) {\n $this->setOpt(CURLOPT_SSL_VERIFYHOST, FALSE);\n }\n\n if ($this->_do_not_verify_peer) {\n $this->setOpt(CURLOPT_SSL_VERIFYPEER, FALSE);\n }\n return $this;\n }",
"public function getSSLVerification()\n {\n return $this->sslVerification;\n }",
"public function getSSLVerification()\n {\n return $this->sslVerification;\n }",
"public function isVerifySsl()\n {\n return $this->verify_ssl;\n }",
"public function getSSL() \n {\n return (bool)$this->_ssl;\n }",
"function getServerSsl() {\n\t\treturn $this->getParam(self::PARAM_SERVER_SSL);\n\t}",
"public function getUseSSL(){\r\n\t\treturn $this->useSSL;\r\n\t}",
"public function getSsl() {\n return @$this->attributes['ssl'];\n }",
"public function getUseSsl()\n {\n return $this->use_ssl;\n }",
"public function sslresult() {\n return $this->info['ssl_verify_result'];\n }",
"public function get_use_ssl()\n {\n return $this->_use_ssl;\n }",
"public function setSSLVerifyPeer(bool $verifySSLPeer) {\r\n\t\t$this->SSLVerifyPeer = $verifySSLPeer;\r\n\t\treturn $this;\r\n\t}",
"public function getSsl()\n {\n return $this->getConfig('ssl');\n }",
"protected function getSslVerifyPeer(InputInterface $input)\n {\n $ssl_verify_peer = true;\n\n if ($input->getOption('dont-verify-ssl-peer')) {\n $ssl_verify_peer = false;\n }\n\n return $ssl_verify_peer;\n }",
"public function getSsl()\n {\n return $this->ssl;\n }",
"public function getSsl()\n {\n return $this->ssl;\n }",
"public function getSsl()\n {\n return $this->ssl;\n }",
"public function secureSsl()\n {\n return $this->secureSsl;\n }",
"public function getInsecureSsl() : string\n {\n return $this->insecureSsl;\n }",
"public function sslGetProtocol(): string {}",
"private function has_certificate() {\n\t\t// Get siteurl.\n\t\t$home_url = get_option( 'siteurl' );\n\n\t\t// Change siteurl protocol.\n\t\tif ( preg_match( '/^http\\:/s', $home_url ) ) {\n\t\t\t$home_url = str_replace( 'http', 'https', $home_url );\n\t\t}\n\n\t\t$site_url = add_query_arg(\n\t\t\t'sgCacheCheck', // The key.\n\t\t\t'022870ae06716782ce17e4f6e7f69cc2', // The value.\n\t\t\t$home_url\n\t\t);\n\n\t\tini_set( 'user_agent', 'SG-Optimizer 3.0.2;' );\n\t\t// Create a streams context.\n\t\t$stream = stream_context_create(\n\t\t\tarray(\n\t\t\t\t'ssl' => array(\n\t\t\t\t\t'capture_peer_cert' => true,\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$read = @fopen( $site_url, 'rb', false, $stream );\n\t\t$cont = @stream_context_get_params( $read );\n\n\t\treturn is_null( $cont['options']['ssl']['peer_certificate'] ) ? false : true;\n\t}",
"public function httpsOnly()\n {\n return $this->secure();\n }",
"public function setVerifyPeerSSL($verifyPeerSSL)\n {\n $this->verifyPeerSSL = $verifyPeerSSL;\n\n return $this;\n }",
"public function get_use_tls()\n {\n return $this->_use_tls;\n }",
"public function setSSLVerifyHost(bool $verifySSLHost) {\r\n\t\t$this->SSLVerifyHost = ($verifySSLHost) ? 2 : 0;\r\n\t\treturn $this;\r\n\t}",
"public function getSslCertificate() {\n return @$this->attributes['ssl_certificate'];\n }",
"public function doNotVerifySslCert(): self\n\t{\n\t\t$this->sslOptions['verify_peer'] = false;\n\t\t$this->sslOptions['verify_peer_name'] = false;\n\n\t\treturn $this;\n\t}",
"private function setSSL()\n {\n curl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1);\n }",
"public function getCurlOptions()\n {\n return $this->curlOptions;\n }",
"public function getSSLConnection()\r\n {\r\n return $this->sslConnection;\r\n }",
"public function isSsl();",
"function parcelcheckout_getUrlCertificate($sUrl, $bDebug = false)\n\t{\n\t\tif($bDebug || parcelcheckout_getDebugMode())\n\t\t{\n\t\t\tif(version_compare(PHP_VERSION, '5.3.0') < 0)\n\t\t\t{\n\t\t\t\tparcelcheckout_log('PHP version is to low for retrieving certificates.', __FILE__, __LINE__);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($oStream = @stream_context_create(array('ssl' => array('capture_peer_cert' => true))))\n\t\t\t\t{\n\t\t\t\t\tparcelcheckout_log('Fetching peer certificate for: ' . $sUrl, __FILE__, __LINE__);\n\n\t\t\t\t\tif($oHandle = @fopen($sUrl, 'rb', false, $oStream))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(function_exists('stream_context_get_params'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$aParams = stream_context_get_params($oHandle);\n\n\t\t\t\t\t\t\tif(isset($aParams['options'], $aParams['options']['ssl'], $aParams['options']['ssl']['peer_certificate']))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$oPeerCertificate = $aParams['options']['ssl']['peer_certificate'];\n\n\t\t\t\t\t\t\t\t$sTempPath = dirname(__DIR__) . '/temp';\n\n\t\t\t\t\t\t\t\t// Save certificate\n\t\t\t\t\t\t\t\tif(@openssl_x509_export_to_file($oPeerCertificate, $sTempPath . '/peer.' . time() . '.crt'))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\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}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tparcelcheckout_log('Stream function does not exist on this PHP version.', __FILE__, __LINE__);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tparcelcheckout_log('Peer certificate capture failed for: ' . $sUrl, __FILE__, __LINE__);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public function get_https_url(): ?string;",
"function qa_is_https_probably()\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\treturn (@$_SERVER['HTTPS'] && ($_SERVER['HTTPS'] != 'off')) || (@$_SERVER['SERVER_PORT'] == 443);\n}",
"function get_ssl_detail($url) {\n $url = (strpos($url, \"https://\") !== false) ? $url : '';\n $certinfo = '';\n if ($url) {\n $orignal_parse = parse_url($url, PHP_URL_HOST);\n $get = stream_context_create(array(\"ssl\" => array(\"capture_peer_cert\" => TRUE)));\n $read = stream_socket_client(\"ssl://\" . $orignal_parse . \":443\", $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $get);\n $cert = stream_context_get_params($read);\n $certinfo = openssl_x509_parse($cert['options']['ssl']['peer_certificate']);\n }\n return ($certinfo) ? $certinfo : false;\n}",
"public function _settings_field_ssl() {\n global $zendesk_support;\n $ssl = (bool) $zendesk_support->settings['ssl'];\n ?>\n <?php if ( $ssl ): ?>\n <span class=\"description\"><?php _e( 'Your account is using SSL', 'zendesk' ); ?></span>\n <?php else: ?>\n <span class=\"description\"><?php _e( 'Your account is <strong>not</strong> using SSL', 'zendesk' ); ?></span>\n <?php endif; ?>\n <?php\n }",
"public function isSSL()\n {\n if (is_null($this->is_ssl)) {\n $server = provider::access('server');\n\n $this->is_ssl = (\n $server->isExist('HTTP_HOST') &&\n $server->isExist('HTTPS') &&\n $server->isValid('HTTPS', validate::T_PATTERN, array('pattern' => '/on/i'))\n );\n }\n\n return $this->is_ssl;\n }",
"function ds_https_verify()\r\n{\r\n\tadd_filter( 'https_ssl_verify', '__return_false' );\r\n}",
"static public function getSecureURL() {\n\t\treturn self::$ssl_url;\n\t}",
"protected function getOAuthCurlOpts()\n\t{\n\t\treturn array(CURLOPT_SSL_VERIFYPEER => false);\n\t}",
"public function verifyPeer() {\n $this->_do_not_verify_peer = FALSE;\n return $this;\n }",
"public function sslGetCipherVersion(): string|false {}",
"public function getUseCurl()\n\t{\n\t\treturn false;\n\t}",
"public function setVerifySsl($verify_ssl)\n {\n $this->verify_ssl = $verify_ssl;\n }",
"public function sslGetCipherInfo(): string|false {}",
"public function forceSSL();",
"public function forceSSL();",
"public function get_test_ssl_support()\n {\n }",
"protected function sslCheck()\n {\n $ssl_port = '443'; // default\n if(\n isset($_SERVER['OPENSSL_CONF'])\n || isset($_SERVER['SSL_PROTOCOL'])\n || preg_match('~SSL~',$_SERVER['SERVER_SOFTWARE']))\n {\n try {\n $context = stream_context_create();\n stream_context_set_option($context, \"ssl\", \"verify_peer\", false);\n $SSL_Check = @stream_socket_client( 'ssl://'.$_SERVER['SERVER_NAME'].':'.$ssl_port, $errno, $errstr, ini_get(\"default_socket_timeout\"), STREAM_CLIENT_CONNECT , $context);\n if (!$SSL_Check) {\n return false;\n } else {\n fclose($SSL_Check);\n return true;\n }\n } catch( Exception $e ) {\n return false;\n }\n }\n }",
"public static function isSSL() {\n\t\treturn isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on';\n\t}",
"public function isSecure() : bool\n\t{\n\t\tif ($this->isUsingTrustedProxy() && $protoString = $this->getHeaderLine(self::$trustedHeaderNames[self::CLIENT_PROTO])) {\n\t\t\t$protoArray = explode(',', $protoString);\n\n\t\t\treturn count($protoArray) > 0 && in_array(strtolower($protoArray[0]), ['https', 'ssl', 'on']);\n\t\t}\n\t\t\n\t\t$https = 'off';\n\t\t\n\t\tif (isset($this->getServerParams()['HTTPS'])) {\n\t\t\t$https = $this->getServerParams()['HTTPS'];\n\t\t}\n\t\t\n\t\treturn $https !== 'off';\n\t}",
"public function setSslVerifyPeer(bool $sslVerifyPeer)\n {\n $this->sslVerifyPeer = $sslVerifyPeer;\n }",
"function get_ssl($ssl_port){\n\t\tif($ssl_port == 80){\n\t\t\t$this->ssl = 'http';\n\t\t}\n\t\telse {\n\t\t\t$this->ssl = 'https';\n\t\t}\n\t}",
"function get_ssl($ssl_port){\n\t\tif($ssl_port == 80){\n\t\t\t$this->ssl = 'http';\n\t\t}\n\t\telse {\n\t\t\t$this->ssl = 'https';\n\t\t}\n\t}",
"public function getSecure(): bool\r\n {\r\n return $this->secure;\r\n }",
"protected function _useCurl(array $headerArray = array(), $p_sslVerifypeer = null, $p_sslVerifyhost = null)\n\t{\n\t\t// init curl\n\t\t$ch = curl_init();\n\t\t\n\t\t// set curl options\n\t\tcurl_setopt($ch, CURLOPT_URL, $this->url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_FAILONERROR, true);\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 5);\n\n\t\tif(substr((string)$this->url, 0, 5) == 'https')\n\t\t{\n\t\t\tif($p_sslVerifypeer !== null)\n\t\t\t{\n\t\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, (bool)$p_sslVerifypeer);\n\t\t\t}\n\n\t\t\tif($p_sslVerifyhost !== null)\n\t\t\t{\n\t\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, (bool)$p_sslVerifyhost);\n\t\t\t}\n\t\t}\n\n\t\tif(!empty($headerArray) && is_array($headerArray))\n\t\t{\n\t\t\tforeach($headerArray as $headerData)\n\t\t\t{\n\t\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array($headerData));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// execute curl\n\t\t$data = curl_exec($ch);\n\t\t\n\t\t// if curl error, return false\n\t\tif(curl_errno($ch))\n\t\t{\n\t\t\t$data = $this->use_iframe('');\n\t\t}\n\t\t\n\t\t// close curl\n\t\tcurl_close($ch);\n\n\t\treturn $data;\n\t}",
"public function usesHttps()\n {\n return $this->useHttps;\n }",
"private function checkSecureUrl()\n {\n $custom_ssl_var = 0;\n if (isset($_SERVER['HTTPS'])) {\n if ($_SERVER['HTTPS'] == 'on') {\n $custom_ssl_var = 1;\n }\n } else if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {\n $custom_ssl_var = 1;\n }\n if ((bool) Configuration::get('PS_SSL_ENABLED') && $custom_ssl_var == 1) {\n return true;\n } else {\n return false;\n }\n }",
"function parcelcheckout_getCurlVerificationError()\n\t{\n\t\tglobal $bIdealcheckoutCurlVerificationError;\n\n\t\tif(isset($bIdealcheckoutCurlVerificationError))\n\t\t{\n\t\t\treturn $bIdealcheckoutCurlVerificationError;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function getSecure()\r\n {\r\n return $this->secure;\r\n }",
"public function getEnableCertificateRevocationCheck()\n {\n if (array_key_exists(\"enableCertificateRevocationCheck\", $this->_propDict)) {\n return $this->_propDict[\"enableCertificateRevocationCheck\"];\n } else {\n return null;\n }\n }",
"public function testIsSSLC() {\n // To revert\n $original_port = ( isset( $_SERVER['SERVER_PORT'] ) ) ? $_SERVER['SERVER_PORT'] : NULL;\n\n // If it's HTTPS is not set, but the port is, SSL\n $_SERVER['SERVER_PORT'] = 443;\n\n // Should be SSL!\n $this->assertTrue( security::is_ssl() );\n\n // Revert\n $_SERVER['SERVER_PORT'] = $original_port;\n }",
"protected static function CheckSSLConnection($sHost)\n\t{\n\t\t$errno = 0;\n\t\t$errstr = 'No error';\n\t\t$fp = @stream_socket_client('ssl://'.$sHost, $errno, $errstr, 5);\n\t\tif (($fp === false) && ($errno === 0))\n\t\t{\n\t\t\t// Failed to connect, check for SSL certificate problems\n\t\t\t$aStreamContextOptions = array(\n\t\t\t\t\t'ssl' => array(\n\t\t\t\t\t\t\t'verify_peer' => 0,\n\t\t\t\t\t\t\t'verify_peer_name' => 0,\n\t\t\t\t\t\t\t'allow_self_signed' => 1,\n\t\t\t\t\t)\n\t\t\t);\n\t\t\t$context = stream_context_create($aStreamContextOptions);\n\t\t\t$fp = @stream_socket_client('ssl://'.$sHost, $errno, $errstr, 5, STREAM_CLIENT_CONNECT, $context);\n\t\t\tif ($fp === false)\n\t\t\t{\n\t\t\t\tUtils::Log(LOG_CRIT, \"Failed to connect to https://$sHost (Error $errno: $errstr)\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tUtils::Log(LOG_CRIT, \"Failed to connect to https://$sHost - Invalid SSL certificate.\\nYou can add the following 'vsphere_connection_options' to your configuration file (conf/params.local.xml) to bypass this check:\\n<vsphere_connection_options>\\n\\t<ssl>\\n\\t\\t<verify_peer>0</verify_peer>\\n\\t\\t<verify_peer_name>0</verify_peer_name>\\n\\t\\t<allow_self_signed>1</allow_self_signed>\\n\\t</ssl>\\n</vsphere_connection_options>\\n\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\telse if ($fp === false)\n\t\t{\n\t\t\tUtils::Log(LOG_CRIT, \"Failed to connect to https://$sHost (Error $errno: $errstr)\");\n\t\t\treturn false;\n\t\t}\n\t\tUtils::Log(LOG_DEBUG, \"Connection to https://$sHost Ok.\");\n\t\treturn true; // Ok this works\n\t}",
"public function getSecure()\n {\n return $this->secure;\n }",
"private function configureSslValidation()\n {\n if ($this->config[ 'cas_validation' ] == 'self') {\n phpCAS::setCasServerCert($this->config[ 'cas_cert' ]);\n } else {\n if ($this->config[ 'cas_validation' ] == 'ca') {\n phpCAS::setCasServerCACert($this->config[ 'cas_cert' ]);\n } else {\n phpCAS::setNoCasServerValidation();\n }\n }\n }",
"public function ssl_check() {\n\n\t\t\t$settings = get_option( 'woocommerce_paypal_pro_settings', array() );\n\n\t\t\t// Show message if enabled and FORCE SSL is disabled and WordpressHTTPS\n\t\t\t// plugin is not detected.\n\t\t\tif ( get_option( 'woocommerce_force_ssl_checkout' ) === 'no'\n\t\t\t\t&& ! class_exists( 'WordPressHTTPS' )\n\t\t\t\t&& isset( $settings['enabled'] )\n\t\t\t\t&& 'yes' === $settings['enabled']\n\t\t\t\t&& 'yes' !== $settings['testmode']\n\t\t\t\t&& ! get_user_meta( get_current_user_id(), '_wc_paypal_pro_ssl_nag_hide' )\n\t\t\t) {\n\t\t\t\techo '<div class=\"error\"><p>' . sprintf( __( 'PayPal Pro requires that the <a href=\"%s\">Force secure checkout</a> option is enabled; your checkout may not be secure! Please enable SSL and ensure your server has a valid SSL certificate - PayPal Pro will only work in test mode.', 'woocommerce-gateway-paypal-pro' ) . ' <a href=\"%s\">' . __( 'Hide Notice', 'woocommerce' ) . '</a>', admin_url( 'admin.php?page=woocommerce' ), wp_nonce_url( add_query_arg( 'wc_paypal_pro_ssl_nag', '1' ), 'wc_paypal_pro_ssl_nag_hide' ) ) . '</p></div>';\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}",
"static public function checkSSL() {\n\t\treturn ($_SERVER['SERVER_PORT'] == self::ssl_port);\n\t}",
"public function getSSLHost()\n {\n return preg_replace('|^http://|i', 'https://', $this->getHost());\n }",
"public function getSecure() {\n return $this->secure;\n }",
"function curl_options(&$curl, $options) {\n if (!curl_setopt_array($curl, $options)) {\n error('Failed to initialize cURL options for ' . spy($curl) . '.');\n }\n\n return $curl;\n}",
"function ssl_cert_found($url) {\n\n\t// First, strip the subfolder from the passed url, if any\n\t$parsedurl = parse_url($url);\n\t$url = 'ssl://' . $parsedurl['host'] . ':443'; \n\t\n\t// Next, check the ssl stream context for certificate info \n\t$result = false;\n\t$context = stream_context_create (array(\"ssl\" => array(\"capture_peer_cert\" => true, \"verify_peer\" => true, \"allow_self_signed\" => true)));\n\t$stream = @stream_socket_client($url, $errno, $errstr, 30, STREAM_CLIENT_CONNECT, $context);\n\tif ($stream !== false)\n\t{\n\t\t$params = stream_context_get_params($stream);\n\t\t$result = isset($params[\"options\"][\"ssl\"][\"peer_certificate\"]) ? true : false;\n\t}\n return $result;\n}",
"public function getSecure()\n\t{\n\t\treturn $this->secure;\n\t}",
"function getSecure()\n {\n return $this->secure;\n }",
"public function isSecure(){\n if(array_key_exists('HTTPS', $this->server)){\n return true;\n }\n return false;\n }",
"public function isSecure(): bool\n {\n //Double check though attributes?\n return $this->request()->getUri()->getScheme() === 'https';\n }",
"public function getServerCertificate() {\n return @$this->attributes['server_certificate'];\n }",
"protected function isSSLEnabled()\n {\n return GeneralUtility::getIndpEnv('TYPO3_SSL');\n }",
"function is_ssl()\n {\n }",
"public function getVerify()\n {\n return $this->data['fields']['verify'];\n }",
"public function isCurlSupported()\n {\n $checking_result = function_exists('curl_init') ? true : false;\n\n if (!$checking_result) {\n App::instance()->setNotification('E', App::instance()->t('error'), App::instance()->t('text_curl_support_notice'), true, 'validator');\n }\n\n return $checking_result;\n }",
"protected function _checkTLSVersion()\n {\n $return = array(\n 'status' => false,\n 'error_message' => ''\n );\n if (defined('CURL_SSLVERSION_TLSv1_2')) {\n $tls_server = $this->context->link->getModuleLink($this->module->name, 'tlscurltestserver');\n $curl = curl_init($tls_server);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($curl, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);\n $response = curl_exec($curl);\n if ($response != 'ok') {\n $return['status'] = false;\n $curl_info = curl_getinfo($curl);\n if ($curl_info['http_code'] == 401) {\n $return['error_message'] = $this->module->l('401 Unauthorized. Please note that the TLS verification can not be done if you have a htaccess password protection enabled on your website.', 'AdminPayPalController');\n } else {\n $return['error_message'] = curl_error($curl);\n }\n } else {\n $return['status'] = true;\n }\n } else {\n $return['status'] = false;\n if (version_compare(curl_version()['version'], '7.34.0', '<')) {\n $return['error_message'] = $this->module->l('You are using an old version of cURL. Please update your cURL extension to version 7.34.0 or higher.', 'AdminPayPalController');\n } else {\n $return['error_message'] = $this->module->l('TLS version is not compatible', 'AdminPayPalController');\n }\n }\n return $return;\n }",
"public function getIsSecureConnection()\n {\n return isset($_SERVER['HTTPS']) && (strcasecmp($_SERVER['HTTPS'], 'on') === 0 || $_SERVER['HTTPS'] == 1)\n || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strcasecmp($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') === 0;\n }",
"public function isSSL(){\n\n if( !empty( $_SERVER['HTTPS'] ) && ($_SERVER['HTTPS'] != 'off') )\n return true;\n\n if( !empty( $_SERVER['HTTP_X_FORWARDED_PROTO'] ) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' )\n return true;\n\n return false;\n\n }",
"public function isUsingHttps() {\r\n\t\treturn $this->useHttps;\r\n\t}",
"public function enableSSLChecks() {}",
"public function testSetOption()\n {\n $oCurl = oxNew('oxCurl');\n $oCurl->setOption('CURLOPT_VERBOSE', 0);\n $aOptions = $oCurl->getOptions();\n $this->assertEquals(2, count($aOptions));\n $this->assertEquals(0, $aOptions['CURLOPT_VERBOSE']);\n }",
"public static function get() {\n if (isset($_SERVER['X_PAPAYA_HTTPS'])) {\n $header = $_SERVER['X_PAPAYA_HTTPS'];\n } elseif (isset($_SERVER['HTTP_X_PAPAYA_HTTPS'])) {\n $header = $_SERVER['HTTP_X_PAPAYA_HTTPS'];\n } else {\n $header = NULL;\n }\n if (isset($header) &&\n defined('PAPAYA_HEADER_HTTPS_TOKEN') &&\n strlen(PAPAYA_HEADER_HTTPS_TOKEN) == 32 &&\n $header == PAPAYA_HEADER_HTTPS_TOKEN) {\n return 443;\n }\n return empty($_SERVER['SERVER_PORT']) ? 80 : (int)$_SERVER['SERVER_PORT'];\n }",
"public function getSSLUrl()\n {\n return preg_replace('|^http://|i', 'https://', $this->getUrl());\n }",
"public static function checkHttps()\n\t{\n\t\tif (!ConfigCls::getNeedHttps())\n\t\t\treturn true;\n\n\t\t//Else, return true only if HTTP is set\n\t\tif (!self::httpsUsed())\n\t\t\tdie('HTTPS connection required');\n\t}",
"function curl_option(&$curl, $option, $value) {\n return curl_options($curl, [$option => $value]);\n}",
"static public function getSecurePort() {\n\t\treturn self::ssl_port;\n\t}",
"protected function checkOpenSslInstalled() {}",
"public function https($https) {\n if (is_string($https)) {\n $this->https = $https;\n }\n return $this->https;\n }",
"public function https($https) {\n if (is_string($https)) {\n $this->https = $https;\n }\n return $this->https;\n }",
"public function setup() : void\n {\n // setup ssl options\n $this->options['ssl'] = array(\n 'verify_peer' => true,\n 'verify_peer_name' => true,\n 'allow_self_signed' => true // All root certificates are self-signed\n );\n }",
"public static function getIsSecureConnection()\n {\n return isset($_SERVER['HTTPS']) && (strcasecmp($_SERVER['HTTPS'], 'on') === 0 || $_SERVER['HTTPS'] == 1)\n || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strcasecmp($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') === 0;\n }"
] | [
"0.7294176",
"0.68446076",
"0.6806716",
"0.65023905",
"0.6446547",
"0.6419565",
"0.6419565",
"0.6323359",
"0.63040197",
"0.62865126",
"0.62145185",
"0.6202334",
"0.6125497",
"0.61195713",
"0.6062529",
"0.60503244",
"0.5997765",
"0.59941584",
"0.59659374",
"0.59659374",
"0.59659374",
"0.5878216",
"0.5867702",
"0.581266",
"0.574244",
"0.57289135",
"0.5721285",
"0.57061356",
"0.57061136",
"0.56815106",
"0.5572992",
"0.5566938",
"0.55498576",
"0.5506755",
"0.5506161",
"0.550454",
"0.5491316",
"0.54804677",
"0.5469961",
"0.5444964",
"0.54423666",
"0.54169273",
"0.53929573",
"0.53365",
"0.5329876",
"0.53282624",
"0.53252673",
"0.53162485",
"0.5312831",
"0.530418",
"0.530418",
"0.52999353",
"0.52969474",
"0.5281587",
"0.5279628",
"0.52745605",
"0.52721417",
"0.52721417",
"0.527009",
"0.5265674",
"0.52647144",
"0.5258475",
"0.5246259",
"0.52206826",
"0.5220353",
"0.52133137",
"0.520155",
"0.51980454",
"0.519804",
"0.5195426",
"0.51924574",
"0.51725525",
"0.5164001",
"0.51537496",
"0.5152586",
"0.51475453",
"0.5143348",
"0.51319265",
"0.5116608",
"0.51021785",
"0.50900435",
"0.50895715",
"0.50783265",
"0.5075262",
"0.50731057",
"0.5070636",
"0.50678825",
"0.50635237",
"0.50590885",
"0.5058277",
"0.5047976",
"0.50452125",
"0.50320005",
"0.50278705",
"0.50229806",
"0.50167286",
"0.50117517",
"0.50117517",
"0.5009532",
"0.50037605"
] | 0.6133987 | 12 |
_getUpdateKeys will return the update keys | public function _getUpdateKeys() {
return array(Model_Fields_PracticeFieldCoordinatorDB::DB_COLUMN_ID => $this->{Model_Fields_PracticeFieldCoordinatorDB::DB_COLUMN_ID});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function _getUpdateKeys() {\n return array(Model_Fields_FieldDB::DB_COLUMN_ID => $this->{Model_Fields_FieldDB::DB_COLUMN_ID});\n }",
"public function _getUpdateKeys() {\r\n return array(Model_Fields_LeagueDB::DB_COLUMN_ID => $this->{Model_Fields_LeagueDB::DB_COLUMN_ID});\r\n }",
"public function addKeysToUpdates()\n\t{\n\t\t$keys = $this->database->getNewKeys();\n\n\t\tif (!empty($keys)) {\n\t\t\t$this->addToUpdates($keys);\n\t\t}\n\t}",
"public function getKeys() {}",
"function filter_update_keys( $args ) {\n\t\t$updates = $args[0];\n\n\t\tif ( isset( $updates->no_update ) ) {\n\t\t\tunset( $updates->no_update );\n\t\t}\n\n\t\treturn $args;\n\t}",
"static function getKeys();",
"public function getPackageReplacementKeys() {}",
"function get_updates() {\n\t\t\treturn $this->quoted_attributes(array_diff_key($this->get_attributes(), array_combine($this->primary_keys, $this->primary_keys)));\n\t\t}",
"public function getKeys(){\n\t\treturn $this->keys;\n\t}",
"public function getUpdateList()\n {\n return $this->updateList;\n }",
"public function getUpdateValues(): array;",
"abstract public function getKeys();",
"function GetDBTableKeys()\n\t{\n\t\tglobal $dal_info;\n\t\tif( !array_key_exists($this->infoKey, $dal_info) || !is_array($dal_info[ $this->infoKey ]) )\n\t\t\treturn array();\n\t\t\n\t\t$ret = array();\n\t\tforeach($dal_info[ $this->infoKey ] as $fname=>$f)\n\t\t{\n\t\t\tif( @$f[\"key\"] )\n\t\t\t\t$ret[] = $fname;\n\t\t}\n\t\treturn $ret;\n\t}",
"public function statKeys()\n {\n \treturn $this->statKeys;\n }",
"protected function listUpdates() {}",
"public function getKeys()\n {\n return $this->keys;\n }",
"public function getKeys()\n {\n return $this->keys;\n }",
"public function getKeys()\n {\n return $this->keys;\n }",
"public function getKeys()\n {\n return $this->keys;\n }",
"public function getKeys()\n {\n return $this->keys;\n }",
"public function getExtensionKeys() {}",
"private function getEncryptionKeys(){\n\t\treturn $this->cryptokeys;\n\t\t/*\n\t\treturn array('REGISTRATION'=> array(\n\t\t\t\t\t\t\t\t\t\t'h'=>array(\n\t\t\t\t\t\t\t\t\t\t\t'hash_size'=> \t64,\n\t\t\t\t\t\t\t\t\t\t\t'hash_key'=>\t'mysecretkey' ),\n\t\t\t\t\t\t\t\t\t\t'c'=>array(\t\n\t\t\t\t\t\t\t\t\t\t\t'nonce'=>\t\t'f5de5a2935a8927268be7a358dbfe73334a7dc38d57f23df',\n\t\t\t\t\t\t\t\t\t\t\t'secretkey'=>\t'8b49a72bb1addff71e630692e2a0c6a0f0cfa3657ff527642700b247364c19e8',\n\t\t\t\t\t\t\t\t\t\t\t'blocksize'=>\t16 )\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t 'EMAIL'=> \tarray(\n\t\t\t\t\t\t\t\t\t\t'h'=>array(\n\t\t\t\t\t\t\t\t\t\t\t'hash_size'=> \t32,\n\t\t\t\t\t\t\t\t\t\t\t'hash_key'=>\t'mysecretkey' ),\n\t\t\t\t\t\t\t\t\t\t'c'=>array(\t\n\t\t\t\t\t\t\t\t\t\t\t'nonce'=>\t\t'f5de5a2935a8927268be7a358dbfe73334a7dc38d57f23df',\n\t\t\t\t\t\t\t\t\t\t\t'secretkey'=>\t'8b49a72bb1addff71e630692e2a0c6a0f0cfa3657ff527642700b247364c19e8',\n\t\t\t\t\t\t\t\t\t\t\t'blocksize'=>\t16 )\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t 'PROFILE'=> array(\n\t\t\t\t\t\t\t\t\t\t'h'=>array(\n\t\t\t\t\t\t\t\t\t\t\t'hash_size'=> \t64,\n\t\t\t\t\t\t\t\t\t\t\t'hash_key'=>\t'mysecretkey' ),\n\t\t\t\t\t\t\t\t\t\t'c'=>array(\t\n\t\t\t\t\t\t\t\t\t\t\t'nonce'=>\t\t'f5de5a2935a8927268be7a358dbfe73334a7dc38d57f23df',\n\t\t\t\t\t\t\t\t\t\t\t'secretkey'=>\t'8b49a72bb1addff71e630692e2a0c6a0f0cfa3657ff527642700b247364c19e8',\n\t\t\t\t\t\t\t\t\t\t\t'blocksize'=>\t16 )\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t*/\n\t\t\n\t\t\t\t\t \t\t\t\n\t}",
"public function getKeys()\n {\n $this->prepare();\n\n return $this->_keys;\n }",
"public function testUpdateKey()\n {\n }",
"function GetRecordKeys() {\n\t\tglobal $EW_COMPOSITE_KEY_SEPARATOR;\n\t\t$arKeys = array();\n\t\t$arKey = array();\n\t\tif (isset($_POST[\"key_m\"])) {\n\t\t\t$arKeys = ew_StripSlashes($_POST[\"key_m\"]);\n\t\t\t$cnt = count($arKeys);\n\t\t} elseif (isset($_GET[\"key_m\"])) {\n\t\t\t$arKeys = ew_StripSlashes($_GET[\"key_m\"]);\n\t\t\t$cnt = count($arKeys);\n\t\t} elseif (!empty($_GET) || !empty($_POST)) {\n\t\t\t$isPost = ew_IsHttpPost();\n\t\t\tif ($isPost && isset($_POST[\"gjd_id\"]))\n\t\t\t\t$arKeys[] = ew_StripSlashes($_POST[\"gjd_id\"]);\n\t\t\telseif (isset($_GET[\"gjd_id\"]))\n\t\t\t\t$arKeys[] = ew_StripSlashes($_GET[\"gjd_id\"]);\n\t\t\telse\n\t\t\t\t$arKeys = NULL; // Do not setup\n\n\t\t\t//return $arKeys; // Do not return yet, so the values will also be checked by the following code\n\t\t}\n\n\t\t// Check keys\n\t\t$ar = array();\n\t\tif (is_array($arKeys)) {\n\t\t\tforeach ($arKeys as $key) {\n\t\t\t\tif (!is_numeric($key))\n\t\t\t\t\tcontinue;\n\t\t\t\t$ar[] = $key;\n\t\t\t}\n\t\t}\n\t\treturn $ar;\n\t}",
"public function getKeys() {\n if (!isset($this->_keys)) {\n $this->_keys = array('ADDONS_CATALOG_SUPPORT_TICKETS_STATUS');\n }\n\n return $this->_keys;\n }",
"function KeyNameList ( ) { return $this->_KeyNameList; }",
"public function getKeys();",
"public function updateAffiliateKeys( $update )\n {\n $changed = false; foreach( $update as $service => $key ){ if( $key != $this->affiliateKeys[$service] ){ $changed = true; } $this->affiliateKeys[$service] = $key; }\n\n if( $changed == true )\n {\n return $this->APICall( array('updateAffiliateKeys' => json_encode( $this->affiliateKeys )), \"Could not update the affiliate keys for \" . $this->description() );\n }\n }",
"public function getKeys() {\n\t\treturn $this->getAllKeys();\n\t}",
"public function getNewEntriesKey(): string;",
"protected function getUpdateInfo()\n {\n return array_fill_keys(\n array_keys($this->getSelected()),\n $this->getUpdateInfoElement()\n );\n }",
"function getAllKeys() {\n return $this->memcached->getAllKeys();\n }",
"protected function getNewFlashKeys(): array\n {\n return $this->get(self::NEW_FLASH_KEYS_KEY, []);\n }",
"function GetRecordKeys() {\n\t\tglobal $EW_COMPOSITE_KEY_SEPARATOR;\n\t\t$arKeys = array();\n\t\t$arKey = array();\n\t\tif (isset($_POST[\"key_m\"])) {\n\t\t\t$arKeys = ew_StripSlashes($_POST[\"key_m\"]);\n\t\t\t$cnt = count($arKeys);\n\t\t} elseif (isset($_GET[\"key_m\"])) {\n\t\t\t$arKeys = ew_StripSlashes($_GET[\"key_m\"]);\n\t\t\t$cnt = count($arKeys);\n\t\t} elseif (!empty($_GET) || !empty($_POST)) {\n\t\t\t$isPost = ew_IsHttpPost();\n\t\t\tif ($isPost && isset($_POST[\"IDXDAFTAR\"]))\n\t\t\t\t$arKeys[] = ew_StripSlashes($_POST[\"IDXDAFTAR\"]);\n\t\t\telseif (isset($_GET[\"IDXDAFTAR\"]))\n\t\t\t\t$arKeys[] = ew_StripSlashes($_GET[\"IDXDAFTAR\"]);\n\t\t\telse\n\t\t\t\t$arKeys = NULL; // Do not setup\n\n\t\t\t//return $arKeys; // Do not return yet, so the values will also be checked by the following code\n\t\t}\n\n\t\t// Check keys\n\t\t$ar = array();\n\t\tif (is_array($arKeys)) {\n\t\t\tforeach ($arKeys as $key) {\n\t\t\t\tif (!is_numeric($key))\n\t\t\t\t\tcontinue;\n\t\t\t\t$ar[] = $key;\n\t\t\t}\n\t\t}\n\t\treturn $ar;\n\t}",
"function GetRecordKeys() {\n\t\tglobal $EW_COMPOSITE_KEY_SEPARATOR;\n\t\t$arKeys = array();\n\t\t$arKey = array();\n\t\tif (isset($_POST[\"key_m\"])) {\n\t\t\t$arKeys = $_POST[\"key_m\"];\n\t\t\t$cnt = count($arKeys);\n\t\t} elseif (isset($_GET[\"key_m\"])) {\n\t\t\t$arKeys = $_GET[\"key_m\"];\n\t\t\t$cnt = count($arKeys);\n\t\t} elseif (!empty($_GET) || !empty($_POST)) {\n\t\t\t$isPost = ew_IsPost();\n\t\t\tif ($isPost && isset($_POST[\"rid\"]))\n\t\t\t\t$arKeys[] = $_POST[\"rid\"];\n\t\t\telseif (isset($_GET[\"rid\"]))\n\t\t\t\t$arKeys[] = $_GET[\"rid\"];\n\t\t\telse\n\t\t\t\t$arKeys = NULL; // Do not setup\n\n\t\t\t//return $arKeys; // Do not return yet, so the values will also be checked by the following code\n\t\t}\n\n\t\t// Check keys\n\t\t$ar = array();\n\t\tif (is_array($arKeys)) {\n\t\t\tforeach ($arKeys as $key) {\n\t\t\t\tif (!is_numeric($key))\n\t\t\t\t\tcontinue;\n\t\t\t\t$ar[] = $key;\n\t\t\t}\n\t\t}\n\t\treturn $ar;\n\t}",
"public function getCleanKeys()\n {\n return $this->cleanKeys;\n }",
"public function getUpdatedProperties() {}",
"public function getKeys(): array\n {\n return $this->keys;\n }",
"public function getAllKey();",
"public function getKeys(): array;",
"abstract protected function getAllUpdates();",
"protected function getStaleFlashKeys(): array\n {\n return $this->get(self::STALE_FLASH_KEYS_KEY, []);\n }",
"public function getKeys()\n {\n $private_key = $this->config->getAppValue($this->appName, \"privatekey\");\n $public_key = $this->config->getAppValue($this->appName, \"publickey\");\n\n return [$private_key, $public_key];\n }",
"function wp_get_update_data()\n {\n }",
"public function keys()\n {\n return static::from($this->keyR);\n }",
"function getKeys(){\n\t\ttry{\n\t\t\t$db = getConnection();\n\n\t\t\t$sql = \"SELECT * FROM network_keys WHERE name = ?\";\n\t\t\t$stmt = $db->prepare($sql);\n\t\t\t$stmt->execute(array(\"llsec\"));\n\t\t\t$llsec = $stmt->fetch()['network_key'];\n\n\t\t\t$sql = \"SELECT * FROM network_keys WHERE name = ?\";\n\t\t\t$stmt = $db->prepare($sql);\n\t\t\t$stmt->execute(array(\"dtls\"));\n\t\t\t$dtls = $stmt->fetch()['network_key'];\n\t\t}\n\t\tcatch(PDOException $e){\n\t\t echo $e->getMessage();\n\t }\n\t return array($llsec, $dtls);\n\t}",
"function keys() {\r\n return array('MODULE_PAYMENT_AUTHORIZENET_ECHECK_STATUS', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_LOGIN', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_TXNKEY', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_MD5HASH', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_TESTMODE', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_AUTHORIZATION_TYPE', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_STORE_DATA', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_EMAIL_CUSTOMER', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_EMAIL_MERCHANT', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_SORT_ORDER', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_ZONE', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_ORDER_STATUS_ID', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_WFSS_ENABLED', 'MODULE_PAYMENT_AUTHORIZENET_ECHECK_DEBUGGING'); //'MODULE_PAYMENT_AUTHORIZENET_ECHECK_METHOD'\r\n }",
"public function keys();",
"public function keys();",
"public function keys();",
"public function keys();",
"public function keys();",
"public function keys();",
"public function getUpdated();",
"public function getUpdated();",
"function _get_additional_user_keys($user)\n {\n }",
"public function getUpdates()\n {\n return $this->updates;\n }",
"public function getChangedEntries();",
"public function testListKeys()\n {\n }",
"static public function getUpdateList($letter) {\n\t\ttry {\n\t\t\n\t\t\t\n\t\t\t$Updater = new pornstarUpdater(self::getWSDL());\n\t\t\t$list = $Updater->getListByLetter($letter);\n\t\t\t\n\t\t\t// Store the list in session\n\t\t\tself::storeList($list);\n\t\t\t\t\t\t\n\t\t\t$totalSize = 0;\n\t\t\tforeach ($list as $arr)\t{ $totalSize += sizeof($arr);}\n\t\t\t\n\t\t\treturn array(\n\t\t\t\t'incoming' => sizeof($list['incoming']),\n\t\t\t\t'outgoing' => sizeof($list['outgoing']),\n\t\t\t\t'supdate' => sizeof($list['serverupdate']),\n\t\t\t\t'cupdate' => sizeof($list['clientupdate']),\n\t\t\t\t'csupdate' => sizeof($list['clientserverupdate']),\n\t\t\t\t'entries' => $totalSize,\n\t\t\t\t'letter' => $letter\n\t\t\t);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t} catch (Exception $ex) {\n\t\t\tthrow new AjaxException($ex->getMessage(), $ex->getCode());\n\t\t}\n\t}",
"public function validKeys()\n\t{\n\t\treturn array_merge($this->keysOnlyUsedDuringCreation(), $this->statKeys());\n\t}",
"protected function getUpdateStatements() {}",
"function list_core_update($update)\n {\n }",
"public function getUpdates() {\n return $this->updates;\n }",
"public function getSupportedKeys()\n {\n return $this->fieldConfig->getSupportedKeys();\n }",
"public function get_jwks_uri_data() {\n\t\t$jwks_uri = $this->get_jwks_uri();\n\t\t\n\t\t$key_data = array();\n\t\tforeach ($jwks_uri as $uri) {\n\t\t\t$response = wp_remote_get($uri);\n\t\t\tarray_push($key_data, $response['body']);\t\n\t\t}\n\t\treturn $key_data;\n\t}",
"public function refreshKeys() {\n\t\tforeach ($this->keyservers as $ks) {\n\t\t\ttry {\n\t\t\t\t$retarr = $this->runGPG(\"--keyserver $ks --refresh-keys\");\n\t\t\t} catch (\\RuntimeException $e) {\n\t\t\t\t// Took too long. We'll just try the next one.\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ($retarr['exitcode'] > 0) {\n\t\t\t\t//There was some sort of error so try the next one\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\t$this->checkPermissions();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public function retrieveKeys()\n {\n return $this->start()->uri(\"/api/key\")\n ->get()\n ->go();\n }",
"public function defaultStatKeys()\n {\n \treturn $this->defaultKeys;\n }",
"function get_plugin_updates()\n {\n }",
"function &keys(){\n\t\tif ( isset($this->_cache[__FUNCTION__]) ) return $this->_cache[__FUNCTION__];\n\t\t$tables =& $this->tables();\n\t\t$out = array();\n\t\tforeach ( array_keys($tables) as $tablename){\n\t\t\t$keys =& $tables[$tablename]->keys();\n\t\t\tforeach ( array_keys($keys) as $fieldname){\n\t\t\t\t$out[$fieldname] =& $keys[$fieldname];\n\t\t\t}\n\t\t}\n\t\t$this->_cache[__FUNCTION__] =& $out;\n\t\treturn $out;\n\t\t\n\t}",
"public function updateKeys (Array $newKeys){\n try {\n $this->keys=[];//could potentially get this from an existing file so we can add to it\n //merge with existing keys\n $this->keys = array_merge($this->keys,$newKeys);\n if ($this->keys != NULL){\n //if there are keys the build them into the xml file and save it\n $xml = new XMLBuilder($this->filename,$this->keys,\"apiKeys\");\n return $xml->saveFile();\n }\n return false;\n } catch (Exception $ex) {\n return false;\n } \n }",
"protected function getPreloadKeys() {\n\t\t$keys = array(\n\t\t\t'echo-notification-timestamp',\n\t\t\t'echo-notification-timestamp-' . EchoAttributeManager::MESSAGE,\n\t\t\t'echo-notification-timestamp-' . EchoAttributeManager::ALERT,\n\t\t\t'echo-notification-count',\n\t\t\t'echo-notification-count-' . EchoAttributeManager::MESSAGE,\n\t\t\t'echo-notification-count-' . EchoAttributeManager::ALERT,\n\t\t);\n\n\t\treturn array_filter( array_merge(\n\t\t\tarray_map( array( $this, 'getMemcKey' ), $keys ),\n\t\t\tarray_map( array( $this, 'getGlobalMemcKey' ), $keys )\n\t\t) );\n\t}",
"public function getKeys() {\n\t\treturn file('/home4/statelib/keys.txt', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);\n\t}",
"public static function keys()\n {\n return static::$keys;\n }",
"public function getMetaForignKeys(){\n $stmt = $this->query(self::META_FKEYS_SQL);\n if ($stmt === false){\n return array();\n }\n\n $keys = array();\n foreach ($stmt as $row){\n $keys[$row[0] . '.' . $row[1]] = $row[2] . '.' . $row[3];\n }\n\n return $keys;\n }",
"public function getVerificationKeys(): array {\n\t\t\treturn $this->verificationKeys;\n\t\t}",
"public function getKeys()\n {\n $response = $this->get('user/keys');\n\n return $response['public_keys'];\n }",
"public function keys()\n {\n }",
"public function afterUpdateEvent($self, $pkeys){\n }",
"public function getKeys()\n {\n return $this->getNames();\n }",
"public function keys()\n {\n return array('MODULE_PAYMENT_SHOPGATE_STATUS',\n 'MODULE_PAYMENT_SHOPGATE_SORT_ORDER');\n }",
"protected function getUpdateInput()\n {\n return [\n 'email' => 'email@orchestraplatform.com',\n 'password' => '123456',\n 'password_confirmation' => '123456',\n 'token' => 'auniquetoken',\n ];\n }",
"public function getKeys() {\n\t\treturn $this->config->getKeys();\n\t}",
"function keys() {\n return array(\n\t 'MODULE_PAYMENT_PAYMENTECH_STATUS', \n\t 'MODULE_PAYMENT_PAYMENTECH_TESTMODE', \n\t 'MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_TEST', \n\t 'MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_USD', \n\t 'MODULE_PAYMENT_PAYMENTECH_MERCHANT_ID_CAD', \n\t 'MODULE_PAYMENT_PAYMENTECH_BIN', \n\t 'MODULE_PAYMENT_PAYMENTECH_TERMINAL_ID', \n\t 'MODULE_PAYMENT_PAYMENTECH_AUTHORIZATION_TYPE', \n\t 'MODULE_PAYMENT_PAYMENTECH_USE_CVV', \n\t 'MODULE_PAYMENT_PAYMENTECH_SORT_ORDER', \n\t 'MODULE_PAYMENT_PAYMENTECH_CURRENCIES');\n }",
"function getKeys() { \n\tglobal $mysqli;\n\t$sql = \"select keyName from keyValue\";\n\t$res = $mysqli->query($sql);\n\tif (!$res) {\n\t\t//if there was an error, log it and then return null.\n\t\terror_log(\"Error on getKeys select \" . $mysqli->error);\n\t\treturn null;\n\t}\n\n\t$keys = array();\n\twhile( $row = mysqli_fetch_assoc($res)) {\n\t\tarray_push($keys,$row['keyName']);\n\t}\n\treturn $keys;\n}",
"public function getKeyFields()\n {\n return $this->_aKeyFieldList;\n }",
"public function\n\t\tget_key_fields()\n\t{\n\t\tif (!isset($this->key_fields)) {\n\t\t\t$this->key_fields = array();\n\t\t\t\n\t\t\t$sxe = $this->get_simple_xml_element();\n\t\t\t\n\t\t\tforeach ($sxe->table->{'key-fields'}->field as $field) {\n\t\t\t\t#print_r($field);\n\t\t\t\t\n\t\t\t\t$this->key_fields[] = (string)$field['name'];\n\t\t\t}\n\t\t\t\n\t\t\t/*\n\t\t\t * If the key_fields array hasn't been set, use the default\n\t\t\t * values.\n\t\t\t */\n\t\t\tif (count($this->key_fields) < 1) {\n\t\t\t\t$this->key_fields = array('id');\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this->key_fields;\n\t}",
"function getKeys()\n{\n global $keys_file;\n $fp = fopen($keys_file, \"r\");\n $keys = null;\n if (flock($fp, LOCK_SH)) {\n $keys = fread($fp, filesize($keys_file));\n flock($fp, LOCK_UN);\n }\n fclose($fp);\n return $keys;\n}",
"public function update()\n {\n return [\n [self::DRUSH, 'updatedb']\n ];\n }",
"protected function getKeysMap(): array\n {\n return [\n 'baz' => 'greet',\n ];\n }",
"public function get_property_keys() {\n $data = $this->get_data();\n $data_keys = $this->get_data_keys();\n\n foreach ( $data_keys as $data_key ) {\n if ( isset( $data[$data_key] ) && is_array( $data[$data_key] ) ) {\n $data_key_index = array_search( $data_key, $data_keys );\n if ( $data_key_index !== false ) {\n unset( $data_keys[$data_key_index] );\n }\n }\n }\n\n $include_db_keys = false;\n if ( has_filter( \"nwsi_include_order_item_keys_from_database\" ) ) {\n $include_db_keys = (bool) apply_filters( \"nwsi_include_order_item_keys_from_database\" );\n }\n\n if ( $include_db_keys ) {\n // combine with order meta keys from the database\n require_once( NWSI_DIR_PATH . \"includes/controllers/core/class-nwsi-db.php\" );\n $db = new NWSI_DB();\n $keys = array_merge( $data_keys, $db->get_order_item_meta_keys() );\n } else {\n $keys = $data_keys;\n }\n\n $unique_keys = array_unique( $keys );\n sort( $unique_keys, SORT_STRING );\n\n if ( has_filter( \"nwsi_order_item_property_keys\" ) ) {\n $unique_keys = (array) apply_filters( \"nwsi_order_item_property_keys\", $unique_keys );\n }\n\n return $unique_keys;\n }",
"public function getEnableOnBehalfRequestorsToUpdateAccess()\n {\n if (array_key_exists(\"enableOnBehalfRequestorsToUpdateAccess\", $this->_propDict)) {\n return $this->_propDict[\"enableOnBehalfRequestorsToUpdateAccess\"];\n } else {\n return null;\n }\n }",
"public function getRecordKeys()\n\t{\n\t\t$arKeys = [];\n\t\t$arKey = [];\n\t\tif (Param(\"key_m\") !== NULL) {\n\t\t\t$arKeys = Param(\"key_m\");\n\t\t\t$cnt = count($arKeys);\n\t\t} else {\n\t\t\tif (Param(\"id\") !== NULL)\n\t\t\t\t$arKeys[] = Param(\"id\");\n\t\t\telseif (IsApi() && Key(0) !== NULL)\n\t\t\t\t$arKeys[] = Key(0);\n\t\t\telseif (IsApi() && Route(2) !== NULL)\n\t\t\t\t$arKeys[] = Route(2);\n\t\t\telse\n\t\t\t\t$arKeys = NULL; // Do not setup\n\n\t\t\t//return $arKeys; // Do not return yet, so the values will also be checked by the following code\n\t\t}\n\n\t\t// Check keys\n\t\t$ar = [];\n\t\tif (is_array($arKeys)) {\n\t\t\tforeach ($arKeys as $key) {\n\t\t\t\tif (!is_numeric($key))\n\t\t\t\t\tcontinue;\n\t\t\t\t$ar[] = $key;\n\t\t\t}\n\t\t}\n\t\treturn $ar;\n\t}",
"public function getEntityKeys()\n {\n return $this->_entityKey;\n }",
"public function getEntityKeys()\n {\n return $this->_entityKey;\n }",
"public function getEntityKeys()\n {\n return $this->_entityKey;\n }",
"public function getEntityKeys()\n {\n return $this->_entityKey;\n }",
"public function getEntityKeys()\n {\n return $this->_entityKey;\n }"
] | [
"0.75509113",
"0.74989474",
"0.6467931",
"0.6302946",
"0.627223",
"0.62503654",
"0.6244785",
"0.62071365",
"0.611348",
"0.6110936",
"0.6102717",
"0.6034112",
"0.59426516",
"0.5914245",
"0.5905945",
"0.5889035",
"0.5889035",
"0.5889035",
"0.5889035",
"0.5889035",
"0.58815587",
"0.5876344",
"0.58725756",
"0.5847617",
"0.5833376",
"0.5831485",
"0.5828316",
"0.58281535",
"0.5820971",
"0.57887536",
"0.5781202",
"0.5775821",
"0.5772357",
"0.5769872",
"0.5760129",
"0.56906766",
"0.5678596",
"0.56743276",
"0.5650396",
"0.56373084",
"0.5607996",
"0.5607651",
"0.55833066",
"0.55713826",
"0.5565268",
"0.5563335",
"0.5563244",
"0.554784",
"0.55055296",
"0.55055296",
"0.55055296",
"0.55055296",
"0.55055296",
"0.55055296",
"0.55010605",
"0.55010605",
"0.5497826",
"0.5487566",
"0.5480867",
"0.54768515",
"0.54591763",
"0.54454243",
"0.54430056",
"0.5441713",
"0.54197603",
"0.5412479",
"0.54040545",
"0.5401485",
"0.53905237",
"0.5385606",
"0.53828216",
"0.5375318",
"0.5370572",
"0.537022",
"0.53666997",
"0.5360011",
"0.5357165",
"0.53552043",
"0.53463525",
"0.53365034",
"0.53344",
"0.5332907",
"0.5330393",
"0.5329068",
"0.5326852",
"0.53187853",
"0.5304176",
"0.5300941",
"0.5290984",
"0.528969",
"0.52877647",
"0.5285326",
"0.52853245",
"0.5284785",
"0.52838606",
"0.52817124",
"0.52817124",
"0.52817124",
"0.52817124",
"0.52817124"
] | 0.75280595 | 1 |
/ List all of the commands as an index. | function listCmds() {
global $commands; ?>
<ul width="700">
<?php foreach ($commands as $idx => $command): ?>
<li>
<strong><a href="#<?= htmlspecialchars($command['title']) ?>"><?= htmlspecialchars($command['title']) ?></a></strong>
</li>
<?php endforeach; ?>
</ul>
<?php
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function buildCommandsIndex() {}",
"public function index()\n {\n return Command::orderBy('id')->get();\n }",
"public function index()\n {\n return Command::all();\n }",
"public function listCommands()\n {\n $commands = $this->library->getAll();\n\n foreach ($commands as $name => $details) {\n $this->output->writeln(ucwords($name));\n $this->output->hr(strlen($details['description']), '-');\n $this->output->writeln($details['description']);\n $this->output->hr(strlen($details['description']), '-');\n\n foreach ($details['actions'] as $action) {\n $this->output->writeln(\n sprintf(\n \"%s - php [file] %s%s [params]\",\n $action,\n $name,\n ($action != 'main' ? \":$action\" : '')\n )\n );\n }\n\n // Just for padding\n $this->output->writeln('');\n }\n }",
"private static function get_commands_list(){ return array_keys(self::$current_runner->commands_list); }",
"public function getCommands();",
"abstract protected function getCommandList();",
"private function printListOfCommands()\n {\n /**\n * @var Padding\n */\n $padding = $this->cli->padding(50)->char(' ');\n $padding->label(' <bold><blue>show dbs:</blue></bold>')->result('show database names');\n $padding->label(' <bold><blue>show collection:</blue></bold>')->result('show collections in current database');\n $padding->label(' <bold><blue>use:</blue></bold>')->result('set current database');\n }",
"public function all()\n {\n return $this->commands;\n }",
"public function getCommands(): array;",
"public function _index(){\n\t $this->_list();\n\t}",
"public function index()\n {\n //\n $commands = Command::with(['provider','materials'])->ordered(true)->get();\n\n \n\n return $commands->toJson();\n }",
"public function getCmdList()\n {\n return $this->get(self::CMDLIST);\n }",
"public function getCommands()\n {\n return array();\n }",
"public function getCommands()\n {\n return [\n ];\n }",
"public function commands()\n {\n return ['a'];\n }",
"function index_all(){\n\t\t$this->_clear_tmp(0);\n\t\t$this->del_results();\n\t\treturn $this->index(0,true);\n\t}",
"public static function commands() {\n return self::$_commands;\n }",
"public function index()\n {\n $infAll = Operacoes::all()->toArray();\n return array_reverse($infAll);\n }",
"public function getCommands()\n\t{\n\t\treturn $this->commands;\t\n\t}",
"public function index()\n {\n return Operation::all();\n }",
"public function index()\r\n {\r\n \treturn $this->class->index(1);\r\n }",
"public function action_index()\n\t{\n\t\t// Instance terminal\n\t\t$terminal = new Terminal();\n\n\t\t// Init terminal\n\t\t$terminal->init();\n\t}",
"public function getCommands()\n {\n return $this->data['commands'];\n }",
"public function printCommandList(): void\n {\n $commandList = $this->getCommandList();\n $this->writeData('Available commands:');\n array_map(function ($command) {\n $this->writeData('-------------------------');\n $this->writeData('-name: '.$command->getName());\n $this->writeData('-description: '.$command->getDescription());\n $this->writeData('-------------------------');\n }, $commandList);\n }",
"public function actions()\r\n {\r\n return array(\r\n 'index' => array(\r\n 'class' => \\nizsheanez\\jsonRpc\\Action::class,\r\n ),\r\n );\r\n }",
"function _getCommands()\n\t{\n\t\treturn array();\n\t}",
"function _getCommands()\n\t{\n\t\t$commands = array();\n\t\t$commands[] = array( 'permission' => 'read', 'cmd' => 'view', 'lang_var' => 'show', 'default' => true );\n//\t\t$commands[] = array('permission' => 'read', 'cmd' => 'render', 'lang_var' => 'show', 'default' => true);\n//\t\t$commands[] = array('permission' => 'write', 'cmd' => 'enableAdministrationPanel', 'lang_var' => 'edit_content');\n//\t\t$commands[] = array( 'permission' => 'write', 'cmd' => 'edit', 'lang_var' => 'settings' );\n\n\t\treturn $commands;\n\t}",
"public static function GET_COMMANDS(): array\n\t{\n\t\treturn self::$commands::GET_COMMANDS();\n\t}",
"public function index() {\n\t\treturn $this->repository->all();\n\t}",
"public function getCommands(): array\n\t{\n\t\treturn $this->commands;\n\t}",
"public function index(Table $table, Magic $command)\n {\n return $this->key($table, $command, 'INDEX');\n }",
"public function getCommands(): array\n {\n return $this->commands;\n }",
"public function getCommands(): array\n {\n return $this->commands;\n }",
"public function listCommand()\n {\n $this->console->writeLn('list: ' . implode(' ', $this->_getEnvTypes()));\n }",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"function execCmds() {\n\tglobal $commands;\n\tforeach ($commands as $idx => $command) {\n\t\tshowCmdT($idx, $command);\n\t}\n}",
"public function _getCommands()\n\t{\n\t\t$commands\t= array();\n\t\t$commands[] = array(\"permission\" => \"read\", \"cmd\" => \"view\", \"lang_var\" => \"enter\", \"default\" => true);\n\t\t$commands[] = array(\"permission\" => \"write\", \"cmd\" => \"settings-general\", \"lang_var\" => \"settings\");\n\t\t\n\t\t// alex 3 Oct 2012: this leads to a blank screen, i guess it is a copy/paste bug from files\n\t\t//$commands[] = array(\"permission\" => \"write\", \"cmd\" => \"versions\", \"lang_var\" => \"versions\");\n\n\t\treturn $commands;\n\t}",
"public function getIndexList() {\n return self::$indexes;\n }",
"public function index()\n\t{\n\t\treturn 'Aqui mostramos las listas';\n\t}",
"public function getIndex()\n {\n return $this->get(self::_INDEX);\n }",
"public function actionIndex()\n {\n $this->stdout(\"\\n Example Module Base Command: \" . date('d.m.y h:i:s') . \" Done!\\n\");\n }",
"protected function listAvailableCommands()\n {\n $commands = collect(Artisan::all())->mapWithKeys(function ($command, $key) {\n if (Str::startsWith($key, 'neat:')) {\n return [$key => $command];\n }\n\n return [];\n })->toArray();\n\n $width = $this->getColumnWidth($commands);\n\n /** @var Command $command */\n foreach ($commands as $command) {\n $this->line(sprintf(\" %-{$width}s %s\", $command->getName(), $command->getDescription()));\n }\n }",
"public function index()\n {\n return $this->repository->all();\n }",
"public function index()\n {\n return $this->repository->all();\n }",
"public function ListCommands($actionId);",
"public function getCommands()\n {\n return $this->commands;\n }",
"public function getCommands()\n {\n return $this->commands;\n }",
"public function getCommands()\n {\n return $this->commands;\n }",
"public function getCommands()\n {\n return array(\n 'mautic:leadlists:update' => array('title' => 'Update lists', 'description' => 'Updates the leads in the lists. This command is required for basic Mautic functions.'),\n 'mautic:campaigns:update' => array('title' => 'Update campaigns', 'description' => 'Adds/removes leads from campaigns. This command is required for basic Mautic functions.'),\n 'mautic:campaigns:trigger' => array('title' => 'Trigger campaigns', 'description' => 'Triggers the campaign events. This command is required for basic Mautic functions.'),\n 'mautic:email:process' => array('title' => 'Process emails', 'description' => 'Processes the emails in the queue. This command is needed if you configure the emails to be processed in a queue.'),\n 'mautic:fetch:email' => array('title' => 'Fetch emails', 'description' => 'Reads emails from a inbox defined in the Monitored Inbox setting.'),\n 'mautic:iplookup:download' => array('title' => 'Update geoIP', 'description' => 'Downloads/updates the MaxMind GeoIp2 City database. This command is needed only if you use the \"MaxMind - GeoIp2 City Download\" IP lookup service.')\n );\n }",
"public function getAvailableCommands() {}",
"protected function getShortCommandIdentifiers() {}",
"public function _INDEX()\n\t{\n\t\t\n\t}",
"public function getIndex();",
"public function getIndex();",
"public function getIndex();",
"public function index(Table $table, Magic $command)\n {\n return $this->key($table, $command);\n }",
"public function index(Table $table, Magic $command)\n {\n return $this->key($table, $command);\n }",
"public function index()\n {\n return $this->index;\n }",
"public function index()\n {\n $this->help();\n }",
"public function index()\n\t{\n\t\t$data['result']=NULL;\n\t\t$data['show']=NULL;\n\t\t$this->setIndex($data);\n\t}",
"public function actionIndex()\n {\n return $this->renderIndex();\n }",
"public function index(){\r\n $this->display(index);\r\n }",
"public function getIndex()\n {\n // add stuff here\n }",
"public function actionIndex()\n\t{\n\t\techo 1 . \"\\n\\r\";\n\t}",
"public function coreCommands()\n {\n return [\n 'help' => \\Friday\\Console\\Controller\\HelpController::class,\n 'web-server' => \\Friday\\Console\\Controller\\WebServerController::class,\n ];\n }",
"public function actionIndex()\n {\n\t\techo \"=== Action index ===\";\n \n }",
"public function index() {\n return $this->children()->index();\n }",
"public function index()\n {\n return $this->orderInterface->index();\n }",
"public function listCommand() {\n\t\t$iterator = new DirectoryIterator(UploadManager::UPLOAD_FOLDER);\n\n\t\t$counter = 0;\n\t\tforeach ($iterator as $file) {\n\t\t\tif ($file->isFile()) {\n\t\t\t\t$counter++;\n\t\t\t\t$this->outputLine($file->getFilename());\n\t\t\t}\n\t\t}\n\n\t\t$this->outputLine();\n\t\t$this->outputLine(sprintf('%s temporary file(s).', $counter));\n\t}",
"public function index()\n\t{\n $actions = $this->actions->get();\n return View::make('admin.actions.all')->with(compact('actions'));\n\t}",
"public function actionIndex()\n {\n\t return $this->render('index');\n }",
"public function getIndexes()\n\t{\n $result = $this->fetchingData(array(\n 'query' => \"SHOW INDEX FROM `$this->table`\"\n ));\n\n return $result;\n\t}",
"static public function list_commands()\n\t{\n\t\tstatic $commands = NULL;\n\n\t\tif ($commands == NULL)\n\t\t{\n\t\t\t// Include paths must be searched in reverse\n\t\t\t$paths = array_reverse(Kohana::list_files('classes/Item/Command/'));\n\n\t\t\t// Array of class names that have been found\n\t\t\t$found = array();\n\n\t\t\tforeach ($paths as $files)\n\t\t\t{\n\t\t\t\t$replacements = array_merge(Kohana::include_paths(), array('classes'.DIRECTORY_SEPARATOR.'Item'.DIRECTORY_SEPARATOR.'Command'.DIRECTORY_SEPARATOR, '.php'));\n\n\t\t\t\tif (is_array($files))\n\t\t\t\t{\n\t\t\t\t\tforeach ($files as $file)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($replacements as $replace)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$file = str_replace($replace, '', $file);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$found[] = $file;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$commands = $found;\n\t\t}\n\n\t\treturn $commands;\n\t}",
"public function actionIndex()\n\t{\n\n\t\treturn $this->render(\"index\");\n\n\n\t}",
"public static function commands()\n {\n return [\n // Random Commands\n \\Aloe\\Command\\ServeCommand::class,\n \\Aloe\\Command\\ConsoleCommand::class,\n \\Aloe\\Command\\AppDownCommand::class,\n \\Aloe\\Command\\AppUpCommand::class,\n // Aloe Commands\n \\Aloe\\Command\\AloeInstallCommand::class,\n // \\Aloe\\Command\\InstallDebuggerCommand::class,\n // Scaffold Commands\n \\Aloe\\Command\\ScaffoldAuthCommand::class,\n // Env Commands\n \\Aloe\\Command\\EnvGenerateCommand::class,\n // Generate Commands\n \\Aloe\\Command\\GenerateMigrationCommand::class,\n \\Aloe\\Command\\GenerateModelCommand::class,\n \\Aloe\\Command\\GenerateHelperCommand::class,\n \\Aloe\\Command\\GenerateControllerCommand::class,\n \\Aloe\\Command\\GenerateSeedCommand::class,\n \\Aloe\\Command\\GenerateConsoleCommand::class,\n \\Aloe\\Command\\GenerateFactoryCommand::class,\n \\Aloe\\Command\\GenerateTemplateCommand::class,\n // Delete Commands\n \\Aloe\\Command\\DeleteModelCommand::class,\n \\Aloe\\Command\\DeleteSeedCommand::class,\n \\Aloe\\Command\\DeleteFactoryCommand::class,\n \\Aloe\\Command\\DeleteControllerCommand::class,\n \\Aloe\\Command\\DeleteConsoleCommand::class,\n \\Aloe\\Command\\DeleteMigrationCommand::class,\n // Database Commands\n \\Aloe\\Command\\DatabaseInstallCommand::class,\n \\Aloe\\Command\\DatabaseMigrationCommand::class,\n \\Aloe\\Command\\DatabaseRollbackCommand::class,\n \\Aloe\\Command\\DatabaseSeedCommand::class\n ];\n }",
"public function index()\n {\n return (new OrderRepository())->getAll();\n }",
"public function index()\n {\n return $this->processor->index();\n }",
"public function indexes()\r\n {\r\n return $this->indexes;\r\n }",
"public function getCommands()\n {\n $application = new Application($this->kernel);\n $application->setAutoExit(false);\n\n $input = new ArrayInput([\n 'command' => 'list',\n '--format' => 'xml'\n ]);\n\n $output = new StreamOutput(fopen('php://memory', 'w+'));\n $application->run($input, $output);\n rewind($output->getStream());\n\n return $this->extractCommandsFromXML(stream_get_contents($output->getStream()));\n }",
"public function getAll(Index $index): iterable;",
"public function getCommands()\n {\n return $this->getCommandBus()->getCommands();\n }",
"public function commandBar(): iterable\n {\n return [\n Button::make('Show toast')\n ->method('showToast')\n ->novalidate()\n ->icon('bs.chat-square-dots'),\n\n ModalToggle::make('Launch demo modal')\n ->modal('exampleModal')\n ->method('showToast')\n ->icon('bs.window'),\n ];\n }",
"public static function _index()\n\t{\n\t\treturn self::$_index;\n\t}",
"public function getCommandMap(): array;",
"public function index()\n {\n // READ LISTE\n }",
"function masterAllIndexes() {\n $this->db_master->executeSQL(\"SELECT \" . $this->idx_master . \" from \" . $this->db_master->database . \".\" . $this->table_master);\n }",
"public function getCommands()\r\r\n {\r\r\n return $this->invalidCommands;\r\r\n }",
"public function commands()\n {\n return $this->belongsToMany(Command::class)\n ->orderBy('order', 'ASC');\n }",
"public function listCommand() {\n\t\t/** @var Image $image */\n\t\t$totalCount = 0;\n\t\t$totalSize = 0;\n\t\t$totalSizeOfImageVariants = 0;\n\t\t$totalVariantsCount = 0;\n\n\t\tforeach ($this->imageRepository->findAll() as $image) {\n\t\t\t$totalCount++;\n\t\t\tlist($variantsCount, $variantsSize) = $this->getVariantsCount($image);\n\t\t\t$totalSizeOfImageVariants += $variantsSize;\n\t\t\t$this->outputLine(\"%s\\t%s (%dx%d) [%d variant(s)]\", [\n\t\t\t\t$image->getIdentifier(),\n\t\t\t\t$image->getLabel(),\n\t\t\t\t$image->getWidth(),\n\t\t\t\t$image->getHeight(),\n\t\t\t\t$variantsCount\n\t\t\t]);\n\t\t\t$totalSize += $image->getResource()->getFileSize();\n\t\t\t$totalVariantsCount += $variantsCount;\n\t\t}\n\t\t$this->outputLine('# %d assets (%d variants) Total size in MB: %.1f (Original Images: %.1f, Variants: %.1f)', [\n\t\t\t$totalCount,\n\t\t\t$totalVariantsCount,\n\t\t\t($totalSize + $totalSizeOfImageVariants) / 1024 / 1024,\n\t\t\t$totalSize / 1024 / 1024,\n\t\t\t$totalSizeOfImageVariants / 1024 / 1024\n\t\t]);\n\t}",
"public function generateCommands();",
"public function indexAction()\n {\n return [];\n }"
] | [
"0.793251",
"0.7591807",
"0.74901193",
"0.717233",
"0.70074975",
"0.68075603",
"0.674983",
"0.6719281",
"0.6645472",
"0.66397184",
"0.6550231",
"0.654234",
"0.6516168",
"0.65111214",
"0.64758646",
"0.6370422",
"0.63503194",
"0.63056755",
"0.6278105",
"0.6275807",
"0.6262146",
"0.6258912",
"0.62395406",
"0.62387264",
"0.6204896",
"0.62018746",
"0.61891955",
"0.6181615",
"0.6167622",
"0.61636335",
"0.61550146",
"0.6132266",
"0.61301327",
"0.61301327",
"0.6120988",
"0.6116705",
"0.6116705",
"0.6116705",
"0.6116086",
"0.6114904",
"0.6114904",
"0.61148494",
"0.61148494",
"0.61148494",
"0.60888815",
"0.6086946",
"0.6083794",
"0.60837597",
"0.60837257",
"0.60821193",
"0.6078364",
"0.6051792",
"0.6051792",
"0.605175",
"0.6044693",
"0.6044693",
"0.6044693",
"0.603181",
"0.6027976",
"0.6025716",
"0.59980637",
"0.5987916",
"0.5987916",
"0.5987916",
"0.59863204",
"0.59863204",
"0.5974262",
"0.59695375",
"0.5967701",
"0.595681",
"0.5948839",
"0.5941873",
"0.5940263",
"0.5939456",
"0.5932619",
"0.5930335",
"0.59131944",
"0.5905655",
"0.5898562",
"0.5896928",
"0.5889846",
"0.5886135",
"0.5870243",
"0.58661765",
"0.58624005",
"0.58569205",
"0.5854693",
"0.5852297",
"0.5838269",
"0.5837362",
"0.5836487",
"0.5836366",
"0.58343655",
"0.5826389",
"0.58174056",
"0.5808033",
"0.5804577",
"0.58043295",
"0.5800291",
"0.5795133"
] | 0.70653564 | 4 |
/ Execute all of the commands which were defined by a call to defCmd. | function execCmds() {
global $commands;
foreach ($commands as $idx => $command) {
showCmdT($idx, $command);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function execute()\n {\n foreach ($this->commands as $command) {\n $command->execute();\n }\n }",
"function performCommand($cmd){\n switch ($cmd){\n // list all commands that need write permission here\n case \"editProperties\":\t\t\n case \"editQuiz\":\n case \"getPropertiesValues\":\n case \"updateProperties\":\n case \"initPropertiesForm\":\n case \"addQuestion\":\n case \"initAddQuestionForm\":\n case \"showQuestions\":\n case \"initQuestionTable\":\n case \"createQuestion\":\n case \"deleteQuestion\":\n case \"editQuestion\":\n case \"initQuestionEditForm\":\n case \"changeQuestion\":\n case \"addChoice\":\n case \"initAddChoiceForm\":\n case \"createChoice\":\n case \"deleteChoice\":\n case \"showChoices\":\n case \"initChoicesTable\":\n case \"editChoice\":\n case \"initChoiceForm\":\n case \"changeChoice\":\n case \"endCurrentRound\":\n case \"beginCurrentRound\":\n case \"info\":\n\n case \"addQuestionAndAnswers\":\n case \"initAddQuestionAndAnswersForm\":\n case \"createQuestionAndAnswers\":\n case \"showQuestionAndAnswers\":\n case \"initQuestionAndAnswersTable\":\n case \"deleteQuestionAndAnswers\":\n case \"editQuestionAndAnswers\":\n case \"initQuestionAndAnswersEditForm\":\n case \"changeQuestionAndAnswers\":\n case \"switchUp\":\n case \"switchDown\":\t\t\n\n case \"showResults\":\n case \"initResultsTable\":\n case \"showRoundResults\":\n case \"deleteRound\":\n case \"changeRoundStatus\":\n case \"exportResultData\":\n\n $this->checkPermission(\"write\");\n $this->$cmd();\n break;\n\n case \"showCurrentRound\":\t\t\t\n // list all commands that need read permission here\n \n //no commands so far\n \n $this->checkPermission(\"read\");\n $this->$cmd();\n break;\n }\n }",
"public function executeCommands()\n {\n $isVhostCreated = $this->createVirtualHostFile();\n if (!$isVhostCreated) {\n showInfo('Something went wrong' . printNextLine());\n showInfo('Exiting the wizard.' . printNextLine());\n printNextLine();\n exit();\n }\n $this->addNewHostToHostsFile();\n showInfo(' [ ' . $this->name . $this->extension . ' ] >>> Virtual host file is created successfully' . printNextLine());\n showInfo(' [ ' . $this->name . ' ] >>> Added to the HOSTS file successfully' . printNextLine());\n $this->enableNewVirtualHost();\n printNextLine();\n showInfo(' New host ready to rock Goto >>>> http://' . $this->name);\n printNextLine();\n printNextLine();\n }",
"function performCommand($cmd)\n\t{\n\n\t\tswitch ($cmd)\n\t\t{\n\t\t\tcase \"configure\":\n\t\t\tcase \"save\":\n\t\t\t\t$this->$cmd();\n\t\t\t\tbreak;\n\n\t\t}\n\t}",
"public function execute() {\n\t\t$this->command->execute($this->arguments, $this->flags);\n\t}",
"public function execute(): void\n {\n $argv = $this->commandLoaderFactory->getCommandParameters();\n $commandNameSet = isset($argv[self::COMMAND_NAME_INDEX]);\n\n if ($commandNameSet) {\n $commandName = $argv[self::COMMAND_NAME_INDEX];\n\n $commandList = $this->getCommandList();\n $commands = array_filter(\n $commandList,\n fn($command) => strtolower($argv[self::COMMAND_NAME_INDEX]) === strtolower($command->getName())\n );\n\n if (count($commands) < 1) {\n $this->writeDataAndExit('Command {{'.$commandName.'}} does not exist');\n }\n $command = $commands[array_key_first($commands)];\n $this->doExecute($command);\n } else {\n $this->printCommandList();\n }\n }",
"private static function commands()\n {\n foreach (self::fetch(static::$root.'Lumos/Commands') as $file) {\n static::need($file);\n }\n }",
"abstract protected function executeCommand();",
"protected static function commands()\n {\n foreach (self::fetch('support/shell', false) as $file) {\n Bus::need($file);\n }\n }",
"function performCommand($cmd)\n\t{\n\t\tglobal $ilAccess, $ilTabs;\n\n\t\t$next_class = $this->ctrl->getNextClass($this);\n\t\tswitch($next_class)\n\t\t{\n\t\t\tcase 'ilmdeditorgui':\n\t\t\t\tglobal $ilErr;\n\t\t\t\tif(!$ilAccess->checkAccess('write','',$this->object->getRefId()))\n\t\t\t\t{\n\t\t\t\t\t$ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->WARNING);\n\t\t\t\t}\n\t\t\t\tinclude_once 'Services/MetaData/classes/class.ilMDEditorGUI.php';\n\t\t\t\t$md_gui = new ilMDEditorGUI($this->object->getId(), 0, $this->object->getType());\n\t\t\t\t$md_gui->addObserver($this->object,'MDUpdateListener','General');\n\t\t\t\t$ilTabs->setTabActive(\"meta_data\");\n\t\t\t\treturn $this->ctrl->forwardCommand($md_gui);\n\t\t\t\tbreak;\n\n\t\t\tcase 'ilcommonactiondispatchergui':\n\t\t\t\trequire_once 'Services/Object/classes/class.ilCommonActionDispatcherGUI.php';\n\t\t\t\t$gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();\n\t\t\t\treturn $this->ctrl->forwardCommand($gui);\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\tswitch ($cmd)\n\t\t{\n\t\t\tcase \"editProperties\":\t\t// list all commands that need write permission here\n\t\t\tcase \"saveProperties\":\n\t\t\tcase \"addPair\":\n\t\t\tcase \"editPair\":\n\t\t\tcase \"savePair\":\n\t\t\tcase \"savePairNew\":\n\t\t\tcase \"deletePairs\":\n\t\t\tcase \"savePairClose\":\n\t\t\tcase \"importCSV\":\n\t\t\tcase \"copy\":\n\t\t\tcase \"move\":\n\t\t\tcase \"paste\":\n\t\t\tcase \"importPairs\":\n\t\t\tcase \"pairs\":\n\t\t\t\t$this->checkPermission(\"write\");\n\t\t\t\t$this->$cmd();\n\t\t\t\tbreak;\n\t\t\tcase \"gallery\":\t\t\t// list all commands that need read permission here\n\t\t\t\t$this->checkPermission(\"read\");\n\t\t\t\t$this->$cmd();\n\t\t\t\tbreak;\n\t\t}\n\t}",
"protected function __run() {\n\n\t\t$validCommands = array('a', 'c', 'e', 'f', 'g', 'r', 't', 'u', 'q');\n\n\t\twhile (empty($this->command)) {\n\t\t\t$this->out(\"Packages Shell\");\n\t\t\t$this->hr();\n\t\t\t$this->out(\"[C]haracterize Packages\");\n\t\t\t$this->out(\"[E]xistence Check\");\n\t\t\t$this->out(\"[F]ix Repository Urls\");\n\t\t\t$this->out(\"[G]it Clone Repositories\");\n\t\t\t$this->out(\"[R]eset Characteristics\");\n\t\t\t$this->out(\"[U]pdate Attributes\");\n\t\t\t$this->out(\"[Q]uit\");\n\t\t\t$temp = $this->in(\"What command would you like to perform?\", $validCommands, 'i');\n\t\t\tif (in_array(strtolower($temp), $validCommands)) {\n\t\t\t\t$this->command = $temp;\n\t\t\t} else {\n\t\t\t\t$this->out(\"Try again.\");\n\t\t\t}\n\t\t}\n\n\t\tswitch ($this->command) {\n\t\t\tcase 'c' :\n\t\t\t\t$this->characterize();\n\t\t\t\tbreak;\n\t\t\tcase 'e' :\n\t\t\t\t$this->existenceCheck();\n\t\t\t\tbreak;\n\t\t\tcase 'f' :\n\t\t\t\t$this->fixRepositoryUrls();\n\t\t\t\tbreak;\n\t\t\tcase 'g' :\n\t\t\t\t$this->gitCloneRepositories();\n\t\t\t\tbreak;\n\t\t\tcase 'r' :\n\t\t\t\t$this->resetCharacteristics();\n\t\t\t\tbreak;\n\t\t\tcase 'u' :\n\t\t\t\t$this->update_attributes();\n\t\t\t\tbreak;\n\t\t\tcase 'q' :\n\t\t\t\t$this->out(__(\"Exit\"));\n\t\t\t\t$this->_stop();\n\t\t\t\tbreak;\n\t\t}\n\t}",
"function execute() {\r\n\t\t\r\n\t\tswitch( $this->mAction ) {\r\n\t\t\tcase 'help':\r\n\t\t\t\t$this->Help();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 'compute':\r\n\t\t\t\t$this->Compute();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 'liste':\r\n\t\t\t\t$this->Liste();\r\n\t\t\t\t$this->mOutput->display();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 'open':\r\n\t\t\t\t$this->Open();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 'save':\r\n\t\t\t\t$this->Save();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 'delete':\r\n\t\t\t\t$this->Delete();\r\n\t\t\t\t$this->mOutput->display();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase 'install':\r\n\t\t\t\t$this->Install();\r\n\t\t\t\t$this->mOutput->display();\r\n\t\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\t$this->mOutput->start( $this->mDB->isOK(), $this->mLang, $this->mText, array(), '', $this->mCountRegexes, $this->mRegexes );\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}",
"protected function commands() : void\n {\n $this->load(__DIR__ . '/Commands');\n\n require base_path('routes/console.php');\n }",
"public function execute(): void\n\t{\n\t\techo 'Complex Command: should be done by a receiver object <br>';\n\t\t$this->receiver->doSomething($this->a);\n\t\t$this->receiver->doSomethingElse($this->b);\n\t}",
"public function execute()\n\t{\n\t\t$this->output = $this->output->getHelpOutput();\n\t\t$this->help();\n\t\t$this->output->render();\n\t}",
"public function execute() {\n if ( $this->mInternalMode ) {\n $this->executeAction();\n } else {\n $this->executeActionWithErrorHandling();\n }\n }",
"public function execute()\n {\n // if there is no subcommand to render help, show all available commands.\n $subcommands = func_get_args();\n if ($subcommands) {\n $subcommand = array_shift($subcommands);\n // get command object.\n $cmd = $this->application->getCommand( $subcommand );\n $formatter = $this->getFormatter();\n\n $usage = $cmd->usage();\n $option_lines = $cmd->optionSpecs->outputOptions();\n\n if ( $brief = $cmd->brief() ) {\n echo $this->getFormatter()->format(ucfirst($brief),'yellow'),\"\\n\\n\";\n }\n\n if ( $usage = $cmd->usage() ) {\n echo $this->getFormatter()->format('Usage','yellow'),\"\\n\";\n echo $usage, \"\\n\";\n }\n\n if ($option_lines) {\n echo $this->getFormatter()->format('Options','yellow'),\"\\n\";\n echo join(\"\\n\",$option_lines);\n echo \"\\n\";\n }\n\n echo $cmd->getFormattedHelpText();\n\n } else {\n // print application subcommands\n\n // print application brief\n echo $this->getFormatter()->format( ucfirst($this->parent->brief()) ,'yellow'),\"\\n\\n\";\n\n if( $usage = $this->parent->usage() ) {\n echo $this->getFormatter()->format(\"Usage\",'yellow'),\"\\n\";\n echo \"\\t\", basename($_SERVER['SCRIPT_FILENAME']) , ' ' , $usage , \"\\n\\n\";\n }\n\n // print application options\n echo $this->getFormatter()->format(\"Options\",'yellow'),\"\\n\";\n $this->parent->optionSpecs->printOptions();\n\n echo \"\\n\\n\";\n\n // get command list, command classes should be preloaded.\n $classes = get_declared_classes();\n $command_classes = array();\n foreach ($classes as $class) {\n if ( is_subclass_of($class,'CLIFramework\\Command',true) ) {\n $command_classes[] = $class;\n }\n }\n\n // print command brief list\n echo $this->getFormatter()->format(\"Commands\\n\",'yellow');\n foreach ($this->application->commands as $name => $class) {\n $cmd = new $class;\n $brief = $cmd->brief();\n printf(\"%24s %s\\n\",\n $name,\n $brief );\n }\n\n echo \"\\n\";\n echo $this->getFormattedHelpText();\n }\n\n // if empty command list\n /*\n $file = __FILE__ . '.md';\n if( file_exists( $file ) )\n echo file_get_contents( $file );\n */\n\n return true;\n }",
"protected function handleCommands()\n {\n $controllerNames = ['ProductType','ProductCategory','ProductSubCategory','ProductListing','Brand','Material','Color','Style','ProductAttachment','Dashboard'];\n foreach ($controllerNames as $name){\n $controllerName = $name . 'Controller';\n //create controller\n if ($name != 'ProductAttachment' && $name != 'Dashboard'){\n $this->call('productmanagement:controller', ['name' => $controllerName]);\n }\n\n //create model\n if ($name != 'Dashboard') {\n $this->call('productmanagement:model', ['name' => $name]);\n }\n\n //create model\n if ($name != 'Dashboard' && $name != 'ProductAttachment') {\n $request = $name.'Request';\n $this->call('productmanagement:request', ['name' => $request]);\n }\n\n\n //Generate Views\n if ($name != 'ProductAttachment') {\n $this->call('productmanagement:views', ['name' => $name]);\n }\n }\n\n //Generate Routes\n $this->call('productmanagement:route');\n\n Artisan::call('vendor:publish', [\n '--tag' => 'migrations',\n ]);\n\n Artisan::call('vendor:publish', [\n '--tag' => 'public',\n ]);\n\n //Generate layout\n $this->call('productmanagement:views-partial',['name' => 'test']);\n\n }",
"public function execute()\n\t{\n\t\t$this->executeCall();\n\t\t$this->executeReminder();\n\t}",
"protected function callCommandMethod() {}",
"protected function commands()\n {\n $this->load(__DIR__ . '/Commands');\n require base_path('routes/console.php');\n }",
"protected function commands()\r\n {\r\n $this->load(__DIR__ . '/Commands');\r\n\r\n require base_path('routes/console.php');\r\n }",
"protected function commands()\n {\n $this->load(__DIR__ . '/Commands');\n\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__ . '/Commands');\n\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__ . '/Commands');\n\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__ . '/Commands');\n\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__ . '/Commands');\n\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__ . '/Commands');\n\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__ . '/Commands');\n\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__ . '/Commands');\n\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__ . '/Commands');\n\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__ . '/Commands');\n\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__ . '/Commands');\n\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__ . '/Commands');\n\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__ . '/Commands');\n\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__ . '/Commands');\n\n require base_path('routes/console.php');\n }",
"public function loadCommands(): void\n {\n $modules = $this->application['starter.module.loader']->getModules();\n\n foreach ($modules as $module) {\n $module->afterConsoleLoad($this->console);\n }\n }",
"function execute(Angie_Output $output) {\n $commands = Angie::getAvailableCommands();\n if(is_foreachable($commands)) {\n $output->printMessage('Available commands:');\n $output->printMessage('');\n \n $longest_command_name = 0;\n $name_description_map = array();\n foreach($commands as $command => $handler_file) {\n if(strlen($command) > $longest_command_name) {\n $longest_command_name = strlen($command);\n } // if\n \n require_once $handler_file;\n $handler = Angie::constructCommandHandler($command);\n \n $name_description_map[$command] = $handler->defineDescription();\n } // foreach\n \n foreach($name_description_map as $name => $description) {\n $result = $name;\n \n for($i = strlen($name); $i < ($longest_command_name + 2); $i++) {\n $result .= ' ';\n } // for\n \n $result .= '- ' . $description;\n \n $output->printMessage($result);\n } // foreach\n \n $output->printMessage('');\n $output->printMessage('To see more information for any specific command type <command> --help');\n } else {\n $output->printMessage('No commands available');\n } // if\n }",
"public function runCommand($cmd)\n {\n //excecuting\n echo \"'\".$cmd.\"' command executed.\\n\";\n }",
"private function registerCommands()\n {\n $this->add(new RunCommand());\n }",
"public function execute()\n\t{\n\t\tChangeProject::getInstance()->executeTask('cd');\n\t\tChangeProject::getInstance()->executeTask('gdb');\n\t\tChangeProject::getInstance()->executeTask('ci18n', array('markergmaps'));\n\t\tChangeProject::getInstance()->executeTask('cb');\n\t\tChangeProject::getInstance()->executeTask('cec');\n\t\tChangeProject::getInstance()->executeTask('croles');\n\t\tChangeProject::getInstance()->executeTask('cperm');\n\t\tChangeProject::getInstance()->executeTask('import-data', array('markergmaps', 'init.xml'));\n\t}",
"public function perform()\n {\n foreach ($this->actions as $action) {\n $action->perform();\n }\n }",
"public function executeAll();",
"final public function perform()\n {\n $this->execute($this->args, $this->app);\n }",
"public function execute()\n\t{\n\t\t$this->run();\n\t}",
"protected function registerCommands()\n {\n foreach (array_keys($this->commands) as $command) {\n $method = \"register{$command}Command\";\n call_user_func_array([$this, $method], []);\n }\n $this->commands(array_values($this->commands));\n }",
"protected function registerCommands()\n {\n foreach (array_keys($this->commands) as $command) {\n $method = \"register{$command}Command\";\n call_user_func_array([$this, $method], []);\n }\n $this->commands(array_values($this->commands));\n }",
"public function execute($aCommands) {\n\t\t$this->_aExcludes = array();\n\t\tforeach ($aCommands as $sCommand) {\n\t\t\t$aCommand = explode(' ', trim($sCommand));\n\t\t\t$sOpcode = array_shift($aCommand);\n\t\t\t$sParam = implode(' ', $aCommand);\n\t\t\tswitch (strtolower($sOpcode)) {\n\t\t\t\tcase 'load':\n\t\t\t\t\t$this->addFolder($sParam);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'top':\n\t\t\t\t\t$this->setTopFile($sParam);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase 'exclude':\n\t\t\t\t\t$this->_aExcludes[] = $sParam;\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tif ($sOpcode) {\n\t\t\t\t\t\t$this->setOption($sOpcode, $sParam);\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->process();\n\t}",
"protected function registerCommands()\n {\n foreach (array_keys($this->commands) as $command) {\n $method = \"register{$command}Command\";\n\n call_user_func_array([$this, $method], []);\n }\n\n $this->commands(array_values($this->commands));\n }",
"protected function registerCommands()\n {\n foreach (array_keys($this->commands) as $command) {\n $method = \"register{$command}Command\";\n\n call_user_func_array([$this, $method], []);\n }\n\n $this->commands(array_values($this->commands));\n }",
"private function loadCommands()\n {\n foreach($this->commands as $command => $class)\n {\n $this->app->bindShared($command, function($app) use ($class)\n {\n return $app->make($class);\n });\n\n $this->commands($command);\n }\n }",
"function cmdAdmin()\n\t{\n\t\t$cmd = $this->cmd;\n\n\t\tswitch ($this->cmd)\n\t\t{\n\t\t\tcase NULL:\n\t\t\tcase \"clientlist\":\n\t\t\t\t$this->setDisplayMode(\"view\");\n\t\t\t\t$this->displayClientList();\n\t\t\t\t$this->active_tab = \"clientlist\";\n\t\t\t\tbreak;\n\n\t\t\tcase \"changepassword\":\n\t\t\t\t$this->setDisplayMode(\"view\");\n\t\t\t\t$this->changeMasterPassword();\n\t\t\t\t$this->active_tab = \"password\";\n\t\t\t\tbreak;\n\n\t\t\tcase \"mastersettings\":\n\t\t\t\t$this->setDisplayMode(\"view\");\n\t\t\t\t$this->changeMasterSettings();\n\t\t\t\t$this->active_tab = \"basicsettings\";\n\t\t\t\tbreak;\n\n\t\t\tcase \"determineToolsPath\":\n\t\t\t\t$this->setDisplayMode(\"view\");\n\t\t\t\t$this->determineToolsPath();\n\t\t\t\tbreak;\n\n\t\t\tcase \"changedefault\":\n\t\t\t\t$this->changeDefaultClient();\n\t\t\t\tbreak;\n\n\t\t\tcase \"newclient\":\n\t\t\t\t$this->cmd = \"selectdb\";\n\t\t\t\t$this->setDisplayMode(\"setup\");\n\t\t\t\t$this->setup->ini_client_exists = $this->setup->newClient();\n\t\t\t\t$this->selectDBType();\n\t\t\t\tbreak;\n\n\t\t\tcase \"selectdbtype\":\n\t\t\tcase \"displayIni\":\n\t\t\t\t$this->cmd = \"ini\";\n\t\t\t\t$this->setDisplayMode(\"setup\");\n\t\t\t\t//$this->setup->ini_client_exists = $this->setup->newClient($this->client_id);\n\t\t\t\t$this->displayIni();\n\t\t\t\tbreak;\n\n\t\t\tcase \"startup\":\n\t\t\t\t$this->setDisplayMode(\"setup\");\n\t\t\t\t$this->setup->ini_client_exists = $this->setup->newClient();\n\t\t\t\t$this->displayStartup();\n\t\t\t\tbreak;\n\n\t\t\tcase \"delete\":\n\t\t\t\t$this->setDisplayMode(\"view\");\n\t\t\t\t$this->displayDeleteConfirmation();\n\t\t\t\tbreak;\n\n\t\t\tcase \"togglelist\":\n\t\t\t\t$this->setDisplayMode(\"view\");\n\t\t\t\t$this->toggleClientList();\n\t\t\t\tbreak;\n\n\t\t\tcase \"preliminaries\":\n\t\t\t\t$this->setup->checkPreliminaries();\n\t\t\t\t$this->displayPreliminaries();\n\t\t\t\t$this->active_tab = \"preliminaries\";\n\t\t\t\tbreak;\n\n\t\t\tcase \"updateBasicSettings\":\n\t\t\tcase \"performLogin\":\n\t\t\tcase \"performMLogin\":\n\t\t\t\t$this->$cmd();\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$this->cmdClient();\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public function execute()\n {\n $this->run();\n }",
"public function generateCommands();",
"private function setupCommands(): void\n {\n if ($this->app->runningInConsole()) {\n // $this->commands([\n // ]);\n }\n }",
"public function runAll()\n {\n $this->init()->run()->done();\n }",
"protected function doExecute()\n\t{\n\t\t// Your application routines go here.\n\t}",
"private function _executeCmd($cmd) {\n\n if (!$this->isDryrun()) {\n `$cmd`;\n }\n }",
"protected function registerCommands()\n {\n // create singletons of each command\n $commands = array('Register', 'Clear');\n\n foreach ($commands as $command) {\n $this->{'register'.$command.'Command'}();\n }\n\n // register commands\n $this->commands(\n 'command.presenter.register',\n 'command.presenter.clear'\n );\n }",
"protected function executeAdminCommand() {}",
"protected function executeAdminCommand() {}",
"protected function executeAdminCommand() {}",
"public function executeActions(){\n\t\tif(!isset($this->request['do'])) return;\n\t\t\n\t\tif(!is_array($this->request['do'])){\n\t\t\t$this->request['do'] = array($this->request['do']);\n\t\t}\n\t\t\n\t\tforeach($this->request['do'] as $action){\n\t\t\t$this->action_response = array();\n\t\t\t$method = \"action_\" . $action;\n\t\t\tif(method_exists($this, $method)){\n\t\t\t\t$player_id = null;\n\t\t\t\t$game_id = null;\n\t\t\t\tif(is_object($this->session->me)) $player_id = $this->session->me->getID();\n\t\t\t\tif(is_object($this->game)) $game_id = $this->game->getID();\n\t\t\t\t$sql = new SqlManager();\n\t\t\t\t$new = array( \"action_date\" => date(\"Y-m-d H:i:s\", time()), \"action_name\" => $action, \"action_game\" => $game_id, \"action_player\" => $player_id );\n\t\t\t\t$sql->insert(\"action\", $new);\n\t\t\t\t$this->action_response[$action] = $this->$method($sql->getLastInsertID());\n\t\t\t}\n\t\t}\n\t}",
"protected function _exec()\n {\n }",
"protected function populateAvailableCommands(): void\n {\n foreach ($this->commandRegistry->getLegacyCommands() as $commandName => $command) {\n /** @var Command $command */\n $this->application->add($command);\n }\n }",
"private function execute()\n\t{\n\t\t// set working dir and cli path\n\t\t$this->workingDir = getcwd();\n\t\t$this->cliPath = $this->argv[0];\n\n\t\t// get home directory\n\t\t$this->getHomeDir();\n\t}",
"public function listCommands()\n {\n $commands = $this->library->getAll();\n\n foreach ($commands as $name => $details) {\n $this->output->writeln(ucwords($name));\n $this->output->hr(strlen($details['description']), '-');\n $this->output->writeln($details['description']);\n $this->output->hr(strlen($details['description']), '-');\n\n foreach ($details['actions'] as $action) {\n $this->output->writeln(\n sprintf(\n \"%s - php [file] %s%s [params]\",\n $action,\n $name,\n ($action != 'main' ? \":$action\" : '')\n )\n );\n }\n\n // Just for padding\n $this->output->writeln('');\n }\n }",
"public function execute() {\n\t\t$controller = $this->manager->get($this->getController());\n\t\t$reflection = new \\ReflectionClass($controller);\n\t\t$controller->run( $this->getAction($reflection) );\n\t}",
"function performCommand($cmd)\n\t{\n\t\tglobal $tpl;\n\n\t\t$pl = $this->getPluginObject();\n\n\t\t$tpl->setTitle($pl->txt(\"optes_skill_matrix_configuration\"));\n\n\t\tswitch ($cmd)\n\t\t{\n\t\t\tcase \"configure\":\n\t\t\tcase \"listCols\":\n\t\t\tcase \"save\":\n\t\t\tcase \"addRow\":\n\t\t\tcase \"addCol\":\n\t\t\tcase \"saveRows\":\n\t\t\tcase \"saveCols\":\n\t\t\tcase \"deleteRows\":\n\t\t\tcase \"deleteCols\":\n\t\t\tcase \"listCompetences\":\n\t\t\tcase \"selectCompetence\":\n\t\t\tcase \"setCompetence\":\n\t\t\tcase \"removeCompetence\":\n\t\t\tcase \"showTrigger\":\n\t\t\tcase \"setTrigger\":\n\t\t\tcase \"selectTrigger\":\n\t\t\tcase \"resetTrigger\":\n\t\t\t\t$this->$cmd();\n\t\t\t\tbreak;\n\t\t}\n\t}",
"public function run()\n {\n $this->call(specialites::class);\n $this->call(cancers::class);\n $this->call(organes::class);\n $this->call(wilayas::class);\n $this->call(dairas::class);\n $this->call(communes::class);\n $this->call(employes::class);\n $this->call(permissions::class);\n $this->call(roles::class);\n $this->call(users::class);\n }",
"protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n \n require base_path('routes/console.php');\n }",
"private function registerCommands(): void\n\t{\n\t\t// get all files in the Commands dir\n\t\t$commandFiles = new \\DirectoryIterator(__DIR__ . '/Command');\n\t\t// get the Command class name ... using psr4 ... this will be same as filename\n\t\t$namespace = $this->container->get('base-commands-namespace');\n\n\t\t// loop over all files in the commands folder\n\t\tforeach ($commandFiles as $commandFile) {\n\n\t\t\t// check if file is a dir\n\t\t\tif (!$commandFile->isFile()) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\n\t\t\t// get the Command class name..using psr4 this will be same as filename\n\t\t\t$command = $namespace . pathinfo($commandFile, PATHINFO_FILENAME);\n\t\t\tif (str_contains($command, 'AbstractCommand')) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// if it is a subclass of CommandInterface\n\t\t\tif (is_subclass_of($command, CommandInterface::class)) {\n\n\t\t\t\t// add to the container, using the name as the ID e.g. $container->add('database:migrations:migrate', MigrateDatabase::class)\n\t\t\t\t$commandName = (new \\ReflectionClass($command))->getProperty('name')->getDefaultValue();\n\t\t\t\t$this->container->add($commandName, $command);\n\t\t\t}\n\t\t}\n\n\t\t// === register all user-defined commands (@todo) ===\n\n\t}",
"public function addCmds($cmds)\n {\n $this->cmds = $cmds;\n }",
"public function execute()\n {\n if ($this->escape !== false) {\n $this->options = $this->escape($this->options);\n }\n $command = $this->builder->build($this->options);\n\n exec($command);\n }",
"public function batchExecute() {\n\n }",
"public function execute() {\n\t\t\t$connection = \\Leap\\Core\\DB\\Connection\\Pool::instance()->get_connection($this->data_source);\n\t\t\tif ($this->before !== NULL) {\n\t\t\t\tcall_user_func_array($this->before, array($connection));\n\t\t\t}\n\t\t\t$connection->execute($this->command());\n\t\t\tif ($this->after !== NULL) {\n\t\t\t\tcall_user_func_array($this->after, array($connection));\n\t\t\t}\n\t\t}",
"protected function _execute() {\n\t\tDB::query(\n\t\t\tDatabase::UPDATE,\n\t\t\t'ALTER TABLE `forms` CHANGE `code` `code` VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;'\n\t\t)->execute();\n\n\t\tDB::query(\n\t\t\tDatabase::UPDATE,\n\t\t\t'ALTER TABLE `forms` CHANGE `reference` `reference` VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;'\n\t\t)->execute();\n\n\t\tDB::query(\n\t\t\tDatabase::UPDATE,\n\t\t\t'ALTER TABLE `forms` CHANGE `alt_reference` `alt_reference` VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;'\n\t\t)->execute();\n\n\t\tDB::query(\n\t\t\tDatabase::UPDATE,\n\t\t\t'ALTER TABLE `forms` CHANGE `aux_reference` `aux_reference` VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;'\n\t\t)->execute();\n\n\t\tDB::query(\n\t\t\tDatabase::UPDATE,\n\t\t\t'ALTER TABLE `roles` CHANGE `code` `code` VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;'\n\t\t)->execute();\n\n\t\tDB::query(\n\t\t\tDatabase::UPDATE,\n\t\t\t'ALTER TABLE `taxes` CHANGE `code` `code` VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;'\n\t\t)->execute();\n\n\t\tDB::query(\n\t\t\tDatabase::UPDATE,\n\t\t\t'ALTER TABLE `transactions` CHANGE `reference` `reference` VARCHAR(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL;'\n\t\t)->execute();\n\n\n\t\t// WTF is this supposed to be?\n\t\t// 1) It tells the calling script JACK SHIT and \n\t\t// 2) IS IT A FUCKING OBJECT OR AN ARRAY?!?!\n\t\treturn (object)array();\n\t}",
"public function setDefaultCommands() {\n\t\t$this->registerAll([\n\n\t\t]);\n\t}",
"public function commands()\n {\n $this->load($this->app->path('Console/Commands'));\n }",
"function execute() {\n\t\tif (empty($this->args)) {\n\t\t\t$this->__interactive();\n\t\t}\n\n\t\tif (count($this->args) == 1) {\n\t\t\t$this->__interactive($this->args[0]);\n\t\t}\n\n\t\tif (count($this->args) > 1) {\n\t\t\t$type = Inflector::underscore($this->args[0]);\n\t\t\tif ($this->bake($type, $this->args[1])) {\n\t\t\t\t$this->out('done');\n\t\t\t}\n\t\t}\n\t}",
"public abstract function exec();",
"protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n require base_path('routes/console.php');\n }",
"abstract function command();",
"public function run()\n {\n $this->call([\n TableUPMSAdmin::class,\n TableUPMSCityCountry::class,\n TableUPMSRoadmap::class,\n TableUPMSPrograms::class,\n TableUPMSSchools::class,\n TableUPMSStudents::class,\n TableUPMSTeachers::class,\n TableUPMSExams::class\n ]);\n }",
"public function commands(Commands $commands = null);",
"protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n\n require base_path('routes/console.php');\n }",
"protected function commands()\n {\n $this->load(__DIR__.'/Commands');\n\n require base_path('routes/console.php');\n }"
] | [
"0.716668",
"0.63844454",
"0.63216937",
"0.62449616",
"0.62316173",
"0.6209649",
"0.6208212",
"0.6169735",
"0.6136712",
"0.60918254",
"0.60392755",
"0.60356617",
"0.5994778",
"0.59842914",
"0.5972534",
"0.59467286",
"0.59399635",
"0.59085864",
"0.5883688",
"0.58508223",
"0.58501494",
"0.5831826",
"0.582296",
"0.582296",
"0.582296",
"0.582296",
"0.582296",
"0.582296",
"0.582296",
"0.582296",
"0.582296",
"0.582296",
"0.582296",
"0.582296",
"0.582296",
"0.582296",
"0.581768",
"0.5813736",
"0.58123463",
"0.5784578",
"0.57713836",
"0.57563794",
"0.57549185",
"0.5749806",
"0.5742908",
"0.5703922",
"0.5703922",
"0.56949675",
"0.56948286",
"0.56948286",
"0.5691012",
"0.5673732",
"0.5670041",
"0.56686217",
"0.5624207",
"0.56225866",
"0.56214374",
"0.5617595",
"0.5617321",
"0.5616103",
"0.5616103",
"0.5616103",
"0.5607584",
"0.5590401",
"0.55806917",
"0.5558079",
"0.5555534",
"0.555382",
"0.55515254",
"0.5538721",
"0.55296123",
"0.5515188",
"0.5512832",
"0.55071366",
"0.5500752",
"0.54966104",
"0.54894894",
"0.54888695",
"0.54767054",
"0.54764736",
"0.5472163",
"0.54686046",
"0.54686046",
"0.5465066",
"0.5464055",
"0.54629517",
"0.5462058",
"0.5462058",
"0.5462058",
"0.5462058",
"0.5462058",
"0.5462058",
"0.5462058",
"0.5462058",
"0.5462058",
"0.5462058",
"0.5462058",
"0.5462058",
"0.5462058",
"0.5462058"
] | 0.72279155 | 0 |
/ Define a command, with a title, to be executed later. | function defCmdT($idx, $title, $command, $has_filter = false, $header_size = 0) {
global $commands;
$title = htmlspecialchars($title, ENT_NOQUOTES);
$commands[$idx] = array(
'title' => $title,
'command' => $command,
'has_filter' => $has_filter,
'header_size' => $header_size);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cli_set_process_title($title)\n{\n}",
"public static function setTitle(string $title) {}",
"public function command($name)\n {\n $this->name = $name;\n }",
"public function addCommand($command);",
"public function setTitle(string $title);",
"function cli_set_process_title(string $title): void\n{\n error_clear_last();\n $safeResult = \\cli_set_process_title($title);\n if ($safeResult === false) {\n throw InfoException::createFromPhpError();\n }\n}",
"public function command(Command $command);",
"public function createCommand($kernel, string $commandName = null, string $commandDescription = null): Command;",
"public function setTitle($title);",
"public function setTitle($title);",
"public function setTitle($title);",
"public function setTitle($title);",
"public function setTitle($title);",
"public function setTitle($title);",
"public function setTitle($title);",
"abstract function command();",
"public function make(string $name, PreprocessorInterface $preprocessor = null): CommandInterface;",
"function setTitle($title, $append = false, $default = false) {\n\n if ($default && $this->title) return;\n\n if ($append) {\n $title = $this->title . $append . $title;\n }\n $this->title = $title;\n }",
"abstract protected function getCommand();",
"public function setTitle(string $title = null);",
"function __construct($title = \"Default\") {\n\t\t$this->_title = $title;\n\t}",
"static function help($command) {\n return 'TO-DO';\n }",
"function title ( $arguments = \"\" ) {\n $arguments = func_get_args();\n $rc = new ReflectionClass('ttitle');\n return $rc->newInstanceArgs( $arguments ); \n}",
"public function setTitle(string $text = \"untitled\");",
"function setTitle($title) {\n\t\t$this->title = $title;\n\t}",
"protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}",
"function setTitle($title)\r\n\t{\r\n\t\t$this->title = $title;\r\n\t}",
"public function setTitle($title)\n {\n $this->title = $title;\n }",
"public function inflect(ICommand $command);",
"protected function configure() {\n\n\t\tparent::configure();\n\t\t$this\n\t\t\t->setName( self::COMMAND_NAME )\n\t\t\t->setDescription( 'Just testing some command-running stuff' );\n\n\n\t}",
"public function generateCommand($singleCommandDefinition);",
"public function setTitle($title){\n \t$this->title = $title;\n }",
"public function __construct($title=false)\n\t{\n\t\t$this->setTitle($title);\n\t}",
"function set_the_title($title) {\n\n md_set_the_title($title);\n \n }",
"public function setTitle($title = '')\n {\n $this->title = $title;\n }",
"private function setTitle(\\Scrivo\\Str $title) {\n\t\t$this->title = $title;\n\t}",
"abstract public function getCommandName();",
"function setTitle($title)\n {\n $this->title = $title;\n }",
"function setTitle($title)\n {\n $this->title = $title;\n }",
"function setTitle($title)\n {\n $this->title = $title;\n }",
"public function getCommand();",
"public function setTitle($title = ''){\n $this->setVar('TITLE', $title);\n }",
"public function __construct($title = null) {\n $this->setTitle($title);\n }",
"function setTitle($title) {\n\t\t$this->_title = $title;\n\t}",
"public function setTitle($title) {\n\t\t$this->title = $title;\n\t}",
"public function setTitle($title) {\n\t\t$this->title = $title;\n\t}",
"public function setTitle($title) {\n\t\t$this->title = $title;\n\t}",
"public function setTitle($newTitle) { $this->Title = $newTitle; }",
"public function setTitle($title) {\n $this->_title = $title;\n }",
"public function setTitle($title){\n $this->title = $title;\n }",
"public function testInstantiation()\n {\n $command = new CreateRule('dummy name');\n }",
"function setTitle($title) {\r\n $this->_title = $title;\r\n }",
"function setTitle($title) {\r\n $this->_title = $title;\r\n }",
"function set_title($title){\r\n\t\t$this->_title = $title;\r\n\t}",
"function setTitle($a_title)\n\t{\n\t\t$this->title = $a_title;\n\t}",
"protected abstract function describeCommand(\\RectorPrefix20210607\\Symfony\\Component\\Console\\Command\\Command $command, array $options = []);",
"public function setTitle(string $title) {\n\t\t$this->title = $title;\n\t}",
"private function SetTitleProcess() {\r\n $title = \"PhpMX client\";\r\n $title .= \" | PeerID: \" . substr(PoW::hash($this->ip . $this->port), 0, 18);\r\n if ($this->connected_to_bootstrap || $this->bootstrap_node)\r\n $title .= \" | BootstrapNode: Connected\";\r\n else\r\n $title .= \" | BootstrapNode: Disconnected\";\r\n $title .= \" | Peers: \" . count($this->chaindata->GetAllPeers());\r\n\r\n if ($this->syncing)\r\n $title .= \" | Blockchain: Synchronizing\";\r\n else\r\n $title .= \" | Blockchain: Synchronized\";\r\n\r\n if ($this->enable_mine)\r\n $title .= \" | Minning\";\r\n\r\n if ($this->isTestNet)\r\n $title .= \" | TESTNET\";\r\n else\r\n $title .= \" | MAINNET\";\r\n\r\n cli_set_process_title($title);\r\n }",
"public function helpStubCommand() {}",
"public function setTitle($title)\r\n {\r\n $this->title = $title;\r\n }",
"public function setTitle($title) {\n $this->title = $title ;\n }",
"public function setTitle($title) {\r\n $this->title = $title;\r\n }",
"public function show(command $command)\n {\n //\n }",
"public static function register_command($name, $callback_obj) {\n\t\tif (!isset(CLI_Manager::$commands[$name])) {\n\t\t\tif ($callback_obj instanceof CLI_Method)\n\t\t\t\tCLI_Manager::$commands[$name] = $callback_obj;\n\t\t\telse\n\t\t\t\tprint $GLOBALS['i18n']['framework']['cli_err3'] . \"\\n\";\n\t\t} else {\n\t\t\tprint $GLOBALS['i18n']['framework']['cli_err1'] . \"\\n\";\n\t\t}\n\t}",
"public function setTitle($title) {\n\t\t$title = str_replace(\"\\r\\n\", \"|\", $title);\n\t\t$title = str_replace(\" \", \"+\", $title);\n\t\t$this -> setProperty('chtt', $title);\n\t}",
"function setTitle($title)\r\n {\r\n $this->title = $title;\r\n }",
"function getAfterCreationCmd(){\n return \"editQuiz\";\n }",
"function append_title($title){\r\n\t\t$this->_title .= \" - {$title}\";\r\n\t}",
"function setTitle($title)\n {\n $this->m_title = $title;\n }",
"public function setTitle($title)\n\t{\n\t\t$this->title = $title;\n\t}",
"public function setTitle($title)\n\t{\n\t\t$this->title = $title;\n\t}",
"public function setTitle( $newTitle )\n {\n\t\t$this->title = $newTitle;\n\t}",
"function cli_get_process_title()\n{\n}",
"public function __construct($title)\n {\n $this->_title = $title;\n $this->createMenuBar();\n }",
"public function setTitle($title) {\n $this->title = $title;\n }",
"public function setTitle($title) {\n $this->title = $title;\n }",
"public function command(string $command, string $color): void;",
"public function setTitle($title){\n $this->title = $title;\n }",
"function __construct($title)\n\t{\n\t\t$this->title = $$title;\n\t\t$this->name = strtolower(str_ireplace(array(' ','-'), '_', $title));\n\t\t\n\t}",
"public function add(Command $command);",
"public function setTitle($title)\n {\n $this->title = $title;\n }",
"public function setTitle($title)\n {\n $this->title = $title;\n }",
"public function setTitle($title)\n {\n $this->title = $title;\n }",
"public function setTitle($title)\n {\n $this->title = $title;\n }",
"public function setTitle($title)\n {\n $this->title = $title;\n }",
"public function setTitle($title)\n {\n $this->title = $title;\n }",
"public function getCommand() {}",
"public static function header($title)\n\t{\n\t\tstatic::stdout(' '.$title.PHP_EOL);\n\t\tstatic::stdout(' '.\\str_repeat('-', static::$screenwidth-1).PHP_EOL.PHP_EOL);\n\t}",
"public static function title();",
"public function getCommand()\n {\n }",
"public function title();",
"public function title();",
"public function setTitle($title) {\r\n $this->_title = $title;\r\n }",
"public function setTitle($newTitle) {\n\t\t$this->title = $newTitle;\n\t}",
"public function __construct($title) {\n $this->title = $title;\n }",
"public function inflect(CommandInterface $command);",
"public function setTitle($title, $position = 'center') {\n\t\t// Titles currently not supported anymore\n\t}",
"public function __construct(string $command, string $before = '', string $after = '')\n {\n $this->command = $command;\n $this->before = $before;\n $this->after = $after;\n }",
"function defineDescription() {\n return 'List all available commands with a short description';\n }",
"public function set_title($title)\n {\n $this->title = $title;\n }"
] | [
"0.71256137",
"0.62166727",
"0.6145505",
"0.61246043",
"0.6109873",
"0.60980177",
"0.6092369",
"0.6000132",
"0.5973146",
"0.5973146",
"0.5973146",
"0.5973146",
"0.5973146",
"0.5973146",
"0.5973146",
"0.5946619",
"0.5909338",
"0.59040457",
"0.5835975",
"0.5817727",
"0.5814606",
"0.58085227",
"0.5808206",
"0.5800968",
"0.579065",
"0.57695264",
"0.5750809",
"0.57480335",
"0.5741162",
"0.5730213",
"0.5729771",
"0.57283366",
"0.5725989",
"0.5715638",
"0.57132494",
"0.571291",
"0.570463",
"0.5701635",
"0.5701635",
"0.5701635",
"0.5695094",
"0.56909084",
"0.5679827",
"0.5674184",
"0.5668895",
"0.5668895",
"0.5668895",
"0.5668599",
"0.5668077",
"0.56594175",
"0.5653533",
"0.56534475",
"0.56534475",
"0.56531245",
"0.5650278",
"0.56498295",
"0.56477153",
"0.56400794",
"0.56333315",
"0.5629712",
"0.5628884",
"0.562647",
"0.5619279",
"0.56161046",
"0.5605337",
"0.56027704",
"0.56001604",
"0.55962515",
"0.559476",
"0.5594446",
"0.5594446",
"0.55857867",
"0.5576504",
"0.55695236",
"0.556378",
"0.556378",
"0.55631894",
"0.5556505",
"0.55557036",
"0.554942",
"0.5545212",
"0.5545212",
"0.5545212",
"0.5545212",
"0.5545212",
"0.5545212",
"0.5541178",
"0.5538411",
"0.5531098",
"0.5530517",
"0.5527872",
"0.5527872",
"0.55209213",
"0.5518457",
"0.5502952",
"0.5502832",
"0.54910904",
"0.5481362",
"0.5480588",
"0.54742455"
] | 0.7107565 | 1 |
Handle an incoming request. | public function handle($request, Closure $next)
{
if(Auth::check())
{
if(Auth::user()->quyen == 1){
return $next($request);
}
else{
$msg = "Tài khoản được phép đăng nhập";
return response()->json($msg, Response::HTTP_ACCEPTED);
}
}
else{
$msg= "Bạn chưa đăng nhập";
return response()->json($msg, Response::HTTP_BAD_REQUEST);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function handle_request();",
"public function handleRequest();",
"public function handleRequest();",
"public function handleRequest();",
"protected abstract function handleRequest();",
"abstract public function handleRequest($request);",
"abstract public function handleRequest(Request $request);",
"public function handle($request);",
"public function handleRequest() {}",
"function handleRequest() ;",
"public function handle(Request $request);",
"protected function handle(Request $request) {}",
"public function handle(array $request);",
"public function process_request() {\n if(!empty($this->POST)) {\n return $this->handlePOST();\n } else {\n return $this->handleGET();\n }\n }",
"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 }",
"abstract protected function process(Request $request);",
"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 }",
"abstract function handle(Request $request, $parameters);",
"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 handle(ServerRequestInterface $request);",
"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 }",
"function handle(Request $request = null, Response $response = null);",
"public function processRequest();",
"public abstract function processRequest();",
"public function handleRequest(Request $request, Response $response);",
"abstract public function processRequest();",
"public function handle(array $request = []);",
"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 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 }",
"protected function _handle()\n {\n return $this\n ->_addData('post', $_POST)\n ->_addData('get', $_GET)\n ->_addData('server', $_SERVER)\n ->_handleRequestRoute();\n }",
"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 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 }",
"public function process(Request $request, Response $response, RequestHandlerInterface $handler);",
"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 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}",
"public function handle(Request $request): Response;",
"public static function process_http_request()\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 }",
"abstract public function handle(ServerRequestInterface $request): ResponseInterface;",
"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}",
"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 handle($request, $next);",
"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(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 }",
"public function process($path, Request $request);",
"public function handle(string $query, ServerRequestInterface $request);",
"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 ()\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 handle($request)\n {\n $this->setRouter($this->app->compose('Cygnite\\Base\\Router\\Router', $request), $request);\n\n try {\n $response = $this->sendRequestThroughRouter($request);\n /*\n * Check whether return value is a instance of Response,\n * otherwise we will try to fetch the response form container,\n * create a response and return to the browser.\n *\n */\n if (!$response instanceof ResponseInterface && !is_array($response)) {\n $r = $this->app->has('response') ? $this->app->get('response') : '';\n $response = Response::make($r);\n }\n } catch (\\Exception $e) {\n $this->handleException($e);\n } catch (Throwable $e) {\n $this->handleException($e);\n }\n\n return $response;\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 }",
"public function handleRequest(Zend_Controller_Request_Http $request)\n {\n \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 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 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(RequestInterface $request): ResponseInterface;",
"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 process(\n ServerRequestInterface $request,\n RequestHandlerInterface $handler\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}",
"public function handleHttpRequest($requestParams)\n\t{\n\t\t$action = strtolower(@$requestParams[self::REQ_PARAM_ACTION]);\t\t\n\t\t$methodName = $this->actionToMethod($action);\n\t\t\n\t\ttry\n\t\t{\n\t\t\t$this->$methodName($requestParams);\n\t\t} catch(Exception $e)\n\t\t{\n\t\t\techo \"Error: \".$e->getMessage();\n\t\t}\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() {\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 }",
"public function processRequest() {\n $this->server->service($GLOBALS['HTTP_RAW_POST_DATA']);\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 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 }",
"public function handle(ClientInterface $client, RequestInterface $request, HttpRequest $httpRequest);",
"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 function serve_request()\n {\n }",
"public static function process($request){\r\n\t\tcall_user_func($request -> action, $request -> params);\r\n\t}",
"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 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}",
"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 }",
"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 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 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 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 }",
"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 RouteRequest ();",
"public function handle(ServerRequestInterface $request, $handler, array $vars): ?ResponseInterface;",
"public function DispatchRequest ();",
"protected function handleRequest() {\n\t\t// FIXME: is this necessary?\n\t\t$this->getOutput()->allowClickjacking();\n\t\tparent::handleRequest();\n\t}",
"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}",
"abstract public function request();",
"public function run() {\r\n $this->routeRequest(new Request());\r\n }",
"public function processAction(Request $request)\n {\n // Get the request Vars\n $this->requestQuery = $request->query;\n\n // init the hybridAuth instance\n $provider = trim(strip_tags($this->requestQuery->get('hauth_start')));\n $cookieName = $this->get('azine_hybrid_auth_service')->getCookieName($provider);\n $this->hybridAuth = $this->get('azine_hybrid_auth_service')->getInstance($request->cookies->get($cookieName), $provider);\n\n // If openid_policy requested, we return our policy document\n if ($this->requestQuery->has('get') && 'openid_policy' == $this->requestQuery->get('get')) {\n return $this->processOpenidPolicy();\n }\n\n // If openid_xrds requested, we return our XRDS document\n if ($this->requestQuery->has('get') && 'openid_xrds' == $this->requestQuery->get('get')) {\n return $this->processOpenidXRDS();\n }\n\n // If we get a hauth.start\n if ($this->requestQuery->has('hauth_start') && $this->requestQuery->get('hauth_start')) {\n return $this->processAuthStart();\n }\n // Else if hauth.done\n elseif ($this->requestQuery->has('hauth_done') && $this->requestQuery->get('hauth_done')) {\n return $this->processAuthDone($request);\n }\n // Else we advertise our XRDS document, something supposed to be done from the Realm URL page\n\n return $this->processOpenidRealm();\n }",
"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 handle(Request $request, Response|JsonResponse|BinaryFileResponse|StreamedResponse $response, int $length);",
"public function handle(Request $request, Closure $next);",
"public function handleGetRequest($id);",
"abstract function doExecute($request);",
"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 mapRequest($request);",
"public function handle(ServerRequestInterface $request)\n {\n $router = $this->app->get(RouterInterface::class);\n $response = $router->route($request);\n\n if (! headers_sent()) {\n\n // Status\n header(sprintf(\n 'HTTP/%s %s %s',\n $response->getProtocolVersion(),\n $response->getStatusCode(),\n $response->getReasonPhrase()\n ));\n\n // Headers\n foreach ($response->getHeaders() as $name => $values) {\n foreach ($values as $value) {\n header(sprintf('%s: %s', $name, $value), false);\n }\n }\n }\n\n echo $response->getBody()->getContents();\n }",
"abstract public function processRequest(PriceWaiter_NYPWidget_Controller_Endpoint_Request $request);",
"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 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}",
"protected function handle(Request $request)\n {\n return 1;\n }",
"public function __invoke(Request $request, RequestHandler $handler) {\n R::setup('mysql:host=127.0.0.1;dbname=cellar','root','');\n \n $response = $handler->handle($request);\n R::close();\n return $response;\n }",
"public function handle($req)\n {\n $params = $req->post ?: [];\n\n $files = $this->transformFiles($req->files);\n\n $cookies = $req->cookie ?: [];\n\n $server = $this->transformHeadersToServerVars(array_merge($req->header, [\n 'PATH_INFO' => array_get($req->server, 'path_info'),\n ]));\n $server['X_REQUEST_ID'] = Str::uuid()->toString();\n\n $requestUri = $req->server['request_uri'];\n if (isset($req->server['query_string']) && $req->server['query_string']) {\n $requestUri .= \"?\" . $req->server['query_string'];\n }\n\n $resp = $this->call(\n strtolower($req->server['request_method']),\n $requestUri, $params, $cookies, $files,\n $server, $req->rawContent()\n );\n\n return [\n 'status' => $resp->getStatusCode(),\n 'headers' => $resp->headers,\n 'body' => $resp->getContent(),\n ];\n }",
"public function handle(Request $request)\n {\n $route_params = $this->_router->match($request->getUri());\n $route = $route_params['route'];\n $params = $route_params['params'];\n\n $func = reset($route) . self::CONTROLLER_METHOD_SUFIX;\n $class_name = key($route);\n $controller = new $class_name($request);\n\n $response = call_user_func_array(\n [\n $controller,\n $func,\n ],\n [$params]\n );\n\n if ($response instanceof Response) {\n return $response;\n } else {\n throw new InvalidHttpResponseException();\n }\n }"
] | [
"0.8299201",
"0.8147294",
"0.8147294",
"0.8147294",
"0.8127764",
"0.7993589",
"0.7927201",
"0.7912899",
"0.7899075",
"0.76317674",
"0.75089735",
"0.7485808",
"0.74074036",
"0.7377414",
"0.736802",
"0.7294553",
"0.72389543",
"0.7230166",
"0.72108",
"0.71808434",
"0.7170364",
"0.71463037",
"0.7126907",
"0.7122795",
"0.71225274",
"0.7116879",
"0.70607233",
"0.6981947",
"0.6966695",
"0.69393975",
"0.6912079",
"0.68985975",
"0.6887614",
"0.68774897",
"0.6806274",
"0.67969805",
"0.67778915",
"0.6762979",
"0.67565143",
"0.67533374",
"0.67192745",
"0.6683243",
"0.66487724",
"0.66395754",
"0.6634629",
"0.66283566",
"0.6617558",
"0.6610097",
"0.6610011",
"0.6544976",
"0.653806",
"0.6512757",
"0.64682734",
"0.64381886",
"0.6416964",
"0.63373476",
"0.63359964",
"0.6334543",
"0.63308066",
"0.6321675",
"0.63176167",
"0.631661",
"0.6310991",
"0.63108873",
"0.6295945",
"0.6279438",
"0.62778515",
"0.62508965",
"0.62422955",
"0.62321424",
"0.62237644",
"0.6203428",
"0.61954546",
"0.6191255",
"0.61774665",
"0.61682004",
"0.6151806",
"0.61271876",
"0.61257905",
"0.6116093",
"0.61126447",
"0.6112368",
"0.6101652",
"0.60893977",
"0.60871464",
"0.60862815",
"0.60734737",
"0.60535145",
"0.6028341",
"0.60250086",
"0.60224646",
"0.6011745",
"0.6011483",
"0.60106593",
"0.5998867",
"0.5997086",
"0.5991233",
"0.59844923",
"0.59668386",
"0.5961315",
"0.5954762"
] | 0.0 | -1 |
/ Created dbConn to act as a callable function to connect directly to the local database, can be reused easily. Connects to database by providing address, username, and password (additional optional criteria can be provided such as the database name and the port being connected on). | function DatabaseConnection2()
{
$host ="host.docker.internal";
$username ="root";
$password ="password";
//$dbname ="clean";
//$port = "33066";
/*
This line will lead to the connection being refused by the database and i am unsure why
I have:
Terminated all processes on port 33066 in terminal.
Used localhost instead of an address.
Manually put the host, username, password strings inline.
Turned off firewall/antivirus in case of interference.
re-downloaded tscan files.
Used host.docker.internal in place of address.
*/
//Creates the database connection
$dbConn = new mysqli($host, $username, $password);
//Checks the database connection
//If the database can not be connected to, will return an error message.
if ($dbConn->connect_error)
{
echo "<p>Connection Failed: ".$dbConn->connect_error."</p>\n";
exit;
}
echo "Connected Successfully";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function OpenConnection( $user, $pass, $ip, $port, $db, $options );",
"public function connect($host, $database, $user, $password);",
"function db_connect($db_hostname, $db_username, $db_password, $db_name)\n\t{ global $db_port;\n\t\t$this->db_connection = pg_connect(\"host=\".$db_hostname.\" port=\".$db_port.\" dbname=\".$db_name.\" user=\".$db_username.\" password=\".$db_password) \n\t\t\tOR die (\"Connection Error to PostgreSQL Server\");\n\t\treturn $this->db_connection;\n\t}",
"function setDatabaseConnection($host,$database,$user,$pass);",
"function mysqli_connect($hostname=NULL, $username=NULL, $password=NULL, $new=NULL, $flags=NULL) { return pdo_connect(func_get_args()); }",
"public function connect()\n {\n $config = $this->config;\n $config = array_merge($this->_baseConfig, $config);\n\n $conn = \"DATABASE='{$config['database']}';HOSTNAME='{$config['host']}';PORT={$config['port']};\";\n $conn .= \"PROTOCOL=TCPIP;UID={$config['username']};PWD={$config['password']};\";\n\n if (!$config['persistent']) {\n $this->connection = db2_connect($conn, PGSQL_CONNECT_FORCE_NEW);\n } else {\n $this->connection = db2_pconnect($conn);\n }\n $this->connected = false;\n\n if ($this->connection) {\n $this->connected = true;\n $this->query('SET search_path TO '.$config['schema']);\n }\n if (!empty($config['charset'])) {\n $this->setEncoding($config['charset']);\n }\n\n return $this->connection;\n }",
"function dbConnect($app_name, $database) {\n\t$err = null;\n\t// if (!is_file($GLOBALS['instance']['password_file'])) $err = 'Specified password file does not exist.';\n\n\tif (!$err) {\n\t\t// require_once($GLOBALS['instance']['password_file']);\n\n\t\t// if (!is_array($_PASSWD)) $err = 'Password file did not contain password definitions.';\n\t\t// if (!is_array($_PASSWD[$app_name])) $err = 'Password file did not contain an entry for the specified application.';\n\n\t\tif (!$err) {\n\t\t\t$host = $GLOBALS['instance']['host'];\n\t\t\t$login = $GLOBALS['instance']['username'];\n\t\t\t$pass = $GLOBALS['instance']['password'];\n\t\t\tunset($_PASSWD);\n\t\t\t$conn = new mysqli($host, $login, $pass, $database);\n\n\t\t\tif ($conn->connect_errno) {\n\t\t\t\t$err = $conn->connect_error;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ($err) {\n\t\techo str_replace('%%error%%', $err, $this->error_html);\n\t\texit;\n\t}\n\treturn $conn;\n\n}",
"public static function connect($host, $port, $dbname, $user, $password){\r\n\t\t$conn = null;\r\n\t\ttry{\r\n\t\t\tself::$_host = trim((string) $host);\r\n\t\t\tself::$_port = trim((string) $port);\r\n\t\t\tself::$_dbname = trim((string) $dbname);\r\n\t\t\tself::$_user = trim((string) $user);\r\n\t\t\t// create a database connection\r\n\t\t\t$driver = get_called_class();\r\n\t\t\t$conn = new \\PDO($driver::getDsn((string) $password));\r\n\t\t\t// Use the following to make it throw an exception\r\n\t\t\t$conn->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\r\n\t\t}catch(\\PDOException $e){\r\n\t\t\t$conn = $e;\r\n\t\t}catch(\\Exception $e){\r\n\t\t\t$conn = $e;\r\n\t\t}\r\n\t\t// Return a PDO connection object or an exception object\r\n\t\treturn $conn;\r\n\t}",
"function connect_db($host, $username, $passwd, $port, $db)\n{\n $dbinfo = \"mysql:host=\".$host.\";dbname=\".$db.\";port=\".$port;\n\n if (($host != NULL) && ($username != NULL) && ($port != NULL) && ($db != NULL))\n {\n try\n {\n $db = new PDO($dbinfo, $username, $passwd);\n return $db;\n }\n\n catch (PDOException $e)\n {\n echo \"PDO ERROR\".\" \".$e->getMessage();\n $errorMsg = \"Error connection to DB\";\n echo $errorMsg.PHP_EOL;\n }\n }\n \n else\n {\n $error = \"Bad params! Usage: php connect_db.php host username password port db\";\n echo $error.PHP_EOL;\n }\n}",
"function connectToDatabase() {\n $servername = '127.0.0.1';\n $username = 'runlog_user';\n $password = 'run4FUN';\n $db = 'runlog';\n\n try {\n $conn = new PDO(\"mysql:host=$servername;dbname=$db\", $username, $password);\n // set the PDO error mode to exception\n $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n } catch(PDOException $e) {\n echo \"Database connection failed: \" . $e->getMessage();\n }\n return $conn;\n }",
"function accessdb() {\n require 'dbcreds.php'; //Grab the database credentials\n try {\n $conn = new PDO($dsn, $dbun, $dbpw, $options);\n } catch(PDOException $e) {\n echo \"Connection failed: \" . $e->getMessage() . \"<br><br>\"; //Error handling\n }\n return $conn;\n}",
"public function connectToDB() {}",
"private function connectDatabase() {\r\r\n\t\t$this->dbHandle = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Core\\\\Database\\\\DatabaseConnection');\r\r\n\t\t$this->dbHandle->setDatabaseHost($this->dbHost);\r\r\n\t\t$this->dbHandle->setDatabaseUsername($this->dbUsername);\r\r\n\t\t$this->dbHandle->setDatabasePassword($this->dbPassword);\r\r\n\t\t$this->dbHandle->setDatabaseName($this->db);\r\r\n\t\t$this->dbHandle->sql_pconnect();\r\r\n\t\t$this->dbHandle->sql_select_db();\r\r\n\t}",
"function connect_to_db () {\n\tglobal $conn;\n\tglobal $pdo_connection_string;\n\n\tif (!is_null($conn))\n\t\treturn $conn;\n\n\ttry {\n\t // connect to the database\n\t\t$conn = new PDO($pdo_connection_string, DB_USER, DB_PASS);\n\n\t\t// throw exceptions when errors occur\n\t\t$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n\t\t// fetch rows as associative arrays (dictionaries)\n\t\t$conn->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC);\n\t} catch (PDOException $e) {\n\t echo \"Database exception: \" . $e->getMessage() . \"\\n\";\n\t die;\n\t}\n\n\treturn $conn;\t\n}",
"function createConection(){\n\n\t\tglobal $db_host;\n\t\tglobal $db_usr;\n\t\tglobal $db_pwd;\n\t\tglobal $db_name;\n\t\tglobal $db_port;\n\n\t\treturn pg_connect('user='.$db_usr.' password='.$db_pwd.' host= '.$db_host.' dbname = '.$db_name.' port = '.$db_port);\n\t}",
"function connect(\n\t\t$dbname)\n\t{\n\t\trequire 'config.php';\n\n\t\t$servername = $configs['db_servername'];\n\t\t$username = $configs['db_username'];\n\t\t$password = $configs['db_password'];\n\n\t\t// Create connection\n\t\t$this->connection = new mysqli($servername, $username, $password, $dbname);\n\n\t\t// Check connection\n\t\tif ($this->connection->connect_error) {\n\t\t\tdie(\"Connection failed: \" . $this->connection->connect_error);\n\t\t}\n\t}",
"public function connect($config)\n {\n extract($config);\n $host_dsn = isset($host) ? 'host='.$host.';' : '';\n $dsn = 'pgsql:'.$host_dsn.'dbname='.$database;\n\n if (isset($config['port'])) {\n $dsn .= ';port='.$config['port'];\n }\n\n $connection = new PDO($dsn, $username, $password, $this->options($config));\n\n if (isset($config['charset'])) {\n $connection->prepare(\"SET NAMES '\".$config['charset'].\"'\")->execute();\n }\n\n if (isset($config['schema'])) {\n $connection->prepare('SET search_path TO '.$config['schema'])->execute();\n }\n\n return $connection;\n }",
"function getConnection($db,$custom);",
"function connect()\n{\n $hostname = getenv('IP');\n $username = getenv('C9_USER');\n $password = \"\";\n $database = \"c9\";\n $dbport = 3306;\n \n // Create connection\n $db = new mysqli($hostname, $username, $password, $database, $dbport);\n \n // Check connection\n if ($db->connect_error) {\n die(\"Connection failed: \" . $db->connect_error);\n } \n \n // return the connection to the calling script, so it can be used elsewhere\n return $db;\n}",
"function connect_to_db()\n{\n\tglobal $db_host;\n\tglobal $db_name;\n\tglobal $db_username;\n\tglobal $db_password;\n\n\t$conn = false;\n\n\t\t/* Connect to the database */\n\t\t$conn = new PDO('mysql:host='.$db_host.';dbname='.$db_name, $db_username, $db_password);\n\n\t\t/* Disable the emulatrion of prepared statements */\n\t\t$conn->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n\t\t$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n\t\t/* Return the connection object*/\n\t\treturn $conn;\n\n\treturn $conn;\n}",
"protected function db_connect() {\n \n // Data source name\n $this->dsn = 'mysql:host=' . $this->db_host . ';dbname=' . $this->db_name . ';charset=' . $this->db_charset;\n\n // Makes a connection to the database\n $this->db_conn = new PDO( $this->dsn, $this->db_user, $this->db_password );\n\n // When fetching an SQL row it turn into an object\n $this->db_conn->setAttribute( PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ );\n // Gives the Error reporting atribute and throws exeptions\n $this->db_conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\n \n // Returns the connection\n return $this->db_conn;\n\n }",
"function __construct($dbhost=null, $dbuser=null, $dbpass=null, $dbname='', $dbport='', $dbdns=''){\n\t\t$this->connect($dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbdsn);\n\t}",
"function db_driver_connect()\n{\n global $_db;\n\n $_db['resource'][$_db['target']]['dbh'] = pg_connect('host=' . $_db['resource'][$_db['target']]['config']['host'] . ($_db['resource'][$_db['target']]['config']['port'] ? ' port=' . $_db['resource'][$_db['target']]['config']['port'] : '') . ' dbname=' . $_db['resource'][$_db['target']]['config']['name'] . ' user=' . $_db['resource'][$_db['target']]['config']['username'] . ' password=' . $_db['resource'][$_db['target']]['config']['password'], true);\n if (!$_db['resource'][$_db['target']]['dbh']) {\n if (LOGGING_MESSAGE) {\n logging('message', 'db: Connect error');\n }\n\n error('db: Connect error');\n }\n\n return;\n}",
"public function connect()\r\n\t{\r\n\t\t$conn_string = \"DATABASE=\".$this->dbname.\";HOSTNAME=\".$this->host.\";PORT=\".$this->port.\";PROTOCOL=TCPIP;UID=\".$this->user.\";PWD=\".$this->pwd.\";\";\r\n\t\t$this->conn = db2_connect($conn_string, '', '');\r\n\t\t\r\n\t\tif( !$this->conn ) \r\n\t\t\ttrigger_error( db2_conn_errormsg(), E_USER_ERROR );\r\n\t\t\r\n\t\treturn $this->conn;\r\n\t}",
"private function _newConnection($host, $dbname, $username, $passwd, $options = NULL) \n\t{\n\t\t// setting default options if not provided\n\t\t$options || $options = array (\n\t\t\t\\PDO::MYSQL_ATTR_FOUND_ROWS => TRUE\n\t\t);\n\t\n\t\ttry {\n\t\t\t// connect to the database\n\t\t\t$this->_connection = new \\PDO ( 'mysql:host=' . $host . ';dbname=' . $dbname, $username, $passwd, $options );\n\t\t\t\t\n\t\t\t// set the error codes\n\t\t\t$this->_connection->setAttribute ( \\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION );\n\t\t} catch ( PDOException $e ) {\n\t\t\ttrigger_error ( 'Error connecting to host: ' . $e->getMessage (), E_USER_ERROR );\n\t\t}\n\t}",
"function connectToDatabase() {\n\n $host = self::servername;\n $databaseName = self::dbname;\n $password = self::password;\n $username = self::username;\n //To create the connection\n $conn = new mysqli($host, $username, $password, $databaseName);\n self::$conn = $conn;\n //Connection Checking, if there is a connection error, print the error\n if ($conn->connect_error) {\n exit(\"Failure\" . $conn->connect_error);\n }\n }",
"function dbConnect($db='') {\n global $dbhost, $dbuser, $dbpass, $dbname, $dbport, $socket;\n\n $mysqli = new mysqli($dbhost, $dbuser, $dbuser, $dbname); \n // $mysqli = new mysqli('calvar.fatcowmysql.com:3306', 'calvar', 'narnia3#', 'ccc'); \n if (!$mysqli) { \n die('Could not connect: ' . mysqli_error()); \n } \n echo 'Connected successfully'; \n \n // $dbcnx = new mysqli('clavar.fatcowmysql.com', 'calvar', 'calvary1986', 'ccc')\n // or die('The site database appears to be down.');\n return $mysqli;\n}",
"function create_db_connection($host, $user, $password, $dbname, $new_connection = FALSE, $persistency = FALSE)\n{\n\tglobal $phpraid_config;\n\t\n\t// If you are using PHP 4 and need to be instanciating objects by reference, uncomment the second \"$connection\" string below and\n\t// comment the first one.\n\t$connection = new sql_db($host , $user, $password, $dbname, $new_connection, $persistency);\t\t\n\t//$connection = &new sql_db($host, $user, $password, $dbname, $new_connection, $persistency);\t\t\n\t\n\treturn $connection;\n}",
"public static function connect()\n {\n // Only connect if we don't have a handle on the database\n if (!is_null(self::$_db))\n return self::$_db;\n \n try\n {\n // DSN FORMAT: \"mysql:host=localhost;dbname=test\"\n $dsn = Config::get('Database', 'Driver') . ':host=' . Config::get('Database', 'DBHost') . ';dbname=' . Config::get('Database', 'DB');\n self::$_db = new PDO($dsn, Config::get('Database','Username'), Config::get('Database','Password'), array(PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES utf8\"));\n self::$_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n }\n catch (PDOException $e)\n {\n throw new DaoException(\"Error (Dao::connect): \" . $e->getMessage());\n }\n }",
"function dbconnect() {\n\t// XXX: Remove after merge\n\t$args = func_get_args();\n\tif (count($args) == 1 && !defined('DB_HOST')) {\n\t\tLogOutput(\"dbconnect called without dbsetup from \" . $_SERVER['SCRIPT_NAME'], \"MergeLog.txt\");\n\t\tcall_user_func_array('dbsetup', $args);\n\t}\n\n\t// try to connect to database\n\tif ($dbc = @mysql_connect(DB_HOST, DB_USER, DB_PASSWORD)) {\n\t\tif (!mysql_select_db(DB_NAME)) {\n\t\t\t$error_str = \"Error: Could not select database: \" . dberror();\n\t\t\tEFailure(EC_REALS_DATABASE, \"dbconnect_internal() can't select DB: %s\", $error_str);\n\t\t\t\n\t\t\treturn null;\n\t\t} else {\n\t\t\t$GLOBALS['kDBConnection'] = $dbc;\n\t\t\treturn $dbc;\n\t\t}\n\t} else {\n\t\tEFailure(EC_REALS_DATABASE, \"Could not connect to the database: %s\", dberror());\n\t\t\n\t\treturn null;\n\t}\n}",
"function sql_connect_args($db_host = 'localhost', $db_user = '', $db_password = '', $db_name = '') {\n global $CONF, $MYSQL_HANDLER;\n\n $DB_DRIVER_NAME = $MYSQL_HANDLER[1];\n\n try {\n if (strpos($db_host,':') === false) {\n $host = $db_host;\n $port = '';\n $portnum = '';\n }\n else {\n list($host,$port) = explode(\":\",$db_host);\n if (isset($port)) {\n $portnum = $port;\n $port = ';port='.trim($port);\n }\n else {\n $port = '';\n $portnum = '';\n }\n }\n \n switch ($DB_DRIVER_NAME) {\n case 'sybase':\n case 'dblib':\n if (is_numeric($portnum)) $port = ':'.intval($portnum);\n else $port = '';\n $DBH = new PDO($DB_DRIVER_NAME.':host='.$host.$port.';dbname='.$db_name, $db_user, $db_password);\n break;\n case 'mssql':\n if (is_numeric($portnum)) $port = ','.intval($portnum);\n else $port = '';\n $DBH = new PDO($DB_DRIVER_NAME.':host='.$host.$port.';dbname='.$db_name, $db_user, $db_password);\n break;\n case 'oci':\n if (is_numeric($portnum)) $port = ':'.intval($portnum);\n else $port = '';\n $DBH = new PDO($DB_DRIVER_NAME.':dbname=//'.$host.$port.'/'.$db_name, $db_user, $db_password);\n break;\n case 'odbc':\n if (is_numeric($portnum)) $port = ';PORT='.intval($portnum);\n else $port = '';\n $DBH = new PDO($DB_DRIVER_NAME.':DRIVER={IBM DB2 ODBC DRIVER};HOSTNAME='.$host.$port.';DATABASE='.$db_name.';PROTOCOL=TCPIP;UID='.$db_user.';PWD='.$db_password);\n\n break;\n case 'pgsql':\n if (is_numeric($portnum)) $port = ';port='.intval($portnum);\n else $port = '';\n $DBH = new PDO($DB_DRIVER_NAME.':host='.$host.$port.';dbname='.$db_name, $db_user, $db_password);\n break;\n case 'sqlite':\n ini_set('default_charset', \"UTF-8\");\n if (is_numeric($portnum)) $port = ':'.intval($portnum);\n else $port = '';\n $DBH = new PDO($DB_DRIVER_NAME.':'.$db_name, $db_user, $db_password);\n if ($DBH)\n {\n // standard: SUBSTR , non-standard: SUBSTRING\n // SQLite has no SUBSTRING. but has SUBSTR.\n // SUBSTRING , start index 1 or -1 , param 2 or 3\n $DBH->sqliteCreateFunction('SUBSTRING', create_function('', ' $st = intval(func_get_arg(1)); if ($st>0) $st--; return substr(func_get_arg(0) , $st , func_get_arg(2)); ') , 3);\n $DBH->sqliteCreateFunction('UNIX_TIMESTAMP', 'strtotime', 1);\n $DBH->sqliteCreateFunction('NOW', create_function('', 'return date(\"Y-m-d H:i:s\", time());'), 0); // local time\n // SQL non-standard : REGEXP (mysql , sqlite) , src_exp ~ pattern_text (postgreSQL)\n // --- src_exp like pattern_text , % _\n // src_exp REGEXP pattern_text\n // 'P1' REGEXP 'P2' = P2 P1 ( return func_get_arg(0).' '.func_get_arg(1); )\n $DBH->sqliteCreateFunction('REGEXP', create_function('$pattern , $Text', 'return preg_match(\"/(\".str_replace(\"/\",\"\\\\/\",(string) $pattern).\")/im\", (string) $Text)? 1:0;'), 2);\n $DBH->sqliteCreateFunction('CONCAT', create_function('', 'return implode (\"\",func_get_args() );'), -1);\n $DBH->sqliteCreateFunction('FIND_IN_SET', create_function('$k,$v', 'return in_array($k, explode($v)) ? 1:0;'), 2);\n $DBH->sqliteCreateFunction('md5', 'md5', 1);\n// $DBH->beginTransaction();\n }\n break;\n case 'sqlite2': // PDO::sqliteCreateFunction does not support SQLite2\n// trigger_error(\"Critical Error : sqlite2 driver is not suported. \", E_USER_ERROR);\n $msg = '<p>a1 Error!: sqlite2 driver is not supportted.</p>';\n startUpError($msg , 'Connect Error');\n break;\n default:\n //mysql\n $DBH = new PDO($DB_DRIVER_NAME.':host='.$host.$port.';dbname='.$db_name, $db_user, $db_password);\n break;\n }\n\n// <add for garble measure>\n // for mysql\n if ( $DBH && (stripos($DB_DRIVER_NAME, 'mysql') === 0) )\n {\n if ($DBH && version_compare( '5.2.0', PHP_VERSION, '>' ))\n {\n // HY000-2014 Cannot execute queries while other unbuffered queries are active.\n $DBH->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);\n }\n if (defined('_CHARSET'))\n {\n $charset = get_mysql_charset_from_php_charset(_CHARSET);\n }\n else\n {\n $query = sprintf(\"SELECT * FROM %s WHERE name='Language'\", sql_table('config'));\n $res = sql_query($query, $DBH);\n if(!$res) exit('Language name fetch error');\n $obj = sql_fetch_object($res);\n $Language = $obj->value;\n $charset = get_charname_from_langname($Language);\n $charsetOfDB = getCharSetFromDB(sql_table('config'),'name', $DBH);\n if ((stripos($charset, 'utf')!==FALSE) && (stripos($charsetOfDB, 'utf8')!==FALSE))\n $charset = $charsetOfDB; // work around for utf8mb4_general_ci\n }\n sql_set_charset($charset , $DBH);\n }\n// </add for garble measure>*/\n\n } catch (PDOException $e) {\n $DBH =NULL;\n if ($CONF['debug'])\n $msg = '<p>a1 Error!: ' . $e->getMessage() . '</p>';\n else\n {\n $msg = '<p>a1 Error!: ';\n $pattern = '/(Access denied for user|Unknown database)/i';\n if (preg_match($pattern, $e->getMessage(), $m))\n $msg .= $m[1];\n $msg .= '</p>';\n }\n startUpError($msg , 'Connect Error');\n }\n//echo '<hr />DBH: '.print_r($DBH,true).'<hr />'; \n return $DBH;\n }",
"function __construct($dbhost=null, $dbuser=null, $dbpass=null, $dbname='', $dbport='', $dbdsn=''){\n\t\t$this->connect($dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbdsn);\n\t}",
"function connect_to_db(){\n\t\t//Fun Fact: @ suppresses errors of the expression it prepends\n\t\t\n\t\t//Connect to the database and select the database\t\t\t\n\t\ttry{\n\t\t\t$this->connection = new PDO(\"mysql:host=$DATABASE_HOST;dbname=DATABASE_NAME\", DATABASE_USER, DATABASE_PASS);\n\t\t\t$this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t}catch(PDOException $err){\n\t\t\tdie('Could not connect to database' . $err->getMessage());\n\t\t}\t\t\n\t}",
"function connect()\n {\n\trequire_once dirname(__FILE__) . '/db_config.php';\n\t$connstring = \"host={$DB_SERVER} port={$DB_PORT} dbname={$DB_DATABASE} \".\n\t\t \"user={$DB_USER} password={$DB_PASSWORD}\";\n\t$db = pg_connect($connstring);\n\n\treturn $db;\n }",
"function dbConnect($filename = ROOT_DIR . DEFAULT_SQ3_DBNAME) {\n $params = array(\"filename\" => $filename);\n return new DB3($params);\n }",
"public function openConnection() {\n if($this->database != null) return;\n\n $config = $this->getDatabaseConfig();\n\n try {\n $this->database = new \\PDO(\n 'mysql:dbname=' . $config['database'] . ';host=' . $config['host'] . ':' . $config['port'],\n $config['username'],\n $config['password'],\n [\n \\PDO::ATTR_ERRMODE => \\PDO::ERRMODE_EXCEPTION,\n \\PDO::ATTR_DEFAULT_FETCH_MODE => \\PDO::FETCH_ASSOC\n ]\n );\n } catch(\\PDOException $exception) {\n die('Connection to mysql-server failed: ' . $exception->getMessage());\n }\n }",
"function dbconnect($hostName=\"\", $dbUser=\"\", $dbPwd=\"\",$dbName=\"\", $port=\"\"){\n\t\tglobal $GonxAdmin;\n\t\tif ($hostName!=\"\") {\n\t\t $this->hostName = $hostName;\n\t\t}\n\t\tif ($dbUser!=\"\") {\n\t\t $this->dbUser = $dbUser;\n\t\t}\n\t\tif ($dbPwd!=\"\") {\n\t\t $this->dbPwd = $dbPwd;\n\t\t}\n\t\tif ($dbName!=\"\") {\n\t\t $this->dbName = $dbName;\n\t\t}\n\t\tif ($port!=\"\") {\n\t\t $this->hostport = $port;\n\t\t}\n\t\t\n\t\tswitch($GonxAdmin[\"dbtype\"]){\n\t\t\tcase \"mysql\": \n\t\t\t\t$this->Link_ID = @mysql_connect($this->hostName, $this->dbUser, $this->dbPwd) or die (_CONNECTION_ERROR_);\n\t\t\t\t@mysql_select_db($this->dbName) or die (_CONNECTION_ERROR_.$this->error().\"<br><br>\");\n\t\t\tbreak;\n\t\t\t\n\t\t case \"postgresql\": \n\t\t\t\t$this->Link_ID = @pg_connect(\"host=\".$this->hostName.\" dbname=\".$this->dbName.\" port=\".$this->db_port.\" user=\".$this->dbUser.\" password=\".$this->dbPwd);\n\t\t\tbreak;\n\t\t\n\t\t\tcase \"oracle\":\n\t\t\t\t$this->Link_ID = @OCILogon($this->dbUser, $this->dbPwd, $this->dbName); \n\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"sqlite\":\n\t\t\tbreak;\n\t\t\t\n\t\t\tcase \"mssql\":\n\t\t\t\t$this->Link_ID = @mssql_connect($this->hostName, $this->dbUser, $this->dbPwd) or die (_CONNECTION_ERROR_);\n\t\t\t\t@mssql_select_db($this->dbName) or die (_CONNECTION_ERROR_.$this->error().\"<br><br>\");\n\t\t\tbreak;\n\t\t} // switch\n\t\treturn $this->Link_ID;\n\t}",
"abstract protected function make_connection($host, $uid, $pwd);",
"public function __construct($dbname, $user = null, $host = null, $port = null, $password = null, $searchPath = null) {\n $this->dbname = $dbname;\n $this->host = $host;\n $this->port = (int) $port;\n $this->user = $user;\n $this->password = $password;\n $this->searchPath = $searchPath;\n $this->connect();\n }",
"function OpenCon() {\n $dbhost = \"\";\n $dbuser = \"\";\n $dbpass = \"\";\n if($_SERVER['SERVER_NAME'] == \"localhost\"){\n $dbhost = \"localhost\";\n $dbuser = \"root\";\n $dbpass = \"root\";\n }\n else{\n $dbhost = \"db.cs.dal.ca\";\n $dbuser = \"aio\";\n $dbpass = \"ge7ochooCae7\";\n }\n $db = \"aio\";\n $conn = new mysqli($dbhost, $dbuser, $dbpass, $db) or die(\"Connect failed: %s\\n\". $conn -> error);\n return $conn;\n }",
"function dbConnect()\n{\n global $debug, $dbServer, $dbUsername, $dbPassword, $dbDatabase;\n // connect to the server\n $dbConn = new mysqli($dbServer, $dbUsername, $dbPassword, $dbDatabase);\n // check is connection was successful\n if ($dbConn->connect_errno) {\n echo \"Failed to connect to MySQL: \" . $dbConn->connect_error;\n exit();\n }\n \n // return the connection object\n return $dbConn;\n}",
"public function connectToDatabase(){\n\t\t$dbinfo=$this->getDBinfo();\n\n\t\t$host=$dbinfo[\"host\"];\n\t\t$dbname=$dbinfo[\"dbname\"];\n\t\t$user=$dbinfo[\"user\"];\n\t\t\n $pass=$this->getPassword();//don't share!!\n\n try{\n $DBH = new PDO(\"mysql:host=$host;dbname=$dbname\", $user, $pass);\n $DBH->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\n }catch(PDOException $e){\n $this->processException($e);\n }\n \n $this->setDBH($DBH);\n }",
"protected function dbConnect() {\n\t\trequire 'dblog.php';\n\t\t$db = new PDO($connect, $user, $pwd);\n\t\t$db->exec('SET NAMES UTF8');\n\t\treturn $db;\n\t}",
"public static function createConnection()\n {\n $variablesIsSet =\n isset($_ENV['DB_HOST']) &&\n isset($_ENV['DB_NAME']) &&\n isset($_ENV['DB_USER']) &&\n isset($_ENV['DB_PASSWORD']);\n\n if ($variablesIsSet) {\n return new PDO(\n \"mysql:dbname={$_ENV['DB_NAME']};host={$_ENV['DB_HOST']}\",\n $_ENV['DB_USER'],\n $_ENV['DB_PASSWORD'],\n [\n PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,\n PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,\n ]\n );\n }\n }",
"protected function getConnection()\n {\n $pdo = new PDO($GLOBALS['DB_DSN'],\n $GLOBALS['DB_USER'],\n $GLOBALS['DB_PASSWORD']);\n return $this->createDefaultDBConnection($pdo, $GLOBALS['DB_NAME']);\n }",
"public function connectDB() {}",
"public function __construct($dbhost=null, $dbuser=null, $dbpass=null, $dbname='', $dbport='', $dbdsn=''){\n\t\t$this->connect($dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbdsn);\n\t}",
"public function connect()\n\t{\n\t\t//$conn = new \\Mongo(HOST, array(\"username\" => USERNAME, \"password\" => PASSWORD, \"db\" => DATABASE));\n\t\t$conn = new \\Mongo(HOST);\n\t\treturn $conn;\n\t}",
"function connectToDb($pass,$database)\n{\n return mysqli_connect('localhost','root', $pass , $database);\n}",
"public function connect(string $server, string $username, string $password, string $database = null): Database\n {\n return new Database($server, $username, $password, $database);\n }",
"public function createConnection($db)\n {\n $this->adodb = $db;\n }",
"public function connect() {\n\n\t\t$db_info_string = $this->_db_info[0]. ':host=' . $this->_db_info[1] . ';';\n\t\t$db_info_string .= 'dbname='. $this->_db_info[4]; \n\n\t\ttry {\n\t\t\t$this->_db = new pdo($db_info_string, $this->_db_info[2], $this->_db_info[3] );\n\n\t\t//set Error mode to send out exceptions\n\t\t$this->_db->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); \n\n\t\t} catch (PDOException $e) {\n\t\t\t//TODO Custom error reporting\n\t\t\techo $e->getMessage();\n\t\t}\n\n\t\t//TODO ATTEMPT TO CONNECT, IF PDO OBJECT CANNOT BE CREATED, return \n\t\t//false and use custome error reporting\n\t\t//TRY, CATCH that jazz tooo\n\t\t\n\t\t//Returns the object so that it can be chained\n\t\treturn $this;\n }",
"public static function connect( $params = array() ) {\n\t\treturn new PDO( 'mysql:host=' . $params[ 'host' ] . ';dbname=' . $params[ 'database' ] . ';port=' . $params[ 'port' ], $params[ 'username' ], $params[ 'password' ] );\n }",
"function connexionDb()\n{\n $confDb = getConfigFile()['DATABASE'];\n\n\n $type = $confDb['type'];\n $host = $confDb['host'];\n $servername = \"$type:host=$host\";\n $username = $confDb['username'];\n $password = $confDb['password'];\n $dbname = $confDb['dbname'];\n\n $db = new PDO(\"$servername;dbname=$dbname\", $username, $password);\n return $db;\n}",
"function dbConn() { // Returns database link\n\treturn mysqli_connect(DBHOST,DBUSER,DBPASS,DBNAME);\n}",
"public static function connect() {\n\t\tif(!self::$conn) {\n\t\t\tnew Database();\n\t\t}\n\t\treturn self::$conn;\n\t}",
"private function connect() {\n $host = $this->dbConfig[$this->selected]['host'];\n $login = $this->dbConfig[$this->selected]['login'];\n $password = $this->dbConfig[$this->selected]['password'];\n $database = $this->dbConfig[$this->selected]['database'];\n try {\n $this->db = new PDO('mysql:host=' . $host . ';dbname=' . $database . ';charset=utf8', $login, $password);\n $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n//\t\t\t$this->db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n } catch (PDOException $e) {\n die('Could not connect to DB:' . $e);\n }\n }",
"public function connect($servername, $username, $password, $db) {\n\n\t\t$this->dbName = $db;\n\t\t// Create connection\n\t\t$this->db = new mysqli($servername, $username, $password, $db);\n\n\t\t// Check connection\n\t\tif ($this->db->connect_error) {\n\t\t die(\"Connection failed: \" . $this->db->connect_error);\n\t\t}\n\t}",
"function connectDatabase($db)\n {\n $dbhost = $db[\"host\"];\n $dbuser = $db[\"username\"];\n $dbpass = $db[\"password\"];\n $dbname = $db[\"dbname\"];\n $port = $db[\"port\"];\n\n // Create connection\n $conn = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname, $port);\n\n // Check connection\n if (mysqli_connect_errno()) \n {\n die(\"Failed to connect to MySQL: \" . mysqli_connect_error());\n }\n \n return $conn;\n }",
"protected function getConnection()\n\t{\n\t\treturn $this->createDefaultDBConnection(TEST_DB_PDO(), TEST_GET_DB_INFO()->ldb_name);\n\t}",
"public function dbConnection()\n {\n $this->conn = null;\n $config = new Config();\n try\n {\n $this->conn = new PDO(\"mysql:host=\" .$config->getHost() . \";dbname=\" . $config->getDBName(), $config->getDBUsername(), $config->getDBPassword());\n $this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n }\n catch(PDOException $exception)\n {\n echo \"Connection error: \" . $exception->getMessage();\n }\n return $this->conn;\n }",
"public function connect() {\n if ($this->db === null) {\n $this->db = new PDO($this->db_dsn, $this->db_user, $this->db_pass);\n $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n }\n\n if ($this->db_schema !== null && $this->db_schema !== '') {\n $this->db->exec('SET search_path = ' . $this->db_schema . ', public');\n }\n\n return $this->db;\n }",
"function db_pgsql($db_name, $db_user, $db_pass, $db_host, $db_port = 5432, $db_socket = '')\n\t{\n\t\tparent::database($db_name, $db_user, $db_pass, $db_host, $db_port, $db_socket);\n\t\t$pg_connstr = \"host=$db_host port=$db_port dbname=$db_name user=$db_user password=$db_pass\";\n\n\t\t$this->connection = @pg_connect($pg_connstr);\n\t}",
"public static function connectDB() {\n try {\n $conn = new PDO(self::$host, self::$user, self::$pass);\n $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n } catch (PDOException $e) {\n return $e->getMessage();\n }\n return $conn;\n }",
"abstract public function connect($parameters, $selectDB = false);",
"function getConnection(){\n\t\tglobal $hostname,$database,$port,$dbuser,$dbuserpass;\n\t\ttry{\n\t\t\t$db = new PDO(\"mysql:host=$hostname;port=$port;dbname=$database\",\n\t\t\t \t$dbuser, $dbuserpass,\n\t\t\t \tarray(PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION,PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES 'utf8'\"));\n\t\t}\n\t\tcatch(PDOException $e){\n\t\t echo $e->getMessage();\n\t }\n\t return $db;\n\t}",
"protected function getConnection()\n {\n $host = DB_HOST;\n $dbName = DB_NAME;\n $dbUser = DB_USER;\n $dbPass = DB_PASS;\n // mysql\n $dsn = 'mysql:host=' . $host . ';dbName=' . $dbName;\n $db = new \\PDO($dsn, $dbUser, $dbPass);\n $connection = $this->createDefaultDBConnection($db, $dbName);\n return $connection;\n }",
"function newDbConnection()\n{\n extract($GLOBALS);\n $conn = new mysqli($host, $username, $password, $database, $port);\n if ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n }\n return $conn;\n}",
"public static function connect($dsn, $username = null, $password = '', $options = array())\n {\n\n // parse dsn if necessary\n if (is_array($dsn)) {\n $username = $dsn['user'];\n $password = @$dsn['pass'];\n $dsn = sprintf(\"%s:dbname=%s;host=%s;charset=utf8\",\n $dsn['scheme'],\n isset($dsn['dbname']) ? $dsn['dbname'] : substr($dsn['path'], 1),\n $dsn['host']);\n }\n\n $prefix = @$options['prefix'];\n unset($options['prefix']);\n\n return new DB(new PDO($dsn, $username, $password, $options), $prefix);\n\n }",
"function connect($dbpath='', $dbname='')\n\t\t{\n\t\t\tglobal $ezsql_sqlite3_str; \n $return_val = false;\n $this->_connected = false;\n\t\t\t\n\t\t\t// Must have a user and a password\n\t\t\tif ( ! $dbpath || ! $dbname )\n\t\t\t{\n\t\t\t\t$this->register_error($ezsql_sqlite3_str[1].' in '.__FILE__.' on line '.__LINE__);\n\t\t\t\t$this->show_errors ? trigger_error($ezsql_sqlite3_str[1],E_USER_WARNING) : null;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// Try to establish the server database handle\n\t\t\telse if ( ! $this->dbh = @new SQLite3($dbpath.$dbname) )\n\t\t\t{\n\t\t\t\t$this->register_error($php_errormsg);\n\t\t\t\t$this->show_errors ? trigger_error($php_errormsg,E_USER_WARNING) : null;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$return_val = true;\n\t\t\t\t$this->conn_queries = 0;\n $this->_connected = true;\n\t\t\t}\n\n\t\t\treturn $return_val;\t\t\t\n\t\t}",
"protected function openConn() {\n $database = new Database();\n $this->conn = $database->getConnection();\n }",
"public function conn(): DB\n {\n return new DB();\n }",
"private function __construct() {\r\n $this->dbName = self::$_dbname;\r\n $this->username = self::$_username;\r\n $this->password = self::$_password;\r\n $this->hostname = self::$_hostname; \r\n\t return $this->connect();\r\n }",
"function connect($Database = \"\", $Host = \"\", $User = \"\", $Password = \"\") {\t\t\r\n\t\treturn $this->dbh->connect() ;\t\t\r\n\t}",
"function db_connect()\n{\n return pg_connect(\"host=\" . DB_HOST . \" port=\" . DB_PORT . \" dbname=\" . DATABASE . \" user=\" . DB_ADMIN . \" password=\" . DB_PASSWORD);\n}",
"function dbConnect(){\r\n\t$host = \"localhost\"; // this is typically just \"localhost\"\r\n\t$user = \"id1360972_elliott\"; // user name\r\n\t$pwd = \"170592\"; // database password\r\n\t$database = \"id1360972_mysqldemo\"; // database name\r\n\r\n\t// initiate a new mysqli object to connect to the Database. Store the mysqli object in a variable $conn.\r\n\t$conn = new mysqli($host, $user, $pwd, $database) or die(\"could not connect to server\");\r\n\r\n\t// return $conn to the fucntion call\r\n\treturn $conn;}",
"function openDatabaseConnection($db_host, $db_username, $db_password, $db_name)\r\n\t{\r\n\t\t// Connect to the database host\r\n\t\t$db_connection = mysql_connect($db_host, $db_username, $db_password) or die(\"Could not connect to database \".$db_name.\" on host \".$db_host. \".\");\r\n\r\n\t\t// Set the database to use\r\n\t\tmysql_select_db($db_name, $db_connection);\r\n\r\n\t\treturn $db_connection;\r\n\t}",
"function pdo_connect_pgsql($host, $dbname, $username = null, $password = null, array $driver_options = array())\n {\n return pdo_connect(\"pgsql:host={$host};dbname={$dbname};user={$username};password={$password}\", $driver_options);\n }",
"public static function getConnection() {\n if (!self::$db) {\n //new connection object\n new dbConn();\n }\n //return connection\n return self::$db;\n }",
"protected static function createDbConnection() {\n if(isset(self::$_config['db']) &&\n isset(self::$_config['db']['host']) &&\n isset(self::$_config['db']['user']) &&\n isset(self::$_config['db']['password']) &&\n isset(self::$_config['db']['database'])) {\n $db = mysqli_connect(\n self::$_config['db']['host'],\n self::$_config['db']['user'],\n self::$_config['db']['password'],\n self::$_config['db']['database']\n );\n\n if(mysqli_connect_errno()) {\n static::error500('DB error.', 'DB error: ' . mysqli_connect_errno());\n }\n\n if(!mysqli_set_charset($db, 'utf8')) {\n static::error500('DB error.', 'DB error: ' . mysqli_error($db));\n }\n\n Model::setConnection($db);\n } else {\n static::error500('Database settings are missing from config.');\n }\n }",
"public function createConnection()\n {\n $client = DatabaseDriver::create($this->getConfig());\n\n return $client;\n }",
"function db_connect()\n{\n\t// do\n\t$dbc = new PDO(\t'mysql:host=dbs.eecs.utk.edu;dbname=sbradfo5', \n\t\t\t\t\t'sbradfo5', \n\t\t\t\t\t'youCantHaveMyRealPass' );\n\n\tif ($dbc) {\n\t\treturn $dbc;\n\t}\n\telse {\n\t\treturn false;\n\t}\n}",
"public function connectDB($config)\n {\n if (!is_array($config)) {\n throw new \\Exception('Config array must be passed!');\n }\n if (!isset($config['dsn'])) {\n throw new \\Exception('Config dsn must be passed');\n }\n if (!isset($config['username'])) {\n throw new \\Exception('Config username must be passed');\n }\n if (!isset($config['password'])) {\n throw new \\Exception('Config password must be passed');\n }\n\n try {\n $conn = new \\PDO($config['dsn'], $config['username'], $config['password']);\n // set the PDO error mode to exception\n $conn->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n //echo \"Connected successfully\";\n } catch (\\PDOException $e) {\n echo \"Connection failed: \" . $e->getMessage();\n }\n\n $this->conn = $conn;\n\n return;\n }",
"protected function connect()\n\t{\n\t\t$strDSN = 'mysql:';\n\t\t$strDSN .= 'dbname=' . $GLOBALS['TL_CONFIG']['dbDatabase'] . ';';\n\t\t$strDSN .= 'host=' . $GLOBALS['TL_CONFIG']['dbHost'] . ';';\n\t\t$strDSN .= 'port=' . $GLOBALS['TL_CONFIG']['dbPort'] . ';';\n\t\t$strDSN .= 'charset=' . $GLOBALS['TL_CONFIG']['dbCharset'] . ';'; // supported only in PHP 5.3.6+\n\n\t\t$arrOptions = array(\n\t\t\tPDO::ATTR_PERSISTENT => $GLOBALS['TL_CONFIG']['dbPconnect'],\n\t\t\tPDO::MYSQL_ATTR_INIT_COMMAND => 'SET sql_mode=\\'\\'; SET NAMES ' . $GLOBALS['TL_CONFIG']['dbCharset'],\n\t\t\tPDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION\n\t\t);\n\n\t\t$this->resConnection = new PDO($strDSN, $GLOBALS['TL_CONFIG']['dbUser'], $GLOBALS['TL_CONFIG']['dbPass'], $arrOptions);\n\t}",
"function openCon()\r\n {\r\n //Credentials\r\n $servername = \"ls-1f9fbdc4cb3ac2e7c45e19fad57c73926ef8a497.cyneooocbzlz.eu-west-2.rds.amazonaws.com:3306\";\r\n $username = \"dbmasteruser\";\r\n $password = \"mAgHsPDX3Z+DBtMaGs}Lo,wGpXV`%zwz\";\r\n $database = \"dbmaster\";\r\n //Create connection\r\n $conn = new mysqli($servername, $username, $password, $database);\r\n //Check connection\r\n if ($conn->connect_error) {\r\n echo \"FAIL\";\r\n die(\"Connection failed: \" . $conn->connect_error);\r\n }\r\n\r\n return $conn;\r\n }",
"public static function connect(ConnectionParameters $config){\n\n\t\t//Not static\n\t\t$con = new self();\n\t\t\n\t\tswitch(\\strtolower(\\trim($config->getDriver()))){\n\t\t\t\n\t\t\tcase 'sqlite':\n\t\t\t\t$con->Connection = new \\PDO(\n\t\t\t\t\t\t\\sprintf('sqlite:%s', $config->getHost()),\n\t\t\t\t\t\t$config->getUsername(),\n\t\t\t\t\t\t$config->getPassword(),\n\t\t\t\t\t\t$config->getOptions());\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\t$con->Connection = new \\PDO(\\sprintf(\n\t\t\t\t\t\t'%s:host=%s;charset=%s;dbname=%s',\n\t\t\t\t\t\t$config->getDriver() ? $config->getDriver() : '',\n\t\t\t\t\t\t$config->getHost() ? $config->getHost() : '',\n\t\t\t\t\t\t$config->getCharset() ? $config->getCharset() : '',\n\t\t\t\t\t\t$config->getDatabaseName() ? $config->getDatabaseName() : ''\n\t\t\t\t\t),\n\t\t\t\t\t$config->getUsername(),\n\t\t\t\t\t$config->getPassword(),\n\t\t\t\t\t$config->getOptions());\n\t\t\t\tbreak;\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $con;\n\n\t}",
"public function connect($db = DB_DATABASE) {\n\t\t$host = DB_HOST;\n\t\t$db = DB_DATABASE;\n\t\ttry {\n\t\t\t$this->db_handle = new PDO(\"mysql:host=$host;dbname=$db\", DB_USER, DB_PASS);\n\t\t\t$this->db_handle->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ); \n\t\t\t$this->db_handle->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t} catch(PDOException $e) {\n\t\t echo 'ERROR: ' . $e->getMessage();\n\t\t}\n\t}",
"protected function dbConnect(){\n $db_host = $_ENV['DB_HOST'];\n $db_name = $_ENV['DB_NAME'];\n $db_user = $_ENV['DB_USER'];\n $db_pass = $_ENV['DB_PASS'];\n\n try{\n $database = new \\PDO(\"mysql:host=$db_host;dbname=$db_name;charset=utf8\", $db_user, $db_pass);\n return $database;\n } \n catch(Exception $e){\n die('Error Database: ' . $e->getMessage());\n }\n\n }",
"protected function openConn()\n {\n $database = new Database();\n $this->conn = $database->getConnection();\n }",
"private function connect($engine, $host, $database, $user, $password, $port = \"\") {\n try {\n if ($port) {\n $pdoUrl = $engine.\":host=\".$host.\";port=\".$port.\";dbname=\".$database;\n } else {\n $pdoUrl = $engine.\":host=\".$host.\";dbname=\".$database;\n }\n\n if ($user && $password) {\n $conn = new PDO($pdoUrl, $user, $password);\n } else if ($user && !$password) {\n $conn = new PDO($pdoUrl, $user);\n } else {\n $conn = new PDO($pdoUrl);\n }\n \n Logger::logInfo(\"Conexão estabelecida.\");\n } catch (PDOException $e) {\n Logger::logError(\"Não conseguiu criar conexão PDO: \" . $e->getMessage());\n die();\n }\n\n return $conn;\n }",
"private function dbConnect(){\n $database=new \\Database();\n return $database->getConnection();\n }",
"private function _connect()\n {\n Horde::assertDriverConfig($this->_params, 'storage',\n array('phptype', 'charset'));\n\n if (!isset($this->_params['database'])) {\n $this->_params['database'] = '';\n }\n if (!isset($this->_params['username'])) {\n $this->_params['username'] = '';\n }\n if (!isset($this->_params['hostspec'])) {\n $this->_params['hostspec'] = '';\n }\n if (isset($this->_params['prefix'])) {\n $this->prefix = $this->_params['prefix'];\n }\n\n /* Connect to the SQL server using the supplied parameters. */\n require_once 'DB.php';\n $this->write_db = &DB::connect($this->_params,\n array('persistent' => !empty($this->_params['persistent'])));\n if ($this->write_db instanceof PEAR_Error) {\n throw new Horde_Exception($this->write_db);\n }\n\n // Set DB portability options.\n switch ($this->write_db->phptype) {\n case 'mssql':\n $this->write_db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS | DB_PORTABILITY_RTRIM);\n break;\n default:\n $this->write_db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS);\n }\n\n /* Check if we need to set up the read DB connection seperately. */\n if (!empty($this->_params['splitread'])) {\n $params = array_merge($this->_params, $this->_params['read']);\n $this->db = &DB::connect($params,\n array('persistent' => !empty($params['persistent'])));\n if ($this->db instanceof PEAR_Error) {\n throw new Horde_Exception($this->db);\n }\n\n // Set DB portability options.\n switch ($this->db->phptype) {\n case 'mssql':\n $this->db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS | DB_PORTABILITY_RTRIM);\n break;\n default:\n $this->db->setOption('portability', DB_PORTABILITY_LOWERCASE | DB_PORTABILITY_ERRORS);\n }\n\n } else {\n /* Default to the same DB handle for the writer too. */\n $this->db =& $this->write_db;\n }\n\n return true;\n }",
"function connect_to_database($create_db = false)\r\n{\r\n\t// establish connection with database server\r\n\tif (!($link = mysql_connect(DB_HOST_NAME .\":\". DB_PORT, DB_USERNAME, DB_PASSWORD)))\r\n\t{\r\n\t\tmessage_die(\"Could not connect to the database\\n\");\r\n\t}\r\n\r\n\t// create database if requested\r\n\tif ($create_db)\r\n\t{\r\n\t\t$sql = \"CREATE DATABASE \". DB_DATABASE;\r\n\t\tif (!mysql_query($sql)) message_die(mysql_error($db) .\"\\n\");\r\n\t}\r\n\t\r\n\t// select database\r\n\tif (!mysql_select_db(DB_DATABASE, $link))\r\n\t{\r\n\t\tmessage_die(\"Database does not exist\\n\");\r\n\t}\r\n\t\r\n\treturn $link;\r\n}",
"public static function connect(String $host = PGHostName,\r\n String $port = PGPort,\r\n String $dbname = PGDBName,\r\n String $user = PGUserName,\r\n String $password = PGDBPass)\r\n {\r\n //TODO add autoconect parameter, init method and autoconnect\r\n //@self::$pgConn=pg_pconnect('host='.PGHostName.\r\n @self::$pgConnection = pg_connect('host=' . $host .\r\n ' port=' . $port .\r\n ' dbname=' . $dbname .\r\n ' user=' . $user .\r\n ' password=' . $password);\r\n $stat = pg_connection_status(self::$pgConnection);\r\n if ($stat === PGSQL_CONNECTION_OK)\r\n {\r\n self::getPreparedQueriesList();\r\n return true;\r\n }\r\n else\r\n {\r\n return false;\r\n }\r\n }",
"public function connect($dbhost='', $dbuser='', $dbpass='', $dbname='', $dbport='', $dbdsn=''){\n\n\t\tif(!extension_loaded('interbase')){\n\t\t\tthrow new DbException('Debe cargar la extensión de PHP llamada php_interbase');\n\t\t\treturn false;\n\t\t}\n\n\t\tif(!$dbhost) {\n\t\t\t$dbhost = $this->db_host;\n\t\t} else {\n\t\t\t$this->db_host = $dbhost;\n\t\t}\n\t\tif(!$dbuser) {\n\t\t\t$dbuser = $this->db_user;\n\t\t} else {\n\t\t\t$this->db_user = $dbuser;\n\t\t}\n\t\tif(!$dbpass) {\n\t\t\t$dbpass = $this->db_pass;\n\t\t} else {\n\t\t\t$this->db_pass = $dbpass;\n\t\t}\n\t\tif(!$dbname) {\n\t\t\t$dbname = $this->db_name;\n\t\t} else {\n\t\t\t$this->db_name = $dbname;\n\t\t}\n\t\tif(!$dbport) {\n\t\t\t$dbport = $this->db_port;\n\t\t} else {\n\t\t\t$this->db_port = $dbport;\n\t\t}\n\t\tif(!$dbdsn) {\n\t\t\t$dbdsn = $this->db_dsn;\n\t\t} else {\n\t\t\t$this->db_dsn = $dbdsn;\n\t\t}\n\n\t\tif($this->db_host){\n\t\t\t$id_con = @ibase_connect(\"{$this->db_host}:{$this->db_name}\", $this->db_user, $this->db_pass);\n\t\t} else {\n\t\t\t$id_con = @ibase_connect($this->db_name, $this->db_user, $this->db_pass);\n\t\t}\n\n\t\tif($this->id_connection = $id_con){\n\t\t\treturn true;\n\t\t} else {\n\t\t\tthrow new DbException($this->error(), $this->no_error(), false);\n\t\t\treturn false;\n\t\t}\n\n\t}",
"function connectDB();",
"private function getConnection () {\n $host = getenv('DB_HOST');\n $name = getenv('DB_NAME');\n $username = getenv('DB_USERNAME');\n $password = getenv('DB_PASSWORD');\n $conn = new PDO(\"mysql:host={$host};dbname={$name}\", $username, $password);\n $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n return $conn;\n }",
"public function connect($user, $pass, $dbname){\n\t\t/*if ($flag == true){\n\t\t\t$error = error();\n\t\t}\n\t\telse{\n\t\t\t$error = 'an error occured';\n\t\t}*/\n\t\t$this->con = new mysqli(\"localhost\", $user, $pass, $dbname) or die(\"failed to connect to db\" .$error);\n\t\treturn $this->con;\n\t\t\n\t}",
"function connectDB() {\n $dbh = mysqli_connect(\"127.0.0.1:3306\", \"admin\", \"P@ssw0rd\", \"travelexperts\");\n return $dbh;\n }",
"protected function connect()\n\t\t{\n\t\t\t$conn = new PDO(\"mysql:dbname=$this->m_db;host=$this->m_host\", $this->m_username, $this->m_password); /* Create a new connection */\n\n\t\t\tif (DEBUG) /* If the global variable DEBUG is true */\n\t\t\t\techo 'Connecting to database.<br>'; /* Display debug messages */\n\t\t\t\n\t\t\treturn $conn; /* Return the database connection */\n\t\t}",
"private function connect()\n {\n if (! is_null(self::$db)) {\n return;\n }\n\n // $this->host \t= $Database->host;\n // $this->user \t= $Database->user;\n // $this->pass \t= $Database->pass;\n // $this->database\t= $Database->database;\n\n $conn = 'mysql:dbname=' . $this->dbInfo->database . ';host=' . $this->dbInfo->host.';charset=utf8';\n try {\n self::$db = new PDO($conn, $this->dbInfo->user, $this->dbInfo->pass);\n } catch (PDOException $e) {\n die('Could not connect to database (' . $conn . ')');\n }\n }"
] | [
"0.7171739",
"0.65743583",
"0.6424827",
"0.6397188",
"0.63740414",
"0.63604504",
"0.6351201",
"0.6265176",
"0.6235581",
"0.6185248",
"0.6179922",
"0.61667746",
"0.61661565",
"0.61657476",
"0.6161544",
"0.61415195",
"0.61392546",
"0.6134181",
"0.6130765",
"0.6128273",
"0.61222243",
"0.6104501",
"0.60806036",
"0.606051",
"0.6059938",
"0.60496616",
"0.60301864",
"0.6009907",
"0.5998531",
"0.59949714",
"0.59756744",
"0.59713715",
"0.59576446",
"0.59330547",
"0.5931161",
"0.59262323",
"0.59251595",
"0.5924451",
"0.5922186",
"0.5919981",
"0.5903796",
"0.5903761",
"0.58949685",
"0.58860976",
"0.5885228",
"0.58810174",
"0.5876275",
"0.58752877",
"0.5872091",
"0.58700055",
"0.5867538",
"0.58649033",
"0.5852634",
"0.5848323",
"0.58469003",
"0.5842826",
"0.58406854",
"0.58396703",
"0.58382857",
"0.58377177",
"0.5832833",
"0.58307815",
"0.5828784",
"0.5819338",
"0.5814077",
"0.58115214",
"0.5808316",
"0.57978946",
"0.5791752",
"0.57821006",
"0.5778801",
"0.57631344",
"0.57612073",
"0.5758247",
"0.5755064",
"0.57542235",
"0.57453465",
"0.5741514",
"0.57288283",
"0.5728214",
"0.5723162",
"0.57205963",
"0.57185453",
"0.57184947",
"0.5716419",
"0.57129335",
"0.5712639",
"0.57121795",
"0.5705339",
"0.5700891",
"0.5696997",
"0.56956655",
"0.5695198",
"0.56951666",
"0.5693509",
"0.5691946",
"0.5691387",
"0.5689923",
"0.5689276",
"0.5688667",
"0.5684552"
] | 0.0 | -1 |
Makes html id for section | static function html_id($name)
{
global $smcFunc;
$name = str_replace(array('%3A', '+', '%'), array(':', '_', '.'), urlencode(un_htmlspecialchars($name)));
while($name[0] == '.')
$name = substr($name, 1);
return $name;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fn_makeid($editableareaname) {\r\r\n\tglobal $sectionid, $pageid;\r\r\n\t$idstring = $pageid . '_' . $editableareaname;\r\r\n\tif ($sectionid != '')\r\r\n\t\t$idstring = $sectionid . $idstring;\r\r\n\treturn $idstring;\t\r\r\n}",
"function rordb_section_header_callback($args){\n\techo \"<p id=\\\"\".esc_attr($args[\"id\"]).\"\\\">\";\n}",
"function sectionID()\r\n {\r\n return $this->SectionID;\r\n }",
"function setSectionID( $value )\r\n {\r\n $this->SectionID = $value;\r\n }",
"public function render_section() {\n \n }",
"function display_ID_section_html()\n\t\t{\n\t\t\techo '<p>';\n\t\t\techo 'Set verification IDs for web services';\n\t\t\techo '</p>';\n\t\t}",
"protected function defineNameId(){\n list($name,$id)=$this->resolveNameID();\n $this->_id=$this->htmlOptions['id']=$id;\n\t\t$this->_name=$this->htmlOptions['name']=$name;\n }",
"private function title_to_id() {\n\t\t$this->section_data['general_title_to_id'] = array(\n\t\t\t'name' \t\t\t\t\t=> 'general_title_to_id',\n\t\t\t'label' \t\t\t\t=> __( 'Convert Heading Into ID', 'fixedtoc' ),\n\t\t\t'default' \t\t\t=> '',\n\t\t\t'type' \t\t\t\t\t=> 'checkbox',\n\t\t\t'des'\t\t\t\t\t\t=> __( 'Automatically convert The heading to HTML id attribute. <b>Only supports English language headings.</b><br>For example: "Download Source File" to "download-source-file" or "ftoc-download-source-file" if set the "ftoc" prefix below.', 'fixedtoc' )\n\t\t);\n\t}",
"protected function generateId()\n {\n if (empty($this->editorOptions['id'])) {\n $this->editorOptions['id'] = $this->options['id'] . '-editor';\n }\n if (empty($this->containerOptions['id'])) {\n $this->containerOptions['id'] = $this->options['id'] . '-container';\n }\n if (empty($this->headerOptions['id'])) {\n $this->headerOptions['id'] = $this->options['id'] . '-header';\n }\n if (empty($this->footerOptions['id'])) {\n $this->footerOptions['id'] = $this->options['id'] . '-footer';\n }\n if (empty($this->previewOptions['id'])) {\n $this->previewOptions['id'] = $this->options['id'] . '-preview';\n }\n Html::addCssStyle($this->options, 'height:' . $this->height . 'px');\n }",
"function section_id_convert($name) {\n\n\t// remove the hyphen\n\t$id = str_replace(\"-\", \"\", $name);\n\t\n\t// make lowercase\n\t$id = strtolower($id);\n\t\n\t// return clean value\n\treturn $id;\n\t\n}",
"function fopr_template_section( $name ) {\n\t$id = get_the_ID();\n\tswitch ( $name ) {\n\t\tcase 'example-template-section':\n\t\t\t?>\n\t\t\t<section class=\"[ section section--full ] example\">\n\t\t\t\tHi, I'm an example section to show how to use templates mixed with Gutenberg blocks.\n\t\t\t\tJust use the Template Section block and enter the name of this case.\n\t\t\t\tThis way you can use gutenberg blocks in one section and a section from the template in another.\n\t\t\t</section>\n\t\t\t<?php\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\techo 'Template section \"' . esc_html( $name ) . '\" not found.';\n\t}\n}",
"public function get_section($id)\n {\n }",
"public function get_name()\n {\n return 'section-heading';\n }",
"function section_start( $element )\n\t\t{\n\t\t\t$required = $extraclass = $target = \"\";\n\t\t\t\n\t\t\tif(isset($element['required'])) \n\t\t\t{ \n\t\t\t\t$required = '<input type=\"hidden\" value=\"'.$element['required'][0].'::'.$element['required'][1].'\" class=\"ace_required\" />'; \n\t\t\t\t$extraclass = ' ace_hidden ace_required_container';\n\t\t\t} \n\t\t\t\n\t\t\tif(isset($element['target'])) \n\t\t\t{ \n\t\t\t\tif(is_array($element['target']))\n\t\t\t\t{\n\t\t\t\t\tforeach($element['target'] as $value) { $target .= '<input type=\"hidden\" value=\"'.$value.'\" class=\"ace_target_value\" />'; }\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$target = '<input type=\"hidden\" value=\"'.$element['target'].'\" class=\"ace_target_value\" />'; \n\t\t\t\t}\n\t\t\t\t\n\t\t\t} \n\t\t\tif(isset($element['class'])) $extraclass .= ' '.$element['class'];\n\t\t\t\n\t\t\t$output = '<div class=\"ace_section ace_'.$element['type'].$extraclass.'\" id=\"ace_'.$element['id'].'\">';\n\t\t\t$output .= $required;\n\t\t\t$output .= $target;\n\t\t\tif($element['name'] != \"\")\n\t\t\t{\n\t\t\t\t$output .= '<h4>'.$element['name'].'</h4>';\n\t\t\t}\n\t\t\t$output .= '<div class=\"ace_control_container\">';\n\n\t\t\treturn $output;\n\t\t}",
"public function section_adapted(){\n\t\treturn '<div id=\"main\" class=\"'.$this->seccion['adapted'].'\">';\n\t}",
"public function setPageID(){\n\t\t\n\t\t$id = 'page';\n\t\t$s = '-';\n\t\t$pound = (!self::USE_SPLASH)?'#':'';\n\t\t$prefix = $pound.$id.$s;\n\t\t$this->headerContainerId = $prefix.'header'.$s.'container';\n\t\t$this->headerId = $prefix.'header';\n\t\t$this->subtitleId = $prefix.'subtitle';\n\t\t$this->brandId = $prefix.'brand';\n\t\t\n\t}",
"function detailEvenement($id){\t\n\t\t$this->infosDetail[\"id\"] = $id;\n\t\treturn $this->construireHtml([\"header\", \"section-detailEvenement\", \"footer\"]);\n\t}",
"protected function start_section_list() {\n\n $html = html_writer::start_tag('div', array('id' => 'turforlag_wrapper'));\n $html .= html_writer::start_tag('div', array('id' => 'tabs', 'class' => 'turforlag'));\n return $html;\n }",
"public function getHtmlId() {\n return Html::getId('draggableviews-table-' . $this->view->id() . '-' . $this->view->current_display);\n }",
"public function gen_section(){\n $data = array(\n \"txtinicio\"=>\"Inicio\",\n \"rutainicio\" => \"/admin/inicio\",\n \"txtmodulo\" => \"CONTABILIDAD\",\n \"section\" => \"Contabilidad\",\n \"rutamodulo\" => \"/admin/tipocuenta\",\n \"ventana\" => \"Niveles\"\n );\n\n return $data;\n }",
"function assignSectionIdSetLecture()\n {\n /* Query a list of sections for the current lecture. */\n $parents = $this->dbQuerySectionIdSetLecture();\n /* Remember it ... */\n $this->assign('section_parents', $parents);\n }",
"private function id_tag( $prependix = null, $appendix = null )\n {\n $id = $this->get_full_id( $prependix, $appendix );\n if($this->item_id) $id .= '-' . $this->item_id;\n\n echo 'id=\"' . $id . '\"';\n }",
"function set_accordion_id() {\n\t\t\t$this->current_accordion_slug++;\n\t\t}",
"function timezonecalculator_get_section_link($section, $allSections, $section_nicename='') {\r\n\tif (!array_key_exists($section, $allSections))\r\n\t\treturn;\r\n\r\n\t$fieldsPre=\"timezones_\";\r\n\t$sectionPost='_Section';\r\n\r\n\t$menuitem_onclick='';\r\n\r\n\tif (strlen($section_nicename)<1)\r\n\t\t$section_nicename=str_replace('_', ' ', $section);\r\n\r\n\tif ($allSections[$section]=='1')\r\n\t\t$menuitem_onclick=\" onclick=\\\"timezonecalculator_assure_open_section('\".$section.\"');\\\"\";\r\n\r\n\treturn '<a'.$menuitem_onclick.' href=\"#'.$fieldsPre.$section.'\">'.$section_nicename.'</a>';\r\n}",
"function pixelgrade_posts_container_id( $location = array() ) {\n\t\t$posts_container_id = pixelgrade_get_posts_container_id( $location );\n\t\tif ( ! empty( $posts_container_id ) ) {\n\t\t\techo 'id=\"' . esc_attr( $posts_container_id ) . '\"';\n\t\t}\n\t}",
"protected function getSectionId():int\n {\n $secRes = SectionTable::getList([\n \"filter\" => [\n \"IBLOCK_ID\" => $this->iblockId,\n \"DEPTH_LEVEL\" => 2\n ],\n \"select\" => [\"ID\"]\n ]);\n while($sectionFields = $secRes->fetch())\n $sections[] = (int) $sectionFields[\"ID\"];\n $rndKey = array_rand($sections, 1);\n $sectionId = (int) $sections[$rndKey];\n return $sectionId;\n }",
"function getIdHtml($id = null)\n {\n if ($id == null) {\n $id = $this->id;\n }\n\n if (preg_match('/^plg[0-9]+$/', $id)) {\n return '';\n }\n\n return \" id=\\\"$id\\\"\";\n }",
"function getHtmlId(){\n\t\t//this to have unique ID attribute of the main containing div in case there is more \n\t\t//than 1 of the same action box. Cache key is composed of $_htmlUniqueId prefix and \n\t\t//ID of the action box.\n\t\t$actionBoxId = $this->getId();\n\t\t\n\t\t$htmlUniqueId = wp_cache_get( $this->_html_UniqueId . $actionBoxId );\n\t\tif( false === $htmlUniqueId ){\n\t\t\t//this is the first\n\t\t\t$htmlUniqueId = 1;\n\t\t\twp_cache_set( $this->_html_UniqueId . $actionBoxId, $htmlUniqueId );\n\t\t} else {\n\t\t\t//another box is already displayed\n\t\t\t$htmlUniqueId++;\n\t\t\twp_cache_replace( $this->_html_UniqueId . $actionBoxId, $htmlUniqueId );\n\t\t}\n\t\t\n\t\treturn $actionBoxId.$htmlUniqueId;\n\t}",
"function id($name, $echo = true) {\n $id = sprintf('%s_settings_%s', __CLASS__, $name);\n if ($echo) {\n echo $id;\n } else {\n return $id;\n }\n }",
"public function setId()\n\t{\n\t}",
"private function sectionIDbyName( $name )\n {\n $sectionID = false;\n $sectionList = eZSection::fetchFilteredList( array( 'name' => $name ), false, false, true );\n if( is_array( $sectionList ) && count( $sectionList ) > 0 )\n {\n $section = $sectionList[0];\n if( is_object( $section ) )\n {\n $sectionID = $section->attribute( 'id' );\n }\n }\n return $sectionID;\n }",
"private function __appendBodyId(){\n\t\t\t// trim \"content\" from beginning of class name\n\t\t\t$body_id = preg_replace(\"/^content/\", '', get_class($this));\n\n\t\t\t// lowercase any uppercase letters and prefix with a hyphen\n\t\t\t$body_id = trim(preg_replace(\"/([A-Z])/e\", \"'-' . strtolower('\\\\1')\", $body_id), '-');\n\n\t\t\tif (!empty($body_id)) $this->Body->setAttribute('id', trim($body_id));\n\t\t}",
"function bg_AddSettingsSectionHtml() { }",
"public function remove_section($id)\n {\n }",
"public function diviroids_module($atts)\n {\n extract(shortcode_atts(array( 'id' => null), $atts));\n return do_shortcode('[et_pb_section global_module=\"'. $id .'\"][/et_pb_section]');\n }",
"function __tinypass_section_head( TPPaySettings $ps, $num, $text = '', $html = '' ) {\n\t?>\n\n\t<div class=\"tp-section-header\">\n\t\t<div class=\"num\"><?php echo $num ?></div>\n\t\t<?php echo $text ?>\n\t\t<?php echo $html ?>\n\t</div>\n\n<?php }",
"public function generate_section_html( $key, $data ) {\n\t\t$html = '';\n\n\t\tif ( isset( $data['title'] ) && $data['title'] != '' ) $title = $data['title']; else $title = '';\n\t\t$data['class'] = ( isset( $data['class'] ) ) ? $data['class'] : '';\n\t\t$data['css'] = ( isset( $data['css'] ) ) ? $data['css'] : '';\n\n\t\t$html .= '<tr valign=\"top\">' . \"\\n\";\n\t\t$html .= '<th scope=\"row\" colspan=\"2\">';\n\t\t$html .= '<h3 style=\"margin:0;\">' . $data['title'] . '</h3>';\n\t\tif ( $data['description'] ) $html .= '<p>' . $data['description'] . '</p>';\n\t\t$html .= '</th>' . \"\\n\";\n\t\t$html .= '</tr>' . \"\\n\";\n\n\t\treturn $html;\n\t}",
"public static function sectionURI($mnt,$section)\n{\nreturn self::commandURI($mnt,'section&name='.$section);\n}",
"function _add_section( $data=array() )\n\t{\n\t\t$section = array();\n\t\t\n\t\t$section['conf_title_title'] = $data['conf_title_title']['VALUE'];\n\t\t$section['conf_title_desc'] = $data['conf_title_desc']['VALUE'];\n\t\t$section['conf_title_count'] = 0;\n\t\t$section['conf_title_noshow'] = $data['conf_title_noshow']['VALUE'];\n\t\t$section['conf_title_keyword'] = $data['conf_title_keyword']['VALUE'];\n\t\t$section['conf_title_module'] = $data['conf_title_module']['VALUE'];\n\t\t\n\t\t$this->ipsclass->DB->do_insert( 'conf_settings_titles', $section );\n\t\t\n\t\treturn $this->ipsclass->DB->get_insert_id();\n\t}",
"function printID()\n {\n echo str_replace(' ', '', $this->position).substr($this->name, 0,2);;\n }",
"function media_theplatform_mpx_append_html_id($div_id, $append, $html) {\n $find = 'id=\"' . $div_id . '\"';\n // Replace with 'div_id-append'.\n $replace = 'id=\"' . $div_id . '-' . $append . '\" tp:scopes=\"scope-' . $append . '\"';\n return str_replace($find, $replace, $html);\n}",
"public function section_header($id, $value = null, $class = array('section-header')){\n if(is_array($class)) {\n $class = implode(\" \", apply_filters('msdlab_form__' . $id . '_class', $class));\n }\n $ret = '<div class=\"row\"><h3 id=\"'.$id.'_wrapper\" class=\"col-sm-12 '.$class.'\">'.$value.'</h3></div>';\n return apply_filters('msdlab_form__'.$id.'', $ret);\n }",
"function createSimpleLink($idName) {\n echo '<a href=\"index.php\" id=\"' . $idName . '\" class=\"nested\">homepage</a>';\n }",
"public function getSection() : string{\n return $this->section;\n }",
"public function getSection(): string\n {\n return $this->section;\n }",
"protected function getToggleId()\n {\n $unique = md5(uniqid());\n return \"sidenav_$unique\";\n }",
"public function section(Session $session, int $section_id = 0): string\n {\n $title = __('Section list');\n $this->navChain->add($title, route('news.admin.section'));\n\n if (! empty($section_id)) {\n $current_section = (new NewsSection())->findOrFail($section_id);\n $title = $current_section->name;\n Helpers::buildAdminBreadcrumbs($current_section->parentSection);\n // Adding the current section to the navigation chain\n $this->navChain->add($current_section->name);\n }\n\n $data = [];\n $data['messages'] = $session->getFlash('success_message');\n $data['sections'] = (new NewsSection())\n ->when(! empty($section_id), function (Builder $builder) use ($section_id) {\n return $builder->where('parent', $section_id);\n })\n ->when(empty($section_id), function (Builder $builder) {\n return $builder->where('parent', 0)->orWhereNull('parent');\n })\n ->get();\n $data['articles'] = (new NewsArticle())\n ->when(! empty($section_id), function (Builder $builder) use ($section_id) {\n return $builder->where('section_id', $section_id);\n })\n ->when(empty($section_id), function (Builder $builder) {\n return $builder->where('section_id', 0)->orWhereNull('section_id');\n })\n ->orderByDesc('id')\n ->paginate();\n $data['current_section'] = $section_id;\n\n $this->metaTagManager->setAll($title);\n return $this->render->render('johncms/news::admin/sections', ['data' => $data]);\n }",
"function pnq_add_section( $section ) {\n\tglobal $pnq_settings_sections;\t\n\tif( ! array_key_exists( $section['id'], $pnq_settings_sections ) ) {\n\t\t$pnq_settings_sections[$section['id']] = $section;\n\t\treturn $section;\t\n\t}\n}",
"public function outputId()\n\t{\n\t\techo App::e($this->id);\n\t}",
"function getId() {\n\t\treturn $this->getData('sectionDecisionId');\r\n\t}",
"public function sectiondetail($id=FALSE)\n\t{\n\t\tif($id==FALSE)\n\t\t\tredirect('admin/section');\n\t\t$data['sd']=$this->model->get_entity_detail($id);\n\t\t$data['Entity']=$this->__ENTITY;\n\t\tget_views('sectiondetail', 'Section Details', $data);\n\t}",
"public function id()\n {\n return 'idlikethis-post-control';\n }",
"function display_section_before( $retval, $section, $class, $title, $section_id ) {\n\t$layout = get_field( 'section_layout', $section );\n\tswitch ( $layout ) {\n\t\tcase 'courses':\n\t\t\t$retval = display_courses_before( $section );\n\t\t\tbreak;\n\t\tcase 'timeline':\n\t\t\t$retval = display_timeline_before( $section );\n\t\t\tbreak;\n\t\tcase 'default':\n\t\tdefault:\n\t\t\t$retval = \\UCF_Section_Common::ucf_section_display_before( $section, $class, $title, $section_id );\n\t\t\tbreak;\n\t}\n\n\treturn $retval;\n}",
"public function id();",
"public function id();",
"public function id();",
"public function id();",
"public function id();",
"public function id();",
"public function id();",
"public function id();",
"public function id();",
"function add_section($title, $section_id = '', $priority = false) {\n $this->customizer_map_array[] = array(\n 'command' => 'add_section',\n 'title' => $title,\n 'section_id' => $section_id,\n 'priority' => $priority\n );\n\n\n }",
"public function section($action = \"\", $id = \"\") {\n\n\t\t// PROVIDE A LIST OF SECTION ACCORDING TO CLASS ID\n\t\tif ($action == 'list') {\n\t\t\t$page_data['class_id'] = $id;\n\t\t\t$this->load->view('backend/admin/section/list', $page_data);\n\t\t}\n\t}",
"public static function buildCustomSectionCounterId(string $moduleId, ?int $customSectionId): string\n\t{\n\t\treturn $moduleId . self::COUNTER_INFIX . $customSectionId;\n\t}",
"function SECT_ID(){\n\t\tglobal $_CON;\n\t\tif(isset($_GET['this_sect'])){\n\t\t\t$_CLASSID = mysqli_real_escape_string($_CON, $_GET['this_sect']);\n\t\treturn $_CLASSID;\n\t\t}\n\t}",
"public function addSection($sectionId);",
"function getSectionsIdOption() {\r\n\t\t$database =& JFactory::getDBO();\r\n\r\n\t\t$sectoptions = array();\r\n\r\n\t\treturn $sectoptions;\r\n }",
"function ID($id)\n {\n if (false !== $ctrl = \\ClickBlocks\\MVC\\Page::$current->view->get($id)) return $ctrl->attr('id');\n }",
"public function getCustomSectionMenuId(string $customSectionCode): string\n\t{\n\t\treturn 'menu_custom_section_' . htmlspecialcharsbx($customSectionCode);\n\t}",
"function put_id() {\n \n if($this->name == \"\") {\n $this->name = $this->classname;\n }\n \n // if we stop using the session id- we should remove the session id from\n // the current QUERYSTRING/ or the HTTP_GET_VARS ????\n die(\"This has not been coded yet.\");\n }",
"function ffw_port_header_callback( $args ) {\n $html = '<label for=\"ffw_port_settings_' . $args['section'] . '[' . $args['id'] . ']\"> ' . $args['desc'] . '</label>';\n echo $html;\n}",
"function getExpertSectionTitle($sectionid) {\r\n\t\t$database = & JFactory::getDBO();\r\n\r\n\t\tif ($sectionid == 0)\r\n\t\t\treturn '(0) All ';\r\n\r\n\t\t$query = \"SELECT id, catname as title\"\r\n\t\t\t\t. \"\\n FROM #__eventlist_categories\"\r\n\t\t\t\t. \"\\n WHERE id=$sectionid\"\r\n\t\t;\r\n\t\t$database->setQuery($query);\r\n\t\t$row = $database->loadObjectList();\r\n\t\treturn \"($sectionid) \" . $row[0]->title;\r\n\t}",
"private function buildIds(){\n\n\t\t$string = 'data-id=\"'.$this->fullId.'\" ';\n\t\t$string .= 'data-column_id=\"'.$this->id.'\" ';\n\t\t$string .= 'data-section_id=\"'.$this->section_id.'\" ';\n\t\t$string .= 'data-post_id=\"'.$this->post_id.'\" ';\n\n\t\treturn $string;\n\t}",
"function getSectionsIdOption() {\r\n\t\t$database = JFactory::getDBO();\r\n\r\n\t\t$sectoptions = array();\r\n\t\t$query = \"SELECT id, title\"\r\n\t\t\t\t. \"\\n FROM \" . $database->nameQuote($this->componentSectionTable)\r\n\t\t\t\t. \"\\n WHERE published = 1\"\r\n//\t\t\t\t. \"\\n AND access >= 0\"\r\n\t\t\t\t. \"\\n ORDER BY ordering\"\r\n\t\t;\r\n\t\t$database->setQuery($query);\r\n\t\t$sectoptions = $database->loadObjectList();\r\n\r\n\t\treturn $sectoptions;\r\n\t}",
"function createSimpleDiv($idName) {\n echo '<div id=\"' . $idName . '\"class=\"nested\">Div</div>';\n }",
"public function section($action = \"\", $id = \"\") {\n\n\t\t// PROVIDE A LIST OF SECTION ACCORDING TO CLASS ID\n\t\tif ($action == 'list') {\n\t\t\t$page_data['class_id'] = $id;\n\t\t\t$this->load->view('backend/student/section/list', $page_data);\n\t\t}\n\t}",
"public function startSectionEdit($start, $type, $title = null) {\n $this->sectionedits[] = array(++$this->lastsecid, $start, $type, $title);\n return 'sectionedit'.$this->lastsecid;\n }",
"public function id($ctp_file)\n {\n if (empty($this->ids[$ctp_file])) {\n $this->ids[$ctp_file]= 'cajas-' . uniqid() . '-id';\n }\n $link = $this->ids[$ctp_file];\n //debug($_View->_current);\n return $link;\n }",
"public function display_section() {\n\t\t// do nothing - @todo Possibly add description here later if we have more options to add.\n\t}",
"function getExpertSectionIdOption($sections, $include) {\r\n\t\t$database = & JFactory::getDBO();\r\n\r\n\t\t$where = \"\";\r\n\t\tif ($sections) {\r\n\t\t\tif ($include)\r\n\t\t\t\t$where = \"\\n AND id IN ($sections) \";\r\n\t\t\telse\r\n\t\t\t\t$where = \"\\n AND id NOT IN ($sections) \";\r\n\t\t}\r\n\t\t$sectoptions = array();\r\n\t\t$query = \"SELECT id, catname as title\"\r\n\t\t\t\t. \"\\n FROM #__eventlist_categories\"\r\n\t\t\t\t. \"\\n WHERE publishedcat = 1\"\r\n\t\t\t\t. $where\r\n\t\t\t\t//\t\t\t\t. \"\\n AND access >= 0\"\r\n\t\t\t\t. \"\\n ORDER BY ordering\"\r\n\t\t;\r\n\t\t$database->setQuery($query);\r\n\t\t$sectoptions = $database->loadObjectList();\r\n\t\t// add \"All sections\"\r\n\t\tarray_unshift($sectoptions, JHTML::_('select.option', '0', '-- All --', 'id', 'title'));\r\n\r\n\t\treturn $sectoptions;\r\n\t}",
"function RenderSectionTitle($section) {\r\n $this->SetSectionFont();\r\n $this->Cell($this->sectionTitleWidth, 0, $section);\r\n }",
"public function getSectionName(): string\n {\n return $this->sectionName;\n }",
"protected function openBodyTag($section,$count) {\n\t\treturn sprintf('<div id=\"%s_tab_%s\" class=\"block ui-widget-content %s\">',$this->prefixID(),$this->sectionAttr($section),$count > 1 ? \"ui-tabs-hide\" : \"\");\n\n\t}",
"function section_open($level) {\n $this->doc .= '<div class=\"level'.$level.'\">'.DOKU_LF;\n }",
"function target( $element )\n\t\t{\t\n\t\t\t$output = $this->section_start( $element );\n\t\t\t$output .= '\t<div><div class=\"ace_target_inside\">';\n\t\t\t$output .= \t\t$element['std'];\n\t\t\t$output .= '\t</div>';\n\t\t\t$output .= $this->section_end( $element );\n\t\t\treturn $output;\n\t\t}",
"function vcex_get_unique_id( $id = '' ) {\n\tif ( $id ) {\n\t\treturn ' id=\"' . esc_attr( $id ) . '\"'; // do not remove empty space at front!!\n\t}\n}",
"public static function id()\n {\n return new TextNode('id');\n }",
"public function getDiv(): String\n {\n $val = '<div class=\"section\" id=\"section' . $this->__sectionNumber . '\">';\n $val .= '<svg class=\"mapoverview\" id=\"svg-span\">';\n $val .= $this->SVGOBJECTS;\n $val .= '</svg></div>';\n return $val;\n }",
"public function setPageID(){/*ACTUALLY NOT DEFINED*/}",
"function fetchSectionIDFromHandle($handle){\n\t\t\t$handle = Lang::createHandle($handle);\n\n\t\t\treturn $this->_db->fetchVar('id', 0, \"SELECT `id` FROM `tbl_sections` WHERE `handle` = '\".$handle.\"' LIMIT 1\");\n\t\t}",
"public function renderSectionHeader(string $sectionName): void;",
"function dynamic_section( $sections ) {\n //$sections = array();\n $sections[] = array(\n 'title' => __( 'Section via hook', 'slova' ),\n 'desc' => __( '<p class=\"description\">This is a section created by adding a filter to the sections array. Can be used by child themes to add/remove sections from the options.</p>', 'slova' ),\n 'icon' => 'el-icon-paper-clip',\n // Leave this as a blank section, no options just some intro text set above.\n 'fields' => array()\n );\n\n return $sections;\n }",
"public function __toString()\n {\n if (isset($this->properties['Title'])) {\n return $this->properties['Title'] . ' (# '.$this->properties['Id'].')';\n }\n return '# '.$this->properties['Id'];\n }",
"function pqrc_section_title_cal()\n {\n echo \"<h2>\" . __('Post QRC Settings Section', 'post-qurcode') . \"</h2>\";\n }",
"function setId($id) {\r\n\t\t$this->setAttributeNS(self :: TEXT, 'text:id', $id);\r\n\t}",
"protected function create_section_data() {\n\t\t$this->enable();\n\t\t$this->post_types();\n\t\t$this->headings();\n\t\t$this->min_headings_num();\n\t\t$this->exclude_keywords();\n\t\t$this->title_to_id();\n\t\t$this->id_prefix();\n\t\t$this->in_widget();\n\t\t$this->customize_css();\n\t\t$this->shotcut();\n\t\t$this->fixed_menu_selector();\n\t\t$this->scroll_offset();\n\t}",
"function wp_store_primary(){\t\t\r\n\t\techo '<div id=\"primary\">';\r\n\t}",
"public function getElementId() {}",
"public function setSection()\n {\n $this->section = Yii::t('db/product', 'current_section');\n }"
] | [
"0.69072545",
"0.6777588",
"0.63526326",
"0.63415015",
"0.6231621",
"0.62241405",
"0.61618066",
"0.6061156",
"0.6059656",
"0.60034436",
"0.59141463",
"0.58314294",
"0.58139104",
"0.5786361",
"0.57460564",
"0.57457983",
"0.5719343",
"0.56891674",
"0.56888276",
"0.5688206",
"0.56812924",
"0.5668367",
"0.56656295",
"0.56654704",
"0.5664752",
"0.56425387",
"0.5630167",
"0.56266844",
"0.5558068",
"0.5537225",
"0.5534329",
"0.55171734",
"0.550938",
"0.5500437",
"0.5492545",
"0.5488442",
"0.5476362",
"0.54662263",
"0.54661995",
"0.54648316",
"0.5457486",
"0.5444674",
"0.54212993",
"0.5419158",
"0.5405819",
"0.5399965",
"0.53915286",
"0.5389403",
"0.53739464",
"0.5370793",
"0.5365698",
"0.5333628",
"0.53147113",
"0.5309795",
"0.5309795",
"0.5309795",
"0.5309795",
"0.5309795",
"0.5309795",
"0.5309795",
"0.5309795",
"0.5309795",
"0.53031284",
"0.5294476",
"0.5290607",
"0.5286579",
"0.52859086",
"0.5269387",
"0.52654487",
"0.52609575",
"0.52480066",
"0.52369934",
"0.52319694",
"0.5231609",
"0.52233386",
"0.5219625",
"0.5213875",
"0.5203583",
"0.5202939",
"0.5179059",
"0.5170271",
"0.51692426",
"0.5168081",
"0.51575166",
"0.5157446",
"0.5148246",
"0.51433134",
"0.5130774",
"0.51241595",
"0.5107079",
"0.5104426",
"0.5089716",
"0.50847125",
"0.50843334",
"0.50798714",
"0.50789076",
"0.5078685",
"0.5075074",
"0.50697076",
"0.5068841"
] | 0.53467447 | 51 |
Parser content into text for use in parameters etc. | static public function toText($content, $single_line = true)
{
$return = '';
foreach ($content as $c)
{
switch ($c['type'])
{
case Wiki_Parser_Core::NEW_LINE:
$return .= $single_line ? ' ' : '<br />';
break;
case Wiki_Parser_Core::NEW_PARAGRAPH:
$return .= $single_line ? ' ' : '<br /><br />';
break;
case Wiki_Parser_Core::ELEMENT:
$return .= $c['content']->getHtml();
break;
case Wiki_Parser_Core::WARNING:
$return .= $c['unparsed'];
break;
default:
$return .= $c['content'];
break;
}
}
return $return;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function parse($content);",
"public function parse(string $content);",
"public function parse(string $content);",
"public function parse( $contents );",
"public function parse(string $content, array $data = []): string;",
"function _parse() {\n $txt = $this->_text;\n for($i=0; $i<count($txt); $i++) {\n $txt[$i] = preg_replace(\"@[{]([^}]+)[}]@e\", \"''.\\$this->_insert(\\\"\\\\1\\\").''\",$txt[$i]);\n }\n return join(\"\",$txt);\n }",
"private function processContent(){\n\t\t$this->textEnd = strpos($this->raw,\"</{$this->tag}\");\n\t\t$this->text = trim(substr($this->raw, $this->textStart, $this->textEnd - $this->textStart));\n\t}",
"protected function parse(): void\n {\n $lines = preg_split('/\\r\\n|\\r|\\n/', $this->content);\n\n foreach ($lines as $line) {\n if (mb_strlen(trim($line)) && ! (mb_strpos(trim($line), '#') === 0)) {\n [$key, $value] = explode('=', (string) $line);\n $this->variables[$key] = $this->formatValue($value);\n }\n }\n }",
"protected function parse() {}",
"public abstract function parse($text);",
"public function parse($text);",
"private function parse($contents) // {{{\n {\n $entries = array();\n preg_match_all(\"/@(\\\\w+?)\\\\{([^,]+?),(.*?)\\\\n\\\\s*?\\\\}\\\\s*?\\\\n/ms\", \n $contents, $entries, PREG_SET_ORDER);\n foreach ($entries as $entry)\n {\n $bibtex_type = $entry[1];\n $bibtex_name = $entry[2];\n $bibtex_contents = $entry[3].\",\\n\"; // Newline added so that all entries are followed by one\n preg_match_all(\"/(\\\\w+?)\\\\s*=\\\\s*\\\\{(.*?)\\\\},\\\\n/ms\", \n $bibtex_contents, $pairs, PREG_SET_ORDER);\n $params = array();\n foreach ($pairs as $pair)\n {\n $k = $pair[1];\n $v = $pair[2];\n $params[\"raw\"][$k] = Bibliography::unspace($v); // We keep the original BibTeX string in the \"raw\" subarray\n $params[$k] = Bibliography::removeBraces(\n Bibliography::replaceAccents(Bibliography::unspace($v)));\n }\n $params[\"bibtex_type\"] = $bibtex_type;\n $this->m_entries[$bibtex_name] = $params;\n }\n }",
"public function parse($text, array $data, $purgePlaceholders = true);",
"public function parse(string $content)\n {\n foreach ($this->variables as $search => $replace) {\n $this->variables[$search] = $this->renderValue($replace);\n $value = $this->variables[$search]['rendered'];\n $content = preg_replace_callback(\"/\\s*{{\\s*${search}\\s*}}/\", function ($matches) use ($value) {\n return $this->renderSpacing($value, $matches);\n }, $content);\n }\n\n return $content;\n }",
"function parse_content($rawcontent){\n $content = explode(\"++++\", $rawcontent);\n //the defintion of the the title\n $metablock = $content[0];\n $rawmeta = explode(\"----\", $metablock);\n $meta = [];\n foreach ($rawmeta as $metaline) {\n //splits key from value\n $metaentry = explode(\":\", $metaline);\n //removes all spaces around the value\n $key = trim($metaentry[0]);\n $value = trim($metaentry[1]);\n $meta[$key] = $value;\n }\n //the splittet version: just the value\n $title = $meta[\"title\"];\n //the splittet text\n $text = $content[1];\n $result = compact(\"title\", \"text\", \"meta\");\n //returns the result\n return $result;\n}",
"public function parse();",
"public function parse();",
"public function parse();",
"public function getParsedInput();",
"protected function parseContent()\n {\n $contentString = strtok($this->query, '/');\n\n $content = [];\n $delim = '(),';\n $tok = strtok($contentString, $delim);\n while ($tok !== false) {\n $content[] = $tok;\n $tok = strtok($delim);\n }\n\n $this->contentTypes = $content;\n }",
"abstract public function parse();",
"abstract public function parse();",
"abstract public function parse();",
"abstract public function parse();",
"public function parse()\n {\n $strBuffer = parent::parse();\n\n foreach($this->arrData['variables'] as $varName=>$varValue)\n {\n if (empty($varValue))\n {\n continue;\n }\n\n // Convert date values\n /*switch ($objVar['type'])\n {\n case 'date':\n $objVar['value'] = \\Date::parse(\\Config::get('dateFormat'), $objVar['value']);\n break;\n\n case 'time':\n $objVar['value'] = \\Date::parse(\\Config::get('timeFormat'), $objVar['value']);\n break;\n\n case 'datim':\n $objVar['value'] = \\Date::parse(\\Config::get('datimFormat'), $objVar['value']);\n break;\n }*/\n\n //$objVar['value'] = str_replace('$', '\\$', $objVar['value']);\n\n if (is_array($varValue))\n {\n $varValue = json_encode($varValue);\n }\n\n $strBuffer = preg_replace('/{%\\s*' . $varName . '\\s*%}/s', $varValue, $strBuffer);\n\n $strBuffer = preg_replace('/{%\\s*' . $varName . '\\|\\s*nl2br\\s*%}/s', nl2br($varValue), $strBuffer);\n }\n\n $strBuffer = preg_replace('/{%.*?%}/s', '', $strBuffer);\n\n return $strBuffer;\n }",
"public function reparse()\n\t{\n\t\t$for_edit = $this->generate_text_for_edit();\n\t\t$this->post_text = $for_edit['text'];\n\n\t\t// Emulate what happens when sent from the user\n\t\t$this->post_text = html_entity_decode($this->post_text);\n\t\tset_var($this->post_text, $this->post_text, 'string', true);\n\n\t\t$this->generate_text_for_storage($for_edit['allow_bbcode'], $for_edit['allow_urls'], $for_edit['allow_smilies']);\n\t}",
"protected function parse_content(){\n $m = array(); // we will keep here\n list( $t, $text ) = explode( \"<div class='post entry-content '>\", $this->page );\n list( $text, $t ) = explode( '</div>', $text );\n return $text;\n }",
"public function run()\n {\n $tokens = $this->extractTokens( );\n\n // Loop through all the matches\n foreach( $tokens as $token )\n {\n if ( ! isset( $this->tokens[ $token ] ) )\n {\n $this->tokens[ $token ] = '';\n }\n\n if (\n is_object( $this->tokens[ $token ] ) &&\n method_exists( $this->tokens[ $token ], '__toString' ) ) {\n $replacement = ( string ) $this->tokens[ $token ];\n } else {\n $replacement = $this->tokens[ $token ];\n }\n\n // Get the content and replace the token with the parameter token\n $this->content = str_ireplace(\n sprintf( '%s%s%s', $this->openingTag, strtoupper( $token ), $this->closingTag ),\n $replacement,\n $this->content\n );\n }\n\n // Return the content\n return $this->content;\n }",
"protected function _parseTemplate() {}",
"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}",
"public function autoParse()\n {\n $type = $this->getMimeType();\n $contents = '';\n\n if ($type == 'application/json' || $type == 'text/json') {\n $contents = $this->parseJson();\n } elseif ($type == 'application/xml' || $type == 'text/xml') {\n $contents = $this->parseXml();\n } elseif ($type == 'application/x-yaml' || $type == 'text/yaml') {\n $contents = $this->parseYaml();\n } else {\n $contents = $this->getContents();\n }\n\n return $contents;\n }",
"abstract public function parse ();",
"protected function buildContents() : string {\n\n\t\t\t$insertions = [];\n\n\t\t\t# Process blocks\n\n\t\t\tforeach ($this->blocks as $name => $block) {\n\n\t\t\t\t$insertions['{ block:' . $name . ' / }'] = $block->getContents();\n\t\t\t}\n\n\t\t\t# Process loops\n\n\t\t\tforeach ($this->loops as $name => $loop) {\n\n\t\t\t\t$insertions['{ for:' . $name . ' / }'] = $loop->getContents();\n\t\t\t}\n\n\t\t\t# Process widgets\n\n\t\t\tforeach ($this->widgets as $name) {\n\n\t\t\t\t$widget = Template::getWidget($name);\n\n\t\t\t\t$contents = ((false !== $widget) ? $widget->getContents() : '');\n\n\t\t\t\t$insertions['{ widget:' . $name . ' / }'] = $contents;\n\t\t\t}\n\n\t\t\t# Process variables\n\n\t\t\tforeach ($this->variables as $name => $value) {\n\n\t\t\t\t$value = ((false === $value) ? Template::getGlobal($name) : $value);\n\n\t\t\t\t$insertions['$' . $name . '$'] = Str::formatOutput($value);\n\t\t\t}\n\n\t\t\t# Process phrases\n\n\t\t\tforeach ($this->phrases as $name => $value) {\n\n\t\t\t\t$value = Language::get($name);\n\n\t\t\t\t$insertions['%' . $name . '%'] = Str::formatOutput($value);\n\t\t\t}\n\n\t\t\t# Process insertions\n\n\t\t\t$contents = str_replace(array_keys($insertions), array_values($insertions), $this->contents);\n\n\t\t\t# ------------------------\n\n\t\t\treturn $contents;\n\t\t}",
"function parseData(){\r\n\t\t$content = array();\r\n\t\t$this->page_id = $this->CFG->PostVars['pageid'];\r\n\t\tforeach($this->CFG->PostVars as $key=>$value){\r\n\t\t\tif(preg_match(\"/content_(.*)_(.*)/\", $key, $arr)){\r\n\t\t\t\t$field\t= $arr[1];\r\n\t\t\t\t$lang \t= $arr[2];\r\n\t\t\t\tif(is_array($content[$lang])){\r\n\t\t\t\t\t$content[$lang][$field] = $value;\r\n\t\t\t\t}\r\n\t\t\t\telse $content[$lang] = array($field => $value);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$this->content = $content;\r\n\t}",
"protected function parse()\n {\n // $member is an array with the details of the motherless member who wrote the content.\n // @see WebBot::getMember() for more details.\n $member = $this->getMember();\n\n // $content is the content, either a shout, comment, board post, or group forum post.\n // @see WebBot::getContent() for more details.\n $content = $this->getContent();\n\n // $name is the name of this bot with some special bbcode wrapped around it.\n // @see WebBot::getWrappedName() for more details.\n $name = $this->getWrappedName();\n\n // $trigger is the text which triggered calling this bot.\n // @see WebBot::getTrigger() for more details.\n $trigger = $this->getTrigger();\n\n // $this->getWrappedText() wraps the bot's text in some special bbcode tags.\n // @see WebBot::getWrappedText() for more details.\n $quote = $this->getRandomQuote();\n $quote = $this->getWrappedText(\"\n {$name}:\n A quote for {$member['username']}\n [i]{$quote['quote']}[/i]\n - {$quote['author']}\n \");\n\n // Replace the trigger in the content with our random quote.\n $content = str_replace($trigger, $quote, $content);\n\n // Respond with the new content.\n // @see WebBot::sendContent() for more details.\n $this->sendContent($content);\n }",
"public function process($content){\n\t\treturn str_replace('</body>', $this->configstring . '</body>', $content);\n\t}",
"function my_formatter( $content ) {\n\n\t\t$new_content = '';\n\t\t$pattern_full = '{(\\[raw\\].*?\\[/raw\\])}is';\n\t\t$pattern_contents = '{\\[raw\\](.*?)\\[/raw\\]}is';\n\t\t$pieces = preg_split( $pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE );\n\n\t\tforeach ( $pieces as $piece ) {\n\n\t\t\tif ( preg_match( $pattern_contents, $piece, $matches ) ) {\n\t\t\t\t$new_content .= $matches[1];\n\t\t\t} else {\n\t\t\t\t$new_content .= wptexturize( wpautop( $piece ) );\n\t\t\t}\n\n\t\t}\n\n\t\treturn $new_content;\n\n\t}",
"abstract protected function parseContent($content = ''): array;",
"protected function _run() {\n $tmpContent = $this->_content;\n $this->_content = $this->_getCurrentTemplateContent();\n $spaceContent = $this->_parse();\n $this->_content = $tmpContent;\n $content = '';\n\n if(!$spaceContent) {\n $spaceContent = $this->_parse();\n }\n\n $this->_parseParams();\n $news = Newslog_Models_Mapper_NewsMapper::getInstance()->fetchAll(null, array('created_at ' . $this->_orderDirection), $this->_limit, 0);\n\n if(!is_array($news) || empty($news)) {\n return 'You don\\'t have news yet.';\n }\n\n $this->_spaceContent = $spaceContent;\n foreach($news as $newsItem) {\n if(Tools_Security_Acl::isAllowed(Tools_Security_Acl::RESOURCE_ADMINPANEL)) {\n $spaceContent = '<input type=\"hidden\" class=\"news-list-hidden news-list-hidden-' . $newsItem->getId() . '\" />' . $this->_spaceContent;\n }\n $content .= preg_replace('~{\\$' . self::NEWS_WIDGET_NAME . ':(.+)}~uU', '{$' . self::NEWS_WIDGET_NAME . ':' . $newsItem->getPageId() . ':$1}', $spaceContent);\n }\n $parser = new Tools_Content_Parser($content, array());\n return $parser->parseSimple();\n }",
"function parseParameterValues($source) {\n\t$parameterValues = array();\n\t$parameter = preg_split(\"/<br>/\", $source); // get array from the source string\n\t\n\tfor ($i = 0; $i < count($parameter); $i++) {\n\t\t$parameter[$i] = preg_replace(\"/(<p)+[^<]+/\", \"\", $parameter[$i]); // rip off <p> tag\n\t\t$parameter[$i] = preg_replace(\"/<\\/p>/\", \"\", $parameter[$i]); // rip of </p> tag\n\t\t$list = preg_split(\"/=/\", $parameter[$i]);\n\t\t$paramName = $list[0]; // get parameter name\n\t\t$paramVal = $list[1]; // get parameter value\n\t\t\n\t\tif ($paramName != \"class\" && $paramName != \"method\" && $paramName != \"delay\" && $paramName != null) {\n\t\t\tarray_push($parameterValues, $paramVal); // push to the parameter value array;\n\t\t}\n\t}\n\t\n\tif (count($parameterValues) > 0) {\n\t\t$result = \"<param name=\\\"information\\\">\". join($parameterValues, \"^\") . \"</param>\"; // create parameter value string\n\t}\n\t\n\t/*\n\tforeach ($parameter as $item) {\n\t\techo $item;exit;\n\t\t\n\t\t\n\t\t$list = preg_split(\"/=/\", $item);\n\t\t$paramName = $list[0]; // get parameter name\n\t\t$paramVal = $list[1]; // get parameter value\n\t\t\n\t\tif (sizeof($parameter) > 0) {\n\t\t\t$result = $result;\n\t\t}\n\t\t\n\t\tif ($paramName != \"class\" && $paramName != \"method\") { // filter out non-parameter name\n\t\t\t\n\t\t}\n\t}*/\n\treturn $result;\n}",
"public function loadString($content);",
"function tidy_parse_string($input, $config = null, $encoding = null) {}",
"function parse_content( $content ) {\n\t\tif ( is_null( $content ) ) {\n\t\t\t$this->body = null;\n\t\t}\n\n\t\t$this->body = do_shortcode( $content );\n\t}",
"function parseText ($text) {\n return $this->parse($text);\n }",
"public function getParsedText($text) {\n\t\t$this->text = $text;\n\n\t\t$this->extractProtectedParts();\n\t\t$this->escape()->paragraphs()->lineBreaks();\n\t\t$this->restoreProtectedParts();\n\n\t\tReturn $this->text;\n\t}",
"public function get_input_content();",
"function myParse($text) {\n\t$results = array();\n\t$rc = 0;\n\n\tfor($i=0; $i<strlen($text); $i++) {\n\t\t$c = substr($text, $i, 1);\n\n\t\tif ($c=='<') {\n\t\t\t// Starting tag\n\t\t\t$tagC = '';\n\t\t\t$tag = true;\n\t\t}\n\n\t\tif ($tag) {\n\t\t\t$tagC .= $c;\n\t\t} else {\n\t\t\tif ($c==\"\\n\") {\n\t\t\t\t// Advance the counter so each line is stored separately \n\t\t\t\tif (empty($_SESSION['para'])) { \n\t\t\t\t\t$rc++;\n\t\t\t\t} else {\t\t\t\t\t\n\t\t\t\t\tif (!isset($results[$rc])) {\n\t\t\t\t\t\t// Get position of New editable text\n\t\t\t\t\t\t$results[$rc] = array('index'=>$i, 'text'=>'');\n\t\t\t\t\t}\n\t\t\t\t\t$results[$rc]['text'] .= $c;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!isset($results[$rc])) {\n\t\t\t\t\t// Get position of New editable text\n\t\t\t\t\t$results[$rc] = array('index'=>$i, 'text'=>'');\n\t\t\t\t}\n\t\t\t\t$results[$rc]['text'] .= $c;\n\t\t\t}\n\t\t}\n\t\tif ($c=='>') {\n\t\t\t// Tag ending\n\t\t\t$tagC .= $c;\n\t\t\t$tag = false;\n\t\t\t$rc++;\n\t\t}\n\t}\n\n\t// Filter editable text\n\t$resultsx = array();\n\tforeach($results as $resline) {\t\t\n\t\t$res = trim($resline['text']);\n\n\t\t// Skip empty, &xx; and literals \n\t\tif (!$res || ($res[0]=='&' && substr($res,-1)==';') || isLiteral($res) ) continue;\n\t\t\n\t\tif (!empty($_SESSION['para'])) {\n\t\t\t// trim \\n and adjust position\n\t\t\twhile(substr($resline['text'], 0, 1)==\"\\n\" || substr($resline['text'], 0, 1)==\"\\r\") {\n\t\t\t\t$resline['index']++;\n\t\t\t\t$resline['text'] = substr($resline['text'], 1);\n\t\t\t}\n\t\t\t// recheck \\n \n\t\t\tif (!strstr($resline['text'], \"\\n\")) {\n\t\t\t\t// treat as one line (trim and adjust)\n\t\t\t\twhile(substr($resline['text'], 0, 1)==' ') {\n\t\t\t\t\t$resline['index']++;\n\t\t\t\t\t$resline['text'] = substr($resline['text'], 1);\n\t\t\t\t}\n\t\t\t\t$resline['text'] = trim($resline['text']);\n\t\t\t}\n\t\t\t$res = $resline['text'];\n\t\t} else {\n\t\t\t// trim and adjust position\n\t\t\twhile(substr($resline['text'], 0, 1)==' ') {\n\t\t\t\t$resline['index']++;\n\t\t\t\t$resline['text'] = substr($resline['text'], 1);\n\t\t\t}\n\t\t\t$res = trim($resline['text']);\n\t\t}\n\t\t$resultsx[$resline['index']] = $res;\n\t}\n\n\t// Return an array contains all editable texts and their positions in file contents\n\treturn $resultsx;\n}",
"public function parse()// : void\n\t{\n\t\tforeach( $this -> options[ 'command' ] as $command => $params )\n\t\t{\n\t\t\t//- Parsing -//\n\t\t\t$result = null;\n\t\t\tpreg_match_all(\n\t\t\t\t$params[ 'regex' ], \n\t\t\t\t$this -> text, \n\t\t\t\t$result, \n\t\t\t\tPREG_PATTERN_ORDER\n\t\t\t);\n\n\t\t\t//- Set result -//\n\t\t\t$this -> value[ $command ] = array();\n\t\t\t$this -> errors[ $command ] = array();\n\t\t\tforeach( $params[ 'value' ] as $key => $index )\n\t\t\t{\n\t\t\t\tif( !isset( $result[ $index ][ 0 ] ) )\n\t\t\t\t{\n\t\t\t\t\t$this -> errors[ $command ][ $key ] = \"Command not valid\";//TODO: change\n\t\t\t\t\t\n\t\t\t\t\t$this -> valid = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//- Set value -//\n\t\t\t\t$this -> value[ $command ][ $key ] = $result[ $index ][ 0 ];\n\t\t\t}\t\t\t\n\t\t}\n\t}",
"public function parse( $text ) {\n\t\t$parts = explode( ' ', $text );\n\t\t$this->email = trim( array_pop( $parts ), '<>' );\n\t\t$this->name = implode( ' ', $parts );\n\t}",
"function _parse() {\n $file = $this->_get_file();\n $search = array();\n $replace = array();\n $i = 0;\n foreach($this->_keys as $key => $value) {\n $search[$i] = $value;\n $replace[$i] = $this->_vals[$key];\n if(is_object($replace[$i])) {\n $replace[$i] = $replace[$i]->get_string();\n }\n ++$i;\n }\n return str_replace($search, $replace, $file);\n }",
"function process_content( string $str ): string {\n\t$str = apply_filters( 'the_content', $str ); // Shortcodes are expanded here.\n\t$str = str_replace( ']]>', ']]>', $str );\n\treturn $str;\n}",
"function parseTemplateText()\r\n\t{\r\n\t\t$buf = '';\r\n\t\t// we only need this if we are going to use JSP tags for wrapping\r\n\t\t// scriptlet blocks\r\n\t\t//if ($this->reader->matches('<' . '\\\\%'))\r\n\t\t//{\r\n\t\t//\t$buf .= '<' . '%';\r\n\t\t//}\r\n\r\n\t\t$buf .= $this->reader->nextContent();\r\n\r\n\t\t// don't output meaningless whitespace\r\n\t\tif (trim($buf) == '')\r\n\t\t{\r\n\t\t\treturn '';\r\n\t\t}\r\n\t\telseif ($this->ctxt->options->isElIgnored() || strpos($buf, '${') === false)\r\n\t\t{\r\n\t\t\treturn $buf;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn '<?php echo $pageContext->evaluateTemplateText(' . StringUtils::quote($buf) . ');?>';\r\n\t\t}\r\n\t}",
"private function parseContentInOldFormat(){\n\t\t $contentArray = explode(FieldContentInAgenda::SPLIT_CHARACTER, $this->filedContent);\n\t\t if(EducationalUtil::isRoleTypeTheme($this->roleType, $this->roleNamesObj)){\n\t\t \t$this->formattedStr = $this->filedContent;\n\t\t } elseif(EducationalUtil::isRoleTypeCC($this->roleType, $this->roleNamesObj)){ \n\t\t\t$this->isMember = $this->isStartedWithMemberTag($contentArray[0]);\t\n\t\t\t$this->name = $contentArray[1];\n\t\t\t$this->memberLevel = $contentArray[2];\n\t\t\t\n\t\t\tif($this->isMember){\n\t\t\t\t$this->ccclLevel = $contentArray[3];\n\t\t\t\t$this->projectNo = $contentArray[4];\n\t\t\t} else {\n\t\t\t\t$this->clubName = $contentArray[3];\n\t\t\t\t$this->ccclLevel = $contentArray[4];\n\t\t\t\t$this->projectNo = $contentArray[5];\n\t\t\t}\n\t\t\t\n\t\t\t$this->formattedStr = $this->getFormattedPrintedStrForCCCL();\n\t\t\t\n\t\t } else {\n\t\t\t$this->isMember = $this->isStartedWithMemberTag($contentArray[0]);\n\t\t\t$this->name = $contentArray[1];\n\t\t\t$this->memberLevel = $contentArray[2];\n\t\t\t\n\t\t\tif(!$this->isMember){\n\t\t\t\t$this->clubName = $contentArray[3];\n\t\t\t}\n\t\t\t\n\t\t\t$this->formattedStr = $this->getFormattedPrintedStrForNOCCCL();\n\t\t }\n\t }",
"public function getTextContent();",
"function Process($parser, $text, $data)\r\n\t{\r\n\t\tob_start();\r\n\t\teval($data);\r\n\t\t$obj = &$this->GetCurrentObject();\r\n\t\t$obj->out .= ob_get_contents();\r\n\t\tob_end_clean();\r\n\t}",
"function process($content='', $type='', $conf=array())\t{\n\n\t\t$this->out='';\n\t\tif (!$content) {\n\t\t\t$content = $this->getInput();\n\t\t}\n\t\tif ($content) {\n\t\t\t\t// remove words in uppercase which seems to confuse TextCat\n\t\t\t$content = preg_replace('#\\b[A-Z]{2,}\\b#', ' ', $content);\n\n\t\t\t$this->setInput ($content, $type);\n\t\t}\n\n\t\tif($inputFile = $this->getInputFile()) {\n\n\t\t\t$cmd = t3lib_exec::getCommand('perl');\n\t\t\t$cmd.=' '.t3lib_extMgm::extPath('cc_textcat').'textcat/text_cat.pl';\n\t\t\t$cmd.=' -d '.t3lib_extMgm::extPath('cc_textcat').'textcat/LM/';\n\t\t\t$cmd.=' 2>&1';\n\t\t\t$cmd.=' <'.$inputFile;\n\t\t\tif ($fpw = @popen ($cmd, 'r')) {\n\n\t\t\t\t$read=@fread($fpw, 200);\n\t\t\t\t@pclose($fpw);\n\n\t\t\t\t$lang = explode(' or ',$read);\n\t\t\t\t$lang = explode('-',$lang[0]);\n\t\t\t\t$lang = $lang[0];\n\t\t\t}\n\n\t\t\tif(strlen($lang)==2) {\n\t\t\t\t$this->out=$lang;\n\t\t\t} else {\n\t\t\t\t$this->out=FALSE; // no iso code - better set to false\n\t\t\t}\n\n\t\t} else {\n\t\t\t$this->errorPush(T3_ERR_SV_NO_INPUT, 'No or empty input.');\n\t\t}\n\n\t\treturn $this->getLastError();\n\t}",
"private function parse($text)\n {\n // Parse iteration ({Each}..{/Each})\n $callback = array($this, 'iterationCallback');\n \n foreach($this->values as $key => $value)\n {\n // Check the type\n if(!is_array($value))\n {\n // Only allow array types here.\n continue;\n }\n\n $text = preg_replace_callback('/{Each:\\s*(' . $key . ')\\s+as\\s+([\\d\\w.]+)}(.+?)' . \n '{\\/Each: ' . $key . '}/s',\n $callback, $text);\n }\n \n // First search for simple values\n $callback = array($this, 'simpleValueCallback');\n \n // Define the tag format to use for smart tags\n $smartTagPrefix = $this->smartTags ? '<!--\\s*' : '';\n $smartTagSuffix = $this->smartTags ? '\\s*-->' : '';\n \n // Parse simple values\n $text = preg_replace_callback('/' . $smartTagPrefix . '{(QRCode|String|Integer|Decimal):\\s(' . \n '[\\d\\w.\\'\\s\\-]+)((\\s[\\d\\w]+=[\\d\\w.]+)*)}' . $smartTagSuffix . '/',\n $callback, $text);\n \n \n // Load any special tags that are undefinable by the model\n $text = preg_replace_callback('/' . $smartTagPrefix . '{(Subview):\\s(' . \n '[\\d\\w]+)((\\s[\\d\\w]+=[\\d\\w.]+)*)}' . $smartTagSuffix . '/',\n $callback, $text);\n\n // Search for conditionals\n $callback = array($this, 'conditionalCallback');\n $text = preg_replace_callback('/{If:\\s*(([\\w\\'\\d.\\-]+)\\s*(==|>|<|>=|<=|in|%|<>)\\s*([\\w\\'\\d.\\-]+))}(.+?)' . \n '{\\/If:\\s*\\\\1}/s',\n $callback, $text);\n \n \n return $text;\n }",
"public function parse($content)\n {\n global $post_id;\n global $page_id;\n\n // check CMS type and version\n $this->checkCMS();\n\n $id = defined('PAGE_ID') ? PAGE_ID : $page_id;\n\n // collect the main information about CMS, page and user\n $parse = array(\n 'cms' => array(\n 'type' => self::$cms_type,\n 'version' => self::$cms_version,\n 'locale' => strtolower(LANGUAGE),\n 'page_id' => ($id > 0) ? $id : -1,\n 'page_url' => ($id > 0) ? $this->getURLbyPageID($id) : $this->getCurrentPageURL(),\n 'page_visibility' => VISIBILITY,\n 'remove_commands' => ($id == 0),\n 'user' => array(\n 'id' => (isset($_SESSION['USER_ID'])) ? $_SESSION['USER_ID'] : -1,\n 'name' => (isset($_SESSION['USERNAME'])) ? $_SESSION['USERNAME'] : '',\n 'email' => (isset($_SESSION['EMAIL'])) ? $_SESSION['EMAIL'] : ''\n ),\n 'special' => array(\n 'post_id' => (!is_null($post_id) || defined('POST_ID')) ? defined('POST_ID') ? POST_ID : $post_id : null,\n 'topic_id' => defined('TOPIC_ID') ? TOPIC_ID : null\n )\n ),\n 'GET' => $_GET,\n 'POST' => $_POST,\n 'content' => $content,\n );\n\n $options = array(\n CURLOPT_POST => true,\n CURLOPT_HEADER => false,\n CURLOPT_URL => WB_URL.'/kit2/kit_parser',\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_POSTFIELDS => http_build_query(array('parse' => $parse), '', '&'),\n CURLOPT_SSL_VERIFYHOST => false,\n CURLOPT_SSL_VERIFYPEER => false\n );\n // use the connection multiple times by using a cookie to identify\n if (!isset($_SESSION['KIT2_COOKIE_FILE']) || !file_exists($_SESSION['KIT2_COOKIE_FILE'])) {\n $_SESSION['KIT2_COOKIE_FILE'] = WB_PATH.'/kit2/temp/session/'.uniqid('outputfilter_');\n $options[CURLOPT_COOKIEJAR] = $_SESSION['KIT2_COOKIE_FILE'];\n }\n else {\n $options[CURLOPT_COOKIEFILE] = $_SESSION['KIT2_COOKIE_FILE'];\n }\n\n $ch = curl_init();\n curl_setopt_array($ch, $options);\n\n if (false === ($content = curl_exec($ch))) {\n trigger_error(curl_error($ch), E_USER_ERROR);\n }\n curl_close($ch);\n return $content;\n }",
"public function parse()\n\t{\n\t\t$this->parseGroups();\n\t\t$this->parseBadges();\n\t}",
"private function parseContentInNewFormat(){\n\t\t $contentArray = explode(FieldContentInAgenda::SPLIT_CHARACTER, $this->filedContent);\n\t\t \n\t\t if(EducationalUtil::isRoleTypeTheme($this->roleType, $this->roleNamesObj)){\n\t\t \t$this->formattedStr = $this->filedContent;\n\t\t } elseif(EducationalUtil::isRoleTypeCCorCL($this->roleType, $this->roleNamesObj)){\n\t\t\t\n\t\t\t$this->isMember = $this->isStartedWithMemberTag($contentArray[0]);\t\t\t\n\t\t\t$this->id = $contentArray[1];\n\t\t\t$this->name = $contentArray[2];\n\t\t\t$this->memberLevel = $contentArray[3];\n\t\t\t$this->ccclLevel = $contentArray[4];\n\t\t\t$this->projectNo = $contentArray[5];\n\t\t\t\n\t\t\tif(!$this->isMember){\n\t\t\t\t$this->clubIndex = $contentArray[6];\n\t\t\t\t$this->clubName = $this->getClubShortNameByIndex();\n\t\t\t}\n\t\t\t\n\t\t\t$this->formattedStr = $this->getFormattedPrintedStrForCCCL();\n\n\t\t } else {\n\t\t\tif(EducationalUtil::isRoleTypePresident($this->roleType, $this->roleNamesObj)){\n\t\t\t\t$NUM_OF_PIECES_FOR_PRESIDENT = 4;\n\t\t\t\tif(count($contentArray) != $NUM_OF_PIECES_FOR_PRESIDENT){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->isMember = $this->isStartedWithMemberTag($contentArray[0]);\n\t\t\t$this->id = $contentArray[1];\n\t\t\t$this->name = $contentArray[2];\n\t\t\t$this->memberLevel = $contentArray[3];\n\t\t\t\n\t\t\tif(!$this->isMember){\n\t\t\t\t$this->clubIndex = $contentArray[4];\n\t\t\t\t$this->clubName = $this->getClubShortNameByIndex();\n\t\t\t}\n\t\t\t\n\t\t\t$this->formattedStr = $this->getFormattedPrintedStrForNOCCCL();\n\t\t }\n\t }",
"public function getParseTree( $text ) {\n\t\tglobal $wgVisualEditorParserCmd, $wgServer, $wgScriptPath;\n\n\t\t// TODO This is probably not very portable to non-Unix OS. There's a lot of code in wfShellExec to make\n\t\t// that portable and secure on Windows etc. In any case the existing PHP-based parser calls out to an external script to do \n\t\t// HTML-tidy anyway, in a similar manner, without any shell escapes...\n\t\t$cmd = join( \" \", array( \n\t\t\t$wgVisualEditorParserCmd, \n\t\t\t'--wgScriptPath', wfEscapeShellArg( $wgServer . $wgScriptPath ),\n\t\t) );\n\n\t\t$parserIn = 0;\n\t\t$parserOut = 1;\n\t\t$parserErr = 2;\n\n\t\t$descriptorSpec = array(\n\t\t\t$parserIn => array( 'pipe', 'r' ), // child reads from stdin, we write\n\t\t\t$parserOut => array( 'pipe', 'w' ), // child writes to stdout, we read\n\t\t\t$parserErr => array( 'pipe', 'w' ) // child writes to stderr, we read\n\t\t);\n\n\t\t$pipes = array();\n\n\t\t$process = proc_open( $cmd, $descriptorSpec, $pipes );\n\n\t\t$ret = array( 'contents' => null );\n\n\t\tif ( is_resource( $process ) ) {\n\t\t\t// Theoretically, this style of communication could cause a deadlock\n\t\t\t// here. If the stdout buffer fills up, then writes to stdin could\n\t\t\t// block. \n\t\t\t//\n\t\t\t// TODO This might be an opportune time to give the parser all the subtemplates it's going to need,\n\t\t\t// such that we can. The DB does have a mapping of title to templates used.\n\t\t\t// Would need a convention for indicating multiple files in the text we write to the parser, like mime multipart\n\t\t\tfwrite( $pipes[$parserIn], $text );\n\t\t\tfclose( $pipes[$parserIn] );\n\t\t\n\t\t\t$ret['contents'] = FormatJson::decode( self::readFilehandle( $pipes[$parserOut] ) );\n\n\t\t\t$errors = self::readFilehandle( $pipes[$parserErr] );\n\t\t\tif ( $errors != '' and $errors != null ) {\n\t\t\t\t$ret['errors'] = $errors;\n\t\t\t}\n\n\t\t\t$retval = proc_close( $process );\n\t\t\tif ( $retval != 0 ) {\n\t\t\t\twfWarn( \"Parser process returned $retval\" );\n\t\t\t\tif ( !$ret['errors'] ) {\n\t\t\t\t\t$ret['errors'] = 'External parser process returned error code, check server logs';\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\twfWarn( \"Unable to start external parser process\" );\n\t\t\t$ret['errors'] = \"Unable to start external parser process, check server logs\";\n\t\t}\n\n\t\treturn $ret;\n\t}",
"function _parse($tags,$values,$text) {\n\t\tfor ($i = 0; $i<sizeof($tags); $i++) {\n\t\t\t\t$text = str_replace($tags[$i],$values[$i],$text);\n\t\t\t}\n\t\treturn $text;\n\t}",
"abstract protected function parse($data);",
"public function parse(array &$tokens) {\n\t\t$token = current($tokens);\n\t\t$this->content = substr($token['value'], 4, -3);\n\t}",
"public function extract($content);",
"public function getParsedContent()\n {\n return oxUtilsView::getInstance()->parseThroughSmarty( $this->getContent()->oxcontents__oxcontent->value, $this->getContent()->getId() );\n }",
"protected function parse(): void\n {\n parent::parse();\n $this->template->assign('dataGrid', (string) $this->dataGrid->getContent());\n }",
"protected function extract($content) {\n\t\t// load the content\n\t\t$content = $this->load ( $content );\n\t\t\n\t\t// initialize array that will contain all strings found in the code\n\t\t$strings = array ();\n\t\t$comments = array ();\n\t\t\n\t\t// loop all characters\n\t\tfor($i = 0; $i < strlen ( $content ); $i ++) {\n\t\t\t$character = $content [$i];\n\t\t\t\n\t\t\tswitch ($content [$i]) {\n\t\t\t\t// string demarcation: ' or \"\n\t\t\t\tcase '\\'' :\n\t\t\t\tcase '\"' :\n\t\t\t\t\t$stringOpener = $character;\n\t\t\t\t\t$string = $character;\n\t\t\t\t\t\n\t\t\t\t\t// process through content until we find the end of the\n\t\t\t\t\t// string\n\t\t\t\t\tfor($j = $i + 1; $j < strlen ( $content ); $j ++) {\n\t\t\t\t\t\t$character = $content [$j];\n\t\t\t\t\t\t$previousCharacter = isset ( $content [$j - 1] ) ? $content [$j - 1] : '';\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Find end of string: - string started with double\n\t\t\t\t\t\t * quotes ends in double quotes, likewise for single\n\t\t\t\t\t\t * quotes. - unterminated string ends at newline (bad\n\t\t\t\t\t\t * code), unless newline is escaped (though nobody knows\n\t\t\t\t\t\t * this.)\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (($stringOpener == $character && $previousCharacter != '\\\\') || (in_array ( $character, array (\n\t\t\t\t\t\t\t\t\"\\r\",\n\t\t\t\t\t\t\t\t\"\\n\" \n\t\t\t\t\t\t) ) && $previousCharacter != '\\\\')) {\n\t\t\t\t\t\t\t// save string\n\t\t\t\t\t\t\t$replacement = '[MINIFY-STRING-' . count ( $strings ) . ']';\n\t\t\t\t\t\t\t$strings [$replacement] = substr ( $content, $i, $j - $i + 1 );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// replace string by stub\n\t\t\t\t\t\t\t$content = substr_replace ( $content, $replacement, $i, $j - $i + 1 );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// reset pointer to the end of this string\n\t\t\t\t\t\t\t$i += strlen ( $replacement );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t// comment demarcation: // or /*\n\t\t\t\tcase '/' :\n\t\t\t\t\t$commentOpener = $character . (isset ( $content [$i + 1] ) ? $content [$i + 1] : '');\n\t\t\t\t\t\n\t\t\t\t\t/*\n\t\t\t\t\t * Both comment opening tags are 2 characters, so grab the\n\t\t\t\t\t * next character and verify we're really opening a comment\n\t\t\t\t\t * here.\n\t\t\t\t\t */\n\t\t\t\t\tif (in_array ( $commentOpener, array (\n\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// process through content until we find the end of the\n\t\t\t\t\t\t// comment\n\t\t\t\t\t\tfor($j = $i + 1; $j < strlen ( $content ); $j ++) {\n\t\t\t\t\t\t\t$character = $content [$j];\n\t\t\t\t\t\t\t$previousCharacter = isset ( $content [$j - 1] ) ? $content [$j - 1] : '';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t * Find end of comment: - // single line comments\n\t\t\t\t\t\t\t * end at newline. - /* multiline comments and at\n\t\t\t\t\t\t\t * their respective closing tag, which I can't use\n\t\t\t\t\t\t\t * here or it'd end this very comment.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif (($commentOpener == '//' && in_array ( $character, array (\n\t\t\t\t\t\t\t\t\t\"\\r\",\n\t\t\t\t\t\t\t\t\t\"\\n\" \n\t\t\t\t\t\t\t) )) || ($commentOpener == '/*' && $previousCharacter . $character == '*/')) {\n\t\t\t\t\t\t\t\t// save comment\n\t\t\t\t\t\t\t\t$replacement = '[MINIFY-COMMENT-' . count ( $comments ) . ']';\n\t\t\t\t\t\t\t\t$comments [$replacement] = substr ( $content, $i, $j - $i + 1 );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// replace comment by stub\n\t\t\t\t\t\t\t\t$content = substr_replace ( $content, $replacement, $i, $j - $i + 1 );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// reset pointer to the end of this string\n\t\t\t\t\t\t\t\t$i += strlen ( $replacement );\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\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn array (\n\t\t\t\t$content,\n\t\t\t\t$strings,\n\t\t\t\t$comments \n\t\t);\n\t}",
"function _parse($str)\n\t{\n\t\t$vars = func_get_args();\n\t\tarray_shift($vars);\n\t\t$str = _($str);\n\t\tob_start();\n\t\tvprintf($str, $vars);\n\t\t$str = ob_get_contents();\n\t\tob_end_clean();\n\t\treturn $str;\n\t}",
"function processContent(string $content): string\n{\n $content = processShortcodes($content);\n return Michelf\\Markdown::defaultTransform($content);\n}",
"public\n function metabolize( $content )\n {\n $args = func_get_args();\n list($continue, $this->injection_post) = $this->get_injection_post($args);\n if ( ! $continue ) {\n return $content;\n }\n if ( ! $this->injection_author_can(EnzymesCapabilities::inject) ) {\n return $content;\n }\n if ( ! $this->there_is_an_injection($content, $matches) ) {\n return $content;\n }\n $this->new_content = '';\n do {\n $before = $this->value($matches, 'before');\n $could_be_sequence = $this->value($matches, 'could_be_sequence');\n $after = $this->value($matches, 'after');\n $escaped_injection = '{' == substr($before, -1); // \"{{[ .. ]}\"\n if ( $escaped_injection ) {\n $result = '{[' . $could_be_sequence . ']}'; // do not unescape now, version 2 will do it later...\n } else {\n $result = $this->process($could_be_sequence);\n }\n $this->new_content .= $before . $result;\n } while ($this->there_is_an_injection($after, $matches));\n $result = $this->new_content . $after;\n\n return $result;\n }",
"private function get_content()\n {\n $input_char = '';\n $content = array();\n $space = false; //if a space is needed\n\n while (isset($this->input[$this->pos]) && $this->input[$this->pos] !== '<') {\n \n if ($this->pos >= $this->input_length) {\n return count($content) ? implode('', $content) : array('', 'TK_EOF');\n }\n\n if ($this->traverse_whitespace()) {\n if (count($content)) {\n $space = true;\n }\n continue; //don't want to insert unnecessary space\n }\n\n $input_char = $this->input[$this->pos];\n $this->pos++;\n\n if ($space) {\n if ($this->line_char_count >= $this->options['wrap_line_length']) { //insert a line when the wrap_line_length is reached\n $this->print_newline(false, $content);\n $this->print_indentation($content);\n } else {\n $this->line_char_count++;\n $content[] = ' ';\n }\n $space = false;\n }\n $this->line_char_count++;\n $content[] = $input_char; //letter at-a-time (or string) inserted to an array\n }\n \n return count($content) ? implode('', $content) : '';\n }",
"function my_formatter($content)\n{\n $new_content = '';\n $pattern_full = '{(\\[raw\\].*?\\[/raw\\])}is';\n $pattern_contents = '{\\[raw\\](.*?)\\[/raw\\]}is';\n $pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE);\n\n foreach ($pieces as $piece) {\n if (preg_match($pattern_contents, $piece, $matches)) {\n $new_content .= $matches[1];\n } else {\n $new_content .= wptexturize(wpautop($piece));\n }\n }\n\n return $new_content;\n}",
"private function _processContents()\r\n {\r\n $contents = \"\";\r\n foreach ($this->_bagBody->objects as $obj) {\r\n $isInfoKey = false;\r\n foreach ($this->_aryInfoKeys as $infoKey)\r\n if ($infoKey == $obj['key'])\r\n $isInfoKey = true;\r\n \r\n if ($obj['probableText'] == true && !$isInfoKey)\r\n $contents .= $obj['contents'];\r\n } \r\n $this->_contents = $contents;\r\n }",
"protected function str_to_component( $content ) {\n\t\tif ( strpos( $content, ':' ) !== false ) {\n\t\t\tif ( ( preg_match( '/[\\s]*(.+)[\\s]*:[\\s]*(.+)[\\s]*/ui', $content, $matches ) ) ) {\n\t\t\t\t$matches[1] = trim( $matches[1] );\n\t\t\t\t$matches[2] = trim( $matches[2] );\n\t\t\t\tif ( $matches[1] AND $matches[2] !== '' ) {\n\n\t\t\t\t\t// Override default values\n\t\t\t\t\t$i = 0;\n\t\t\t\t\t$used = false;\n\t\t\t\t\tforeach ( $this->component as $component ) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t( strtolower( $component['name'] ) == strtolower( $matches[1] ) ) AND\n\t\t\t\t\t\t\t( strpos( strtolower( $matches[2] ), 'group end' ) === false ) AND\n\t\t\t\t\t\t\t( strpos( strtolower( $matches[2] ), 'ooto end' ) === false )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t$this->component[$i]['val'] = $matches[2];\n\t\t\t\t\t\t\t$used = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t++$i;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !$used ) {\n\t\t\t\t\t\tif ( strpos( $matches[1], ' OPTION' ) !== false ) {\n\n\t\t\t\t\t\t\t// (Some Text) '(1)' OPTION '(name of option)'\n\t\t\t\t\t\t\tif ( ( preg_match( '/(.+)\\s+\\'(\\d+)\\'\\s+OPTION\\s+\\'(.+)\\'[\\s]*/ui', $matches[1], $matches_option ) ) ) {\n\t\t\t\t\t\t\t\t$i = $this->position_of_param( $matches_option[1] );\n\t\t\t\t\t\t\t\tif ( $i !== false ) {\n\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t!isset( $this->component[$i]['options'][$matches_option[2]]['options'] ) or\n\t\t\t\t\t\t\t\t\t\t!is_array( $this->component[$i]['options'][$matches_option[2]]['options'] )\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t$this->component[$i]['options'][$matches_option[2]]['options'] = array();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$this->component[$i]['options'][$matches_option[2]]['options'][$matches_option[3]] = $matches[2];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// (Some Text) OPTION '(name of option)'\n\t\t\t\t\t\t\t} elseif ( ( preg_match( '/(.+)\\s+OPTION\\s+\\'(.+)\\'[\\s]*/ui', $matches[1], $matches_option ) ) ) {\n\t\t\t\t\t\t\t\t$i = $this->position_of_param( $matches_option[1] );\n\t\t\t\t\t\t\t\tif ( $i !== false ) {\n\t\t\t\t\t\t\t\t\tif ( !isset( $this->component[$i]['options'] ) or !is_array( $this->component[$i]['options'] ) ) {\n\t\t\t\t\t\t\t\t\t\t$this->component[$i]['options'] = array();\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$this->component[$i]['options'][$matches_option[2]] = $matches[2];\n\n\t\t\t\t\t\t\t\t\tif ( strtolower( $this->component[$i]['val'] ) == 'ooto tab' ) {\n\t\t\t\t\t\t\t\t\t\t$this->component[$i]['options']['i'] = $this->tab_position_in_ooto( $matches[2] );\n\t\t\t\t\t\t\t\t\t\t$this->tab_ooto( $matches[2], $matches_option[1] );\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} else {\n\n\t\t\t\t\t\t\t// (Some Text) '(1)'\n\t\t\t\t\t\t\tif ( ( preg_match( '/(.+)\\s+\\'(\\d+)\\'/ui', $matches[1], $matches_option ) ) ) {\n\t\t\t\t\t\t\t\t$i = $this->position_of_param( $matches_option[1] );\n\t\t\t\t\t\t\t\tif ( $i !== false ) {\n\t\t\t\t\t\t\t\t\tif ( !isset( $this->component[$i]['options'] ) or !is_array( $this->component[$i]['options'] ) ) {\n\t\t\t\t\t\t\t\t\t\t$this->component[$i]['options'] = array();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( !isset( $this->component[$i]['options'][$matches_option[2]] ) or !is_array( $this->component[$i]['options'][$matches_option[2]] ) ) {\n\t\t\t\t\t\t\t\t\t\t$this->component[$i]['options'][$matches_option[2]] = array();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$this->component[$i]['options'][$matches_option[2]]['val'] = $matches[2];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// (Some Text)\n\t\t\t\t\t\t\t\tarray_push( $this->component, array( 'name' => $matches[1], 'val' => $matches[2] ) );\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\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"protected function _getParser() {}",
"public function main($content, $conf = NULL) {\n\t\treturn $this->parse($content, $conf);\n\t}",
"function parse()\n {\n $params=$this->layoutManager->getPluginParams(\"L\");\n $tLang=$params[\"lang\"];\n $el=$this->getSubElements();\n $id=$el[\"ID\"][\"text\"];\n $textNode=$el[\"C\"][\"node\"];\n $layoutContents=$textNode->contents;\n $nContents=count($layoutContents);\n if($nContents==0)\n return;\n\n $curVar=1;\n $phpCode=array();\n $newContents=array();\n $currentNode=array(\"TYPE\"=>\"HTML\",\"TEXT\"=>\"\");\n $newContents[]=$currentNode;\n /* Supongamos una lista de layoutContents del tipo HTML - PHP - HTML : ej: a <?php echo \"p\";?> b\n * Para buscar la traduccion, hay que actuar como si fuera 1 solo layoutContent de tipo a %1 b\n * Por eso, el resultado debe ser 1 solo layoutcontent de tipo HTML, aunque dentro, contenga codigo php.\n * \n */\n $html=\"\";\n for($k=0;$k<$nContents;$k++)\n { \n if($layoutContents[$k][\"TYPE\"]==\"HTML\")\n {\n $html.=$layoutContents[$k][\"TEXT\"];\n }\n else\n {\n if($layoutContents[$k][\"TYPE\"]==\"PHP\")\n {\n $html.=\"{%\".$curVar.\"}\";\n $phpCode[$curVar]=$layoutContents[$k][\"TEXT\"];\n $curVar++;\n }\n else\n {\n // Se traduce el nodo HTML actual\n $currentNode[\"TEXT\"]=$this->parseTranslation($tLang,$id,$phpCode,$html);\n // Se copia el nodo que hemos encontrado, tal cual (no es ni PHP ni HTML)\n $newContents[]=$layoutContents[$k];\n // Se crea el siguiente nodo HTML.\n $currentNode=array(\"TYPE\"=>\"HTML\",\"TEXT\"=>\"\");\n $newContents[]=$currentNode;\n $html=\"\";\n $phpCode=array();\n $curVar=1;\n }\n \n }\n } \n // Al llegar aqui, nos queda el ultimo nodo HTML creado.Hay que parsearlo.\n $currentNode[\"TEXT\"]=$this->parseTranslation($tLang,$id,$phpCode,$html);\n return $newContents;\n }",
"function main($content, $conf) {\r\n\t\t$titleParsed = str_replace(' ', '-', $conf['title']); \r\n\t\treturn $titleParsed;\r\n\t}",
"function main($content,$conf)\t{\n\t\t$this->conf=$conf;\n\t\t$this->pi_setPiVarDefaults();\n\t\t$this->pi_loadLL();\n\t\t$this->pi_initPIflexForm(); // Einmal am Anfang der Klasse\n $this->gp = $_GET[$this->extKey];\n // Service einbinden\n require_once(t3lib_extMgm::siteRelPath('yuieditor').'sv1/class.tx_yuieditor_sv1.php');\n $this->yui = t3lib_div::makeInstance('tx_yuieditor_sv1');\n // Flexform values\n $this->code = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'bereich', 'sDEF');\n\n // Processing...\n\t $this->yui->renderEditor('test');\n\t $content = '<textarea id=\"test\">test</textarea>';\n\t\treturn $this->pi_wrapInBaseClass($content);\n\t}",
"public function testContentParsing() {\n\n require_once __DIR__ . '/../../../../wp-load.php';\n\n $content = file_get_contents(__DIR__ . '/testResources/content.html');\n $filterKeywords = array(\n 'whiteList' => array('pagemaker'),\n 'blackList' => array('desktop')\n );\n $filterMode = 'white_list';\n $contentParser = new Content();\n echo $parsedContent = $contentParser->convertContent($content, $filterKeywords, $filterMode);\n }",
"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}",
"function parseHTML(){\n\t\t$code = preg_replace_callback('~(href|src|codebase|url|action)\\s*=\\s*([\\'\\\"])?(?(2) (.*?)\\\\2 | ([^\\s\\>]+))~isx',array('self','parseExtURL'),$this->source);\n\t\t$code = preg_replace_callback('~(<\\s*style.*>)(.*)<\\s*/\\s*style\\s*>~iUs',Array('self','parseCSS'),$code);\n\t\t$code = preg_replace_callback('~(style\\s*=\\s*)([\\'\\\"])(.*)\\2~iUs',Array('self','parseStyle'),$code);\n\t\t$code = preg_replace_callback('~<script(\\s*.*)>(.*)<\\s*/\\s*script>~iUs',Array('self','parseScriptTag'),$code);\n\t\t$this->output = $code;\n\t}",
"public function parse()\n {\n $contents = file_get_contents($this->uploadPath);\n if ($contents === false)\n {\n throw new Exception(\"SYSTEM: Can't read temp file\");\n }\n\n $comments = array();\n $css = array();\n $fontFamilies = array();\n $colors = array();\n\n // store and remove comments - found this regex on official CSS 2.1 spec page\n preg_match_all('|\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\/|',$contents, $comments, PREG_SET_ORDER);\n $contents = preg_replace('|\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\/|','',$contents);\n\n // strip newlines\n $contents = preg_replace('/\\n/','',$contents);\n\n // can't take credit for this regex, found on stackexchange\n preg_match_all('/([^{]+)\\s*\\{\\s*([^}]+)\\s*}/',$contents, $css, PREG_SET_ORDER);\n\n // also can't take credit for this regex\n preg_match_all('/font-family\\s*?:.*?(;|(?=\"\"|\\'|;))/',$contents, $fontFamilies, PREG_SET_ORDER);\n\n // a couple more random data points\n preg_match_all('/color\\s*?:.*?(;|(?=\"\"|\\'|;))/',$contents, $colors, PREG_SET_ORDER);\n\n\n $this->parsedData['comments'] = $comments;\n $this->parsedData['css'] = $css;\n $this->parsedData['font_families'] = $fontFamilies;\n $this->parsedData['colors'] = $colors;\n\n }",
"public static function parse($text) : string\n\t{\n\t\tforeach(self::$schema as $code => $html)\n\t\t\t$text = str_replace($code, $html, $text);\n\n\t\treturn $text;\n\t}",
"function parse($data = \"\") {\n // bold, italic, h2 (Название)\n $data = preg_replace(\"/<span class=rvts78>(.+?)\\s?<\\/span>/i\",\"##**_$1_**\",$data);\n // bold. h3 (коротко)\n $data = preg_replace(\"/<span class=rvts23>(.+?)\\s?<\\/span>/i\",\"###**$1**\",$data);\n // bold (Статья)\n $data = preg_replace(\"/<span class=rvts(?:9|44)>(.+?)\\s?<\\/span>/i\",\"**$1**\",$data);\n // bold h4 (Раздел)\n $data = preg_replace(\"/<span class=rvts15>(.+?)\\s?<\\/span>/i\",\"####**$1**\",$data);\n\n $container = $data;\n\n $container = strip_tags($container);\n $container = preg_replace(\"/ /s\",\" \",$container);\n $container = preg_replace(\"/(\\r\\n|\\n|\\r)+/s\",\"\\n\\n\",$container);\n return trim($container);\n}",
"function render($format = 'Xhtml')\n {\n // the rendering method we're going to use from each rule\n $format = ucwords(strtolower($format));\n \n // the eventual output text\n $output = '';\n \n // when passing through the parsed source text, keep track of when\n // we are in a delimited section\n $in_delim = false;\n \n // when in a delimited section, capture the token key number\n $key = '';\n \n // load the format object\n $this->loadFormatObj($format);\n \n // pre-rendering activity\n if (is_object($this->formatObj[$format])) {\n $output .= $this->formatObj[$format]->pre();\n }\n \n // load the render objects\n foreach (array_keys($this->parseObj) as $rule) {\n $this->loadRenderObj($format, $rule);\n }\n \n // pass through the parsed source text character by character\n $k = strlen($this->source);\n for ($i = 0; $i < $k; $i++) {\n \n // the current character\n $char = $this->source{$i};\n \n // are alredy in a delimited section?\n if ($in_delim) {\n \n // yes; are we ending the section?\n if ($char == $this->delim) {\n \n // yes, get the replacement text for the delimited\n // token number and unset the flag.\n $key = (int)$key;\n $rule = $this->tokens[$key][0];\n $opts = $this->tokens[$key][1];\n $output .= $this->renderObj[$rule]->token($opts);\n $in_delim = false;\n \n } else {\n \n // no, add to the dlimited token key number\n $key .= $char;\n \n }\n \n } else {\n \n // not currently in a delimited section.\n // are we starting into a delimited section?\n if ($char == $this->delim) {\n // yes, reset the previous key and\n // set the flag.\n $key = '';\n $in_delim = true;\n } else {\n // no, add to the output as-is\n $output .= $char;\n }\n }\n }\n \n // post-rendering activity\n if (is_object($this->formatObj[$format])) {\n $output .= $this->formatObj[$format]->post();\n }\n \n // return the rendered source text.\n return $output;\n }\n \n \n /**\n * \n * Returns the parsed source text with delimited token placeholders.\n * \n * @access public\n * \n * @return string The parsed source text.\n * \n */\n \n function getSource()\n {\n return $this->source;\n }\n \n \n /**\n * \n * Returns tokens that have been parsed out of the source text.\n * \n * @access public\n * \n * @param array $rules If an array of rule names is passed, only return\n * tokens matching these rule names. If no array is passed, return all\n * tokens.\n * \n * @return array An array of tokens.\n * \n */\n \n function getTokens($rules = null)\n {\n if (is_null($rules)) {\n return $this->tokens;\n } else {\n settype($rules, 'array');\n $result = array();\n foreach ($this->tokens as $key => $val) {\n if (in_array($val[0], $rules)) {\n $result[] = $val;\n }\n }\n return $result;\n }\n }\n \n \n /**\n * \n * Add a token to the Text_Wiki tokens array, and return a delimited\n * token number.\n * \n * @access public\n * \n * @param array $options An associative array of options for the new\n * token array element. The keys and values are specific to the\n * rule, and may or may not be common to other rule options. Typical\n * options keys are 'text' and 'type' but may include others.\n * \n * @param boolean $id_only If true, return only the token number, not\n * a delimited token string.\n * \n * @return string|int By default, return the number of the\n * newly-created token array element with a delimiter prefix and\n * suffix; however, if $id_only is set to true, return only the token\n * number (no delimiters).\n * \n */\n \n function addToken($rule, $options = array(), $id_only = false)\n {\n // increment the token ID number. note that if you parse\n // multiple times with the same Text_Wiki object, the ID number\n // will not reset to zero.\n static $id;\n if (! isset($id)) {\n $id = 0;\n } else {\n $id ++;\n }\n \n // force the options to be an array\n settype($options, 'array');\n \n // add the token\n $this->tokens[$id] = array(\n 0 => $rule,\n 1 => $options\n );\n \n // return a value\n if ($id_only) {\n // return the last token number\n return $id;\n } else {\n // return the token number with delimiters\n return $this->delim . $id . $this->delim;\n }\n }\n \n \n /**\n * \n * Set or re-set a token with specific information, overwriting any\n * previous rule name and rule options.\n * \n * @access public\n * \n * @param int $id The token number to reset.\n * \n * @param int $rule The rule name to use.\n * \n * @param array $options An associative array of options for the\n * token array element. The keys and values are specific to the\n * rule, and may or may not be common to other rule options. Typical\n * options keys are 'text' and 'type' but may include others.\n * \n * @return void\n * \n */\n \n function setToken($id, $rule, $options = array())\n {\n // reset the token\n $this->tokens[$id] = array(\n 0 => $rule,\n 1 => $options\n );\n }\n \n \n /**\n * \n * Load a rule parser class file.\n * \n * @access public\n * \n * @return bool True if loaded, false if not.\n * \n */\n \n function loadParseObj($rule)\n {\n $rule = ucwords(strtolower($rule));\n $file = $rule . '.php';\n $class = \"Text_Wiki_Parse_$rule\";\n \n if (! class_exists($class)) {\n $loc = $this->findFile('parse', $file);\n if ($loc) {\n // found the class\n include_once $loc;\n } else {\n // can't find the class\n $this->parseObj[$rule] = null;\n return false;\n }\n }\n \n $this->parseObj[$rule] = new $class($this);\n\n }\n \n \n /**\n * \n * Load a rule-render class file.\n * \n * @access public\n * \n * @return bool True if loaded, false if not.\n * \n */\n \n function loadRenderObj($format, $rule)\n {\n $format = ucwords(strtolower($format));\n $rule = ucwords(strtolower($rule));\n $file = \"$format/$rule.php\";\n $class = \"Text_Wiki_Render_$format\" . \"_$rule\";\n \n if (! class_exists($class)) {\n // load the class\n $loc = $this->findFile('render', $file);\n if ($loc) {\n // found the class\n include_once $loc;\n } else {\n // can't find the class\n return false;\n }\n }\n \n $this->renderObj[$rule] = new $class($this);\n }\n \n \n /**\n * \n * Load a format-render class file.\n * \n * @access public\n * \n * @return bool True if loaded, false if not.\n * \n */\n \n function loadFormatObj($format)\n {\n $format = ucwords(strtolower($format));\n $file = $format . '.php';\n $class = \"Text_Wiki_Render_$format\";\n \n if (! class_exists($class)) {\n $loc = $this->findFile('render', $file);\n if ($loc) {\n // found the class\n include_once $loc;\n } else {\n // can't find the class\n return false;\n }\n }\n \n $this->formatObj[$format] = new $class($this);\n }\n \n \n /**\n * \n * Add a path to a path array.\n * \n * @access public\n * \n * @param string $type The path-type to add (parse or render).\n * \n * @param string $dir The directory to add to the path-type.\n * \n * @return void\n * \n */\n \n function addPath($type, $dir)\n {\n $dir = $this->fixPath($dir);\n if (! isset($this->path[$type])) {\n $this->path[$type] = array($dir);\n } else {\n array_unshift($this->path[$type], $dir);\n }\n }\n \n \n /**\n * \n * Get the current path array for a path-type.\n * \n * @access public\n * \n * @param string $type The path-type to look up (plugin, filter, or\n * template). If not set, returns all path types.\n * \n * @return array The array of paths for the requested type.\n * \n */\n \n function getPath($type = null)\n {\n if (is_null($type)) {\n return $this->path;\n } elseif (! isset($this->path[$type])) {\n return array();\n } else {\n return $this->path[$type];\n }\n }\n \n \n /**\n * \n * Searches a series of paths for a given file.\n * \n * @param array $type The type of paths to search (template, plugin,\n * or filter).\n * \n * @param string $file The file name to look for.\n * \n * @return string|bool The full path and file name for the target file,\n * or boolean false if the file is not found in any of the paths.\n *\n */\n \n function findFile($type, $file)\n {\n // get the set of paths\n $set = $this->getPath($type);\n \n // start looping through them\n foreach ($set as $path) {\n $fullname = $path . $file;\n if (file_exists($fullname) && is_readable($fullname)) {\n return $fullname;\n }\n }\n \n // could not find the file in the set of paths\n return false;\n }\n \n \n /**\n * \n * Append a trailing '/' to paths, unless the path is empty.\n * \n * @access private\n * \n * @param string $path The file path to fix\n * \n * @return string The fixed file path\n * \n */\n \n function fixPath($path)\n {\n $len = strlen($this->_dirSep);\n \n if (! empty($path) &&\n substr($path, -1 * $len, $len) != $this->_dirSep) {\n return $path . $this->_dirSep;\n } else {\n return $path;\n }\n }\n}",
"function parse(&$reader, &$ctxt)\r\n\t{\r\n\t\t$parser =& new PhaseParser($reader, $ctxt);\r\n\t\t$output = '';\r\n\t\t\r\n\t\t// NOTE: this method provides an easy way to setup the tag libraries\r\n\t\t$parser->loadTagLibraries();\r\n\r\n\t\twhile ($reader->hasMoreInput())\r\n\t\t{\r\n\t\t\t$output .= $parser->parseElements();\r\n\t\t}\r\n\r\n\t\t// tack on the tag functions, wrapping them in the namespace\r\n\t\t// for this phase context\r\n\t\tif (count($parser->tagFunctions))\r\n\t\t{\r\n\t\t\t$output .= \r\n\t\t\t'<?php' . \"\\n\" .\r\n\t\t\t'class ' . $parser->namespace . ' {' . \"\\n\" .\r\n\t\t\timplode(\"\\n\", array_reverse($parser->tagFunctions)) . \"\\n\" .\r\n\t\t\t'}' . \"\\n\" .\r\n\t\t\t'?>' . \"\\n\";\t\r\n\t\t}\r\n\r\n\t\t// merge sections where php tags have become adjacent (no need for them)\r\n\t\t$output = preg_replace('; *\\?><\\?php *;', ' ', $output);\r\n\r\n\t\treturn $output;\r\n\t}",
"protected function _parse($output)\n\t{\n\t\t$this->_CI->load->library('parser');\n\t\t$vars = $this->values();\n\t\t$output = $this->_CI->parser->parse_string($output, $vars, TRUE);\n\t\treturn $output;\n\t}",
"function _loadDataText() {\r\n\t\treturn unserialize(file_get_contents($this->data_txt));\r\n\t}",
"function wp_kses_split2($content, $allowed_html, $allowed_protocols)\n {\n }",
"public function parse()\n {\n $this->initProps();\n $this->initParams();\n $this->load();\n }",
"private function prepareData(){\n\t\t\t$this->text = trim($this->text);\n\t\t\t$this->user_id = intval($this->user_id);\n\t\t\t$this->parent_id = intval($this->parent_id);\n\t\t}",
"protected static function handle_vars($content) {\n\t\treturn preg_replace('/{\\- VAR ([a-z_]+)\\: (.*?) \\-}/', '<?php \\$$1 = $2; ?>', $content);\n\t}",
"public function test_getContent() : void\n {\n $subject = '{code: \"ApacheVelocity\"}Some content here.{code}';\n $expected = 'Some content here.';\n\n $this->preParseString($subject);\n\n $this->assertSame($expected, PreParser::getContent(1));\n }",
"private function parseOutput()\n {\n// $parsedOutput = explode(' ',$this->output);\n// $this->image = new Image($parsedOutput[0]);\n// $this->resolution = $parsedOutput[1];\n\n }",
"public function parse()\n {\n }",
"public function parse()\n {\n }",
"public function parse()\n {\n }",
"public function parse()\n {\n }",
"function contents($parser, $data){\n global $currentTag, $filterWords;\n $data = trim($data);\n if($currentTag == \"WORD\" && strlen($data) > 0){\n $filterWords[] = $data;\n }\n}"
] | [
"0.6701736",
"0.66947556",
"0.66947556",
"0.6681259",
"0.6618902",
"0.6526563",
"0.62483776",
"0.6221378",
"0.61714095",
"0.6159372",
"0.6156381",
"0.60390246",
"0.5995332",
"0.59187603",
"0.5909063",
"0.59069425",
"0.59069425",
"0.59069425",
"0.5861882",
"0.5839693",
"0.58386075",
"0.58386075",
"0.58386075",
"0.58386075",
"0.5813882",
"0.57938856",
"0.57841736",
"0.5778925",
"0.5731333",
"0.57218665",
"0.5719073",
"0.5713385",
"0.57095903",
"0.5704384",
"0.5683024",
"0.56782365",
"0.56467813",
"0.56234515",
"0.56061625",
"0.5582043",
"0.5562601",
"0.5559897",
"0.5529666",
"0.5523907",
"0.5521908",
"0.5511188",
"0.54977065",
"0.54775846",
"0.5472945",
"0.54593796",
"0.54587555",
"0.5448216",
"0.54345244",
"0.53960764",
"0.5385303",
"0.5364149",
"0.535697",
"0.5343478",
"0.5340083",
"0.5332995",
"0.5331763",
"0.5326377",
"0.5324165",
"0.5320017",
"0.53171897",
"0.5315488",
"0.5314898",
"0.5313363",
"0.53059775",
"0.52900195",
"0.52821064",
"0.52775276",
"0.52738005",
"0.5273151",
"0.52729255",
"0.5266613",
"0.5260738",
"0.5260186",
"0.5240378",
"0.52354676",
"0.523073",
"0.52220494",
"0.522112",
"0.5217365",
"0.5217083",
"0.5209486",
"0.52071065",
"0.5197123",
"0.51947814",
"0.5191914",
"0.5186133",
"0.5184081",
"0.5168736",
"0.516383",
"0.5162919",
"0.51369387",
"0.51334935",
"0.51334935",
"0.51326436",
"0.5132567",
"0.5130109"
] | 0.0 | -1 |
Parser content into text for use in parameters etc. | static function getUnparsed($content, $single_line = true)
{
$return = '';
foreach ($content as $c)
$return .= !empty($c['unparsed'])? $c['unparsed'] : $c['content'];
return $return;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function parse($content);",
"public function parse(string $content);",
"public function parse(string $content);",
"public function parse( $contents );",
"public function parse(string $content, array $data = []): string;",
"function _parse() {\n $txt = $this->_text;\n for($i=0; $i<count($txt); $i++) {\n $txt[$i] = preg_replace(\"@[{]([^}]+)[}]@e\", \"''.\\$this->_insert(\\\"\\\\1\\\").''\",$txt[$i]);\n }\n return join(\"\",$txt);\n }",
"private function processContent(){\n\t\t$this->textEnd = strpos($this->raw,\"</{$this->tag}\");\n\t\t$this->text = trim(substr($this->raw, $this->textStart, $this->textEnd - $this->textStart));\n\t}",
"protected function parse(): void\n {\n $lines = preg_split('/\\r\\n|\\r|\\n/', $this->content);\n\n foreach ($lines as $line) {\n if (mb_strlen(trim($line)) && ! (mb_strpos(trim($line), '#') === 0)) {\n [$key, $value] = explode('=', (string) $line);\n $this->variables[$key] = $this->formatValue($value);\n }\n }\n }",
"protected function parse() {}",
"public abstract function parse($text);",
"public function parse($text);",
"private function parse($contents) // {{{\n {\n $entries = array();\n preg_match_all(\"/@(\\\\w+?)\\\\{([^,]+?),(.*?)\\\\n\\\\s*?\\\\}\\\\s*?\\\\n/ms\", \n $contents, $entries, PREG_SET_ORDER);\n foreach ($entries as $entry)\n {\n $bibtex_type = $entry[1];\n $bibtex_name = $entry[2];\n $bibtex_contents = $entry[3].\",\\n\"; // Newline added so that all entries are followed by one\n preg_match_all(\"/(\\\\w+?)\\\\s*=\\\\s*\\\\{(.*?)\\\\},\\\\n/ms\", \n $bibtex_contents, $pairs, PREG_SET_ORDER);\n $params = array();\n foreach ($pairs as $pair)\n {\n $k = $pair[1];\n $v = $pair[2];\n $params[\"raw\"][$k] = Bibliography::unspace($v); // We keep the original BibTeX string in the \"raw\" subarray\n $params[$k] = Bibliography::removeBraces(\n Bibliography::replaceAccents(Bibliography::unspace($v)));\n }\n $params[\"bibtex_type\"] = $bibtex_type;\n $this->m_entries[$bibtex_name] = $params;\n }\n }",
"public function parse($text, array $data, $purgePlaceholders = true);",
"public function parse(string $content)\n {\n foreach ($this->variables as $search => $replace) {\n $this->variables[$search] = $this->renderValue($replace);\n $value = $this->variables[$search]['rendered'];\n $content = preg_replace_callback(\"/\\s*{{\\s*${search}\\s*}}/\", function ($matches) use ($value) {\n return $this->renderSpacing($value, $matches);\n }, $content);\n }\n\n return $content;\n }",
"function parse_content($rawcontent){\n $content = explode(\"++++\", $rawcontent);\n //the defintion of the the title\n $metablock = $content[0];\n $rawmeta = explode(\"----\", $metablock);\n $meta = [];\n foreach ($rawmeta as $metaline) {\n //splits key from value\n $metaentry = explode(\":\", $metaline);\n //removes all spaces around the value\n $key = trim($metaentry[0]);\n $value = trim($metaentry[1]);\n $meta[$key] = $value;\n }\n //the splittet version: just the value\n $title = $meta[\"title\"];\n //the splittet text\n $text = $content[1];\n $result = compact(\"title\", \"text\", \"meta\");\n //returns the result\n return $result;\n}",
"public function parse();",
"public function parse();",
"public function parse();",
"public function getParsedInput();",
"protected function parseContent()\n {\n $contentString = strtok($this->query, '/');\n\n $content = [];\n $delim = '(),';\n $tok = strtok($contentString, $delim);\n while ($tok !== false) {\n $content[] = $tok;\n $tok = strtok($delim);\n }\n\n $this->contentTypes = $content;\n }",
"abstract public function parse();",
"abstract public function parse();",
"abstract public function parse();",
"abstract public function parse();",
"public function parse()\n {\n $strBuffer = parent::parse();\n\n foreach($this->arrData['variables'] as $varName=>$varValue)\n {\n if (empty($varValue))\n {\n continue;\n }\n\n // Convert date values\n /*switch ($objVar['type'])\n {\n case 'date':\n $objVar['value'] = \\Date::parse(\\Config::get('dateFormat'), $objVar['value']);\n break;\n\n case 'time':\n $objVar['value'] = \\Date::parse(\\Config::get('timeFormat'), $objVar['value']);\n break;\n\n case 'datim':\n $objVar['value'] = \\Date::parse(\\Config::get('datimFormat'), $objVar['value']);\n break;\n }*/\n\n //$objVar['value'] = str_replace('$', '\\$', $objVar['value']);\n\n if (is_array($varValue))\n {\n $varValue = json_encode($varValue);\n }\n\n $strBuffer = preg_replace('/{%\\s*' . $varName . '\\s*%}/s', $varValue, $strBuffer);\n\n $strBuffer = preg_replace('/{%\\s*' . $varName . '\\|\\s*nl2br\\s*%}/s', nl2br($varValue), $strBuffer);\n }\n\n $strBuffer = preg_replace('/{%.*?%}/s', '', $strBuffer);\n\n return $strBuffer;\n }",
"public function reparse()\n\t{\n\t\t$for_edit = $this->generate_text_for_edit();\n\t\t$this->post_text = $for_edit['text'];\n\n\t\t// Emulate what happens when sent from the user\n\t\t$this->post_text = html_entity_decode($this->post_text);\n\t\tset_var($this->post_text, $this->post_text, 'string', true);\n\n\t\t$this->generate_text_for_storage($for_edit['allow_bbcode'], $for_edit['allow_urls'], $for_edit['allow_smilies']);\n\t}",
"protected function parse_content(){\n $m = array(); // we will keep here\n list( $t, $text ) = explode( \"<div class='post entry-content '>\", $this->page );\n list( $text, $t ) = explode( '</div>', $text );\n return $text;\n }",
"public function run()\n {\n $tokens = $this->extractTokens( );\n\n // Loop through all the matches\n foreach( $tokens as $token )\n {\n if ( ! isset( $this->tokens[ $token ] ) )\n {\n $this->tokens[ $token ] = '';\n }\n\n if (\n is_object( $this->tokens[ $token ] ) &&\n method_exists( $this->tokens[ $token ], '__toString' ) ) {\n $replacement = ( string ) $this->tokens[ $token ];\n } else {\n $replacement = $this->tokens[ $token ];\n }\n\n // Get the content and replace the token with the parameter token\n $this->content = str_ireplace(\n sprintf( '%s%s%s', $this->openingTag, strtoupper( $token ), $this->closingTag ),\n $replacement,\n $this->content\n );\n }\n\n // Return the content\n return $this->content;\n }",
"protected function _parseTemplate() {}",
"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}",
"public function autoParse()\n {\n $type = $this->getMimeType();\n $contents = '';\n\n if ($type == 'application/json' || $type == 'text/json') {\n $contents = $this->parseJson();\n } elseif ($type == 'application/xml' || $type == 'text/xml') {\n $contents = $this->parseXml();\n } elseif ($type == 'application/x-yaml' || $type == 'text/yaml') {\n $contents = $this->parseYaml();\n } else {\n $contents = $this->getContents();\n }\n\n return $contents;\n }",
"abstract public function parse ();",
"protected function buildContents() : string {\n\n\t\t\t$insertions = [];\n\n\t\t\t# Process blocks\n\n\t\t\tforeach ($this->blocks as $name => $block) {\n\n\t\t\t\t$insertions['{ block:' . $name . ' / }'] = $block->getContents();\n\t\t\t}\n\n\t\t\t# Process loops\n\n\t\t\tforeach ($this->loops as $name => $loop) {\n\n\t\t\t\t$insertions['{ for:' . $name . ' / }'] = $loop->getContents();\n\t\t\t}\n\n\t\t\t# Process widgets\n\n\t\t\tforeach ($this->widgets as $name) {\n\n\t\t\t\t$widget = Template::getWidget($name);\n\n\t\t\t\t$contents = ((false !== $widget) ? $widget->getContents() : '');\n\n\t\t\t\t$insertions['{ widget:' . $name . ' / }'] = $contents;\n\t\t\t}\n\n\t\t\t# Process variables\n\n\t\t\tforeach ($this->variables as $name => $value) {\n\n\t\t\t\t$value = ((false === $value) ? Template::getGlobal($name) : $value);\n\n\t\t\t\t$insertions['$' . $name . '$'] = Str::formatOutput($value);\n\t\t\t}\n\n\t\t\t# Process phrases\n\n\t\t\tforeach ($this->phrases as $name => $value) {\n\n\t\t\t\t$value = Language::get($name);\n\n\t\t\t\t$insertions['%' . $name . '%'] = Str::formatOutput($value);\n\t\t\t}\n\n\t\t\t# Process insertions\n\n\t\t\t$contents = str_replace(array_keys($insertions), array_values($insertions), $this->contents);\n\n\t\t\t# ------------------------\n\n\t\t\treturn $contents;\n\t\t}",
"function parseData(){\r\n\t\t$content = array();\r\n\t\t$this->page_id = $this->CFG->PostVars['pageid'];\r\n\t\tforeach($this->CFG->PostVars as $key=>$value){\r\n\t\t\tif(preg_match(\"/content_(.*)_(.*)/\", $key, $arr)){\r\n\t\t\t\t$field\t= $arr[1];\r\n\t\t\t\t$lang \t= $arr[2];\r\n\t\t\t\tif(is_array($content[$lang])){\r\n\t\t\t\t\t$content[$lang][$field] = $value;\r\n\t\t\t\t}\r\n\t\t\t\telse $content[$lang] = array($field => $value);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t$this->content = $content;\r\n\t}",
"protected function parse()\n {\n // $member is an array with the details of the motherless member who wrote the content.\n // @see WebBot::getMember() for more details.\n $member = $this->getMember();\n\n // $content is the content, either a shout, comment, board post, or group forum post.\n // @see WebBot::getContent() for more details.\n $content = $this->getContent();\n\n // $name is the name of this bot with some special bbcode wrapped around it.\n // @see WebBot::getWrappedName() for more details.\n $name = $this->getWrappedName();\n\n // $trigger is the text which triggered calling this bot.\n // @see WebBot::getTrigger() for more details.\n $trigger = $this->getTrigger();\n\n // $this->getWrappedText() wraps the bot's text in some special bbcode tags.\n // @see WebBot::getWrappedText() for more details.\n $quote = $this->getRandomQuote();\n $quote = $this->getWrappedText(\"\n {$name}:\n A quote for {$member['username']}\n [i]{$quote['quote']}[/i]\n - {$quote['author']}\n \");\n\n // Replace the trigger in the content with our random quote.\n $content = str_replace($trigger, $quote, $content);\n\n // Respond with the new content.\n // @see WebBot::sendContent() for more details.\n $this->sendContent($content);\n }",
"public function process($content){\n\t\treturn str_replace('</body>', $this->configstring . '</body>', $content);\n\t}",
"function my_formatter( $content ) {\n\n\t\t$new_content = '';\n\t\t$pattern_full = '{(\\[raw\\].*?\\[/raw\\])}is';\n\t\t$pattern_contents = '{\\[raw\\](.*?)\\[/raw\\]}is';\n\t\t$pieces = preg_split( $pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE );\n\n\t\tforeach ( $pieces as $piece ) {\n\n\t\t\tif ( preg_match( $pattern_contents, $piece, $matches ) ) {\n\t\t\t\t$new_content .= $matches[1];\n\t\t\t} else {\n\t\t\t\t$new_content .= wptexturize( wpautop( $piece ) );\n\t\t\t}\n\n\t\t}\n\n\t\treturn $new_content;\n\n\t}",
"abstract protected function parseContent($content = ''): array;",
"protected function _run() {\n $tmpContent = $this->_content;\n $this->_content = $this->_getCurrentTemplateContent();\n $spaceContent = $this->_parse();\n $this->_content = $tmpContent;\n $content = '';\n\n if(!$spaceContent) {\n $spaceContent = $this->_parse();\n }\n\n $this->_parseParams();\n $news = Newslog_Models_Mapper_NewsMapper::getInstance()->fetchAll(null, array('created_at ' . $this->_orderDirection), $this->_limit, 0);\n\n if(!is_array($news) || empty($news)) {\n return 'You don\\'t have news yet.';\n }\n\n $this->_spaceContent = $spaceContent;\n foreach($news as $newsItem) {\n if(Tools_Security_Acl::isAllowed(Tools_Security_Acl::RESOURCE_ADMINPANEL)) {\n $spaceContent = '<input type=\"hidden\" class=\"news-list-hidden news-list-hidden-' . $newsItem->getId() . '\" />' . $this->_spaceContent;\n }\n $content .= preg_replace('~{\\$' . self::NEWS_WIDGET_NAME . ':(.+)}~uU', '{$' . self::NEWS_WIDGET_NAME . ':' . $newsItem->getPageId() . ':$1}', $spaceContent);\n }\n $parser = new Tools_Content_Parser($content, array());\n return $parser->parseSimple();\n }",
"function parseParameterValues($source) {\n\t$parameterValues = array();\n\t$parameter = preg_split(\"/<br>/\", $source); // get array from the source string\n\t\n\tfor ($i = 0; $i < count($parameter); $i++) {\n\t\t$parameter[$i] = preg_replace(\"/(<p)+[^<]+/\", \"\", $parameter[$i]); // rip off <p> tag\n\t\t$parameter[$i] = preg_replace(\"/<\\/p>/\", \"\", $parameter[$i]); // rip of </p> tag\n\t\t$list = preg_split(\"/=/\", $parameter[$i]);\n\t\t$paramName = $list[0]; // get parameter name\n\t\t$paramVal = $list[1]; // get parameter value\n\t\t\n\t\tif ($paramName != \"class\" && $paramName != \"method\" && $paramName != \"delay\" && $paramName != null) {\n\t\t\tarray_push($parameterValues, $paramVal); // push to the parameter value array;\n\t\t}\n\t}\n\t\n\tif (count($parameterValues) > 0) {\n\t\t$result = \"<param name=\\\"information\\\">\". join($parameterValues, \"^\") . \"</param>\"; // create parameter value string\n\t}\n\t\n\t/*\n\tforeach ($parameter as $item) {\n\t\techo $item;exit;\n\t\t\n\t\t\n\t\t$list = preg_split(\"/=/\", $item);\n\t\t$paramName = $list[0]; // get parameter name\n\t\t$paramVal = $list[1]; // get parameter value\n\t\t\n\t\tif (sizeof($parameter) > 0) {\n\t\t\t$result = $result;\n\t\t}\n\t\t\n\t\tif ($paramName != \"class\" && $paramName != \"method\") { // filter out non-parameter name\n\t\t\t\n\t\t}\n\t}*/\n\treturn $result;\n}",
"public function loadString($content);",
"function tidy_parse_string($input, $config = null, $encoding = null) {}",
"function parse_content( $content ) {\n\t\tif ( is_null( $content ) ) {\n\t\t\t$this->body = null;\n\t\t}\n\n\t\t$this->body = do_shortcode( $content );\n\t}",
"function parseText ($text) {\n return $this->parse($text);\n }",
"public function getParsedText($text) {\n\t\t$this->text = $text;\n\n\t\t$this->extractProtectedParts();\n\t\t$this->escape()->paragraphs()->lineBreaks();\n\t\t$this->restoreProtectedParts();\n\n\t\tReturn $this->text;\n\t}",
"public function get_input_content();",
"function myParse($text) {\n\t$results = array();\n\t$rc = 0;\n\n\tfor($i=0; $i<strlen($text); $i++) {\n\t\t$c = substr($text, $i, 1);\n\n\t\tif ($c=='<') {\n\t\t\t// Starting tag\n\t\t\t$tagC = '';\n\t\t\t$tag = true;\n\t\t}\n\n\t\tif ($tag) {\n\t\t\t$tagC .= $c;\n\t\t} else {\n\t\t\tif ($c==\"\\n\") {\n\t\t\t\t// Advance the counter so each line is stored separately \n\t\t\t\tif (empty($_SESSION['para'])) { \n\t\t\t\t\t$rc++;\n\t\t\t\t} else {\t\t\t\t\t\n\t\t\t\t\tif (!isset($results[$rc])) {\n\t\t\t\t\t\t// Get position of New editable text\n\t\t\t\t\t\t$results[$rc] = array('index'=>$i, 'text'=>'');\n\t\t\t\t\t}\n\t\t\t\t\t$results[$rc]['text'] .= $c;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!isset($results[$rc])) {\n\t\t\t\t\t// Get position of New editable text\n\t\t\t\t\t$results[$rc] = array('index'=>$i, 'text'=>'');\n\t\t\t\t}\n\t\t\t\t$results[$rc]['text'] .= $c;\n\t\t\t}\n\t\t}\n\t\tif ($c=='>') {\n\t\t\t// Tag ending\n\t\t\t$tagC .= $c;\n\t\t\t$tag = false;\n\t\t\t$rc++;\n\t\t}\n\t}\n\n\t// Filter editable text\n\t$resultsx = array();\n\tforeach($results as $resline) {\t\t\n\t\t$res = trim($resline['text']);\n\n\t\t// Skip empty, &xx; and literals \n\t\tif (!$res || ($res[0]=='&' && substr($res,-1)==';') || isLiteral($res) ) continue;\n\t\t\n\t\tif (!empty($_SESSION['para'])) {\n\t\t\t// trim \\n and adjust position\n\t\t\twhile(substr($resline['text'], 0, 1)==\"\\n\" || substr($resline['text'], 0, 1)==\"\\r\") {\n\t\t\t\t$resline['index']++;\n\t\t\t\t$resline['text'] = substr($resline['text'], 1);\n\t\t\t}\n\t\t\t// recheck \\n \n\t\t\tif (!strstr($resline['text'], \"\\n\")) {\n\t\t\t\t// treat as one line (trim and adjust)\n\t\t\t\twhile(substr($resline['text'], 0, 1)==' ') {\n\t\t\t\t\t$resline['index']++;\n\t\t\t\t\t$resline['text'] = substr($resline['text'], 1);\n\t\t\t\t}\n\t\t\t\t$resline['text'] = trim($resline['text']);\n\t\t\t}\n\t\t\t$res = $resline['text'];\n\t\t} else {\n\t\t\t// trim and adjust position\n\t\t\twhile(substr($resline['text'], 0, 1)==' ') {\n\t\t\t\t$resline['index']++;\n\t\t\t\t$resline['text'] = substr($resline['text'], 1);\n\t\t\t}\n\t\t\t$res = trim($resline['text']);\n\t\t}\n\t\t$resultsx[$resline['index']] = $res;\n\t}\n\n\t// Return an array contains all editable texts and their positions in file contents\n\treturn $resultsx;\n}",
"public function parse()// : void\n\t{\n\t\tforeach( $this -> options[ 'command' ] as $command => $params )\n\t\t{\n\t\t\t//- Parsing -//\n\t\t\t$result = null;\n\t\t\tpreg_match_all(\n\t\t\t\t$params[ 'regex' ], \n\t\t\t\t$this -> text, \n\t\t\t\t$result, \n\t\t\t\tPREG_PATTERN_ORDER\n\t\t\t);\n\n\t\t\t//- Set result -//\n\t\t\t$this -> value[ $command ] = array();\n\t\t\t$this -> errors[ $command ] = array();\n\t\t\tforeach( $params[ 'value' ] as $key => $index )\n\t\t\t{\n\t\t\t\tif( !isset( $result[ $index ][ 0 ] ) )\n\t\t\t\t{\n\t\t\t\t\t$this -> errors[ $command ][ $key ] = \"Command not valid\";//TODO: change\n\t\t\t\t\t\n\t\t\t\t\t$this -> valid = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//- Set value -//\n\t\t\t\t$this -> value[ $command ][ $key ] = $result[ $index ][ 0 ];\n\t\t\t}\t\t\t\n\t\t}\n\t}",
"public function parse( $text ) {\n\t\t$parts = explode( ' ', $text );\n\t\t$this->email = trim( array_pop( $parts ), '<>' );\n\t\t$this->name = implode( ' ', $parts );\n\t}",
"function _parse() {\n $file = $this->_get_file();\n $search = array();\n $replace = array();\n $i = 0;\n foreach($this->_keys as $key => $value) {\n $search[$i] = $value;\n $replace[$i] = $this->_vals[$key];\n if(is_object($replace[$i])) {\n $replace[$i] = $replace[$i]->get_string();\n }\n ++$i;\n }\n return str_replace($search, $replace, $file);\n }",
"function process_content( string $str ): string {\n\t$str = apply_filters( 'the_content', $str ); // Shortcodes are expanded here.\n\t$str = str_replace( ']]>', ']]>', $str );\n\treturn $str;\n}",
"function parseTemplateText()\r\n\t{\r\n\t\t$buf = '';\r\n\t\t// we only need this if we are going to use JSP tags for wrapping\r\n\t\t// scriptlet blocks\r\n\t\t//if ($this->reader->matches('<' . '\\\\%'))\r\n\t\t//{\r\n\t\t//\t$buf .= '<' . '%';\r\n\t\t//}\r\n\r\n\t\t$buf .= $this->reader->nextContent();\r\n\r\n\t\t// don't output meaningless whitespace\r\n\t\tif (trim($buf) == '')\r\n\t\t{\r\n\t\t\treturn '';\r\n\t\t}\r\n\t\telseif ($this->ctxt->options->isElIgnored() || strpos($buf, '${') === false)\r\n\t\t{\r\n\t\t\treturn $buf;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn '<?php echo $pageContext->evaluateTemplateText(' . StringUtils::quote($buf) . ');?>';\r\n\t\t}\r\n\t}",
"private function parseContentInOldFormat(){\n\t\t $contentArray = explode(FieldContentInAgenda::SPLIT_CHARACTER, $this->filedContent);\n\t\t if(EducationalUtil::isRoleTypeTheme($this->roleType, $this->roleNamesObj)){\n\t\t \t$this->formattedStr = $this->filedContent;\n\t\t } elseif(EducationalUtil::isRoleTypeCC($this->roleType, $this->roleNamesObj)){ \n\t\t\t$this->isMember = $this->isStartedWithMemberTag($contentArray[0]);\t\n\t\t\t$this->name = $contentArray[1];\n\t\t\t$this->memberLevel = $contentArray[2];\n\t\t\t\n\t\t\tif($this->isMember){\n\t\t\t\t$this->ccclLevel = $contentArray[3];\n\t\t\t\t$this->projectNo = $contentArray[4];\n\t\t\t} else {\n\t\t\t\t$this->clubName = $contentArray[3];\n\t\t\t\t$this->ccclLevel = $contentArray[4];\n\t\t\t\t$this->projectNo = $contentArray[5];\n\t\t\t}\n\t\t\t\n\t\t\t$this->formattedStr = $this->getFormattedPrintedStrForCCCL();\n\t\t\t\n\t\t } else {\n\t\t\t$this->isMember = $this->isStartedWithMemberTag($contentArray[0]);\n\t\t\t$this->name = $contentArray[1];\n\t\t\t$this->memberLevel = $contentArray[2];\n\t\t\t\n\t\t\tif(!$this->isMember){\n\t\t\t\t$this->clubName = $contentArray[3];\n\t\t\t}\n\t\t\t\n\t\t\t$this->formattedStr = $this->getFormattedPrintedStrForNOCCCL();\n\t\t }\n\t }",
"public function getTextContent();",
"function Process($parser, $text, $data)\r\n\t{\r\n\t\tob_start();\r\n\t\teval($data);\r\n\t\t$obj = &$this->GetCurrentObject();\r\n\t\t$obj->out .= ob_get_contents();\r\n\t\tob_end_clean();\r\n\t}",
"function process($content='', $type='', $conf=array())\t{\n\n\t\t$this->out='';\n\t\tif (!$content) {\n\t\t\t$content = $this->getInput();\n\t\t}\n\t\tif ($content) {\n\t\t\t\t// remove words in uppercase which seems to confuse TextCat\n\t\t\t$content = preg_replace('#\\b[A-Z]{2,}\\b#', ' ', $content);\n\n\t\t\t$this->setInput ($content, $type);\n\t\t}\n\n\t\tif($inputFile = $this->getInputFile()) {\n\n\t\t\t$cmd = t3lib_exec::getCommand('perl');\n\t\t\t$cmd.=' '.t3lib_extMgm::extPath('cc_textcat').'textcat/text_cat.pl';\n\t\t\t$cmd.=' -d '.t3lib_extMgm::extPath('cc_textcat').'textcat/LM/';\n\t\t\t$cmd.=' 2>&1';\n\t\t\t$cmd.=' <'.$inputFile;\n\t\t\tif ($fpw = @popen ($cmd, 'r')) {\n\n\t\t\t\t$read=@fread($fpw, 200);\n\t\t\t\t@pclose($fpw);\n\n\t\t\t\t$lang = explode(' or ',$read);\n\t\t\t\t$lang = explode('-',$lang[0]);\n\t\t\t\t$lang = $lang[0];\n\t\t\t}\n\n\t\t\tif(strlen($lang)==2) {\n\t\t\t\t$this->out=$lang;\n\t\t\t} else {\n\t\t\t\t$this->out=FALSE; // no iso code - better set to false\n\t\t\t}\n\n\t\t} else {\n\t\t\t$this->errorPush(T3_ERR_SV_NO_INPUT, 'No or empty input.');\n\t\t}\n\n\t\treturn $this->getLastError();\n\t}",
"private function parse($text)\n {\n // Parse iteration ({Each}..{/Each})\n $callback = array($this, 'iterationCallback');\n \n foreach($this->values as $key => $value)\n {\n // Check the type\n if(!is_array($value))\n {\n // Only allow array types here.\n continue;\n }\n\n $text = preg_replace_callback('/{Each:\\s*(' . $key . ')\\s+as\\s+([\\d\\w.]+)}(.+?)' . \n '{\\/Each: ' . $key . '}/s',\n $callback, $text);\n }\n \n // First search for simple values\n $callback = array($this, 'simpleValueCallback');\n \n // Define the tag format to use for smart tags\n $smartTagPrefix = $this->smartTags ? '<!--\\s*' : '';\n $smartTagSuffix = $this->smartTags ? '\\s*-->' : '';\n \n // Parse simple values\n $text = preg_replace_callback('/' . $smartTagPrefix . '{(QRCode|String|Integer|Decimal):\\s(' . \n '[\\d\\w.\\'\\s\\-]+)((\\s[\\d\\w]+=[\\d\\w.]+)*)}' . $smartTagSuffix . '/',\n $callback, $text);\n \n \n // Load any special tags that are undefinable by the model\n $text = preg_replace_callback('/' . $smartTagPrefix . '{(Subview):\\s(' . \n '[\\d\\w]+)((\\s[\\d\\w]+=[\\d\\w.]+)*)}' . $smartTagSuffix . '/',\n $callback, $text);\n\n // Search for conditionals\n $callback = array($this, 'conditionalCallback');\n $text = preg_replace_callback('/{If:\\s*(([\\w\\'\\d.\\-]+)\\s*(==|>|<|>=|<=|in|%|<>)\\s*([\\w\\'\\d.\\-]+))}(.+?)' . \n '{\\/If:\\s*\\\\1}/s',\n $callback, $text);\n \n \n return $text;\n }",
"public function parse($content)\n {\n global $post_id;\n global $page_id;\n\n // check CMS type and version\n $this->checkCMS();\n\n $id = defined('PAGE_ID') ? PAGE_ID : $page_id;\n\n // collect the main information about CMS, page and user\n $parse = array(\n 'cms' => array(\n 'type' => self::$cms_type,\n 'version' => self::$cms_version,\n 'locale' => strtolower(LANGUAGE),\n 'page_id' => ($id > 0) ? $id : -1,\n 'page_url' => ($id > 0) ? $this->getURLbyPageID($id) : $this->getCurrentPageURL(),\n 'page_visibility' => VISIBILITY,\n 'remove_commands' => ($id == 0),\n 'user' => array(\n 'id' => (isset($_SESSION['USER_ID'])) ? $_SESSION['USER_ID'] : -1,\n 'name' => (isset($_SESSION['USERNAME'])) ? $_SESSION['USERNAME'] : '',\n 'email' => (isset($_SESSION['EMAIL'])) ? $_SESSION['EMAIL'] : ''\n ),\n 'special' => array(\n 'post_id' => (!is_null($post_id) || defined('POST_ID')) ? defined('POST_ID') ? POST_ID : $post_id : null,\n 'topic_id' => defined('TOPIC_ID') ? TOPIC_ID : null\n )\n ),\n 'GET' => $_GET,\n 'POST' => $_POST,\n 'content' => $content,\n );\n\n $options = array(\n CURLOPT_POST => true,\n CURLOPT_HEADER => false,\n CURLOPT_URL => WB_URL.'/kit2/kit_parser',\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_POSTFIELDS => http_build_query(array('parse' => $parse), '', '&'),\n CURLOPT_SSL_VERIFYHOST => false,\n CURLOPT_SSL_VERIFYPEER => false\n );\n // use the connection multiple times by using a cookie to identify\n if (!isset($_SESSION['KIT2_COOKIE_FILE']) || !file_exists($_SESSION['KIT2_COOKIE_FILE'])) {\n $_SESSION['KIT2_COOKIE_FILE'] = WB_PATH.'/kit2/temp/session/'.uniqid('outputfilter_');\n $options[CURLOPT_COOKIEJAR] = $_SESSION['KIT2_COOKIE_FILE'];\n }\n else {\n $options[CURLOPT_COOKIEFILE] = $_SESSION['KIT2_COOKIE_FILE'];\n }\n\n $ch = curl_init();\n curl_setopt_array($ch, $options);\n\n if (false === ($content = curl_exec($ch))) {\n trigger_error(curl_error($ch), E_USER_ERROR);\n }\n curl_close($ch);\n return $content;\n }",
"public function parse()\n\t{\n\t\t$this->parseGroups();\n\t\t$this->parseBadges();\n\t}",
"private function parseContentInNewFormat(){\n\t\t $contentArray = explode(FieldContentInAgenda::SPLIT_CHARACTER, $this->filedContent);\n\t\t \n\t\t if(EducationalUtil::isRoleTypeTheme($this->roleType, $this->roleNamesObj)){\n\t\t \t$this->formattedStr = $this->filedContent;\n\t\t } elseif(EducationalUtil::isRoleTypeCCorCL($this->roleType, $this->roleNamesObj)){\n\t\t\t\n\t\t\t$this->isMember = $this->isStartedWithMemberTag($contentArray[0]);\t\t\t\n\t\t\t$this->id = $contentArray[1];\n\t\t\t$this->name = $contentArray[2];\n\t\t\t$this->memberLevel = $contentArray[3];\n\t\t\t$this->ccclLevel = $contentArray[4];\n\t\t\t$this->projectNo = $contentArray[5];\n\t\t\t\n\t\t\tif(!$this->isMember){\n\t\t\t\t$this->clubIndex = $contentArray[6];\n\t\t\t\t$this->clubName = $this->getClubShortNameByIndex();\n\t\t\t}\n\t\t\t\n\t\t\t$this->formattedStr = $this->getFormattedPrintedStrForCCCL();\n\n\t\t } else {\n\t\t\tif(EducationalUtil::isRoleTypePresident($this->roleType, $this->roleNamesObj)){\n\t\t\t\t$NUM_OF_PIECES_FOR_PRESIDENT = 4;\n\t\t\t\tif(count($contentArray) != $NUM_OF_PIECES_FOR_PRESIDENT){\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->isMember = $this->isStartedWithMemberTag($contentArray[0]);\n\t\t\t$this->id = $contentArray[1];\n\t\t\t$this->name = $contentArray[2];\n\t\t\t$this->memberLevel = $contentArray[3];\n\t\t\t\n\t\t\tif(!$this->isMember){\n\t\t\t\t$this->clubIndex = $contentArray[4];\n\t\t\t\t$this->clubName = $this->getClubShortNameByIndex();\n\t\t\t}\n\t\t\t\n\t\t\t$this->formattedStr = $this->getFormattedPrintedStrForNOCCCL();\n\t\t }\n\t }",
"public function getParseTree( $text ) {\n\t\tglobal $wgVisualEditorParserCmd, $wgServer, $wgScriptPath;\n\n\t\t// TODO This is probably not very portable to non-Unix OS. There's a lot of code in wfShellExec to make\n\t\t// that portable and secure on Windows etc. In any case the existing PHP-based parser calls out to an external script to do \n\t\t// HTML-tidy anyway, in a similar manner, without any shell escapes...\n\t\t$cmd = join( \" \", array( \n\t\t\t$wgVisualEditorParserCmd, \n\t\t\t'--wgScriptPath', wfEscapeShellArg( $wgServer . $wgScriptPath ),\n\t\t) );\n\n\t\t$parserIn = 0;\n\t\t$parserOut = 1;\n\t\t$parserErr = 2;\n\n\t\t$descriptorSpec = array(\n\t\t\t$parserIn => array( 'pipe', 'r' ), // child reads from stdin, we write\n\t\t\t$parserOut => array( 'pipe', 'w' ), // child writes to stdout, we read\n\t\t\t$parserErr => array( 'pipe', 'w' ) // child writes to stderr, we read\n\t\t);\n\n\t\t$pipes = array();\n\n\t\t$process = proc_open( $cmd, $descriptorSpec, $pipes );\n\n\t\t$ret = array( 'contents' => null );\n\n\t\tif ( is_resource( $process ) ) {\n\t\t\t// Theoretically, this style of communication could cause a deadlock\n\t\t\t// here. If the stdout buffer fills up, then writes to stdin could\n\t\t\t// block. \n\t\t\t//\n\t\t\t// TODO This might be an opportune time to give the parser all the subtemplates it's going to need,\n\t\t\t// such that we can. The DB does have a mapping of title to templates used.\n\t\t\t// Would need a convention for indicating multiple files in the text we write to the parser, like mime multipart\n\t\t\tfwrite( $pipes[$parserIn], $text );\n\t\t\tfclose( $pipes[$parserIn] );\n\t\t\n\t\t\t$ret['contents'] = FormatJson::decode( self::readFilehandle( $pipes[$parserOut] ) );\n\n\t\t\t$errors = self::readFilehandle( $pipes[$parserErr] );\n\t\t\tif ( $errors != '' and $errors != null ) {\n\t\t\t\t$ret['errors'] = $errors;\n\t\t\t}\n\n\t\t\t$retval = proc_close( $process );\n\t\t\tif ( $retval != 0 ) {\n\t\t\t\twfWarn( \"Parser process returned $retval\" );\n\t\t\t\tif ( !$ret['errors'] ) {\n\t\t\t\t\t$ret['errors'] = 'External parser process returned error code, check server logs';\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\twfWarn( \"Unable to start external parser process\" );\n\t\t\t$ret['errors'] = \"Unable to start external parser process, check server logs\";\n\t\t}\n\n\t\treturn $ret;\n\t}",
"function _parse($tags,$values,$text) {\n\t\tfor ($i = 0; $i<sizeof($tags); $i++) {\n\t\t\t\t$text = str_replace($tags[$i],$values[$i],$text);\n\t\t\t}\n\t\treturn $text;\n\t}",
"abstract protected function parse($data);",
"public function parse(array &$tokens) {\n\t\t$token = current($tokens);\n\t\t$this->content = substr($token['value'], 4, -3);\n\t}",
"public function extract($content);",
"public function getParsedContent()\n {\n return oxUtilsView::getInstance()->parseThroughSmarty( $this->getContent()->oxcontents__oxcontent->value, $this->getContent()->getId() );\n }",
"protected function parse(): void\n {\n parent::parse();\n $this->template->assign('dataGrid', (string) $this->dataGrid->getContent());\n }",
"protected function extract($content) {\n\t\t// load the content\n\t\t$content = $this->load ( $content );\n\t\t\n\t\t// initialize array that will contain all strings found in the code\n\t\t$strings = array ();\n\t\t$comments = array ();\n\t\t\n\t\t// loop all characters\n\t\tfor($i = 0; $i < strlen ( $content ); $i ++) {\n\t\t\t$character = $content [$i];\n\t\t\t\n\t\t\tswitch ($content [$i]) {\n\t\t\t\t// string demarcation: ' or \"\n\t\t\t\tcase '\\'' :\n\t\t\t\tcase '\"' :\n\t\t\t\t\t$stringOpener = $character;\n\t\t\t\t\t$string = $character;\n\t\t\t\t\t\n\t\t\t\t\t// process through content until we find the end of the\n\t\t\t\t\t// string\n\t\t\t\t\tfor($j = $i + 1; $j < strlen ( $content ); $j ++) {\n\t\t\t\t\t\t$character = $content [$j];\n\t\t\t\t\t\t$previousCharacter = isset ( $content [$j - 1] ) ? $content [$j - 1] : '';\n\t\t\t\t\t\t\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Find end of string: - string started with double\n\t\t\t\t\t\t * quotes ends in double quotes, likewise for single\n\t\t\t\t\t\t * quotes. - unterminated string ends at newline (bad\n\t\t\t\t\t\t * code), unless newline is escaped (though nobody knows\n\t\t\t\t\t\t * this.)\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (($stringOpener == $character && $previousCharacter != '\\\\') || (in_array ( $character, array (\n\t\t\t\t\t\t\t\t\"\\r\",\n\t\t\t\t\t\t\t\t\"\\n\" \n\t\t\t\t\t\t) ) && $previousCharacter != '\\\\')) {\n\t\t\t\t\t\t\t// save string\n\t\t\t\t\t\t\t$replacement = '[MINIFY-STRING-' . count ( $strings ) . ']';\n\t\t\t\t\t\t\t$strings [$replacement] = substr ( $content, $i, $j - $i + 1 );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// replace string by stub\n\t\t\t\t\t\t\t$content = substr_replace ( $content, $replacement, $i, $j - $i + 1 );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// reset pointer to the end of this string\n\t\t\t\t\t\t\t$i += strlen ( $replacement );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t// comment demarcation: // or /*\n\t\t\t\tcase '/' :\n\t\t\t\t\t$commentOpener = $character . (isset ( $content [$i + 1] ) ? $content [$i + 1] : '');\n\t\t\t\t\t\n\t\t\t\t\t/*\n\t\t\t\t\t * Both comment opening tags are 2 characters, so grab the\n\t\t\t\t\t * next character and verify we're really opening a comment\n\t\t\t\t\t * here.\n\t\t\t\t\t */\n\t\t\t\t\tif (in_array ( $commentOpener, array (\n\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// process through content until we find the end of the\n\t\t\t\t\t\t// comment\n\t\t\t\t\t\tfor($j = $i + 1; $j < strlen ( $content ); $j ++) {\n\t\t\t\t\t\t\t$character = $content [$j];\n\t\t\t\t\t\t\t$previousCharacter = isset ( $content [$j - 1] ) ? $content [$j - 1] : '';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t/*\n\t\t\t\t\t\t\t * Find end of comment: - // single line comments\n\t\t\t\t\t\t\t * end at newline. - /* multiline comments and at\n\t\t\t\t\t\t\t * their respective closing tag, which I can't use\n\t\t\t\t\t\t\t * here or it'd end this very comment.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif (($commentOpener == '//' && in_array ( $character, array (\n\t\t\t\t\t\t\t\t\t\"\\r\",\n\t\t\t\t\t\t\t\t\t\"\\n\" \n\t\t\t\t\t\t\t) )) || ($commentOpener == '/*' && $previousCharacter . $character == '*/')) {\n\t\t\t\t\t\t\t\t// save comment\n\t\t\t\t\t\t\t\t$replacement = '[MINIFY-COMMENT-' . count ( $comments ) . ']';\n\t\t\t\t\t\t\t\t$comments [$replacement] = substr ( $content, $i, $j - $i + 1 );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// replace comment by stub\n\t\t\t\t\t\t\t\t$content = substr_replace ( $content, $replacement, $i, $j - $i + 1 );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// reset pointer to the end of this string\n\t\t\t\t\t\t\t\t$i += strlen ( $replacement );\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\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn array (\n\t\t\t\t$content,\n\t\t\t\t$strings,\n\t\t\t\t$comments \n\t\t);\n\t}",
"function _parse($str)\n\t{\n\t\t$vars = func_get_args();\n\t\tarray_shift($vars);\n\t\t$str = _($str);\n\t\tob_start();\n\t\tvprintf($str, $vars);\n\t\t$str = ob_get_contents();\n\t\tob_end_clean();\n\t\treturn $str;\n\t}",
"function processContent(string $content): string\n{\n $content = processShortcodes($content);\n return Michelf\\Markdown::defaultTransform($content);\n}",
"public\n function metabolize( $content )\n {\n $args = func_get_args();\n list($continue, $this->injection_post) = $this->get_injection_post($args);\n if ( ! $continue ) {\n return $content;\n }\n if ( ! $this->injection_author_can(EnzymesCapabilities::inject) ) {\n return $content;\n }\n if ( ! $this->there_is_an_injection($content, $matches) ) {\n return $content;\n }\n $this->new_content = '';\n do {\n $before = $this->value($matches, 'before');\n $could_be_sequence = $this->value($matches, 'could_be_sequence');\n $after = $this->value($matches, 'after');\n $escaped_injection = '{' == substr($before, -1); // \"{{[ .. ]}\"\n if ( $escaped_injection ) {\n $result = '{[' . $could_be_sequence . ']}'; // do not unescape now, version 2 will do it later...\n } else {\n $result = $this->process($could_be_sequence);\n }\n $this->new_content .= $before . $result;\n } while ($this->there_is_an_injection($after, $matches));\n $result = $this->new_content . $after;\n\n return $result;\n }",
"private function get_content()\n {\n $input_char = '';\n $content = array();\n $space = false; //if a space is needed\n\n while (isset($this->input[$this->pos]) && $this->input[$this->pos] !== '<') {\n \n if ($this->pos >= $this->input_length) {\n return count($content) ? implode('', $content) : array('', 'TK_EOF');\n }\n\n if ($this->traverse_whitespace()) {\n if (count($content)) {\n $space = true;\n }\n continue; //don't want to insert unnecessary space\n }\n\n $input_char = $this->input[$this->pos];\n $this->pos++;\n\n if ($space) {\n if ($this->line_char_count >= $this->options['wrap_line_length']) { //insert a line when the wrap_line_length is reached\n $this->print_newline(false, $content);\n $this->print_indentation($content);\n } else {\n $this->line_char_count++;\n $content[] = ' ';\n }\n $space = false;\n }\n $this->line_char_count++;\n $content[] = $input_char; //letter at-a-time (or string) inserted to an array\n }\n \n return count($content) ? implode('', $content) : '';\n }",
"function my_formatter($content)\n{\n $new_content = '';\n $pattern_full = '{(\\[raw\\].*?\\[/raw\\])}is';\n $pattern_contents = '{\\[raw\\](.*?)\\[/raw\\]}is';\n $pieces = preg_split($pattern_full, $content, -1, PREG_SPLIT_DELIM_CAPTURE);\n\n foreach ($pieces as $piece) {\n if (preg_match($pattern_contents, $piece, $matches)) {\n $new_content .= $matches[1];\n } else {\n $new_content .= wptexturize(wpautop($piece));\n }\n }\n\n return $new_content;\n}",
"private function _processContents()\r\n {\r\n $contents = \"\";\r\n foreach ($this->_bagBody->objects as $obj) {\r\n $isInfoKey = false;\r\n foreach ($this->_aryInfoKeys as $infoKey)\r\n if ($infoKey == $obj['key'])\r\n $isInfoKey = true;\r\n \r\n if ($obj['probableText'] == true && !$isInfoKey)\r\n $contents .= $obj['contents'];\r\n } \r\n $this->_contents = $contents;\r\n }",
"protected function str_to_component( $content ) {\n\t\tif ( strpos( $content, ':' ) !== false ) {\n\t\t\tif ( ( preg_match( '/[\\s]*(.+)[\\s]*:[\\s]*(.+)[\\s]*/ui', $content, $matches ) ) ) {\n\t\t\t\t$matches[1] = trim( $matches[1] );\n\t\t\t\t$matches[2] = trim( $matches[2] );\n\t\t\t\tif ( $matches[1] AND $matches[2] !== '' ) {\n\n\t\t\t\t\t// Override default values\n\t\t\t\t\t$i = 0;\n\t\t\t\t\t$used = false;\n\t\t\t\t\tforeach ( $this->component as $component ) {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t( strtolower( $component['name'] ) == strtolower( $matches[1] ) ) AND\n\t\t\t\t\t\t\t( strpos( strtolower( $matches[2] ), 'group end' ) === false ) AND\n\t\t\t\t\t\t\t( strpos( strtolower( $matches[2] ), 'ooto end' ) === false )\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t$this->component[$i]['val'] = $matches[2];\n\t\t\t\t\t\t\t$used = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t++$i;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !$used ) {\n\t\t\t\t\t\tif ( strpos( $matches[1], ' OPTION' ) !== false ) {\n\n\t\t\t\t\t\t\t// (Some Text) '(1)' OPTION '(name of option)'\n\t\t\t\t\t\t\tif ( ( preg_match( '/(.+)\\s+\\'(\\d+)\\'\\s+OPTION\\s+\\'(.+)\\'[\\s]*/ui', $matches[1], $matches_option ) ) ) {\n\t\t\t\t\t\t\t\t$i = $this->position_of_param( $matches_option[1] );\n\t\t\t\t\t\t\t\tif ( $i !== false ) {\n\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t!isset( $this->component[$i]['options'][$matches_option[2]]['options'] ) or\n\t\t\t\t\t\t\t\t\t\t!is_array( $this->component[$i]['options'][$matches_option[2]]['options'] )\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t$this->component[$i]['options'][$matches_option[2]]['options'] = array();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$this->component[$i]['options'][$matches_option[2]]['options'][$matches_option[3]] = $matches[2];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// (Some Text) OPTION '(name of option)'\n\t\t\t\t\t\t\t} elseif ( ( preg_match( '/(.+)\\s+OPTION\\s+\\'(.+)\\'[\\s]*/ui', $matches[1], $matches_option ) ) ) {\n\t\t\t\t\t\t\t\t$i = $this->position_of_param( $matches_option[1] );\n\t\t\t\t\t\t\t\tif ( $i !== false ) {\n\t\t\t\t\t\t\t\t\tif ( !isset( $this->component[$i]['options'] ) or !is_array( $this->component[$i]['options'] ) ) {\n\t\t\t\t\t\t\t\t\t\t$this->component[$i]['options'] = array();\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$this->component[$i]['options'][$matches_option[2]] = $matches[2];\n\n\t\t\t\t\t\t\t\t\tif ( strtolower( $this->component[$i]['val'] ) == 'ooto tab' ) {\n\t\t\t\t\t\t\t\t\t\t$this->component[$i]['options']['i'] = $this->tab_position_in_ooto( $matches[2] );\n\t\t\t\t\t\t\t\t\t\t$this->tab_ooto( $matches[2], $matches_option[1] );\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} else {\n\n\t\t\t\t\t\t\t// (Some Text) '(1)'\n\t\t\t\t\t\t\tif ( ( preg_match( '/(.+)\\s+\\'(\\d+)\\'/ui', $matches[1], $matches_option ) ) ) {\n\t\t\t\t\t\t\t\t$i = $this->position_of_param( $matches_option[1] );\n\t\t\t\t\t\t\t\tif ( $i !== false ) {\n\t\t\t\t\t\t\t\t\tif ( !isset( $this->component[$i]['options'] ) or !is_array( $this->component[$i]['options'] ) ) {\n\t\t\t\t\t\t\t\t\t\t$this->component[$i]['options'] = array();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif ( !isset( $this->component[$i]['options'][$matches_option[2]] ) or !is_array( $this->component[$i]['options'][$matches_option[2]] ) ) {\n\t\t\t\t\t\t\t\t\t\t$this->component[$i]['options'][$matches_option[2]] = array();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$this->component[$i]['options'][$matches_option[2]]['val'] = $matches[2];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\n\t\t\t\t\t\t\t\t// (Some Text)\n\t\t\t\t\t\t\t\tarray_push( $this->component, array( 'name' => $matches[1], 'val' => $matches[2] ) );\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\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"protected function _getParser() {}",
"public function main($content, $conf = NULL) {\n\t\treturn $this->parse($content, $conf);\n\t}",
"function parse()\n {\n $params=$this->layoutManager->getPluginParams(\"L\");\n $tLang=$params[\"lang\"];\n $el=$this->getSubElements();\n $id=$el[\"ID\"][\"text\"];\n $textNode=$el[\"C\"][\"node\"];\n $layoutContents=$textNode->contents;\n $nContents=count($layoutContents);\n if($nContents==0)\n return;\n\n $curVar=1;\n $phpCode=array();\n $newContents=array();\n $currentNode=array(\"TYPE\"=>\"HTML\",\"TEXT\"=>\"\");\n $newContents[]=$currentNode;\n /* Supongamos una lista de layoutContents del tipo HTML - PHP - HTML : ej: a <?php echo \"p\";?> b\n * Para buscar la traduccion, hay que actuar como si fuera 1 solo layoutContent de tipo a %1 b\n * Por eso, el resultado debe ser 1 solo layoutcontent de tipo HTML, aunque dentro, contenga codigo php.\n * \n */\n $html=\"\";\n for($k=0;$k<$nContents;$k++)\n { \n if($layoutContents[$k][\"TYPE\"]==\"HTML\")\n {\n $html.=$layoutContents[$k][\"TEXT\"];\n }\n else\n {\n if($layoutContents[$k][\"TYPE\"]==\"PHP\")\n {\n $html.=\"{%\".$curVar.\"}\";\n $phpCode[$curVar]=$layoutContents[$k][\"TEXT\"];\n $curVar++;\n }\n else\n {\n // Se traduce el nodo HTML actual\n $currentNode[\"TEXT\"]=$this->parseTranslation($tLang,$id,$phpCode,$html);\n // Se copia el nodo que hemos encontrado, tal cual (no es ni PHP ni HTML)\n $newContents[]=$layoutContents[$k];\n // Se crea el siguiente nodo HTML.\n $currentNode=array(\"TYPE\"=>\"HTML\",\"TEXT\"=>\"\");\n $newContents[]=$currentNode;\n $html=\"\";\n $phpCode=array();\n $curVar=1;\n }\n \n }\n } \n // Al llegar aqui, nos queda el ultimo nodo HTML creado.Hay que parsearlo.\n $currentNode[\"TEXT\"]=$this->parseTranslation($tLang,$id,$phpCode,$html);\n return $newContents;\n }",
"function main($content, $conf) {\r\n\t\t$titleParsed = str_replace(' ', '-', $conf['title']); \r\n\t\treturn $titleParsed;\r\n\t}",
"function main($content,$conf)\t{\n\t\t$this->conf=$conf;\n\t\t$this->pi_setPiVarDefaults();\n\t\t$this->pi_loadLL();\n\t\t$this->pi_initPIflexForm(); // Einmal am Anfang der Klasse\n $this->gp = $_GET[$this->extKey];\n // Service einbinden\n require_once(t3lib_extMgm::siteRelPath('yuieditor').'sv1/class.tx_yuieditor_sv1.php');\n $this->yui = t3lib_div::makeInstance('tx_yuieditor_sv1');\n // Flexform values\n $this->code = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'bereich', 'sDEF');\n\n // Processing...\n\t $this->yui->renderEditor('test');\n\t $content = '<textarea id=\"test\">test</textarea>';\n\t\treturn $this->pi_wrapInBaseClass($content);\n\t}",
"public function testContentParsing() {\n\n require_once __DIR__ . '/../../../../wp-load.php';\n\n $content = file_get_contents(__DIR__ . '/testResources/content.html');\n $filterKeywords = array(\n 'whiteList' => array('pagemaker'),\n 'blackList' => array('desktop')\n );\n $filterMode = 'white_list';\n $contentParser = new Content();\n echo $parsedContent = $contentParser->convertContent($content, $filterKeywords, $filterMode);\n }",
"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}",
"function parseHTML(){\n\t\t$code = preg_replace_callback('~(href|src|codebase|url|action)\\s*=\\s*([\\'\\\"])?(?(2) (.*?)\\\\2 | ([^\\s\\>]+))~isx',array('self','parseExtURL'),$this->source);\n\t\t$code = preg_replace_callback('~(<\\s*style.*>)(.*)<\\s*/\\s*style\\s*>~iUs',Array('self','parseCSS'),$code);\n\t\t$code = preg_replace_callback('~(style\\s*=\\s*)([\\'\\\"])(.*)\\2~iUs',Array('self','parseStyle'),$code);\n\t\t$code = preg_replace_callback('~<script(\\s*.*)>(.*)<\\s*/\\s*script>~iUs',Array('self','parseScriptTag'),$code);\n\t\t$this->output = $code;\n\t}",
"public function parse()\n {\n $contents = file_get_contents($this->uploadPath);\n if ($contents === false)\n {\n throw new Exception(\"SYSTEM: Can't read temp file\");\n }\n\n $comments = array();\n $css = array();\n $fontFamilies = array();\n $colors = array();\n\n // store and remove comments - found this regex on official CSS 2.1 spec page\n preg_match_all('|\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\/|',$contents, $comments, PREG_SET_ORDER);\n $contents = preg_replace('|\\/\\*[^*]*\\*+([^/*][^*]*\\*+)*\\/|','',$contents);\n\n // strip newlines\n $contents = preg_replace('/\\n/','',$contents);\n\n // can't take credit for this regex, found on stackexchange\n preg_match_all('/([^{]+)\\s*\\{\\s*([^}]+)\\s*}/',$contents, $css, PREG_SET_ORDER);\n\n // also can't take credit for this regex\n preg_match_all('/font-family\\s*?:.*?(;|(?=\"\"|\\'|;))/',$contents, $fontFamilies, PREG_SET_ORDER);\n\n // a couple more random data points\n preg_match_all('/color\\s*?:.*?(;|(?=\"\"|\\'|;))/',$contents, $colors, PREG_SET_ORDER);\n\n\n $this->parsedData['comments'] = $comments;\n $this->parsedData['css'] = $css;\n $this->parsedData['font_families'] = $fontFamilies;\n $this->parsedData['colors'] = $colors;\n\n }",
"public static function parse($text) : string\n\t{\n\t\tforeach(self::$schema as $code => $html)\n\t\t\t$text = str_replace($code, $html, $text);\n\n\t\treturn $text;\n\t}",
"function parse($data = \"\") {\n // bold, italic, h2 (Название)\n $data = preg_replace(\"/<span class=rvts78>(.+?)\\s?<\\/span>/i\",\"##**_$1_**\",$data);\n // bold. h3 (коротко)\n $data = preg_replace(\"/<span class=rvts23>(.+?)\\s?<\\/span>/i\",\"###**$1**\",$data);\n // bold (Статья)\n $data = preg_replace(\"/<span class=rvts(?:9|44)>(.+?)\\s?<\\/span>/i\",\"**$1**\",$data);\n // bold h4 (Раздел)\n $data = preg_replace(\"/<span class=rvts15>(.+?)\\s?<\\/span>/i\",\"####**$1**\",$data);\n\n $container = $data;\n\n $container = strip_tags($container);\n $container = preg_replace(\"/ /s\",\" \",$container);\n $container = preg_replace(\"/(\\r\\n|\\n|\\r)+/s\",\"\\n\\n\",$container);\n return trim($container);\n}",
"function render($format = 'Xhtml')\n {\n // the rendering method we're going to use from each rule\n $format = ucwords(strtolower($format));\n \n // the eventual output text\n $output = '';\n \n // when passing through the parsed source text, keep track of when\n // we are in a delimited section\n $in_delim = false;\n \n // when in a delimited section, capture the token key number\n $key = '';\n \n // load the format object\n $this->loadFormatObj($format);\n \n // pre-rendering activity\n if (is_object($this->formatObj[$format])) {\n $output .= $this->formatObj[$format]->pre();\n }\n \n // load the render objects\n foreach (array_keys($this->parseObj) as $rule) {\n $this->loadRenderObj($format, $rule);\n }\n \n // pass through the parsed source text character by character\n $k = strlen($this->source);\n for ($i = 0; $i < $k; $i++) {\n \n // the current character\n $char = $this->source{$i};\n \n // are alredy in a delimited section?\n if ($in_delim) {\n \n // yes; are we ending the section?\n if ($char == $this->delim) {\n \n // yes, get the replacement text for the delimited\n // token number and unset the flag.\n $key = (int)$key;\n $rule = $this->tokens[$key][0];\n $opts = $this->tokens[$key][1];\n $output .= $this->renderObj[$rule]->token($opts);\n $in_delim = false;\n \n } else {\n \n // no, add to the dlimited token key number\n $key .= $char;\n \n }\n \n } else {\n \n // not currently in a delimited section.\n // are we starting into a delimited section?\n if ($char == $this->delim) {\n // yes, reset the previous key and\n // set the flag.\n $key = '';\n $in_delim = true;\n } else {\n // no, add to the output as-is\n $output .= $char;\n }\n }\n }\n \n // post-rendering activity\n if (is_object($this->formatObj[$format])) {\n $output .= $this->formatObj[$format]->post();\n }\n \n // return the rendered source text.\n return $output;\n }\n \n \n /**\n * \n * Returns the parsed source text with delimited token placeholders.\n * \n * @access public\n * \n * @return string The parsed source text.\n * \n */\n \n function getSource()\n {\n return $this->source;\n }\n \n \n /**\n * \n * Returns tokens that have been parsed out of the source text.\n * \n * @access public\n * \n * @param array $rules If an array of rule names is passed, only return\n * tokens matching these rule names. If no array is passed, return all\n * tokens.\n * \n * @return array An array of tokens.\n * \n */\n \n function getTokens($rules = null)\n {\n if (is_null($rules)) {\n return $this->tokens;\n } else {\n settype($rules, 'array');\n $result = array();\n foreach ($this->tokens as $key => $val) {\n if (in_array($val[0], $rules)) {\n $result[] = $val;\n }\n }\n return $result;\n }\n }\n \n \n /**\n * \n * Add a token to the Text_Wiki tokens array, and return a delimited\n * token number.\n * \n * @access public\n * \n * @param array $options An associative array of options for the new\n * token array element. The keys and values are specific to the\n * rule, and may or may not be common to other rule options. Typical\n * options keys are 'text' and 'type' but may include others.\n * \n * @param boolean $id_only If true, return only the token number, not\n * a delimited token string.\n * \n * @return string|int By default, return the number of the\n * newly-created token array element with a delimiter prefix and\n * suffix; however, if $id_only is set to true, return only the token\n * number (no delimiters).\n * \n */\n \n function addToken($rule, $options = array(), $id_only = false)\n {\n // increment the token ID number. note that if you parse\n // multiple times with the same Text_Wiki object, the ID number\n // will not reset to zero.\n static $id;\n if (! isset($id)) {\n $id = 0;\n } else {\n $id ++;\n }\n \n // force the options to be an array\n settype($options, 'array');\n \n // add the token\n $this->tokens[$id] = array(\n 0 => $rule,\n 1 => $options\n );\n \n // return a value\n if ($id_only) {\n // return the last token number\n return $id;\n } else {\n // return the token number with delimiters\n return $this->delim . $id . $this->delim;\n }\n }\n \n \n /**\n * \n * Set or re-set a token with specific information, overwriting any\n * previous rule name and rule options.\n * \n * @access public\n * \n * @param int $id The token number to reset.\n * \n * @param int $rule The rule name to use.\n * \n * @param array $options An associative array of options for the\n * token array element. The keys and values are specific to the\n * rule, and may or may not be common to other rule options. Typical\n * options keys are 'text' and 'type' but may include others.\n * \n * @return void\n * \n */\n \n function setToken($id, $rule, $options = array())\n {\n // reset the token\n $this->tokens[$id] = array(\n 0 => $rule,\n 1 => $options\n );\n }\n \n \n /**\n * \n * Load a rule parser class file.\n * \n * @access public\n * \n * @return bool True if loaded, false if not.\n * \n */\n \n function loadParseObj($rule)\n {\n $rule = ucwords(strtolower($rule));\n $file = $rule . '.php';\n $class = \"Text_Wiki_Parse_$rule\";\n \n if (! class_exists($class)) {\n $loc = $this->findFile('parse', $file);\n if ($loc) {\n // found the class\n include_once $loc;\n } else {\n // can't find the class\n $this->parseObj[$rule] = null;\n return false;\n }\n }\n \n $this->parseObj[$rule] = new $class($this);\n\n }\n \n \n /**\n * \n * Load a rule-render class file.\n * \n * @access public\n * \n * @return bool True if loaded, false if not.\n * \n */\n \n function loadRenderObj($format, $rule)\n {\n $format = ucwords(strtolower($format));\n $rule = ucwords(strtolower($rule));\n $file = \"$format/$rule.php\";\n $class = \"Text_Wiki_Render_$format\" . \"_$rule\";\n \n if (! class_exists($class)) {\n // load the class\n $loc = $this->findFile('render', $file);\n if ($loc) {\n // found the class\n include_once $loc;\n } else {\n // can't find the class\n return false;\n }\n }\n \n $this->renderObj[$rule] = new $class($this);\n }\n \n \n /**\n * \n * Load a format-render class file.\n * \n * @access public\n * \n * @return bool True if loaded, false if not.\n * \n */\n \n function loadFormatObj($format)\n {\n $format = ucwords(strtolower($format));\n $file = $format . '.php';\n $class = \"Text_Wiki_Render_$format\";\n \n if (! class_exists($class)) {\n $loc = $this->findFile('render', $file);\n if ($loc) {\n // found the class\n include_once $loc;\n } else {\n // can't find the class\n return false;\n }\n }\n \n $this->formatObj[$format] = new $class($this);\n }\n \n \n /**\n * \n * Add a path to a path array.\n * \n * @access public\n * \n * @param string $type The path-type to add (parse or render).\n * \n * @param string $dir The directory to add to the path-type.\n * \n * @return void\n * \n */\n \n function addPath($type, $dir)\n {\n $dir = $this->fixPath($dir);\n if (! isset($this->path[$type])) {\n $this->path[$type] = array($dir);\n } else {\n array_unshift($this->path[$type], $dir);\n }\n }\n \n \n /**\n * \n * Get the current path array for a path-type.\n * \n * @access public\n * \n * @param string $type The path-type to look up (plugin, filter, or\n * template). If not set, returns all path types.\n * \n * @return array The array of paths for the requested type.\n * \n */\n \n function getPath($type = null)\n {\n if (is_null($type)) {\n return $this->path;\n } elseif (! isset($this->path[$type])) {\n return array();\n } else {\n return $this->path[$type];\n }\n }\n \n \n /**\n * \n * Searches a series of paths for a given file.\n * \n * @param array $type The type of paths to search (template, plugin,\n * or filter).\n * \n * @param string $file The file name to look for.\n * \n * @return string|bool The full path and file name for the target file,\n * or boolean false if the file is not found in any of the paths.\n *\n */\n \n function findFile($type, $file)\n {\n // get the set of paths\n $set = $this->getPath($type);\n \n // start looping through them\n foreach ($set as $path) {\n $fullname = $path . $file;\n if (file_exists($fullname) && is_readable($fullname)) {\n return $fullname;\n }\n }\n \n // could not find the file in the set of paths\n return false;\n }\n \n \n /**\n * \n * Append a trailing '/' to paths, unless the path is empty.\n * \n * @access private\n * \n * @param string $path The file path to fix\n * \n * @return string The fixed file path\n * \n */\n \n function fixPath($path)\n {\n $len = strlen($this->_dirSep);\n \n if (! empty($path) &&\n substr($path, -1 * $len, $len) != $this->_dirSep) {\n return $path . $this->_dirSep;\n } else {\n return $path;\n }\n }\n}",
"function parse(&$reader, &$ctxt)\r\n\t{\r\n\t\t$parser =& new PhaseParser($reader, $ctxt);\r\n\t\t$output = '';\r\n\t\t\r\n\t\t// NOTE: this method provides an easy way to setup the tag libraries\r\n\t\t$parser->loadTagLibraries();\r\n\r\n\t\twhile ($reader->hasMoreInput())\r\n\t\t{\r\n\t\t\t$output .= $parser->parseElements();\r\n\t\t}\r\n\r\n\t\t// tack on the tag functions, wrapping them in the namespace\r\n\t\t// for this phase context\r\n\t\tif (count($parser->tagFunctions))\r\n\t\t{\r\n\t\t\t$output .= \r\n\t\t\t'<?php' . \"\\n\" .\r\n\t\t\t'class ' . $parser->namespace . ' {' . \"\\n\" .\r\n\t\t\timplode(\"\\n\", array_reverse($parser->tagFunctions)) . \"\\n\" .\r\n\t\t\t'}' . \"\\n\" .\r\n\t\t\t'?>' . \"\\n\";\t\r\n\t\t}\r\n\r\n\t\t// merge sections where php tags have become adjacent (no need for them)\r\n\t\t$output = preg_replace('; *\\?><\\?php *;', ' ', $output);\r\n\r\n\t\treturn $output;\r\n\t}",
"protected function _parse($output)\n\t{\n\t\t$this->_CI->load->library('parser');\n\t\t$vars = $this->values();\n\t\t$output = $this->_CI->parser->parse_string($output, $vars, TRUE);\n\t\treturn $output;\n\t}",
"function _loadDataText() {\r\n\t\treturn unserialize(file_get_contents($this->data_txt));\r\n\t}",
"function wp_kses_split2($content, $allowed_html, $allowed_protocols)\n {\n }",
"public function parse()\n {\n $this->initProps();\n $this->initParams();\n $this->load();\n }",
"private function prepareData(){\n\t\t\t$this->text = trim($this->text);\n\t\t\t$this->user_id = intval($this->user_id);\n\t\t\t$this->parent_id = intval($this->parent_id);\n\t\t}",
"protected static function handle_vars($content) {\n\t\treturn preg_replace('/{\\- VAR ([a-z_]+)\\: (.*?) \\-}/', '<?php \\$$1 = $2; ?>', $content);\n\t}",
"public function test_getContent() : void\n {\n $subject = '{code: \"ApacheVelocity\"}Some content here.{code}';\n $expected = 'Some content here.';\n\n $this->preParseString($subject);\n\n $this->assertSame($expected, PreParser::getContent(1));\n }",
"private function parseOutput()\n {\n// $parsedOutput = explode(' ',$this->output);\n// $this->image = new Image($parsedOutput[0]);\n// $this->resolution = $parsedOutput[1];\n\n }",
"public function parse()\n {\n }",
"public function parse()\n {\n }",
"public function parse()\n {\n }",
"public function parse()\n {\n }",
"function contents($parser, $data){\n global $currentTag, $filterWords;\n $data = trim($data);\n if($currentTag == \"WORD\" && strlen($data) > 0){\n $filterWords[] = $data;\n }\n}"
] | [
"0.6701736",
"0.66947556",
"0.66947556",
"0.6681259",
"0.6618902",
"0.6526563",
"0.62483776",
"0.6221378",
"0.61714095",
"0.6159372",
"0.6156381",
"0.60390246",
"0.5995332",
"0.59187603",
"0.5909063",
"0.59069425",
"0.59069425",
"0.59069425",
"0.5861882",
"0.5839693",
"0.58386075",
"0.58386075",
"0.58386075",
"0.58386075",
"0.5813882",
"0.57938856",
"0.57841736",
"0.5778925",
"0.5731333",
"0.57218665",
"0.5719073",
"0.5713385",
"0.57095903",
"0.5704384",
"0.5683024",
"0.56782365",
"0.56467813",
"0.56234515",
"0.56061625",
"0.5582043",
"0.5562601",
"0.5559897",
"0.5529666",
"0.5523907",
"0.5521908",
"0.5511188",
"0.54977065",
"0.54775846",
"0.5472945",
"0.54593796",
"0.54587555",
"0.5448216",
"0.54345244",
"0.53960764",
"0.5385303",
"0.5364149",
"0.535697",
"0.5343478",
"0.5340083",
"0.5332995",
"0.5331763",
"0.5326377",
"0.5324165",
"0.5320017",
"0.53171897",
"0.5315488",
"0.5314898",
"0.5313363",
"0.53059775",
"0.52900195",
"0.52821064",
"0.52775276",
"0.52738005",
"0.5273151",
"0.52729255",
"0.5266613",
"0.5260738",
"0.5260186",
"0.5240378",
"0.52354676",
"0.523073",
"0.52220494",
"0.522112",
"0.5217365",
"0.5217083",
"0.5209486",
"0.52071065",
"0.5197123",
"0.51947814",
"0.5191914",
"0.5186133",
"0.5184081",
"0.5168736",
"0.516383",
"0.5162919",
"0.51369387",
"0.51334935",
"0.51334935",
"0.51326436",
"0.5132567",
"0.5130109"
] | 0.0 | -1 |
Prepares content array for boolean conversion | static protected function __boolean_trim($content)
{
$return = array();
foreach ($content as $c)
{
switch ($c['type'])
{
case Wiki_Parser_Core::NEW_LINE:
case Wiki_Parser_Core::NEW_PARAGRAPH:
break;
case Wiki_Parser_Core::ELEMENT:
$return[] = $c;
break;
case Wiki_Parser_Core::WARNING:
$return[] = $c;
break;
default:
$c['content'] = trim($c['content']);
if ($c['content'] !== '')
$return[] = $c;
break;
}
}
return $return;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static function toBoolean($content)\r\n\t{\r\n\t\t$content = Wiki_Parser_Core::__boolean_trim($content);\r\n\t\t\r\n\t\tif (count($content) != 1 || ($content[0]['type'] != Wiki_Parser_Core::ELEMENT && $content[0]['type'] != Wiki_Parser_Core::WARNING))\r\n\t\t{\r\n\t\t\t$result = Wiki_Parser_Core::toText($content);\r\n\t\t\treturn !empty($result);\r\n\t\t}\r\n\t\telseif ($content[0]['type'] == Wiki_Parser_Core::WARNING)\r\n\t\t\treturn false;\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn $content[0]['content']->toBoolean();\r\n\t\t}\r\n\t}",
"private function convertContent(){\n $newContent = array();\n foreach ($this->content as $key => $value) {\n if (is_scalar($value)) {\n $newContent[$key] = $this->format($value);\n }\n }\n return $newContent;\n }",
"function prepareData()\r\n\t{\r\n\t\treturn true;\r\n\t}",
"private function convertStringBooleans($data) {\n foreach($data as $key=>$value) {\n if($value === 'true' || $value === 'TRUE')\n $data[$key] = true;\n\n if($value === 'false' || $value === 'FALSE')\n $data[$key] = false;\n\n if (is_array($value)) {\n $data[$key] = $this->convertStringBooleans($value);\n }\n }\n\n return $data;\n }",
"protected function getCleanContent(): array\n {\n return $this->content = array_filter($this->getContent()->getArrayCopy(), function ($v) {\n if ($v instanceof ArrayObject) {\n return (bool) $v->count();\n }\n if ($v instanceof JsonSerializable) {\n return (bool) $v->jsonSerialize();\n }\n return !empty($v);\n });\n }",
"protected function _initData()\n\t{\n\t\t// Lets load the content if it doesn't already exist\n\t\tif (empty($this->_data))\n\t\t{\n\t\t\t$template = new stdClass();\n\t\t\t$this->_data = $template;\n\t\t\treturn (boolean) $this->_data;\n\t\t}\n\t\treturn true;\n\t}",
"function toBoolean() {\n return $this->content != false;\n }",
"function _initData()\n\t{\n\t\t// Lets load the content if it doesn't already exist\n\t\tif (empty($this->_data))\n\t\t{\n\t\t\t$this->_data = null;\n\t\t\treturn (boolean) $this->_data;\n\t\t}\n\t\treturn true;\n\t}",
"public function boolify(array &$array)\n {\n $array = array_map(function ($value) {\n if (!is_array($value) && !is_object($value)) {\n $value = (bool)$value;\n } elseif (!empty($value)) {\n $value = true;\n }\n\n return $value;\n }, $array);\n }",
"private function convert_to_boolean_attributes() {\n foreach ($this->attributes() as $attr => $val) {\n if (preg_match('/^can_/', $attr) || preg_match('/^is_/', $attr)) {\n $this->$attr = ($val == '1');\n }\n }\n }",
"public function testConvertToBoolean() {\r\n $data = array(\r\n true => true,\r\n false => false,\r\n 'true' => true,\r\n 'false' => false,\r\n 'test' => true,\r\n 0 => false,\r\n '0' => false,\r\n 1 => true\r\n );\r\n\r\n foreach ($data as $value => $expected) {\r\n $this->assertSame($expected, $this->_utils->convertToBoolean($value));\r\n }\r\n }",
"public function makeArray() {\n\t\tif ( $this->file == '' ) {\n\t\t\tif ( $this->rawdata == '' ) {\n\t\t\t\techo \"No filename specified, aborting\";\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\tif ( ! file_exists( $this->file ) ) {\n\t\t\t\techo \"File $this->file does not exist, aborting\";\n\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t$this->rawdata = file_get_contents( $this->file );\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->rawdata == '' ) {\n\t\t\techo \"No data in file, aborting\";\n\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->parse2array();\n\n\t\treturn true;\n\t}",
"public function isJsonArrayReturnsBoolDataProvider() {\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\tjson_encode(array('a')),\n\t\t\t\tTRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tjson_encode('a,b:c'),\n\t\t\t\tFALSE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tjson_encode(array('object' => 'a')),\n\t\t\t\tTRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tjson_encode(array(array('title' => 'test2'), array('title' => 'test2'))),\n\t\t\t\tTRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'a,b:c',\n\t\t\t\tFALSE\n\t\t\t),\n\t\t);\n\t}",
"public function isJsonArrayReturnsBoolDataProvider() {\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\tjson_encode(array('a')),\n\t\t\t\tTRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tjson_encode('a,b:c'),\n\t\t\t\tFALSE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tjson_encode(array('object' => 'a')),\n\t\t\t\tTRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tjson_encode(array(array('title' => 'test2'), array('title' => 'test2'))),\n\t\t\t\tTRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'a,b:c',\n\t\t\t\tFALSE\n\t\t\t),\n\t\t);\n\t}",
"function rest_sanitize_boolean($value)\n {\n }",
"public function provideBoolValues(): array\n {\n return [\n [true],\n [false],\n ];\n }",
"public function toArray()\n\t{\n\t\treturn ['false' => __('No'), 'true' => __('Yes')];\n\t}",
"protected static function clean_array() {\n\t\treturn array( '<', '>', '&', \"'\", '\"' );\n\t}",
"public function getBooleanArray() {\n // explicit type cast just to be sure\n return (array) $this->booleanArray;\n }",
"public function testEmptyArrayCastedToBoolGivesFalse() {\n\t\t$this->assertFalse((bool)array());\n\t}",
"public function prepareData(): array\n {\n return [];\n }",
"abstract public function unescapeBoolean($bool);",
"public function validBooleanTrueProvider() {\n\t\treturn [\n\t\t\t\"string TRUE\"\t=> [\"TRUE\"],\n\t\t\t\"string ON\"\t\t=> [\"ON\"],\n\t\t\t\"string YES\"\t=> [\"YES\"],\n\t\t\t\"string 1\"\t\t=> [\"1\"],\n\t\t\t\"integer 1\"\t\t=> [1]\n\t\t];\n\t}",
"protected function prepare() \n {\n $this->array = new ArrayNode;\n }",
"protected function preprocessData() {}",
"function bool2str($data)\n {\n TRUE === $data && $data = 'true';\n FALSE === $data && $data = 'false';\n return $data;\n }",
"public function prepareData($data)\n\t{\t\n\t\t/**\n\t\t * Fill the data (specially for the 'active', 'inactive', 'supporter' and 'newsletter':\n\t\t * they could not exist in the array when the box is not checked and in this case, the default value would be\n\t\t * used instead of the '0' one\n\t\t */\n\t\tarray_key_exists('active', $data) ? $data['active'] = '1' : $data['active'] = '0';\n\t\tarray_key_exists('inactive', $data) ? $data['inactive'] = '1' : $data['inactive'] = '0';\n\t\tarray_key_exists('supporter', $data) ? $data['supporter'] = '1' : $data['supporter'] = '0';\n\t\tarray_key_exists('newsletter', $data) ? $data['newsletter'] = '1' : $data['newsletter'] = '0';\n\n\t\treturn $data;\n\t}",
"public static function canConvert()\n\t{\n\t\treturn array(\n\t\t\t'convert_cms_pages' => array(\n\t\t\t\t'table'\t\t\t\t=> 'xf_page',\n\t\t\t\t'where'\t\t\t\t=> NULL,\n\t\t\t)\n\t\t);\n\t}",
"protected function convertFormData($data)\n {\n $converted = array();\n $blank = translate('LBL_BLANK', 'ModuleBuilder');\n foreach ($data as $key => $item) {\n if ($key === $blank) {\n $key = '';\n }\n\n $converted[$key] = (bool) $item;\n }\n\n return $converted;\n }",
"public function decodeObjectAsArray(bool $bool) : void\n {\n $this->decodeObjectAsArray = $bool;\n }",
"protected function _checkContent($content)\n {\n if (is_array($content)) {\n $exportContent = var_export($content, TRUE);\n error_class::log('inf', \"detected content as array \\n\\n $exportContent\");\n\n return serialize($content);\n }\n\n return $content;\n }",
"abstract function prepare_data(&$data_arr);",
"function studiare_get_text_transform_array($first_empty = false) {\n\t$text_transforms = array();\n\n\tif ($first_empty) {\n\t\t$text_transforms[''] = '';\n\t}\n\n\t$text_transforms['none'] = esc_html__( 'None', 'studiare' );\n\t$text_transforms['capitalize'] = esc_html__( 'Capitalize', 'studiare' );\n\t$text_transforms['uppercase'] = esc_html__( 'Uppercase', 'studiare' );\n\t$text_transforms['lowercase'] = esc_html__( 'Lowercase', 'studiare' );\n\n\treturn $text_transforms;\n}",
"public function testCopyPrepareDataEmpties() {\n\t\t$this->assertEquals(\n\t\t\t$this->Article->copyPrepareData(array()),\n\t\t\tarray()\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->copyPrepareData(null),\n\t\t\tarray()\n\t\t);\n\t\t$this->assertEquals(\n\t\t\t$this->Article->copyPrepareData(false),\n\t\t\tarray()\n\t\t);\n\t}",
"public function preprocessData()\n {\n $data = $this->getData();\n $preData = [\n 'replace' => null,\n 'remove' => null,\n 'append' => null,\n ];\n\n // Set the data to change and data to remove.\n if (!empty($data['role'])) {\n $preData['remove']['o:role'] = $data['role'];\n }\n if (array_key_exists('is_active', $data) && in_array($data['is_active'], ['0', '1'])) {\n $preData['remove']['o:is_active'] = $data['is_active'];\n }\n\n // Set remaining elements according to attribute data-collection-action.\n $processeds = [\n 'role', 'is_active',\n 'csrf', 'id', 'o:id',\n ];\n foreach ($data as $key => $value) {\n if (is_numeric($key) || in_array($key, $processeds)\n || is_null($value) || $value === ''\n ) {\n continue;\n }\n $collectionAction = $this->has($key)\n ? $this->get($key)->getAttribute('data-collection-action')\n : 'replace';\n $preData[$collectionAction][$key] = $value;\n }\n\n return array_filter($preData);\n }",
"public static function booleans()\n {\n return self::elements(false, true);\n }",
"private function prepareBoolParam($value)\n {\n if (is_bool( $value )) {\n return true === $value ? 'true' : 'false';\n }\n\n return $value;\n }",
"public function convertItemArray() {}",
"protected function needsToBeCleaned()\n {\n return boolval($this->cleanData);\n }",
"function to_boolean($val);",
"public function xml2ArrayConvertsEmptyArraysToElementWithoutContent() {}",
"public function convertCheckboxesToBool()\n\t{\n\t\t$this->convertCheckboxesToBool = true;\n\t}",
"function converter(&$value, $key){\n if($value === \"true\") {\n $value = TRUE;\n } elseif ($value === \"false\") {\n $value = FALSE;\n }\n if ($key === \"not\") {\n if ($value === \"1\") {\n $value = TRUE;\n }\n if ($value === \"0\") {\n $value = FALSE;\n }\n }\n }",
"function read_boolean(&$payload) {\n return (bool) read_byte($payload);\n}",
"public function beforeSave() {\n if ( ! empty($this->filter_id)) {\n $this->content_html = Filter::get($this->filter_id)->apply($this->content);\n }\n else {\n $this->content_html = $this->content;\n }\n return true;\n }",
"public function scrubBool(bool $data) : bool;",
"function convertBooleanValues($table, $row)\n{\n global $db_lnk;\n $qry_val_arr = array(\n $table\n );\n $result = pg_query_params($db_lnk, 'SELECT * FROM information_schema.columns WHERE table_name = $1 ', $qry_val_arr);\n while ($field_details = pg_fetch_assoc($result)) {\n if ($field_details['data_type'] == 'boolean') {\n $row[$field_details['column_name']] = ($row[$field_details['column_name']] == 'f') ? 0 : 1;\n }\n }\n return $row;\n}",
"private function prepareData($content, $user_id)\n\t{\n\t\t// Set data array.\n\t\t$data = [\n\t\t\t'content' => $content,\n\t\t\t'user_id' => $user_id,\n\t\t];\n\n\t\treturn $data;\n\t}",
"function o_castBool($value) {\n\t\t\treturn Obj::singleton()->castBool($value);\n\t\t}",
"protected function fix_boolean_settings() {\n\t\tforeach ($this->boolean_settings as $setting) {\n\t\t\t$val = $this->get_setting($setting);\n\t\t\tif ($val) {\n\t\t\t\t$this->add_setting($setting, filter_var($val, FILTER_VALIDATE_BOOLEAN));\n\t\t\t}\n\t\t}\n\t}",
"public function toArray(): array\n {\n $validClauseKeys = ['must', 'filter', 'must_not', 'should'];\n\n $body = [];\n\n foreach ($this->queries as $clause => $queries) {\n if (in_array($clause, $validClauseKeys, true)) {\n if (count($queries) === 1) {\n $body[$clause] = $queries[0]->toArray();\n } else {\n foreach ($queries as $query) {\n $body[$clause][] = $query->toArray();\n }\n }\n }\n }\n\n return [\n 'bool' => array_merge($body, $this->body),\n ];\n }",
"public function toArray()\n {\n return array(\n 'lucida' => Mage::helper('markdown')->__('Lucida Sans'),\n '' => Mage::helper('markdown')->__('Yes'),\n );\n }",
"protected function prepareData(array $data)\n {\n $data['original_text'] = $data['text'];\n $data['text'] = $this->stringProcessor ? $this->stringProcessor->prepare($data['text']) : $data['text'];\n return $data;\n }",
"function vcex_filter_grid_blocks_array( $blocks ) {\n\t$new_blocks = array();\n\tforeach ( $blocks as $key => $value ) {\n\t\tif ( 'true' == $value ) {\n\t\t\t$new_blocks[$key] = '';\n\t\t}\n\t}\n\treturn $new_blocks;\n}",
"private function clean_mms_data()\n {\n // Set result default value to FALSE\n $_result = FALSE;\n \n if ($this->_mms_data && is_array($this->_mms_data)) {\n foreach ($this->_mms_data as $_key => $_value) {\n if (isset($_value['payload'])) {\n $_clean_str = $this->remove_escaped_chars($_value['payload']);\n if ($_clean_str && is_string($_clean_str)) {\n $this->_mms_data[$_key]['payload'] = $_clean_str;\n }\n \n // Check if the escaped backslash character has been removed from the payload value string\n $_result = preg_match_all('@\\\\\\\"|\\\\\\/@', $this->_mms_data[$_key]['payload']) ? FALSE : TRUE;\n }\n }\n }\n \n return $_result;\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}",
"protected function preparePrimitives()\n {\n /* Primitive collections */\n $this->aframeDomObj->appendEntities($this->childrens);\n /* Primitives which only one can be present */\n\n (! $this->sky) ?: $this->aframeDomObj->appendEntity($this->sky);\n (! $this->videosphere) ?: $this->aframeDomObj->appendEntity($this->videosphere);\n }",
"function gotravel_mikado_get_text_transform_array($first_empty = false) {\n\t\t$text_transforms = array();\n\n\t\tif($first_empty) {\n\t\t\t$text_transforms[''] = '';\n\t\t}\n\n\t\t$text_transforms['none'] = esc_html__('None', 'gotravel');\n\t\t$text_transforms['capitalize'] = esc_html__('Capitalize', 'gotravel');\n\t\t$text_transforms['uppercase'] = esc_html__('Uppercase', 'gotravel');\n\t\t$text_transforms['lowercase'] = esc_html__('Lowercase', 'gotravel');\n\n\t\treturn $text_transforms;\n\t}",
"private function _prepareRow($array){\n return array_merge($this->_blankRow, $array);\n }",
"public function convertPlainArrayToTypoScriptArrayTestdata() {}",
"function wpsl_bool_check( $atts ) {\n\n foreach ( $atts as $key => $val ) {\n if ( in_array( $val, array( 'true', '1', 'yes', 'on' ) ) ) {\n $atts[$key] = true;\n } else if ( in_array( $val, array( 'false', '0', 'no', 'off' ) ) ) {\n $atts[$key] = false;\n }\n }\n\n return $atts;\n}",
"public function prepare(){\n\t\treturn array(\n\t\t\t'creationData' => $this->creationData->prepare(),\n\t\t\t'modificationHistory' => $this->modificationHistory->prepare() );\t\t\n\t}",
"function array_false($arr, $is_key=FALSE) {\n if ($is_key)\n $arr = array_keys($arr);\n\n foreach ($arr as $val) {\n $row[$val] = FALSE;\n }\n return $row;\n}",
"public function toArray() {\n\t\treturn array (\n\t\t\t\t'true' => Mage::helper ( 'masterpass' )->__ ( 'true' ),\n\t\t\t\t'false' => Mage::helper ( 'masterpass' )->__ ( 'false' ) \n\t\t)\n\t\t;\n\t}",
"public function unsetBooleanValue(): void\n {\n $this->booleanValue = [];\n }",
"public function isPrependingType(): bool;",
"function fastshop_sanitize_checkbox( $checked ) {\n return (bool) $checked;\n}",
"abstract public function prepareData();",
"protected function prepareValue($value) {\n $result = $value;\n if (is_bool($result)) {\n if ($value) {\n $result = '1';\n } else {\n $result = '0';\n }\n } else if (strpos($result, \"\\n\") !== FALSE) {\n// $result = '\"' . $result . '\"';\n// $result = preg_replace(\"/\\t/\", \"\\\\t\", $result);\n// $result = preg_replace(\"/\\r?\\n/\", \"\\\\n\", $result);\n $result = str_replace(\"\\n\", PHP_EOL, $result);\n }\n return $result;\n }",
"function cleanPageStructureArray($array) {\r\n\t\t$newPageStructureArray = array();\r\n\t\tforeach($array as $index => $value) {\r\n\t\t\tif($value[0] === \"?\" && strlen($value[1]) === 0) {\r\n\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\t$newPageStructureArray[] = $value;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $newPageStructureArray;\r\n\t}",
"public static function prepareBool($value)\n {\n return (bool) $value;\n }",
"public function transform($item)\n {\n return [\n 'title'=>$item['title'],\n 'description'=>$item['description'],\n 'active'=>(boolean)$item['active']\n ];\n }",
"public function prepare($body, $smileys_enabled);",
"private function unCdata($array) {\n //$return = array();\n foreach ($array as $key => $value) {\n if (is_array($value) && isset($value['@cdata'])) {\n $array[$key] = $value['@cdata'];\n }\n elseif(is_array($value)) {\n $array[$key] = $this->unCdata($value);\n }\n }\n return $array;\n }",
"public function beforeCompile(): ?array;",
"public function toArray(): array\n {\n return [\n 'type' => 'not',\n 'field' => $this->filter->toArray(),\n ];\n }",
"function convert_content_capableof($conversion) {\n global $settings;\n return is_array($settings['converters']) &&\n array_key_exists($conversion, $settings['converters']) &&\n function_exists($settings['converters'][$conversion]);\n}",
"function fm_clean_checkbox_array() {\r\n\t$cb = optional_param('cb', array(), PARAM_RAW);\r\n\t//echo $cb;\r\n\tif (is_array($cb)) {\r\n\t\t$tmp = array();\r\n\t\tforeach($cb as $c) {\r\n\t\t\tif(substr($c,0,4) == 'fold') {\r\n\t\t\t\t$tmp[] = 'f-'.(int)substr($c, 4);\r\n\t\t\t} else if (substr($c,0,2) == \"f-\") {\r\n\t\t\t\t$tmp[] = 'f-'.(int)substr($c, 2);\r\n\t\t\t} else {\r\n\t\t\t\t$tmp[] = (int)$c;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$cb = $tmp;\r\n\t} else {\r\n\t\tif (substr($cb, 0, 4) == 'fold') {\r\n\t\t\t$cb[] = 'f-'.(int)substr($cb, 4);\r\n\t\t} else if (substr($cb, 2) == 'f-') {\r\n\t\t\t$cb[] = 'f-'.(int)substr($cb, 2);\r\n\t\t} else {\r\n\t\t\t//$cb[] = (int)$cb;\r\n\t\t\t//$singlecb = NULL;\r\n\t\t\t//$cb[] = $singlecb;\r\n\t\t}\r\n\t}\t\r\n\t// Removes 0 as default\r\n\t$nullify = false;\r\n\tforeach ($cb as $c) {\r\n\t\tif ($c == 0 && substr($c, 0, 2) != 'f-') {\r\n\t\t\t$nullify = true;\r\n\t\t} else {\t\r\n\t\t\t$nullify = false;\r\n\t\t}\r\n\t}\r\n\tif ($nullify == true) {\r\n\t\t$cb = NULL;\r\n\t}\r\n\t\r\n\treturn $cb;\r\n}",
"function toBoolean(){\n\t\tif(in_array($this->lower(),array('','false','off','no','n','f'))){\n\t\t\treturn false;\n\t\t}\n\t\treturn (bool)$this->toString();\n\t}",
"public function toArray():array {\n return [\n 'name' => $this->name,\n 'description' => $this->description,\n 'points' => $this->points,\n 'deadline' => $this->deadline,\n 'for_newcomer' => $this->for_newcomer === \"1\" ?true:false\n ];\n }",
"public function __construct()\n {\n $this->transformations = [\n function ($value) : bool {\n return 'false' === $value ? false : (bool) $value;\n }\n ];\n }",
"public function transform($lesson)\n {\n return [\n 'title' => $lesson['title'],\n 'body' => $lesson['body'],\n 'active' => (boolean)$lesson['some_bool'],\n ];\n }",
"private function process_array($value) {\n return is_array($value);\n }",
"public function convertTypoScriptArrayToPlainArrayTestdata() {}",
"protected function initializeFilters()\r\n\t{\r\n\t\t$this->iso_filterFields = deserialize($this->iso_filterFields, true);\r\n\t\t\r\n\t\tif(!empty($this->iso_filterFields))\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\tif ($this->iso_filterTpl)\r\n\t\t{\r\n\t\t\t$this->strTemplate = $this->iso_filterTpl;\r\n\t\t}\r\n\t\t\r\n\t\treturn false;\r\n\t}",
"public function clean_boolean($input)\r\n {\r\n settype($input, 'boolean');\r\n return $input;\r\n }",
"protected function _changeBooleansToNumbers(Array $data) {\n\t\t// Note the order of arguments and the & in front of $value\n\t\tarray_walk_recursive($data, array($this, '__converter'));\n\t\treturn $data;\n\t}",
"protected function checkAlwaysPopulateRawPostDataSetting() {}",
"public function cargarArrayResponse(bool $res,string $msg)\n {\n $this->response['res'] = $res;\n $this->response['msg'] = $msg;\n }",
"public function getValues() {\n $values = parent::getValues();\n return array_merge($values, Array('0'=>__('general.bool_no'), '1'=>__('general.bool_yes')));\n }",
"private function check_make_input()\n {\n $output = [];\n\n if (!isset($_POST['token']) || !isset($_POST['new_only']) || !isset($_POST['emptys']) || !isset($_POST['wrongs']) || !isset($_POST['answer_result']) || !isset($_POST['random']) || !isset($_POST['length']) || !isset($_POST['category']))\n return false;\n\n if (empty($_POST['token']) || empty($_POST['new_only']) || empty($_POST['emptys']) || empty($_POST['wrongs']) || empty($_POST['answer_result']) || empty($_POST['random']) || empty($_POST['length']))\n return false;\n\n $output = [\n \"token\" => (string) $_POST[\"token\"],\n \"new_only\" => (bool) $_POST[\"new_only\"],\n \"emptys\" => (bool) $_POST[\"emptys\"],\n \"wrongs\" => (bool) $_POST[\"wrongs\"],\n \"answer_result\" => (bool) $_POST[\"answer_result\"],\n \"random\" => (bool) $_POST[\"random\"],\n \"length\" => (int) $_POST[\"length\"],\n \"category\" => (array) json_decode($_POST[\"category\"]),\n ];\n return $output;\n }",
"private function _from_array($array, $par, $xss_clean = false)\n {\n if(isset($array[$par])) {\n if($xss_clean) {\n return $this->xss_clean($array[$par]);\n }\n else\n return $array[$par];\n }\n else if($par == null) {\n if($xss_clean) {\n return $this->xss_clean($array);\n }\n else\n return $array;\n }\n else\n return false;\n }",
"public function toArray() {\n return [\n 'content' => $this->content,\n 'status' => $this->status\n ];\n }",
"public static function sanitize($data, bool $array = true)\n {\n return json_decode(json_encode($data), $array);\n }",
"public function toArray() {\n $output = array();\n foreach($this->_magicProperties as $key => $value) {\n if (in_array($key,$this->translation)) {\n $output[array_search($key,$this->translation)] = $value;\n }else{\n $output[$key] = $value;\n }\n }\n return $this->_postarray($output);\n }",
"private function prepareArray()\n {\n $tempItems = trim(Input::get('items'));\n $items = explode(PHP_EOL, $tempItems);\n $badItemsToTest = ['shp#', 'totals', 'total', 'shipment', 'shipment#', ''];\n\n $finalArray = array();\n\n foreach ($items as $item) {\n\n if (in_array(strtolower(trim($item)), $badItemsToTest) == false) {\n array_push($finalArray, trim($item));\n }\n\n }\n return $finalArray;\n\n\n }",
"function PrepBool(&$bool,$blnNullable = true) {\n $bool = (integer)$bool;\n }",
"function preWeekContent() {\n\t\tif (func_num_args() >= 2) {\n\t\t\t$week = intval(func_get_arg(0));\n\t\t\t$content = trim(func_get_arg(1));\n\t\t\t\n\t\t\tif ($week >= 1 && $week <= 6) {\n\t\t\t\t$this->_preWeekArray[$week] = $content;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\telseif (func_num_args() == 1) {\n\t\t\t$day = intval(func_get_arg(0));\n\t\t\t\n\t\t\tif (array_key_exists($week,$this->_preWeekArray)) {\n\t\t\t\treturn $this->_fillContent($this->_preWeekArray[$week]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t} \n\t\telse {\n\t\t\treturn $this->_preWeekArray;\n\t\t\t//user_error(\"You must pass at least one argument to the preWeekContent function of the Calendar class\", E_NOTICE);\n\t\t}\n\t}",
"protected function _loadData()\n\t{\n\t\t// Lets load the content if it doesn't already exist\n\t\tif (empty($this->_data))\n\t\t{\n\t\t\t$file\t\t= $this->_client->path.DS.'templates'.DS.$this->_template.DS.'index.php';\n\n\t\t\t// Read the source file\n\t\t\tjimport('joomla.filesystem.file');\n\t\t\t$content = JFile::read($file);\n\n\t\t\tif ($content === false)\n\t\t\t{\n\t\t\t\t$this->setError(JText::sprintf('Operation Failed Could not open', $file));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$content = htmlspecialchars($content, ENT_COMPAT, 'UTF-8');\n\n\t\t\t$this->_data = $content;\n\t\t\treturn (boolean) $this->_data;\n\t\t}\n\t\treturn true;\n\t}",
"public function hasContent(){ return !empty($this->content); }"
] | [
"0.5847623",
"0.5777596",
"0.56586695",
"0.5655845",
"0.55385774",
"0.55211246",
"0.54677653",
"0.54483616",
"0.54424417",
"0.537309",
"0.52657694",
"0.5235262",
"0.5210518",
"0.5210518",
"0.5209036",
"0.5195377",
"0.51793647",
"0.509323",
"0.5090657",
"0.50481176",
"0.50276196",
"0.50218606",
"0.50207126",
"0.5007695",
"0.496951",
"0.4956569",
"0.4954133",
"0.49390242",
"0.49351394",
"0.49301404",
"0.49264142",
"0.49041837",
"0.48971117",
"0.48447227",
"0.48436058",
"0.48241544",
"0.4795917",
"0.47890845",
"0.4780175",
"0.4768996",
"0.47636324",
"0.47580558",
"0.47577614",
"0.47550604",
"0.47510645",
"0.475024",
"0.47492367",
"0.4744059",
"0.4740197",
"0.47364676",
"0.47350803",
"0.47318885",
"0.47305015",
"0.47151086",
"0.4714959",
"0.47135237",
"0.4704849",
"0.468428",
"0.4677157",
"0.46728244",
"0.46727955",
"0.46650386",
"0.46450472",
"0.46430284",
"0.4642469",
"0.464014",
"0.46387142",
"0.46371832",
"0.4627882",
"0.46270543",
"0.4626859",
"0.46161774",
"0.4614816",
"0.4610719",
"0.4609269",
"0.46054274",
"0.4603012",
"0.46018937",
"0.45996067",
"0.45990002",
"0.45824984",
"0.45793095",
"0.4574591",
"0.45739025",
"0.45734805",
"0.45716426",
"0.4563201",
"0.45613188",
"0.45514244",
"0.45464173",
"0.45409194",
"0.45364907",
"0.4536236",
"0.45318106",
"0.45304695",
"0.45260847",
"0.45251217",
"0.45237315",
"0.45234784",
"0.45188352"
] | 0.5623857 | 4 |
Convert content array to boolean | static function toBoolean($content)
{
$content = Wiki_Parser_Core::__boolean_trim($content);
if (count($content) != 1 || ($content[0]['type'] != Wiki_Parser_Core::ELEMENT && $content[0]['type'] != Wiki_Parser_Core::WARNING))
{
$result = Wiki_Parser_Core::toText($content);
return !empty($result);
}
elseif ($content[0]['type'] == Wiki_Parser_Core::WARNING)
return false;
else
{
return $content[0]['content']->toBoolean();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toBoolean() {\n return $this->content != false;\n }",
"public function testConvertToBoolean() {\r\n $data = array(\r\n true => true,\r\n false => false,\r\n 'true' => true,\r\n 'false' => false,\r\n 'test' => true,\r\n 0 => false,\r\n '0' => false,\r\n 1 => true\r\n );\r\n\r\n foreach ($data as $value => $expected) {\r\n $this->assertSame($expected, $this->_utils->convertToBoolean($value));\r\n }\r\n }",
"public function boolify(array &$array)\n {\n $array = array_map(function ($value) {\n if (!is_array($value) && !is_object($value)) {\n $value = (bool)$value;\n } elseif (!empty($value)) {\n $value = true;\n }\n\n return $value;\n }, $array);\n }",
"public function getBooleanArray() {\n // explicit type cast just to be sure\n return (array) $this->booleanArray;\n }",
"public function isJsonArrayReturnsBoolDataProvider() {\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\tjson_encode(array('a')),\n\t\t\t\tTRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tjson_encode('a,b:c'),\n\t\t\t\tFALSE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tjson_encode(array('object' => 'a')),\n\t\t\t\tTRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tjson_encode(array(array('title' => 'test2'), array('title' => 'test2'))),\n\t\t\t\tTRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'a,b:c',\n\t\t\t\tFALSE\n\t\t\t),\n\t\t);\n\t}",
"public function isJsonArrayReturnsBoolDataProvider() {\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\tjson_encode(array('a')),\n\t\t\t\tTRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tjson_encode('a,b:c'),\n\t\t\t\tFALSE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tjson_encode(array('object' => 'a')),\n\t\t\t\tTRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\tjson_encode(array(array('title' => 'test2'), array('title' => 'test2'))),\n\t\t\t\tTRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'a,b:c',\n\t\t\t\tFALSE\n\t\t\t),\n\t\t);\n\t}",
"public function testEmptyArrayCastedToBoolGivesFalse() {\n\t\t$this->assertFalse((bool)array());\n\t}",
"function to_boolean($val);",
"public function provideBoolValues(): array\n {\n return [\n [true],\n [false],\n ];\n }",
"public function toBool() : bool\n {\n return boolval($this->value);\n }",
"public static function booleans()\n {\n return self::elements(false, true);\n }",
"function toBoolean(){\n\t\tif(in_array($this->lower(),array('','false','off','no','n','f'))){\n\t\t\treturn false;\n\t\t}\n\t\treturn (bool)$this->toString();\n\t}",
"function read_boolean(&$payload) {\n return (bool) read_byte($payload);\n}",
"private function isTrueArray($array) {\n if (is_array($array) && isset($array) && count($array)) {\n return TRUE;\n } else {\n return FALSE;\n }\n }",
"public function hasNodeArrayValue(): bool\n {\n return $this->nodeValueHasArray;\n }",
"private function process_array($value) {\n return is_array($value);\n }",
"public function toBool(): bool\n\t{\n\t\treturn false;\n\t}",
"public function toArray()\n\t{\n\t\treturn ['false' => __('No'), 'true' => __('Yes')];\n\t}",
"protected function _checkContent($content)\n {\n if (is_array($content)) {\n $exportContent = var_export($content, TRUE);\n error_class::log('inf', \"detected content as array \\n\\n $exportContent\");\n\n return serialize($content);\n }\n\n return $content;\n }",
"public function toBoolean()\n {\n $key = $this->toLowerCase()->str;\n $map = array(\n 'true' => true,\n '1' => true,\n 'on' => true,\n 'yes' => true,\n 'false' => false,\n '0' => false,\n 'off' => false,\n 'no' => false,\n );\n\n if (array_key_exists($key, $map)) {\n return $map[$key];\n } elseif (is_numeric($this->str)) {\n return ((int) $this->str > 0);\n } else {\n return (bool) $this->regexReplace('[[:space:]]', '')->str;\n }\n }",
"public function validBooleanTrueProvider() {\n\t\treturn [\n\t\t\t\"string TRUE\"\t=> [\"TRUE\"],\n\t\t\t\"string ON\"\t\t=> [\"ON\"],\n\t\t\t\"string YES\"\t=> [\"YES\"],\n\t\t\t\"string 1\"\t\t=> [\"1\"],\n\t\t\t\"integer 1\"\t\t=> [1]\n\t\t];\n\t}",
"function acf_is_array($array)\n{\n}",
"static protected function __boolean_trim($content)\r\n\t{\r\n\t\t$return = array();\r\n\t\tforeach ($content as $c)\r\n\t\t{\r\n\t\t\tswitch ($c['type'])\r\n\t\t\t{\r\n\t\t\t\tcase Wiki_Parser_Core::NEW_LINE:\r\n\t\t\t\tcase Wiki_Parser_Core::NEW_PARAGRAPH:\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase Wiki_Parser_Core::ELEMENT:\r\n\t\t\t\t\t$return[] = $c;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase Wiki_Parser_Core::WARNING:\r\n\t\t\t\t\t$return[] = $c;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t$c['content'] = trim($c['content']);\r\n\t\t\t\t\tif ($c['content'] !== '')\r\n\t\t\t\t\t\t$return[] = $c;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $return;\r\n\t}",
"public function isArray()\n {\n return \\is_array($this->value);\n }",
"private function convertStringBooleans($data) {\n foreach($data as $key=>$value) {\n if($value === 'true' || $value === 'TRUE')\n $data[$key] = true;\n\n if($value === 'false' || $value === 'FALSE')\n $data[$key] = false;\n\n if (is_array($value)) {\n $data[$key] = $this->convertStringBooleans($value);\n }\n }\n\n return $data;\n }",
"public function isEncodedArrayFieldValue($value)\n {\n if (!is_array($value)) {\n return false;\n }\n unset($value['__empty']);\n foreach ($value as $row) {\n if (!is_array($row) || !array_key_exists('predefined_values_donation', $row)) {\n return false;\n }\n }\n return true;\n }",
"static function toBoolean($data)\r\n {\r\n if(!is_string($data))\r\n return (bool) $data;\r\n switch(strtolower($data)) {\r\n case '1':\r\n case 'TRUE':\r\n case 'on':\r\n case 'yes':\r\n case 'y':\r\n return TRUE;\r\n default:\r\n return FALSE;\r\n }\r\n }",
"public function hasContent(){ return !empty($this->content); }",
"protected function getCleanContent(): array\n {\n return $this->content = array_filter($this->getContent()->getArrayCopy(), function ($v) {\n if ($v instanceof ArrayObject) {\n return (bool) $v->count();\n }\n if ($v instanceof JsonSerializable) {\n return (bool) $v->jsonSerialize();\n }\n return !empty($v);\n });\n }",
"private function convert_to_boolean_attributes() {\n foreach ($this->attributes() as $attr => $val) {\n if (preg_match('/^can_/', $attr) || preg_match('/^is_/', $attr)) {\n $this->$attr = ($val == '1');\n }\n }\n }",
"public function isArray(): bool\n {\n return false;\n }",
"public function isArray(): bool\n {\n return false;\n }",
"public function toBoolean(): bool\n {\n return $this->boolean;\n }",
"public function castToBool($value);",
"public function toBoolean(): bool\n {\n return !!$this->getValue();\n }",
"public function value(): bool\n {\n if (($val = $this->raw()) === null) {\n return false;\n }\n\n return (new Boolean)->decode($val);\n }",
"public function hasContent() {}",
"function isArrayVal()\n {\n return $this->_arrayVal;\n }",
"public static function isArray($element, $require_content = true)\n {\n return (!is_array($element)) ? false : ($require_content && empty($element) ? false : true);\n }",
"function readBoolean();",
"private function clean_mms_data()\n {\n // Set result default value to FALSE\n $_result = FALSE;\n \n if ($this->_mms_data && is_array($this->_mms_data)) {\n foreach ($this->_mms_data as $_key => $_value) {\n if (isset($_value['payload'])) {\n $_clean_str = $this->remove_escaped_chars($_value['payload']);\n if ($_clean_str && is_string($_clean_str)) {\n $this->_mms_data[$_key]['payload'] = $_clean_str;\n }\n \n // Check if the escaped backslash character has been removed from the payload value string\n $_result = preg_match_all('@\\\\\\\"|\\\\\\/@', $this->_mms_data[$_key]['payload']) ? FALSE : TRUE;\n }\n }\n }\n \n return $_result;\n }",
"private function convertContent(){\n $newContent = array();\n foreach ($this->content as $key => $value) {\n if (is_scalar($value)) {\n $newContent[$key] = $this->format($value);\n }\n }\n return $newContent;\n }",
"function array_val_bool(array $array, $key, $default = false) { \n\treturn make_bool(array_val($array, $key, $default)); \n}",
"public function makeArray() {\n\t\tif ( $this->file == '' ) {\n\t\t\tif ( $this->rawdata == '' ) {\n\t\t\t\techo \"No filename specified, aborting\";\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\tif ( ! file_exists( $this->file ) ) {\n\t\t\t\techo \"File $this->file does not exist, aborting\";\n\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t$this->rawdata = file_get_contents( $this->file );\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->rawdata == '' ) {\n\t\t\techo \"No data in file, aborting\";\n\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->parse2array();\n\n\t\treturn true;\n\t}",
"public function bool()\n {\n return filter_var($this->value, FILTER_VALIDATE_BOOLEAN);\n }",
"public function testBoolean()\r\n {\r\n $s = new XML_Serializer();\r\n $s->serialize(true);\r\n $this->assertEquals('<boolean>1</boolean>', $s->getSerializedData());\r\n $s->serialize(false);\r\n $this->assertEquals('<boolean />', $s->getSerializedData());\r\n }",
"public function testMakeReturnsContent()\n\t{\n\t\t$this->assertInternalType('array', ArrayQuery::make('is,valid'));\n\t}",
"protected function getBooleans(){\n return array_keys( array_filter( $this->getOperatorData(),\n function($item){\n return $item['type'] === self::TYPE_BOOLEAN;\n }));\n }",
"function rest_sanitize_boolean($value)\n {\n }",
"public function checkBooleanFulltextSupport();",
"public function hasContent(): bool\n {\n return (empty($this->content) === false);\n }",
"function parseBoolFromArray($index, $array)\n\t{\n\t\treturn array_key_exists($index, $array);\n\t}",
"public function getInjectEntityContent()\n {\n $value = $this->get(self::INJECTENTITYCONTENT);\n return $value === null ? (boolean)$value : $value;\n }",
"final public function toBool()\n {\n return $this->hasSolution();\n }",
"public function checkSucces() {\n return is_array($this->succes);\n }",
"private function allUnchecked($arr) {\n\n foreach($arr as $data) {\n if(is_array($data) && array_key_exists('checked', $data) && $data['checked']) return FALSE;\n }\n \n return TRUE;\n }",
"public function toArray(){\n return $this->content;\n }",
"public function getBool(): bool;",
"public function hasContent(){\n return $this->_has(4);\n }",
"function o_castBool($value) {\n\t\t\treturn Obj::singleton()->castBool($value);\n\t\t}",
"public function isEqualToArray($array)\n {\n // RsoBool\n return ($this->array === $array) ? true : false;\n }",
"public function testCastToBooleanTrue($data) {\n\t\t$this->assertTrue(Convertor::cast($data), \"[{$data}] is not Boolean TRUE\");\n\t}",
"protected function toBool($value)\n\t{\n\t\tif ($value === true) {\n\t\t\treturn 'yes';\n\t\t}\n\t\treturn 'no';\n\t}",
"public function getArray()\n {\n if (!empty($this->array))\n {\n return $this->array;\n }\n \n // return false if $this->array empty\n return false;\n }",
"function isValid($array){\n return $array['format_valid'];\n }",
"protected function isContentToBeParsed() {\n\t\t$result = FALSE;\n\t\t$currentPageUid = $GLOBALS['TSFE']->id;\n\t\t// get rootline of the current page\n\t\t$rootline = $GLOBALS['TSFE']->sys_page->getRootline($currentPageUid);\n\t\t// build an array of uids of pages the rootline\n\t\tfor ($i=count($rootline)-1; $i>=0; $i--) {\n\t\t\t$pageUidsInRootline[] = $rootline[\"$i\"]['uid'];\n\t\t}\n\t\t// check if the root page is in the rootline of the current page\n\t\tforeach (t3lib_div::trimExplode(',',$this->settings['includeRootPages'],1) as $includeRootPageUid) {\n\t\t\tif (t3lib_div::inArray((array)$pageUidsInRootline,$includeRootPageUid))\n\t\t\t\t$result = TRUE;\n\t\t}\n\t\tforeach (t3lib_div::trimExplode(',',$this->settings['excludeRootPages'],1) as $excludeRootPageUid) {\n\t\t\tif (t3lib_div::inArray((array)$pageUidsInRootline,$excludeRootPageUid))\n\t\t\t\t$result = FALSE;\n\t\t}\n\t\tif (t3lib_div::inList($this->settings['includePages'],$currentPageUid)) {\n\t\t\t$result = TRUE;\n\t\t}\n\t\tif (t3lib_div::inList($this->settings['excludePages'],$currentPageUid)) {\n\t\t\t$result = FALSE;\n\t\t}\n\t\tif ( $GLOBALS['TSFE']->page['f3_contentparser_dont_parse'] == 1) {\n\t\t\t$result = FALSE;\n\t\t}\n\t\t// if ( $this->cObj->getFieldVal('f3_contentparser_dont_parse') == 1) {\n\t\t// \t$result = FALSE;\n\t\t// }\n\n\t\treturn $result;\n\t}",
"public function setArray($var)\n {\n GPBUtil::checkBool($var);\n $this->array = $var;\n\n return $this;\n }",
"public function convertCheckboxesToBool()\n\t{\n\t\t$this->convertCheckboxesToBool = true;\n\t}",
"public function isArray(): bool\n {\n return $this->phpType === self::HASH;\n }",
"public function isTrue();",
"public static function boolean() {}",
"public static function hasContent(): bool\n {\n return true;\n }",
"private function strToBoolean($value) {\r\n\t\tif ($value && strtolower($value) === \"true\") {\r\n\t\t return true;\r\n\t\t} else {\r\n\t\t return false;\r\n\t\t}\r\n\t}",
"private function getFormatStatusFromContent(){\n\t\t if(EducationalUtil::isRoleTypeTheme($this->roleType, $this->roleNamesObj)){\n\t\t\treturn true;\n\t\t }\n\t\t \n\t\t $contentArray = explode(FieldContentInAgenda::SPLIT_CHARACTER, $this->filedContent);\n\t\t \n\t\t if(EducationalUtil::isRoleTypeCC($this->roleType, $this->roleNamesObj)){\n\t\t\t$NUM_OF_PIECES_FOR_MEMBER_OLD = 5;\n\t\t\t$NUM_OF_PIECES_FOR_NON_MEMBER_OLD = 6;\n\t\t\tif(((count($contentArray) == $NUM_OF_PIECES_FOR_MEMBER_OLD) && ($contentArray[0] == FieldContentInAgenda::MEMBER_TAG)) ||\n\t\t\t ((count($contentArray) == $NUM_OF_PIECES_FOR_NON_MEMBER_OLD) && ($contentArray[0] == FieldContentInAgenda::NONE_MEMBER_TAG))){\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t } else {\n\t\t\t$NUM_OF_PIECES_FOR_MEMBER_OLD = 3;\n\t\t\t$NUM_OF_PIECES_FOR_NON_MEMBER_OLD = 4;\n\t\t\t\n\t\t\tif(((count($contentArray) == $NUM_OF_PIECES_FOR_MEMBER_OLD) && ($contentArray[0] == FieldContentInAgenda::MEMBER_TAG)) ||\n\t\t\t ((count($contentArray) == $NUM_OF_PIECES_FOR_NON_MEMBER_OLD) && ($contentArray[0] == FieldContentInAgenda::NONE_MEMBER_TAG))){\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t }\n\t }",
"public function testGetDataTableBooleanDataType() {\r\n\t\t// Insert border values into database\r\n\t\t$this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE) values (\\'testuuid0\\',0)');\r\n\t\t$this->executeQuery('insert into POTEST (UUID, BOOLEAN_VALUE) values (\\'testuuid1\\',1)');\r\n\t\t// Extract datatable\r\n\t\t$datatable = $this->getPersistenceAdapter()->getDataTable('select BOOLEAN_VALUE from POTEST order by UUID');\r\n\t\t$datamatrix = $datatable->getDataMatrix();\r\n\t\t// Check strings for correct conversion\r\n\t\t$this->assertEquals('0', $datamatrix[0][0], 'Minimum boolean value is not converted to string as expected.');\r\n\t\t$this->assertEquals('1', $datamatrix[1][0], 'Maximum boolean value is not converted to string as expected.');\r\n\t}",
"public function hasContent(){\n return $this->_has(6);\n }",
"protected function isContentCorrect() {}",
"public function isTrue()\n {\n \n return !!$this->value;\n \n }",
"public function boolberry(): bool\n\t{\n\t\treturn false;\n\t}",
"abstract public function hasContent();",
"function convert_content_capableof($conversion) {\n global $settings;\n return is_array($settings['converters']) &&\n array_key_exists($conversion, $settings['converters']) &&\n function_exists($settings['converters'][$conversion]);\n}",
"public function isArray()\n {\n return $this->_type == self::BEAN_CONSTRUCTOR_ARRAY;\n }",
"public function loaded()\n {\n return is_array($this->data);\n }",
"public function decodeObjectAsArray(bool $bool) : void\n {\n $this->decodeObjectAsArray = $bool;\n }",
"public function isSuccessful()\r\n {\r\n return is_array($this->data);\r\n }",
"function b2s($b) {\n return ($b) ? 'TRUE' : 'FALSE';\n}",
"public function hasData(): bool {\n return is_array($this->data);\n }",
"public function getIsArray()\n {\n return $this->_isArray;\n }",
"public static function canConvert()\n\t{\n\t\treturn array(\n\t\t\t'convert_cms_pages' => array(\n\t\t\t\t'table'\t\t\t\t=> 'xf_page',\n\t\t\t\t'where'\t\t\t\t=> NULL,\n\t\t\t)\n\t\t);\n\t}",
"public function isElements() {}",
"public function toArray()\n {\n return $this->content;\n }",
"public function parseJson($array = false)\n {\n if ($this->getMimeType() == 'application/json') {\n $contents = $this->getContents();\n $contents = json_decode($contents, $array);\n if (json_last_error() == JSON_ERROR_NONE) {\n return $contents;\n }\n }\n return false;\n }",
"protected function arrayIsList(array $array): bool\n {\n $encoded = json_encode($array);\n\n return false !== $encoded && $encoded[0] === '[';\n }",
"public function isSubmited(): bool\n {\n return (bool) $this->values();\n }",
"public final function & toBoolean () {\n # As previously written, go recursive down to find the toBoolean value of\n # a DT object;\n if ($this->varContainer instanceof B) {\n # Return the toBoolean () call of the function;\n return $this->varContainer->toBoolean ();\n } else {\n # Return the varContainer;\n return $this->varContainer;\n }\n }",
"public static function toBool($val) {\n return ($val === true || in_array($val, array('true', 'yes', 'on', 'checked', '1', 1))) ? true : false;\n }",
"public function methodIsProvider(): array\n {\n return [\n [true, (bool) true, [true, false]],\n [false, (bool) false, [true, false, 0]],\n [true, 123, [11, 0, -34]],\n [false, 123, [11, 0, -34.456]],\n [true, 1.23, [11.0, 0.0, -34.6]],\n [false, 1.23, [11.0, 0, -34.4]],\n [true, '', ['', '0', 'i am not a string']],\n [false, '', [11.2, '0', true]],\n [true, null, [null, null]],\n [false, null, [[], null, false]],\n [true, new stdClass(), [new stdClass(), new stdClass()]],\n [false, new stdClass(), [[], new stdClass(), true]],\n ];\n }",
"public function validBooleanFalseProvider() {\n\t\treturn [\n\t\t\t\"string TRUE\"\t=> [\"FALSE\"],\n\t\t\t\"string ON\"\t\t=> [\"OFF\"],\n\t\t\t\"string YES\"\t=> [\"NO\"],\n\t\t\t\"string 1\"\t\t=> [\"0\"],\n\t\t\t\"integer 1\"\t\t=> [0]\n\t\t];\n\t}",
"public function getData() {\n\n return empty($this->result->body) ?\n false :\n $this->result->body;\n }",
"public function isBackendAdminReturnsBoolDataProvider() {\n\t\treturn array(\n\t\t\tarray(\n\t\t\t\t1,\n\t\t\t\tTRUE\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t0,\n\t\t\t\tFALSE\n\t\t\t),\n\t\t);\n\t}"
] | [
"0.6845962",
"0.63453716",
"0.6312975",
"0.62089044",
"0.6081801",
"0.6081801",
"0.6079825",
"0.6064722",
"0.58788896",
"0.5857571",
"0.58527595",
"0.5844531",
"0.58417153",
"0.5806632",
"0.5779585",
"0.5762508",
"0.57615805",
"0.57383806",
"0.57194036",
"0.5667835",
"0.566603",
"0.55440897",
"0.5539918",
"0.5524469",
"0.55055726",
"0.54733235",
"0.5463865",
"0.54166293",
"0.54139066",
"0.5409986",
"0.54066145",
"0.54066145",
"0.5386127",
"0.5349829",
"0.53470176",
"0.5309128",
"0.5301886",
"0.5284807",
"0.5282238",
"0.5275522",
"0.52674526",
"0.5264199",
"0.5259628",
"0.5229659",
"0.5221657",
"0.5211208",
"0.5204217",
"0.5200319",
"0.51961935",
"0.51700616",
"0.5166481",
"0.516163",
"0.51609737",
"0.5160085",
"0.5139112",
"0.5126978",
"0.5126315",
"0.51261234",
"0.5124056",
"0.5110266",
"0.5095839",
"0.5095122",
"0.50926226",
"0.5088151",
"0.50832194",
"0.5079306",
"0.50685227",
"0.5068291",
"0.50675976",
"0.5053482",
"0.5050297",
"0.5048648",
"0.50388867",
"0.50382257",
"0.503797",
"0.50221217",
"0.5020558",
"0.50123554",
"0.50117064",
"0.5007952",
"0.5007837",
"0.50060606",
"0.49737158",
"0.4971258",
"0.49696505",
"0.4968856",
"0.49688116",
"0.49669957",
"0.49668038",
"0.49509513",
"0.4947357",
"0.49452555",
"0.49446127",
"0.4941178",
"0.49402332",
"0.49369994",
"0.4936595",
"0.49358976",
"0.49350992",
"0.4932624"
] | 0.72971016 | 0 |
Checks that method _load_ throws _DataDirectoryNotFoundException_, if data directory was not found. | public function testLoadThrowsDataDirectoryNotFoundForNonExistingDir(): void
{
$dirname = 'nonexistent';
$path = $this->getFullPath($dirname);
$this->expectException(DataDirectoryNotFoundException::class);
$this->expectExceptionExactMessage("Root folder $path was not found.");
$directoryDataLoader = $this->prepareDirectoryDataLoader();
$directoryDataLoader->load($path, '/^.*\..*$/');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testLoadThrowsDataDirectoryNotFoundForNonReadableDirectory(): void\n {\n $dirname = 'forbidden';\n $this->addDirectoryToVFS($dirname, 0);\n $path = $this->getFullPath($dirname);\n $this->expectException(DataDirectoryNotFoundException::class);\n $this->expectExceptionExactMessage(\"Root folder $path was not found.\");\n\n $directoryDataLoader = $this->prepareDirectoryDataLoader();\n\n $directoryDataLoader->load($path, '/^.*\\..*$/');\n }",
"public function testLoadThrowsDataDirectoryNotFoundForFileInsteadOfDirectory(): void\n {\n $filename = 'accessible.json';\n $this->addFileToVFS($filename);\n $path = $this->getFullPath($filename);\n $this->expectException(DataDirectoryNotFoundException::class);\n $this->expectExceptionExactMessage(\"Root folder $path was not found.\");\n\n $directoryDataLoader = $this->prepareDirectoryDataLoader();\n\n $directoryDataLoader->load($path, '/^.*\\..*$/');\n }",
"public function testLoadReturnsCorrectDataWithExceptionsThrownByDataLoaders(): void\n {\n $this->prepareVFSDirectoryStructure();\n $fullPath = $this->getFullPath('container');\n $expectedFilesMap = ['FileSecond' => 'first/file_second.exe', 'SomeExt' => 'some_ext.exe'];\n $expectedLoadData = ['FileSecond' => ['param1' => 'with_value'], 'SomeExt' => ['param2' => 'without_value']];\n $expectedExceptions =\n array_fill_keys([\"$fullPath/first/file_first.exe\", \"$fullPath/second/file_third.exe\"], new Exception());\n $dataLoaderMockCallbackParams = [$fullPath, $expectedFilesMap, $expectedLoadData, $expectedExceptions];\n $dataLoaderMockCallback = $this->prepareDataLoaderMockCallbackWithExceptions(...$dataLoaderMockCallbackParams);\n $directoryDataLoader = $this->prepareDirectoryDataLoader($dataLoaderMockCallback);\n\n $actualLoadData = $directoryDataLoader->load($fullPath, '/^.*\\.exe$/');\n\n static::assertArraysAreSame($expectedLoadData, $actualLoadData);\n }",
"public function testCreateDataCollectionThrowsExceptionOnInvalidDirectory(): void\n {\n $collection = $this->getMockBuilder(DataCollection::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $property = new ReflectionProperty($this->object, 'collection');\n $property->setValue($this->object, $collection);\n\n $this->expectException(RuntimeException::class);\n $this->expectExceptionMessage('Directory \"./platforms\" does not exist.');\n\n $this->object->createDataCollection('.');\n }",
"public function validateTestData()\n\t{\n\t\t$testDataFileName = $this->config->getTestData();\n\t\tif (!(realpath($testDataFileName) || realpath(Config::$testDataFile))){\n\t\t\t$this->errors['testData'][] = [\n\t\t\t\t'property' => 'testData',\n\t\t\t\t'message' => 'Test data file was not found.'\n\t\t\t];\n\t\t}\n\t}",
"private function checkDir()\n {\n if (!is_dir($this->basePath)) {\n throw new InvalidArgumentException('base path: ' . $this->basePath .\n ' is not a directory or does not exist' .\n ' current working dir is ' . getcwd());\n }\n // check writable\n if (!is_writable($this->basePath)) {\n throw new InvalidArgumentException('base path: ' . $this->basePath .\n ' is not writable' .\n ' current working dir is ' . getcwd());\n }\n }",
"public function testInvalidArgumentExceptionIsThrownIfDirectoryIsNotReadableWhenCreatingProcedureLoader()\n {\n $this->setExpectedException('\\InvalidArgumentException');\n\n $procedureFactory = $this->getProcedureFactory();\n\n $procedureLoaderFactory = $this->getProcedureLoaderFactory($procedureFactory);\n $procedureLoaderFactory->createProcedureLoader('invalid/directory');\n }",
"public function testCreateDataCollectionFailsBecauseOfEmptyDirectory(): void\n {\n $path = __DIR__ . '/../../../fixtures/empty-directory';\n\n $this->expectException(RuntimeException::class);\n $this->expectExceptionMessage(sprintf('Directory \"%s/browsers\" was empty.', $path));\n\n $this->object->createDataCollection($path);\n }",
"public function testCreateDataCollectionFailsBecauseOfMissingFiles(): void\n {\n $path = __DIR__ . '/../../../fixtures/missing-file';\n\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage(sprintf('File \"%s/core/default-browser.json\" does not exist.', $path));\n\n $this->object->createDataCollection($path);\n }",
"protected function validateStoragePath()\r\n {\r\n if (is_null($this->storagePath)) {\r\n throw new Exception('A storage path has not been set');\r\n }\r\n\r\n if ( ! is_dir($this->storagePath) || ! is_writable($this->storagePath)) {\r\n throw new Exception('The specified storage path is not writable');\r\n }\r\n }",
"public function check_data()\n {\n parent::check_data();\n\n if(empty($this->build_notifications))\n {\n throw new exception('<strong>Data missing: Notifications</strong>');\n }\n\n if(empty($this->build_batch_reference))\n {\n throw new exception('<strong>Data missing: Batch References</strong>');\n }\n }",
"public function testInvalidFileException() {\n\t\t$this->expectException('/Could not read file/');\n\t\tFixture::load('Foobar');\n\t}",
"public function should_throw_if_trying_to_build_on_non_existing_directory(): void\n {\n $this->expectException(\\InvalidArgumentException::class);\n new DirectorySnapshot(__DIR__ . '/not-existing');\n }",
"public function testLoadingInvalidLanguageFileThrowsException()\n {\n $this->expectException(\\Sparta\\Exceptions\\LanguageFileNotFound::class);\n $this->translator->setLocale('FakeFileLanguageCode');\n $this->translator->load();\n }",
"public function testBadLoaderDefined() {\n $this->expectException('\\\\Phloem\\\\Exception\\\\LoaderException');\n\n $this->factory->setLoader('bad', true);\n $this->factory->getLoader('filename.bad');\n }",
"public function it_should_throw_is_specified_dump_file_is_not_readable()\n {\n $root = vfsStream::setup('root');\n $dumpFle = vfsStream::newFile('foo.sql', 0000);\n $root->addChild($dumpFle);\n $path = $root->url() . '/foo.sql';\n\n $driver = $this->stubProphecy(ExtendedMySql::class);\n $driver->load($path)->shouldNotBeCalled();\n\n $this->expectException(\\InvalidArgumentException::class);\n\n $sut = $this->make_instance();\n $sut->_setDriver($driver->reveal());\n\n $sut->importSqlDumpFile($path);\n }",
"private function validatePath()\n {\n $locator = new FileLocator();\n $locator->locate($this->path); // throws exception on failure\n }",
"public function test_LoadAllException_NoPath()\n {\n $this->setExpectedException('Q\\Exception', \"Unable to create Config object: Path not specified.\");\n $config = new Config_Dir(array('ext'=>'mock'), array('loadall'=> 'true'));\n }",
"abstract public function loadData();",
"public function loadDir($directory);",
"public function testLoadMissingFixtures(): void\n {\n $this->expectException(UnexpectedValueException::class);\n $this->expectExceptionMessage('Could not find fixture `core.ThisIsMissing`');\n (new FixtureHelper())->loadFixtures(['core.ThisIsMissing']);\n }",
"public function testLoadFile_invalidFileName() : void\n {\n $spreadsheet = SpreadsheetUtil::loadFile('junk.xls');\n $this->assertNull($spreadsheet);\n }",
"public function it_should_throw_if_specified_dump_file_does_not_exist()\n {\n $path = __DIR__ . '/foo.sql';\n\n $driver = $this->stubProphecy(ExtendedMySql::class);\n $driver->load($path)->shouldNotBeCalled();\n\n $this->expectException(\\InvalidArgumentException::class);\n\n $sut = $this->make_instance();\n $sut->_setDriver($driver->reveal());\n\n $sut->importSqlDumpFile($path);\n }",
"public function test_metadata_not_found_in_the_current_directory() {\n\t\t$result = register_block_type_from_metadata( __DIR__ );\n\n\t\t$this->assertFalse( $result );\n\t}",
"protected function loadStats()\n {\n if ($this->stat === false) {\n $this->stat = @stat($this->getPath());\n if ($this->stat===false) {\n throw new T_Exception_File($this->getPath(),'stat error');\n }\n }\n }",
"public function validate() {\n\t\t\n\t\tif(!is_dir($this->path)) {\n\t\t\tthrow new Exception('The path provided does not exist', '400');\n\t\t}\n\t\t\n\t\tif(!is_writeable($this->path)) {\n\t\t\tthrow new Exception('The path provided is not writeable', '400');\n\t\t}\n\t\t\n\t\tif(file_exists($this->path . $this->filename)) {\n\t\t\t\n\t\t\tif($this->allow_overwrite === false && $this->rename_if_exists === false) {\n\t\t\t\tthrow new Exception('The file ' . $this->filename . ' already exists', '400');\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif($this->checkExtension() === false) {\n\t\t\tthrow new Exception('The file has an invalid extension', '400');\n\t\t}\n\t\t\n\t\treturn true;\n\t\t\n\t}",
"private function dirIsValid() {\n return is_dir($this->directory);\n }",
"protected static function checkForDirectoryToBeExisting($directory) {\n\t\tif (!file_exists($directory)) {\n\t\t\tthrow new Exception($directory . ' is not existing! 1287234117');\n\t\t}\n\t}",
"public function initializeObject()\n {\n if (!is_writable($this->path)) {\n Files::createDirectoryRecursively($this->path);\n }\n if (!is_dir($this->path) && !is_link($this->path)) {\n throw new StorageException('The directory \"' . $this->path . '\" which was configured as a resource storage does not exist.', 1361533189);\n }\n if (!is_writable($this->path)) {\n throw new StorageException('The directory \"' . $this->path . '\" which was configured as a resource storage is not writable.', 1361533190);\n }\n }",
"public function testNoLoaderDefined() {\n $this->expectException('\\\\Phloem\\\\Exception\\\\LoaderException');\n\n $this->factory->getLoader('filename.unknown');\n }",
"public function testIfExceptionIsThrownWhenConfigurationIsNotValid()\n {\n $path = $this->getTestDataDir() . '/config.invalid.yml';\n\n $this->assertTrue(is_readable($path), 'Invalid configuration file is missing.');\n\n $reader = new Reader(new Configuration());\n $reader->read($path);\n }",
"protected function initialize()\n {\n // if basepath hasn't been set, attempt to discover it by working back up the directory structure\n if( ! $this->basepath )\n {\n $path = __DIR__;\n $last = '';\n while($path !== $last)\n {\n $last = $path;\n $path = realpath($path . '/../');\n $config = $path . '/paths.php';\n if(file_exists($config))\n {\n $this->option('basepath', $this->fix($path));\n break;\n }\n }\n\n // check if the paths configuration was found\n if( ! file_exists($this->basepath) )\n {\n throw new \\Exception('The paths configuration file `paths.php` was not found anywhere on the path \"' .__DIR__. '\" ');\n }\n\n }\n\n // test that the base path (supplied or found) exists\n if( ! file_exists($this->basepath) )\n {\n throw new \\Exception('The supplied base path \"' .$this->basepath. '\" does not exist');\n }\n }",
"public function test_load_returns_empty_array_if_conf_dir_dnx()\n {\n $config = new Bootphp_Config_File_Reader('gafloogle');\n\n $this->assertSame([], $config->load('values'));\n }",
"public function testFileNotFoundException ()\n {\n $this->tran->loadFile(2);\n $this->tran->loadFile();\n $this->tran->loadFile(true);\n $this->tran->loadFile('asd');\n }",
"public function checkinit(){\n if(!$this->initialised){\n throw new DataProviderManagerNotInitializedException(\"DPManager isn't initialised\");\n }\n }",
"function load( $filename = NULL )\n\t{\n\t\tif ( is_file( $filename ) ) {\n\n\t\t} else {\n\t\t\tthrow new FileNotFound( 'config file not exist!' );\n\t\t}\n\t}",
"public function testPathToDatasetFileInvalid()\n {\n $rem = new RemServer();\n $session = new Session([\"name\" => \"test\"]);\n $dataset = [ANAX_INSTALL_PATH . \"/config/remserver/dataset/users-NO.json\"];\n\n $rem->setDefaultDataset($dataset)\n ->injectSession($session)\n ->init();\n }",
"function testPathNotFoundMovie() {\n try {\n $v = $this->loadMovie(\"path_that_doesnt_exist/movie.mp4\");\n //this assert should never be called\n $this->assertTrue(false);\n } catch (Exception $e) {\n $this->assertTrue(true);\n }\n }",
"protected function assertIsLoaded()\n\t{\n\t\tif (is_null($this->operator) || is_null($this->variable) || is_null($this->value))\n\t\t{\n\t\t\tthrow new RuntimeException('The Guard is not loaded : Null variable, operator or Value.');\n\t\t}\n\t}",
"public function testImagesDirBase(): void\n {\n $this->expectException(\\Magento\\Framework\\Exception\\LocalizedException::class);\n $this->expectExceptionMessage('Images file directory is outside required directory');\n\n $this->_model->setData(\n Import::FIELD_NAME_VALIDATION_STRATEGY,\n ProcessingErrorAggregatorInterface::VALIDATION_STRATEGY_SKIP_ERRORS\n );\n $this->_model->setEntity('catalog_product');\n $this->_model->setData(Import::FIELD_NAME_IMG_FILE_DIR, '../_files');\n $this->_model->importSource();\n }",
"public function testReadWithNonExistentFile() {\n $reader = new ConfigReader($this->path);\n $reader->read('fake_values');\n }",
"protected static function _validate()\n\t{\n\t\tif (!file_exists(self::$jar)) {\n\t\t\tthrow new Exception('MergeMinify_Minification:$jar(' . self::$jar . ') is not a valid file.');\n\t\t}\n\t\tif (!is_dir(self::$tmpDir) || !is_writable(self::$tmpDir)) {\n\t\t\tthrow new Exception('MergeMinify_Minification:$temp(' . self::$temp . ') is not a valid directory.');\n\t\t}\n\t}",
"public function load() \n\t{\n\t\tif (is_null ( $this->getDataFile () )) \n\t\t{\n\t\t\tthrow new Exception ( 'Data File is not set' );\n\t\t}\n\t\t\n\t\tif (!file_exists($this->getDataFile()))\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn json_decode(file_get_contents($this->getDataFile()));\n\t\t}\n\t}",
"public function load($data_folder)\n {\n $this->_provider->load($data_folder);\n }",
"private function checkDir() {\n if (! is_dir ( $this->option ['templateDir'] ))\n $this->core->err ( '101', $this->option ['templateDir'] );\n \n if (! is_dir ( $this->option ['compileDir'] ))\n $this->core->err ( '101', $this->option ['compileDir'] );\n \n if (! is_dir ( $this->option ['cacheDir'] ))\n $this->core->err ( '101', $this->option ['cacheDir'] );\n }",
"private function checkConfiguration()\n {\n if (!isset($this->getConf()->{'privatedir'})) {\n // @codeCoverageIgnoreStart\n throw new \\Exception('Empty privatedir');\n // @codeCoverageIgnoreEnd\n }\n }",
"protected function fetchData()\n {\n $this->checkRequiredParameters();\n\n if (!is_null($this->data)) {\n /*\n * If the $data variable isn't null anymore, data was provided\n * from outside. This means, we have to stop the method execution\n * here to prevent subclasses from fetching data from the database.\n *\n * Using a return statement to stop the method execution won't work,\n * because it just ends the execution of the parent method. By using\n * an exception, we ensure that also the execution of the child method\n * is stopped. The exception should be catched in the method which\n * calls fetchData().\n *\n * To indicate that this IndexDataException is thrown to show the\n * existence of valid external data and not because of errors in the\n * data, we set the specific exception code 1 which differs from the\n * default value 0.\n */\n throw new IndexDataException('Data has still been provided\n from outside and should not be overridden.', 1);\n }\n }",
"public function testValidateThrowDataMissingException()\n {\n try {\n $this->job->validate();\n } catch (\\Exception $e) {\n $this->assertEquals($e->getMessage(), JobException::MSG_JOB_DATA_MISSING);\n }\n }",
"public function testLoad() {\n $this->_loader->getSource('FilesystemTest.php');\n $this->_loader->getSource('FilesystemTest.php');\n\n $this->_loader->appendDir(dirname(__FILE__) . '/../Loader');\n $this->_loader->prependDir(dirname(__FILE__) . '/../Loader');\n }",
"private static function loadConfigurationFile()\n {\n if(self::$ConfigurationData == null)\n {\n $file_contents = file_get_contents(CONFIGURATION_FILE);\n $json_data = json_decode($file_contents, true);\n\n if(empty($json_data))\n {\n throw new Exception(\"Invalid JSON data in the configuration file\");\n }\n\n self::$ConfigurationData = $json_data;\n }\n }",
"function openDirectory(){\n if (!file_exists(\"./data\")){ # If file doesn't exist return false\n $handleDir = false;\n return $handleDir;\n }\n else{\n $handleDir = opendir(\"./data\");\n /* I'm checking if the handleDir == returns false for some other reason in connection.php. This is part of validation.php,\n which allows me to present an error message above the form (nb if opendir can't connect it returns a boolean value of false) */\n return $handleDir;\n }\n}",
"public function testCsvReaderThrowsFileNotFoundExceptionIfFileNotFound() {\n \n $this->expectException(new Csv_Exception_FileNotFound('File does not exist or is not readable: \"./data/nonexistant.csv\".'));\n $reader = new Csv_Reader('./data/nonexistant.csv');\n \n }",
"public function testGetDataDirectory()\n {\n $hostMock = $this->getMockBuilder(Host::class)\n ->disableOriginalConstructor()\n ->getMock();\n $hostMock->expects($this->once())->method('getPath')->willReturn('{host-base-path}');\n\n $workspace = new Workspace($hostMock);\n $workspace->setDataDirectory('data/');\n\n $this->assertSame('{host-base-path}/data/', $workspace->getDataDirectory());\n }",
"public function setDataFileFromPath($path)\n {\n if (!file_exists($path)) {\n throw new \\Exception(\"The provided data file was not found\");\n }\n\n $this->dataFilePath = $path;\n }",
"public function testCreateInvalidFile()\n {\n new MaterializedResource(new GenericResource('file_not_found.txt'), '/probably/not/a/directory');\n }",
"private static function check_config ()\n\t{\n\t\t// load config file here\n\t\tif (count(self::$_config) == 0)\n\t\t{\n\t\t\tself::LoadConfigFile();\n\t\t}\n\t}",
"private function check_directory()\n\t{\n\t\tif (!is_dir(Kohana::config($this->type.'.cache_folder')))\n\t\t\tmkdir(Kohana::config($this->type.'.cache_folder'));\n\t}",
"protected function detectMissingFiles() {}",
"public function init()\n\t{\n\t\tPiwik::checkDirectoriesWritableOrDie( array('/config/') );\n\n\t\tif(file_exists($this->pathLocal)\n\t\t\t&& !is_writable($this->pathLocal))\n\t\t{\n\t\t\tthrow new Exception(Piwik_TranslateException('General_ExceptionUnwritableFileDisabledMethod', array($this->pathLocal)));\n\t\t}\n\n\t\tparent::init();\n\t}",
"public function load()\n {\n foreach ($this->config['autoload'] as $file) {\n if ( ! locate_template($this->getRelativePath($file), true, true)) {\n throw new FileNotFoundException(\"Autoloaded file [{$this->getPath($file)}] cannot be found. Please, check your autoloaded entries in `config/app.php` file.\");\n }\n }\n }",
"private static function initialLoad() {\n include_once __DIR__ . '/Storange.php';\n Storange::getPathDir('wowframework/');\n include_once __DIR__ . '/exceptions/LoadFiles.php';\n }",
"private function __construct()\n {\n require_once DATA_DIR . '/system/DataIO.php';\n }",
"public function test_UserFileWithDrDir()\n {\n $this->setExpectedException('Q\\Exception', \"File '{$this->file}' is not a directory, but a file\");\n $config = Config::with(\"dir:mock:{$this->file}\");\n }",
"public function testOnNewDirectoryWithIllegalArgumentException() {\n\n $obj = new FileSystemStorageProvider($this->logger, $this->directory);\n\n try {\n\n $obj->onNewDirectory($this->doc1);\n } catch (Exception $ex) {\n\n $this->assertInstanceOf(IllegalArgumentException::class, $ex);\n $this->assertEquals(\"The document must be a directory\", $ex->getMessage());\n }\n }",
"public function testGetDirectory(): void\n {\n $model = Hash::load([\n \"directory\" => \"directory\",\n ], $this->container);\n\n $this->assertSame(\"directory\", $model->getDirectory());\n }",
"public function testIfExceptionIsThrownWhenConfigurationCannotBeRead()\n {\n $reader = new Reader(new Configuration());\n $reader->read('/does-not-exists-i-guess');\n }",
"private function validateCachePath($path)\n {\n if (!$this->isDirectory($path)) {\n throw new Exception('The cache path must be a directory!');\n }\n if (!is_readable($path)) {\n throw new Exception('The cache path must be a readable directory!');\n }\n if (!is_writable($path)) {\n throw new Exception('The cache path must be a writable directory!');\n }\n }",
"public function testNonExistentQueriesFile()\n {\n $result = DALBaker::loadQueriesXml('TestSys2');\n PHPUnit_Framework_Assert::assertNull($result);\n\n }",
"abstract protected function load();",
"abstract protected function load();",
"abstract protected function load();",
"abstract protected function load();",
"public function testDir_EagerLoad()\n {\n $config = new Config_Dir($this->dir, array('transformer'=>'from-mock', 'ext'=>'mock','loadall'=>true));\n\n $this->assertType('Q\\Config_Dir', $config);\n\n $this->assertArrayHasKey('dir1', (array)$config);\n $this->assertArrayHasKey('dir2', (array)$config);\n $this->assertArrayHasKey('file1', (array)$config);\n\n $this->assertArrayHasKey('file3', (array)$config['dir1']);\n $this->assertArrayHasKey('file4', (array)$config['dir1']); \n }",
"function test_import_base()\n\t{\n\t\t$testLib = 'joomla._testdata.loader-data';\n\t\t$this -> assertFalse(defined('JUNIT_DATA_JLOADER'), 'Test set up failure.');\n\t\t$r = JLoader::import($testLib, dirname(__FILE__));\n\t\tif ($this -> assertTrue($r)) {\n\t\t\t$this -> assertTrue(defined('JUNIT_DATA_JLOADER'));\n\t\t}\n\n\t\t// retry\n\t\t$r = JLoader::import($testLib, dirname(__FILE__));\n\t\t$this->assertTrue($r);\n\t}",
"public function testLoadDulicateFixtures(): void\n {\n $this->expectException(UnexpectedValueException::class);\n $this->expectExceptionMessage('Found duplicate fixture `core.Articles`');\n (new FixtureHelper())->loadFixtures(['core.Articles','core.Articles']);\n }",
"public function testDir_LazyLoad()\n {\n $config = new Config_Dir($this->dir, array('transformer'=>'from-mock', 'ext'=>'mock'));\n\n $this->assertType('Q\\Config_Dir', $config);\n $this->assertEquals(array(), (array)$config);\n \n $cfg_file1 = $config['file1'];\n $this->assertType('Q\\Config_File', $cfg_file1);\n $this->assertEquals(array(\"db\"=>array(\"host\"=>\"localhost\", \"dbname\"=>\"test\",\"user\"=>\"myuser\",\"pwd\"=>\"mypwd\"),\"output\"=>\"xml\",\"input\"=>\"json\"), (array)$cfg_file1);\n $this->assertArrayHasKey('file1', (array)$config);\n $this->assertArrayNotHasKey('dir1', (array)$config);\n\n $cfg_dir1 = $config['dir1'];\n $this->assertType('Q\\Config_Dir', $cfg_dir1);\n $this->assertEquals(array(), (array)$cfg_dir1);\n $this->assertArrayHasKey('file1', (array)$config);\n $this->assertArrayHasKey('dir1', (array)$config); \n }",
"public function testReadFromFileSetDefaultAuthCacheDirWhenMissingPath()\n {\n $testModel = AuthCacheUtil::readFromFile();\n\n $this->assertEquals(AuthCacheUtil::getDefaultAuthCacheDirectory(), $testModel->getAuthCacheDir(),\n \"Auth cache directory should be set to the default path when no cache dir provided.\");\n }",
"public function testInvalidFileImport(): void\n {\n $this->expectException(ValidationException::class);\n $file_path = base_path('tests/data/aircraft.csv');\n $this->importSvc->importAirports($file_path);\n }",
"protected function checkFilesDir() {\n\t\t$perms = @fileperms(self::FILES_DIR);\n\t\t/* create if not exist */\n\t\tif ($perms === false) {\n\t\t\tif (!mkdir(self::FILES_DIR, 0700, true)) {\n\t\t\t\tthrow new QuicksandException(\"Cannot create files dir.\");\n\t\t\t}\n\t\t}\n\t\t/* check if dir */\n\t\telse if (($perms & 0x4000) != 0x4000) {\n\t\t\tthrow new QuicksandException(\"Files dir is not actually a directory.\");\n\t\t}\n\t\t/* check permissions */\n\t\telse if (($perms & 0700) != 0700) {\n\t\t\tthrow new QuicksandException(\"Missing permissions. Make sure this script can read, write and enter the files dir.\");\n\t\t}\n\t}",
"public function testLoadWithInvalidPrimaryKey()\n {\n $this->assertNull($this->appService->load('invalidPrimaryKey'));\n }",
"private function loadPath() {\n $this->_system_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'System'.DIRECTORY_SEPARATOR;\n $this->_application_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'Application'.DIRECTORY_SEPARATOR;\n $this->_configuration_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'configuration'.DIRECTORY_SEPARATOR;\n $this->_libraries_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'Libraries'.DIRECTORY_SEPARATOR;\n $this->_logs_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'logs'.DIRECTORY_SEPARATOR;\n }",
"protected function _load()\n\t{\n\t\t$_file = $this->_storagePath . DIRECTORY_SEPARATOR . $this->_fileName;\n\n\t\tif ( is_file( $_file ) && file_exists( $_file ) && is_readable( $_file ) )\n\t\t{\n\t\t\tif ( false !== ( $_data = Utility\\Storage::defrost( file_get_contents( $_file ) ) ) )\n\t\t\t{\n\t\t\t\t//\tIf it wasn't frozen, a JSON string may be returned\n\t\t\t\tif ( is_string( $_data ) && false !== json_decode( $_data ) )\n\t\t\t\t{\n\t\t\t\t\t$_data = json_decode( $_data, true );\n\t\t\t\t}\n\n\t\t\t\t$this->merge( $_data );\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"private function Load($fullpath, $data=null){\r\n global $BASECONFIG;\r\n extract($BASECONFIG[\"ALIASES\"]);\r\n if(!is_null($data)){\r\n extract($data);\r\n }\r\n if(file_exists($fullpath)){\r\n require_once ($fullpath);\r\n return true;\r\n }\r\n else{\r\n return false;\r\n }\r\n }",
"public function canNotOpenDirectory()\n {\n $this->assertFalse(@dir(vfsStream::url('foo')));\n }",
"public function testCanLoadLanguageFilesFromSpecifiedPath()\n {\n $this->translator->load();\n $messages = $this->translator->all();\n $this->assertArrayHasKey('test_message', $messages);\n }",
"public function testCreateDataCollectionFailsBecauseOfInvalidJson(): void\n {\n $path = __DIR__ . '/../../../fixtures/invalid-json';\n\n $this->expectException(RuntimeException::class);\n $this->expectExceptionMessage(sprintf('File \"%s/core/default-browser.json\" had invalid JSON.', $path));\n\n $this->object->createDataCollection($path);\n }",
"protected static function _load($directory, $filename, $tracker, $init, $namespace, $class_name)\n {\n $base_array = array(\n array('framework', ''),\n array(DCMS_CALL, '\\\\'.DCMS_CALL)\n );\n \n foreach($base_array as $base):\n \n $basepath = $base[0].'/'.$directory;\n $loaded = \\dcms\\Core::load_file($filename, $basepath, true, false);\n \n if($loaded === true):\n \n $filepath = $basepath.'/'.$filename.'.php';\n \\dcms\\Log::write(\"Loaded file from $filepath\", null, 1);\n \n $full_class_name = \"\\dcms\\\\$namespace{$base[1]}\\\\$class_name\";\n self::_initialize_class($full_class_name, $init);\n \\dcms\\Core::track_file($filepath, $tracker);\n \n return true;\n \n endif;\n \n endforeach;\n \n \\dcms\\Log::write(\"Could not load file $filename.php from /$directory/ as $tracker!\", null, 3);\n \\dcms\\Core::kill(\"Could not load file!\");\n }",
"public function testGettingNonExistantDataSource() \n {\n DataSourcesRegistry::getDataSource('test');\n }",
"private function validateEnv(): void\n {\n $this->getAuthJsonContent();\n\n if (!$this->isWritableDir($this->env->getProjectsRootDir())) {\n throw new FilesystemException(\n \"Directory does not exist or is not writeable: {$this->env->getProjectsRootDir()}\"\n );\n }\n\n if (!$this->isWritableDir($this->env->getSslCertificatesDir())) {\n throw new FilesystemException(\n \"Directory does not exist or is not writeable: {$this->env->getSslCertificatesDir()}\"\n );\n }\n\n $this->getDirPath(self::DIR_PHP_DOCKERFILES);\n $this->getDirPath(self::DIR_PROJECT_TEMPLATE);\n\n if (!$this->isWritableFile($this->getTraefikRulesFile())) {\n throw new FilesystemException(\n \"Missing Traefik SSL configuration file: {$this->getTraefikRulesFile()}\\n\" .\n 'Maybe the infrastructure has not been set up yet.'\n );\n }\n }",
"private function checkSourceExists()\n {\n // Check if source exists\n if (!@file_exists($this->getSource())) {\n throw new TargetNotFoundException('File or directory not found: ' . $this->getSource());\n }\n }",
"protected function throwMissingSingletonDataException($missingDataName){\r\n\t\tthrow new Exception('ToolBoxException | singleton for \"'.get_class($this).'\" could not be constructed, missing data \"'.$missingDataName.'\"');\r\n\t}",
"protected function assertFilesDontExist()\n {\n $this->assertFileNotExists($this->getSeedFilePath('LarafolioSeeder.php'));\n\n $this->assertFileNotExists($this->getSeedFilePath('ImagesTableSeeder.php'));\n\n $this->assertFileNotExists($this->getSeedFilePath('ProjectsTableSeeder.php'));\n\n $this->assertFileNotExists($this->getSeedFilePath('TextBlocksTableSeeder.php'));\n\n $this->assertFileNotExists($this->getSeedFilePath('UsersTableSeeder.php'));\n\n $this->assertFileNotExists(database_path('factories/ModelFactory.php'));\n }",
"private function ensureDirectory() {\n\t\tif (!is_dir($this -> directory)) {\n\t\t\tif (!mkdir($this -> directory)) {\n\t\t\t\tthrow new LatexException('Could not create directory ' . $this -> directory);\n\t\t\t}\n\t\t}\n\t}",
"public function testReadDocumentWithIllegalArgumentException() {\n\n $obj = new FileSystemStorageProvider($this->logger, $this->directory);\n\n try {\n\n $obj->readDocument($this->dir1);\n } catch (Exception $ex) {\n\n $this->assertInstanceOf(IllegalArgumentException::class, $ex);\n $this->assertEquals(\"The document must be a document\", $ex->getMessage());\n }\n }",
"public function testReadFromFileReturnsLoadsDataWhenConfigFileExistsInPath()\n {\n $tempDirPath = sys_get_temp_dir() . \"/\" . uniqid();\n $tempCacheFilePath = $tempDirPath . \"/current\";\n\n try {\n $setModel = new AuthCacheUtil($this->_getDefaultModelTestData());\n $setModel->setAuthCacheDir($tempDirPath);\n\n $setModel->write();\n\n $this->assertFileExists($tempCacheFilePath,\n \"Cache file should existing in the newly created cache file path after writing.\");\n\n $model = AuthCacheUtil::readFromFile($tempDirPath);\n\n $this->assertJsonStringEqualsJsonString($setModel->__toString(), $model->__toString(),\n \"Auth cache util should deserialize data to the same value as the original cache file.\");\n\n\n $this->assertJsonStringEqualsJsonFile($tempCacheFilePath, $model->__toString(),\n \"Cache file should serialize data to the same value as was written to disk.\");\n }\n finally {\n // delete the written cache file\n if (file_exists($tempCacheFilePath)) {\n unlink($tempCacheFilePath);\n }\n\n rmdir($tempDirPath);\n }\n }",
"public static function check($path, $ds = DIRECTORY_SEPARATOR)\n\t{\n\t\tif (strpos($path, '..') !== false)\n\t\t{\n\t\t\t// Don't translate\n\t\t\tthrow new \\Exception(__CLASS__ . '::check Use of relative paths not permitted', 20);\n\t\t}\n\n\t\t$rootPath = Application::getInstance()->getContainer()->filesystemBase;\n\n\t\t$path = self::clean($path);\n\t\tif (($rootPath != '') && strpos($path, self::clean($rootPath)) !== 0)\n\t\t{\n\t\t\t// Don't translate\n\t\t\tthrow new \\Exception(__CLASS__ . '::check Snooping out of bounds @ ' . $path, 20);\n\t\t}\n\n\t\treturn $path;\n\t}",
"public function test_cohortsync_with_notfoundfile() {\n global $CFG;\n\n $csvfilename = $CFG->dirroot.'/admin/tool/cohortsync/tests/fixtures/cohorts_notfound.csv';\n\n $cohortsync = new cohortsync($this->trace, $csvfilename);\n\n $this->assertEquals(1, count($cohortsync->get_errors()));\n $errormsg = $cohortsync->get_errors()[0];\n $this->assertStringContainsString('not readable or does not exist', $errormsg->out());\n }",
"private function validatePath($path)\n {\n if (!$this->isDirectory($path)) {\n throw new Exception('The view path must be a directory!');\n }\n if (!is_readable($path)) {\n throw new Exception('The view path must be a readable directory!');\n }\n }",
"public function test_OffsetSetException_NoExtForDir()\n {\n $this->setExpectedException('Q\\Exception', \"Unable to create section 'test': No extension specified for Config_Dir '{$this->dir}', creating a section requires setting a Config_File object.\");\n $config = new Config_Dir($this->dir); \n $config['test'] = array();\n }",
"protected static function checkMainPathsExist() {}"
] | [
"0.8110693",
"0.78229994",
"0.6789695",
"0.59919906",
"0.59202546",
"0.5832519",
"0.57075226",
"0.56565315",
"0.56031394",
"0.5587415",
"0.55260384",
"0.5520538",
"0.54952514",
"0.5461734",
"0.54442966",
"0.54427797",
"0.54328895",
"0.54191715",
"0.53932315",
"0.53719383",
"0.5352259",
"0.5318837",
"0.5316097",
"0.5304023",
"0.5287141",
"0.52770007",
"0.525336",
"0.52369577",
"0.5227308",
"0.52135867",
"0.5194549",
"0.51927423",
"0.51637536",
"0.51353145",
"0.51255214",
"0.5099527",
"0.5090876",
"0.508596",
"0.50821507",
"0.50819826",
"0.50727576",
"0.5060974",
"0.504057",
"0.50371283",
"0.5026922",
"0.5024927",
"0.50058085",
"0.4984078",
"0.4977316",
"0.4967537",
"0.49625552",
"0.49526754",
"0.49383587",
"0.4937037",
"0.49207845",
"0.4920442",
"0.49156693",
"0.4894721",
"0.4894194",
"0.48907432",
"0.48878387",
"0.48871404",
"0.48813292",
"0.488129",
"0.4879768",
"0.4876598",
"0.48722968",
"0.48681828",
"0.4859474",
"0.4859474",
"0.4859474",
"0.4859474",
"0.48391402",
"0.48380393",
"0.4831218",
"0.48276597",
"0.48233977",
"0.48190275",
"0.48175693",
"0.48170894",
"0.48166907",
"0.4813684",
"0.4812892",
"0.48048186",
"0.47930974",
"0.47913697",
"0.4787278",
"0.47830975",
"0.47829038",
"0.47758868",
"0.4762563",
"0.47606832",
"0.47580048",
"0.4753142",
"0.47416395",
"0.4739281",
"0.47337756",
"0.47331074",
"0.47324142",
"0.47222137"
] | 0.8085527 | 1 |
Checks that method _load_ throws _DataDirectoryNotFoundException_, if read access to data directory is denied. | public function testLoadThrowsDataDirectoryNotFoundForNonReadableDirectory(): void
{
$dirname = 'forbidden';
$this->addDirectoryToVFS($dirname, 0);
$path = $this->getFullPath($dirname);
$this->expectException(DataDirectoryNotFoundException::class);
$this->expectExceptionExactMessage("Root folder $path was not found.");
$directoryDataLoader = $this->prepareDirectoryDataLoader();
$directoryDataLoader->load($path, '/^.*\..*$/');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testLoadThrowsDataDirectoryNotFoundForFileInsteadOfDirectory(): void\n {\n $filename = 'accessible.json';\n $this->addFileToVFS($filename);\n $path = $this->getFullPath($filename);\n $this->expectException(DataDirectoryNotFoundException::class);\n $this->expectExceptionExactMessage(\"Root folder $path was not found.\");\n\n $directoryDataLoader = $this->prepareDirectoryDataLoader();\n\n $directoryDataLoader->load($path, '/^.*\\..*$/');\n }",
"public function testLoadThrowsDataDirectoryNotFoundForNonExistingDir(): void\n {\n $dirname = 'nonexistent';\n $path = $this->getFullPath($dirname);\n $this->expectException(DataDirectoryNotFoundException::class);\n $this->expectExceptionExactMessage(\"Root folder $path was not found.\");\n\n $directoryDataLoader = $this->prepareDirectoryDataLoader();\n\n $directoryDataLoader->load($path, '/^.*\\..*$/');\n }",
"public function checkFolderPermissionsFilesystemPermissionsDataProvider() {}",
"public function testLoadReturnsCorrectDataWithExceptionsThrownByDataLoaders(): void\n {\n $this->prepareVFSDirectoryStructure();\n $fullPath = $this->getFullPath('container');\n $expectedFilesMap = ['FileSecond' => 'first/file_second.exe', 'SomeExt' => 'some_ext.exe'];\n $expectedLoadData = ['FileSecond' => ['param1' => 'with_value'], 'SomeExt' => ['param2' => 'without_value']];\n $expectedExceptions =\n array_fill_keys([\"$fullPath/first/file_first.exe\", \"$fullPath/second/file_third.exe\"], new Exception());\n $dataLoaderMockCallbackParams = [$fullPath, $expectedFilesMap, $expectedLoadData, $expectedExceptions];\n $dataLoaderMockCallback = $this->prepareDataLoaderMockCallbackWithExceptions(...$dataLoaderMockCallbackParams);\n $directoryDataLoader = $this->prepareDirectoryDataLoader($dataLoaderMockCallback);\n\n $actualLoadData = $directoryDataLoader->load($fullPath, '/^.*\\.exe$/');\n\n static::assertArraysAreSame($expectedLoadData, $actualLoadData);\n }",
"protected function validateStoragePath()\r\n {\r\n if (is_null($this->storagePath)) {\r\n throw new Exception('A storage path has not been set');\r\n }\r\n\r\n if ( ! is_dir($this->storagePath) || ! is_writable($this->storagePath)) {\r\n throw new Exception('The specified storage path is not writable');\r\n }\r\n }",
"private function checkDir()\n {\n if (!is_dir($this->basePath)) {\n throw new InvalidArgumentException('base path: ' . $this->basePath .\n ' is not a directory or does not exist' .\n ' current working dir is ' . getcwd());\n }\n // check writable\n if (!is_writable($this->basePath)) {\n throw new InvalidArgumentException('base path: ' . $this->basePath .\n ' is not writable' .\n ' current working dir is ' . getcwd());\n }\n }",
"private function checkReadable() {\n\t\tif ( !$this->isReadable() ) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Current user doesn't have permissions to view this pathway\"\n\t\t\t);\n\t\t}\n\t}",
"private function checkConfiguration()\n {\n if (!isset($this->getConf()->{'privatedir'})) {\n // @codeCoverageIgnoreStart\n throw new \\Exception('Empty privatedir');\n // @codeCoverageIgnoreEnd\n }\n }",
"public function canNotOpenDirectory()\n {\n $this->assertFalse(@dir(vfsStream::url('foo')));\n }",
"public function testCreateDataCollectionThrowsExceptionOnInvalidDirectory(): void\n {\n $collection = $this->getMockBuilder(DataCollection::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $property = new ReflectionProperty($this->object, 'collection');\n $property->setValue($this->object, $collection);\n\n $this->expectException(RuntimeException::class);\n $this->expectExceptionMessage('Directory \"./platforms\" does not exist.');\n\n $this->object->createDataCollection('.');\n }",
"public function isDirectoryOperationAllowed() {}",
"public function getFilePermissionsReturnsCorrectPermissionsForFilesNotOwnedByCurrentUser_dataProvider() {}",
"public function init()\n\t{\n\t\tPiwik::checkDirectoriesWritableOrDie( array('/config/') );\n\n\t\tif(file_exists($this->pathLocal)\n\t\t\t&& !is_writable($this->pathLocal))\n\t\t{\n\t\t\tthrow new Exception(Piwik_TranslateException('General_ExceptionUnwritableFileDisabledMethod', array($this->pathLocal)));\n\t\t}\n\n\t\tparent::init();\n\t}",
"static function checkPermissions() {\n\t\tif ( !@file_exists(self::getConfig()->getPathLogs()) || !@is_writable(self::getConfig()->getPathLogs()) ) {\n\t\t\texit(\"The LOGS folder cannot be written to by the current process: \".self::getConfig()->getPathLogs());\n\t\t}\n\t\tif ( !@file_exists(self::getConfig()->getPathTemp()) || !@is_writable(self::getConfig()->getPathTemp()) ) {\n\t\t\texit(\"The TEMP folder cannot be written to by the current process: \".self::getConfig()->getPathTemp());\n\t\t}\n\t}",
"public function testInvalidArgumentExceptionIsThrownIfDirectoryIsNotReadableWhenCreatingProcedureLoader()\n {\n $this->setExpectedException('\\InvalidArgumentException');\n\n $procedureFactory = $this->getProcedureFactory();\n\n $procedureLoaderFactory = $this->getProcedureLoaderFactory($procedureFactory);\n $procedureLoaderFactory->createProcedureLoader('invalid/directory');\n }",
"private function validateCachePath($path)\n {\n if (!$this->isDirectory($path)) {\n throw new Exception('The cache path must be a directory!');\n }\n if (!is_readable($path)) {\n throw new Exception('The cache path must be a readable directory!');\n }\n if (!is_writable($path)) {\n throw new Exception('The cache path must be a writable directory!');\n }\n }",
"public function testReadWrite() {\n if (file_exists(\"data/testreadwrite.txt\")) {\n unlink(\"data/testreadwrite.txt\");\n }\n if (file_exists(\"data\")) {\n file_put_contents(\"data/testreadwrite.txt\", \"1234567890\");\n $input = file_get_contents(\"data/testreadwrite.txt\");\n unlink(\"data/testreadwrite.txt\");\n }\n if (isset($input) && $input === \"1234567890\") {\n $this->pass(\"We can read/write to the data directory.\");\n }\n else {\n $this->fail(\"We are unable to read/write to the data directory.\");\n }\n }",
"private function dirIsValid() {\n return is_dir($this->directory);\n }",
"public function ensure(): void\n {\n if (config('lodata.authorization') === false) {\n if (!in_array($this->access, [self::read, self::query]) && config('lodata.readonly') === true) {\n throw new ForbiddenException('forbidden', 'This service is read-only');\n }\n\n return;\n }\n\n if (!LaravelGate::check('lodata', $this)) {\n throw new UnauthorizedException;\n }\n }",
"protected function checkFilesDir() {\n\t\t$perms = @fileperms(self::FILES_DIR);\n\t\t/* create if not exist */\n\t\tif ($perms === false) {\n\t\t\tif (!mkdir(self::FILES_DIR, 0700, true)) {\n\t\t\t\tthrow new QuicksandException(\"Cannot create files dir.\");\n\t\t\t}\n\t\t}\n\t\t/* check if dir */\n\t\telse if (($perms & 0x4000) != 0x4000) {\n\t\t\tthrow new QuicksandException(\"Files dir is not actually a directory.\");\n\t\t}\n\t\t/* check permissions */\n\t\telse if (($perms & 0700) != 0700) {\n\t\t\tthrow new QuicksandException(\"Missing permissions. Make sure this script can read, write and enter the files dir.\");\n\t\t}\n\t}",
"function openDirectory(){\n if (!file_exists(\"./data\")){ # If file doesn't exist return false\n $handleDir = false;\n return $handleDir;\n }\n else{\n $handleDir = opendir(\"./data\");\n /* I'm checking if the handleDir == returns false for some other reason in connection.php. This is part of validation.php,\n which allows me to present an error message above the form (nb if opendir can't connect it returns a boolean value of false) */\n return $handleDir;\n }\n}",
"public function testLoad()\n {\n $this->_access->load('gir', array('bar'));\n $this->diag($this->_access->list);\n \n // simply test there's correct amount of acl rows\n $actual = count($this->_access->list);\n $expect = 1;\n $this->assertEquals($actual, $expect);\n }",
"public function validate() {\n\t\t\n\t\tif(!is_dir($this->path)) {\n\t\t\tthrow new Exception('The path provided does not exist', '400');\n\t\t}\n\t\t\n\t\tif(!is_writeable($this->path)) {\n\t\t\tthrow new Exception('The path provided is not writeable', '400');\n\t\t}\n\t\t\n\t\tif(file_exists($this->path . $this->filename)) {\n\t\t\t\n\t\t\tif($this->allow_overwrite === false && $this->rename_if_exists === false) {\n\t\t\t\tthrow new Exception('The file ' . $this->filename . ' already exists', '400');\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif($this->checkExtension() === false) {\n\t\t\tthrow new Exception('The file has an invalid extension', '400');\n\t\t}\n\t\t\n\t\treturn true;\n\t\t\n\t}",
"public function it_should_throw_is_specified_dump_file_is_not_readable()\n {\n $root = vfsStream::setup('root');\n $dumpFle = vfsStream::newFile('foo.sql', 0000);\n $root->addChild($dumpFle);\n $path = $root->url() . '/foo.sql';\n\n $driver = $this->stubProphecy(ExtendedMySql::class);\n $driver->load($path)->shouldNotBeCalled();\n\n $this->expectException(\\InvalidArgumentException::class);\n\n $sut = $this->make_instance();\n $sut->_setDriver($driver->reveal());\n\n $sut->importSqlDumpFile($path);\n }",
"public function checkIsReadable($path);",
"public function testPathToDatasetFileInvalid()\n {\n $rem = new RemServer();\n $session = new Session([\"name\" => \"test\"]);\n $dataset = [ANAX_INSTALL_PATH . \"/config/remserver/dataset/users-NO.json\"];\n\n $rem->setDefaultDataset($dataset)\n ->injectSession($session)\n ->init();\n }",
"public function isDirectoryCopyAllowed() {}",
"public function checkAccess() {}",
"public function checkAccess() {}",
"public function checkAccess() {}",
"public function checkAccess() {}",
"public function checkAccess() {}",
"public function checkAccess() {}",
"public function checkAccess() {}",
"public function checkAccess() {}",
"public function initializeObject()\n {\n if (!is_writable($this->path)) {\n Files::createDirectoryRecursively($this->path);\n }\n if (!is_dir($this->path) && !is_link($this->path)) {\n throw new StorageException('The directory \"' . $this->path . '\" which was configured as a resource storage does not exist.', 1361533189);\n }\n if (!is_writable($this->path)) {\n throw new StorageException('The directory \"' . $this->path . '\" which was configured as a resource storage is not writable.', 1361533190);\n }\n }",
"protected function loadStats()\n {\n if ($this->stat === false) {\n $this->stat = @stat($this->getPath());\n if ($this->stat===false) {\n throw new T_Exception_File($this->getPath(),'stat error');\n }\n }\n }",
"function privDirCheck($p_dir, $p_is_dir = \\false)\n {\n }",
"private function loadPermissions() {\n\tif ($this->permissionsloaded) {return;}\n\t//$mem = DStructMemCache::getInstance();\n\t//if (!$this->permissions = $mem->get(md5(get_class($this->activecontainer).$this->areaname.$this->activecontainer->getID()))) {\n\t\t$this->permissions = $this->activecontainer->permissions();\n\t//\t$mem->set(md5(get_class($this->activecontainer).$this->areaname.$this->activecontainer->getID()), $this->permissions);\n\t//}\n\t$this->permissionsloaded = true;\n}",
"public function testInvalidFileException() {\n\t\t$this->expectException('/Could not read file/');\n\t\tFixture::load('Foobar');\n\t}",
"public function checkAccess()\n {\n // need to be modified for security\n }",
"private function validatePath($path)\n {\n if (!$this->isDirectory($path)) {\n throw new Exception('The view path must be a directory!');\n }\n if (!is_readable($path)) {\n throw new Exception('The view path must be a readable directory!');\n }\n }",
"public function testReadWithNonExistentFile() {\n $reader = new ConfigReader($this->path);\n $reader->read('fake_values');\n }",
"public function validateTestData()\n\t{\n\t\t$testDataFileName = $this->config->getTestData();\n\t\tif (!(realpath($testDataFileName) || realpath(Config::$testDataFile))){\n\t\t\t$this->errors['testData'][] = [\n\t\t\t\t'property' => 'testData',\n\t\t\t\t'message' => 'Test data file was not found.'\n\t\t\t];\n\t\t}\n\t}",
"public function checkIfCanLoad()\r\n\t{\r\n\t\treturn true;\r\n\t}",
"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 _validateModifiable()\n {\n if(!($this->_getDataSource() instanceof wCrudAdapter))\n {\n throw new Exception('Object is read-only.');\n }\n }",
"private function validatePath()\n {\n $locator = new FileLocator();\n $locator->locate($this->path); // throws exception on failure\n }",
"protected function throwInaccessibleException() {}",
"public function testIfExceptionIsThrownWhenConfigurationIsNotValid()\n {\n $path = $this->getTestDataDir() . '/config.invalid.yml';\n\n $this->assertTrue(is_readable($path), 'Invalid configuration file is missing.');\n\n $reader = new Reader(new Configuration());\n $reader->read($path);\n }",
"public function testCacheFileDoesNotExistsAndDirectoryIsNotWritable()\n {\n $cacheFile = __DIR__ . '/non-writable-directory/router.cache';\n\n $this->expectException(RuntimeException::class);\n $this->expectExceptionMessage(sprintf(\n 'Route collector cache file directory `%s` is not writable',\n dirname($cacheFile)\n ));\n\n $responseFactoryProphecy = $this->prophesize(ResponseFactoryInterface::class);\n $callableResolverProphecy = $this->prophesize(CallableResolverInterface::class);\n\n $routeCollector = new RouteCollector($responseFactoryProphecy->reveal(), $callableResolverProphecy->reveal());\n $routeCollector->setCacheFile($cacheFile);\n }",
"public function testIfExceptionIsThrownWhenConfigurationCannotBeRead()\n {\n $reader = new Reader(new Configuration());\n $reader->read('/does-not-exists-i-guess');\n }",
"public function testAllowInvalidPermission()\n {\n $this->expectException(\\Exception::class);\n $this->Acl->allow('Micheal', 'tpsReports', 'derp');\n }",
"private function validateEnv(): void\n {\n $this->getAuthJsonContent();\n\n if (!$this->isWritableDir($this->env->getProjectsRootDir())) {\n throw new FilesystemException(\n \"Directory does not exist or is not writeable: {$this->env->getProjectsRootDir()}\"\n );\n }\n\n if (!$this->isWritableDir($this->env->getSslCertificatesDir())) {\n throw new FilesystemException(\n \"Directory does not exist or is not writeable: {$this->env->getSslCertificatesDir()}\"\n );\n }\n\n $this->getDirPath(self::DIR_PHP_DOCKERFILES);\n $this->getDirPath(self::DIR_PROJECT_TEMPLATE);\n\n if (!$this->isWritableFile($this->getTraefikRulesFile())) {\n throw new FilesystemException(\n \"Missing Traefik SSL configuration file: {$this->getTraefikRulesFile()}\\n\" .\n 'Maybe the infrastructure has not been set up yet.'\n );\n }\n }",
"public function testReadDocumentWithIllegalArgumentException() {\n\n $obj = new FileSystemStorageProvider($this->logger, $this->directory);\n\n try {\n\n $obj->readDocument($this->dir1);\n } catch (Exception $ex) {\n\n $this->assertInstanceOf(IllegalArgumentException::class, $ex);\n $this->assertEquals(\"The document must be a document\", $ex->getMessage());\n }\n }",
"public function testReadConfigurationTrowsException()\n {\n\t $method = $this->setAccessibleMethod('readConfig');\n\n\t $method->invoke($this->dbConfiguration->newInstanceWithoutConstructor(), 11);\n\n }",
"public function getDirectoryData();",
"abstract public function loadData();",
"public function checkReadPermission(BreadEvent $event)\n {\n if (!$this->isGranted($this->basePermission, $event->getEntity())) {\n throw new UnauthorizedException;\n }\n }",
"private function checkAccess() {\n $this->permission('Garden.Import'); // This permission doesn't exist, so only users with Admin == '1' will succeed.\n \\Vanilla\\FeatureFlagHelper::ensureFeature(\n 'Import',\n t('Imports are not enabled.', 'Imports are not enabled. Set the config Feature.Import.Enabled = true to enable imports.')\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 checkPermissions() {\n if ($this->checkIp()) {\n \\BDSCore\\Errors\\Errors::returnError(403);\n }\n }",
"public function check_data()\n {\n parent::check_data();\n\n if(empty($this->build_notifications))\n {\n throw new exception('<strong>Data missing: Notifications</strong>');\n }\n\n if(empty($this->build_batch_reference))\n {\n throw new exception('<strong>Data missing: Batch References</strong>');\n }\n }",
"public function testBadLoaderDefined() {\n $this->expectException('\\\\Phloem\\\\Exception\\\\LoaderException');\n\n $this->factory->setLoader('bad', true);\n $this->factory->getLoader('filename.bad');\n }",
"public function wasReadOnlyError() {\n\t\treturn false;\n\t}",
"function folder_is_writable(string $folder)\n{\n if (file_exists($folder)) {\n if (!is_writable($folder)) {\n throw new Exception(\"no_rights\", 1);\n } else {\n return true;\n }\n }\n return false;\n}",
"public function verify_file_access() {\n\t\tif (function_exists('clearstatcache')) {\n\t\t\tclearstatcache();\n\t\t}\n\n\t\t// First check wp-config.php.\n\t\tif (!is_writable(ABSPATH . 'wp-config.php') && !is_writable(ABSPATH . '../wp-config.php')) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Now check wp-content. We need to be able to create files of the same user as this file.\n\t\tif (!$this->_is_dir_writable(untrailingslashit(WP_CONTENT_DIR))) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// If the cache and config directories exist, make sure they're writeable\n\t\tif (file_exists(untrailingslashit(WP_CONTENT_DIR) . '/wpo-cache')) {\n\t\t\t\n\t\t\tif (file_exists(WPO_CACHE_DIR)) {\n\t\t\t\tif (!$this->_is_dir_writable(WPO_CACHE_DIR)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (file_exists(WPO_CACHE_CONFIG_DIR)) {\n\t\t\t\tif (!$this->_is_dir_writable(WPO_CACHE_CONFIG_DIR)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}",
"protected function fetchData()\n {\n $this->checkRequiredParameters();\n\n if (!is_null($this->data)) {\n /*\n * If the $data variable isn't null anymore, data was provided\n * from outside. This means, we have to stop the method execution\n * here to prevent subclasses from fetching data from the database.\n *\n * Using a return statement to stop the method execution won't work,\n * because it just ends the execution of the parent method. By using\n * an exception, we ensure that also the execution of the child method\n * is stopped. The exception should be catched in the method which\n * calls fetchData().\n *\n * To indicate that this IndexDataException is thrown to show the\n * existence of valid external data and not because of errors in the\n * data, we set the specific exception code 1 which differs from the\n * default value 0.\n */\n throw new IndexDataException('Data has still been provided\n from outside and should not be overridden.', 1);\n }\n }",
"protected static function fileIsAccessible($path)\n {\n }",
"public function testCreateDataCollectionFailsBecauseOfEmptyDirectory(): void\n {\n $path = __DIR__ . '/../../../fixtures/empty-directory';\n\n $this->expectException(RuntimeException::class);\n $this->expectExceptionMessage(sprintf('Directory \"%s/browsers\" was empty.', $path));\n\n $this->object->createDataCollection($path);\n }",
"public function testReadNonExistingFile()\n {\n $filename = static::$baseFile . '/fs/tmp.txt';\n try {\n file_get_contents($filename);\n\n $this->fail('Expected read of non-existing file to fail');\n } catch (\\PHPUnit_Framework_Error_Warning $e) {\n $this->assertContains('failed to open stream', $e->getMessage());\n }\n }",
"private function loadReadDataIntoMDR() {\r\n \r\n }",
"public static function check($path, $ds = DIRECTORY_SEPARATOR)\n\t{\n\t\tif (strpos($path, '..') !== false)\n\t\t{\n\t\t\t// Don't translate\n\t\t\tthrow new \\Exception(__CLASS__ . '::check Use of relative paths not permitted', 20);\n\t\t}\n\n\t\t$rootPath = Application::getInstance()->getContainer()->filesystemBase;\n\n\t\t$path = self::clean($path);\n\t\tif (($rootPath != '') && strpos($path, self::clean($rootPath)) !== 0)\n\t\t{\n\t\t\t// Don't translate\n\t\t\tthrow new \\Exception(__CLASS__ . '::check Snooping out of bounds @ ' . $path, 20);\n\t\t}\n\n\t\treturn $path;\n\t}",
"public function load() \n\t{\n\t\tif (is_null ( $this->getDataFile () )) \n\t\t{\n\t\t\tthrow new Exception ( 'Data File is not set' );\n\t\t}\n\t\t\n\t\tif (!file_exists($this->getDataFile()))\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn json_decode(file_get_contents($this->getDataFile()));\n\t\t}\n\t}",
"protected function _aclValidation()\n {\n if(!$this->_aclResource && !$this->_aclPrivilege) {\n return;\n }\n \n if(!$this->_acl->isUserAllowed(\n $this->_aclResource, \n $this->_aclPrivilege\n )) {\n $fullResource = array(\n $this->_request->getModuleName(),\n $this->_request->getControllerName(),\n $this->_request->getActionName(),\n );\n \n throw new SG_Controller_Action_NotAuthorized_Exception(\n 'User not allowed to access \"' \n . implode(':', $fullResource) \n . '\" (ACL: '\n . $this->_aclResource\n . ' > '\n . $this->_aclPrivilege\n . ').'\n );\n }\n }",
"public function isDataDumpAvailable()\n {\n $result = self::checkFileAccess(Registry::get('config.dir.install') . App::DB_DATA);\n\n if (!$result) {\n $app = App::instance();\n $app->setNotification('E', $app->t('error'), $app->t('data_dump_is_not_available'), true);\n }\n\n return $result;\n }",
"public function checkCache()\n {\n $this->assertWritableDir($this->config->getPath('cache'));\n }",
"abstract public function require_access();",
"public function testCreateDataCollectionFailsBecauseOfMissingFiles(): void\n {\n $path = __DIR__ . '/../../../fixtures/missing-file';\n\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage(sprintf('File \"%s/core/default-browser.json\" does not exist.', $path));\n\n $this->object->createDataCollection($path);\n }",
"public function testReadFromFileThrowsExceptionWhenConfigPathIsFileNotNamedCurrent()\n {\n $tempDirPath = sys_get_temp_dir() . \"/\" . uniqid();\n $tempCacheFilePath = $tempDirPath . \"/current\";\n $renamedCacheFilePath = $tempDirPath . \"/myCacheFileName\";\n try {\n $setModel = new AuthCacheUtil($this->_getDefaultModelTestData());\n $setModel->setAuthCacheDir($tempDirPath);\n\n $setModel->write();\n\n $this->assertFileExists($tempCacheFilePath,\n \"Cache file should existing in the newly created cache file path after writing.\");\n\n rename($tempCacheFilePath, $renamedCacheFilePath);\n\n AuthCacheUtil::readFromFile($renamedCacheFilePath);\n\n $this->fail(\"Exception should be thrown when a path is given to a file not named 'current'\");\n }\n finally {\n // delete the written cache file\n if (file_exists($tempCacheFilePath)) {\n unlink($tempCacheFilePath);\n }\n\n // delete the written cache file\n if (file_exists($renamedCacheFilePath)) {\n unlink($renamedCacheFilePath);\n }\n\n rmdir($tempDirPath);\n }\n }",
"private function isDirWritable($cacheDir) {\n\t\ttry {\n\t\t\tif (!is_writable(BASEPATH . $cacheDir)) {\n\t\t\t\tthrow new Fari_Exception('Cache directory ' . $cacheDir . ' is not writable.');\n\t\t\t}\n\t\t} catch (Fari_Exception $exception) { $exception->fire(); }\n\t}",
"public static function assertReadable($path) {\n if (!is_readable($path)) {\n throw new FilesystemException(\n $path,\n pht(\"Path '%s' is not readable.\", $path));\n }\n }",
"public function checkDirectoryExistance()\n {\n if (!file_exists($this->event->getConfig()->router->global_router)) {\n return false;\n }\n if (!is_readable($this->event->getConfig()->router->global_router)) {\n return false;\n }\n\n return true;\n }",
"public function testReadFromFileReturnsLoadsDataWhenConfigFileExistsInPath()\n {\n $tempDirPath = sys_get_temp_dir() . \"/\" . uniqid();\n $tempCacheFilePath = $tempDirPath . \"/current\";\n\n try {\n $setModel = new AuthCacheUtil($this->_getDefaultModelTestData());\n $setModel->setAuthCacheDir($tempDirPath);\n\n $setModel->write();\n\n $this->assertFileExists($tempCacheFilePath,\n \"Cache file should existing in the newly created cache file path after writing.\");\n\n $model = AuthCacheUtil::readFromFile($tempDirPath);\n\n $this->assertJsonStringEqualsJsonString($setModel->__toString(), $model->__toString(),\n \"Auth cache util should deserialize data to the same value as the original cache file.\");\n\n\n $this->assertJsonStringEqualsJsonFile($tempCacheFilePath, $model->__toString(),\n \"Cache file should serialize data to the same value as was written to disk.\");\n }\n finally {\n // delete the written cache file\n if (file_exists($tempCacheFilePath)) {\n unlink($tempCacheFilePath);\n }\n\n rmdir($tempDirPath);\n }\n }",
"public function checkConfiguration()\n\t{\n\t\tglobal $langs;\n\n\t\t$errors = array();\n\n\t\t$filename = $this->getFilename();\n\n\t\tif (file_exists($filename) && is_writable($filename))\n\t\t{\n\t\t\tdol_syslog('admin/syslog: file '.$filename);\n\t\t}\n\t\telse $errors[] = $langs->trans(\"ErrorFailedToOpenFile\", $filename);\n\n\t\treturn $errors;\n\t}",
"public function testReadFromFileSetDefaultAuthCacheDirWhenMissingPath()\n {\n $testModel = AuthCacheUtil::readFromFile();\n\n $this->assertEquals(AuthCacheUtil::getDefaultAuthCacheDirectory(), $testModel->getAuthCacheDir(),\n \"Auth cache directory should be set to the default path when no cache dir provided.\");\n }",
"public function canNotOpen()\n {\n $this->assertFalse(@fopen(vfsStream::url('foo')));\n }",
"private function check_directory()\n\t{\n\t\tif (!is_dir(Kohana::config($this->type.'.cache_folder')))\n\t\t\tmkdir(Kohana::config($this->type.'.cache_folder'));\n\t}",
"public function testReadConfigurationFileOrArray()\n {\n\t $method = $this->setAccessibleMethod('readConfig');\n\n\t $this->assertEquals([], $method->invoke($this->dbConfiguration->newInstanceWithoutConstructor(), __DIR__.'/dummy/configuration.php'));\n\n\t $this->assertEquals([], $method->invoke($this->dbConfiguration->newInstanceWithoutConstructor(), []));\n }",
"public function testCreateInvalidFile()\n {\n new MaterializedResource(new GenericResource('file_not_found.txt'), '/probably/not/a/directory');\n }",
"public function isValidLevelThrowsExceptionOnInvalidLevelIfAskedToDoSoDataProvider() {}",
"public function testLoadFile_invalidFileName() : void\n {\n $spreadsheet = SpreadsheetUtil::loadFile('junk.xls');\n $this->assertNull($spreadsheet);\n }",
"private function read(): array|false {\n $security = \"<?php header(\\\"Status: 403\\\"); exit(\\\"Access denied.\\\"); ?>\\n\";\n $contents = @file_get_contents(INCLUDES_DIR.DIR.\"config.json.php\");\n\n if ($contents === false)\n return false;\n\n $json = json_get(str_replace($security, \"\", $contents), true);\n\n if (!is_array($json))\n return false;\n\n return $this->data = $json;\n }",
"function _block_direct_file_access() {\n\t\tIMFORZA_Utils::block_direct_file_access();\n\t}",
"public function should_throw_if_trying_to_build_on_non_existing_directory(): void\n {\n $this->expectException(\\InvalidArgumentException::class);\n new DirectorySnapshot(__DIR__ . '/not-existing');\n }",
"public function check()\n {\n if (!file_exists($this->websitesDir)) {\n throw new \\RuntimeException(sprintf('Websites directory \"%s\" is not available', $this->websitesDir));\n }\n\n if (!is_writable($this->websitesDir)) {\n throw new \\RuntimeException(sprintf('Websites directory \"%s\" is not writable', $this->websitesDir));\n }\n }",
"public function test_load_returns_empty_array_if_conf_dir_dnx()\n {\n $config = new Bootphp_Config_File_Reader('gafloogle');\n\n $this->assertSame([], $config->load('values'));\n }",
"public function testReadFromFileReturnsEmptyAuthCacheWhenCacheFileDoesNotExist()\n {\n $tempDirPath = sys_get_temp_dir() . \"/\" . uniqid() . \"/\";\n $tempCacheFilePath = $tempDirPath . \"current\";\n\n try {\n $emptyModel = new AuthCacheUtil();\n $emptyModelData = $emptyModel->__toString();\n\n mkdir($tempDirPath, 755, true);\n\n $testModel = AuthCacheUtil::readFromFile($tempCacheFilePath);\n\n $this->assertJsonStringEqualsJsonString($emptyModelData, $testModel->__toString(),\n \"Cache file should serialize empty auth config when cache file does not exist.\");\n\n $this->assertEquals($tempDirPath, $testModel->getAuthCacheDir(),\n \"Auth cache directory should be set to the loaded path regardless of success.\");\n }\n finally {\n // delete the cache dir\n rmdir($tempDirPath);\n }\n }",
"public function doesCheckModifyAccessListThrowExceptionOnWrongHookInterface() {}",
"function Tests_Auth_Yadis_datafile($name, $reader)\n{\n $path = dirname(realpath(__FILE__));\n $sep = DIRECTORY_SEPARATOR;\n $filename = $path . $sep . 'data' . $sep . $name;\n $data = $reader($filename);\n if ($data === false) {\n $msg = \"Failed to open data file: $name\";\n trigger_error($msg, E_USER_ERROR);\n }\n return $data;\n}"
] | [
"0.73274696",
"0.6951977",
"0.6154955",
"0.59455526",
"0.5696819",
"0.56874084",
"0.56486386",
"0.56125045",
"0.5513242",
"0.5491798",
"0.5438474",
"0.5403089",
"0.5361558",
"0.5317423",
"0.53033257",
"0.5298568",
"0.5292611",
"0.5265657",
"0.52390426",
"0.52330214",
"0.5227806",
"0.52240264",
"0.5210747",
"0.51983744",
"0.5157022",
"0.51563436",
"0.5141984",
"0.5107088",
"0.5107088",
"0.5107088",
"0.510697",
"0.510697",
"0.5106571",
"0.5106571",
"0.5106571",
"0.5106034",
"0.5080877",
"0.5072165",
"0.5064898",
"0.50619864",
"0.505093",
"0.50460774",
"0.5045588",
"0.50404304",
"0.50260895",
"0.50038207",
"0.4962981",
"0.49424374",
"0.49389356",
"0.4933337",
"0.49316671",
"0.49209848",
"0.49160174",
"0.49127972",
"0.49038583",
"0.4886619",
"0.48704875",
"0.48693514",
"0.48639295",
"0.48630494",
"0.48474655",
"0.48401093",
"0.48334026",
"0.48266804",
"0.48202202",
"0.4820089",
"0.48163685",
"0.48045355",
"0.47993273",
"0.47974396",
"0.4790173",
"0.47888175",
"0.47852468",
"0.4779612",
"0.47795066",
"0.47789446",
"0.47764984",
"0.47749686",
"0.47738683",
"0.47733432",
"0.4767669",
"0.47669283",
"0.4764784",
"0.4753728",
"0.4752391",
"0.4748804",
"0.474403",
"0.4743532",
"0.47386384",
"0.47325113",
"0.47209778",
"0.47202012",
"0.47165576",
"0.47071967",
"0.470657",
"0.4701443",
"0.47004637",
"0.46945143",
"0.46907476",
"0.46863404"
] | 0.8051038 | 0 |
Checks that method _load_ throws _DataDirectoryNotFoundException_, if data directory is actually a file. | public function testLoadThrowsDataDirectoryNotFoundForFileInsteadOfDirectory(): void
{
$filename = 'accessible.json';
$this->addFileToVFS($filename);
$path = $this->getFullPath($filename);
$this->expectException(DataDirectoryNotFoundException::class);
$this->expectExceptionExactMessage("Root folder $path was not found.");
$directoryDataLoader = $this->prepareDirectoryDataLoader();
$directoryDataLoader->load($path, '/^.*\..*$/');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testLoadThrowsDataDirectoryNotFoundForNonReadableDirectory(): void\n {\n $dirname = 'forbidden';\n $this->addDirectoryToVFS($dirname, 0);\n $path = $this->getFullPath($dirname);\n $this->expectException(DataDirectoryNotFoundException::class);\n $this->expectExceptionExactMessage(\"Root folder $path was not found.\");\n\n $directoryDataLoader = $this->prepareDirectoryDataLoader();\n\n $directoryDataLoader->load($path, '/^.*\\..*$/');\n }",
"public function testLoadThrowsDataDirectoryNotFoundForNonExistingDir(): void\n {\n $dirname = 'nonexistent';\n $path = $this->getFullPath($dirname);\n $this->expectException(DataDirectoryNotFoundException::class);\n $this->expectExceptionExactMessage(\"Root folder $path was not found.\");\n\n $directoryDataLoader = $this->prepareDirectoryDataLoader();\n\n $directoryDataLoader->load($path, '/^.*\\..*$/');\n }",
"public function testLoadReturnsCorrectDataWithExceptionsThrownByDataLoaders(): void\n {\n $this->prepareVFSDirectoryStructure();\n $fullPath = $this->getFullPath('container');\n $expectedFilesMap = ['FileSecond' => 'first/file_second.exe', 'SomeExt' => 'some_ext.exe'];\n $expectedLoadData = ['FileSecond' => ['param1' => 'with_value'], 'SomeExt' => ['param2' => 'without_value']];\n $expectedExceptions =\n array_fill_keys([\"$fullPath/first/file_first.exe\", \"$fullPath/second/file_third.exe\"], new Exception());\n $dataLoaderMockCallbackParams = [$fullPath, $expectedFilesMap, $expectedLoadData, $expectedExceptions];\n $dataLoaderMockCallback = $this->prepareDataLoaderMockCallbackWithExceptions(...$dataLoaderMockCallbackParams);\n $directoryDataLoader = $this->prepareDirectoryDataLoader($dataLoaderMockCallback);\n\n $actualLoadData = $directoryDataLoader->load($fullPath, '/^.*\\.exe$/');\n\n static::assertArraysAreSame($expectedLoadData, $actualLoadData);\n }",
"public function validateTestData()\n\t{\n\t\t$testDataFileName = $this->config->getTestData();\n\t\tif (!(realpath($testDataFileName) || realpath(Config::$testDataFile))){\n\t\t\t$this->errors['testData'][] = [\n\t\t\t\t'property' => 'testData',\n\t\t\t\t'message' => 'Test data file was not found.'\n\t\t\t];\n\t\t}\n\t}",
"public function testCreateDataCollectionThrowsExceptionOnInvalidDirectory(): void\n {\n $collection = $this->getMockBuilder(DataCollection::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $property = new ReflectionProperty($this->object, 'collection');\n $property->setValue($this->object, $collection);\n\n $this->expectException(RuntimeException::class);\n $this->expectExceptionMessage('Directory \"./platforms\" does not exist.');\n\n $this->object->createDataCollection('.');\n }",
"public function testInvalidFileException() {\n\t\t$this->expectException('/Could not read file/');\n\t\tFixture::load('Foobar');\n\t}",
"private function checkDir()\n {\n if (!is_dir($this->basePath)) {\n throw new InvalidArgumentException('base path: ' . $this->basePath .\n ' is not a directory or does not exist' .\n ' current working dir is ' . getcwd());\n }\n // check writable\n if (!is_writable($this->basePath)) {\n throw new InvalidArgumentException('base path: ' . $this->basePath .\n ' is not writable' .\n ' current working dir is ' . getcwd());\n }\n }",
"public function testInvalidArgumentExceptionIsThrownIfDirectoryIsNotReadableWhenCreatingProcedureLoader()\n {\n $this->setExpectedException('\\InvalidArgumentException');\n\n $procedureFactory = $this->getProcedureFactory();\n\n $procedureLoaderFactory = $this->getProcedureLoaderFactory($procedureFactory);\n $procedureLoaderFactory->createProcedureLoader('invalid/directory');\n }",
"public function testCreateDataCollectionFailsBecauseOfMissingFiles(): void\n {\n $path = __DIR__ . '/../../../fixtures/missing-file';\n\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage(sprintf('File \"%s/core/default-browser.json\" does not exist.', $path));\n\n $this->object->createDataCollection($path);\n }",
"public function testLoadFile_invalidFileName() : void\n {\n $spreadsheet = SpreadsheetUtil::loadFile('junk.xls');\n $this->assertNull($spreadsheet);\n }",
"protected function validateStoragePath()\r\n {\r\n if (is_null($this->storagePath)) {\r\n throw new Exception('A storage path has not been set');\r\n }\r\n\r\n if ( ! is_dir($this->storagePath) || ! is_writable($this->storagePath)) {\r\n throw new Exception('The specified storage path is not writable');\r\n }\r\n }",
"public function testLoadingInvalidLanguageFileThrowsException()\n {\n $this->expectException(\\Sparta\\Exceptions\\LanguageFileNotFound::class);\n $this->translator->setLocale('FakeFileLanguageCode');\n $this->translator->load();\n }",
"private function dirIsValid() {\n return is_dir($this->directory);\n }",
"public function validate() {\n\t\t\n\t\tif(!is_dir($this->path)) {\n\t\t\tthrow new Exception('The path provided does not exist', '400');\n\t\t}\n\t\t\n\t\tif(!is_writeable($this->path)) {\n\t\t\tthrow new Exception('The path provided is not writeable', '400');\n\t\t}\n\t\t\n\t\tif(file_exists($this->path . $this->filename)) {\n\t\t\t\n\t\t\tif($this->allow_overwrite === false && $this->rename_if_exists === false) {\n\t\t\t\tthrow new Exception('The file ' . $this->filename . ' already exists', '400');\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tif($this->checkExtension() === false) {\n\t\t\tthrow new Exception('The file has an invalid extension', '400');\n\t\t}\n\t\t\n\t\treturn true;\n\t\t\n\t}",
"public function testCreateDataCollectionFailsBecauseOfEmptyDirectory(): void\n {\n $path = __DIR__ . '/../../../fixtures/empty-directory';\n\n $this->expectException(RuntimeException::class);\n $this->expectExceptionMessage(sprintf('Directory \"%s/browsers\" was empty.', $path));\n\n $this->object->createDataCollection($path);\n }",
"public function it_should_throw_is_specified_dump_file_is_not_readable()\n {\n $root = vfsStream::setup('root');\n $dumpFle = vfsStream::newFile('foo.sql', 0000);\n $root->addChild($dumpFle);\n $path = $root->url() . '/foo.sql';\n\n $driver = $this->stubProphecy(ExtendedMySql::class);\n $driver->load($path)->shouldNotBeCalled();\n\n $this->expectException(\\InvalidArgumentException::class);\n\n $sut = $this->make_instance();\n $sut->_setDriver($driver->reveal());\n\n $sut->importSqlDumpFile($path);\n }",
"private function validatePath()\n {\n $locator = new FileLocator();\n $locator->locate($this->path); // throws exception on failure\n }",
"public function testFileNotFoundException ()\n {\n $this->tran->loadFile(2);\n $this->tran->loadFile();\n $this->tran->loadFile(true);\n $this->tran->loadFile('asd');\n }",
"public function loadDir($directory);",
"public function test_UserFileWithDrDir()\n {\n $this->setExpectedException('Q\\Exception', \"File '{$this->file}' is not a directory, but a file\");\n $config = Config::with(\"dir:mock:{$this->file}\");\n }",
"public function test_metadata_not_found_in_the_current_directory() {\n\t\t$result = register_block_type_from_metadata( __DIR__ );\n\n\t\t$this->assertFalse( $result );\n\t}",
"public function testCreateInvalidFile()\n {\n new MaterializedResource(new GenericResource('file_not_found.txt'), '/probably/not/a/directory');\n }",
"public function testBadLoaderDefined() {\n $this->expectException('\\\\Phloem\\\\Exception\\\\LoaderException');\n\n $this->factory->setLoader('bad', true);\n $this->factory->getLoader('filename.bad');\n }",
"public function testIfExceptionIsThrownWhenConfigurationIsNotValid()\n {\n $path = $this->getTestDataDir() . '/config.invalid.yml';\n\n $this->assertTrue(is_readable($path), 'Invalid configuration file is missing.');\n\n $reader = new Reader(new Configuration());\n $reader->read($path);\n }",
"public function testPathToDatasetFileInvalid()\n {\n $rem = new RemServer();\n $session = new Session([\"name\" => \"test\"]);\n $dataset = [ANAX_INSTALL_PATH . \"/config/remserver/dataset/users-NO.json\"];\n\n $rem->setDefaultDataset($dataset)\n ->injectSession($session)\n ->init();\n }",
"public function should_throw_if_trying_to_build_on_non_existing_directory(): void\n {\n $this->expectException(\\InvalidArgumentException::class);\n new DirectorySnapshot(__DIR__ . '/not-existing');\n }",
"public function canNotOpenDirectory()\n {\n $this->assertFalse(@dir(vfsStream::url('foo')));\n }",
"public function testReadWithNonExistentFile() {\n $reader = new ConfigReader($this->path);\n $reader->read('fake_values');\n }",
"function openDirectory(){\n if (!file_exists(\"./data\")){ # If file doesn't exist return false\n $handleDir = false;\n return $handleDir;\n }\n else{\n $handleDir = opendir(\"./data\");\n /* I'm checking if the handleDir == returns false for some other reason in connection.php. This is part of validation.php,\n which allows me to present an error message above the form (nb if opendir can't connect it returns a boolean value of false) */\n return $handleDir;\n }\n}",
"public function test_load_returns_empty_array_if_conf_dir_dnx()\n {\n $config = new Bootphp_Config_File_Reader('gafloogle');\n\n $this->assertSame([], $config->load('values'));\n }",
"public function testOnNewDirectoryWithIllegalArgumentException() {\n\n $obj = new FileSystemStorageProvider($this->logger, $this->directory);\n\n try {\n\n $obj->onNewDirectory($this->doc1);\n } catch (Exception $ex) {\n\n $this->assertInstanceOf(IllegalArgumentException::class, $ex);\n $this->assertEquals(\"The document must be a directory\", $ex->getMessage());\n }\n }",
"public function it_should_throw_if_specified_dump_file_does_not_exist()\n {\n $path = __DIR__ . '/foo.sql';\n\n $driver = $this->stubProphecy(ExtendedMySql::class);\n $driver->load($path)->shouldNotBeCalled();\n\n $this->expectException(\\InvalidArgumentException::class);\n\n $sut = $this->make_instance();\n $sut->_setDriver($driver->reveal());\n\n $sut->importSqlDumpFile($path);\n }",
"public function testCsvReaderThrowsFileNotFoundExceptionIfFileNotFound() {\n \n $this->expectException(new Csv_Exception_FileNotFound('File does not exist or is not readable: \"./data/nonexistant.csv\".'));\n $reader = new Csv_Reader('./data/nonexistant.csv');\n \n }",
"public function testImagesDirBase(): void\n {\n $this->expectException(\\Magento\\Framework\\Exception\\LocalizedException::class);\n $this->expectExceptionMessage('Images file directory is outside required directory');\n\n $this->_model->setData(\n Import::FIELD_NAME_VALIDATION_STRATEGY,\n ProcessingErrorAggregatorInterface::VALIDATION_STRATEGY_SKIP_ERRORS\n );\n $this->_model->setEntity('catalog_product');\n $this->_model->setData(Import::FIELD_NAME_IMG_FILE_DIR, '../_files');\n $this->_model->importSource();\n }",
"public function testIsVendorFileThrowsExceptionIfNoValidFileReferenceIsProvided()\n {\n $this->expectException('InvalidArgumentException');\n VendorResources::isVendorFile(__DIR__ . '/this/files/does/not/exist');\n }",
"protected function checkFilesDir() {\n\t\t$perms = @fileperms(self::FILES_DIR);\n\t\t/* create if not exist */\n\t\tif ($perms === false) {\n\t\t\tif (!mkdir(self::FILES_DIR, 0700, true)) {\n\t\t\t\tthrow new QuicksandException(\"Cannot create files dir.\");\n\t\t\t}\n\t\t}\n\t\t/* check if dir */\n\t\telse if (($perms & 0x4000) != 0x4000) {\n\t\t\tthrow new QuicksandException(\"Files dir is not actually a directory.\");\n\t\t}\n\t\t/* check permissions */\n\t\telse if (($perms & 0700) != 0700) {\n\t\t\tthrow new QuicksandException(\"Missing permissions. Make sure this script can read, write and enter the files dir.\");\n\t\t}\n\t}",
"public function test_LoadAllException_NoPath()\n {\n $this->setExpectedException('Q\\Exception', \"Unable to create Config object: Path not specified.\");\n $config = new Config_Dir(array('ext'=>'mock'), array('loadall'=> 'true'));\n }",
"abstract public function loadData();",
"private function validatePath($path)\n {\n if (!$this->isDirectory($path)) {\n throw new Exception('The view path must be a directory!');\n }\n if (!is_readable($path)) {\n throw new Exception('The view path must be a readable directory!');\n }\n }",
"public function testInvalidFileImport(): void\n {\n $this->expectException(ValidationException::class);\n $file_path = base_path('tests/data/aircraft.csv');\n $this->importSvc->importAirports($file_path);\n }",
"protected static function checkForDirectoryToBeExisting($directory) {\n\t\tif (!file_exists($directory)) {\n\t\t\tthrow new Exception($directory . ' is not existing! 1287234117');\n\t\t}\n\t}",
"public function testMalformedFilePath() {\n $configuration = [\n 'path' => 'non-existent-path',\n 'ids' => ['id'],\n ];\n\n $csv = new CSV($configuration, $this->pluginId, $this->pluginDefinition, $this->migration);\n $this->expectException(Warning::class);\n $this->expectExceptionMessage('fopen(non-existent-path): failed to open stream: No such file or directory');\n $csv->initializeIterator();\n }",
"protected function isDirectory() {}",
"private function validateCachePath($path)\n {\n if (!$this->isDirectory($path)) {\n throw new Exception('The cache path must be a directory!');\n }\n if (!is_readable($path)) {\n throw new Exception('The cache path must be a readable directory!');\n }\n if (!is_writable($path)) {\n throw new Exception('The cache path must be a writable directory!');\n }\n }",
"protected static function _validate()\n\t{\n\t\tif (!file_exists(self::$jar)) {\n\t\t\tthrow new Exception('MergeMinify_Minification:$jar(' . self::$jar . ') is not a valid file.');\n\t\t}\n\t\tif (!is_dir(self::$tmpDir) || !is_writable(self::$tmpDir)) {\n\t\t\tthrow new Exception('MergeMinify_Minification:$temp(' . self::$temp . ') is not a valid directory.');\n\t\t}\n\t}",
"public function testReadDocumentWithIllegalArgumentException() {\n\n $obj = new FileSystemStorageProvider($this->logger, $this->directory);\n\n try {\n\n $obj->readDocument($this->dir1);\n } catch (Exception $ex) {\n\n $this->assertInstanceOf(IllegalArgumentException::class, $ex);\n $this->assertEquals(\"The document must be a document\", $ex->getMessage());\n }\n }",
"public function testNoLoaderDefined() {\n $this->expectException('\\\\Phloem\\\\Exception\\\\LoaderException');\n\n $this->factory->getLoader('filename.unknown');\n }",
"public function testCreateDataCollectionFailsBecauseOfInvalidJson(): void\n {\n $path = __DIR__ . '/../../../fixtures/invalid-json';\n\n $this->expectException(RuntimeException::class);\n $this->expectExceptionMessage(sprintf('File \"%s/core/default-browser.json\" had invalid JSON.', $path));\n\n $this->object->createDataCollection($path);\n }",
"public function setDataFileFromPath($path)\n {\n if (!file_exists($path)) {\n throw new \\Exception(\"The provided data file was not found\");\n }\n\n $this->dataFilePath = $path;\n }",
"function load( $filename = NULL )\n\t{\n\t\tif ( is_file( $filename ) ) {\n\n\t\t} else {\n\t\t\tthrow new FileNotFound( 'config file not exist!' );\n\t\t}\n\t}",
"public function initializeObject()\n {\n if (!is_writable($this->path)) {\n Files::createDirectoryRecursively($this->path);\n }\n if (!is_dir($this->path) && !is_link($this->path)) {\n throw new StorageException('The directory \"' . $this->path . '\" which was configured as a resource storage does not exist.', 1361533189);\n }\n if (!is_writable($this->path)) {\n throw new StorageException('The directory \"' . $this->path . '\" which was configured as a resource storage is not writable.', 1361533190);\n }\n }",
"private function loadFile()\n\t{\n\t\tif( empty($this->content) ) {\n\t\t\tif( empty($this->file) ) {\n\t\t\t\tthrow new Exception('Which file should I parse, you ...!');\n\t\t\t} else {\n\t\t\t\tif( strtolower( $this->file->getExtension() ) == 'zip' ) {\n\t\t\t\t\t$this->content = $this->handleZipFile( $this->file );\n\t\t\t\t} else {\n\t\t\t\t\t$this->content = $this->file->getContents();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"private static function loadConfigurationFile()\n {\n if(self::$ConfigurationData == null)\n {\n $file_contents = file_get_contents(CONFIGURATION_FILE);\n $json_data = json_decode($file_contents, true);\n\n if(empty($json_data))\n {\n throw new Exception(\"Invalid JSON data in the configuration file\");\n }\n\n self::$ConfigurationData = $json_data;\n }\n }",
"private function checkDir() {\n if (! is_dir ( $this->option ['templateDir'] ))\n $this->core->err ( '101', $this->option ['templateDir'] );\n \n if (! is_dir ( $this->option ['compileDir'] ))\n $this->core->err ( '101', $this->option ['compileDir'] );\n \n if (! is_dir ( $this->option ['cacheDir'] ))\n $this->core->err ( '101', $this->option ['cacheDir'] );\n }",
"public function load() \n\t{\n\t\tif (is_null ( $this->getDataFile () )) \n\t\t{\n\t\t\tthrow new Exception ( 'Data File is not set' );\n\t\t}\n\t\t\n\t\tif (!file_exists($this->getDataFile()))\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn json_decode(file_get_contents($this->getDataFile()));\n\t\t}\n\t}",
"protected function loadStats()\n {\n if ($this->stat === false) {\n $this->stat = @stat($this->getPath());\n if ($this->stat===false) {\n throw new T_Exception_File($this->getPath(),'stat error');\n }\n }\n }",
"public function testOnDeletedDirectoryWithIllegalArgumentException() {\n\n $obj = new FileSystemStorageProvider($this->logger, $this->directory);\n\n try {\n\n $obj->onDeletedDirectory($this->doc1);\n } catch (Exception $ex) {\n\n $this->assertInstanceOf(IllegalArgumentException::class, $ex);\n $this->assertEquals(\"The document must be a directory\", $ex->getMessage());\n }\n }",
"public function check_data()\n {\n parent::check_data();\n\n if(empty($this->build_notifications))\n {\n throw new exception('<strong>Data missing: Notifications</strong>');\n }\n\n if(empty($this->build_batch_reference))\n {\n throw new exception('<strong>Data missing: Batch References</strong>');\n }\n }",
"public static function fileDoesNotExist()\n {\n return self::logicalNot(self::fileExists());\n }",
"public function testCsvReaderThrowsCannotDetermineDialectIfDataCorrupt() {\n \n //$this->expectException(new Csv_Exception_CannotDetermineDialect('File does not exist or is not readable: \"./data/nonexistant.csv\".'));\n $reader = new Csv_Reader('./data/corrupt.csv');\n \n }",
"public function testGetFilesDataReturnsNull()\n {\n $this->assertNull($this->class->get_files_data('invalid'));\n }",
"public function checkFolderPermissionsFilesystemPermissionsDataProvider() {}",
"protected function detectMissingFiles() {}",
"function testPathNotFoundMovie() {\n try {\n $v = $this->loadMovie(\"path_that_doesnt_exist/movie.mp4\");\n //this assert should never be called\n $this->assertTrue(false);\n } catch (Exception $e) {\n $this->assertTrue(true);\n }\n }",
"public function testLoadMissingFixtures(): void\n {\n $this->expectException(UnexpectedValueException::class);\n $this->expectExceptionMessage('Could not find fixture `core.ThisIsMissing`');\n (new FixtureHelper())->loadFixtures(['core.ThisIsMissing']);\n }",
"protected function _load()\n\t{\n\t\t$_file = $this->_storagePath . DIRECTORY_SEPARATOR . $this->_fileName;\n\n\t\tif ( is_file( $_file ) && file_exists( $_file ) && is_readable( $_file ) )\n\t\t{\n\t\t\tif ( false !== ( $_data = Utility\\Storage::defrost( file_get_contents( $_file ) ) ) )\n\t\t\t{\n\t\t\t\t//\tIf it wasn't frozen, a JSON string may be returned\n\t\t\t\tif ( is_string( $_data ) && false !== json_decode( $_data ) )\n\t\t\t\t{\n\t\t\t\t\t$_data = json_decode( $_data, true );\n\t\t\t\t}\n\n\t\t\t\t$this->merge( $_data );\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public function testReadNonExistingFile()\n {\n $filename = static::$baseFile . '/fs/tmp.txt';\n try {\n file_get_contents($filename);\n\n $this->fail('Expected read of non-existing file to fail');\n } catch (\\PHPUnit_Framework_Error_Warning $e) {\n $this->assertContains('failed to open stream', $e->getMessage());\n }\n }",
"public function testCanLoadLanguageFilesFromSpecifiedPath()\n {\n $this->translator->load();\n $messages = $this->translator->all();\n $this->assertArrayHasKey('test_message', $messages);\n }",
"public function checkFilePath($file)\n {\n if(!file_exists($file))\n {\n throw new Exception(\"Invalid file\");\n }\n }",
"public function testConfigFromFileAndDirectory()\n {\n $cfg = new Configuration();\n $cfg->setBaseDirectories($this->dirs);\n $config = $cfg->load(\"route\");\n\n $this->assertInternalType(\"array\", $config);\n $this->assertArrayHasKey(\"file\", $config);\n $this->assertArrayHasKey(\"config\", $config);\n $this->assertContains(\"a route\", $config[\"config\"]);\n $this->assertArrayHasKey(\"items\", $config);\n $this->assertContains(\"a 404 route\", $config[\"items\"][0][\"config\"]);\n $this->assertContains(\"an internal route\", $config[\"items\"][1][\"config\"]);\n }",
"public function testReadFromFileSetDefaultAuthCacheDirWhenMissingPath()\n {\n $testModel = AuthCacheUtil::readFromFile();\n\n $this->assertEquals(AuthCacheUtil::getDefaultAuthCacheDirectory(), $testModel->getAuthCacheDir(),\n \"Auth cache directory should be set to the default path when no cache dir provided.\");\n }",
"public static function check($path, $ds = DIRECTORY_SEPARATOR)\n\t{\n\t\tif (strpos($path, '..') !== false)\n\t\t{\n\t\t\t// Don't translate\n\t\t\tthrow new \\Exception(__CLASS__ . '::check Use of relative paths not permitted', 20);\n\t\t}\n\n\t\t$rootPath = Application::getInstance()->getContainer()->filesystemBase;\n\n\t\t$path = self::clean($path);\n\t\tif (($rootPath != '') && strpos($path, self::clean($rootPath)) !== 0)\n\t\t{\n\t\t\t// Don't translate\n\t\t\tthrow new \\Exception(__CLASS__ . '::check Snooping out of bounds @ ' . $path, 20);\n\t\t}\n\n\t\treturn $path;\n\t}",
"public function testAddDataWithInvalidTemplateFileType()\n {\n $this->expectException(\\LogicException::class);\n $this->template_data->add(array('name' => 'Jonathan'), 123);\n }",
"protected static function _load($directory, $filename, $tracker, $init, $namespace, $class_name)\n {\n $base_array = array(\n array('framework', ''),\n array(DCMS_CALL, '\\\\'.DCMS_CALL)\n );\n \n foreach($base_array as $base):\n \n $basepath = $base[0].'/'.$directory;\n $loaded = \\dcms\\Core::load_file($filename, $basepath, true, false);\n \n if($loaded === true):\n \n $filepath = $basepath.'/'.$filename.'.php';\n \\dcms\\Log::write(\"Loaded file from $filepath\", null, 1);\n \n $full_class_name = \"\\dcms\\\\$namespace{$base[1]}\\\\$class_name\";\n self::_initialize_class($full_class_name, $init);\n \\dcms\\Core::track_file($filepath, $tracker);\n \n return true;\n \n endif;\n \n endforeach;\n \n \\dcms\\Log::write(\"Could not load file $filename.php from /$directory/ as $tracker!\", null, 3);\n \\dcms\\Core::kill(\"Could not load file!\");\n }",
"public function testGetDataDirectory()\n {\n $hostMock = $this->getMockBuilder(Host::class)\n ->disableOriginalConstructor()\n ->getMock();\n $hostMock->expects($this->once())->method('getPath')->willReturn('{host-base-path}');\n\n $workspace = new Workspace($hostMock);\n $workspace->setDataDirectory('data/');\n\n $this->assertSame('{host-base-path}/data/', $workspace->getDataDirectory());\n }",
"public function isValid () {\n\treturn (is_dir($this->getPath())) ? true : false;\n }",
"public function testGetDirectory(): void\n {\n $model = Hash::load([\n \"directory\" => \"directory\",\n ], $this->container);\n\n $this->assertSame(\"directory\", $model->getDirectory());\n }",
"public function load($data_folder)\n {\n $this->_provider->load($data_folder);\n }",
"public function testReadFromFileReturnsLoadsDataWhenConfigFileExistsInPath()\n {\n $tempDirPath = sys_get_temp_dir() . \"/\" . uniqid();\n $tempCacheFilePath = $tempDirPath . \"/current\";\n\n try {\n $setModel = new AuthCacheUtil($this->_getDefaultModelTestData());\n $setModel->setAuthCacheDir($tempDirPath);\n\n $setModel->write();\n\n $this->assertFileExists($tempCacheFilePath,\n \"Cache file should existing in the newly created cache file path after writing.\");\n\n $model = AuthCacheUtil::readFromFile($tempDirPath);\n\n $this->assertJsonStringEqualsJsonString($setModel->__toString(), $model->__toString(),\n \"Auth cache util should deserialize data to the same value as the original cache file.\");\n\n\n $this->assertJsonStringEqualsJsonFile($tempCacheFilePath, $model->__toString(),\n \"Cache file should serialize data to the same value as was written to disk.\");\n }\n finally {\n // delete the written cache file\n if (file_exists($tempCacheFilePath)) {\n unlink($tempCacheFilePath);\n }\n\n rmdir($tempDirPath);\n }\n }",
"public function validPathStrDataProvider() {}",
"private function check_directory()\n\t{\n\t\tif (!is_dir(Kohana::config($this->type.'.cache_folder')))\n\t\t\tmkdir(Kohana::config($this->type.'.cache_folder'));\n\t}",
"public function testReadWithExistentFileWithoutExtension() {\n $reader = new ConfigReader($this->path);\n $reader->read('no_php_extension');\n }",
"public function testFileExceptions() {\n $xsl_service = new ExcelFileProcessorService();\n\n try {\n $xsl_service->processFile('foo');\n $this->fail();\n } catch (\\Exception $e) {\n $this->assertEquals($e->getMessage(), 'The file does not exists');\n }\n }",
"public function path_valid() {\n\t\tif (!file_exists($this->path)) return false;\n\t\treturn true;\n\t}",
"public function path_valid() {\n\t\tif (!file_exists($this->path)) return false;\n\t\treturn true;\n\t}",
"public function testGetLinesFromFileThrowsExceptionIfFileDoesNotExist(): void\n {\n $file = '/hopefully/this/file/does/not/exist';\n $parser = new IniParser($file);\n\n $this->expectException(InvalidArgumentException::class);\n $this->expectExceptionMessage('File not found: ' . $file);\n\n $parser->getLinesFromFile();\n }",
"public function testReadFromFileThrowsExceptionWhenConfigPathIsFileNotNamedCurrent()\n {\n $tempDirPath = sys_get_temp_dir() . \"/\" . uniqid();\n $tempCacheFilePath = $tempDirPath . \"/current\";\n $renamedCacheFilePath = $tempDirPath . \"/myCacheFileName\";\n try {\n $setModel = new AuthCacheUtil($this->_getDefaultModelTestData());\n $setModel->setAuthCacheDir($tempDirPath);\n\n $setModel->write();\n\n $this->assertFileExists($tempCacheFilePath,\n \"Cache file should existing in the newly created cache file path after writing.\");\n\n rename($tempCacheFilePath, $renamedCacheFilePath);\n\n AuthCacheUtil::readFromFile($renamedCacheFilePath);\n\n $this->fail(\"Exception should be thrown when a path is given to a file not named 'current'\");\n }\n finally {\n // delete the written cache file\n if (file_exists($tempCacheFilePath)) {\n unlink($tempCacheFilePath);\n }\n\n // delete the written cache file\n if (file_exists($renamedCacheFilePath)) {\n unlink($renamedCacheFilePath);\n }\n\n rmdir($tempDirPath);\n }\n }",
"public function isLoadedFromFile() : bool\n {\n return $this->fileExists;\n }",
"private function isFileValid(): bool\n {\n return FileHelper::isExpectedExtensions($this->getPath(), $this->getFileExtensions());\n }",
"public function test_OffsetSetException_NoExtForDir()\n {\n $this->setExpectedException('Q\\Exception', \"Unable to create section 'test': No extension specified for Config_Dir '{$this->dir}', creating a section requires setting a Config_File object.\");\n $config = new Config_Dir($this->dir); \n $config['test'] = array();\n }",
"protected function validateConfigFile(): void\n {\n switch ($this->filePath) {\n case !is_file($this->filePath):\n throw new DbConnectorException(\n 'Specified configuration file does not exist.',\n 1001\n );\n case !is_readable($this->filePath):\n throw new DbConnectorException(\n 'Config file is not readable by DbConnector.',\n 1002\n );\n }\n\n $jsonConfig = json_decode(file_get_contents($this->filePath) ?: '', false);\n $this->filePath = null;\n\n if (empty($jsonConfig->dbConnector) || !\\is_object($jsonConfig->dbConnector)) {\n throw new DbConnectorException(\n 'The config file is malformed. Please refer to documentation for schema information.',\n 1003\n );\n }\n\n $this->jsonObject = $jsonConfig->dbConnector;\n }",
"public function testDir_LazyLoad()\n {\n $config = new Config_Dir($this->dir, array('transformer'=>'from-mock', 'ext'=>'mock'));\n\n $this->assertType('Q\\Config_Dir', $config);\n $this->assertEquals(array(), (array)$config);\n \n $cfg_file1 = $config['file1'];\n $this->assertType('Q\\Config_File', $cfg_file1);\n $this->assertEquals(array(\"db\"=>array(\"host\"=>\"localhost\", \"dbname\"=>\"test\",\"user\"=>\"myuser\",\"pwd\"=>\"mypwd\"),\"output\"=>\"xml\",\"input\"=>\"json\"), (array)$cfg_file1);\n $this->assertArrayHasKey('file1', (array)$config);\n $this->assertArrayNotHasKey('dir1', (array)$config);\n\n $cfg_dir1 = $config['dir1'];\n $this->assertType('Q\\Config_Dir', $cfg_dir1);\n $this->assertEquals(array(), (array)$cfg_dir1);\n $this->assertArrayHasKey('file1', (array)$config);\n $this->assertArrayHasKey('dir1', (array)$config); \n }",
"private function checkDirectory($directory, Output $output = null)\n {\n if (!is_dir($directory)) {\n if ($output != null) {\n $output->writeNewLine();\n $output->writeLine(\"Invalid folder ($directory) is given.\");\n $output->writeNewLine();\n }\n\n throw new \\Exception(\"Invalid folder ($directory) is given.\");\n }\n }",
"public function extensionValid() \n\t{\n\t\tif (!in_array($this->extension_of_file, $this->file_types)) //{\n\t\t\tthrow new Exception(\"Invalid file Extension\",5);\n\t\t//}\n\t}",
"abstract protected function load();",
"abstract protected function load();",
"abstract protected function load();",
"abstract protected function load();",
"private function _directoryIsValid($dirName) {\n switch ($dirName) {\n case '.':\n case '..':\n case '.DS_Store':\n case '':\n return false;\n break;\n default:\n return true;\n break;\n }\n }",
"private function Load($fullpath, $data=null){\r\n global $BASECONFIG;\r\n extract($BASECONFIG[\"ALIASES\"]);\r\n if(!is_null($data)){\r\n extract($data);\r\n }\r\n if(file_exists($fullpath)){\r\n require_once ($fullpath);\r\n return true;\r\n }\r\n else{\r\n return false;\r\n }\r\n }"
] | [
"0.8073221",
"0.77692044",
"0.6773753",
"0.6123974",
"0.6119891",
"0.60418874",
"0.5997595",
"0.5851567",
"0.57685053",
"0.57673746",
"0.5674731",
"0.5671657",
"0.5664472",
"0.5659976",
"0.56397593",
"0.56390274",
"0.56239116",
"0.5581382",
"0.55016166",
"0.5485913",
"0.54821706",
"0.5473634",
"0.54657686",
"0.5450927",
"0.54050666",
"0.5376025",
"0.5368819",
"0.5350911",
"0.5278849",
"0.52615863",
"0.52525806",
"0.5245573",
"0.52161944",
"0.5212473",
"0.52082217",
"0.51995885",
"0.51958185",
"0.51944447",
"0.5168679",
"0.51659596",
"0.51618266",
"0.51590157",
"0.5124288",
"0.512022",
"0.5107039",
"0.5100725",
"0.5088139",
"0.50806546",
"0.50745195",
"0.5073623",
"0.5061579",
"0.50567704",
"0.5056155",
"0.5055918",
"0.5047126",
"0.50448066",
"0.50354135",
"0.50298375",
"0.5029105",
"0.50250614",
"0.49923372",
"0.4991892",
"0.49874014",
"0.4984879",
"0.49709275",
"0.49642062",
"0.4928753",
"0.49180734",
"0.49037474",
"0.48992145",
"0.48946",
"0.48873076",
"0.48869586",
"0.48818874",
"0.48788193",
"0.4873385",
"0.48613986",
"0.4858191",
"0.48580337",
"0.4857833",
"0.48547745",
"0.48488387",
"0.48482254",
"0.48376706",
"0.48376706",
"0.4836377",
"0.48355132",
"0.48303384",
"0.4827517",
"0.48262006",
"0.48081565",
"0.48045045",
"0.48010325",
"0.48003736",
"0.4793603",
"0.4793603",
"0.4793603",
"0.4793603",
"0.47924936",
"0.4791186"
] | 0.81286526 | 0 |
Checks that method _load_ calls data loader's method _load_ for each file in the given folder. | public function testLoadCallsDataLoaderLoadForEachFile(string $path, string $filenameRegExp, array $expectedFilesMap): void
{
$this->prepareVFSDirectoryStructure();
$fullPath = $this->getFullPath($path);
$expectedFilenames = array_values($expectedFilesMap);
$dataLoaderMockCallback = static function (MockInterface $dataLoaderMock) use ($expectedFilenames, $fullPath) {
foreach ($expectedFilenames as $expectedFile) {
$dataLoaderMock->shouldReceive('load')->withArgs(["$fullPath/$expectedFile"])->once();
}
};
$directoryDataLoader = $this->prepareDirectoryDataLoader($dataLoaderMockCallback);
$directoryDataLoader->load($fullPath, $filenameRegExp);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function loadAll()\n {\n $this->setAll(array());\n $d = dir($this->getPath());\n $this->load($d);\n $d->close();\n }",
"protected function loadFiles() {\n if ($this->loaded === true) {\n return;\n }\n $iter = new RecursiveDirectoryIterator($this->directory);\n $this->iterateFiles($iter);\n $this->loaded = true;\n }",
"abstract public function loadAll();",
"function loadFiles($folder){\n $files = scandir($folder);\n foreach ($files as $filename)\n {\n if($filename != \".\" && $filename != \"..\") {\n if (is_dir($filename)) {\n //handle nesting\n loadFiles($filename);\n } else {\n if (strpos($filename, '.php') !== false) {\n require $folder.\"/\".$filename;\n }\n }\n }\n\n }\n}",
"function LoadUploadedFiles()\n {\n\t\t$upld_folder = $this->EnsureTmpUploadFolder();\n\t\t\n foreach($this->upload_fields as $filefield)\n {\n $tmp_filepath = $this->globaldata->files[$filefield]['tmp_name'];\n if(is_uploaded_file($tmp_filepath))\n {\n $filename = $this->globaldata->files[$filefield]['name'];\n\t\t\t\t$filename = $this->trim_file_name($filename,$this->globaldata->files[$filefield][\"type\"]);\n \n if(!$this->config->allow_nonsecure_file_attachments && \n $this->IsNonSecureFile($filename))\n {\n $this->error_handler->NotifyError(\n \"File Upload handler: skipping nonsecure file attachment: $filename\");\n continue;\n }\n\n $upld_path = $upld_folder.\"/\".$filename;\n \n $upld_path = \n $this->CopyFile_Prevent_Overwrite($tmp_filepath, $upld_path);\n\n $this->logger->LogInfo(\"File Upload handler: loaded file from $tmp_filepath to $upld_path.\");\n\n $mimetype = $this->globaldata->files[$filefield][\"type\"];\n\n //NOTE: LoadUploadedFiles is for native file uploads where the file is submitted along with the\n //form submission. In this case, more than one files is not supported per field.\n $existing_file = $this->find_file_uploaded($filefield);\n if($existing_file >= 0)\n {\n unlink($this->loaded_files[$existing_file]['loaded_file']);\n $this->loaded_files[$existing_file] = array(\"input_name\"=>$filefield,\n \"loaded_file\"=>$upld_path,\n \"mime_type\"=>$mimetype); \n }\n else\n {\n $this->loaded_files[] = array(\"input_name\"=>$filefield,\n \"loaded_file\"=>$upld_path,\n \"mime_type\"=>$mimetype);\n }\n }//if\n }//foreach\n \n \n \n return true;\n }",
"private function loadFiles()\n {\n $finder = new Finder();\n\n foreach (Config::get('routing_dirs') as $directory) {\n $finder\n ->files()\n ->name('*.yml')\n ->in($directory)\n ;\n\n foreach ($finder as $file) {\n $resource = $file->getRealPath();\n $this->routes = array_merge($this->routes, Yaml::parse(file_get_contents($resource)));\n }\n }\n }",
"public static function loadAll();",
"public function load($data_folder)\n {\n $this->_provider->load($data_folder);\n }",
"protected function loadClassFiles() {}",
"public static function loadAll($files) {\n self::load_files_from_dir($files);\n }",
"public function load(): void\n {\n if ($this->paths->isEmpty()) {\n return;\n }\n\n foreach ((new Finder)->in($this->paths->toArray())->files() as $file) {\n $this->loadAction(\n $this->getClassnameFromPathname($file->getPathname())\n );\n }\n }",
"public function testLoadReturnsCorrectDataWithExceptionsThrownByDataLoaders(): void\n {\n $this->prepareVFSDirectoryStructure();\n $fullPath = $this->getFullPath('container');\n $expectedFilesMap = ['FileSecond' => 'first/file_second.exe', 'SomeExt' => 'some_ext.exe'];\n $expectedLoadData = ['FileSecond' => ['param1' => 'with_value'], 'SomeExt' => ['param2' => 'without_value']];\n $expectedExceptions =\n array_fill_keys([\"$fullPath/first/file_first.exe\", \"$fullPath/second/file_third.exe\"], new Exception());\n $dataLoaderMockCallbackParams = [$fullPath, $expectedFilesMap, $expectedLoadData, $expectedExceptions];\n $dataLoaderMockCallback = $this->prepareDataLoaderMockCallbackWithExceptions(...$dataLoaderMockCallbackParams);\n $directoryDataLoader = $this->prepareDirectoryDataLoader($dataLoaderMockCallback);\n\n $actualLoadData = $directoryDataLoader->load($fullPath, '/^.*\\.exe$/');\n\n static::assertArraysAreSame($expectedLoadData, $actualLoadData);\n }",
"public function provideTestLoadsOfFiles()\n {\n AutoloaderTestHelper::deleteDirectory(\"testLoadsOfFiles\");\n $alTestHelper = new AutoloaderTestHelper($this);\n\n for ($i = 0; $i < 150; $i++) {\n $alTestHelper->makeClass(\"anyClass\", \"testLoadsOfFiles/flat\");\n\n }\n\n for ($i = 0; $i < 150; $i++) {\n $alTestHelper->makeClass(\n \"anyClass\", \"testLoadsOfFiles\" . str_repeat('/sub', $i)\n );\n\n }\n\n return array(\n array(\n new AutoloaderFileIterator_PriorityList(),\n \"testLoadsOfFiles/flat\"\n ),\n array(\n new AutoloaderFileIterator_Simple(),\n \"testLoadsOfFiles/flat\"\n ),\n array(\n new AutoloaderFileIterator_SimpleCached(),\n \"testLoadsOfFiles/flat\"\n ),\n array(\n new AutoloaderFileIterator_PriorityList(),\n \"testLoadsOfFiles/sub\"\n ),\n array(\n new AutoloaderFileIterator_Simple(),\n \"testLoadsOfFiles/sub\"\n ),\n array(\n new AutoloaderFileIterator_SimpleCached(),\n \"testLoadsOfFiles/sub\"\n )\n );\n }",
"public function loadTree($folder)\n {\n $filter = \".class.php\";\n $files = file::file_tree_filtered($this->ApplicationRootFolder().\"/\".$folder,\"/\",$filter);\n\n $files = file::arrayFilterOut($files, \"~\");\n $files = file::arrayFilterOut($files, \".new\");\n $files = file::arrayFilterOut($files, \".backup\");\n\n\n // load classes found\n foreach ($files as $key => $value)\n {\n\n include_once $value;\n }\n\n }",
"public function loadFilesFromDirectory($path)\n {\n if ($handle = opendir($path)) {\n while (false !== ($file = readdir($handle))) {\n if (strpos($file, '.yml')) {\n if ($this->existInFile($path . '/' . $file, ['services', 'parameters'])) {\n $this->load($file);\n }\n }\n }\n }\n }",
"protected function _Recusive_Load_Dir($dir) {\r\n if (!is_dir($dir)) { return; }\r\n // Load each of the field shortcodes\r\n foreach (new DirectoryIterator($dir) as $FileInfo) {\r\n // If this is a directory dot\r\n if ($FileInfo->isDot()) { continue; }\r\n // If this is a directory\r\n if ($FileInfo->isDir()) { \r\n // Load the directory\r\n $this->_Recusive_Load_Dir($FileInfo->getPathname());\r\n } // Otherwise load the file\r\n else {\r\n // If this is not false\r\n if (stripos($FileInfo->getFilename(),'.tpl') !== false) { continue; } \r\n // If this is not false\r\n if (stripos($FileInfo->getFilename(),'.php') === false) { continue; } \r\n // Include the file\r\n require_once($FileInfo->getPathname());\r\n }\r\n }\r\n }",
"protected function load_files() {\n\t\trequire_once __DIR__ . '/class-papi-admin-meta-handler.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-option-handler.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-entry-post.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-entry-taxonomy.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-columns.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-page-type-switcher.php';\n\t}",
"private function loadSeedersAndCall(): void\n {\n $shipFiles = $this->getSeedersFromShip();\n $containersFiles = $this->getSeedersFromContainers();\n\n $files = array_merge($shipFiles, $containersFiles);\n\n foreach ($files as $file){\n $this->call($file);\n }\n }",
"public function load()\n {\n $files = $this->finder->files()->in($this->shimsDirectory);\n\n foreach ($files as $file) {\n $this->loadFile($file);\n }\n }",
"function loadTests($dirPath)\n{\n global $recursive;\n global $src;\n global $in;\n global $out;\n global $rc;\n\n # get content of directory\n $files = scandir($dirPath);\n\n foreach ($files as $file) {\n if ($file === \".\" || $file === \"..\") {\n continue;\n }\n if ($recursive === 1 && is_dir($dirPath.'/'.$file) ) {\n loadTests($dirPath.'/'.$file);\n }\n if (preg_match('/^[\\p{L}*[0-9]*]*\\.src$/u',$file) == 1) {\n $src[] = $dirPath.'/'.$file;\n }\n if (preg_match('/^[\\p{L}*[0-9]*]*\\.in$/u',$file) == 1) {\n $in[] = $dirPath.'/'.$file;\n }\n if (preg_match('/^[\\p{L}*[0-9]*]*\\.out$/u',$file) == 1) {\n $out[] = $dirPath.'/'.$file;\n }\n if (preg_match('/^[\\p{L}*[0-9]*]*\\.rc$/u',$file) == 1) {\n $rc[] = $dirPath.'/'.$file;\n }\n }\n}",
"public function testDir_EagerLoad()\n {\n $config = new Config_Dir($this->dir, array('transformer'=>'from-mock', 'ext'=>'mock','loadall'=>true));\n\n $this->assertType('Q\\Config_Dir', $config);\n\n $this->assertArrayHasKey('dir1', (array)$config);\n $this->assertArrayHasKey('dir2', (array)$config);\n $this->assertArrayHasKey('file1', (array)$config);\n\n $this->assertArrayHasKey('file3', (array)$config['dir1']);\n $this->assertArrayHasKey('file4', (array)$config['dir1']); \n }",
"public static function loadSectionFiles() {\n\t\tforeach (scandir( dirname(__FILE__) . Route::ROUTE_SECTION_DIR) as $filename) {\n\n\t\t $path = dirname(__FILE__) . Route::ROUTE_SECTION_DIR . '/' . $filename;\n\n\t\t if (is_file($path)) {\n\t\t\t\t$path_parts = pathinfo($path);\n\t\t \t$basename = $path_parts['filename'];\n\n\t\t \tif (self::endsWith($basename, Route::ROUTE_SECTION_SUFFIX)) {\n\t\t\t require_once $path;\n\t\t\t call_user_func(array($basename , 'init'));\n\t\t \t}\n\t\t }\n\t\t}\n\t}",
"public function load_files($dir = '') {\n $dir = trailingslashit($dir);\n if (!empty($dir) && is_dir($dir)) {\n if ($dh = opendir($dir)) {\n while (( $file = readdir($dh) ) !== false) {\n if (!in_array($file, array('.', '..')) && is_file($dir . $file) && 'php' == pathinfo($dir . $file, PATHINFO_EXTENSION)) {\n include_once( $dir . $file );\n }\n }\n closedir($dh);\n }\n }\n }",
"protected static function _load($directory, $filename, $tracker, $init, $namespace, $class_name)\n {\n $base_array = array(\n array('framework', ''),\n array(DCMS_CALL, '\\\\'.DCMS_CALL)\n );\n \n foreach($base_array as $base):\n \n $basepath = $base[0].'/'.$directory;\n $loaded = \\dcms\\Core::load_file($filename, $basepath, true, false);\n \n if($loaded === true):\n \n $filepath = $basepath.'/'.$filename.'.php';\n \\dcms\\Log::write(\"Loaded file from $filepath\", null, 1);\n \n $full_class_name = \"\\dcms\\\\$namespace{$base[1]}\\\\$class_name\";\n self::_initialize_class($full_class_name, $init);\n \\dcms\\Core::track_file($filepath, $tracker);\n \n return true;\n \n endif;\n \n endforeach;\n \n \\dcms\\Log::write(\"Could not load file $filename.php from /$directory/ as $tracker!\", null, 3);\n \\dcms\\Core::kill(\"Could not load file!\");\n }",
"public function testLoad() {\n $this->_loader->getSource('FilesystemTest.php');\n $this->_loader->getSource('FilesystemTest.php');\n\n $this->_loader->appendDir(dirname(__FILE__) . '/../Loader');\n $this->_loader->prependDir(dirname(__FILE__) . '/../Loader');\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 }",
"private static function load_files() {\n\t\t\t// Classes.\n\t\t\tinclude_once ASTRA_ADDON_EXT_ADVANCED_HEADERS_DIR . 'classes/class-astra-ext-advanced-headers-data.php';\n\t\t\t// Load Astra Breadcrumbs.\n\t\t\tinclude_once ASTRA_ADDON_EXT_ADVANCED_HEADERS_DIR . 'classes/astra-breadcrumbs.php';\n\t\t}",
"public function autoloadFilesAreBuildCorrectlyDataProvider() {}",
"public function load()\n {\n\n /*\n $folder = new LibFilesystemFolder(PATH_GW.'data/bdl/');\n $files = $folder->getPlainFiles();\n\n $this->data = array();\n\n // Load als xmi Files\n foreach ($files as $file)\n if (substr($file, -3 , strlen($file)) == \"xml\")\n $this->data[] = $file;\n */\n\n $data = array();\n\n include PATH_GW.'conf/map/bdl/projects/projects.php';\n\n $this->data = $data;\n\n ksort($this->data);\n\n }",
"public function loadAllClasses($folder_name = null, $class_name = null)\n\t{\n\t\t$folder_name = 'classes';\n\t\t$result = array();\n\t\t$pattern = '#.*.class.php$#';\n\n\t\tif(is_dir($folder_name))\n\t\t{\n\t\t\t$folder = scandir($folder_name);\n\t\t\tforeach($folder as $key => $value)\n\t\t\t{\n\t\t\t\tpreg_match($pattern, $value, $match);\n\t\t\t\tif(isset($match[0]))\n\t\t\t\t{\n\t\t\t\t\tarray_push($result, $match[0]);\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t$this->importFoundedClasses($folder_name,$result);\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}",
"private static function call(array $files, $folder, $ext = 'php')\n {\n foreach ($files as $file) {\n static::need($folder.$file.'.'.$ext);\n }\n }",
"private function loadArray(){\n if(file_exists($this->fullPath.$this->arrayFile)){\n include_once($this->fullPath.$this->arrayFile);\n if(!empty($arCfg)){\n $this->loadConfigs($arCfg);\n }\n }\n }",
"public function __LoadFile($files)\n {\n\t!is_array($files)?$files = Array($files):false;\n\t\n\tforeach($files as $file) include $file;\n }",
"function loadFolderData() {\n if (isset($this->params['folder_id'])) {\n $folder = $this->getFolder($this->params['folder_id']);\n if (isset($folder[$this->lngSelect->currentLanguageId])) {\n $this->currentFolder = $folder[$this->lngSelect->currentLanguageId];\n } else {\n $this->currentFolder = current($folder);\n }\n }\n }",
"public function check_files()\n {\n }",
"public function load_files() {\n\n\t\t// Load our admin-related functions.\n\t\tif ( is_admin() ) {\n\t\t\trequire_once( GUPR_DIR . 'lib/admin.php' );\n\t\t}\n\t}",
"function loadFolders() {\n unset($this->folders);\n unset($this->folderTree);\n unset($this->alternativeFolderNames);\n $this->folders = $this->getFolders($this->lngSelect->currentLanguageId);\n $this->countSubFolders($this->folders);\n foreach ($this->folders as $folderId => $folder) {\n $this->folderTree[$folder['parent_id']][$folderId] = $folderId;\n if (!isset($folder['folder_name'])) {\n $foldersWithoutName[] = $folderId;\n }\n }\n if (PAPAYA_CONTENT_LANGUAGE != $this->lngSelect->currentLanguageId &&\n isset($foldersWithoutName) && is_array($foldersWithoutName) &&\n count($foldersWithoutName) > 0) {\n $this->alternativeFolderNames = $this->getFolders(\n PAPAYA_CONTENT_LANGUAGE, $foldersWithoutName\n );\n }\n }",
"public function all() {\r\n\t\tthrow new Exception('Cannot load all for this type of file, use the next() method.');\r\n\t}",
"protected function processFileTree () {\n\t\t$files = $this->populateFileTree();\n\t\tforeach ($files as $file) {\n\t\t\t$this->processFile($file);\n\t\t}\n\t}",
"public function loadDir($directory);",
"abstract public function loadData();",
"public function loadDirectoryFiles($directory)\n {\n $files = $this->getDirectoryFiles($directory);\n foreach ($files as $key => $path) {\n $this->setData($key, $path);\n }\n }",
"private function _autoload() {\n\t\t\t$autoload = get_config('autoload');\n\t\t\tif(!is_array($autoload)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tforeach($autoload as $type => $resource) {\n\t\t\t\tif(method_exists($this->load, $type)) {\n\t\t\t\t\t$resource = (array) $resource;\n\t\t\t\t\tforeach($resource as $parameter) {\n\t\t\t\t\t\tif(is_string($parameter)) {\n\t\t\t\t\t\t\t$this->load->$type($parameter);\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 load()\n {\n if( $this->autoload ) {\n $loader = new BasePathClassLoader( $this->paths );\n $loader->useEnvPhpLib();\n $loader->register();\n }\n\n foreach( $this->paths as $path ) {\n $di = new RecursiveDirectoryIterator($path);\n $ita = new RecursiveIteratorIterator($di);\n $regex = new RegexIterator($ita, '/^.+\\.php$/i', \n RecursiveRegexIterator::GET_MATCH);\n\n foreach( $regex as $matches ) foreach( $matches as $match ) {\n try {\n require_once $match;\n } \n catch ( Exception $e ) {\n echo \"$match class load failed.\\n\";\n }\n }\n }\n }",
"public function registerValidatorsFromFolder($namespace, $dir)\n {\n\n $validatorFiles = scandir($dir);\n\n foreach ($validatorFiles as $key => $validatorFileName) {\n if (strpos($validatorFileName, \"php\") !== false) {\n $this->registerValidator($namespace . \"\\\\\" . substr($validatorFileName, 0, -4));\n }\n }\n\n }",
"public function testLoadFromFolder(): void\n {\n $provider = $this->createProvider();\n\n $appSettings = [];\n $valuesA = (new SampleSettingsAA())->get($appSettings);\n $valuesB = (new SampleSettingsBB())->get($appSettings);\n\n $this->assertFalse($provider->has(MarkerInterfaceTop::class));\n $this->assertTrue($provider->isAmbiguous(MarkerInterfaceTop::class));\n\n $this->assertTrue($provider->has(MarkerInterfaceChild1::class));\n $this->assertFalse($provider->isAmbiguous(MarkerInterfaceChild1::class));\n $this->assertEquals($valuesA, $provider->get(MarkerInterfaceChild1::class));\n\n $this->assertTrue($provider->has(MarkerInterfaceChild2::class));\n $this->assertFalse($provider->isAmbiguous(MarkerInterfaceChild2::class));\n $this->assertEquals($valuesB, $provider->get(MarkerInterfaceChild2::class));\n\n $this->assertTrue($provider->has(MarkerInterfaceChild11::class));\n $this->assertFalse($provider->isAmbiguous(MarkerInterfaceChild11::class));\n $this->assertEquals($valuesA, $provider->get(MarkerInterfaceChild11::class));\n\n $this->assertFalse($provider->has(MarkerInterfaceChild11And21::class));\n $this->assertTrue($provider->isAmbiguous(MarkerInterfaceChild11And21::class));\n\n $this->assertTrue($provider->has(MarkerInterfaceChild21::class));\n $this->assertFalse($provider->isAmbiguous(MarkerInterfaceChild21::class));\n $this->assertEquals($valuesB, $provider->get(MarkerInterfaceChild21::class));\n\n $this->assertTrue($provider->has(MarkerInterfaceStandalone::class));\n $this->assertFalse($provider->isAmbiguous(MarkerInterfaceStandalone::class));\n $this->assertEquals($valuesB, $provider->get(MarkerInterfaceStandalone::class));\n\n $this->assertTrue($provider->has(SampleSettingsA::class));\n $this->assertFalse($provider->isAmbiguous(SampleSettingsA::class));\n $this->assertEquals($valuesA, $provider->get(SampleSettingsA::class));\n\n $this->assertTrue($provider->has(SampleSettingsAA::class));\n $this->assertFalse($provider->isAmbiguous(SampleSettingsAA::class));\n $this->assertEquals($valuesA, $provider->get(SampleSettingsAA::class));\n\n $this->assertTrue($provider->has(SampleSettingsB::class));\n $this->assertFalse($provider->isAmbiguous(SampleSettingsB::class));\n $this->assertEquals($valuesB, $provider->get(SampleSettingsB::class));\n\n $this->assertTrue($provider->has(SampleSettingsBB::class));\n $this->assertFalse($provider->isAmbiguous(SampleSettingsBB::class));\n $this->assertEquals($valuesB, $provider->get(SampleSettingsBB::class));\n\n $this->assertEquals([\n MarkerInterfaceTop::class => true,\n MarkerInterfaceChild11And21::class => true,\n SettingsInterface::class => true,\n ], $provider->getAmbiguousMap());\n\n $this->assertEquals([\n 0 => $valuesA,\n 1 => $valuesB,\n ], $provider->getSettingsData());\n\n $this->assertEmpty(array_diff_assoc($provider->getSettingsMap(), [\n SampleSettingsA::class => 0,\n SampleSettingsAA::class => 0,\n MarkerInterfaceChild1::class => 0,\n MarkerInterfaceChild11::class => 0,\n SampleSettingsB::class => 1,\n SampleSettingsBB::class => 1,\n MarkerInterfaceChild2::class => 1,\n MarkerInterfaceChild21::class => 1,\n MarkerInterfaceStandalone::class => 1,\n ]));\n }",
"function load_specified_files( array $filenames, $folder_root = '', $ext = '.php' ) {\n\t$folder_root = $folder_root ? : METRO_CORE_DIR . '/inc/';\n\n\tforeach ( $filenames as $filename ) {\n\t\trequire_once $folder_root . $filename . $ext ;\n\t}\n}",
"public function testCanLoadLanguageFilesFromSpecifiedPath()\n {\n $this->translator->load();\n $messages = $this->translator->all();\n $this->assertArrayHasKey('test_message', $messages);\n }",
"abstract protected function load();",
"abstract protected function load();",
"abstract protected function load();",
"abstract protected function load();",
"public function folder_data($folder) {\n // TO DO!!!!!!\n }",
"private function load_children() {\n\t\tif (isset($this->_children)) return;\n\t\t$this->_children = array();\n\t\t$this->_testcases = array();\n\t\tif (!$this->exists()) return; // entity doesn't actually exist\n\t\tforeach (new DirectoryIterator($this->data_path()) as $child) {\n\t\t\t$filename = $child->getFilename();\n\t\t\tif ($child->isDot() || $filename[0] == '.') {\n\t\t\t\t// skip hidden files and ..\n\t\t\t} else if ($child->isDir()) {\n\t\t\t\t// subdirectory = child entity\n\t\t\t\t$this->_children[$filename] = new Entity($this, $filename);\n\t\t\t} else if (substr($filename,-3) == '.in') {\n\t\t\t\t// \".in\" file = testcase\n\t\t\t\t$this->_testcases []= substr($filename,0,-3);\n\t\t\t}\n\t\t}\n\t\tsort($this->_testcases);\n\t\t//ksort($this->_children);\n\t\tuasort($this->_children, 'compare_order');\n\t}",
"function LoadFiles(){\n\n\t\t//open or create the user file\n\t\t$this->userFile = $this->fileHandler->rOpen('users.txt');\n\t\tif($this->userFile == NO_LOCK) $this->markFatal('User file is currently being edited, try again later');\n\t\telse if(!$this->userFile){\n\t\t\t$this->logMsg(WARNING, 'Failed to open user file, attempting to create one');\n\n\t\t\t$this->userFile = $this->fileHandler->rCreate('users.txt');\n\t\t\tif(!$this->userFile) $this->markFatal('Failed to create user file');\n\t\t}\n\n\t\t//open the schedule file\n\t\t$this->scheduleFile = $this->fileHandler->rOpen('schedule.txt');\n\t\tif($this->userFile == NO_LOCK) $this->markFatal('Schedule file is locked, try again later');\n\t\telse if(!$this->scheduleFile) $this->markFatal('Failed to open schedule file');\n\t}",
"protected function _load()\n {\n return array();\n }",
"private function loadSubmissionFiles() {\n $submitter_id = $this->graded_gradeable->getSubmitter()->getId();\n $gradeable = $this->graded_gradeable->getGradeable();\n $course_path = $this->core->getConfig()->getCoursePath();\n $config = $gradeable->getAutogradingConfig();\n\n // Get the path to load files from (based on submission type)\n $dirs = $gradeable->isVcs() ? ['submissions', 'checkout'] : ['submissions'];\n\n\n foreach ($dirs as $dir) {\n $this->meta_files[$dir] = [];\n $this->files[$dir][0] = [];\n\n $path = FileUtils::joinPaths($course_path, $dir, $gradeable->getId(), $submitter_id, $this->version);\n\n // Now load all files in the directory, flattening the results\n $submitted_files = FileUtils::getAllFiles($path, [], true);\n foreach ($submitted_files as $file => $details) {\n if (substr(basename($file), 0, 1) === '.') {\n $this->meta_files[$dir][$file] = $details;\n }\n else {\n $this->files[$dir][0][$file] = $details;\n }\n }\n // If there is only one part (no separation of upload files),\n // be sure to set the \"Part 1\" files to the \"all\" files\n if ($config->getNumParts() === 1 && !$config->isNotebookGradeable()) {\n $this->files[$dir][1] = $this->files[$dir][0];\n }\n\n $part_names = $config->getPartNames();\n $notebook_model = null;\n if ($config->isNotebookGradeable()) {\n $notebook_model = $config->getUserSpecificNotebook($submitter_id);\n\n $part_names = range(1, $notebook_model->getNumParts());\n }\n\n // A second time, look through the folder, but now split up based on part number\n foreach ($part_names as $i => $name) {\n foreach ($submitted_files as $file => $details) {\n $dir_name = \"part{$i}/\";\n $index = $i;\n if ($config->isNotebookGradeable() && isset($notebook_model->getFileSubmissions()[$i])) {\n $dir_name = $notebook_model->getFileSubmissions()[$i][\"directory\"];\n $index = $name;\n }\n\n if (substr($file, 0, strlen($dir_name)) === $dir_name) {\n $this->files[$dir][$index][substr($file, strlen($dir_name))] = $details;\n }\n }\n }\n }\n }",
"public function loadAllClassesIncrementally()\n {\n }",
"public function internalLoad(string $path)\n {\n // Scan path\n $scan = array_diff(scandir($path), array('.', '..', 'Core.php', 'Resources'));\n // Foreach found item\n foreach ($scan as $item) {\n // Check if item is a file\n if (substr($item, -4) == \".php\") {\n // Require file once\n require_once $path . '/' . $item;\n } else {\n // Rerun autoload on new folder\n $this->internalLoad($path . '/' . $item);\n }\n }\n }",
"private function loadResources(): void\n {\n foreach ($this->options['resource_files'] as $locale => $files) {\n foreach ($files as $key => $file) {\n $c = mb_substr_count($file, '.');\n\n if ($c < 2) {\n // filename is domain.format\n list($domain, $format) = explode('.', basename($file), 2);\n } else {\n // filename is domain.locale.format\n list($domain, $locale, $format) = explode('.', basename($file), 3);\n }\n\n $this->addResource($format, $file, $locale, $domain);\n unset($this->options['resource_files'][$locale][$key]);\n }\n }\n }",
"public function load()\n {\n $this->_retrievedFiles = $this->getRetrievedFiles();\n $this->_loadedClasses = [];\n\n $manifestRepository = $this->_registry->getManifestRepository();\n $providerRepository = $this->_registry->getProviderRepository();\n\n $loadedClasses = [];\n\n // loop through files and find the classes declared by loading the file\n foreach ($this->_retrievedFiles as $file) {\n if(is_dir($file)) {\n continue;\n }\n\n $classesLoadedBefore = get_declared_classes();\n $oldLevel = error_reporting(E_ALL | ~E_STRICT); // remove strict so that other packages wont throw warnings\n // should we lint the files here? i think so\n include_once $file;\n error_reporting($oldLevel); // restore old error level\n $classesLoadedAfter = get_declared_classes();\n $loadedClasses = array_merge($loadedClasses, array_diff($classesLoadedAfter, $classesLoadedBefore));\n }\n\n // loop through the loaded classes and ensure that\n foreach ($loadedClasses as $loadedClass) {\n\n // reflect class to see if its something we want to load\n $reflectionClass = new ReflectionClass($loadedClass);\n if ($reflectionClass->implementsInterface('Zend_Tool_Framework_Manifest_Interface')\n && !$reflectionClass->isAbstract())\n {\n $manifestRepository->addManifest($reflectionClass->newInstance());\n $this->_loadedClasses[] = $loadedClass;\n }\n\n if ($reflectionClass->implementsInterface('Zend_Tool_Framework_Provider_Interface')\n && !$reflectionClass->isAbstract()\n && !$providerRepository->hasProvider($reflectionClass->getName(), false))\n {\n $providerRepository->addProvider($reflectionClass->newInstance());\n $this->_loadedClasses[] = $loadedClass;\n }\n\n }\n\n return $this->_loadedClasses;\n }",
"public function parseFiles()\n {\n $this->files->each(function ($file) {\n $this->store[] = $this->getTree($this->parseFile($file), $file);\n });\n }",
"public function doLoad()\n {\n $this->DataSourceInstance->doLoad();\n }",
"abstract protected function collectionLoader();",
"public function _load()\n {\n $query = new Query(\n \"SELECT *\n FROM `\" . Leder::TABLE . \"`\n WHERE `arrangement_fra` = '#fra'\n AND `arrangement_til` = '#til'\",\n [\n 'fra' => $this->getArrangementFraId(),\n 'til' => $this->getArrangementTilId()\n ]\n );\n\n $res = $query->getResults();\n while( $row = Query::fetch($res) ) {\n $this->add(\n Leder::loadFromDatabaseRow( $row )\n );\n }\n }",
"private function isLoad($file){\n\t\treturn in_array($file, $this->file, true);\n\t}",
"public function testAll(): void\n {\n $all = $this->files->all();\n\n foreach (['', 'connection_2', 'connection_3'] as $key_name) {\n $this->assertArrayHasKey($key_name, $all);\n }\n\n $this->assertEquals('2000_01_01_000001_simple_sql_data.sql', $all[''][0]);\n $this->assertEquals('2000_01_01_000002_simple_sql_data_tarball.sql.gz', $all[''][1]);\n\n $this->assertEquals('2000_01_01_000010_simple_sql_data.sql', $all['connection_2'][0]);\n\n $this->assertEquals('2000_01_01_000020_simple_sql_data.sql', $all['connection_3'][0]);\n }",
"public function load()\n {\n foreach ($this->aMappingConfiguration as $sLinkedEntity => $aMappingSetup) {\n $this->loadMapped(new $sLinkedEntity());\n }\n }",
"protected function load()\n {\n $this->translations = array();\n \n if ($this->language) {\n if ($this->cachepath) {\n if (file_exists($cache = $this->cachepath.'/'.$this->language.'.php')) {\n $this->translations = include($cache);\n }\n } else {\n if (!empty($this->filepaths)) {\n foreach ($this->filepaths as $filepath) {\n $this->loadFilePath($filepath);\n }\n }\n }\n }\n }",
"public function testLoadThrowsDataDirectoryNotFoundForFileInsteadOfDirectory(): void\n {\n $filename = 'accessible.json';\n $this->addFileToVFS($filename);\n $path = $this->getFullPath($filename);\n $this->expectException(DataDirectoryNotFoundException::class);\n $this->expectExceptionExactMessage(\"Root folder $path was not found.\");\n\n $directoryDataLoader = $this->prepareDirectoryDataLoader();\n\n $directoryDataLoader->load($path, '/^.*\\..*$/');\n }",
"public function load($files)\n {\n foreach ($files as $key => $value)\n {\n if (gettype($key) == 'integer')\n $path = 'Core/' . $value . '/' . $value . '.php';\n else\n $path = 'Core/' . $key . '/' . $value . '.php';\n\n require_once $path;\n }\n }",
"private function setAllLoaded()\n {\n $class_reflection = new ReflectionClass(get_class($this));\n do {\n if ($class_reflection->isInstantiable())\n $this->setLoadedFromDb($class_reflection->getName());\n\n } while (($class_reflection = $class_reflection->getParentClass()) && # get the parent\n $class_reflection->getName() != __CLASS__); # check that we're not hitting the top\n }",
"function load_files($path) {\n\t$files = scandir($path);\n\tarray_shift($files); // remove \".\"\n\tarray_shift($files); // remove \"..\"\n\tforeach ($files as $file) {\n\t\tif (is_dir($path . '/' . $file)) {\n\t\t\tload_files($path . '/' . $file);\n\t\t} else {\n\t\t\t$file_name = $path . '/' . $file;\n\t\t\trequire_once($file_name);\n\t\t}\n\t}\n\treturn true;\n}",
"public function collectYamlFiles()\r\n {\r\n $folder = array($this->app_root.'/config');\r\n $files_found = $this->findFiles(\r\n $folder,\r\n array(\"yml\"),\r\n array(\"parameters.yml\")\r\n );\r\n\r\n if($files_found)\r\n $this->file_list = array_merge($this->file_list, $files_found);\r\n }",
"function frame_load_files($folder, $include = false, $extension = true)\n{\n $path = locate_template($folder);\n $files = array();\n\n if (is_dir($path))\n {\n $path_items = new DirectoryIterator($path);\n\n foreach ($path_items as $item)\n {\n if (!$item->isDot() && $item->isFile())\n {\n if (substr($item->getFilename(), 0, 1) !== '.' &&\n substr($item->getFilename(), 0, 1) !== '_')\n {\n if ($include === true) include($item->getPathname());\n $files[] = ($extension === true) ? $item->getFilename() : $item->getBasename('.'.$item->getExtension());\n }\n }\n // Recursive\n else if (!$item->isDot() && $item->isDir())\n {\n if (substr($item->getBasename(), 0, 1) !== '.' &&\n substr($item->getBasename(), 0, 1) !== '_')\n {\n $files = frame_load_files($folder.'/'.$item->getBasename(), $include, $extension);\n }\n }\n }\n }\n\n return $files;\n}",
"abstract protected function load(): array;",
"public function scanSourceFolders() {\n $this->addons = [];\n foreach ($this->sources as $sourceDir) {\n $this->scanSource($sourceDir);\n }\n }",
"public function run() {\n $this->load_dependencies();\n $this->load_localization();\n $this->load_admin();\n $this->load_public();\n }",
"function load_results($dir) {\n\n\t\t$data = array();\n\n\t\t$fs_dir = opendir($dir);\n\t\twhile ($fs = readdir($fs_dir)) {\n\n\t\t\tif ((! is_dir(\"$dir/$fs\")) || (in_array($fs,array('.','..')))) { continue; }\n\n\t\t\techo \"$dir/$fs\\n\";\n\n\t\t\t$data[$fs] = array();\n\n\t\t\t$pgbs_dir = opendir(\"$dir/$fs\");\n\t\t\twhile ($pgbs = readdir($pgbs_dir)) {\n\n\t\t\t\tif ($pgbs == '.' || $pgbs == '..') { continue; }\n\n\t\t\t\techo \"\\t$pgbs:\";\n\n\t\t\t\t$data[$fs][$pgbs] = array();\n\n\t\t\t\t$fsbs_dir = opendir(\"$dir/$fs/$pgbs\");\n\t\t\t\twhile ($fsbs = readdir($fsbs_dir)) {\n\n\t\t\t\t\tif ($fsbs == '.' || $fsbs == '..') { continue; }\n\n\t\t\t\t\techo \" $fsbs\";\n\n\t\t\t\t\t$data[$fs][$pgbs][$fsbs] = array();\n\n\t\t\t\t\t$data[$fs][$pgbs][$fsbs]['hash'] = md5(\"$fs/$pgbs/$fsbs\" . microtime(true));\n\n\t\t\t\t\t$data[$fs][$pgbs][$fsbs]['pgbench'] = array();\n\n\t\t\t\t\t$data[$fs][$pgbs][$fsbs]['pgbench']['ro'] = load_pgbench(\"$dir/$fs/$pgbs/$fsbs/pgbench/ro\", 1);\n\t\t\t\t\t$data[$fs][$pgbs][$fsbs]['pgbench']['rw'] = load_pgbench(\"$dir/$fs/$pgbs/$fsbs/pgbench/rw\", 9);\n\n\t\t\t\t\t$data[$fs][$pgbs][$fsbs]['tpch'] = load_tpch(\"$dir/$fs/$pgbs/$fsbs/tpch\");\n\n\t\t\t\t}\n\t\t\t\tclosedir($fsbs_dir);\n\t\t\t\techo \"\\n\";\n\n\t\t\t}\n\t\t\tclosedir($pgbs_dir);\n\n\t\t}\n\t\tclosedir($fs_dir);\n\n\t\treturn $data;\n\t}",
"public function test_scan_files()\n {\n $content = array('.gitignore','.htaccess','index.php','README');\n $object = Directory::factory(ROOT);\n $res = $object->scan(Directory::SORT_ASC, Directory::SCAN_FILES);\n \n $this->assertEquals(count($content), count($res));\n foreach($res as $path=>$dir){\n $this->assertTrue(in_array($dir->get_base_name(), $content));\n $this->assertInstanceOf('\\Kaili\\File', $dir);\n }\n }",
"public function loadFiles()\n\t{\n\t\t$files = array();\n\t\t\n\t\t$searchPath = $this->getLocalFolder().\"/*.*\";\n\t\t$filesArray = glob($searchPath);\n\t\t\n\t\tforeach($filesArray as $file)\n\t\t{\n\t\t\t$files[] = new File($file);\n\t\t}\n\t\t\n\t\treturn $files;\n\t}",
"public static function load()\n {\n $files = glob(BASEDIR . '/config/*.php');\n foreach ($files as $file){\n $key = str_replace('.php', '', basename($file));\n static::$values[$key] = include $file;\n }\n }",
"function include_all_php($folder)\n{\n foreach (glob(\"{$folder}/*.php\") as $filename)\n {\n require_once $filename;\n }\n\n foreach (glob(\"{$folder}/*\") as $foldername)\n {\n \tif(is_dir($foldername))\n \t{\n\t\t\tinclude_all_php($foldername);\n \t}\n }\n}",
"public function testLoadAll()\n {\n $config = [\n 'cryptors' => [\n 'rsa' => [\n 'foo' => [],\n 'bar' => [],\n ],\n 'aes' => [\n 'baz' => [\n 'key_size' => Fixtures::bits(),\n 'key_path' => $this->existentKeyFile,\n 'binary_output' => true,\n ],\n 'qux' => [\n 'key_size' => Fixtures::bits(),\n 'key_path' => $this->existentKeyFile,\n 'binary_output' => false,\n ],\n ],\n ],\n 'doctrine' => [\n 'dbal' => [\n 'encrypted_string' => [\n 'enabled' => false\n ]\n ]\n ]\n ];\n $this->load($config, function (ContainerBuilder $container) use ($config) {\n foreach ($config['cryptors'] as $cryptorType) {\n foreach ($cryptorType as $name => $cryptorConfig) {\n $this->assertTrue($container->hasDefinition(\"gtt.crypt.encryptor.$name\"));\n }\n }\n $this->assertTrue($container->has('gtt.crypt.rsa.zend_rsa.foo'));\n $this->assertTrue($container->has('gtt.crypt.rsa.zend_rsa.bar'));\n\n $this->assertTrue($container->has('gtt.crypt.aes.key_reader.baz'));\n $this->assertTrue($container->has('gtt.crypt.aes.key_reader.qux'));\n $this->assertEquals($this->existentKeyFile, $container->getDefinition('gtt.crypt.aes.key_reader.baz')->getArgument(0));\n $this->assertEquals($this->existentKeyFile, $container->getDefinition('gtt.crypt.aes.key_reader.qux')->getArgument(0));\n\n $this->assertTrue($container->getDefinition('gtt.crypt.encryptor.baz')->getArgument(1));\n $this->assertFalse($container->getDefinition('gtt.crypt.encryptor.qux')->getArgument(1));\n });\n }",
"public function testDir_LazyLoad()\n {\n $config = new Config_Dir($this->dir, array('transformer'=>'from-mock', 'ext'=>'mock'));\n\n $this->assertType('Q\\Config_Dir', $config);\n $this->assertEquals(array(), (array)$config);\n \n $cfg_file1 = $config['file1'];\n $this->assertType('Q\\Config_File', $cfg_file1);\n $this->assertEquals(array(\"db\"=>array(\"host\"=>\"localhost\", \"dbname\"=>\"test\",\"user\"=>\"myuser\",\"pwd\"=>\"mypwd\"),\"output\"=>\"xml\",\"input\"=>\"json\"), (array)$cfg_file1);\n $this->assertArrayHasKey('file1', (array)$config);\n $this->assertArrayNotHasKey('dir1', (array)$config);\n\n $cfg_dir1 = $config['dir1'];\n $this->assertType('Q\\Config_Dir', $cfg_dir1);\n $this->assertEquals(array(), (array)$cfg_dir1);\n $this->assertArrayHasKey('file1', (array)$config);\n $this->assertArrayHasKey('dir1', (array)$config); \n }",
"public abstract function load();",
"public static function checkImports($files, FileCheckContract $fileCheckContract)\n {\n foreach ($files as $classFilePath) {\n if ($fileCheckContract) {\n $fileCheckContract->onFileTap($classFilePath);\n }\n\n $absFilePath = $classFilePath->getRealPath();\n\n $tokens = token_get_all(file_get_contents($absFilePath));\n\n // If file is empty or does not begin with <?php\n if (($tokens[0][0] ?? null) !== T_OPEN_TAG) {\n continue;\n }\n\n [\n $currentNamespace,\n $class,\n $type,\n $parent,\n $interfaces\n ] = GetClassProperties::readClassDefinition($tokens);\n\n // It means that, there is no class/trait definition found in the file.\n if (! $class) {\n continue;\n }\n\n event('laravel_microscope.checking_file', [$absFilePath]);\n // better to do it an event listener.\n $fileCheckContract->onFileTap($classFilePath);\n\n $tokens = token_get_all(file_get_contents($absFilePath));\n $nonImportedClasses = ParseUseStatement::findClassReferences($tokens, $absFilePath);\n foreach ($nonImportedClasses as $nonImportedClass) {\n $v = trim($nonImportedClass['class'], '\\\\');\n if (! class_exists($v) && ! trait_exists($v) && ! interface_exists($v) && ! function_exists($v)) {\n app(ErrorPrinter::class)->wrongUsedClassError($absFilePath, $nonImportedClass);\n }\n }\n\n try {\n// $classPath = self::relativePath($basePath, $absFilePath);\n// $correctNamespace = NamespaceCorrector::calculateCorrectNamespace($classPath, $composerPath, $composerNamespace);\n\n if ($currentNamespace) {\n $namespacedClassName = $currentNamespace.'\\\\'.$class;\n } else {\n $namespacedClassName = $class;\n }\n\n $imports = ParseUseStatement::getUseStatementsByPath($namespacedClassName, $absFilePath);\n self::checkImportedClasses($imports, $absFilePath);\n\n if ($currentNamespace) {\n $ref = new ReflectionClass($currentNamespace.'\\\\'.$class);\n ModelRelations::checkModelsRelations($currentNamespace.'\\\\'.$class, $ref);\n } else {\n // @todo show skipped file...\n }\n } catch (ReflectionException $e) {\n // @todo show skipped file...\n }\n }\n }",
"public function load() {\r\n\t\t$this->includes();\r\n\t\t$this->inits();\r\n\t}",
"protected function process_load($data)\n\t{\n\t\t$parsed_data = array();\n\t\tforeach ($data as $key => $value)\n\t\t{\n\t\t\tif (strpos($key, ':'))\n\t\t\t{\n\t\t\t\tlist($table, $field) = explode(':', $key);\n\t\t\t\tif ($table == $this->_table_name)\n\t\t\t\t{\n\t\t\t\t\t$parsed_data[$field] = $value;\n\t\t\t\t}\n\t\t\t\telseif ($field)\n\t\t\t\t{\n\t\t\t\t\t$this->_lazy[inflector::singular($table)][$field] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$parsed_data[$key] = $value;\n\t\t\t}\n\t\t}\n\t\t$this->_data = $parsed_data;\n\t}",
"function load_files_from_dir($dir) {\n\n\t$catalog = opendir($dir);\n\n\twhile ($filename = readdir($catalog )) // перебираем наш каталог \n\t{\n\t\t\tif (getEndFile($filename) === 'functions.php') {\n\t\t\t\t$filename = $dir.'/'.$filename;\n\t\t\t\tinclude($filename); // один раз подрубаем, чтоб не повторяться \n\t\t\t}\n\t}\n\n\tclosedir($catalog);\n\n}",
"private function loadAllTeams()\n\t{\n\t\t$this->aTeams = Team::loadAllTeams();\n\t}",
"abstract public function load();",
"abstract public function load();",
"public static function run() {\n\t\t$errors = [];\n\t\t$testCnt = 0;\n\t\t$classCnt = 0;\n\t\t$methodCnt = 0;\n\t\t$path = static::getPath();\n\t\t$Folder = dir($path);\n\t\twhile ($className = $Folder->read()) {\n\t\t\tif (in_array($className, ['.', '..']));\n\t\t\telseif (!is_dir($classPath = $path . '/' . $className));\n\t\t\telse {\n\t\t\t\t$classCnt++;\n\t\t\t\t$ClassFolder = dir($classPath);\n\t\t\t\twhile ($methodName = $ClassFolder->read()) {\n\t\t\t\t\tif (in_array($methodName, ['.', '..']));\n\t\t\t\t\telseif (!is_dir($methodPath = $classPath . '/' . $methodName));\n\t\t\t\t\telse {\n\t\t\t\t\t\t$methodCnt++;\n\t\t\t\t\t\t$MethodFolder = dir($methodPath);\n\t\t\t\t\t\twhile ($testFname = $MethodFolder->read()) {\n\t\t\t\t\t\t\t$fullTestFname = $methodPath . '/' . $testFname;\n\t\t\t\t\t\t\tif (!is_file($fullTestFname));\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t$testData = require($fullTestFname);\n\t\t\t\t\t\t\t\t$result = static::_assert($testData);\n\t\t\t\t\t\t\t\t$testCnt++;\n\t\t\t\t\t\t\t\tif (!is_null($result)) {\n\t\t\t\t\t\t\t\t\t$result['filename'] = $testFname;\n\t\t\t\t\t\t\t\t\t$errors[] = $result;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn [\n\t\t\t'success' => count($errors) ? false : true,\n\t\t\t'testCnt' => $testCnt,\n\t\t\t'classCnt' => $classCnt,\n\t\t\t'methodCnt' => $methodCnt,\n\t\t\t'errors' => $errors,\n\t\t];\n\t}",
"public function __doLoad()\n {\n $strSQL = $this->getSelectSql();\n $_SESSION[\"logger\"]->info(\"__doLoad: \" . $strSQL);\n\n $result = $this->query($strSQL);\n $_SESSION[\"logger\"]->info(\"Results: \" . $this->rowCount($result));\n if ($result && $this->rowCount($result) > 0) {\n $this->exists = true;\n $this->dxHashToClass($this->torecord($result));\n } else {\n $this->exists = false;\n }\n }",
"protected function childLoad() {}",
"function _fillFiles()\n\t{\n\t\t// directory from which we import (real path)\n\t\t$importDirectory = ereg_replace(\n\t\t\t\t\"^(.*)/$\", \n\t\t\t\t'\\1', \n\t\t\t\tereg_replace(\"^(.*)/$\", '\\1', $_SERVER[\"DOCUMENT_ROOT\"]) . $this->from);\n\t\t\n\t\t// when running on windows we have to change slashes to backslashes\n\t\tif (runAtWin()) {\n\t\t\t$importDirectory = str_replace(\"/\", \"\\\\\", $importDirectory);\n\t\t}\n\t\t$this->_files = array();\n\t\t$this->_depth = 0;\n\t\t$this->_postProcess = array();\n\t\t$this->_fillDirectories($importDirectory);\n\t\t// sort it so that webEdition files are at the end (that templates know about css and js files)\n\t\t\n\n\t\t$tmp = array();\n\t\tforeach ($this->_files as $e) {\n\t\t\tif ($e[\"contentType\"] == \"folder\") {\n\t\t\t\tarray_push($tmp, $e);\n\t\t\t}\n\t\t}\n\t\tforeach ($this->_files as $e) {\n\t\t\tif ($e[\"contentType\"] != \"folder\" && $e[\"contentType\"] != \"text/webedition\") {\n\t\t\t\tarray_push($tmp, $e);\n\t\t\t}\n\t\t}\n\t\tforeach ($this->_files as $e) {\n\t\t\tif ($e[\"contentType\"] == \"text/webedition\") {\n\t\t\t\tarray_push($tmp, $e);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->_files = $tmp;\n\t\t\n\t\tforeach ($this->_postProcess as $e) {\n\t\t\tarray_push($this->_files, $e);\n\t\t}\n\t}",
"public function testLoad()\n {\n $fixture = new Mad_Test_Fixture_Base($this->_conn, 'unit_tests');\n $this->assertEquals('0', $this->_countRecords());\n\n $fixture->load();\n $this->assertEquals('6', $this->_countRecords());\n }",
"final protected function loadAllConfigFiles(ContainerBuilder $container): void\n {\n $directory = dirname((new ReflectionObject($this))->getFileName());\n $directory = realpath(sprintf('%s/../Resources/config/services', $directory));\n\n $loader = new YamlFileLoader($container, new FileLocator($directory));\n\n foreach ($this->configs() as $config) {\n $loader->load(sprintf('%s.yaml', $config));\n }\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }"
] | [
"0.6698514",
"0.66538554",
"0.645682",
"0.63700205",
"0.5995556",
"0.5979308",
"0.5963646",
"0.5948187",
"0.5873748",
"0.5867739",
"0.585716",
"0.58527035",
"0.5833193",
"0.5760506",
"0.57397145",
"0.5727868",
"0.5698817",
"0.5695705",
"0.5694314",
"0.5680861",
"0.5680386",
"0.56557345",
"0.56311774",
"0.56101465",
"0.55956197",
"0.5541476",
"0.55329317",
"0.5515496",
"0.55129504",
"0.5478957",
"0.547799",
"0.54773164",
"0.5476372",
"0.54620636",
"0.5457731",
"0.5452654",
"0.5448762",
"0.5444572",
"0.5428948",
"0.5421746",
"0.5407418",
"0.5395186",
"0.53791517",
"0.53789616",
"0.5375656",
"0.53667927",
"0.5333681",
"0.53312117",
"0.5321121",
"0.5321121",
"0.5321121",
"0.5321121",
"0.531929",
"0.5319186",
"0.5308721",
"0.52897817",
"0.5286381",
"0.5274137",
"0.5267091",
"0.52640474",
"0.5257472",
"0.5255798",
"0.5248897",
"0.52430797",
"0.52333695",
"0.5223246",
"0.52229667",
"0.5221565",
"0.52192587",
"0.52061844",
"0.52056044",
"0.5185444",
"0.5184429",
"0.5181038",
"0.5179854",
"0.5174886",
"0.5160799",
"0.51525223",
"0.5138451",
"0.51360583",
"0.5132669",
"0.51302546",
"0.5129721",
"0.51081455",
"0.5099605",
"0.5096333",
"0.5093368",
"0.5084988",
"0.508452",
"0.5079362",
"0.5073218",
"0.5071166",
"0.5071166",
"0.5069909",
"0.506522",
"0.50582755",
"0.5050102",
"0.50424135",
"0.50399226",
"0.50343806"
] | 0.56678486 | 21 |
Provides correct test data for testing method _load_. | public function directoryWithFilesDataProvider(): array
{
$multiMap = ['OtherFile' => 'other_file.json', 'JSONFile' => 'j_s_o_n_file.json'];
$multiDirMap = ['FileFirst' => 'first/file_first.exe', 'FileSecond' => 'first/file_second.exe'];
$multiDirMap['FileThird'] = 'second/file_third.exe';
$multiDirMap['SomeExt'] = 'some_ext.exe';
$singleLoadData = ['OneFile' => ['param1' => 'some_value']];
$multiLoadData = ['OtherFile' => ['param2' => 'other_value'], 'JSONFile' => ['param3' => 'last_value']];
$multiDirLoadData = ['FileFirst' => ['param4' => 'no_value'], 'FileSecond' => ['param5' => 'ext_value']];
$multiDirLoadData['FileThird'] = ['param6' => 'this_value'];
$multiDirLoadData['SomeExt'] = ['param7' => 'that_value'];
return [
'single file' => ['single', '/^.*\..*$/', ['OneFile' => 'one_file.json'], $singleLoadData],
'multiple files with mask' => ['multi', '/^.*\.json$/', $multiMap, $multiLoadData],
'multiple directories' => ['container', '/^.*\.exe$/', $multiDirMap, $multiDirLoadData],
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function loadData();",
"public function testLoad()\n {\n $fixture = new Mad_Test_Fixture_Base($this->_conn, 'unit_tests');\n $this->assertEquals('0', $this->_countRecords());\n\n $fixture->load();\n $this->assertEquals('6', $this->_countRecords());\n }",
"public function testLoad()\n {\n $this->todo('stub');\n }",
"public function testLoad()\n {\n $this->todo('stub');\n }",
"public function testLoad()\n {\n $this->todo('stub');\n }",
"public function readTestData()\n {\n return $this->testData->get();\n }",
"function testLoad()\n {\n $this->assertTrue(true);\n }",
"abstract protected function getTestData() : array;",
"abstract protected function load();",
"abstract protected function load();",
"abstract protected function load();",
"abstract protected function load();",
"abstract public function load();",
"abstract public function load();",
"public function testLoad()\n {\n $struct = $this->_newStruct();\n $expect = array(\n 'foo' => 'bar2',\n 'baz' => 'dib2',\n 'zim' => 'gir2',\n 'irk' => array(\n 'subfoo' => 'subbar2',\n 'subbaz' => 'subdib2',\n 'subzim' => 'subgir2',\n ),\n );\n $struct->load($expect);\n $actual = $struct->toArray();\n $this->assertSame($actual, $expect);\n }",
"abstract public function getTestData(): array;",
"public function testCanBeCreatedFromGetData(): void\n {\n $this->assertEquals(\n 'C:\\Documents\\Word\\Work\\Current\\1\\2\\3<br>',\n (new Read)->getData('current')\n );\n $this->assertIsString((new Read)->getData('current'));\n\n $this->assertEquals(\n 'C:\\Documents\\Software Engineer\\Projects\\AnnualReport.xls<br>',\n (new Read)->getData('software engineer')\n );\n $this->assertIsString((new Read)->getData('software engineer'));\n\n $this->assertEquals(\n 'C:\\Documents\\Salary\\Accounting\\Accounting.xls<br>',\n (new Read)->getData('accounting')\n );\n $this->assertIsString((new Read)->getData('accounting'));\n }",
"protected function getTestData(){\n\t\treturn \"application/testdata/Pagers.php\" ;\n\t}",
"protected static function getDataFixtures()\n {\n return array(\n new LoadTestUser(),\n new LoadSuperUser(),\n );\n }",
"public function setUp()\n {\n $folder = dirname(__DIR__) . '/fixtures';\n\n $this->keyVal(true);\n $this->_mutableLoader = new Loader($folder);\n $this->_immutableLoader = new Loader($folder, true);\n }",
"public abstract function load();",
"public function testData()\n {\n $output = $this->primer->getPatterns(array('components/test-group/data-autoload'), false);\n\n $this->assertEquals($output, '1.2');\n }",
"public function testLoad()\n {\n \t$this->assertEquals(array('id'=>1, 'key'=>'one', 'title'=>'first row', 'status'=>'ACTIVE'), $this->conn->load(\"test\", 1, DB::FETCH_ASSOC), 'Using id=1');\n \t$this->assertEquals(array('id'=>3, 'key'=>'three', 'title'=>'another row', 'status'=>'PASSIVE'), $this->conn->load(\"test\", array('key'=>'three'), DB::FETCH_ASSOC), 'Using id=array(\"key\"=>\"three\")');\n\n \t$this->assertEquals(array(1, 'one', 'first row', 'ACTIVE'), $this->conn->load(\"test\", 1, DB::FETCH_ORDERED), 'Using id=1');\n \t$this->assertEquals(array(1, 'one', 'first row', 'ACTIVE', 'id'=>1, 'key'=>'one', 'title'=>'first row', 'status'=>'ACTIVE'), $this->conn->load(\"test\", 1, DB::FETCH_FULLARRAY), 'Using id=1');\n \t\n \t$this->assertNull($this->conn->load(\"test\", 99), 'Using id=99');\n }",
"private function loadBasicData()\n\t{\n\t\t$this->filename = basename($this->filepath);\n\t\t$this->title = $this->filename;\n\t\t$this->description = $this->filename;\n\t\t$this->mimetype = mime_content_type($this->filepath);\n\t\t$this->dateGathered = date('Y-m-d').'T'.date('h:i:s');\n\t\t$this->filesize = filesize($this->filepath);\n\n\t\t$this->data['path'] = $this->filepath;\n\t\t$this->data['name'] = basename($this->data['path']);\n\n\t\t$this->data['sizeExact'] = filesize($this->data['path']);\n\t\t$this->data['size'] = Utilities::filesizeInterpreter($this->data['sizeExact']);\n\n\t\t$this->data['accessDateExact'] = fileatime($this->data['path']);\n\t\t$this->data['accessDate'] = date(\"F d Y H:i:s.\", $this->data['accessDateExact']);\n\n\t\t$this->data['modifyDateExact'] = filemtime($this->data['path']);\n\t\t$this->data['modifyDate'] = date(\"F d Y H:i:s.\", $this->data['modifyDateExact']);\n\n\t\t$this->data['mimetype'] = mime_content_type($this->data['path']);\n\t\t$this->data['mimetypeType'] = explode(\"/\", $this->data['mimetype'])[0];\n\n\n\t}",
"public function testLoad() {\n $this->_loader->getSource('FilesystemTest.php');\n $this->_loader->getSource('FilesystemTest.php');\n\n $this->_loader->appendDir(dirname(__FILE__) . '/../Loader');\n $this->_loader->prependDir(dirname(__FILE__) . '/../Loader');\n }",
"protected function setUp(): void\n {\n parent::setUp();\n\n $this->load();\n }",
"protected function _load()\n {\n return array();\n }",
"public function load($data);",
"public static function loadFixture()\n {\n //include __DIR__ .'/../_files/customer.php';\n include __DIR__ .'/../_files/order_fee_variation.php';\n\n }",
"public function load() { }",
"abstract protected function load(): array;",
"public function testLoader()\n {\n $suiteCollection = new SuiteCollection(array(\n TestUtil::createSuite(array(\n 'subjects' => array('benchOne', 'benchTwo'),\n 'benchmarks' => array('BenchOne', 'BenchTwo'),\n 'groups' => array('one', 'two'),\n 'output_time_unit' => 'milliseconds',\n 'output_mode' => 'throughput',\n 'revs' => 5,\n 'warmup' => 2,\n 'sleep' => 9,\n 'env' => array(\n 'system' => array(\n 'os' => 'linux',\n 'memory' => 8096,\n 'distribution' => 'debian',\n ),\n 'vcs' => array(\n 'system' => 'git',\n 'branch' => 'foo',\n ),\n ),\n )),\n TestUtil::createSuite(),\n ));\n\n $this->persister->persist($suiteCollection);\n $suiteCollection = $this->loader->load(new Comparison('$in', 'run', array(1, 2)));\n\n $suites = $suiteCollection->getSuites();\n $this->assertCount(2, $suites);\n\n $suite = current($suites);\n\n // assert env information\n $envInformations = $suite->getEnvInformations();\n $this->assertCount(2, $envInformations);\n $this->assertEquals('system', $envInformations[0]->getName());\n $this->assertEquals(array(\n 'os' => 'linux',\n 'memory' => 8096,\n 'distribution' => 'debian',\n ), iterator_to_array($envInformations[0]));\n $this->assertEquals('vcs', $envInformations[1]->getName());\n\n // assert benchmarks\n $benchmarks = $suite->getBenchmarks();\n $this->assertCount(2, $benchmarks);\n $this->assertEquals('BenchOne', $benchmarks[0]->getClass());\n $this->assertEquals('BenchTwo', $benchmarks[1]->getClass());\n\n // assert subjects\n $subjects = array_values($benchmarks[0]->getSubjects());\n $this->assertCount(2, $subjects);\n $this->assertEquals('benchOne', $subjects[0]->getName());\n $this->assertEquals('benchTwo', $subjects[1]->getName());\n $subject = $subjects[0];\n $this->assertEquals(array('one', 'two'), $subject->getGroups());\n $this->assertEquals(5, $subject->getRevs());\n $this->assertEquals(2, $subject->getWarmup());\n $this->assertEquals(9, $subject->getSleep());\n $this->assertEquals('milliseconds', $subject->getOutputTimeUnit());\n $this->assertEquals('throughput', $subject->getOutputMode());\n\n // assert variants\n $variants = $subject->getVariants();\n $this->assertCount(1, $variants);\n $variant = current($variants);\n\n // assert iterations\n $iterations = $variant->getIterations();\n $this->assertCount(2, $iterations);\n $iteration = current($iterations);\n $this->assertEquals(10, $iteration->getTime());\n $this->assertEquals(200, $iteration->getMemory());\n }",
"protected function loadTreeData() {}",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"function getTestDataFromFile($file) {\n return require $file;\n}",
"public function test_loadVars_called_returnArrayWithProperData()\n {\n $expected = $this->getArrayContentTemplate();\n $emailTemplate = new EmailTemplate();\n $this->lotteryService->getNextJackpot('EuroMillions')->willReturn(new Money(10000,new Currency('EUR')));\n $this->lotteryService->getNextDateDrawByLottery('EuroMillions')->willReturn(new \\DateTime());\n\n\n $next_draw_day = new \\DateTime();\n $emailTemplateDataStrategy_double = $this->getInterfaceWebDouble('IEmailTemplateDataStrategy');\n $emailTemplateDataStrategy_double->getData(Argument::type('EuroMillions\\web\\interfaces\\IEmailTemplateDataStrategy'))->willReturn([]);\n $data = [\n 'jackpot_amount' => 100,\n 'draw_day_format_one' => $next_draw_day->format('l'),\n 'draw_day_format_two' => $next_draw_day->format('j F Y')\n ];\n $emailTemplateDataStrategy_double->getData($emailTemplateDataStrategy_double->reveal())->willReturn($data);\n $sut = new LowBalanceEmailTemplate($emailTemplate, $emailTemplateDataStrategy_double->reveal());\n $actual = $sut->loadVars($emailTemplateDataStrategy_double->reveal());\n $this->assertEquals($expected,$actual);\n\n }",
"public function getTestData()\n {\n return [\n 'user_id' => 1,\n 'status' => 1,\n 'created_at' => '2016-01-21 15:00:00',\n 'updated_at' => '2016-01-21 18:00:00'\n ];\n }",
"protected function loadData()\n\t{\n\t\t$delimiter = \"|||---|||---|||\";\n\t\t$command = 'show --pretty=format:\"%an'.$delimiter.'%ae'.$delimiter.'%cd'.$delimiter.'%s'.$delimiter.'%B'.$delimiter.'%N\" ' . $this->hash;\n\n\t\t$response = $this->repository->run($command);\n\n\t\t$parts = explode($delimiter,$response);\n\t\t$this->_authorName = array_shift($parts);\n\t\t$this->_authorEmail = array_shift($parts);\n\t\t$this->_time = array_shift($parts);\n\t\t$this->_subject = array_shift($parts);\n\t\t$this->_message = array_shift($parts);\n\t\t$this->_notes = array_shift($parts);\n\t}",
"protected function loadMetaData() {}",
"public function load()\n {\n }",
"public function load()\n {\n }",
"public function load()\n {\n }",
"public function load()\n {\n }",
"public function load()\n {\n }",
"public function setUp()\n {\n foreach (glob(__DIR__.'/../data/*.json') as $jsonFile) {\n if (basename($jsonFile) != 'json_output_test_json_fixed.json') {\n unlink($jsonFile);\n }\n }\n\n $this->data = [\n [1, 'PHP Developer', 'Mazen Kenjrawi'],\n [4, 'Dummy Classes', 'Foo Bar'],\n ];\n\n $this->headingFields = ['id', 'Title', 'Name'];\n\n $this->Loader = new Loader();\n }",
"function loadSampleData()\n{\n $moduleDirName = basename(dirname(__DIR__));\n $helper = Cellar\\Helper::getInstance();\n $utility = new Cellar\\Utility();\n $configurator = new Common\\Configurator();\n // Load language files\n $helper->loadLanguage('admin');\n $helper->loadLanguage('modinfo');\n $helper->loadLanguage('common');\n if (!$wineData = \\Xmf\\Yaml::readWrapped('wine.yml')) {\n throw new \\UnexpectedValueException('Could not read the win.yml file');\n }\n \\Xmf\\Database\\TableLoad::truncateTable($moduleDirName . '_wine');\n \\Xmf\\Database\\TableLoad::loadTableFromArray($moduleDirName . '_wine', (array)$wineData);\n\n // --- COPY test folder files ---------------\n if (count($configurator->copyTestFolders) > 0) {\n // $file = __DIR__ . ' /../testdata / images / ';\n foreach (array_keys($configurator->copyTestFolders) as $i) {\n $src = $configurator->copyTestFolders[$i][0];\n $dest = $configurator->copyTestFolders[$i][1];\n $utility::xcopy($src, $dest);\n }\n }\n redirect_header(' ../admin / index . php', 1, AM_CELLAR_SAMPLEDATA_SUCCESS);\n}",
"public function testLoad()\n {\n $this->rlpMapper->save($this->content1, '/products/news/content1-news', 'default', 'de');\n $this->sessionManager->getSession()->save();\n\n $result = $this->rlpMapper->loadByResourceLocator('/products/news/content1-news', 'default', 'de');\n $this->assertEquals($this->content1->getIdentifier(), $result);\n }",
"public function load()\n {\n }",
"public function load()\n {\n }",
"public function testLoad(): void\n {\n $this->document1->setResourceSegment('/products/news/content1-news');\n $this->phpcrMapper->save($this->document1);\n $this->sessionManager->getSession()->save();\n\n $result = $this->phpcrMapper->loadByResourceLocator('/products/news/content1-news', 'sulu_io', 'de');\n $this->assertEquals($this->document1->getUuid(), $result);\n }",
"public function loadData(){\r\n $this->host = Team::find($this->host);\r\n $this->guest = Team::find($this->guest);\r\n $this->winner = Team::find($this->winner);\r\n $this->tournament = Tournament::find($this->tournamentID); \r\n }",
"public function loadModuleData() {}",
"public function testLoad()\r\n\t{\r\n\t\t// Load table\r\n\t\t$table = Table::model()->findByPk(array(\r\n\t\t\t'TABLE_SCHEMA' => 'indextest',\r\n\t\t\t'TABLE_NAME' => 'table1',\r\n\t\t));\r\n\r\n\t\t// Check index count\r\n\t\t$this->assertEquals(4, count($table->indices));\r\n\r\n\t\t// Check index 1\r\n\t\t$index = $table->indices[0];\r\n\t\t$this->assertEquals($table->TABLE_NAME, $index->table->TABLE_NAME);\r\n\t\t$this->assertEquals('PRIMARY', $index->INDEX_NAME);\r\n\t\t$this->assertEquals('PRIMARY', $index->getType());\r\n\r\n\t\t// Check index 2\r\n\t\t$index = $table->indices[1];\r\n\t\t$this->assertEquals('unique', $index->INDEX_NAME);\r\n\t\t$this->assertEquals('UNIQUE', $index->getType());\r\n\r\n\t\t// Check index 2\r\n\t\t$index = $table->indices[2];\r\n\t\t$this->assertEquals('index', $index->INDEX_NAME);\r\n\t\t$this->assertEquals('INDEX', $index->getType());\r\n\r\n\t\t// Check index 2\r\n\t\t$index = $table->indices[3];\r\n\t\t$this->assertEquals('fulltext', $index->INDEX_NAME);\r\n\t\t$this->assertEquals('FULLTEXT', $index->getType());\r\n\t}",
"public function testData() {\n $subscription = $this->mockSubscription('test@example.com', (object) [\n 'fields' => [\n ['name' => 'FIRSTNAME'],\n ['name' => 'LASTNAME'],\n ],\n ]);\n\n // Test new item.\n list($cr, $api) = $this->mockProvider();\n $source1 = new ArraySource([\n 'firstname' => 'test',\n ]);\n $cr->method('getSource')->willReturn($source1);\n list($data, $fingerprint) = $cr->data($subscription, []);\n $this->assertEqual([\n 'FIRSTNAME' => 'test',\n ], $data);\n\n // Test item with existing data.\n list($cr, $api) = $this->mockProvider();\n $source2 = new ArraySource([\n 'lastname' => 'test',\n ]);\n $cr->method('getSource')->willReturn($source2);\n list($data, $fingerprint) = $cr->data($subscription, $data);\n $this->assertEqual([\n 'FIRSTNAME' => 'test',\n 'LASTNAME' => 'test',\n ], $data);\n }",
"public function testFixtureLoadOnDemand(): void\n {\n $this->loadFixtures('Categories');\n }",
"public function conversionTestingDataProvider() {}",
"public function __load();",
"public function setUp() {\r\n // and doing it every test slows the tests down to a crawl\r\n $this->sharedFixture = new MovieLensDataSet(DATA_DIR);\r\n }",
"public function _loadData()\n\t{\n\t\t$this->username = $this->_admin->username;\n\t\t$this->oldPassword = '';\n\t\t$this->last_name = $this->_admin->last_name;\n\t\t$this->first_name = $this->_admin->first_name;\n\t}",
"public function _fixtures()\n {\n return [\n\n 'base_date' => [\n 'class' => BaseDataFixture::class,\n 'dataFile' => codecept_data_dir() . 'base_data_data.php',\n ],\n\n ];\n }",
"abstract public function loadAll();",
"public function load() : array;",
"public function testReadFromMicrostorage()\n {\n }",
"public function testLoadBasic()\r\n\t\t{\r\n\t\t\tORM::init('mysql:host=localhost;dbname=rocket_orm', 'orm_username', 'orm_password');\r\n\t\t\t\r\n\t\t\t$user = User::load(1);\r\n\t\t\t\r\n\t\t\t$this->assertEquals($user->get('user_id'), '1');\r\n\t\t}",
"protected function setUpConfigurationData() {}",
"public function testData()\n {\n $img = new P4Cms_Image();\n $data = file_get_contents(TEST_ASSETS_PATH . '/images/luigi.png');\n $img->setData($data);\n\n if (extension_loaded('imagick')) {\n // no driver was specified so the driver should be an instance of\n // P4Cms_Image_Driver_Imagick\n $this->assertTrue(\n $img->getDriver() instanceof P4Cms_Image_Driver_Imagick,\n 'Expected driver to be instance of P4Cms_Image_Driver_Imagick.'\n );\n } else {\n $this->markTestIncomplete(\"Cannot verify default driver, 'imagick' extension not found.\");\n }\n\n $this->assertSame(\n $img->getImageSize(),\n array('width' => 516, 'height' => 710),\n 'Expected file at: ..assets/images/luigi.png to be 516x710 pixels.'\n );\n\n $newImg = new P4Cms_Image();\n $newImg->setData($data);\n\n // the data returned from getData() should be the same as what was set\n $this->assertSame(\n $newImg->getImageSize(),\n array('width' => 516, 'height' => 710),\n 'Expected image built from file: ..assets/images/luigi.png to be 516x710 pixels.'\n );\n }",
"public function test_loadVars_called_returnArrayWithProperData()\n {\n $expected = $this->getArrayContentTemplateJackpot();\n $emailTemplate = new EmailTemplate();\n $this->lotteryService->getNextDateDrawByLottery('EuroMillions')->willReturn(new \\DateTime());\n $this->lotteryService->getNextJackpot('EuroMillions')->willReturn(new Money((int) 10000, new Currency('EUR')));\n $sut = new JackpotRolloverEmailTemplate($emailTemplate, new JackpotDataEmailTemplateStrategy($this->lotteryService->reveal()) );\n $sut->setUser($this->getUser());\n $sut->setThresholdAmount(1000000);\n $actual = $sut->loadVars();\n $this->assertEquals($expected,$actual);\n }",
"protected static function getData()\n {\n }",
"public function testIsModelSavingDataToDatabase()\n {\n $modelId = $this->saveTestData();\n $newModel = $this->model->load($modelId);\n $testData = $this->getTestData();\n $newModelData = [];\n foreach (array_keys($testData) as $key) {\n $newModelData[$key] = $newModel->getData($key);\n }\n $this->assertEquals($testData, $newModelData);\n }",
"public function testGetData()\n {\n $this->getWeather->setUrl();\n $result = $this->getWeather->getData();\n\n $this->assertIsArray($result);\n }",
"public function _fixtures()\n {\n return [\n 'user' => [\n 'class' => BookFixture::class,\n 'dataFile' => codecept_data_dir() . 'book.php'\n ],\n ];\n }",
"public function testLoadWithCollection() {\n\t\t$options = $this->_loadOptions;\n\t\t$posts = Fixture::load('models/Posts', $options);\n\t\t$this->_testLoad($posts);\n\t}",
"abstract protected function getFixtures();",
"public function loadData()\n {\n $this->sendApiCall(self::ACTION_RETRIEVE, $this->getCreateUrl());\n }",
"public function testLoadReturnsCorrectDataWithExceptionsThrownByDataLoaders(): void\n {\n $this->prepareVFSDirectoryStructure();\n $fullPath = $this->getFullPath('container');\n $expectedFilesMap = ['FileSecond' => 'first/file_second.exe', 'SomeExt' => 'some_ext.exe'];\n $expectedLoadData = ['FileSecond' => ['param1' => 'with_value'], 'SomeExt' => ['param2' => 'without_value']];\n $expectedExceptions =\n array_fill_keys([\"$fullPath/first/file_first.exe\", \"$fullPath/second/file_third.exe\"], new Exception());\n $dataLoaderMockCallbackParams = [$fullPath, $expectedFilesMap, $expectedLoadData, $expectedExceptions];\n $dataLoaderMockCallback = $this->prepareDataLoaderMockCallbackWithExceptions(...$dataLoaderMockCallbackParams);\n $directoryDataLoader = $this->prepareDirectoryDataLoader($dataLoaderMockCallback);\n\n $actualLoadData = $directoryDataLoader->load($fullPath, '/^.*\\.exe$/');\n\n static::assertArraysAreSame($expectedLoadData, $actualLoadData);\n }",
"public function load()\n {\n return $this->loadData();\n }",
"protected function setUp()\n {\n parent::setUp();\n $this->testData = ['test' => 'test'];\n }",
"private function loadTestcases() {\n $submitter_id = $this->graded_gradeable->getSubmitter()->getId();\n $gradeable = $this->graded_gradeable->getGradeable();\n $course_path = $this->core->getConfig()->getCoursePath();\n $config = $gradeable->getAutogradingConfig();\n\n $results_path = FileUtils::joinPaths($course_path, 'results', $gradeable->getId(), $submitter_id, $this->version);\n $results_public_path = FileUtils::joinPaths($course_path, 'results_public', $gradeable->getId(), $submitter_id, $this->version);\n\n // Load files produced by autograding\n $result_files = FileUtils::getAllFiles($results_path, [], true);\n foreach ($result_files as $file => $details) {\n $this->results_files[$file] = $details;\n }\n\n $result_public_files = FileUtils::getAllFiles($results_public_path, [], true);\n foreach ($result_public_files as $file => $details) {\n $this->results_public_files[$file] = $details;\n }\n\n // Load file that contains numeric results\n $result_details = FileUtils::readJsonFile(FileUtils::joinPaths($results_path, 'results.json'));\n if ($result_details === false) {\n // Couldn't find the file, so grading hasn't happened yet...\n $this->graded_testcases = [];\n return;\n }\n\n $queue_file = FileUtils::readJsonFile(FileUtils::joinPaths($results_path, 'queue_file.json'));\n if ($queue_file !== false && array_key_exists('which_machine', $queue_file)) {\n $this->autograder_machine = $queue_file['which_machine'];\n }\n\n // Load the historical results (for early submission incentive)\n $history = FileUtils::readJsonFile(FileUtils::joinPaths($results_path, 'history.json'));\n if ($history !== false) {\n $this->history = array_map(function ($data) {\n return new AutoGradedVersionHistory($this->core, $data);\n }, $history);\n }\n\n\n // Load the testcase results (and calculate early incentive points)\n if (!is_null($config)) {\n foreach ($config->getPersonalizedTestcases($submitter_id) as $testcase) {\n if (!isset($result_details['testcases'][$testcase->getIndex()])) {\n // TODO: Autograding results file was incomplete. This is a big problem, but how should\n // TODO: we handle this error\n }\n if (\n $result_details != null\n && count($result_details['testcases']) > $testcase->getIndex()\n && $result_details['testcases'][$testcase->getIndex()] != null\n ) {\n $graded_testcase = new AutoGradedTestcase(\n $this->core,\n $testcase,\n $results_path,\n $results_public_path,\n $result_details['testcases'][$testcase->getIndex()]\n );\n $this->graded_testcases[$testcase->getIndex()] = $graded_testcase;\n if (in_array($testcase, $config->getEarlySubmissionTestCases())) {\n $this->early_incentive_points += $graded_testcase->getPoints();\n }\n }\n }\n }\n }",
"private function loadReadDataIntoMDR() {\r\n \r\n }",
"public function provideTestLoadsOfFiles()\n {\n AutoloaderTestHelper::deleteDirectory(\"testLoadsOfFiles\");\n $alTestHelper = new AutoloaderTestHelper($this);\n\n for ($i = 0; $i < 150; $i++) {\n $alTestHelper->makeClass(\"anyClass\", \"testLoadsOfFiles/flat\");\n\n }\n\n for ($i = 0; $i < 150; $i++) {\n $alTestHelper->makeClass(\n \"anyClass\", \"testLoadsOfFiles\" . str_repeat('/sub', $i)\n );\n\n }\n\n return array(\n array(\n new AutoloaderFileIterator_PriorityList(),\n \"testLoadsOfFiles/flat\"\n ),\n array(\n new AutoloaderFileIterator_Simple(),\n \"testLoadsOfFiles/flat\"\n ),\n array(\n new AutoloaderFileIterator_SimpleCached(),\n \"testLoadsOfFiles/flat\"\n ),\n array(\n new AutoloaderFileIterator_PriorityList(),\n \"testLoadsOfFiles/sub\"\n ),\n array(\n new AutoloaderFileIterator_Simple(),\n \"testLoadsOfFiles/sub\"\n ),\n array(\n new AutoloaderFileIterator_SimpleCached(),\n \"testLoadsOfFiles/sub\"\n )\n );\n }",
"public function testLoad()\n {\n $this->_access->load('gir', array('bar'));\n $this->diag($this->_access->list);\n \n // simply test there's correct amount of acl rows\n $actual = count($this->_access->list);\n $expect = 1;\n $this->assertEquals($actual, $expect);\n }",
"function testLoadMetadata() {\n $v = $this->loadMovie(\"FakeMovie1/FakeMovie1.mp4\");\n $v->loadMetadata(true);\n\n $this->assertEqual($v->title, \"Fake Movie 1\");\n $this->assertEqual($v->plot, \"This is the plot for the fake movie 1.\");\n $this->assertEqual($v->year, \"1992-11-25\");\n $this->assertEqual($v->mpaa, \"PG\");\n $this->assertEqual(count($v->actorList), 3);\n\n $v = $this->loadMovie(\"BarrenMovie/BarrenMovie.mp4\");\n $this->assertEqual($v->title, \"BarrenMovie\");\n $this->assertEqual($v->plot, \"\");\n $this->assertEqual($v->year, \"\");\n $this->assertEqual($v->mpaa, \"N/A\");\n $this->assertEqual(count($v->actorList), 0);\n }",
"public function load(): void;",
"public function load(): void;",
"public function load()\n {\n $input = $this->getCleanInput();\n $this->populate($input);\n }",
"public function setUp()\n\t{\n\t\tparent::setUp();\n if(is_array($this->fixtures)){\n foreach($this->fixtures as $fixtureName=>$modelClass)\n {\n $tableName=WF_Table::model($modelClass)->tableName();\n $this->resetTable($tableName);\n $rows=$this->loadFixtures($modelClass, $tableName);\n if(is_array($rows) && is_string($fixtureName))\n {\n $this->_rows[$fixtureName]=$rows;\n if(isset($modelClass))\n {\n foreach(array_keys($rows) as $alias)\n $this->_records[$fixtureName][$alias]=$modelClass;\n }\n }\n }\n }\n }",
"public function testReadAll()\n {\n }",
"private function loadData() {\n // If the file does not yet exists we cancel immediately\n if (!file_exists(DATA_FILE)) return;\n\n // Grab all the contents from the file\n $data = file_get_contents(DATA_FILE);\n // And convert it to a json object\n $data = json_decode($data);\n\n // If something went wrong with decoding we cancel\n if ($data == false) return;\n\n // Store our information in our object\n $this->accessToken = $data->accessToken;\n $this->expirationDate = $data->expirationDate;\n $this->refreshToken = $data->refreshToken;\n }",
"abstract protected function loadFields();"
] | [
"0.7357341",
"0.68124354",
"0.67742395",
"0.67742395",
"0.67742395",
"0.6700625",
"0.65999746",
"0.65756214",
"0.6527443",
"0.6527443",
"0.6527443",
"0.6527443",
"0.65109664",
"0.65109664",
"0.6455664",
"0.64220345",
"0.64166003",
"0.6400629",
"0.63900745",
"0.6360639",
"0.6356973",
"0.63460237",
"0.6288102",
"0.6263481",
"0.6239777",
"0.6216981",
"0.6189959",
"0.6166321",
"0.6162768",
"0.6144178",
"0.61412793",
"0.6110317",
"0.6086492",
"0.60374093",
"0.60374093",
"0.60374093",
"0.60374093",
"0.60374093",
"0.60374093",
"0.60374093",
"0.60374093",
"0.60374093",
"0.60374093",
"0.60374093",
"0.60374093",
"0.60374093",
"0.60336363",
"0.6001597",
"0.59734154",
"0.59705865",
"0.5963031",
"0.5955253",
"0.59551877",
"0.5954373",
"0.5954373",
"0.5954373",
"0.59529424",
"0.59398353",
"0.5938959",
"0.5932348",
"0.5932348",
"0.5922418",
"0.592023",
"0.5897698",
"0.5883454",
"0.5847368",
"0.58469445",
"0.5846765",
"0.58418876",
"0.5838072",
"0.5836211",
"0.58115125",
"0.58105505",
"0.58045137",
"0.5797081",
"0.57969236",
"0.57828206",
"0.5771447",
"0.5771293",
"0.577084",
"0.57695836",
"0.5767379",
"0.5766286",
"0.5761851",
"0.5756428",
"0.57532007",
"0.57374084",
"0.57342345",
"0.56929654",
"0.5679795",
"0.5674663",
"0.56746256",
"0.5671805",
"0.56670535",
"0.5666017",
"0.5666017",
"0.5663627",
"0.5658823",
"0.5652247",
"0.5652068",
"0.564545"
] | 0.0 | -1 |
Checks that method _load_ returns array combined from arrays returned from data loaders' method _load_. | public function testLoadReturnsResultOfLoadOfDataLoaders(string $path, string $filenameRegExp, array $expectedFilesMap, array $expectedLoadData): void
{
$this->prepareVFSDirectoryStructure();
$fullPath = $this->getFullPath($path);
$dataLoaderMockCallback = $this->prepareDataLoaderMockCallback($fullPath, $expectedFilesMap, $expectedLoadData);
$directoryDataLoader = $this->prepareDirectoryDataLoader($dataLoaderMockCallback);
$actualLoadData = $directoryDataLoader->load($fullPath, $filenameRegExp);
static::assertArraysAreSame($expectedLoadData, $actualLoadData);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract protected function load(): array;",
"public function load() : array;",
"protected function _load()\n {\n return array();\n }",
"public function loaded()\n {\n return is_array($this->data);\n }",
"abstract public function loadData();",
"public function load(array $data);",
"private function loadArray(){\n if(file_exists($this->fullPath.$this->arrayFile)){\n include_once($this->fullPath.$this->arrayFile);\n if(!empty($arCfg)){\n $this->loadConfigs($arCfg);\n }\n }\n }",
"public function testLoad()\n {\n $struct = $this->_newStruct();\n $expect = array(\n 'foo' => 'bar2',\n 'baz' => 'dib2',\n 'zim' => 'gir2',\n 'irk' => array(\n 'subfoo' => 'subbar2',\n 'subbaz' => 'subdib2',\n 'subzim' => 'subgir2',\n ),\n );\n $struct->load($expect);\n $actual = $struct->toArray();\n $this->assertSame($actual, $expect);\n }",
"abstract public function getArray();",
"protected abstract function getData(): array;",
"public function isEnableArrayLoader()\n {\n return $this->enableArrayLoader;\n }",
"public function getLoad();",
"public abstract function FetchArray();",
"public function getLoads() : array\n {\n return $this->loads;\n }",
"abstract protected function load();",
"abstract protected function load();",
"abstract protected function load();",
"abstract protected function load();",
"abstract public function loadAll();",
"public function testToArrayMethod()\n {\n $this->assertEquals(self::$testData, $this->resource->toArray(),\n 'toArray() does not return array');\n }",
"public function overload()\n {\n return $this->loadData(true);\n }",
"public function testLoad()\n {\n \t$this->assertEquals(array('id'=>1, 'key'=>'one', 'title'=>'first row', 'status'=>'ACTIVE'), $this->conn->load(\"test\", 1, DB::FETCH_ASSOC), 'Using id=1');\n \t$this->assertEquals(array('id'=>3, 'key'=>'three', 'title'=>'another row', 'status'=>'PASSIVE'), $this->conn->load(\"test\", array('key'=>'three'), DB::FETCH_ASSOC), 'Using id=array(\"key\"=>\"three\")');\n\n \t$this->assertEquals(array(1, 'one', 'first row', 'ACTIVE'), $this->conn->load(\"test\", 1, DB::FETCH_ORDERED), 'Using id=1');\n \t$this->assertEquals(array(1, 'one', 'first row', 'ACTIVE', 'id'=>1, 'key'=>'one', 'title'=>'first row', 'status'=>'ACTIVE'), $this->conn->load(\"test\", 1, DB::FETCH_FULLARRAY), 'Using id=1');\n \t\n \t$this->assertNull($this->conn->load(\"test\", 99), 'Using id=99');\n }",
"public function load()\n {\n return $this->loadData();\n }",
"public function getInternalArray() {}",
"public function read(): array\n {\n }",
"public function read(): array\n {\n }",
"public function read(): array;",
"abstract protected function getTestData() : array;",
"abstract public function load();",
"abstract public function load();",
"public function load(string $path): array;",
"public function getData() : array;",
"public function getData() : array;",
"protected function lookupData()\n\t{\n\t\t//nope, load it normally.\n\t\t$data = $this->getData(true);\n\t\tif (count($data) && is_array($data))\n\t\t\n\t\tif (!empty($data))\n\t\t\t$this->hydrate($data);\n\t}",
"public abstract function load();",
"abstract public function getTestData(): array;",
"public function getData(): array;",
"public function getData(): array;",
"public function getData(): array;",
"public function getData(): array;",
"public function get_data(): array;",
"public function get_data(): array;",
"function load_data()\n \t{\n \t\t\n \t\t$return=parent::load_data();\t\n \t\t$this->images_array=t3lib_div::trimExplode(',',$this->images);\n \t\t$this->teaserImagesArray=t3lib_div::trimExplode(',',$this->teaserimages);\n \t\treturn $return;\n \t}",
"public function load($sources): array;",
"protected function initializeResultArray() {}",
"protected abstract function getSourceDataAsArray(): ?array;",
"public static function grabAllLoad()\n {\n \n $load = Load::all();\n\n foreach ($load as $key => $value) {\n $load[$key] = $value->to_array();\n }\n\n return $load;\n }",
"abstract protected function toArray();",
"public function importArray($data);",
"public static function load(): array\n {\n $data = [];\n if($storage_data = @file_get_contents(self::$path.self::$filename)) {\n $data = unserialize($storage_data);\n } \n\n return $data;\n }",
"public function testLoadReturnsCorrectDataWithExceptionsThrownByDataLoaders(): void\n {\n $this->prepareVFSDirectoryStructure();\n $fullPath = $this->getFullPath('container');\n $expectedFilesMap = ['FileSecond' => 'first/file_second.exe', 'SomeExt' => 'some_ext.exe'];\n $expectedLoadData = ['FileSecond' => ['param1' => 'with_value'], 'SomeExt' => ['param2' => 'without_value']];\n $expectedExceptions =\n array_fill_keys([\"$fullPath/first/file_first.exe\", \"$fullPath/second/file_third.exe\"], new Exception());\n $dataLoaderMockCallbackParams = [$fullPath, $expectedFilesMap, $expectedLoadData, $expectedExceptions];\n $dataLoaderMockCallback = $this->prepareDataLoaderMockCallbackWithExceptions(...$dataLoaderMockCallbackParams);\n $directoryDataLoader = $this->prepareDirectoryDataLoader($dataLoaderMockCallback);\n\n $actualLoadData = $directoryDataLoader->load($fullPath, '/^.*\\.exe$/');\n\n static::assertArraysAreSame($expectedLoadData, $actualLoadData);\n }",
"public function get() : array;",
"public function provider_load() {\n return array(\n array(\n 'text',// Field.\n array(// Post.\n 'text' => 'test',\n ),\n 'test', // Expected.\n ),\n );\n }",
"public function load() \n\t{\n\t\tif (is_null ( $this->getDataFile () )) \n\t\t{\n\t\t\tthrow new Exception ( 'Data File is not set' );\n\t\t}\n\t\t\n\t\tif (!file_exists($this->getDataFile()))\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn json_decode(file_get_contents($this->getDataFile()));\n\t\t}\n\t}",
"function getArray();",
"public function getAsArray();",
"function load() {\r\n\t\t$this->log .= \"load() called<br />\";\r\n\t\tif (!file_exists($this->filename)) {\r\n\t\t\t$this->log .= $this->filename.\" does not exist.<br />\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (!$x = @file_get_contents($this->filename)) {\r\n\t\t\t$this->log .= \"Could not read \".$this->filename.\"<br />\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (!$this->data = unserialize($x)) {\r\n\t\t\t$this->log .= \"unserialize failed<br />\";\r\n\t\t\t$this->data = array();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\treturn true;\r\n\t\t}",
"abstract protected function collectionLoader();",
"public function validArrayForArrayConfigurationProvider() {}",
"public function inArrayDataProvider() {}",
"private function _getData():array {\n\n # Set result\n $result = [];\n\n # Return result\n return $result;\n\n }",
"public static function loadAll();",
"protected function _load()\n\t{\n\t\t$_file = $this->_storagePath . DIRECTORY_SEPARATOR . $this->_fileName;\n\n\t\tif ( is_file( $_file ) && file_exists( $_file ) && is_readable( $_file ) )\n\t\t{\n\t\t\tif ( false !== ( $_data = Utility\\Storage::defrost( file_get_contents( $_file ) ) ) )\n\t\t\t{\n\t\t\t\t//\tIf it wasn't frozen, a JSON string may be returned\n\t\t\t\tif ( is_string( $_data ) && false !== json_decode( $_data ) )\n\t\t\t\t{\n\t\t\t\t\t$_data = json_decode( $_data, true );\n\t\t\t\t}\n\n\t\t\t\t$this->merge( $_data );\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"function load() {\n\t\tif (!$this->_load_action || $this->_loaded) return false;\n\n\t\t$this->_loaded = true;\n\n\t\t$data = $this->_request_data($this->_load_action);\n\n\t\tif (!$data) return false;\n\n\t\t$this->_parse_data($data);\n\n\t\treturn true;\n\n\t}",
"public function getCalculatedData(): array\n\t{\n\t\t$result = parent::getCalculatedData(); // return mixed value in base method\n\n\t\treturn is_array($result) ? $result : [];\n\t}",
"public function fetchArray();",
"public function fetchArray();",
"protected function initializeCompatibilityLoadedExtArray() {}",
"public function checkIfCanLoad()\r\n\t{\r\n\t\treturn true;\r\n\t}",
"public function get(): array;",
"public function get(): array;",
"public function testImportDataValidationArray()\n {\n $this->commonNamespaces->add('foo', 'http://foo/');\n\n $selectAll = 'SELECT * FROM <'. $this->testGraph .'> WHERE {?s ?p ?o.}';\n\n $startResource = $this->nodeFactory->createNamedNode($this->testGraph .'res1');\n\n $this->assertCountStatementIterator(0, $this->store->query($selectAll));\n\n $this->fixture->importDataValidationArray(\n array(\n 'rdf:type' => 'foo:User',\n 'foo:has-rights' => array(\n array(\n 'rdfs:label' => 'foo',\n 'foo:knows' => array(\n 'http://rdf/type' => 'http://foaf/Person'\n )\n ),\n array(\n 'rdfs:label' => 'bar',\n 'foo:a-number' => 43\n )\n )\n ),\n $startResource,\n $this->testGraph\n );\n\n $this->assertCountStatementIterator(8, $this->store->query($selectAll));\n\n // get referenced blank node\n $result = $this->store->query('SELECT * FROM <'. $this->testGraph .'> WHERE {<'.$startResource.'> ?p ?o.}');\n $blankNode1 = array_values($result->getArrayCopy())[1]['o'];\n $blankNode2 = array_values($result->getArrayCopy())[2]['o'];\n\n $result = $this->store->query('SELECT * FROM <'. $this->testGraph .'> WHERE {<'.$blankNode1.'> ?p ?o.}');\n $blankNode3 = $result->getArrayCopy()[1]['o'];\n\n // expect\n $expectedResult = new SetResultImpl(array(\n array(\n 's' => $startResource,\n 'p' => $this->nodeFactory->createNamedNode($this->commonNamespaces->getUri('rdf') .'type'),\n 'o' => $this->nodeFactory->createNamedNode($this->commonNamespaces->getUri('foo') .'User')\n ),\n // has-rights entry 1\n array(\n 's' => $startResource,\n 'p' => $this->nodeFactory->createNamedNode($this->commonNamespaces->getUri('foo') .'has-rights'),\n 'o' => $blankNode1\n ),\n array(\n 's' => $blankNode1,\n 'p' => $this->nodeFactory->createNamedNode($this->commonNamespaces->getUri('rdfs') .'label'),\n 'o' => $this->nodeFactory->createLiteral('foo')\n ),\n array(\n 's' => $blankNode1,\n 'p' => $this->nodeFactory->createNamedNode($this->commonNamespaces->getUri('foo') .'knows'),\n 'o' => $blankNode3\n ),\n // sub reference\n array(\n 's' => $blankNode3,\n 'p' => $this->nodeFactory->createNamedNode('http://rdf/type'),\n 'o' => $this->nodeFactory->createNamedNode('http://foaf/Person')\n ),\n // has-rights entry 2\n array(\n 's' => $startResource,\n 'p' => $this->nodeFactory->createNamedNode($this->commonNamespaces->getUri('foo') .'has-rights'),\n 'o' => $blankNode2\n ),\n array(\n 's' => $blankNode2,\n 'p' => $this->nodeFactory->createNamedNode($this->commonNamespaces->getUri('rdfs') .'label'),\n 'o' => $this->nodeFactory->createLiteral('bar')\n ),\n array(\n 's' => $blankNode2,\n 'p' => $this->nodeFactory->createNamedNode($this->commonNamespaces->getUri('foo') .'a-number'),\n 'o' => $this->nodeFactory->createLiteral('43')\n ),\n ));\n $expectedResult->setVariables(array('s', 'p', 'o'));\n\n $this->assertSetIteratorEquals(\n $expectedResult,\n $this->store->query($selectAll)\n );\n }",
"private function markLoaded () {\n\t\t$arguments = func_get_args();\n\t\t$arguments = array_flatten($arguments);\n\n\t\t// Starting point\n\t\t$current = $this->get('loaded');\n\t\tif ($current === null) {\n\t\t\t$current = array();\n\t\t}\n\n\t\treturn $this->set('loaded', array_merge($current, $arguments));\n\t}",
"protected function loadData($overload = false)\n {\n $this->initialize($overload);\n\n return $this->loader->load();\n }",
"public function testBasicToArrayVoid() {\n\t\t$result = $this->entity->toArray(true);\n\t\t\n\t\t$this->assertInternalType('array', $result);\n\t\t$this->assertTrue(sizeof($result) > 0);\n\t}",
"public function &getLocalFilesLoaded() {\n\t\tstatic $array = null;\n\t\tif ($array==null) {\n\t\t\t$array = $this->ajapCoreFiles;\n\t\t\tforeach ($this->objectWriters as &$objectWriter) {\n\t\t\t\t$array = array_merge($array,$objectWriter->getLocalFilesLoaded());\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $array;\n\t}",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"abstract public function toArray();",
"abstract public function toArray();",
"abstract public function toArray();",
"abstract public function toArray();",
"abstract public function toArray();",
"protected function loadData(){\n\t\t//SELECT from \".self::TABLE_NAME.\"_data WHERE \".self::TABLE_NAME.\"_id=\".$this->id.\"\n\t\t\n\t\t//return the data\n\t\treturn array();\n\t}",
"public function get(): array {\n\n if ($this->options['evaluation'] === false) {\n // Look for previous training and prediction files we generated and couldn't be used\n // by machine learning backends because they weren't big enough.\n\n $pendingfiles = \\core_analytics\\dataset_manager::get_pending_files($this->modelid, $this->includetarget,\n array_keys($this->filesbytimesplitting));\n foreach ($pendingfiles as $timesplittingid => $files) {\n foreach ($files as $file) {\n $this->filesbytimesplitting[$timesplittingid][] = $file;\n }\n }\n }\n\n // We join the datasets by time splitting method.\n $timesplittingfiles = array();\n foreach ($this->filesbytimesplitting as $timesplittingid => $files) {\n\n if ($this->options['evaluation'] === true) {\n // Delete the previous copy. Only when evaluating.\n \\core_analytics\\dataset_manager::delete_previous_evaluation_file($this->modelid, $timesplittingid);\n }\n\n // Merge all course files into one.\n if ($this->includetarget) {\n $filearea = \\core_analytics\\dataset_manager::LABELLED_FILEAREA;\n } else {\n $filearea = \\core_analytics\\dataset_manager::UNLABELLED_FILEAREA;\n }\n $timesplittingfiles[$timesplittingid] = \\core_analytics\\dataset_manager::merge_datasets($files,\n $this->modelid, $timesplittingid, $filearea, $this->options['evaluation']);\n }\n\n if (!empty($pendingfiles)) {\n // We must remove them now as they are already part of another dataset.\n foreach ($pendingfiles as $timesplittingid => $files) {\n foreach ($files as $file) {\n $file->delete();\n }\n }\n }\n\n return $timesplittingfiles;\n }",
"public function makeArray() {\n\t\tif ( $this->file == '' ) {\n\t\t\tif ( $this->rawdata == '' ) {\n\t\t\t\techo \"No filename specified, aborting\";\n\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\tif ( ! file_exists( $this->file ) ) {\n\t\t\t\techo \"File $this->file does not exist, aborting\";\n\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\t$this->rawdata = file_get_contents( $this->file );\n\t\t\t}\n\t\t}\n\n\t\tif ( $this->rawdata == '' ) {\n\t\t\techo \"No data in file, aborting\";\n\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->parse2array();\n\n\t\treturn true;\n\t}",
"public function __load();",
"public function getProcessedData(): object|array;",
"public function overLoad()\n {\n $loader = new Loader($this->filePath, false);\n return $loader->load();\n }",
"public function result() : array;"
] | [
"0.73180246",
"0.7026126",
"0.68491983",
"0.66283596",
"0.6205293",
"0.6041006",
"0.5980546",
"0.59709144",
"0.5950842",
"0.59474516",
"0.58296406",
"0.5827969",
"0.57729363",
"0.5753817",
"0.56466377",
"0.56466377",
"0.56466377",
"0.56466377",
"0.5643907",
"0.5623824",
"0.5596244",
"0.55610514",
"0.5524339",
"0.5513148",
"0.54997575",
"0.54997575",
"0.54781526",
"0.5475318",
"0.5462615",
"0.5462615",
"0.5460962",
"0.54539686",
"0.54539686",
"0.5452516",
"0.54272324",
"0.5425465",
"0.5415296",
"0.5415296",
"0.5415296",
"0.5415296",
"0.54150605",
"0.54150605",
"0.54082245",
"0.54073197",
"0.539961",
"0.5392299",
"0.53688306",
"0.53675634",
"0.5357779",
"0.5350805",
"0.53430057",
"0.53163105",
"0.530674",
"0.52994174",
"0.52916247",
"0.52834165",
"0.5283116",
"0.5278887",
"0.5276538",
"0.5269679",
"0.5253909",
"0.5229453",
"0.522495",
"0.52201134",
"0.52080184",
"0.51944554",
"0.51944554",
"0.5190257",
"0.5181094",
"0.51731676",
"0.51731676",
"0.51698375",
"0.516112",
"0.51381356",
"0.5135094",
"0.51338077",
"0.51211447",
"0.51211447",
"0.51211447",
"0.51211447",
"0.51211447",
"0.51211447",
"0.51211447",
"0.51211447",
"0.51211447",
"0.51211447",
"0.51211447",
"0.51211447",
"0.51211447",
"0.5109089",
"0.5109089",
"0.5109089",
"0.5109089",
"0.5109089",
"0.5104452",
"0.50982213",
"0.509361",
"0.5092931",
"0.5088877",
"0.5085449",
"0.5085396"
] | 0.0 | -1 |
Checks that method _load_ returns loading results even if errors occurred during processing of some files. | public function testLoadReturnsCorrectDataWithExceptionsThrownByDataLoaders(): void
{
$this->prepareVFSDirectoryStructure();
$fullPath = $this->getFullPath('container');
$expectedFilesMap = ['FileSecond' => 'first/file_second.exe', 'SomeExt' => 'some_ext.exe'];
$expectedLoadData = ['FileSecond' => ['param1' => 'with_value'], 'SomeExt' => ['param2' => 'without_value']];
$expectedExceptions =
array_fill_keys(["$fullPath/first/file_first.exe", "$fullPath/second/file_third.exe"], new Exception());
$dataLoaderMockCallbackParams = [$fullPath, $expectedFilesMap, $expectedLoadData, $expectedExceptions];
$dataLoaderMockCallback = $this->prepareDataLoaderMockCallbackWithExceptions(...$dataLoaderMockCallbackParams);
$directoryDataLoader = $this->prepareDirectoryDataLoader($dataLoaderMockCallback);
$actualLoadData = $directoryDataLoader->load($fullPath, '/^.*\.exe$/');
static::assertArraysAreSame($expectedLoadData, $actualLoadData);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _load()\n\t{\n\t\t$_file = $this->_storagePath . DIRECTORY_SEPARATOR . $this->_fileName;\n\n\t\tif ( is_file( $_file ) && file_exists( $_file ) && is_readable( $_file ) )\n\t\t{\n\t\t\tif ( false !== ( $_data = Utility\\Storage::defrost( file_get_contents( $_file ) ) ) )\n\t\t\t{\n\t\t\t\t//\tIf it wasn't frozen, a JSON string may be returned\n\t\t\t\tif ( is_string( $_data ) && false !== json_decode( $_data ) )\n\t\t\t\t{\n\t\t\t\t\t$_data = json_decode( $_data, true );\n\t\t\t\t}\n\n\t\t\t\t$this->merge( $_data );\n\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"abstract protected function load();",
"abstract protected function load();",
"abstract protected function load();",
"abstract protected function load();",
"function load() {\r\n\t\t$this->log .= \"load() called<br />\";\r\n\t\tif (!file_exists($this->filename)) {\r\n\t\t\t$this->log .= $this->filename.\" does not exist.<br />\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (!$x = @file_get_contents($this->filename)) {\r\n\t\t\t$this->log .= \"Could not read \".$this->filename.\"<br />\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (!$this->data = unserialize($x)) {\r\n\t\t\t$this->log .= \"unserialize failed<br />\";\r\n\t\t\t$this->data = array();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\treturn true;\r\n\t\t}",
"public function checkIfCanLoad()\r\n\t{\r\n\t\treturn true;\r\n\t}",
"public abstract function load();",
"protected function _load()\n {\n return array();\n }",
"abstract public function load();",
"abstract public function load();",
"function load() {\n $this->log .= \"load() called<br />\";\n if (!file_exists($this->filename)) {\n $this->log .= $this->filename.\" does not exist.<br />\";\n return false;\n }\n if (!$x = @file_get_contents($this->filename)) {\n $this->log .= \"Could not read \".$this->filename.\"<br />\";\n return false;\n }\n if (!$this->data = unserialize($x)) {\n $this->log .= \"unserialize failed<br />\";\n $this->data = array();\n return false;\n }\n touch($this->filename);\n return true;\n }",
"public function __doLoad()\n {\n $strSQL = $this->getSelectSql();\n $_SESSION[\"logger\"]->info(\"__doLoad: \" . $strSQL);\n\n $result = $this->query($strSQL);\n $_SESSION[\"logger\"]->info(\"Results: \" . $this->rowCount($result));\n if ($result && $this->rowCount($result) > 0) {\n $this->exists = true;\n $this->dxHashToClass($this->torecord($result));\n } else {\n $this->exists = false;\n }\n }",
"public function overLoad()\n {\n $loader = new Loader($this->filePath, false);\n return $loader->load();\n }",
"function load() {\n\t\tif (!$this->_load_action || $this->_loaded) return false;\n\n\t\t$this->_loaded = true;\n\n\t\t$data = $this->_request_data($this->_load_action);\n\n\t\tif (!$data) return false;\n\n\t\t$this->_parse_data($data);\n\n\t\treturn true;\n\n\t}",
"private function loadFile()\n\t{\n\t\tif( empty($this->content) ) {\n\t\t\tif( empty($this->file) ) {\n\t\t\t\tthrow new Exception('Which file should I parse, you ...!');\n\t\t\t} else {\n\t\t\t\tif( strtolower( $this->file->getExtension() ) == 'zip' ) {\n\t\t\t\t\t$this->content = $this->handleZipFile( $this->file );\n\t\t\t\t} else {\n\t\t\t\t\t$this->content = $this->file->getContents();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"protected function handleLoad()\n\t{\n\n\t\t/*\n\t\t*\tif safe mode or open_basedir is set, skip to using file_get_contents\n\t\t*\t(fixes \"CURLOPT_FOLLOWLOCATION cannot be activated\" curl_setopt error)\n\t\t*/\n\t\tif(ini_get('safe_mode') || ini_get('open_basedir'))\n\t\t{\n\t\t\t// do nothing (will pass on to getPafeFile/get_file_contents as isset($curlHtml) will fail)\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// load the page\n\t\t\t$this->getPageCurl();\n\n\t\t\t// parse the returned html for the data we want\n\t\t\t$curlHtml = $this->parseHtml();\n\t\t}\n\n\t\t// see if curl managed to get data\n\t\t// if not, try with get_file_contents\n\t\tif (isset($curlHtml) && !empty($curlHtml['name']) && !empty($curlHtml['count']) && !empty($curlHtml['img']))\n\t\t{\n\t\t\treturn $curlHtml;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// try loading with file_get_contents instead\n\t\t\t$this->getPageFile();\n\n\t\t\t// parse\n\t\t\t$data = $this->parseHtml();\n\n\t\t\t// return\n\t\t\treturn $data;\n\t\t}\n\n\t}",
"public function load() { }",
"function LoadUploadedFiles()\n {\n\t\t$upld_folder = $this->EnsureTmpUploadFolder();\n\t\t\n foreach($this->upload_fields as $filefield)\n {\n $tmp_filepath = $this->globaldata->files[$filefield]['tmp_name'];\n if(is_uploaded_file($tmp_filepath))\n {\n $filename = $this->globaldata->files[$filefield]['name'];\n\t\t\t\t$filename = $this->trim_file_name($filename,$this->globaldata->files[$filefield][\"type\"]);\n \n if(!$this->config->allow_nonsecure_file_attachments && \n $this->IsNonSecureFile($filename))\n {\n $this->error_handler->NotifyError(\n \"File Upload handler: skipping nonsecure file attachment: $filename\");\n continue;\n }\n\n $upld_path = $upld_folder.\"/\".$filename;\n \n $upld_path = \n $this->CopyFile_Prevent_Overwrite($tmp_filepath, $upld_path);\n\n $this->logger->LogInfo(\"File Upload handler: loaded file from $tmp_filepath to $upld_path.\");\n\n $mimetype = $this->globaldata->files[$filefield][\"type\"];\n\n //NOTE: LoadUploadedFiles is for native file uploads where the file is submitted along with the\n //form submission. In this case, more than one files is not supported per field.\n $existing_file = $this->find_file_uploaded($filefield);\n if($existing_file >= 0)\n {\n unlink($this->loaded_files[$existing_file]['loaded_file']);\n $this->loaded_files[$existing_file] = array(\"input_name\"=>$filefield,\n \"loaded_file\"=>$upld_path,\n \"mime_type\"=>$mimetype); \n }\n else\n {\n $this->loaded_files[] = array(\"input_name\"=>$filefield,\n \"loaded_file\"=>$upld_path,\n \"mime_type\"=>$mimetype);\n }\n }//if\n }//foreach\n \n \n \n return true;\n }",
"abstract public function loadAll();",
"public function getLoad();",
"abstract protected function load(): array;",
"protected function loadStats()\n {\n if ($this->stat === false) {\n $this->stat = @stat($this->getPath());\n if ($this->stat===false) {\n throw new T_Exception_File($this->getPath(),'stat error');\n }\n }\n }",
"public function load()\n {\n }",
"public function load()\n {\n }",
"public function load()\n {\n }",
"public function load()\n {\n }",
"public function load()\n {\n }",
"public function load()\n {\n }",
"public function load()\n {\n }",
"public function isLoadedFromFile() : bool\n {\n return $this->fileExists;\n }",
"public function __load();",
"public function testAlreadyLoadedFileWillNotBeLoadedTwice()\n {\n $this->translator->load();\n $this->assertArrayHasKey('test_message', $this->translator->all());\n $this->translator->load();\n $this->assertTrue($this->translator->hasBeenLoaded('en'));\n }",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load();",
"public function load(){\n\t\tif (is_file($this->_filename) && is_readable($this->_filename)){\n\t\t\t$this->_storage = require($this->_filename);\n\t\t\t$this->_dataAvailable = true;\n\t\t}\n\t}",
"protected function childLoad() {}",
"public function testBadLoaderDefined() {\n $this->expectException('\\\\Phloem\\\\Exception\\\\LoaderException');\n\n $this->factory->setLoader('bad', true);\n $this->factory->getLoader('filename.bad');\n }",
"public function testFileNotFoundException ()\n {\n $this->tran->loadFile(2);\n $this->tran->loadFile();\n $this->tran->loadFile(true);\n $this->tran->loadFile('asd');\n }",
"public function isLoaded(): bool\n {\n return $this->options['load'] || in_array($this->getMethod(), [self::INLOAD, self::POSTLOAD], true);\n }",
"abstract public function loadData();",
"public function testLoad()\n {\n $fixture = new Mad_Test_Fixture_Base($this->_conn, 'unit_tests');\n $this->assertEquals('0', $this->_countRecords());\n\n $fixture->load();\n $this->assertEquals('6', $this->_countRecords());\n }",
"public function load(): bool\n {\n if (file_exists($this->file_name)) {\n $data = file_get_contents($this->file_name);\n\n if ($data !== false) {\n $this->setData(json_decode($data, true) ?? []);\n } else {\n $this->setData([]);\n }\n\n return true;\n }\n\n return false;\n }",
"abstract public function load($filename);",
"protected function assertLoaded()\n\t{\n\t\tif (!$this->hasLoaded) {\n\t\t\t$this->settings = $this->loadSettings();\n\n\t\t\t$this->hasLoaded = true;\n\t\t}\n\t}",
"public function isLoaded() {\n return is_object($this->result);\n }",
"protected function load()\n {\n $this->translations = array();\n \n if ($this->language) {\n if ($this->cachepath) {\n if (file_exists($cache = $this->cachepath.'/'.$this->language.'.php')) {\n $this->translations = include($cache);\n }\n } else {\n if (!empty($this->filepaths)) {\n foreach ($this->filepaths as $filepath) {\n $this->loadFilePath($filepath);\n }\n }\n }\n }\n }",
"function load($filename) {\r\n return null; //PEAR::raiseError(\"No Load method exists\", true);\r\n }",
"public function fileNeedsProcessing() {}",
"private function isLoad($file){\n\t\treturn in_array($file, $this->file, true);\n\t}",
"public function testLoad() {\n $this->_loader->getSource('FilesystemTest.php');\n $this->_loader->getSource('FilesystemTest.php');\n\n $this->_loader->appendDir(dirname(__FILE__) . '/../Loader');\n $this->_loader->prependDir(dirname(__FILE__) . '/../Loader');\n }",
"public function __load()\r\n {\r\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\r\n }",
"public function __load()\r\n {\r\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\r\n }",
"public function isLoaded();",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }",
"public function __load()\n {\n $this->__initializer__ && $this->__initializer__->__invoke($this, '__load', []);\n }"
] | [
"0.6530118",
"0.6468308",
"0.6468308",
"0.6468308",
"0.6468308",
"0.6398187",
"0.6360412",
"0.61929655",
"0.6162414",
"0.61575955",
"0.61575955",
"0.6152795",
"0.61042905",
"0.60975623",
"0.6032236",
"0.5989458",
"0.5964382",
"0.5961701",
"0.5959401",
"0.59563017",
"0.5921872",
"0.58613235",
"0.58424133",
"0.5832722",
"0.5832722",
"0.58319455",
"0.58314204",
"0.58314204",
"0.58314204",
"0.58309317",
"0.58235884",
"0.58210635",
"0.58121276",
"0.5764242",
"0.5764242",
"0.5764242",
"0.5764242",
"0.5764242",
"0.5764242",
"0.5764242",
"0.5764242",
"0.5764242",
"0.5764242",
"0.5764242",
"0.5764242",
"0.5764242",
"0.5745547",
"0.57367253",
"0.57361853",
"0.57199943",
"0.5698551",
"0.5692477",
"0.5691735",
"0.5679282",
"0.56725204",
"0.5666093",
"0.56599796",
"0.5651221",
"0.563759",
"0.563485",
"0.56250834",
"0.561127",
"0.5586434",
"0.5586434",
"0.5574241",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382",
"0.5563382"
] | 0.6198579 | 7 |
Prepares directory data loader with mock object for data processor. | private function prepareDirectoryDataLoader(?callable $dataLoaderMockCallback = null): DirectoryDataLoaderInterface
{
$dataLoaderMock = Mockery::mock(DataLoaderInterface::class);
if (null !== $dataLoaderMockCallback) {
$dataLoaderMockCallback($dataLoaderMock);
}
return new RecursiveDirectoryDataLoader($dataLoaderMock);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setUp()\n {\n $folder = dirname(__DIR__) . '/fixtures';\n\n $this->keyVal(true);\n $this->_mutableLoader = new Loader($folder);\n $this->_immutableLoader = new Loader($folder, true);\n }",
"public function setUp()\n {\n foreach (glob(__DIR__.'/../data/*.json') as $jsonFile) {\n if (basename($jsonFile) != 'json_output_test_json_fixed.json') {\n unlink($jsonFile);\n }\n }\n\n $this->data = [\n [1, 'PHP Developer', 'Mazen Kenjrawi'],\n [4, 'Dummy Classes', 'Foo Bar'],\n ];\n\n $this->headingFields = ['id', 'Title', 'Name'];\n\n $this->Loader = new Loader();\n }",
"protected function setUp()\n {\n $this->object = new Loader;\n }",
"protected function setUp()\n {\n $this->dir = sys_get_temp_dir() . '/q-config_dirtest-' . md5(uniqid());\n \n mkdir($this->dir);\n mkdir(\"{$this->dir}/dir1\");\n mkdir(\"{$this->dir}/dir2\");\n touch(\"{$this->dir}/file1.mock\");\n touch(\"{$this->dir}/file2.mock\");\n touch(\"{$this->dir}/dir1/file3.mock\");\n touch(\"{$this->dir}/dir1/file4.mock\");\n \n $this->file = \"{$this->dir}/file1.mock\";\n \n Q\\Transform::$drivers['from-mock'] = 'Config_Mock_Unserialize';\n }",
"public function testDir_LazyLoad()\n {\n $config = new Config_Dir($this->dir, array('transformer'=>'from-mock', 'ext'=>'mock'));\n\n $this->assertType('Q\\Config_Dir', $config);\n $this->assertEquals(array(), (array)$config);\n \n $cfg_file1 = $config['file1'];\n $this->assertType('Q\\Config_File', $cfg_file1);\n $this->assertEquals(array(\"db\"=>array(\"host\"=>\"localhost\", \"dbname\"=>\"test\",\"user\"=>\"myuser\",\"pwd\"=>\"mypwd\"),\"output\"=>\"xml\",\"input\"=>\"json\"), (array)$cfg_file1);\n $this->assertArrayHasKey('file1', (array)$config);\n $this->assertArrayNotHasKey('dir1', (array)$config);\n\n $cfg_dir1 = $config['dir1'];\n $this->assertType('Q\\Config_Dir', $cfg_dir1);\n $this->assertEquals(array(), (array)$cfg_dir1);\n $this->assertArrayHasKey('file1', (array)$config);\n $this->assertArrayHasKey('dir1', (array)$config); \n }",
"public function testLoad() {\n $this->_loader->getSource('FilesystemTest.php');\n $this->_loader->getSource('FilesystemTest.php');\n\n $this->_loader->appendDir(dirname(__FILE__) . '/../Loader');\n $this->_loader->prependDir(dirname(__FILE__) . '/../Loader');\n }",
"protected function initFileLoader() \n\t{\n\t\t$this->fileLoader = new FileLoader();\n\t}",
"protected function init()\n {\n $classParser = $this->getContainer()->get('classParser');\n $classParser->setAllowedMethods( array($this->allowedMethod) );\n $this->data = $classParser->getData($this->paths, $this->cacheFile);\n }",
"protected function setUp()\r\n {\r\n $this->object = new Json;\r\n mkdir('data/tests');\r\n file_put_contents('data/tests/test.json', json_encode(\\MockObject\\FileDataStub::getData()));\r\n }",
"public function testDir_EagerLoad()\n {\n $config = new Config_Dir($this->dir, array('transformer'=>'from-mock', 'ext'=>'mock','loadall'=>true));\n\n $this->assertType('Q\\Config_Dir', $config);\n\n $this->assertArrayHasKey('dir1', (array)$config);\n $this->assertArrayHasKey('dir2', (array)$config);\n $this->assertArrayHasKey('file1', (array)$config);\n\n $this->assertArrayHasKey('file3', (array)$config['dir1']);\n $this->assertArrayHasKey('file4', (array)$config['dir1']); \n }",
"private function initLoader() {\n $this->_loader = new Loader();\n\t}",
"protected function setUp() {\n\t\tparent::setUp();\n\n\t\t$this->object = new Transit($this->data);\n\t\t$this->object->setDirectory(TEMP_DIR);\n\t}",
"public function setUp() {\n $this->libraryLoader= \\lang\\ClassLoader::registerLoader(new \\lang\\archive\\ArchiveClassLoader(new Archive(\\lang\\XPClass::forName(\\xp::nameOf(__CLASS__))\n ->getPackage()\n ->getPackage('lib')\n ->getResourceAsStream('three-and-four.xar')\n )));\n }",
"public function setUp()\n {\n $this->data = array(\n 'folder_name_1' => array(\n 'src' => 'source_1',\n 'dst' => 'destination_1',\n ),\n 'folder_name_2' => array(\n 'src' => 'source_2',\n 'dst' => 'destination_2',\n 'client' => 'test'\n )\n );\n }",
"public function setUp() {\r\n // and doing it every test slows the tests down to a crawl\r\n $this->sharedFixture = new MovieLensDataSet(DATA_DIR);\r\n }",
"protected function setUp()\n {\n parent::setUp();\n $driver = new StorageDriver(\n new Storage('/', new Filesystem(new LocalDriver(sys_get_temp_dir()))),\n '/cache_test'\n );\n $this->object = new CachePool($driver);\n }",
"public function load()\n {\n $this->rootDir = '';\n\n /** @var string $arg */\n while ($arg = array_shift($this->arguments)) {\n\n if ($this->stringStartsWith('--directory=', $arg)) {\n $this->rootDir = str_replace('--directory=', '', $arg);\n }\n }\n }",
"private function initData()\n {\n $data = $this->cache->load($this->cacheId);\n if (false === $data) {\n /** @var Reader $reader */\n $reader = $this->readerFactory->create(\n ['fileName' => sprintf(self::SEARCH_PATTERN, $this->componentName)]\n );\n $data = $reader->read();\n $this->cache->save($this->serializer->serialize($data), $this->cacheId);\n } else {\n $data = $this->serializer->unserialize($data);\n }\n\n if (!empty($data)) {\n $this->data[$this->componentName] = [Converter::DATA_ATTRIBUTES_KEY => ['name' => $this->componentName]];\n $this->merge([$this->componentName => $data]);\n $this->data = $this->evaluateComponentArguments($this->data);\n }\n }",
"protected function setUp() {\r\n\t\t$this->cacheDatabaseEntryRepository = new Tx_StaticfilecacheMananger_Domain_Repository_CacheDatabaseEntryRepository ();\r\n\t\t$this->cacheDatabaseEntryRepository->setFileTable('tx_ncstaticfilecache_file');\r\n\t\t$this->assertTrue($this->createDatabase());\r\n\t\t$this->useTestDatabase();\r\n\t\t$this->importExtensions(array('nc_staticfilecache'));\r\n\t\t$path = dirname ( __FILE__ ) . DIRECTORY_SEPARATOR .'fixtures'.DIRECTORY_SEPARATOR.'db'.DIRECTORY_SEPARATOR.'tx_ncstaticfilecache_file.xml';\r\n\t\t$this->importDataSet($path);\r\n\t}",
"private function __construct()\n {\n require_once DATA_DIR . '/system/DataIO.php';\n }",
"public function setUp()\n {\n $this->fs = new Filesystem();\n $this->cacheDir = __DIR__ . '/cache';\n if ($this->fs->exists($this->cacheDir)) {\n $this->fs->remove($this->cacheDir);\n }\n\n $this->cache = new ConfigFileScriptCache($this->cacheDir, true);\n }",
"public function init() {\n if (!class_exists(TableBuilderManager::class)) {\n $loader = new ClassLoader();\n $loader->addPsr4('Drush\\\\dmt_structure_export\\\\', __DIR__ . '/src');\n $loader->register();\n }\n }",
"protected function prepareArchiveDir(): void\n {\n $this->filesystem = new Filesystem();\n $this->archiveDir = FsUtils::tmpDir(self::ARCHIVES_DIR_NAME);\n }",
"public function testLoadReturnsCorrectDataWithExceptionsThrownByDataLoaders(): void\n {\n $this->prepareVFSDirectoryStructure();\n $fullPath = $this->getFullPath('container');\n $expectedFilesMap = ['FileSecond' => 'first/file_second.exe', 'SomeExt' => 'some_ext.exe'];\n $expectedLoadData = ['FileSecond' => ['param1' => 'with_value'], 'SomeExt' => ['param2' => 'without_value']];\n $expectedExceptions =\n array_fill_keys([\"$fullPath/first/file_first.exe\", \"$fullPath/second/file_third.exe\"], new Exception());\n $dataLoaderMockCallbackParams = [$fullPath, $expectedFilesMap, $expectedLoadData, $expectedExceptions];\n $dataLoaderMockCallback = $this->prepareDataLoaderMockCallbackWithExceptions(...$dataLoaderMockCallbackParams);\n $directoryDataLoader = $this->prepareDirectoryDataLoader($dataLoaderMockCallback);\n\n $actualLoadData = $directoryDataLoader->load($fullPath, '/^.*\\.exe$/');\n\n static::assertArraysAreSame($expectedLoadData, $actualLoadData);\n }",
"public function setup()\n {\n if (! PluginRegistry::isLoaderSet()) {\n $loader = $this->getMockClass(\n 'CubicMushroom\\WordpressCore\\Component\\Plugin\\PluginLoader',\n array('hook')\n );\n PluginRegistry::setLoader(new $loader);\n }\n }",
"protected function setUp(): void\n {\n parent::setUp();\n\n $this->load();\n }",
"protected function setUp()\n {\n // driver\n $driver = new Driver\\FilesystemDriver([\n 'hash_level' => 1,\n 'file_pref' => 'cache.',\n 'file_suff' => '.txt'\n ]);\n\n $this->cache = new CachePool($driver);\n\n $this->object = new CacheItem('test', $this->cache, [\n 'ttl' => 60\n ]);\n\n }",
"public function setUp()\n {\n parent::setUp();\n\n $this->file = sys_get_temp_dir() . DS . 'serialized';\n $this->SerializedArray = new SerializedArray($this->file);\n }",
"protected function setUp()\n\t{\n\t\t$this->object = $this->getMockForAbstractClass(\n\t\t\t'Ruon\\\\Loader\\\\LoaderAbstract'\n\t\t);\n\t}",
"protected function setUp() {\n dir::make($this->root);\n\n // set up a new library\n $this->library();\n\n }",
"protected function setUp()\n {\n parent::setUp();\n \n // TODO Auto-generated ServiceLoaderTest::setUp()\n \n $this->serviceLoader = new ServiceLoader();\n }",
"public function setUp() {\n parent::setUp();\n\n // Mock FileSystem DI.\n $file_system_prophecy = $this->prophesize(FileSystem::class);\n $file_system_prophecy->realpath('php://pii_data/filename.csv')->willReturn('/tmp/pii_data/filename.csv');\n $file_system_prophecy->realpath('php://pii_data/filename.zip')->willReturn('/tmp/pii_data/filename.zip');\n\n $file_system_prophecy->basename('temporary://pii_data/webform_csv_data-1542374348.zip')->willReturn('webform_csv_data-1542374348.zip');\n $file_system_prophecy->basename('php://pii_data/filename.zip')->willReturn('filename.zip');\n\n $this->fileSystemProphecy = $file_system_prophecy;\n $this->archiveService = new ArchiveService($file_system_prophecy->reveal());\n }",
"protected function _before() : void {\n require_once '../../public/wp-content/plugins/kc/Data/Database/DataManager.php';\n $this->dataManager = new DataManager(new PostTypeService(), new SecurityService(), new ImageService());\n }",
"protected function init()\n {\n $dir = $this->getDir();\n\n if (!file_exists($dir)) {\n mkdir($dir, 0755, true);\n }\n }",
"protected function setUp(): void\n {\n $this->mock = new FileSystem;\n }",
"public function setUp() {\n $this->csv = new Csv();\n $this->csv->auto(__DIR__ . '/../example_files/single_column.csv');\n\n // Remove last 2 lines to simplify comparison\n unset($this->csv->data[2], $this->csv->data[3]);\n\n $temp_dir = str_replace(\"\\\\\", '/', sys_get_temp_dir());\n if (substr($temp_dir, -1) != '/') {\n // From the PHP.net documentation:\n // This function does not always add trailing slash. This behaviour\n // is inconsistent across systems.\n $temp_dir .= '/';\n }\n $this->temp_filename = $temp_dir . 'parsecsv_test_file.csv';\n }",
"protected function setUp()\n {\n $this->loader = $this->getMock('Che\\LogStock\\Loader\\LogAdapterLoader');\n $this->fallbackAdapter = $this->getMock('Che\\LogStock\\Adapter\\LogAdapter');\n $this->factory = new AdapterLoaderFactory($this->loader, $this->fallbackAdapter);\n }",
"protected function setUp()\n {\n $this->object = new Autoloader();\n }",
"protected function setUp()\n {\n $this->media = new Media();\n $this->object = new FileHelper($this->media);\n }",
"public static function setUpBeforeClass() {\n\t\t$loader = new \\Mockery\\Loader();\n\t\t$loader->register();\n\t}",
"protected function setUp() {\n $this->object = new Butler\\Files(BUTLER_PATH_TESTS);\n }",
"public static function setUpBeforeClass()\n {\n $fileSystemHelper = new FileSystemHelper(__DIR__ . '/cache');\n\n if (is_dir(__DIR__ . '/cache/builder') === false) {\n $fileSystemHelper->createFolder(__DIR__ . '/cache', 'builder');\n }\n }",
"protected function setUp() {\n $this->object = new ZipArchiver;\n }",
"protected function setUp() {\n $this->object = new NlReader();\n \n vfsStreamWrapper::register();\n $root = vfsStream::newDirectory('tmp');\n vfsStreamWrapper::setRoot($root);\n $this->file = vfsStream::newFile('items.csv', 0764)\n ->withContent(\"73-ou-XW46\\nApple\\n1\\na\")\n ->at($root); \n }",
"protected function setUp() {\n\t\tparent::setUp();\n\n\t\t// All tests in this class can only be run as root.\n\t\tif (!function_exists('posix_getuid') || 0 != posix_getuid()) {\n\t\t\t$this->markTestSkipped('This test may only be run as root on a unix filesystem with the posix extension');\n\t\t}\n\n\t\tclearstatcache();\n\n\t\t$this->testBasePath = rtrim(getenv('YAPEPBASE_TEST_TEMPPATH'), DIRECTORY_SEPARATOR);\n\n\t\tif (empty($this->testBasePath)) {\n\t\t\t$this->markTestSkipped('Test cannot be done without a test directory');\n\t\t} else {\n\t\t\t$this->testBasePath .= DIRECTORY_SEPARATOR;\n\t\t}\n\n\t\tif (stripos(PHP_OS, 'WIN') === 0) {\n\t\t\t$this->markTestSkipped('The Unix file handler tests can not be run on Windows');\n\t\t}\n\n\t\tif (!file_exists($this->testBasePath) && !mkdir($this->testBasePath, 0755, true)) {\n\t\t\t$this->markTestSkipped('The given path does not exist, and cannot be created: ' . $this->testBasePath);\n\t\t}\n\n\t\t$this->cleanupTestDirectory();\n\n\t\t$this->fileHandler = new FileHandlerUnix();\n\t}",
"protected function setUp()\n {\n $this->object = new LazyClassDefinition('\\stdClass');\n \n }",
"public function setUp()\n {\n $this->loadEnv();\n\n require_once(__DIR__ . '/functions.php');\n\n // Allows for persistence of array cache to improve test performance,\n // e.g. by caching the LWA token to minimize OAuth requests. If this\n // is not desireable, see implementation of tearDown method below.\n if (!static::$arrayCache instanceof ArrayCache) {\n static::$arrayCache = new ArrayCache();\n }\n }",
"protected function _initProcessor()\n {\n $this->_processor = Processor::getInstance();\n $paramPath = $this->_input->getArgument('path');\n\n // If path cannot be loaded, exit immediately\n if (!$paramPath) {\n return;\n }\n\n $path = new Path($paramPath, getcwd(), $this->_baseDirectory);\n\n if ($path->isValid()) {\n $this->_processor->setPath($path);\n\n if (!$this->_input->getOption('ignore-manifest')) {\n $this->_manifest->load($path);\n // Check if we've some preprocessor task to complete\n $this->_runProcessors(Processor::PRE_PROCESSORS);\n }\n }\n }",
"protected function setUp()\n {\n $this->object = $this->getReadWriteFile();\n }",
"protected function setUp()\n {\n $this->request = new Request();\n $this->response = new Response();\n\n $this->request->load();\n $this->response->load();\n }",
"protected function setUp()\n {\n $this->request = new Request();\n $this->response = new Response();\n\n $this->request->load();\n $this->response->load();\n }",
"function createDataPaths() {\n foreach ($this->data_paths as $path) {\n if (!file_exists($this->root . $path)) {\n mkdir($this->root . $path);\n }\n }\n }",
"public function setUp() {\n\t\t$this->parser = new CoordinatorParser();\n\t\t$this->jsonFileManager = new JsonFileManager(__DIR__ . '/data/');\n\t\t$this->packetBonded = $this->jsonFileManager->read('response-coordinator-bonded')['response'];\n\t\t$this->packetDiscovered = $this->jsonFileManager->read('response-coordinator-discovered')['response'];\n\t\t$this->expectedBonded = $this->jsonFileManager->read('data-coordinator-bonded');\n\t\t$this->expectedDiscovered = $this->jsonFileManager->read('data-coordinator-discovered');\n\t}",
"public function __construct() {\n $this->loader();\n }",
"private function setMockDataConfig() {\n\n }",
"protected function setUp() {\n\n $this->di = m::mock('\\videoViewer\\DIContainer');\n $head = file_get_contents(dirname(__FILE__).'/../../../templates/head.tpl');\n $nav = file_get_contents(dirname(__FILE__).'/../../../templates/nav.tpl');\n $this->di->shouldReceive('loadTemplate')->with('head')->andReturn($head);\n $this->di->shouldReceive('loadTemplate')->with('nav')->andReturn($nav);\n $this->tpl = file_get_contents(dirname(__FILE__).'/../../../templates/ViewEpisode.tpl');\n }",
"public function loadModuleData() {}",
"public function loadDir($directory);",
"protected function setUp()\n {\n $this->object = new DecorateExtension;\n include_once dirname(dirname(__DIR__)) . '/testData1.php';\n }",
"protected function loadTreeData() {}",
"function __construct()\n {\n $this->setTemporaryDirectory(sys_get_temp_dir());\n }",
"public static function setUpBeforeClass(): void\n {\n parent::setUpBeforeClass();\n\n self::$reader = [\n 'username' => self::$faker->userName,\n 'email' => self::$faker->email,\n 'password' => self::$faker->password,\n ];\n\n // load user admin fixtures\n parent::$writer['id'] = Utils::loadUserData(\n parent::$writer['username'],\n parent::$writer['email'],\n parent::$writer['password'],\n true\n );\n\n // load user reader fixtures\n self::$reader['id'] = Utils::loadUserData(\n self::$reader['username'],\n self::$reader['email'],\n self::$reader['password'],\n false\n );\n }",
"protected function setUp() {\n parent::setUp();\n $this->tempJson = $this->json;\n }",
"protected function setUp()\n {\n parent::setUp();\n\n $run = dirname(__FILE__) . '/_run';\n if (file_exists($run) === false) {\n mkdir($run, 0755);\n }\n\n $this->_clearRunResources($run);\n\n include_once 'PHP/Depend.php';\n include_once 'PHP/Depend/StorageRegistry.php';\n include_once 'PHP/Depend/Storage/MemoryEngine.php';\n\n PHP_Depend_StorageRegistry::set(\n PHP_Depend::TOKEN_STORAGE,\n new PHP_Depend_Storage_MemoryEngine()\n );\n PHP_Depend_StorageRegistry::set(\n PHP_Depend::PARSER_STORAGE,\n new PHP_Depend_Storage_MemoryEngine()\n );\n\n if (defined('STDERR') === false) {\n define('STDERR', fopen('php://stderr', true));\n }\n }",
"public function setUp()\n {\n $this->testModel = new TestModel;\n $this->mockFileUploadDir = vfsStream::setup('foo/bar');\n }",
"public static function setup()\n\t{\n\t\tif (false === self::$data_cache_provider)\n\t\t{\n\t\t\tself::$data_cache_provider = new aw_cache();\n\t\t}\n\t}",
"protected function _preload() {\n }",
"protected function setUp()\n\t{\n\t\t$this->object = $this->getMockForAbstractClass(\n 'Ruon\\\\Loader\\\\LoaderAutoloadAbstract'\n );\n\t}",
"protected function setUp()\n {\n $this->object = new \\Yana\\Http\\Uploads\\UploadWrapper($this->inputArray);\n }",
"public function setUp()\n {\n $decereal = new ModelDeserialiser();\n $decereal->reset();\n $bar = new SimpleMetadataProvider('Data', 'Data');\n unset($bar);\n DateTime::setTimeProvider([new Carbon(), 'now']);\n }",
"protected function setUp()\n {\n $this->object = new CommonTransformer;\n }",
"protected function setUp() {\n $this->object = new LyvDAL;\n }",
"protected function prepareCache()\n {\n $oldUmask = umask(0);\n mkdir($this->cacheDirectory, 0777);\n mkdir($this->getObjectsDirectory(), 0777);\n\n $this->cacheInfo = array(\"objects\" => array());\n file_put_contents($this->cacheDirectory . self::CACHE_INFO_FILENAME, json_encode(array(\"cache\" => $this->cacheInfo)));\n @chmod($this->cacheDirectory . self::CACHE_INFO_FILENAME, 0666);\n umask($oldUmask);\n }",
"protected function initialize() {\n\t\t$this->databasesDir = $this->projectDir . '/var/data/databases';\n\t\t$this->simulatorsDir = $this->projectDir . '/var/data/simulators';\n\t\t$this->publicDir = $this->projectDir . '/' . ($this->getParameter('public_dir') ?? 'public');\n\t\t$this->viewsDir = $this->projectDir . '/templates';\n\t\t$this->pdfFormsDir = $this->projectDir . '/var/data/pdfforms';\n\t}",
"private static function prep() {\n\t\tif (!isset(F3::$global['CACHE'])) {\n\t\t\t// Extensions usable as cache back-ends\n\t\t\t$_exts=array_intersect(\n\t\t\t\texplode('|','apc|xcache'),get_loaded_extensions()\n\t\t\t);\n\t\t\tforeach (array_keys($_exts,'') as $_null)\n\t\t\t\tunset($_exts[$_null]);\n\t\t\t$_exts=array_merge($_exts,array());\n\t\t\tF3::$global['CACHE']=$_exts[0]?:\n\t\t\t\t('folder='.F3::$global['BASE'].'cache/');\n\t\t}\n\t\tif (preg_match(\n\t\t\t'/^(?:(folder)\\=(.+\\/)|(apc)|(memcache)=(.+))|(xcache)/i',\n\t\t\tF3::$global['CACHE'],$_match)) {\n\t\t\tif ($_match[1]) {\n\t\t\t\tif (!file_exists($_match[2])) {\n\t\t\t\t\tif (!is_writable(dirname($_match[2])) &&\n\t\t\t\t\t\tfunction_exists('posix_getpwuid')) {\n\t\t\t\t\t\t\t$_uid=posix_getpwuid(posix_geteuid());\n\t\t\t\t\t\t\tF3::$global['CONTEXT']=array(\n\t\t\t\t\t\t\t\t$_uid['name'],realpath(dirname($_match[2]))\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\ttrigger_error(F3::TEXT_Write);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// Create the framework's cache folder\n\t\t\t\t\tmkdir($_match[2],0755);\n\t\t\t\t}\n\t\t\t\t// File system\n\t\t\t\tself::$l1cache=array('type'=>'folder','id'=>$_match[2]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$_ext=strtolower($_match[3]?:($_match[4]?:$_match[6]));\n\t\t\t\tif (!extension_loaded($_ext)) {\n\t\t\t\t\tF3::$global['CONTEXT']=$_ext;\n\t\t\t\t\ttrigger_error(F3::TEXT_PHPExt);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif ($_match[4]) {\n\t\t\t\t\t// Open persistent MemCache connection(s)\n\t\t\t\t\t// Multiple servers separated by semi-colon\n\t\t\t\t\t$_pool=explode(';',$_match[5]);\n\t\t\t\t\t$_mcache=NULL;\n\t\t\t\t\tforeach ($_pool as $_server) {\n\t\t\t\t\t\t// Hostname:port\n\t\t\t\t\t\tlist($_host,$_port)=explode(':',$_server);\n\t\t\t\t\t\tif (is_null($_port))\n\t\t\t\t\t\t\t// Use default port\n\t\t\t\t\t\t\t$_port=11211;\n\t\t\t\t\t\t// Connect to each server\n\t\t\t\t\t\tif (is_null($_mcache))\n\t\t\t\t\t\t\t$_mcache=memcache_pconnect($_host,$_port);\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tmemcache_add_server($_mcache,$_host,$_port);\n\t\t\t\t\t}\n\t\t\t\t\t// MemCache\n\t\t\t\t\tself::$l1cache=array('type'=>$_ext,'id'=>$_mcache);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t// APC and XCache\n\t\t\t\t\tself::$l1cache=array('type'=>$_ext);\n\t\t\t}\n\t\t\tself::$l1cache['current']=FALSE;\n\t\t\treturn TRUE;\n\t\t}\n\t\t// Unknown back-end\n\t\ttrigger_error(self::TEXT_Backend);\n\t\treturn FALSE;\n\t}",
"public function setUp()\n\t{\t\t\n\t\t$this->postMapper = phpDataMapper_TestHelper::mapper('Blogs', 'PostMapper');\n\t\t$this->dogMapper = phpDataMapper_TestHelper::mapper('Dogs', 'DogMapper');\n\t}",
"protected function _before()\n {\n $this->repo = m::mock('Gzero\\Cms\\Repositories\\BlockReadRepository');\n $this->finder = new BlockFinder($this->repo, new CacheManager(app()));\n }",
"public function setUp()\n {\n $m = new Memory;\n $m->mkdir('foo/bar/baz', 0755, true);\n $m->mkdir('lorem/ipsum', 0755, true);\n $m->filePutContents('foo/todo.txt', 'Write Awesome Code');\n $m->createFile('foo/track.mp3');\n $m->createFile('foo/bar/aww.jpg');\n $this->m = $m;\n }",
"public function init()\n {\n chdir($this->context['source_dir']);\n $this->loadConfig();\n $this->context['temp_dir'] = $this->cacheDir(\"upgrades/temp\");\n $this->context['extract_dir'] = $this->context['temp_dir'];\n $this->ensureDir($this->context['temp_dir']);\n $this->context['state_file'] = $this->cacheDir('upgrades/') . self::STATE_FILE;\n $this->context['upgrader_dir'] = dirname(__FILE__);\n $this->loadState();\n $this->context['backup_dir'] = $this->config['upload_dir'] . \"/upgrades/backup/\" . pathinfo(\n $this->context['zip'],\n PATHINFO_FILENAME\n ) . \"-restore\";\n if (isset($this->context['script_mask'])) {\n $this->script_mask &= $this->context['script_mask'];\n }\n if (isset($this->state['extract_dir'])) {\n $this->context['extract_dir'] = $this->state['extract_dir'];\n }\n if (empty($this->context['health_check_path'])) {\n $this->context['health_check_path'] =\n realpath($this->context['extract_dir']) . self::DEFAULT_HEALTHCHECK_PATH;\n }\n $this->context['case_insensitive_fs'] = $this->testFilesystemCaseInsensitive();\n $this->context['versionInfo'] = self::getVersion();\n\n $this->initialized = true;\n }",
"protected function setUp() {\n $this->object = new UtilityIO;\n }",
"protected function setUp()\n {\n chdir(CWD . '../../..' );\n \\Yana\\Db\\Ddl\\Database::setDirectory(CWD . '/resources/');\n try {\n\n \\Yana\\Db\\FileDb\\Sequence::create($this->ascendingId, +1, null, null, +3, false);\n \\Yana\\Db\\FileDb\\Sequence::create($this->descendingId, -1, null, -3, null, true);\n $this->ascendingSequence = new \\Yana\\Db\\FileDb\\Sequence($this->ascendingId);\n $this->descendingSequence = new \\Yana\\Db\\FileDb\\Sequence($this->descendingId);\n\n } catch (\\Exception $e) {\n $this->markTestSkipped(\"Unable to connect to database: \" . $e->getMessage());\n chdir(CWD);\n }\n }",
"protected function setUp()\n {\n parent::setUp();\n $cache = new StaticCacheData(\n true,\n new Memory(25.0, 100.0),\n new Statistics(100, 5),\n new InternedStrings(2.0, 8.0, 6.0, 1009)\n );\n $this->dataCollector = new ByteCodeCacheDataCollector($cache);\n }",
"public function setUp()\n {\n $command = 'production';\n\n $this->container = Phake::mock('Symfony\\Component\\DependencyInjection\\ContainerInterface');\n Phake::when($this->container)\n ->getParameter('open_orchestra_model.fixtures_interface.' . $command)\n ->thenReturn(array(\n 'OpenOrchestra\\ModelInterface\\DataFixtures\\OrchestraProductionFixturesInterface',\n 'OpenOrchestra\\ModelBundle\\Tests\\DataFixtures\\Loader\\FakeProductionInterface',\n ));\n Phake::when($this->container)\n ->hasParameter('open_orchestra_model.fixtures_interface.' . $command)\n ->thenReturn(true);\n\n $this->loader = new OrchestraContainerAwareLoader($this->container, $command);\n }",
"protected function setUp() {\n\t\t$this->objectRegistry = new \\F3\\FLOW3\\Object\\TransientRegistry();\n\t}",
"public function setUp() {\n $this->fixture= new TreeParser();\n }",
"public function testLoadThrowsDataDirectoryNotFoundForNonExistingDir(): void\n {\n $dirname = 'nonexistent';\n $path = $this->getFullPath($dirname);\n $this->expectException(DataDirectoryNotFoundException::class);\n $this->expectExceptionExactMessage(\"Root folder $path was not found.\");\n\n $directoryDataLoader = $this->prepareDirectoryDataLoader();\n\n $directoryDataLoader->load($path, '/^.*\\..*$/');\n }",
"private function prepareDataLoaderMockCallback(string $path, array $expectedFilesMap, ?array $expectedLoadData = null): callable\n {\n return static function (MockInterface $dataLoaderMock) use ($expectedFilesMap, $expectedLoadData, $path) {\n foreach ($expectedFilesMap as $key => $expectedFile) {\n $filePath = \"$path/$expectedFile\";\n $returnData = $expectedLoadData[$key] ?? [];\n $dataLoaderMock->shouldReceive('load')->withArgs([$filePath])->andReturn($returnData);\n }\n };\n }",
"function setUp() {\n\t\t$this->dataLong = file_get_contents(__DIR__ . '/../lib/crypt.php');\n\t\t$this->dataShort = 'hats';\n\t\t$this->dataUrl = __DIR__ . '/../lib/crypt.php';\n\t\t$this->legacyData = __DIR__ . '/legacy-text.txt';\n\t\t$this->legacyEncryptedData = __DIR__ . '/legacy-encrypted-text.txt';\n\t\t$this->randomKey = Encryption\\Crypt::generateKey();\n\n\t\t$keypair = Encryption\\Crypt::createKeypair();\n\t\t$this->genPublicKey = $keypair['publicKey'];\n\t\t$this->genPrivateKey = $keypair['privateKey'];\n\n\t\t$this->view = new \\OC_FilesystemView('/');\n\n\t\t\\OC_User::setUserId(\\Test_Encryption_Keymanager::TEST_USER);\n\t\t$this->userId = \\Test_Encryption_Keymanager::TEST_USER;\n\t\t$this->pass = \\Test_Encryption_Keymanager::TEST_USER;\n\n\t\t$userHome = \\OC_User::getHome($this->userId);\n\t\t$this->dataDir = str_replace('/' . $this->userId, '', $userHome);\n\n\t\t// remember files_trashbin state\n\t\t$this->stateFilesTrashbin = OC_App::isEnabled('files_trashbin');\n\n\t\t// we don't want to tests with app files_trashbin enabled\n\t\t\\OC_App::disable('files_trashbin');\n\t}",
"public function setup()\n {\n $dataModel = eval(\"?>\" . file_get_contents( $this->getDataModelFilename() ));\n if($dataModel instanceof DataModelInterface) {\n $dataModel = new ProjectData($dataModel);\n }\n $this->getEngine()->bindData($dataModel);\n $this->getEngine()->activate();\n }",
"protected function fixture_setup() {\r\n $this->service = SQLConnectionService::get_instance($this->configuration);\r\n test_data_setup($this->service);\r\n }",
"public function initializeTreeData() {}",
"public function initializeTreeData() {}",
"protected function __construct() {\n if (!file_exists(self::getCachePath())) {\n mkdir(self::getCachePath(), 0777, true);\n }\n }",
"protected function setUp() {\n $this->object = Qwin::getInstance()->fcache;\n }",
"public function _setupObjects()\n {\n if ((count ($this -> _mXoopsModules) == 0) && $handler = opendir (XOOPS_MODULE_PATH)) {\n while (($dir = readdir($handler)) !== false) {\n if (!in_array ($dir, $this -> _mExclusions, true) && is_dir(XOOPS_MODULE_PATH . '/' . $dir)) {\n $module =& $this->get($dir);\n if ($module !== false) {\n $this->_mXoopsModules[] =& $module;\n }\n unset($module);\n }\n }\n }\n }",
"public function setUp() {\n try {\n $this->classname= $this->testClassName();\n $this->interfacename= $this->testClassName('I');\n } catch (IllegalStateException $e) {\n throw new PrerequisitesNotMetError($e->getMessage());\n }\n\n // Create an archive\n $this->tempfile= new TempFile($this->name);\n $archive= new Archive($this->tempfile);\n $archive->open(ARCHIVE_CREATE);\n\n $this->add($archive, $this->classname, '\n uses(\"util.Comparator\", \"'.$this->interfacename.'\");\n class '.$this->classname.' extends Object implements '.$this->interfacename.', Comparator { \n public function compare($a, $b) {\n return strcmp($a, $b);\n }\n }\n ');\n $this->add($archive, $this->interfacename, 'interface '.$this->interfacename.' { } ');\n $archive->create();\n \n // Setup classloader\n $this->classloader= new ArchiveClassLoader($archive);\n ClassLoader::getDefault()->registerLoader($this->classloader, TRUE);\n }",
"protected function setUp() : void\n {\n $this->routers = m::mock(Router::class);\n $this->writer = m::mock(WriterAbstract::class);\n $this->fixture = new Collection($this->routers);\n }",
"protected function initStorageObjects() {}",
"protected function initStorageObjects() {}",
"protected function initStorageObjects() {}"
] | [
"0.67082214",
"0.6618764",
"0.65211236",
"0.646287",
"0.6299706",
"0.619",
"0.60907036",
"0.6071325",
"0.60702026",
"0.6058675",
"0.60256207",
"0.5968181",
"0.59307015",
"0.59234875",
"0.5914662",
"0.5871581",
"0.58656985",
"0.5838043",
"0.57885945",
"0.5788488",
"0.5777952",
"0.57724595",
"0.57712084",
"0.5731274",
"0.5710945",
"0.56931084",
"0.56728745",
"0.5669593",
"0.5656583",
"0.5647136",
"0.56461304",
"0.5634918",
"0.56125",
"0.56050557",
"0.5593518",
"0.5589635",
"0.55880195",
"0.5582225",
"0.5570463",
"0.5557567",
"0.5540222",
"0.5537882",
"0.5535865",
"0.5534847",
"0.55339915",
"0.55288947",
"0.5527737",
"0.5520259",
"0.55073714",
"0.54786474",
"0.54786474",
"0.5477097",
"0.5474942",
"0.5471309",
"0.5465796",
"0.5463557",
"0.5461232",
"0.54506236",
"0.54387724",
"0.54369384",
"0.54321903",
"0.54264975",
"0.5425988",
"0.54206175",
"0.5419648",
"0.541749",
"0.5413761",
"0.53976244",
"0.5395578",
"0.5390984",
"0.53866553",
"0.5385977",
"0.5376438",
"0.537155",
"0.53710735",
"0.5366349",
"0.5364209",
"0.5363572",
"0.5354668",
"0.53532135",
"0.5350091",
"0.5349257",
"0.534665",
"0.5340597",
"0.5340124",
"0.5340079",
"0.53361636",
"0.53292406",
"0.53246593",
"0.5322925",
"0.53047353",
"0.53047353",
"0.5303749",
"0.5301083",
"0.5296012",
"0.5288135",
"0.52850866",
"0.528158",
"0.528158",
"0.5281248"
] | 0.69854474 | 0 |
Prepares directory structure in virtual file system for testing method _load_. | private function prepareVFSDirectoryStructure(): void
{
$structure = [
'single' => ['one_file.json' => ''],
'multi' => ['other_file.json' => '', 'j_s_o_n_file.json' => '', 'text.txt' => ''],
'container' => [
'first' => ['file_first.exe' => '', 'file_second.exe' => '', 'text.txt' => ''],
'second' => ['file_third.exe' => '', 'other.dat' => ''],
'third' => ['temp.tmp' => ''],
'some_ext.exe' => '',
],
];
$this->addStructureToVFS($structure);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testLoad() {\n $this->_loader->getSource('FilesystemTest.php');\n $this->_loader->getSource('FilesystemTest.php');\n\n $this->_loader->appendDir(dirname(__FILE__) . '/../Loader');\n $this->_loader->prependDir(dirname(__FILE__) . '/../Loader');\n }",
"protected function prepareArchiveDir(): void\n {\n $this->filesystem = new Filesystem();\n $this->archiveDir = FsUtils::tmpDir(self::ARCHIVES_DIR_NAME);\n }",
"private function loadPath() {\n $this->_system_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'System'.DIRECTORY_SEPARATOR;\n $this->_application_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'Application'.DIRECTORY_SEPARATOR;\n $this->_configuration_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'configuration'.DIRECTORY_SEPARATOR;\n $this->_libraries_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'Libraries'.DIRECTORY_SEPARATOR;\n $this->_logs_path = INDEX_DIRECTORY.DIRECTORY_SEPARATOR.'logs'.DIRECTORY_SEPARATOR;\n }",
"protected function setUp() {\n vfsStreamWrapper::register();\n vfsStreamWrapper::setRoot(new vfsStreamDirectory(\"Resources\"));\n vfsStream::copyFromFileSystem(dirname(__DIR__) . \"/Resources\", vfsStreamWrapper::getRoot());\n }",
"private static function initialLoad() {\n include_once __DIR__ . '/Storange.php';\n Storange::getPathDir('wowframework/');\n include_once __DIR__ . '/exceptions/LoadFiles.php';\n }",
"protected function initialize() {\n\t\t$this->databasesDir = $this->projectDir . '/var/data/databases';\n\t\t$this->simulatorsDir = $this->projectDir . '/var/data/simulators';\n\t\t$this->publicDir = $this->projectDir . '/' . ($this->getParameter('public_dir') ?? 'public');\n\t\t$this->viewsDir = $this->projectDir . '/templates';\n\t\t$this->pdfFormsDir = $this->projectDir . '/var/data/pdfforms';\n\t}",
"protected function setUp() {\n dir::make($this->root);\n\n // set up a new library\n $this->library();\n\n }",
"protected function createRealTestdir() {}",
"protected function local() : void\n {\n File::ensureDirectoryExists(Path::storage('framework/dusk/console'));\n File::ensureDirectoryExists(Path::storage('framework/dusk/screenshots'));\n\n File::ensureDirectoryExists(Path::storage('testing/downloads'));\n File::ensureDirectoryExists(Path::storage('testing/public'));\n File::ensureDirectoryExists(Path::storage('testing/private'));\n }",
"protected function init()\n {\n $dir = $this->getDir();\n\n if (!file_exists($dir)) {\n mkdir($dir, 0755, true);\n }\n }",
"public function load()\n {\n $this->rootDir = '';\n\n /** @var string $arg */\n while ($arg = array_shift($this->arguments)) {\n\n if ($this->stringStartsWith('--directory=', $arg)) {\n $this->rootDir = str_replace('--directory=', '', $arg);\n }\n }\n }",
"protected function createNecessaryDirectoriesInDocumentRoot() {}",
"protected function createNecessaryDirectoriesInDocumentRoot() {}",
"function smarty_core_create_dir_structure($params, &$smarty)\n{\n if (!file_exists($params['dir'])) {\n $_open_basedir_ini = ini_get('open_basedir');\n\n if (DIRECTORY_SEPARATOR=='/') {\n /* unix-style paths */\n $_dir = $params['dir'];\n $_dir_parts = preg_split('!/+!', $_dir, -1, PREG_SPLIT_NO_EMPTY);\n $_new_dir = (substr($_dir, 0, 1)=='/') ? '/' : getcwd().'/';\n if($_use_open_basedir = !empty($_open_basedir_ini)) {\n $_open_basedirs = explode(':', $_open_basedir_ini);\n }\n\n } else {\n /* other-style paths */\n $_dir = str_replace('\\\\','/', $params['dir']);\n $_dir_parts = preg_split('!/+!', $_dir, -1, PREG_SPLIT_NO_EMPTY);\n if (preg_match('!^((//)|([a-zA-Z]:/))!', $_dir, $_root_dir)) {\n /* leading \"//\" for network volume, or \"[letter]:/\" for full path */\n $_new_dir = $_root_dir[1];\n /* remove drive-letter from _dir_parts */\n if (isset($_root_dir[3])) array_shift($_dir_parts);\n\n } else {\n $_new_dir = str_replace('\\\\', '/', getcwd()).'/';\n\n }\n\n if($_use_open_basedir = !empty($_open_basedir_ini)) {\n $_open_basedirs = explode(';', str_replace('\\\\', '/', $_open_basedir_ini));\n }\n\n }\n\n /* all paths use \"/\" only from here */\n foreach ($_dir_parts as $_dir_part) {\n $_new_dir .= $_dir_part;\n\n if ($_use_open_basedir) {\n // do not attempt to test or make directories outside of open_basedir\n $_make_new_dir = false;\n foreach ($_open_basedirs as $_open_basedir) {\n if (substr($_new_dir, 0, strlen($_open_basedir)) == $_open_basedir) {\n $_make_new_dir = true;\n break;\n }\n }\n } else {\n $_make_new_dir = true;\n }\n\n if ($_make_new_dir && !file_exists($_new_dir) && !@mkdir($_new_dir, $smarty->_dir_perms) && !is_dir($_new_dir)) {\n $smarty->trigger_error(\"problem creating directory '\" . $_new_dir . \"'\");\n return false;\n }\n $_new_dir .= '/';\n }\n }\n}",
"function _fillFiles()\n\t{\n\t\t// directory from which we import (real path)\n\t\t$importDirectory = ereg_replace(\n\t\t\t\t\"^(.*)/$\", \n\t\t\t\t'\\1', \n\t\t\t\tereg_replace(\"^(.*)/$\", '\\1', $_SERVER[\"DOCUMENT_ROOT\"]) . $this->from);\n\t\t\n\t\t// when running on windows we have to change slashes to backslashes\n\t\tif (runAtWin()) {\n\t\t\t$importDirectory = str_replace(\"/\", \"\\\\\", $importDirectory);\n\t\t}\n\t\t$this->_files = array();\n\t\t$this->_depth = 0;\n\t\t$this->_postProcess = array();\n\t\t$this->_fillDirectories($importDirectory);\n\t\t// sort it so that webEdition files are at the end (that templates know about css and js files)\n\t\t\n\n\t\t$tmp = array();\n\t\tforeach ($this->_files as $e) {\n\t\t\tif ($e[\"contentType\"] == \"folder\") {\n\t\t\t\tarray_push($tmp, $e);\n\t\t\t}\n\t\t}\n\t\tforeach ($this->_files as $e) {\n\t\t\tif ($e[\"contentType\"] != \"folder\" && $e[\"contentType\"] != \"text/webedition\") {\n\t\t\t\tarray_push($tmp, $e);\n\t\t\t}\n\t\t}\n\t\tforeach ($this->_files as $e) {\n\t\t\tif ($e[\"contentType\"] == \"text/webedition\") {\n\t\t\t\tarray_push($tmp, $e);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->_files = $tmp;\n\t\t\n\t\tforeach ($this->_postProcess as $e) {\n\t\t\tarray_push($this->_files, $e);\n\t\t}\n\t}",
"public function setUp()\n {\n $root = vfsStream::setup();\n vfsStream::newDirectory('basic')\n ->at($root);\n vfsStream::newFile('foo.txt')\n ->at($root);\n vfsStream::newFile('bar.txt')\n ->at($root->getChild('basic'));\n }",
"private function initialiseVariables(): void\n {\n $this->entityInterfaceFqn = $this->namespaceHelper->getEntityInterfaceFromEntityFqn($this->entityFqn);\n list($className, , $subDirs) = $this->namespaceHelper->parseFullyQualifiedName(\n $this->entityFqn,\n $this->srcSubFolderName,\n $this->projectRootNamespace\n );\n\n $this->singularNamespacedName = $this->namespaceHelper->getSingularNamespacedName(\n $this->entityFqn,\n $subDirs\n );\n $this->pluralNamespacedName = $this->namespaceHelper->getPluralNamespacedName(\n $this->entityFqn,\n $subDirs\n );\n $this->setDestinationDirectory(\n $className,\n $subDirs\n );\n $plural = ucfirst(MappingHelper::getPluralForFqn($this->entityFqn));\n $singular = ucfirst(MappingHelper::getSingularForFqn($this->entityFqn));\n $nsNoEntities = implode('\\\\', array_slice($subDirs, 2));\n $this->singularNamespace = ltrim($nsNoEntities . '\\\\' . $singular, '\\\\');\n $this->pluralNamespace = ltrim($nsNoEntities . '\\\\' . $plural, '\\\\');\n $this->dirsToRename = [];\n $this->filesCreated = [];\n }",
"protected function setInitialRootPath() {}",
"function mscaffolding_prepare_directories($name)\n\t{\n\t\tmkdir(\"data/scaffolding/\" . $name);\n\t\tmkdir(\"data/scaffolding/\" . $name . \"/views\");\n\t}",
"protected function buildFsTree()\n {\n mkdir($this->config_path, 0755, true);\n mkdir($this->compiledViewsPath(), 0755, true);\n }",
"public function init()\n {\n chdir($this->context['source_dir']);\n $this->loadConfig();\n $this->context['temp_dir'] = $this->cacheDir(\"upgrades/temp\");\n $this->context['extract_dir'] = $this->context['temp_dir'];\n $this->ensureDir($this->context['temp_dir']);\n $this->context['state_file'] = $this->cacheDir('upgrades/') . self::STATE_FILE;\n $this->context['upgrader_dir'] = dirname(__FILE__);\n $this->loadState();\n $this->context['backup_dir'] = $this->config['upload_dir'] . \"/upgrades/backup/\" . pathinfo(\n $this->context['zip'],\n PATHINFO_FILENAME\n ) . \"-restore\";\n if (isset($this->context['script_mask'])) {\n $this->script_mask &= $this->context['script_mask'];\n }\n if (isset($this->state['extract_dir'])) {\n $this->context['extract_dir'] = $this->state['extract_dir'];\n }\n if (empty($this->context['health_check_path'])) {\n $this->context['health_check_path'] =\n realpath($this->context['extract_dir']) . self::DEFAULT_HEALTHCHECK_PATH;\n }\n $this->context['case_insensitive_fs'] = $this->testFilesystemCaseInsensitive();\n $this->context['versionInfo'] = self::getVersion();\n\n $this->initialized = true;\n }",
"protected function _before() {\n\t\tparent::_before ();\n\t\t$this->uFileSystem = new UFileSystem ();\n\t\t$this->testDir = $this->uFileSystem->cleanFilePathname ( \\ROOT . \\DS . \"tests-files/\" );\n\t\t$this->uFileSystem->xcopy ( $this->uFileSystem->cleanFilePathname ( \\ROOT . \\DS . \"files-tests/\" ), $this->testDir );\n\t}",
"protected function getFilesInDirCreateTestDirectory() {}",
"protected function setUp()\n {\n $this->dir = sys_get_temp_dir() . '/q-config_dirtest-' . md5(uniqid());\n \n mkdir($this->dir);\n mkdir(\"{$this->dir}/dir1\");\n mkdir(\"{$this->dir}/dir2\");\n touch(\"{$this->dir}/file1.mock\");\n touch(\"{$this->dir}/file2.mock\");\n touch(\"{$this->dir}/dir1/file3.mock\");\n touch(\"{$this->dir}/dir1/file4.mock\");\n \n $this->file = \"{$this->dir}/file1.mock\";\n \n Q\\Transform::$drivers['from-mock'] = 'Config_Mock_Unserialize';\n }",
"public function setUp()\n {\n $this->fs = new Filesystem();\n $this->cacheDir = __DIR__ . '/cache';\n if ($this->fs->exists($this->cacheDir)) {\n $this->fs->remove($this->cacheDir);\n }\n\n $this->cache = new ConfigFileScriptCache($this->cacheDir, true);\n }",
"public function setUp()\n {\n $folder = dirname(__DIR__) . '/fixtures';\n\n $this->keyVal(true);\n $this->_mutableLoader = new Loader($folder);\n $this->_immutableLoader = new Loader($folder, true);\n }",
"public function loadDir($directory);",
"public function createBaseFilesAndFolders()\n {\n $this\n ->createRootFolder()\n ->createRelsFolderAndFile()\n ->createDocPropsFolderAndFiles()\n ->createXlFolderAndSubFolders();\n }",
"public function prepareDirectory(): void\n {\n if (!file_exists($makerRepoPath = sprintf('%s/maker-repo', $this->cachePath))) {\n MakerTestProcess::create(sprintf('git clone %s %s', $this->rootPath, $makerRepoPath), $this->cachePath)->run();\n }\n\n if (!$this->fs->exists($this->flexPath)) {\n $this->buildFlexSkeleton();\n }\n\n if (!$this->fs->exists($this->path)) {\n try {\n // let's do some magic here git is faster than copy\n MakerTestProcess::create(\n '\\\\' === \\DIRECTORY_SEPARATOR ? 'git clone %FLEX_PATH% %APP_PATH%' : 'git clone \"$FLEX_PATH\" \"$APP_PATH\"',\n \\dirname($this->flexPath),\n [\n 'FLEX_PATH' => $this->flexPath,\n 'APP_PATH' => $this->path,\n ]\n )\n ->run();\n\n // In Window's we have to require MakerBundle in each project - git clone doesn't symlink well\n if ($this->isWindows) {\n $this->composerRequireMakerBundle($this->path);\n }\n\n // install any missing dependencies\n $dependencies = $this->determineMissingDependencies();\n if ($dependencies) {\n MakerTestProcess::create(sprintf('composer require %s', implode(' ', $dependencies)), $this->path)\n ->run();\n }\n\n $this->changeRootNamespaceIfNeeded();\n\n file_put_contents($this->path.'/.gitignore', \"var/cache/\\nvendor/\\n\");\n\n MakerTestProcess::create('git diff --quiet || ( git config user.name \"symfony\" && git config user.email \"test@symfony.com\" && git add . && git commit -a -m \"second commit\" )',\n $this->path\n )->run();\n } catch (\\Exception $e) {\n $this->fs->remove($this->path);\n\n throw $e;\n }\n } else {\n MakerTestProcess::create('git reset --hard && git clean -fd', $this->path)->run();\n }\n }",
"protected function loadFiles() {\n if ($this->loaded === true) {\n return;\n }\n $iter = new RecursiveDirectoryIterator($this->directory);\n $this->iterateFiles($iter);\n $this->loaded = true;\n }",
"private function _prepareTemplate()\r\n {\r\n $this->_template = array();\r\n $this->_prepareTemplateDirectory($this->_templateXml->children(), $this->_template);\r\n }",
"function createImportDirectory()\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$svy_data_dir = ilUtil::getDataDir().\"/svy_data\";\n\t\tilUtil::makeDir($svy_data_dir);\n\t\t\n\t\tif(!is_writable($svy_data_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Survey Data Directory (\".$svy_data_dir\n\t\t\t\t.\") not writeable.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\n\t\t// create test directory (data_dir/svy_data/svy_<id>)\n\t\t$svy_dir = $svy_data_dir.\"/svy_\".$this->getId();\n\t\tilUtil::makeDir($svy_dir);\n\t\tif(!@is_dir($svy_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Survey Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\n\t\t// create import subdirectory (data_dir/svy_data/svy_<id>/import)\n\t\t$import_dir = $svy_dir.\"/import\";\n\t\tilUtil::makeDir($import_dir);\n\t\tif(!@is_dir($import_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Import Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\t}",
"protected function setUp()\n {\n parent::setUp();\n $this->vfs = Vfs::setup('root');\n }",
"protected function setInitialRelativePath() {}",
"abstract public function getRelativeDataDir();",
"protected function setUp()\n {\n $tempDir = tempnam(sys_get_temp_dir(),'');\n if (file_exists($tempDir)) {\n unlink($tempDir);\n }\n mkdir($tempDir);\n chdir($tempDir);\n exec('unzip '.__DIR__.'/gitRepo.zip');\n exec('git checkout .');\n $this->testDir = $tempDir;\n }",
"function createDataPaths() {\n foreach ($this->data_paths as $path) {\n if (!file_exists($this->root . $path)) {\n mkdir($this->root . $path);\n }\n }\n }",
"public function testDir_EagerLoad()\n {\n $config = new Config_Dir($this->dir, array('transformer'=>'from-mock', 'ext'=>'mock','loadall'=>true));\n\n $this->assertType('Q\\Config_Dir', $config);\n\n $this->assertArrayHasKey('dir1', (array)$config);\n $this->assertArrayHasKey('dir2', (array)$config);\n $this->assertArrayHasKey('file1', (array)$config);\n\n $this->assertArrayHasKey('file3', (array)$config['dir1']);\n $this->assertArrayHasKey('file4', (array)$config['dir1']); \n }",
"protected function initializeFileStorages() {}",
"public function __construct()\n {\n $this->tempDirectories = array(\n 'main' => PATH_site . 'typo3temp/razor/',\n 'cache' => PATH_site . 'typo3temp/razor/Temp/',\n );\n }",
"private function __construct()\n {\n \t$this->storage_dir = $_SERVER[\"DOCUMENT_ROOT\"] . '/storage';\n }",
"protected function _initFilesystem() {\n $this->_createWriteableDir($this->getTargetDir());\n $this->_createWriteableDir($this->getQuoteTargetDir());\n\n // Directory listing and hotlink secure\n $io = new Varien_Io_File();\n $io->cd($this->getTargetDir());\n if (!$io->fileExists($this->getTargetDir() . DS . '.htaccess')) {\n $io->streamOpen($this->getTargetDir() . DS . '.htaccess');\n $io->streamLock(true);\n $io->streamWrite(\"Order deny,allow\\nAllow from all\");\n $io->streamUnlock();\n $io->streamClose();\n }\n }",
"function __construct() {\n $this->_determine_custom_dir( dirname( __FILE__ ) );\n }",
"public static function setUpBeforeClass()\n {\n $fileSystemHelper = new FileSystemHelper(__DIR__ . '/cache');\n\n if (is_dir(__DIR__ . '/cache/builder') === false) {\n $fileSystemHelper->createFolder(__DIR__ . '/cache', 'builder');\n }\n }",
"public function setUp()\n {\n $this->set('\\Gustavus\\Resources\\JSMin', 'stagingDir', '/cis/lib/Gustavus/Resources/Test/files/staging/');\n if (!file_exists('/cis/lib/Gustavus/Resources/Test/files/staging/')) {\n mkdir('/cis/lib/Gustavus/Resources/Test/files/staging/');\n }\n if (!file_exists(JSMin::$minifiedFolder)) {\n mkdir(JSMin::$minifiedFolder);\n }\n if (!file_exists(CSSMin::$minifiedFolder)) {\n mkdir(CSSMin::$minifiedFolder);\n }\n }",
"private function updatePaths()\n\t{\n\t\t$hash = $this->e107->makeSiteHash($this->previous_steps['mysql']['db'],$this->previous_steps['mysql']['prefix']);\n\t\t$this->e107->site_path = $hash;\t\n\t\t\n\t\t$this->previous_steps['paths']['hash'] = $hash;\n\n\t\t$omit = array('FILES_DIRECTORY','WEB_IMAGES_DIRECTORY');\n\t\t\n\t\tforeach($this->e107->e107_dirs as $dir => $p)\n\t\t{\n\t\t\tif(in_array($dir, $omit)) { continue; }\t\n\t\t\t\n\t\t\t$this->e107->e107_dirs[$dir] = str_replace(\"[hash]\", $hash, $this->e107->e107_dirs[$dir]);\n\t\t\t\t\t\n\t\t\tif(!is_dir($this->e107->e107_dirs[$dir]))\n\t\t\t{\n\t\t\t\t@mkdir($this->e107->e107_dirs[$dir]);\t\n\t\t\t}\t\t\t\t\t\n\t\t}\n\t}",
"private function checkDir()\n {\n $this->init = $this->url[0].'/';\n\n for ($i=0; $i < $this->count; $i++) { \n if (is_dir($this->init)) {\n if ($i == 0) {\n $this->dir .= $this->init;\n } elseif (is_dir($this->dir.$this->url[$i])) {\n $this->dir .= $this->url[$i].'/';\n } else {\n $this->file = $this->url[$i];\n break;\n }\n } else {\n if ($i == 0) {\n $this->dir .= 'views/';\n }\n \n if (is_dir($this->dir.$this->url[$i])) {\n $this->dir .= $this->url[$i].'/';\n } else {\n $this->file = $this->url[$i];\n break;\n }\n \n }\n }\n\n $this->dir = str_replace(\"//\", \"/\", $this->dir);\n $this->checkFile();\n }",
"protected function scanDir()\n {\n $this->moduleList = [];\n foreach ($this->getVendorList() as $vendorName) {\n $this->moduleList[$vendorName] = [];\n }\n\n $this->readModules();\n }",
"private function loadFiles()\n {\n $finder = new Finder();\n\n foreach (Config::get('routing_dirs') as $directory) {\n $finder\n ->files()\n ->name('*.yml')\n ->in($directory)\n ;\n\n foreach ($finder as $file) {\n $resource = $file->getRealPath();\n $this->routes = array_merge($this->routes, Yaml::parse(file_get_contents($resource)));\n }\n }\n }",
"protected function setUp()\n {\n $this->_oldIncludePath = get_include_path();\n\n // add _files dir to include path\n $addToPath = dirname(__FILE__) . '/_files';\n set_include_path($addToPath . PATH_SEPARATOR . $this->_oldIncludePath);\n }",
"protected function init()\n {\n $files = $this->fs->findFile('', 'init', 'php', true, true);\n\n if (!$files) {\n return;\n }\n\n $files = array_reverse($files);\n\n $di = $this->getDI();\n\n foreach ($files as $file) {\n include $file;\n }\n\n }",
"protected function load_files() {\n\t\trequire_once __DIR__ . '/class-papi-admin-meta-handler.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-option-handler.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-entry-post.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-entry-taxonomy.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-columns.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-page-type-switcher.php';\n\t}",
"function setUp() {\n\t\tglobal $fakeExtensions;\n\t\t$fakeExtensions = array();\n\n\t\t$tmpName = tempnam( sys_get_temp_dir(), __CLASS__ );\n\t\tunlink( $tmpName );\n\t\tmkdir( $tmpName . \"/extensions\", 0777, /* recursive: */ true );\n\t\t$this->tmpName = $tmpName;\n\t}",
"function LocalDir($path) {\n parent::FileList($path);\n $this->handle = opendir($this->path);\n }",
"private function packFiles()\n {\n // load core\n $this->builder->putVehicle($this->builder->createVehicle('xPDOFileVehicle', [\n 'vehicle_class' => 'xPDOFileVehicle',\n 'object' => [\n 'source' => __DIR__ . '/../core/components/' . self::PKG_NAME,\n 'target' => \"return MODX_CORE_PATH . 'components/';\"\n ]\n ]));\n\n // load assets\n $this->builder->putVehicle($this->builder->createVehicle('xPDOFileVehicle', [\n 'vehicle_class' => 'xPDOFileVehicle',\n 'object' => [\n 'source' => __DIR__ . '/../assets/components/' . self::PKG_NAME,\n 'target' => \"return MODX_ASSETS_PATH . 'components/';\"\n ]\n ]));\n }",
"public static function setUpBeforeClass(): void\n {\n parent::setUpBeforeClass();\n\n // Create a compile dir\n $compileDir = tempnam(sys_get_temp_dir(), 'smarty_compile_');\n unlink($compileDir);\n mkdir($compileDir);\n\n self::$compileDir = $compileDir;\n }",
"protected function prepareCache()\n {\n $oldUmask = umask(0);\n mkdir($this->cacheDirectory, 0777);\n mkdir($this->getObjectsDirectory(), 0777);\n\n $this->cacheInfo = array(\"objects\" => array());\n file_put_contents($this->cacheDirectory . self::CACHE_INFO_FILENAME, json_encode(array(\"cache\" => $this->cacheInfo)));\n @chmod($this->cacheDirectory . self::CACHE_INFO_FILENAME, 0666);\n umask($oldUmask);\n }",
"public function setInitialPaths() {}",
"public function testDir_LazyLoad()\n {\n $config = new Config_Dir($this->dir, array('transformer'=>'from-mock', 'ext'=>'mock'));\n\n $this->assertType('Q\\Config_Dir', $config);\n $this->assertEquals(array(), (array)$config);\n \n $cfg_file1 = $config['file1'];\n $this->assertType('Q\\Config_File', $cfg_file1);\n $this->assertEquals(array(\"db\"=>array(\"host\"=>\"localhost\", \"dbname\"=>\"test\",\"user\"=>\"myuser\",\"pwd\"=>\"mypwd\"),\"output\"=>\"xml\",\"input\"=>\"json\"), (array)$cfg_file1);\n $this->assertArrayHasKey('file1', (array)$config);\n $this->assertArrayNotHasKey('dir1', (array)$config);\n\n $cfg_dir1 = $config['dir1'];\n $this->assertType('Q\\Config_Dir', $cfg_dir1);\n $this->assertEquals(array(), (array)$cfg_dir1);\n $this->assertArrayHasKey('file1', (array)$config);\n $this->assertArrayHasKey('dir1', (array)$config); \n }",
"public function initalizeObjectCreatesDirectories()\n {\n $publishingTarget = $this->getAccessibleMock('TYPO3\\Flow\\Resource\\Publishing\\FileSystemPublishingTarget', array('dummy'));\n\n $publishingTarget->_set('resourcesPublishingPath', 'vfs://Foo/Web/_Resources/');\n $publishingTarget->initializeObject();\n\n $this->assertFileExists('vfs://Foo/Web/_Resources');\n $this->assertFileExists('vfs://Foo/Web/_Resources/Persistent');\n }",
"protected function setUp(): void\n {\n vfsStream::setup('root', null, [\n 'home' => [\n '.exception-generator.json' => 'empty yet',\n ],\n 'currentdir' => ['test' => []],\n 'expectedpath' => [\n 'exception.phtml' => '',\n ],\n ]);\n\n $this->object = new TemplatePathMatcher(\n vfsStream::url('root/currentdir/test/bar'),\n vfsStream::url('root/home')\n );\n\n $this->configPath = vfsStream::url('root/home/.exception-generator.json');\n }",
"private function determineFixturesPath() {}",
"public function set_test_directory_list() {\n\t\tforeach ($this->directory_list as $dir_name) {\n\t\t\t$dir=dir($dir_name);\n\t\t\twhile(( $file=$dir->read()) !==false) {\n\t\t\t\tif (preg_match(\"/\\w+\\.phpt$/\", $file)) {\n\t\t\t\t\tarray_push($this->test_directory_list, $dir_name);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function setUp(): void\n {\n $control = sprintf('%s/_files/testfile.txt', dirname(__DIR__));\n $this->tmpPath = sprintf('%s%s%s', sys_get_temp_dir(), DIRECTORY_SEPARATOR, uniqid('laminasilter'));\n mkdir($this->tmpPath, 0775, true);\n\n $this->oldFile = sprintf('%s%stestfile.txt', $this->tmpPath, DIRECTORY_SEPARATOR);\n $this->origFile = sprintf('%s%soriginal.file', $this->tmpPath, DIRECTORY_SEPARATOR);\n $this->newFile = sprintf('%s%snewfile.xml', $this->tmpPath, DIRECTORY_SEPARATOR);\n $this->newDir = sprintf('%s%stestdir', $this->tmpPath, DIRECTORY_SEPARATOR);\n $this->newDirFile = sprintf('%s%stestfile.txt', $this->newDir, DIRECTORY_SEPARATOR);\n\n copy($control, $this->oldFile);\n copy($control, $this->origFile);\n mkdir($this->newDir, 0775, true);\n }",
"public function setUp(): void\n {\n parent::setUp();\n\n Settings::resetStaticProps();\n\n $dir = self::resolveBaseProjectDir();\n chdir($dir);\n Settings::setProjectRootDir($dir);\n }",
"protected function defineOriginalRootPath() {}",
"private function ensureFolderStructure()\n {\n $localeDir = Strata::getLocalePath();\n if (!is_dir($localeDir)) {\n mkdir($localeDir);\n }\n }",
"public function loadAll()\n {\n $this->setAll(array());\n $d = dir($this->getPath());\n $this->load($d);\n $d->close();\n }",
"public function load() {\n\t\t$this->copyFromTemplateIfNeeded();\n\t\trequire $this->filePath;\n\t\t$this->vars = $vars;\n\t}",
"public final function prep(){\n\n //disable apache from append session ids to requests\n ini_set('session.use_trans_sid',0);\n //only allow sessions to be used with cookies\n ini_set('session.use_only_cookies',1);\n\n //base directory of application\n //$this->path = dirname($_SERVER['DOCUMENT_ROOT']);\n $this->path = dirname(dirname(dirname(dirname(dirname(__DIR__)))));\n \n //load the appropriate application production configuration \n //and override with any dev config.\n if(is_file($this->path.'/.config.php')){\n $this->config = require($this->path.'/.config.php');\n if($this->config['APP_MODE']!='PROD' && is_file($this->path.'/.dev.config.php')){\n $this->config = array_merge($this->config,require($this->path.'/.dev.config.php'));\n }//if\n }//if\n \n //if the COMPOSER PATH isn't set then resort to the default installer path \"vendor/\"\n if(!isset($this->config['COMPOSER_PATH'])){\n $this->config['COMPOSER_PATH'] = 'vendor';\n }//if\n\n }",
"public function createDirectories()\n {\n self::createDirectory($this->contentDirectoryPath);\n\n if ($this->staticPreviewIsEnabled())\n self::createDirectory($this->cacheDirectoryPath);\n }",
"public function dir_rewinddir() {}",
"public static function loadInventoryFixtures(): void\n {\n include __DIR__ . '/../../../_files/source_items_on_default_source.php';\n }",
"public function __construct(){\r\n\t\t$dir = $this->dir;\r\n\t}",
"protected function setUp()\n {\n vfsStream::setup('root');\n $this->config = new MultilevelBag();\n }",
"public function setUp() {\n\t\t\\OMV\\Environment::set(\"OMV_CONFIG_FILE\", sprintf(\n\t\t\t\"%s/../data/config.xml\", getcwd()));\n\t\t// Setup the model manager.\n\t\t$modelMngr = \\OMV\\DataModel\\Manager::getInstance();\n\t\t$modelMngr->load();\n\t}",
"protected function createOtherDirs()\n {\n $this->createDir('Database', true);\n $this->createDir('Database/Migrations', true);\n $this->createDir('Database/Seeds', true);\n $this->createDir('Filters', true);\n $this->createDir('Language', true);\n $this->createDir('Validation', true);\n }",
"function checkPaths() {\n\tif(!file_exists(MODEL_PATH)) {\n\t\tmkdir(MODEL_PATH);\n\t}\n\tif(!file_exists(ENTITY_PATH)) {\n\t\tmkdir(ENTITY_PATH);\n\t}\n\tif(!file_exists(REPOSITORY_PATH)) {\n\t\tmkdir(REPOSITORY_PATH);\n\t}\n}",
"protected function setUp() {\n\t\tparent::setUp();\n\n\t\t// All tests in this class can only be run as root.\n\t\tif (!function_exists('posix_getuid') || 0 != posix_getuid()) {\n\t\t\t$this->markTestSkipped('This test may only be run as root on a unix filesystem with the posix extension');\n\t\t}\n\n\t\tclearstatcache();\n\n\t\t$this->testBasePath = rtrim(getenv('YAPEPBASE_TEST_TEMPPATH'), DIRECTORY_SEPARATOR);\n\n\t\tif (empty($this->testBasePath)) {\n\t\t\t$this->markTestSkipped('Test cannot be done without a test directory');\n\t\t} else {\n\t\t\t$this->testBasePath .= DIRECTORY_SEPARATOR;\n\t\t}\n\n\t\tif (stripos(PHP_OS, 'WIN') === 0) {\n\t\t\t$this->markTestSkipped('The Unix file handler tests can not be run on Windows');\n\t\t}\n\n\t\tif (!file_exists($this->testBasePath) && !mkdir($this->testBasePath, 0755, true)) {\n\t\t\t$this->markTestSkipped('The given path does not exist, and cannot be created: ' . $this->testBasePath);\n\t\t}\n\n\t\t$this->cleanupTestDirectory();\n\n\t\t$this->fileHandler = new FileHandlerUnix();\n\t}",
"function prepare() {\n\t\t\tcopy( \\Rum::config()->fixtures . '/Address Book.csv', __ROOT__ . '/app/data/Address Book.csv' );\n\t\t}",
"public function setUp()\n\t {\n\t\t$this->_testsetFolder = __DIR__ . \"/schematestsets/schemafragment\";\n\t }",
"private static function setup()\n {\n $files = ['Routes', 'Setup', 'Response'];\n $folder = static::$root.'Setup'.'/';\n\n self::call($files, $folder);\n\n $files = ['Database', 'Panel', 'Security', 'Maintenance', 'Loggin', 'Translator', 'App', 'Robots'];\n $folder = static::$root.'Setup/Documentations'.'/';\n\n self::call($files, $folder);\n\n $files = ['AppSetupException'];\n $folder = static::$root.'Setup/Exceptions'.'/';\n\n self::call($files, $folder);\n }",
"public function createFromRealDirectory($realPath);",
"public function setUp() {\n $this->temp= new Folder(\\lang\\System::tempDir());\n $this->spec= new GlueSpec();\n }",
"function setUp() {\n\t\t$this->dataLong = file_get_contents(__DIR__ . '/../lib/crypt.php');\n\t\t$this->dataShort = 'hats';\n\t\t$this->dataUrl = __DIR__ . '/../lib/crypt.php';\n\t\t$this->legacyData = __DIR__ . '/legacy-text.txt';\n\t\t$this->legacyEncryptedData = __DIR__ . '/legacy-encrypted-text.txt';\n\t\t$this->randomKey = Encryption\\Crypt::generateKey();\n\n\t\t$keypair = Encryption\\Crypt::createKeypair();\n\t\t$this->genPublicKey = $keypair['publicKey'];\n\t\t$this->genPrivateKey = $keypair['privateKey'];\n\n\t\t$this->view = new \\OC_FilesystemView('/');\n\n\t\t\\OC_User::setUserId(\\Test_Encryption_Keymanager::TEST_USER);\n\t\t$this->userId = \\Test_Encryption_Keymanager::TEST_USER;\n\t\t$this->pass = \\Test_Encryption_Keymanager::TEST_USER;\n\n\t\t$userHome = \\OC_User::getHome($this->userId);\n\t\t$this->dataDir = str_replace('/' . $this->userId, '', $userHome);\n\n\t\t// remember files_trashbin state\n\t\t$this->stateFilesTrashbin = OC_App::isEnabled('files_trashbin');\n\n\t\t// we don't want to tests with app files_trashbin enabled\n\t\t\\OC_App::disable('files_trashbin');\n\t}",
"public static function setUpBeforeClass(): void\n {\n $count = 0;\n self::getBlockVirtualTypesWithDifferentModule();\n foreach (Files::init()->getLayoutFiles([], false) as $file) {\n $xml = simplexml_load_file($file);\n $blocks = $xml->xpath('//block[@template]') ?: [];\n $fileTemplates = [];\n foreach ($blocks as $block) {\n $fileTemplates[] = ['class' => (string)$block['class'], 'file' => (string)$block['template']];\n }\n if (!empty($fileTemplates)) {\n self::$templates[$file] = $fileTemplates;\n $count += count($fileTemplates);\n }\n }\n }",
"protected function auto_register_files()\r\n\t\t{\r\n\t\t\t// initialize variables\r\n\t\t\t$level = 0;\r\n\t\t\t\r\n\t\t\t// look through each director\r\n\t\t\tforeach( $this->paths as $i => $path )\r\n\t\t\t{\r\n\t\t\t\t// initialize variables\r\n\t\t\t\t$j \t\t= $level + 1001;\r\n\t\t\t\t$files \t= glob( \"{$path}*\" . self::REAL_EXT );\r\n\t\t\t\t$len \t= strlen( self::REAL_EXT );\r\n\t\t\t\t\r\n\t\t\t\tforeach( $files as $f )\r\n\t\t\t\t{\r\n\t\t\t\t\t// determine handle\r\n\t\t\t\t\t$file_name \t= substr( $f, 0, strlen( $f ) - $len );\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ( strpos( $file_name, $this->local ) !== false )\r\n\t\t\t\t\t\t$file_name = substr( $file_name, strlen( $this->local ) );\r\n\t\t\t\t\t\r\n\t\t\t\t\t$handle \t= $i == self::ROOT_PATH ? strtoupper( self::ROOT_PATH ) . \"_\" : \"\";\r\n\t\t\t\t\t$handle \t.= preg_replace( \"/[^\\w]/\", \"_\", strtoupper( $file_name ) );\r\n\t\t\t\t\tdefine( $handle, $handle );\r\n\t\t\t\t\t/* The old page id number define( $handle . '_PAGEID', $j );*/\r\n\t\t\t\t\t\r\n\t\t\t\t\t// get rid of system directories\r\n\t\t\t\t\tif ( strpos( $file_name, $this->local ) !== false )\r\n\t\t\t\t\t\t$file_name = substr( $file_name, strlen( $this->local ) );\r\n\t\t\t\t\t\r\n\t\t\t\t\t// define properties\r\n\t\t\t\t\t$this->files[ $handle ] = $file_name;\r\n\t\t\t\t\t$this->urls[ $handle ] = $this->url . str_replace( \"\\\\\", \"/\", $file_name );\r\n\t\t\t\t\t$j++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// increment for next path\r\n\t\t\t\t$level += 1000;\r\n\t\t\t\t$j = 1;\r\n\t\t\t}\r\n\t\t}",
"public function setUp()\n {\n parent::setUp();\n\n $this->file = sys_get_temp_dir() . DS . 'serialized';\n $this->SerializedArray = new SerializedArray($this->file);\n }",
"protected function setUp()\r\n {\r\n $this->object = new Json;\r\n mkdir('data/tests');\r\n file_put_contents('data/tests/test.json', json_encode(\\MockObject\\FileDataStub::getData()));\r\n }",
"public function setUp() {\n $this->libraryLoader= \\lang\\ClassLoader::registerLoader(new \\lang\\archive\\ArchiveClassLoader(new Archive(\\lang\\XPClass::forName(\\xp::nameOf(__CLASS__))\n ->getPackage()\n ->getPackage('lib')\n ->getResourceAsStream('three-and-four.xar')\n )));\n }",
"protected function setUp() {\n\t\tparent::setUp();\n\n\t\t$this->object = new Transit($this->data);\n\t\t$this->object->setDirectory(TEMP_DIR);\n\t}",
"abstract public function directoryLocation();",
"public function load_files() {\n\n\t\t// Load our admin-related functions.\n\t\tif ( is_admin() ) {\n\t\t\trequire_once( GUPR_DIR . 'lib/admin.php' );\n\t\t}\n\t}",
"public function testBasedir()\n {\n $this->buildContainer(\n $this->resolveOptions([\n ])\n );\n }",
"public function __construct() {\n // TODO: put here some basic verifications: tmp & photos directories exists and writeable ; install.php ; conf OK !\n }",
"protected function setUpInstancePath() {\n\t\t$this->instancePath = BEHAT_ROOT;\n\t}",
"protected function createDirectories() :void\n {\n $directories = ['Entities', 'Resources', 'Services'];\n\n foreach ($directories as $directory) {\n $directory = app_path($directory);\n\n Storage::makeDirectory($directory, true);\n Storage::put($directory . '/' . '.gitkeep', \"\");\n }\n }",
"protected function initFileLoader() \n\t{\n\t\t$this->fileLoader = new FileLoader();\n\t}",
"private function setup()\n {\n $home = getenv('PHLEXGET_HOME');\n $cacheDir = getenv('PHLEXGET_CACHE_DIR');\n if (!$home) {\n if (defined('PHP_WINDOWS_VERSION_MAJOR')) {\n $home = strtr(getenv('APPDATA'), '\\\\', '/') . '/Phlexget';\n } else {\n $home = rtrim(getenv('HOME'), '/') . '/.phlexget';\n }\n }\n if (!$cacheDir) {\n if (defined('PHP_WINDOWS_VERSION_MAJOR')) {\n if ($cacheDir = getenv('LOCALAPPDATA')) {\n $cacheDir .= '/Phlexget';\n } else {\n $cacheDir = getenv('APPDATA') . '/Phlexget/cache';\n }\n $cacheDir = strtr($cacheDir, '\\\\', '/');\n } else {\n $cacheDir = $home.'/cache';\n }\n }\n\n // Protect directory against web access. Since HOME could be\n // the www-data's user home and be web-accessible it is a\n // potential security risk\n foreach (array($home, $cacheDir) as $dir) {\n if (!file_exists($dir . '/.htaccess')) {\n if (!is_dir($dir)) {\n @mkdir($dir, 0777, true);\n }\n @file_put_contents($dir . '/.htaccess', 'Deny from all');\n }\n }\n\n $this->homeDir = $home;\n $this->cacheDir = $cacheDir;\n }",
"protected function initializeExtensionFiles() {}"
] | [
"0.6459662",
"0.63972",
"0.63940936",
"0.635077",
"0.6279006",
"0.6257096",
"0.61878026",
"0.6186471",
"0.6176269",
"0.6118358",
"0.6074575",
"0.60563093",
"0.60563093",
"0.6000353",
"0.59908193",
"0.59522694",
"0.5946168",
"0.59277886",
"0.5925607",
"0.5924923",
"0.59158677",
"0.5914713",
"0.5894527",
"0.58878344",
"0.58804184",
"0.58633584",
"0.5860081",
"0.5850541",
"0.580782",
"0.58039486",
"0.57921433",
"0.57851076",
"0.5780726",
"0.573557",
"0.5735533",
"0.57347256",
"0.5733835",
"0.572988",
"0.5691574",
"0.5689737",
"0.56800807",
"0.5677441",
"0.56733125",
"0.56686795",
"0.56624997",
"0.565515",
"0.56365347",
"0.56302077",
"0.56232494",
"0.56228083",
"0.5620137",
"0.56155103",
"0.56041443",
"0.56038797",
"0.55866086",
"0.5582011",
"0.55801105",
"0.55796605",
"0.5579216",
"0.5571971",
"0.5567922",
"0.55526125",
"0.55509895",
"0.554004",
"0.5533843",
"0.55296296",
"0.5528062",
"0.55202025",
"0.55159545",
"0.5510357",
"0.5509776",
"0.55086356",
"0.5508089",
"0.55030257",
"0.54976845",
"0.54975617",
"0.5496358",
"0.5493874",
"0.5491229",
"0.54882866",
"0.54824245",
"0.54806095",
"0.54805917",
"0.54789037",
"0.547698",
"0.5475595",
"0.5470312",
"0.54665744",
"0.5464781",
"0.5446365",
"0.5436587",
"0.543458",
"0.5433426",
"0.54309165",
"0.54265475",
"0.5426376",
"0.54219717",
"0.54213387",
"0.5419119",
"0.54188484"
] | 0.6234509 | 6 |
Prepares function that takes mock object for data loader and performs its additional preparation. | private function prepareDataLoaderMockCallback(string $path, array $expectedFilesMap, ?array $expectedLoadData = null): callable
{
return static function (MockInterface $dataLoaderMock) use ($expectedFilesMap, $expectedLoadData, $path) {
foreach ($expectedFilesMap as $key => $expectedFile) {
$filePath = "$path/$expectedFile";
$returnData = $expectedLoadData[$key] ?? [];
$dataLoaderMock->shouldReceive('load')->withArgs([$filePath])->andReturn($returnData);
}
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function prepareData();",
"function _prepare() {}",
"protected function setUp()\n {\n $this->object = new Loader;\n }",
"abstract protected function _prepare();",
"protected function _prepareMockObjects()\n {\n $this->requestMock = $this->getMockBuilder(\\Magento\\Framework\\App\\Request\\Http::class)\n ->disableOriginalConstructor()\n ->getMock();\n $this->objectManagerMock = $this->createMock(\\Magento\\Framework\\ObjectManagerInterface::class);\n $this->storeManagerMock = $this->getMockForAbstractClass(\\Magento\\Store\\Model\\StoreManagerInterface::class);\n $this->storeModelMock = $this->createPartialMock(\\Magento\\Store\\Model\\Store::class, ['__wakeup', 'getId']);\n $this->reviewMock = $this->createPartialMock(\n \\Magento\\Review\\Model\\Review::class,\n ['__wakeup', 'create', 'save', 'getId', 'getResource', 'aggregate', 'getEntityIdByCode']\n );\n $this->reviewFactoryMock = $this->createPartialMock(\\Magento\\Review\\Model\\ReviewFactory::class, ['create']);\n $this->ratingMock = $this->createPartialMock(\n \\Magento\\Review\\Model\\Rating::class,\n ['__wakeup', 'setRatingId', 'setReviewId', 'addOptionVote']\n );\n $this->ratingFactoryMock = $this->createPartialMock(\\Magento\\Review\\Model\\RatingFactory::class, ['create']);\n $this->resultFactoryMock = $this->getMockBuilder(\\Magento\\Framework\\Controller\\ResultFactory::class)\n ->disableOriginalConstructor()\n ->getMock();\n $this->resultRedirectMock = $this->getMockBuilder(\\Magento\\Backend\\Model\\View\\Result\\Redirect::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->resultFactoryMock->expects($this->any())\n ->method('create')\n ->with(ResultFactory::TYPE_REDIRECT, [])\n ->willReturn($this->resultRedirectMock);\n }",
"protected function prepareData()\n {\n parent::prepareData();\n $this->prepareConfigurableProductOptions();\n $this->prepareAttributeSet();\n }",
"public function test_prepare_item() {}",
"protected function prepare()\n {\n $this->register('require', function($context, $path) {\n $context->requireAsset($path);\n });\n\n $this->register('depend_on', function($context, $path) {\n $context->dependOn($path);\n });\n\n $this->register('require_tree', function($context, $path) {\n $context->requireTree($path);\n });\n\n $this->body = $this->getData();\n\n if (preg_match(static::HEADER_PATTERN, $this->getData(), $matches)) {\n $this->header = $matches[0];\n $this->body = substr($this->getData(), strlen($matches[0])) ?: '';\n }\n\n $this->processed = array();\n }",
"public function setUp()\n {\n foreach (glob(__DIR__.'/../data/*.json') as $jsonFile) {\n if (basename($jsonFile) != 'json_output_test_json_fixed.json') {\n unlink($jsonFile);\n }\n }\n\n $this->data = [\n [1, 'PHP Developer', 'Mazen Kenjrawi'],\n [4, 'Dummy Classes', 'Foo Bar'],\n ];\n\n $this->headingFields = ['id', 'Title', 'Name'];\n\n $this->Loader = new Loader();\n }",
"abstract public function prepareToStore();",
"public function setUp()\n {\n $folder = dirname(__DIR__) . '/fixtures';\n\n $this->keyVal(true);\n $this->_mutableLoader = new Loader($folder);\n $this->_immutableLoader = new Loader($folder, true);\n }",
"protected function setUp()\n {\n $this->object = new LazyClassDefinition('\\stdClass');\n \n }",
"protected function setUp() {\n parent::setUp();\n $this->tempJson = $this->json;\n }",
"abstract protected function prepareData( $data );",
"public function prepare() {}",
"public function prepare() {}",
"public function prepare()\n {\n $this->status = $this->response->getStatusCode();\n\n $rawResponseData = $this->response->getBody()->getContents();\n\n $this->body = $rawResponseData ? \\GuzzleHttp\\json_decode($rawResponseData, true) : '';\n\n $this->errors = isset($this->body['errors']) ? $this->body['errors'] : [];\n\n if ($this->throwException && (substr($this->status, 0, 1) != 2)) {\n $this->throwException($this->status, $this->errors);\n }\n\n //Set data\n if ($this->body) {\n //This happens when array was expected but it is empty\n if (empty($this->body['data'])) {\n $this->data = collect([]);\n } else {\n $document = Document::createFromArray($this->body);\n $hydrator = new ClassHydrator();\n $hydrated = $hydrator->hydrate($document);\n $this->data = is_array($hydrated) ? collect($hydrated) : $hydrated;\n }\n }\n\n //Set meta\n if (isset($this->body['meta'])) {\n $this->meta = $this->body['meta'];\n }\n }",
"public function setUp()\n {\n $decereal = new ModelDeserialiser();\n $decereal->reset();\n $bar = new SimpleMetadataProvider('Data', 'Data');\n unset($bar);\n DateTime::setTimeProvider([new Carbon(), 'now']);\n }",
"private function setMockDataConfig() {\n\n }",
"public static function setup()\n\t{\n\t\tif (false === self::$data_cache_provider)\n\t\t{\n\t\t\tself::$data_cache_provider = new aw_cache();\n\t\t}\n\t}",
"protected function setUp()\n {\n parent::setUp();\n\n $this->parameters = new EncodingParameters(\n $paths = ['some.path'],\n $fieldsets = ['type' => ['field1', 'field2']]\n );\n\n $this->container = Mockery::mock(ContainerInterface::class);\n }",
"protected function prepare()\n\t{\n\t}",
"public function prepare() {\n $this->customTaxonomies = [];\n\n // Get custom taxonomy with selectors\n $this->prepareCustomTaxonomyWithSelectors();\n\n // Get manually added custom post taxonomy\n $this->prepareManuallyAddedCustomTaxonomy();\n\n // If there is no custom taxonomy, stop.\n if(empty($this->customTaxonomies)) return;\n\n // Store it\n $this->bot->getPostData()->setCustomTaxonomies($this->customTaxonomies);\n }",
"protected function setUp()\n {\n $this->cicindelaStab = $this->getMock('Net_Cicindela');\n $this->object = new Net_Cicindela_Dataset('test', $this->cicindelaStab);\n }",
"protected function setUp()\n {\n $this->object = new CommonTransformer;\n }",
"protected function _preload() {\n }",
"public function setup()\n {\n $this->addOriginToData()->addArgumentsToData();\n }",
"protected function setUp()\r\n {\r\n $this->helper = new Helper(new DefaultBuilder(), array(\"meta\", \"input\", \"br\"));\r\n $this->object = new HelperObject($this->helper, \"sample\");\r\n }",
"protected function setUp()\n {\n $this->factory = new CallableReaderFactory();\n }",
"protected function preprocessData() {}",
"public function setup()\n {\n if (! PluginRegistry::isLoaderSet()) {\n $loader = $this->getMockClass(\n 'CubicMushroom\\WordpressCore\\Component\\Plugin\\PluginLoader',\n array('hook')\n );\n PluginRegistry::setLoader(new $loader);\n }\n }",
"abstract protected function prepareContext(): void;",
"protected function setUp()\n\t{\n\t\t$this->values = array(\n\t\t\t'id' => 'product/id/1:detail-body',\n\t\t\t'siteid' => 1,\n\t\t\t'value' => 'test',\n\t\t\t'expire' => '2000-01-01 00:00:00',\n\t\t\t'tags' => array( 'tag:1', 'tag:2' ),\n\t\t);\n\n\t\t$this->object = new \\Aimeos\\MAdmin\\Cache\\Item\\Standard( $this->values );\n\t}",
"protected function setUp()\n\t{\n\t\t$this->object = $this->getMockForAbstractClass(\n\t\t\t'Ruon\\\\Loader\\\\LoaderAbstract'\n\t\t);\n\t}",
"protected function setUp()\n {\n parent::setUp();\n $driver = new StorageDriver(\n new Storage('/', new Filesystem(new LocalDriver(sys_get_temp_dir()))),\n '/cache_test'\n );\n $this->object = new CachePool($driver);\n }",
"public function prepare( $data );",
"protected function setUp() {\r\n parent::setUp();\r\n\r\n $this->_utils = $this->getProvider()->get('PM\\Main\\Utils');\r\n }",
"protected function init()\n {\n $classParser = $this->getContainer()->get('classParser');\n $classParser->setAllowedMethods( array($this->allowedMethod) );\n $this->data = $classParser->getData($this->paths, $this->cacheFile);\n }",
"protected function setUp(): void\n {\n $this->object = new HydrationOptions();\n }",
"protected function setUp()\n\t{\n\t\t$module = new stdClass;\n\t\t$this->object = $module;\n\t}",
"protected function setUp()\n\t{\n\t\t$module = new stdClass;\n\t\t$this->object = $module;\n\t}",
"private function prepareContainer() {\n $container_class = 'Drupal\\Core\\DependencyInjection\\Container';\n $methods = get_class_methods($container_class);\n /** @var ContainerInterface $container */\n $this->containerMock = $container = $this->getMockBuilder($container_class)\n ->disableOriginalConstructor()\n ->setMethods($methods)\n ->getMock();\n \\Drupal::setContainer($container);\n\n $this->containerMock->method('get')->willReturnCallback([\n $this,\n 'containerMockGetServiceCallback'\n ]);\n }",
"protected function setUp()\n {\n $this->dir = sys_get_temp_dir() . '/q-config_dirtest-' . md5(uniqid());\n \n mkdir($this->dir);\n mkdir(\"{$this->dir}/dir1\");\n mkdir(\"{$this->dir}/dir2\");\n touch(\"{$this->dir}/file1.mock\");\n touch(\"{$this->dir}/file2.mock\");\n touch(\"{$this->dir}/dir1/file3.mock\");\n touch(\"{$this->dir}/dir1/file4.mock\");\n \n $this->file = \"{$this->dir}/file1.mock\";\n \n Q\\Transform::$drivers['from-mock'] = 'Config_Mock_Unserialize';\n }",
"protected function setUp()\n\t{\n\t\t$this->object = new object('obj att', 'obj att2');\n\t}",
"protected function setUp()\n {\n $this->aClosureObjectParser = new ClosureObjectParser ;\n }",
"public abstract function setup(array $data = array());",
"protected function setUp()\n {\n $this->object = new \\Yana\\Db\\Ddl\\Functions\\Implementation();\n }",
"protected function setUp(): void\n\t{\n\t\t$this->object = new SmartyAdapter;\n\t}",
"private function prepare(){\r\n \r\n $autoload = &$this->settings->autoload; \r\n \r\n if(isset($autoload)){\r\n \r\n foreach($autoload AS $key => $class){\r\n \r\n $settings = &$this->settings->{$key};\r\n \r\n if(isset($settings)){\r\n\r\n $this->{$key} = new $class($settings);\r\n }\r\n }\r\n }\r\n }",
"protected function setUp() {\n\t\t$this->objectRegistry = new \\F3\\FLOW3\\Object\\TransientRegistry();\n\t}",
"protected function setUp()\n {\n // driver\n $driver = new Driver\\FilesystemDriver([\n 'hash_level' => 1,\n 'file_pref' => 'cache.',\n 'file_suff' => '.txt'\n ]);\n\n $this->cache = new CachePool($driver);\n\n $this->object = new CacheItem('test', $this->cache, [\n 'ttl' => 60\n ]);\n\n }",
"protected function setUp()\n {\n $this->scheduledStructure = $this->createMock(\\Magento\\Framework\\View\\Layout\\ScheduledStructure::class);\n $this->context = $this->createMock(\\Magento\\Framework\\View\\Layout\\Reader\\Context::class);\n $this->readerPool = $this->createMock(\\Magento\\Framework\\View\\Layout\\ReaderPool::class);\n }",
"protected function setUp() {\n $this->object = new LyvDAL;\n }",
"public function __prepare()\n {\n $config = $this->objectManager->get(\\Magento\\Mtf\\Config\\DataInterface::class);\n // Prepare config data\n $configData['dbHost'] = $config->get('install/0/host/0');\n $configData['dbUser'] = $config->get('install/0/user/0');\n $configData['dbPassword'] = $config->get('install/0/password/0');\n $configData['dbName'] = $config->get('install/0/dbName/0');\n $configData['baseUrl'] = $config->get('install/0/baseUrl/0');\n $configData['admin'] = $config->get('install/0/backendName/0');\n\n return ['configData' => $configData];\n }",
"protected function fixture_setup() {\r\n $this->service = SQLConnectionService::get_instance($this->configuration);\r\n test_data_setup($this->service);\r\n }",
"protected function setUp() {\n\t\t$this->_tableGateway = $this->_getCleanMock('Zend_Db_Table_Abstract');\n\t\t$this->_adapter = $this->_getCleanMock('Zend_Db_Adapter_Abstract');\n\t\t$this->_rowset = $this->_getCleanMock('Zend_Db_Table_Rowset_Abstract');\n\t\t$this->_tableGateway->expects($this->any())->method('getAdapter')->will($this->returnValue($this->_adapter));\n\n\t\t$this->object = new GTW_Model_User_Mapper($this->_tableGateway);\n\t}",
"protected function setUp() {\n $this->object = Qwin::getInstance()->fcache;\n }",
"protected function setUp() {\n\t\tparent::setUp();\n\n\t\t$this->object = new Transit($this->data);\n\t\t$this->object->setDirectory(TEMP_DIR);\n\t}",
"protected function setUp()\n\t{\n\t\t$this->object = $this->getMockForAbstractClass(\n 'Ruon\\\\Loader\\\\LoaderAutoloadAbstract'\n );\n\t}",
"protected function setUp()\n {\n $this->request = new Request();\n $this->response = new Response();\n\n $this->request->load();\n $this->response->load();\n }",
"protected function setUp()\n {\n $this->request = new Request();\n $this->response = new Response();\n\n $this->request->load();\n $this->response->load();\n }",
"public function prepare();",
"public function prepare();",
"protected function setUp()\n {\n $this->hotelMapperService = new HotelMapperService();\n $this->jsonHotels = json_encode($this->getHotelsRequestExample());\n $this->mappedHotels = $this->hotelMapperService->mapJsonToHotels($this->jsonHotels);\n $this->sort = new Sort($this->mappedHotels);\n }",
"protected function _before()\n {\n $this->repo = m::mock('Gzero\\Cms\\Repositories\\BlockReadRepository');\n $this->finder = new BlockFinder($this->repo, new CacheManager(app()));\n }",
"public function setup()\n {\n //\n // we need to make sure that it is empty at the start of every\n // test\n InvokeMethod::onString(AllMatchingTypesList::class, 'resetCache');\n }",
"protected function prepareGalleryData() {}",
"protected function setUp()\n {\n $this->object = new RandomAccessIterator(\n new ArrayIterator(\n array(\n 'key1' => 'val1',\n 'key2' => 'val2'\n )\n )\n );\n }",
"protected function setUp()\n {\n $this->object = new HandlebarsData([\n 'product_id' => 123,\n 'product_title' => 'Hello World',\n 'product_comments' => [\n 'comment1' => 'this is good',\n 'comment2' => 'this is great',\n 'comment3' => 'this is nice'\n ]\n ]);\n }",
"public function __before() {\n\t\t// runs after this->data is set up, but before the class methods are run\n\t}",
"public function setUp() {\r\n // and doing it every test slows the tests down to a crawl\r\n $this->sharedFixture = new MovieLensDataSet(DATA_DIR);\r\n }",
"protected function setUp()\n {\n $this->object = Factory::slim();\n }",
"protected function setUp()\n {\n $this->object = new Constructor_Callable(array($this, 'methodConstructor'));\n $this->called = false;\n }",
"public function setUp() {\n\t\t$this->mockObjectManager = $this->getMock('F3\\FLOW3\\Object\\ObjectManagerInterface');\n\t\t$this->mockObjectFactory = $this->getMock('F3\\FLOW3\\Object\\ObjectFactoryInterface');\n\t\t$this->mockReflectionService = $this->getMock('F3\\FLOW3\\Reflection\\ReflectionService');\n\t\t$this->mockReflectionService->expects($this->any())->method('getPropertyNamesByTag')->will($this->returnValue(array()));\n\n\t\t$this->objectBuilder = new \\F3\\FLOW3\\Object\\ObjectBuilder();\n\t\t$this->objectBuilder->injectObjectManager($this->mockObjectManager);\n\t\t$this->objectBuilder->injectObjectFactory($this->mockObjectFactory);\n\t\t$this->objectBuilder->injectReflectionService($this->mockReflectionService);\n\t}",
"protected function setUp() {\n $this->object = new UtilityIO;\n }",
"public function prepare()\n {\n }",
"public function setUp() {\n $this->transformation = new Modulate();\n }",
"public function __prepare()\n {\n $this->objectManager->create('Mage\\CatalogRule\\Test\\TestStep\\DeleteAllCatalogRulesStep')->run();\n }",
"private function initData()\n {\n $data = $this->cache->load($this->cacheId);\n if (false === $data) {\n /** @var Reader $reader */\n $reader = $this->readerFactory->create(\n ['fileName' => sprintf(self::SEARCH_PATTERN, $this->componentName)]\n );\n $data = $reader->read();\n $this->cache->save($this->serializer->serialize($data), $this->cacheId);\n } else {\n $data = $this->serializer->unserialize($data);\n }\n\n if (!empty($data)) {\n $this->data[$this->componentName] = [Converter::DATA_ATTRIBUTES_KEY => ['name' => $this->componentName]];\n $this->merge([$this->componentName => $data]);\n $this->data = $this->evaluateComponentArguments($this->data);\n }\n }",
"protected function setUp() {\n $this->object = new HeaderModel;\n }",
"public static function setUpBeforeClass() {\n\t\t$loader = new \\Mockery\\Loader();\n\t\t$loader->register();\n\t}",
"protected function setUp()\n\t{\n\t\t$this->_mock = $this->getMock( 'T3Cache' );\n\t\t$this->_object = new MW_Cache_Typo3( array(), $this->_mock );\n\t}",
"protected function setUp()\n { \n $settings = require __DIR__ . '/../../../config/settings.php';\n $container = new \\Slim\\Container($settings);\n $container['stockconfig'] = function ($config) {\n $stockconfig =$config['settings']['stockconfig']; \n return $stockconfig;\n };\n $dependencies = new Dependencies($container);\n $dependencies->registerLogger();\n $dependencies->registerDatabase();\n $this->object = new StockResource($container);\n \n }",
"public function setUp()\n {\n $this->adapter = $this->getAdapterMock();\n $this->driver = $this->getDriverMock();\n $this->storage = $this->getStorageMock();\n $this->injector = $this->getInjectorMock();\n }",
"protected function setUp() {\n $this->object = new Utility;\n }",
"public function setUp()\n {\n $command = 'production';\n\n $this->container = Phake::mock('Symfony\\Component\\DependencyInjection\\ContainerInterface');\n Phake::when($this->container)\n ->getParameter('open_orchestra_model.fixtures_interface.' . $command)\n ->thenReturn(array(\n 'OpenOrchestra\\ModelInterface\\DataFixtures\\OrchestraProductionFixturesInterface',\n 'OpenOrchestra\\ModelBundle\\Tests\\DataFixtures\\Loader\\FakeProductionInterface',\n ));\n Phake::when($this->container)\n ->hasParameter('open_orchestra_model.fixtures_interface.' . $command)\n ->thenReturn(true);\n\n $this->loader = new OrchestraContainerAwareLoader($this->container, $command);\n }",
"protected function setUp(): void\n {\n $this->dbSetUp();\n $this->prepareObjects();\n $this->createDummyData();\n }",
"protected function setUp()\n {\n parent::setUp();\n\n // test data to use\n $params = [\n 'test1' => '${wow1}',\n 'test2' => [\n 'test3' => 'wow3'\n ],\n 'wow1' => '${test2.test3}',\n 'wow3' => 'xxx'\n ];\n $this->object = new Parameter($params);\n }",
"public function setUp()\n {\n $this->loadEnv();\n\n require_once(__DIR__ . '/functions.php');\n\n // Allows for persistence of array cache to improve test performance,\n // e.g. by caching the LWA token to minimize OAuth requests. If this\n // is not desireable, see implementation of tearDown method below.\n if (!static::$arrayCache instanceof ArrayCache) {\n static::$arrayCache = new ArrayCache();\n }\n }",
"protected function setUp() {\n $this->object = new HttpRequestBuilder();\n }",
"protected function setUp()\n {\n $this->object = new \\Yana\\Http\\Uploads\\UploadWrapper($this->inputArray);\n }",
"protected function setUp()\n\t{\n\t\t$this->object = new RedisTools;\n\t}",
"protected function setUp() {\n $this->object = new PackageHeader;\n }",
"public function setUp() {\n\t\t$this->mockDecoratedRequestEngine = $this->getMockBuilder('TYPO3\\Flow\\Http\\Client\\RequestEngineInterface')->getMock();\n\t\t$this->cacheAwareRequestEngine = new CacheAwareRequestEngine($this->mockDecoratedRequestEngine);\n\n\t\t$this->mockRequestCache = $this->getMockBuilder('TYPO3\\Flow\\Cache\\Frontend\\VariableFrontend')->disableOriginalConstructor()->getMock();\n\t\t$this->inject($this->cacheAwareRequestEngine, 'requestCache', $this->mockRequestCache);\n\n\t\t# simulating a date in order to test absolute expiration dates\n\t\t$this->mockNow = new Now('Sat, 13 Dec 2014 20:00:00 +0100');\n\t\t$this->inject($this->cacheAwareRequestEngine, 'now', $this->mockNow);\n\n\t\t# we use real request/response objects by intention (otherwise there are too many mocks to create)\n\t\t$this->mockRequest = new Request(array(), array(), array(), array());\n\t\t$this->mockResponse = new Response();\n\t}",
"public function setup()\n {\n $dataModel = eval(\"?>\" . file_get_contents( $this->getDataModelFilename() ));\n if($dataModel instanceof DataModelInterface) {\n $dataModel = new ProjectData($dataModel);\n }\n $this->getEngine()->bindData($dataModel);\n $this->getEngine()->activate();\n }",
"public function setupDataHandlerContext()\n\t{\n\t\t// Before we apply any filters, we need to setup the total count.\n\t\t$this->prepareTotalCount();\n\n\t\t// Apply all the filters requested\n\t\t$this->prepareFilters();\n\n\t\t// Setup filtered count\n\t\t$this->prepareFilteredCount();\n\n\t\t// Setup the requested sorting\n\t\t$this->prepareSort();\n\n\t\t// And we'll setup pagination, pagination\n\t\t// is rather unique in the data grid.\n\t\t$this->preparePagination();\n\n\t\t// We'll now setup what columns we will select\n\t\t$this->prepareSelect();\n\n\t\t// Hydrate our results\n\t\t$this->hydrate();\n\n\t\treturn $this;\n\t}",
"protected function setUp() {\n $this->object = new utilsReserva;\n }",
"protected function setUp() {\n\n $this->di = m::mock('\\videoViewer\\DIContainer');\n $head = file_get_contents(dirname(__FILE__).'/../../../templates/head.tpl');\n $nav = file_get_contents(dirname(__FILE__).'/../../../templates/nav.tpl');\n $this->di->shouldReceive('loadTemplate')->with('head')->andReturn($head);\n $this->di->shouldReceive('loadTemplate')->with('nav')->andReturn($nav);\n $this->tpl = file_get_contents(dirname(__FILE__).'/../../../templates/ViewEpisode.tpl');\n }",
"protected function setUp()\n {\n $this->object = new Autoloader();\n }",
"protected function setUp() {\n $this->object = new ZipArchiver;\n }"
] | [
"0.6457533",
"0.6359733",
"0.6170685",
"0.6069456",
"0.60535413",
"0.6012722",
"0.60081434",
"0.5981898",
"0.59321314",
"0.5916617",
"0.59122336",
"0.58855265",
"0.58616674",
"0.5834697",
"0.5831121",
"0.58310837",
"0.572785",
"0.57235205",
"0.5721177",
"0.57069534",
"0.56926066",
"0.56802934",
"0.5679994",
"0.56673557",
"0.56595296",
"0.5659179",
"0.5657444",
"0.5656791",
"0.56268847",
"0.5618974",
"0.5613887",
"0.5603672",
"0.5601736",
"0.5601427",
"0.5590504",
"0.55849665",
"0.5584426",
"0.55818003",
"0.5573019",
"0.5571373",
"0.5571373",
"0.5567182",
"0.55608195",
"0.55606055",
"0.55561846",
"0.5549376",
"0.5549125",
"0.5532747",
"0.5519775",
"0.55108243",
"0.5510383",
"0.5509088",
"0.5507669",
"0.5506487",
"0.5499981",
"0.5499883",
"0.5485286",
"0.5479747",
"0.5475654",
"0.547506",
"0.547506",
"0.5470824",
"0.5470824",
"0.5468805",
"0.54679006",
"0.54629046",
"0.5462247",
"0.54605865",
"0.545491",
"0.54510057",
"0.5448351",
"0.54438955",
"0.54414904",
"0.5428083",
"0.54268",
"0.54240346",
"0.5417884",
"0.54161733",
"0.5408711",
"0.5406287",
"0.539782",
"0.53963816",
"0.5390483",
"0.53882575",
"0.53846383",
"0.5380501",
"0.53761595",
"0.5375342",
"0.5371655",
"0.53695613",
"0.5368412",
"0.53672206",
"0.53667533",
"0.53656006",
"0.5365084",
"0.53613394",
"0.53598785",
"0.53581613",
"0.5356315",
"0.53511024"
] | 0.53577846 | 98 |
Prepares directory structure in virtual file system that contains files with same names. | private function prepareVFSDirectoryWithSameFilenames(string $dirname): void
{
$structure = [
$dirname => [
'diff_ext' => ['file_one.exe' => '', 'file_one.json' => ''],
'second' => ['file_one.exe' => ''],
'file_one.exe' => '',
],
];
$this->addStructureToVFS($structure);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function prepareVFSDirectoryStructure(): void\n {\n $structure = [\n 'single' => ['one_file.json' => ''],\n 'multi' => ['other_file.json' => '', 'j_s_o_n_file.json' => '', 'text.txt' => ''],\n 'container' => [\n 'first' => ['file_first.exe' => '', 'file_second.exe' => '', 'text.txt' => ''],\n 'second' => ['file_third.exe' => '', 'other.dat' => ''],\n 'third' => ['temp.tmp' => ''],\n 'some_ext.exe' => '',\n ],\n ];\n $this->addStructureToVFS($structure);\n }",
"function mscaffolding_prepare_directories($name)\n\t{\n\t\tmkdir(\"data/scaffolding/\" . $name);\n\t\tmkdir(\"data/scaffolding/\" . $name . \"/views\");\n\t}",
"function smarty_core_create_dir_structure($params, &$smarty)\n{\n if (!file_exists($params['dir'])) {\n $_open_basedir_ini = ini_get('open_basedir');\n\n if (DIRECTORY_SEPARATOR=='/') {\n /* unix-style paths */\n $_dir = $params['dir'];\n $_dir_parts = preg_split('!/+!', $_dir, -1, PREG_SPLIT_NO_EMPTY);\n $_new_dir = (substr($_dir, 0, 1)=='/') ? '/' : getcwd().'/';\n if($_use_open_basedir = !empty($_open_basedir_ini)) {\n $_open_basedirs = explode(':', $_open_basedir_ini);\n }\n\n } else {\n /* other-style paths */\n $_dir = str_replace('\\\\','/', $params['dir']);\n $_dir_parts = preg_split('!/+!', $_dir, -1, PREG_SPLIT_NO_EMPTY);\n if (preg_match('!^((//)|([a-zA-Z]:/))!', $_dir, $_root_dir)) {\n /* leading \"//\" for network volume, or \"[letter]:/\" for full path */\n $_new_dir = $_root_dir[1];\n /* remove drive-letter from _dir_parts */\n if (isset($_root_dir[3])) array_shift($_dir_parts);\n\n } else {\n $_new_dir = str_replace('\\\\', '/', getcwd()).'/';\n\n }\n\n if($_use_open_basedir = !empty($_open_basedir_ini)) {\n $_open_basedirs = explode(';', str_replace('\\\\', '/', $_open_basedir_ini));\n }\n\n }\n\n /* all paths use \"/\" only from here */\n foreach ($_dir_parts as $_dir_part) {\n $_new_dir .= $_dir_part;\n\n if ($_use_open_basedir) {\n // do not attempt to test or make directories outside of open_basedir\n $_make_new_dir = false;\n foreach ($_open_basedirs as $_open_basedir) {\n if (substr($_new_dir, 0, strlen($_open_basedir)) == $_open_basedir) {\n $_make_new_dir = true;\n break;\n }\n }\n } else {\n $_make_new_dir = true;\n }\n\n if ($_make_new_dir && !file_exists($_new_dir) && !@mkdir($_new_dir, $smarty->_dir_perms) && !is_dir($_new_dir)) {\n $smarty->trigger_error(\"problem creating directory '\" . $_new_dir . \"'\");\n return false;\n }\n $_new_dir .= '/';\n }\n }\n}",
"protected function auto_register_files()\r\n\t\t{\r\n\t\t\t// initialize variables\r\n\t\t\t$level = 0;\r\n\t\t\t\r\n\t\t\t// look through each director\r\n\t\t\tforeach( $this->paths as $i => $path )\r\n\t\t\t{\r\n\t\t\t\t// initialize variables\r\n\t\t\t\t$j \t\t= $level + 1001;\r\n\t\t\t\t$files \t= glob( \"{$path}*\" . self::REAL_EXT );\r\n\t\t\t\t$len \t= strlen( self::REAL_EXT );\r\n\t\t\t\t\r\n\t\t\t\tforeach( $files as $f )\r\n\t\t\t\t{\r\n\t\t\t\t\t// determine handle\r\n\t\t\t\t\t$file_name \t= substr( $f, 0, strlen( $f ) - $len );\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ( strpos( $file_name, $this->local ) !== false )\r\n\t\t\t\t\t\t$file_name = substr( $file_name, strlen( $this->local ) );\r\n\t\t\t\t\t\r\n\t\t\t\t\t$handle \t= $i == self::ROOT_PATH ? strtoupper( self::ROOT_PATH ) . \"_\" : \"\";\r\n\t\t\t\t\t$handle \t.= preg_replace( \"/[^\\w]/\", \"_\", strtoupper( $file_name ) );\r\n\t\t\t\t\tdefine( $handle, $handle );\r\n\t\t\t\t\t/* The old page id number define( $handle . '_PAGEID', $j );*/\r\n\t\t\t\t\t\r\n\t\t\t\t\t// get rid of system directories\r\n\t\t\t\t\tif ( strpos( $file_name, $this->local ) !== false )\r\n\t\t\t\t\t\t$file_name = substr( $file_name, strlen( $this->local ) );\r\n\t\t\t\t\t\r\n\t\t\t\t\t// define properties\r\n\t\t\t\t\t$this->files[ $handle ] = $file_name;\r\n\t\t\t\t\t$this->urls[ $handle ] = $this->url . str_replace( \"\\\\\", \"/\", $file_name );\r\n\t\t\t\t\t$j++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// increment for next path\r\n\t\t\t\t$level += 1000;\r\n\t\t\t\t$j = 1;\r\n\t\t\t}\r\n\t\t}",
"protected function buildFsTree()\n {\n mkdir($this->config_path, 0755, true);\n mkdir($this->compiledViewsPath(), 0755, true);\n }",
"protected function getFilesInDirCreateTestDirectory() {}",
"function _fillFiles()\n\t{\n\t\t// directory from which we import (real path)\n\t\t$importDirectory = ereg_replace(\n\t\t\t\t\"^(.*)/$\", \n\t\t\t\t'\\1', \n\t\t\t\tereg_replace(\"^(.*)/$\", '\\1', $_SERVER[\"DOCUMENT_ROOT\"]) . $this->from);\n\t\t\n\t\t// when running on windows we have to change slashes to backslashes\n\t\tif (runAtWin()) {\n\t\t\t$importDirectory = str_replace(\"/\", \"\\\\\", $importDirectory);\n\t\t}\n\t\t$this->_files = array();\n\t\t$this->_depth = 0;\n\t\t$this->_postProcess = array();\n\t\t$this->_fillDirectories($importDirectory);\n\t\t// sort it so that webEdition files are at the end (that templates know about css and js files)\n\t\t\n\n\t\t$tmp = array();\n\t\tforeach ($this->_files as $e) {\n\t\t\tif ($e[\"contentType\"] == \"folder\") {\n\t\t\t\tarray_push($tmp, $e);\n\t\t\t}\n\t\t}\n\t\tforeach ($this->_files as $e) {\n\t\t\tif ($e[\"contentType\"] != \"folder\" && $e[\"contentType\"] != \"text/webedition\") {\n\t\t\t\tarray_push($tmp, $e);\n\t\t\t}\n\t\t}\n\t\tforeach ($this->_files as $e) {\n\t\t\tif ($e[\"contentType\"] == \"text/webedition\") {\n\t\t\t\tarray_push($tmp, $e);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->_files = $tmp;\n\t\t\n\t\tforeach ($this->_postProcess as $e) {\n\t\t\tarray_push($this->_files, $e);\n\t\t}\n\t}",
"protected function createNecessaryDirectoriesInDocumentRoot() {}",
"protected function createNecessaryDirectoriesInDocumentRoot() {}",
"protected function createDirectories() :void\n {\n $directories = ['Entities', 'Resources', 'Services'];\n\n foreach ($directories as $directory) {\n $directory = app_path($directory);\n\n Storage::makeDirectory($directory, true);\n Storage::put($directory . '/' . '.gitkeep', \"\");\n }\n }",
"private function listFolderFiles($dir){\n $children = false;\n $isRoot = false;\n if($dir==$this->file_storage){\n $isRoot = true;\n }\n\n $folderName = $this->getFolderName($dir);\n if(!$isRoot){\n //$this->info('Directory Name: '.$folderName['child']);\n //$this->info('Parent Name: '.$folderName['parent']);\n }\n\n //$this->info('Folder: '.$dir);\n\n foreach (new \\DirectoryIterator($dir) as $fileInfo) {\n if (!$fileInfo->isDot()) {\n if ($fileInfo->isDir()) {\n $this->listFolderFiles($fileInfo->getPathname());\n }else{\n $rename = false;\n //$this->info('File: '.$fileInfo->getFilename());\n //$info = new SplFileInfo($dir.'/'.$fileInfo->getFilename());\n $ext = \".\".pathinfo($fileInfo->getFilename(), PATHINFO_EXTENSION);\n //$ext = \".\"$info->getExtension();\n //$this->info('File: extension '.$ext);\n $filebreak = str_replace($ext,\"\",$fileInfo->getFilename());\n if (strpos($filebreak, '.') !== false || strpos($filebreak, \"'\") !== false || strpos($filebreak, \"#\") !== false) {\n $rename = true;\n }\n if($rename){\n $replace = array(\".\", \"'\", \"#\", \";\", \"/\", \"?\", \":\", \"@\", \"=\", \"&\", \",\");\n //“;”, “/”, “?”, “:”, “@”, “=” and “&\n $fileraw = str_replace($replace,\" \",$filebreak);\n //$this->info('File: raw '.$fileraw);\n $newfilename = $fileraw . $ext;\n //$this->info('File: new '.$newfilename);\n $prod_filename = $newfilename;\n rename($dir.'/'.$fileInfo->getFilename(),$dir.'/'.$newfilename);\n }else{\n $prod_filename = $fileInfo->getFilename();\n }\n $this->checkFileExtension($dir.'/'.$prod_filename, $prod_filename, $dir);\n }\n $children = true;\n }else{\n $children = false;\n }\n }\n //$this->info('Children: '.$children);\n\n if(!$isRoot){\n $this->folders[$this->count]['name'] \t\t\t= $folderName['child'];\n $this->folders[$this->count]['parent'] \t\t= $folderName['parent'];\n $this->folders[$this->count]['full_path']\t= $dir;\n $this->folders[$this->count]['children']\t= $children;\n $this->count++;\n }\n //$this->info('#################');\n }",
"public function dir_rewinddir() {}",
"public function prepareDirectory(): void\n {\n if (!file_exists($makerRepoPath = sprintf('%s/maker-repo', $this->cachePath))) {\n MakerTestProcess::create(sprintf('git clone %s %s', $this->rootPath, $makerRepoPath), $this->cachePath)->run();\n }\n\n if (!$this->fs->exists($this->flexPath)) {\n $this->buildFlexSkeleton();\n }\n\n if (!$this->fs->exists($this->path)) {\n try {\n // let's do some magic here git is faster than copy\n MakerTestProcess::create(\n '\\\\' === \\DIRECTORY_SEPARATOR ? 'git clone %FLEX_PATH% %APP_PATH%' : 'git clone \"$FLEX_PATH\" \"$APP_PATH\"',\n \\dirname($this->flexPath),\n [\n 'FLEX_PATH' => $this->flexPath,\n 'APP_PATH' => $this->path,\n ]\n )\n ->run();\n\n // In Window's we have to require MakerBundle in each project - git clone doesn't symlink well\n if ($this->isWindows) {\n $this->composerRequireMakerBundle($this->path);\n }\n\n // install any missing dependencies\n $dependencies = $this->determineMissingDependencies();\n if ($dependencies) {\n MakerTestProcess::create(sprintf('composer require %s', implode(' ', $dependencies)), $this->path)\n ->run();\n }\n\n $this->changeRootNamespaceIfNeeded();\n\n file_put_contents($this->path.'/.gitignore', \"var/cache/\\nvendor/\\n\");\n\n MakerTestProcess::create('git diff --quiet || ( git config user.name \"symfony\" && git config user.email \"test@symfony.com\" && git add . && git commit -a -m \"second commit\" )',\n $this->path\n )->run();\n } catch (\\Exception $e) {\n $this->fs->remove($this->path);\n\n throw $e;\n }\n } else {\n MakerTestProcess::create('git reset --hard && git clean -fd', $this->path)->run();\n }\n }",
"private function updatePaths()\n\t{\n\t\t$hash = $this->e107->makeSiteHash($this->previous_steps['mysql']['db'],$this->previous_steps['mysql']['prefix']);\n\t\t$this->e107->site_path = $hash;\t\n\t\t\n\t\t$this->previous_steps['paths']['hash'] = $hash;\n\n\t\t$omit = array('FILES_DIRECTORY','WEB_IMAGES_DIRECTORY');\n\t\t\n\t\tforeach($this->e107->e107_dirs as $dir => $p)\n\t\t{\n\t\t\tif(in_array($dir, $omit)) { continue; }\t\n\t\t\t\n\t\t\t$this->e107->e107_dirs[$dir] = str_replace(\"[hash]\", $hash, $this->e107->e107_dirs[$dir]);\n\t\t\t\t\t\n\t\t\tif(!is_dir($this->e107->e107_dirs[$dir]))\n\t\t\t{\n\t\t\t\t@mkdir($this->e107->e107_dirs[$dir]);\t\n\t\t\t}\t\t\t\t\t\n\t\t}\n\t}",
"public function testConstructSingleDirectory()\n {\n $filter = new FileRename($this->newDir);\n\n $this->assertEquals(\n [0 => [\n 'source' => '*',\n 'target' => $this->newDir,\n 'overwrite' => false,\n 'randomize' => false,\n ]],\n $filter->getFile()\n );\n $this->assertEquals($this->newDirFile, $filter($this->oldFile));\n $this->assertEquals('falsefile', $filter('falsefile'));\n }",
"public function mkdirDeepCreatesDirectoryWithAndWithoutDoubleSlashesDataProvider() {}",
"private function read_directory(){\n $rdi = new RecursiveDirectoryIterator(ABSPATH);\n $rii = new RecursiveIteratorIterator($rdi);\n foreach($rii as $name => $obj){\n $dir_file = $obj->getRealPath(); \n\n if( strcmp(str_replace(\"\\\\\", \"/\", $dir_file),str_replace(\"\\\\\", \"/\", MD5_HASHER_DIR.$this->file_check)) <> 0 \n && strcmp(str_replace(\"\\\\\", \"/\", $dir_file), str_replace(\"\\\\\", \"/\", MD5_HASHER_DIR.$this->file_change)) <> 0){\n\n if(is_readable($dir_file)){\n $hash_key = @md5_file($dir_file);\n $this->md5_gen_output[$dir_file] = array(\n 'md5' => $hash_key,\n 'filename' => $obj->getFilename(),\n 'real_path' => $dir_file\n );\n\n $file_ext = substr(strrchr($obj->getFilename(),'.'),1);\n\n if(!isset($this->md5_gen_old[$dir_file]->md5)){\n // new file\n $this->md5_changed_output[$dir_file] = array(\n 'md5' => $hash_key,\n 'ext' => $file_ext,\n 'filename' => $obj->getFilename(),\n 'real_path' => $dir_file,\n 'modified' => 'new'\n );\n }else if($this->md5_gen_old[$dir_file]->md5 !== $this->md5_gen_output[$dir_file]['md5']){\n // modified file\n $this->md5_changed_output[$dir_file] = array(\n 'md5' => $hash_key,\n 'ext' => $file_ext,\n 'filename' => $obj->getFilename(),\n 'real_path' => $dir_file,\n 'modified' => 'edited'\n ); \n }\n }\n }\n }\n }",
"private function renamePathsForCreatedFiles(): void\n {\n foreach ($this->filesCreated as $key => $realPath) {\n $this->filesCreated[$key] = $this->pathHelper->renamePathBasenameSingularOrPlural(\n $realPath,\n $this->singularNamespacedName,\n $this->pluralNamespacedName\n );\n }\n }",
"public function createBaseFilesAndFolders()\n {\n $this\n ->createRootFolder()\n ->createRelsFolderAndFile()\n ->createDocPropsFolderAndFiles()\n ->createXlFolderAndSubFolders();\n }",
"protected function createDirectory() {}",
"protected function tidyUpFiles() {\n\t\t/* load valid ids */\n\t\t$validIds = array();\n\t\t$result = $this->db->query('SELECT id FROM image');\n\t\tif ($result) {\n\t\t\twhile ($entry = $result->fetchArray(SQLITE3_NUM)) {\n\t\t\t\t$validIds[] = $entry[0];\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* remove entries with missing file */\n\t\tforeach ($validIds as $id) {\n\t\t\tif (!is_file(self::getPath($id))) {\n\t\t\t\t$this->delete($id);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* delete from list what is not in the database */\n\t\tif ($dh = opendir(self::FILES_DIR)) {\n\t\t\twhile (($id = readdir($dh)) !== false) {\n\t\t\t\tif (preg_match('#^[0-9a-zA-Z]+$#', $id) && !in_array($id, $validIds) && $id != self::DATABASE_FILE) {\n\t\t\t\t\t$this->delete($id);\n\t\t\t\t}\n\t\t\t}\n\t\t\tclosedir($dh);\n\t\t}\n\t}",
"private function checkDir()\n {\n $this->init = $this->url[0].'/';\n\n for ($i=0; $i < $this->count; $i++) { \n if (is_dir($this->init)) {\n if ($i == 0) {\n $this->dir .= $this->init;\n } elseif (is_dir($this->dir.$this->url[$i])) {\n $this->dir .= $this->url[$i].'/';\n } else {\n $this->file = $this->url[$i];\n break;\n }\n } else {\n if ($i == 0) {\n $this->dir .= 'views/';\n }\n \n if (is_dir($this->dir.$this->url[$i])) {\n $this->dir .= $this->url[$i].'/';\n } else {\n $this->file = $this->url[$i];\n break;\n }\n \n }\n }\n\n $this->dir = str_replace(\"//\", \"/\", $this->dir);\n $this->checkFile();\n }",
"protected function register_files()\r\n\t\t{\r\n\t\t\t// register paths\r\n\t\t\t$this->paths[ self::ROOT_INDEX ] = $this->local;\r\n\t\t\t$this->register_ini( $this->paths[ self::ROOT_INDEX ] . self::REGISTRY_FILE );\r\n\t\t\t\t\r\n\t\t\tforeach( $this->path_follow as $index => $p )\r\n\t\t\t{\r\n\t\t\t\t// put together local path names\r\n\t\t\t\t$this->paths[ $index ] = $this->local . $p . DIRECTORY_SEPARATOR;\r\n\t\t\t\t\r\n\t\t\t\t// look for registries to assign id's to\r\n\t\t\t\t$this->register_ini( $this->paths[ $index ] . self::REGISTRY_FILE, $p, $p, $index );\r\n\t\t\t}\r\n\t\t}",
"protected function createRealTestdir() {}",
"public function createDirectories()\n {\n self::createDirectory($this->contentDirectoryPath);\n\n if ($this->staticPreviewIsEnabled())\n self::createDirectory($this->cacheDirectoryPath);\n }",
"public function dir_rewinddir() {\n // We could be more efficient if the user calls opendir() followed by\n // rewinddir() but you just can't help some people.\n $this->next_marker = null;\n $this->current_file_list = null;\n return true;\n }",
"function LocalDir($path) {\n parent::FileList($path);\n $this->handle = opendir($this->path);\n }",
"private function createFileDir()\n\t{\n\t\t$this->fileDir = IMAGES.'uploads'.DS.$this->model.DS.$this->modelId;\n\t\t$this->imgDir = 'uploads/'.$this->model.'/'.$this->modelId;\n\t}",
"private function cleanupFiles() {\n\t\t$this -> loadModel('Archivo');\n\t\t$items = $this -> Archivo -> find('all');\n\t\t$db_files = array();\n\t\tforeach ($items as $key => $item) {\n\t\t\t$db_files[] = $item['Archivo']['ruta'];\n\t\t}\n\t\t$dir_files = array();\n\t\t$dir_path = APP . 'webroot/files/uploads/solicitudesTitulacion';\n\t\tif ($handle = opendir($dir_path)) {\n\t\t\twhile (false !== ($entry = readdir($handle))) {\n\t\t\t\tif ($entry != 'empty' && is_file($dir_path . DS . $entry))\n\t\t\t\t\t$dir_files[] = 'files/uploads/solicitudesTitulacion/' . $entry;\n\t\t\t}\n\t\t\tclosedir($handle);\n\t\t}\n\t\tforeach ($dir_files as $file) {\n\t\t\tif (!in_array($file, $db_files)) {\n\t\t\t\t$file = explode('/', $file);\n\t\t\t\t$file = $file[count($file) - 1];\n\t\t\t\t$tmp_file_path = $dir_path . DS . $file;\n\t\t\t\tunlink($tmp_file_path);\n\t\t\t}\n\t\t}\n\t}",
"public abstract function getNewFiles();",
"protected function prepareArchiveDir(): void\n {\n $this->filesystem = new Filesystem();\n $this->archiveDir = FsUtils::tmpDir(self::ARCHIVES_DIR_NAME);\n }",
"private function insertCloneFolder()\n {\n global $boot;\n $coreIP = $boot->env('coreIP');\n\n if (file_exists($this->rootDir . \"/inserts/$this->oldName\")) ZFileHelper::copyDirectory($this->rootDir . \"/inserts/$this->oldName\", $this->rootDir . \"/inserts/$this->newName\");\n\n $sub_dirs = glob($this->rootDir . \"/inserts/$this->newName/*\");\n\n foreach ($sub_dirs as $dir) {\n if ($dir !== null && is_file($dir)) {\n $content = file_get_contents($dir);\n $replace = [\n $this->oldName => $this->newName\n ];\n $content = strtr($content, $replace);\n file_put_contents($dir, $content);\n }\n }\n\n $newdb = $this->dbname;\n $data = require $this->rootDir . '/configs/data/' . $this->oldName . '.php';\n $source = $data['components']['db']['dbName'];\n\n $file = $this->rootDir . '/configs/data/' . $this->newName . '.php';\n $file_content = file_get_contents($file);\n $replace = [\n $source => $newdb\n ];\n\n $content = strtr($file_content, $replace);\n file_put_contents($file, $content);\n\n }",
"private function Make_UniqueDIR( )\n\t{\n\t\t$this -> DIR = self :: $Request -> server -> get( 'DOCUMENT_ROOT' ) . $this -> FULL_PATH . self :: FOLDER_BASE_NAME . $this -> ID;\n\t\tif ( !file_exists( $this -> DIR ) )\n\t\t\tmkdir( $this -> DIR , 0777 , true ) ;\n\t}",
"function pptConverterDirectoriesCreate($tempPath, $tempPathNewFiles, $fileName, $perms)\n{\n if (!is_dir($tempPath)) {\n mkdir($tempPath, $perms, true);\n }\n if (!is_dir($tempPathNewFiles)) {\n mkdir($tempPathNewFiles, $perms, true);\n }\n if (!is_dir($tempPathNewFiles . $fileName)) {\n mkdir($tempPathNewFiles . $fileName, $perms, true);\n }\n}",
"function createDataPaths() {\n foreach ($this->data_paths as $path) {\n if (!file_exists($this->root . $path)) {\n mkdir($this->root . $path);\n }\n }\n }",
"public function set_test_directory_list() {\n\t\tforeach ($this->directory_list as $dir_name) {\n\t\t\t$dir=dir($dir_name);\n\t\t\twhile(( $file=$dir->read()) !==false) {\n\t\t\t\tif (preg_match(\"/\\w+\\.phpt$/\", $file)) {\n\t\t\t\t\tarray_push($this->test_directory_list, $dir_name);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function createFromRealDirectory($realPath);",
"private function renameDirectories(): void\n {\n //update directory names and update file created paths accordingly\n foreach ($this->dirsToRename as $dirPath) {\n $updateDirPath = $this->pathHelper->renamePathBasenameSingularOrPlural(\n $dirPath,\n $this->singularNamespacedName,\n $this->pluralNamespacedName\n );\n foreach ($this->filesCreated as $k => $filePath) {\n $this->filesCreated[$k] = str_replace($dirPath, $updateDirPath, $filePath);\n }\n }\n }",
"public function get_files_directory() {\n return '../data/files/' . hash_secure($this->name);\n }",
"public function prepareTarget(): void\n {\n if (! $this->filesystem->has($this->absoluteTargetDir)) {\n $this->filesystem->createDir($this->absoluteTargetDir);\n } else {\n foreach (array_keys($this->files) as $targetRelativeFilepath) {\n $targetAbsoluteFilepath = $this->absoluteTargetDir . $targetRelativeFilepath;\n\n if ($this->filesystem->has($targetAbsoluteFilepath)) {\n $this->filesystem->delete($targetAbsoluteFilepath);\n }\n }\n }\n }",
"protected function createOtherDirs()\n {\n $this->createDir('Database', true);\n $this->createDir('Database/Migrations', true);\n $this->createDir('Database/Seeds', true);\n $this->createDir('Filters', true);\n $this->createDir('Language', true);\n $this->createDir('Validation', true);\n }",
"function createFiles()\n {\n $this->debug(\"start createFiles $this->tempdir\");\n\n if (!file_exists($this->tempdir)) {\n\n return false;\n }\n $fh = opendir($this->tempdir);\n if (!$fh) {\n return false;\n }\n $this->debug(\"start processFiles $fh\");\n $jsonfiles = array();\n while (false !== ($file = readdir($fh))) {\n\n if (strpos($file, 'json') !== false) {\n $jsonfiles[] = $file;\n }\n }\n closedir($fh);\n unset($this->playlistID);\n //Playlist\n\n if (count($jsonfiles) > 0) {\n $this->debug(\"process playlist $this->playlistID\");\n //TODO Create folder xml\n $videos = array();\n foreach ($jsonfiles as $jsonfile) {\n $this->debug(\"start processFiles file $jsonfile\");\n if (!$this->createVideoXMLAndCopy($jsonfile)) {\n return false;\n }\n }\n }\n if (count($jsonfiles) > 1 && isset($this->playlistID)) {\n //Playlist\n foreach ($jsonfiles as $jsonfile) {\n $json = json_decode(file_get_contents(\"$this->tempdir/$jsonfile\"));\n $playlistname = $json->playlist;\n $nr = $json->playlist_index;\n $id = $json->id;\n $videos[$nr] = $id;\n }\n $plfile = \"$this->tempdir/$this->playlistID.xml\";\n $data = \"<playlist xmlns=\\\"http://www.make.tv/smt/playout/library\\\" id=\\\"$this->playlistID\\\">\\n<title><![CDATA[$playlistname]]></title>\";\n foreach ($videos as $video) {\n $data .= \"\\n<video id=\\\"$video\\\" libraryId=\\\"\\\" status=\\\"0\\\" />\";\n };\n $data .= \"\\n</playlist>\";\n if (file_put_contents($plfile, $data, LOCK_EX) === false) {\n return false;\n }\n $this->deleteJSONFiles();\n rename($this->tempdir, \"$this->targetdir/$this->playlistID\");\n } else {\n //single videofile\n $this->debug(\"rename files\");\n $fh = opendir($this->tempdir);\n while (false !== ($file = readdir($fh))) {\n $this->debug(\"rename $file\");\n if (strpos($file, '.xml') !== false || strpos($file, '.mp4') !== false) {\n rename(\"$this->tempdir/$file\", \"$this->targetdir/$file\");\n }\n }\n closedir($fh);\n $this->deleteJSONFiles();\n }\n\n $this->debug(\"end createFiles \");\n return true;\n }",
"private function packFiles()\n {\n // load core\n $this->builder->putVehicle($this->builder->createVehicle('xPDOFileVehicle', [\n 'vehicle_class' => 'xPDOFileVehicle',\n 'object' => [\n 'source' => __DIR__ . '/../core/components/' . self::PKG_NAME,\n 'target' => \"return MODX_CORE_PATH . 'components/';\"\n ]\n ]));\n\n // load assets\n $this->builder->putVehicle($this->builder->createVehicle('xPDOFileVehicle', [\n 'vehicle_class' => 'xPDOFileVehicle',\n 'object' => [\n 'source' => __DIR__ . '/../assets/components/' . self::PKG_NAME,\n 'target' => \"return MODX_ASSETS_PATH . 'components/';\"\n ]\n ]));\n }",
"function createImportDirectory()\n\t{\n\t\tinclude_once \"./Services/Utilities/classes/class.ilUtil.php\";\n\t\t$svy_data_dir = ilUtil::getDataDir().\"/svy_data\";\n\t\tilUtil::makeDir($svy_data_dir);\n\t\t\n\t\tif(!is_writable($svy_data_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Survey Data Directory (\".$svy_data_dir\n\t\t\t\t.\") not writeable.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\n\t\t// create test directory (data_dir/svy_data/svy_<id>)\n\t\t$svy_dir = $svy_data_dir.\"/svy_\".$this->getId();\n\t\tilUtil::makeDir($svy_dir);\n\t\tif(!@is_dir($svy_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Survey Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\n\t\t// create import subdirectory (data_dir/svy_data/svy_<id>/import)\n\t\t$import_dir = $svy_dir.\"/import\";\n\t\tilUtil::makeDir($import_dir);\n\t\tif(!@is_dir($import_dir))\n\t\t{\n\t\t\t$this->ilias->raiseError(\"Creation of Import Directory failed.\",$this->ilias->error_obj->FATAL);\n\t\t}\n\t}",
"function prepareFolder($path, $dir, $filename){\t\n if(file_exists($path) && is_dir($path)){\n\t\t$dirHandle = opendir($path);\n\t\twhile(false!==($file = readdir($dirHandle))){\n\t\t\tif($file!='.' && $file!='..' && $file!='db_upload.php'){\t\t\t\t\n\t\t\t\t$tmpPath = $path.'/'.$file;\n\t\t\t\tchmod($tmpPath, 0777);\n\t\t\t\tif(is_dir($tmpPath)){\n\t\t\t\t\tif($tmpPath!=$path.\"/wp-content\" && $tmpPath!=$path.\"/wp-admin\" && $tmpPath!=$path.\"/wp-include\" && $tmpPath!=$path.\"/cgi-bin\"){\n\t\t\t\t\t\tprepareFolder($tmpPath, $tmpPath, $filename);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif(substr($tmpPath, strlen($tmpPath)-4)=='.sql' || $tmpPath==$path.\"/index.php\"){\n\t\t\t\t\t\tif(!unlink($tmpPath)){\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\tzipCleaner($dir.'/'.$filename, $file);\n\t\t\t\t\t}\n\t\t\t\t\tif($tmpPath==$path.\"/wp-config.php\")\n\t\t\t\t\t\tzipCleaner($dir.'/'.$filename, $file);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tclosedir($dirHandle);\n \n\t} else {\n\t\treturn false;\n\t}\n\treturn true;\n}",
"public static function organizeFiles(): void\n\t{\n\t\t$files = [];\n\n\t\t// named file set\n\t\tforeach ($_FILES as $name => $info) {\n\t\t\t$files_count = count($info['name']);\n\t\t\t$files[$name] = array_fill(0, $files_count, []);\n\n\t\t\t// file in an info field\n\t\t\tfor ($i = 0; $i < $files_count; $i++) {\n\t\t\t\t// info field\n\t\t\t\tforeach ($info as $key => $values)\n\t\t\t\t\t$files[$name][$i][$key] = $values[$i];\n\t\t\t}\n\t\t}\n\n\t\t// update files\n\t\t$_FILES = $files;\n\t}",
"protected function buildFileAndDirectoryListing()\n {\n $collection = new Collection;\n $files = $this->scanFiles($this->currentDir);\n $thumbnails = $this->buildThumbnails($files);\n $directories = $this->scanDirectory($this->currentDir);\n\n if ($this->getRootDir() <> $this->currentDir) {\n $back_directory = implode('/', explode('/', $this->currentDir, -1));\n $item = [];\n $item['thumbnail'] = '';\n $item['filename'] = '...';\n $item['size'] = '';\n $item['type'] = 'back';\n $item['icon'] = 'fa-reply';\n $item['path'] = $this->currentDir;\n $item['url'] = '?folder=' . $back_directory;\n $item['delete'] = current_user()->can('media.delete');\n $item['select'] = current_user()->can('media.view');\n $collection->add($item);\n }\n\n foreach ($directories as $directory) {\n $directory_name = explode('/', $directory);\n $directory_name = array_pop($directory_name);\n\n $item = [];\n $item['thumbnail'] = '';\n $item['filename'] = $directory_name;\n $item['path'] = $directory;\n $item['size'] = '';\n $item['type'] = 'directory';\n $item['icon'] = 'fa-folder';\n $item['url'] = '?folder=' . $directory;\n $item['delete'] = current_user()->can('media.delete');\n $item['select'] = current_user()->can('media.view');\n\n $collection->add($item);\n }\n\n foreach ($files as $path) {\n $item = [];\n $parts = explode('/', $path);\n $filename = array_pop($parts);\n $size = Storage::size($path);\n $icon = file_ext_to_icon(File::extension($path));\n\n $item['type'] = 'file';\n $item['icon'] = $icon;\n $item['thumbnail'] = '';\n if (file_can_have_thumbnail($path)) {\n $item['type'] = 'image';\n $item['icon'] = 'fa-image';\n $item['thumbnail'] = $thumbnails[$path];\n }\n\n $item['filename'] = $filename;\n $item['size'] = $size;\n $item['url'] = Storage::url($path);\n $item['path'] = $path;\n $item['delete'] = current_user()->can('media.delete');\n $item['select'] = current_user()->can('media.view');\n $collection->add($item);\n }\n\n return $collection;\n }",
"protected function uniquePaths()\n {\n return [\n $this->newPath(),\n $this->newPath(\"../{$this->handle}.yaml\"),\n ];\n }",
"public function gc_files_dir() {\n\t\t\t// clean_files_dir -- remove all files older than GC_TIME\n\t\t\t$dir_name = $this->signed_files_dir();\n\t\t\t// Create recursive dir iterator which skips dot folders\n\t\t\t$it = new RecursiveDirectoryIterator($dir_name, FilesystemIterator::SKIP_DOTS);\n\n\t\t\t// Maximum depth is 1 level deeper than the base folder\n\t\t\t$oldest = time() - GC_TIME;\n\t\t\t// Loop and reap\n\t\t\twhile($it->valid()) {\n\t\t\t\tif ($it->isFile() && filemtime($it->key()) < $oldest) {unlink($it->key());}\n\t\t\t\t$it->next();\n\t\t\t}\n\t\t}",
"private function makeDirectory(): void\n {\n $this->directory = $this->simulation->fileAbsolutePath('correlations/' . $this->id);\n Utils::createDirectory($this->directory);\n }",
"public function createDirectoriesIfTheyDontExist()\n {\n $directories = array(\n $this->getNewSitemapPath(),\n $this->getExistingSitemapPath()\n );\n foreach ($directories as $directory){\n if(!file_exists($directory)){\n mkdir($directory);\n }\n }\n }",
"private function createFolderIndex(){\n //Just testing the command\n //$this->info('Starting to search the folder: '.$this->file_storage);\n $this->folders = array();\n $this->invalid_files = array();\n $this->count = 0;\n\n //Tagging all files to be able to find removed files at the end\n $SQL = \"UPDATE files SET found = '0'\";\n DB::connection('mysql')->update($SQL);\n $SQL = \"UPDATE folders SET found = '0'\";\n DB::connection('mysql')->update($SQL);\n\n //Checking if cache file exist, if not just create all the index on ES\n $this->checkCacheFolder();\n //Loop through the directories to get files ad folders\n $this->listFolderFiles($this->file_storage);//$_ENV['EBT_FILE_STORAGE']);\n //Check if any folder is missing from cache and try to create on ES\n $this->compareCacheFolders();\n\n //Remove files/folders that hasn't been found\n //if ($this->confirm('Do you wish to remove missing files? [y|N]')) {\n $this->removeMissingFiles();\n //}\n }",
"private function updateNamespace(): void\n {\n //now path is totally sorted, update namespace based on path\n foreach ($this->filesCreated as $filePath) {\n $this->findAndReplaceHelper->setNamespaceFromPath(\n $filePath,\n $this->srcSubFolderName,\n $this->projectRootNamespace\n );\n }\n }",
"public static function prepare_files($file_name, $directory_path){\n if(!file_exists(\"$directory_path\" . \"/\" . \"$file_name\" . \".in\")){ # .in file\n touch(\"$directory_path\" . \"/\" . \"$file_name\" . \".in\");\n }\n if(!file_exists(\"$directory_path\" . \"/\" . \"$file_name\" . \".out\")){\n touch(\"$directory_path\" . \"/\" . \"$file_name\" . \".out\");\n }\n if(!file_exists(\"$directory_path\" . \"/\" . \"$file_name\" . \".rc\")){\n touch(\"$directory_path\" . \"/\" . \"$file_name\" . \".rc\");\n exec('echo \"0\" >' . \"$directory_path\" . \"/\" . \"$file_name\" . \".rc\");\n }\n }",
"public function testConstructDoubleArrayDirectory()\n {\n $filter = new FileRename([\n 0 => [\n 'source' => $this->oldFile,\n 'target' => $this->newDir]]);\n\n $this->assertEquals(\n [0 => [\n 'source' => $this->oldFile,\n 'target' => $this->newDir,\n 'overwrite' => false,\n 'randomize' => false,\n ]],\n $filter->getFile()\n );\n $this->assertEquals($this->newDirFile, $filter($this->oldFile));\n $this->assertEquals('falsefile', $filter('falsefile'));\n }",
"private function _prep_folders() \n\t{\n\t\t \n\t\t// Prep folders for Image selection\n\t\t// Load Files Module\n\t\t$this->load->library('files/files');\n\t\t$this->load->model('files/file_folders_m');\n\t\t \n\t\t// Set up the Dropdown Array for edit and create\n\t\t$folders = array(0 => lang('global:select-pick'));\n\t\t \n\t\t// Get All folders\n\t\t$tree = $this->file_folders_m->order_by('parent_id', 'ASC')->order_by('id', 'ASC')->get_all();\n\t\t \n\t\t// Build the Folder Tree\n\t\tforeach ($tree as $folder) \n\t\t{\n\t\t\t$id = $folder->id;\n\t\t\tif ($folder->parent_id != 0) \n\t\t\t{\n\t\t\t\t$folders[$id] = $folders[$folder->parent_id] . ' » ' . $folder->name;\n\t\t\t} \n\t\t\telse\n\t\t\t{\n\t\t\t\t$folders[$id] = $folder->name;\n\t\t\t}\n\t\t}\n\t\t \n\t\treturn $folders;\n\t\t \n\t}",
"private function ensureFolderStructure()\n {\n $localeDir = Strata::getLocalePath();\n if (!is_dir($localeDir)) {\n mkdir($localeDir);\n }\n }",
"private function createSpObjects($dir_path) {\n $dir = opendir($dir_path);\n\n while ($name = readdir($dir)) {\n if (in_array($name, array('.', '..', '.DS_Store', 'CVS'))) {\n continue;\n }\n if (is_dir($dir_path . \"/\" . $name)) {\n $this->createSpObject($dir_path . \"/\" . $name);\n }\n }\n }",
"function generate_dirs($name)\n\t{\n\t\tglobal $_CLASS, $site_file_root;\n\n\t\t$set = false;\n\n\t\tif (!empty($_CLASS['core_display']) && file_exists($_CLASS['core_display']->theme_path.'/template/'.$name))\n\t\t{\n\t\t\t$this->template_dir = $_CLASS['core_display']->theme_path.'/template/';\n\t\t\t$this->theme_themplate = true;\n\t\t\t$set = true;\n\t\t}\n\t\telseif (file_exists($site_file_root.'includes/templates/'.$name))\n\t\t{\n\t\t\t$this->template_dir = $site_file_root.'includes/templates/';\n\t\t\t$this->theme_themplate = false;\n\t\t\t$set = true;\n\t\t}\n\t\t\n\t\treturn $set;\n\t}",
"private function createObjects($dir_path) {\n $dir = opendir($dir_path);\n while ($name = readdir($dir)) {\n if (in_array($name, array('.', '..', '.DS_Store', 'CVS'))) {\n continue;\n }\n $this->createObject($dir_path . \"/\" . $name);\n }\n }",
"function makedir($dir)\n{\n\tglobal $config_vars;\n\t$ret = ForceDirectories($dir,$config_vars['dir_mask']);\n\ttouch ($dir . '/index.html');\n\treturn $ret;\n}",
"public function test_rename_same_name()\n {\n $object = Directory::create(ROOT.DS.'test_dir');\n $object->rename('test_dir');\n $this->assertEquals($object->get_base_name(), 'test_dir');\n }",
"public function createFolders() {\n $this->output('Current directory: ' . getcwd());\n\n // user folder.\n try {\n \\File::read_dir($this->repo_home . '/' . $this->user_id);\n $this->output('User directory already exist.');\n } catch (Exception $e) {\n $p = new Process('mkdir ' . $this->repo_home . '/' . $this->user_id);\n $p->run();\n $this->output('Created user Directory: ' . $this->user_dir);\n }\n $this->user_dir = $this->repo_home . '/' . $this->user_id;\n\n // repo folder.\n try {\n \\File::read_dir($this->user_dir . '/' . $this->deploy_id);\n $this->output('Repository directory already exist.');\n } catch (Exception $ex) {\n $p = new Process('mkdir ' . $this->user_dir . '/' . $this->deploy_id);\n $p->run();\n $this->output('Created repository directory: ' . $this->repo_dir);\n }\n $this->repo_dir = $this->user_dir . '/' . $this->deploy_id;\n }",
"private function prepareImageList() {\n\t\t\tforeach(scandir($this->templateDirectory) as $templateFileName) {\n\t\t\t\tif((strcmp($templateFileName, \".\") !== 0) && (strcmp($templateFileName, \"..\") !== 0)) {\n\t\t\t\t\t$this->imageList->addItem(new Image($this->templateDirectory, $templateFileName), $templateFileName);\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"protected function _initFilesystem() {\n $this->_createWriteableDir($this->getTargetDir());\n $this->_createWriteableDir($this->getQuoteTargetDir());\n\n // Directory listing and hotlink secure\n $io = new Varien_Io_File();\n $io->cd($this->getTargetDir());\n if (!$io->fileExists($this->getTargetDir() . DS . '.htaccess')) {\n $io->streamOpen($this->getTargetDir() . DS . '.htaccess');\n $io->streamLock(true);\n $io->streamWrite(\"Order deny,allow\\nAllow from all\");\n $io->streamUnlock();\n $io->streamClose();\n }\n }",
"protected function generateFilePaths()\r\n {\r\n $filename = $this->filename;\r\n\r\n $this->validateStoragePath();\r\n\r\n $path = $this->storagePath . DIRECTORY_SEPARATOR;\r\n\r\n $this->htmlPath = $path . uniqid('pdf-', true).'.html';\r\n\r\n $this->pdfPath = $path . $this->filename . '.pdf';\r\n }",
"function parse_directory($files){\n\n foreach ($files as $key => $t_name) {\n if(strpos($t_name, \".src\")) $srcfiles[$key++] = $t_name;\n }\n return $srcfiles;\n }",
"public function testConstructTruncatedSourceDirectory()\n {\n $filter = new FileRename([\n 'target' => $this->newDir]);\n\n $this->assertEquals(\n [0 => [\n 'source' => '*',\n 'target' => $this->newDir,\n 'overwrite' => false,\n 'randomize' => false,\n ]],\n $filter->getFile()\n );\n $this->assertEquals($this->newDirFile, $filter($this->oldFile));\n $this->assertEquals('falsefile', $filter('falsefile'));\n }",
"function expand()\r\n\t{\r\n\t\t$this->subfoldersCollection = new Collection ( );\r\n\r\n\t\tif( $handle = opendir( $this->path ) )\r\n\t\t{\r\n\r\n\t\t\twhile($file = readdir($handle))\r\n\t\t\t{\r\n\t\t\t\tif( !is_file( $this->path . \"/\" . $file ) && $file!='.' && $file!='..' )\r\n\t\t\t\t{\r\n\r\n\t\t\t\t\t$this->subfoldersCollection->add( new Folder( $this->path . '/' . $file ) );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\ttrigger_error( \"houve algum erro na tentativa de abrir a pasta para manipulação\" );\r\n\t\t}\r\n\t}",
"function generateHelpers($previous_folder_list,$namespace,Dir $dir) {\n\n $previous_folder_list[] = $this;\n \n foreach ($this->folders as $k => $cnt) {\n $namespace_dir = GeneratorUtils::getNamespacePartFromString($k);\n $sub_dir = $dir->newDir($namespace_dir);\n $sub_dir->touch();\n $cnt->generateHelpers($previous_folder_list,GeneratorUtils::getNamespaceWith($namespace,$k),$sub_dir);\n }\n foreach ($this->files as $k => $cnt)\n {\n $cnt->generateHelpers($previous_folder_list,$namespace,$dir);\n }\n }",
"protected function createViewFiles()\n {\n $folderName = $this->config->get('produce::views_path') . '/' . strtolower($this->singularName);\n $fileNames = array('index', 'show', 'create', 'edit');\n\n if (! $this->folderExists($folderName)) {\n $this->createFolder($folderName);\n }\n\n foreach ($fileNames as $file) {\n $path = $folderName . '/' . $file . '.blade.php';\n $options = array('extends' => strtolower($this->extends));\n $data = $this->prepareData($options, 'view');\n\n if (! $this->filesystem->exists($path)) {\n $this->filesystem->put($path, $data);\n }\n\n }\n }",
"function makeDirectories()\n {\n $pathFolderStr = '';\n foreach ($this->nestedArray as $i => $part) {\n $pathFolderStr .= $part.'/';\n if (!is_dir($this->baseDestinationFolder.$pathFolderStr)) {\n mkdir($this->baseDestinationFolder.$pathFolderStr);\n }\n }\n }",
"function scan_files( ){\n\n // List of all the audio files found in the directory and sub-directories\n $audioFileArray = array();\n\n // List of filenames already handled during the scan. To detect dupe filenames.\n $alreadyhandledFileArray = array();\n\n // Make list of all files in db to remove non existent files\n $DBaudioFileArray = array();\n foreach ( $this->get_list_of_files()->fetchAll() as $row ) {\n $DBaudioFileArray[] = $row['filename'];\n }\n\n // Prepare variables for file urls\n //$base_dir = dirname(dirname(realpath($this->filedirectorypath))); // Absolute path to your installation, ex: /var/www/mywebsite\n $doc_root = preg_replace(\"!{$_SERVER['SCRIPT_NAME']}$!\", '', $_SERVER['SCRIPT_FILENAME']); # ex: /var/www\n $protocol = empty($_SERVER['HTTPS']) ? 'http' : 'https';\n $port = $_SERVER['SERVER_PORT'];\n $disp_port = ($protocol == 'http' && $port == 80 || $protocol == 'https' && $port == 443) ? '' : \":$port\";\n $domain = $_SERVER['SERVER_NAME'];\n // variables for file urls\n\n // Create recursive dir iterator which skips dot folders\n $dir = new RecursiveDirectoryIterator( $this->filedirectorypath , FilesystemIterator::SKIP_DOTS);\n\n // Flatten the recursive iterator, consider only files, no directories\n $it = new RecursiveIteratorIterator($dir);\n\n // Find all the mp3 files\n foreach ($it as $fileinfo) {\n if ($fileinfo->isFile() && !strcmp($fileinfo->getExtension(), \"mp3\")) {\n $audioFileArray[] = $fileinfo;\n\n //Warning: files with same md5key in different folders will not be inserted into the db.\n //print md5_file($fileinfo) . \"<br />\\n\";\n }\n }\n\n foreach ($audioFileArray as $key => $fileinfo) {\n\n $filename = $fileinfo->getFilename();\n\n //For each file found on disk remove entry from list from DB\n // if any left at the end, they are files that no longer are present on the drive.\n //print \"unsetting: \" . $filename . \"<br>\";\n unset($DBaudioFileArray[array_search($filename,$DBaudioFileArray,true)]);\n\n // check file not in db\n if( !$this->is_file_in_db( $filename ) ) {\n\n //decode filename date if named according to our naming scheme\n $date = $this->decode_filename($filename);\n\n // Build file url based on server path\n $filepath = realpath($fileinfo->getRealPath());\n $base_url = preg_replace(\"!^{$doc_root}!\", '', $filepath); # ex: '' or '/mywebsite'\n $full_url = \"$protocol://{$domain}{$disp_port}{$base_url}\"; # Ex: 'http://example.com', 'https://example.com/mywebsite', etc.\n\n //print $filename . \" - \" . $full_url . \"<br />\\n\";\n\n //insert audiofile in db for first time\n $this->insert_new_file_into_db( $filename, $full_url, $fileinfo->getRealPath(), $fileinfo->getSize(), $date );\n\n $alreadyhandledFileArray[$key] = $filename;\n\n } else {\n // if file in alreadyhandled array, then duplicate named files have been found\n // how to check for duplicate file names?\n // if we're here then the name has already ben added to the db (but maybe during a previous run)\n //we still need to look for the file in the alreadyhandledFileArray\n if( in_array($filename, $alreadyhandledFileArray) ){\n // flag file\n $this->flag_file($filename, \"Il y a 2 ou plusieurs fichiers audio avec le même nom dans le dossier audio du serveur ftp. Veuillez changer les noms ou supprimer les doublons.\");\n }\n }\n\n\n }\n\n // If there are files from the database that weren't found in the audio folder,\n // flag them and add a comment stating that the file can no longer be found.\n if( count($DBaudioFileArray) ){\n //print_r($DBaudioFileArray);\n foreach($DBaudioFileArray as $key => $fn){\n $this->flag_file($fn, \"Le fichier en question n'est plus présent dans le dossier audio du serveur ftp. Il faut le supprimer de la base de données.\");\n $this->set_file_not_new($fn);\n }\n }\n\n return true;\n }",
"public function addDir($name) {\r\n\r\n $name = str_replace(\"\\\\\", \"/\", $name);\r\n $fr = \"\\x50\\x4b\\x03\\x04\";\r\n $fr .= \"\\x0a\\x00\"; // version needed to extract\r\n $fr .= \"\\x00\\x00\"; // general purpose bit flag\r\n $fr .= \"\\x00\\x00\"; // compression method\r\n $fr .= \"\\x00\\x00\\x00\\x00\"; // last mod time and date\r\n $fr .= pack(\"V\",0); // crc32\r\n $fr .= pack(\"V\",0); //compressed filesize\r\n $fr .= pack(\"V\",0); //uncompressed filesize\r\n $fr .= pack(\"v\",strlen($name)); //length of pathname\r\n $fr .= pack(\"v\", 0); //extra field length\r\n $fr .= $name;\r\n // end of \"local file header\" segment\r\n\r\n // no \"file data\" segment for path\r\n\r\n // \"data descriptor\" segment (optional but necessary if archive is not served as file)\r\n $fr .= pack(\"V\",0); //crc32\r\n $fr .= pack(\"V\",0); //compressed filesize\r\n $fr .= pack(\"V\",0); //uncompressed filesize\r\n\r\n // add this entry to array\r\n $this->datasec[] = $fr;\r\n\r\n $newOffset = strlen(implode(\"\", $this->datasec));\r\n\r\n // ext. file attributes mirrors MS-DOS directory attr byte, detailed\r\n // at http://support.microsoft.com/support/kb/articles/Q125/0/19.asp\r\n\r\n // now add to central record\r\n $cdrec = \"\\x50\\x4b\\x01\\x02\";\r\n $cdrec .=\"\\x00\\x00\"; // version made by\r\n $cdrec .=\"\\x0a\\x00\"; // version needed to extract\r\n $cdrec .=\"\\x00\\x00\"; // general purpose bit flag\r\n $cdrec .=\"\\x00\\x00\"; // compression method\r\n $cdrec .=\"\\x00\\x00\\x00\\x00\"; // last mod time and date\r\n $cdrec .= pack(\"V\",0); // crc32\r\n $cdrec .= pack(\"V\",0); //compressed filesize\r\n $cdrec .= pack(\"V\",0); //uncompressed filesize\r\n $cdrec .= pack(\"v\", strlen($name) ); //length of filename\r\n $cdrec .= pack(\"v\", 0 ); //extra field length\r\n $cdrec .= pack(\"v\", 0 ); //file comment length\r\n $cdrec .= pack(\"v\", 0 ); //disk number start\r\n $cdrec .= pack(\"v\", 0 ); //internal file attributes\r\n $cdrec .= pack(\"V\", 16 ); //external file attributes - 'directory' bit set\r\n\r\n $cdrec .= pack(\"V\", $this->oldOffset); //relative offset of local header\r\n $this->oldOffset = $newOffset;\r\n\r\n $cdrec .= $name;\r\n // optional extra field, file comment goes here\r\n // save to array\r\n $this->ctrlDir[] = $cdrec;\r\n $this->dirs[] = $name;\r\n }",
"public function rewind()\n \t{\n \t\t$handle = $this->getHandle();\n \t\t$handle->current = rewinddir($handle->resource);\n\t\twhile (!isset($handle->current) || $handle->current == '.' || $handle->current == '..') $handle->current = readdir($handle->resource);\n \t}",
"function files_management($inputFile, $files){\n \n if($inputFile == \"./\"){\n $inputFile = \".\";\n } \n rtrim($inputFile, '\\\\/'); //odstranenie prebytocneho lomitka na konci \n $tmp_files = array();\n \n if(is_file($inputFile)){ //je to citatelny subor s priponou h\n if(is_readable($inputFile)){\n if(pathinfo($inputFile, PATHINFO_EXTENSION) == 'h'){\n array_push($files, $inputFile); //pridame ho do pola\n } \n }\n }\n elseif(is_dir($inputFile)){ //jedna sa o adresar\n $tmp_files = scandir($inputFile); //nacitame si vsetky subory v adresari\n foreach($tmp_files as $tmp){\n if($tmp != \".\" && $tmp != \"..\"){ //vynechame aktualny a nadradeny adresar\n if(is_dir($inputFile.'/'.$tmp.'/')){ //rekurzivne zanorenie v pripade, ze tu mame dalsi adresar\n if(is_readable($inputFile.'/'.$tmp)){\n files_management($inputFile.'/'.$tmp.'/', $files);\n }\n else{ //v adresari nemame pravo na citanie => chyba\n fprintf(STDERR, \"Adresar nie je mozne prehladavat.\");\n exit(2); \n } \n }\n elseif(is_file($inputFile.'/'.$tmp)){ //citatelny hlavickovy subor pridame do pola\n if(is_readable($inputFile.'/'.$tmp)){\n if(pathinfo($inputFile.'/'.$tmp, PATHINFO_EXTENSION) == 'h'){\n array_push($files, $inputFile.'/'.$tmp);\n }\n }\n }\n else{\n fprintf(STDERR, \"Zadana cesta nie je ani subor, ani adresar.\");\n exit(2);\n }\n }\n } \n \n \n }\n else{\n fprintf(STDERR, \"Zadana cesta nie je ani subor, ani adresar.\");\n exit(2);\n } \n \n return $files;\n}",
"function wp_make_theme_file_tree($allowed_files)\n {\n }",
"private final function commandLinkDup() {\n\t\t$storageDir = $this->storage->getStorageDirectory();\n\t\t\n\t\t// create recursive iterator, so we can walk all files\n\t\t// unfortunately we can't pass flags to only get pathname here as RecursiveIteratorIterator doesn't work anymore then\n\t\t$storageDirIterator = new RecursiveDirectoryIterator( $storageDir, FilesystemIterator::FOLLOW_SYMLINKS | RecursiveDirectoryIterator::SKIP_DOTS ); \n\t\t\n\t\t// filter storageDirIterator\n\t\t$filteredStorageDirIterator = new RecursiveCallbackFilterIterator( $storageDirIterator, function( $current, $key, $iterator ) {\n\t\t\t$currentFilename = $current->getFilename();\n\t\t\t\n\t\t\t// skip hidden files and directories\n\t\t\tif ( ( $currentFilename[0] === '.' ) || ( ( $currentFilename === \"lost+found\" ) && $current->isDir() ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t});\n\t\t\n\t\t// used to store file sizes so we have a rough filter for files first\n\t\t$fileSizes = array();\n\t\t$numFiles = 0;\n\t\t$numFilesUnduped = 0;\n\t\t$startTime = microtime(true);\n\t\t\t\t\n\t\t$spaceSaved = 0;\n\t\t\n\t\t// report\n\t\tprintf(\"Starting iteration through %s\\n\", $storageDir);\n\t\t\n\t\t// iterate through directories and compare files as we go\n\t\tforeach ( new RecursiveIteratorIterator( $filteredStorageDirIterator, RecursiveIteratorIterator::CHILD_FIRST ) as $splFileObject ) {\n\t\t\t// skip directories\n\t\t\tif ( $splFileObject->isDir() ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\ttry {\n\t\t\t\t// SPLFileObject does not expose a method to read an \n\t\t\t\t// arbitrary number of bytes, so we need to get\n\t\t\t\t// the full Pathname to use a regular filehandle\n\t\t\t\t$fullFileName = $splFileObject->getPathname();\n\t\t\t\t\n\t\t\t\tif ( ( $fileHandle = fopen($fullFileName, 'rb') ) === false ) {\n\t\t\t\t\t// in case we can't open the file, we report and continue\n\t\t\t\t\t$this->notifyError( \"Unable to read file $fullFileName\\n\" );\n\t\t\t\t\t\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// according to php manual, this function does not fail\n\t\t\t\t$stats = fstat($fileHandle);\n\t\t\t\t\n\t\t\t\t$fileSize = $stats['size'];\n\t\t\t\t\n\t\t\t\t$fileIno = $stats['ino'];\n\t\t\t\t$fileDev = $stats['dev'];\n\t\t\t\t\t\t\t\n\t\t\t\t// !isset? -> no files with that size yet\n\t\t\t\tif (!isset($fileSizes[$fileSize])) {\n\t\t\t\t\t$fileSizes[$fileSize] = array();\n\t\t\t\t} \t\t\n\t\t\t\t\n\t\t\t\t// read first 32k of data to use as base for hash comparison\n\t\t\t\t// by limiting to fixed length at start of file we stay time-constant in theory\n\t\t\t\tif ( ( $data = fread($fileHandle, 32768) ) === false ) {\n\t\t\t\t\t// in case of error, we report and continue\n\t\t\t\t\t\n\t\t\t\t\tfclose( $fileHandle );\n\t\t\t\t\t\n\t\t\t\t\t$this->notifyError( \"Unable to read 32k from $fullFileName\\n\" );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// crc is less compute intensive than e.g. md5 and should be sufficient for our case\n\t\t\t\t// according to php manual, this function does not fail\n\t\t\t\t$crc = crc32($data);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (isset($fileSizes[$fileSize][$crc])) {\n\t\t\t\t\t// as we've already read 32k, we need to first \n\t\t\t\t\t// rewind the pointer to make sure to read everything\n\t\t\t\t\t// it would also be possible to prepend $data, but we\n\t\t\t\t\t// would then risk to not have mmap\n\t\t\t\t\trewind( $fileHandle );\n\t\t\t\t\t\n\t\t\t\t\t// hopefully php will mmap this\n\t\t\t\t\t$fileContents = stream_get_contents($fileHandle);\n\t\t\t\t\tfclose($fileHandle);\n\t\t\t\t\t\n\t\t\t\t\tforeach ($fileSizes[$fileSize][$crc] as $fullFileNameOther ) {\n\t\t\t\t\t\t// first check that this isn't already linking to the same \n\t\t\t\t\t\t// if so, we can completely skip this file\n\t\t\t\t\t\t$statsOther = stat( $fullFileNameOther );\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( ( $fileDev === $statsOther['dev'] ) && ( $fileIno === $statsOther['ino'] ) ) {\n\t\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// exact comparison - if match found: hardlink (and count for report)\n\t\t\t\t\t\t// file_get_contents & stream_get_contents should use mmap \n\t\t\t\t\t\t// and thus be more efficient than fread \n\t\t\t\t\t\t// unfortunately we can't really save anything into variables without \n\t\t\t\t\t\t// possibly loosing optimizations, which makes error handling bad\n\t\t\t\t\t\tif ($fileContents === file_get_contents($fullFileNameOther)) {\n\t\t\t\t\t\t\t// create link on different filename and then rename it\n\t\t\t\t\t\t\t// to original filename - this way we achieve atomic operation\n\t\t\n\t\t\t\t\t\t\t$linkName = $fullFileNameOther . '_LINK';\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// check for file with $linkName already existing\n\t\t\t\t\t\t\tif ( file_exists( $linkName ) ) {\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// if so, it was probably left from a previous iteration\n\t\t\t\t\t\t\t\t// but we can't just delete, so we report and skip\n\t\t\t\t\t\t\t\t$this->notifyError( \"$linkName already exists\\n\" );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t// hard link file to already existing one so we can remove doubled contents\n\t\t\t\t\t\t\t\tif ( link( $fullFileNameOther, $linkName ) === false ) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$this->notifyError( \"Unable to create link $linkName pointing to $fullFileNameOther\\n\" );\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// in case of error creating link, we can just \n\t\t\t\t\t\t\t\t\t// continue to next file after reporting\n\t\t\t\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch( Exception $linkException ) {\n\t\t\t\t\t\t\t\t// may encounter exception in case of permission problem\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->notifyError( \"Exception trying to link $linkName pointing to $fullFileNameOther\\n\" );\n\t\t\t\t\t\t\t\t$this->notifyError( $linkException->getMessage() );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tcontinue 2;\n\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\t\t\t\t\n\t\t\t\t\t\t\t// attempt to rename link to original filename ;\n\t\t\t\t\t\t\t// unfortunately there's no way to make sure that\n\t\t\t\t\t\t\t// this is the original file we've been dealing\n\t\t\t\t\t\t\t// with / make the operation atomic\n\t\t\t\t\t\t\tif ( rename( $linkName, $fullFileName ) === false ) {\n\t\t\t\t\t\t\t\t$this->notifyError( \"Unable to rename link from $linkName to $fullFileName\\n\" );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// if we err on rename, we need to remove link again before proceeding\n\t\t\t\t\t\t\t\tif ( unlink( $linkName ) === false ) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// something went really wrong if we're unable to remove \n\t\t\t\t\t\t\t\t\t// the link we just created again\n\t\t\t\t\t\t\t\t\tthrow new Exception( \"Unable to remove the link at $linkName after creating it\" );\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// in case of error creating link, we can just \n\t\t\t\t\t\t\t\t// continue to next file after reporting\n\t\t\t\t\t\t\t\tcontinue 2;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$numFilesUnduped++;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$spaceSaved += $fileSize;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// jump to next file\n\t\t\t\t\t\t\tcontinue 2;\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// if no match found, add to array\n\t\t\t\t\t$fileSizes[$fileSize][$crc][] = $fullFileName;\n\t\t\t\t} else {\n\t\t\t\t\tfclose($fileHandle);\n\t\t\t\t\t\n\t\t\t\t\t$fileSizes[$fileSize][$crc] = array( $fullFileName );\n\t\t\t\t}\n\n\t\t\t} catch(Exception $e) {\n\t\t\t\tif (isset($fileHandle) && is_resource($fileHandle)) {\n\t\t\t\t\tfclose($fileHandle);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tthrow $e;\n\t\t\t}\n\t\t\t\n\t\t\t// count number of files, so we can display something in the meantime\n\t\t\t$numFiles ++;\n\t\t\t\n\t\t\t// progress report\n\t\t\tprintf(\"\\rFiles scanned: %d - Files unduped: %d - Space saved: %s\", $numFiles, $numFilesUnduped, StringFilter::formatFileSize($spaceSaved) );\n\t\t}\n\t\t\n\t\tprint(\"\\n\");\n\t\t\n\t\t\n\t\techo \"Finished unduping.\\n\";\t\t\n\t}",
"function set_templates_directory() {\n $parent_basepath = get_template_directory() . '/';\n $current_basepath = get_stylesheet_directory() . '/';\n $template_dirs = array(\n 'templates',\n 'partials',\n 'twig-components',\n\t 'pattern-library'\n );\n\n $path_list = array();\n\n foreach ($template_dirs as $subdir) {\n $subdirs = $this->get_subdirectories($current_basepath . $subdir, $current_basepath);\n if ($subdirs) {\n $path_list = array_merge($path_list, $subdirs);\n }\n }\n\n if ( $parent_basepath !== $current_basepath ) {\n foreach ($template_dirs as $subdir) {\n $subdirs = $this->get_subdirectories($parent_basepath . $subdir, $parent_basepath);\n if ($subdirs) {\n $path_list = array_merge($path_list, $subdirs);\n }\n }\n }\n\n Timber::$dirname = $path_list;\n }",
"public function testCreateSubDirsWithExistingDirectory()\n {\n mkdir($this->dir.'56');\n $this->assertNotEmpty($this->hd->getHash());\n }",
"function get_files($instructor=False, $sources=array('class', 'lab', 'project', 'exam', 'review', 'capstone', 'continued-lab'), $file_path = '.', $access=array(), $virtual=array(), $categories=array(), $secret='really') {\n $results = array();\n $basedir = scandir($file_path);\n foreach ($sources as $i => $l0) {\n if (in_array($l0, $basedir) && is_dir($file_path . '/' . $l0)) {\n $level1 = scandir($file_path . '/' . $l0);\n sort($level1);\n foreach ($level1 as $i => $l1) {\n if (substr($l1, 0, 1) != '.' && is_dir($file_path . '/' . $l0 . '/' . $l1)) {\n // The following code allows the system recursively look through the Directory\n // structure within a class, and the system can now process RELATIVE links\n // that go into those subordinate directories\n $level2 = array();\n try {\n $Iterator = new RecursiveIteratorIterator(\n new RecursiveDirectoryIterator($file_path . '/' . $l0 . '/' . $l1),\n RecursiveIteratorIterator::LEAVES_ONLY,\n RecursiveIteratorIterator::CATCH_GET_CHILD);\n foreach($Iterator as $name => $object) {\n $name = explode(\"/\", $name);\n unset($name[2]);\n unset($name[1]);\n unset($name[0]);\n $name = implode(\"/\", $name);\n $level2[] = $name;\n }\n } catch (Exception $e) {\n // Unable to recurse, so don't bother...\n }\n //$level2 = scandir($file_path . '/' . $l0 . '/' . $l1);\n $results[$l0][$l1] = array();\n sort($level2);\n foreach ($level2 as $i => $l2) {\n $key = sha1($secret.$l0.$l1.$l2);\n if (substr($l2, 0, 1) != '.' && validate_file($instructor, $l2, $file_path . '/' . $l0 . '/' . $l1 . '/' . $l2, $access)[0]) {\n if (is_link($file_path . '/' . $l0 . '/' . $l1 . '/' . $l2)) {\n if (validate_file($instructor, readlink($file_path . '/' . $l0 . '/' . $l1 . '/' . $l2), readlink($file_path . '/' . $l0 . '/' . $l1 . '/' . $l2), $access)[0]) {\n $vf = validate_file($instructor, readlink($file_path . '/' . $l0 . '/' . $l1 . '/' . $l2), readlink($file_path . '/' . $l0 . '/' . $l1 . '/' . $l2), $access);\n $category = categorize_file($instructor, $l2, readlink($file_path . '/' . $l0 . '/' . $l1 . '/' . $l2), $vf[5], $categories);\n $results[$l0][$l1][$l2] = array('actual' => $file_path . '/' . $l0 . '/' . $l1 . '/' . readlink($file_path . '/' . $l0 . '/' . $l1 . '/' . $l2),\n 'visible' => $vf[1],\n 'year' => $vf[2],\n 'month' => $vf[3],\n 'day' => $vf[4],\n 'type' => $category[0],\n 'category' => $category[1],\n 'key' => $key);\n }\n } else {\n $vf = validate_file($instructor, $l2, $file_path . '/' . $l0 . '/' . $l1 . '/' . $l2, $access);\n $category = categorize_file($instructor, $l2, $file_path . '/' . $l0 . '/' . $l1 . '/' . $l2, $vf[5], $categories);\n $results[$l0][$l1][$l2] = array('actual' => $file_path . '/' . $l0 . '/' . $l1 . '/' . $l2,\n 'visible' => $vf[1],\n 'year' => $vf[2],\n 'month' => $vf[3],\n 'day' => $vf[4],\n 'type' => $category[0],\n 'category' => $category[1],\n 'key' => $key);\n }\n }\n }\n }\n }\n }\n }\n # Add Virtual files, format like array('class'=>array(1 => array(array('answers.html', 'homework/answers05.html'))))\n foreach ($virtual as $l0 => $l1array) {\n if (isset($results[$l0])) {\n $classes = array_keys($results[$l0]);\n foreach ($l1array as $day => $l2array) {\n if (isset($classes[$day-1])) {\n foreach ($l2array as $i => $values) {\n $virt_file = $values[0];\n $real_file = $values[1];\n if (validate_file($instructor, $real_file, $real_file, $access)[0]) {\n $key = sha1($secret.$real_file.$virt_file);\n $vf = validate_file($instructor, $real_file, $real_file, $access);\n $category = categorize_file($instructor, $virt_file, $real_file, $vf[5], $categories);\n $results[$l0][$classes[$day-1]][$virt_file] = array('actual' => $real_file,\n 'visible' => $vf[1],\n 'year' => $vf[2],\n 'month' => $vf[3],\n 'day' => $vf[4],\n 'type' => $category[0],\n 'category' => $category[1],\n 'key' => $key);\n }\n }\n }\n }\n }\n }\n #####################################################\n # Verify that the class is not blocked by security...\n $today = getdate();\n foreach ($results as $l0 => $classes) {\n $counter = 1;\n foreach ($classes as $l1 => $data) {\n foreach ($data as $filename => $fdata) {\n if ($fdata['year'] == 1 && $fdata['month'] == 1 && $fdata['day'] == 1) {\n $cate = $fdata['category'];\n if (isset($access[$l0.\"_\".$counter]) && $cate == 'title') {\n $sspec = $l0.\"_\".$counter;\n $results[$l0][$l1][$filename]['month'] = $access[$sspec]['month'];\n $results[$l0][$l1][$filename]['day'] = $access[$sspec]['day'];\n if (($today['mon'] > $access[$sspec]['month']) || ($today['mon'] == $access[$sspec]['month'] && $today['mday'] >= $access[$sspec]['day'])) {\n } else {\n $results[$l0][$l1][$filename]['visible'] = False;\n if (!$instructor) {\n unset($results[$l0][$l1][$filename]);\n }\n }\n } elseif (isset($access[$l0.\"_\".$counter.\"/\".$cate])) {\n $sspec = $l0.\"_\".$counter.\"/\".$cate;\n $results[$l0][$l1][$filename]['month'] = $access[$sspec]['month'];\n $results[$l0][$l1][$filename]['day'] = $access[$sspec]['day'];\n if (($today['mon'] > $access[$sspec]['month']) || ($today['mon'] == $access[$sspec]['month'] && $today['mday'] >= $access[$sspec]['day'])) {\n } else {\n $results[$l0][$l1][$filename]['visible'] = False;\n if (!$instructor) {\n unset($results[$l0][$l1][$filename]);\n }\n }\n } elseif (isset($access[$l0.\"_\".$counter.\"/\".$filename])) {\n $sspec = $l0.\"_\".$counter.\"/\".$filename;\n $results[$l0][$l1][$filename]['month'] = $access[$sspec]['month'];\n $results[$l0][$l1][$filename]['day'] = $access[$sspec]['day'];\n if (($today['mon'] > $access[$sspec]['month']) || ($today['mon'] == $access[$sspec]['month'] && $today['mday'] >= $access[$sspec]['day'])) {\n } else {\n $results[$l0][$l1][$filename]['visible'] = False;\n if (!$instructor) {\n unset($results[$l0][$l1][$filename]);\n }\n }\n } elseif (isset($access[$l0.\"_\".$counter.\"/all\"])) {\n $sspec = $l0.\"_\".$counter.\"/all\";\n $results[$l0][$l1][$filename]['month'] = $access[$sspec]['month'];\n $results[$l0][$l1][$filename]['day'] = $access[$sspec]['day'];\n if (($today['mon'] > $access[$sspec]['month']) || ($today['mon'] == $access[$sspec]['month'] && $today['mday'] >= $access[$sspec]['day'])) {\n } else {\n $results[$l0][$l1][$filename]['visible'] = False;\n if (!$instructor) {\n unset($results[$l0][$l1][$filename]);\n }\n }\n }\n }\n }\n $counter++;\n }\n }\n return $results;\n }",
"function _prepare_cache_path($cur_cache_name = \"\") { \n\t\t// Get name of the cache file\n\t\tif (empty($cur_cache_name)) {\n\t\t\treturn false;\n\t\t}\n\t\t// Memcached code\n\t\tif ($this->USE_MEMCACHED) {\n\t\t\treturn $cur_cache_name;\n\t\t}\n\t\t// Base cache dir\n\t\t$cache_dir = $this->CACHE_DIR;\n\t\t// Create subdir (a/b/c)\n\t\t$cache_sub_dir = $cur_cache_name[0].\"/\".$cur_cache_name[1].\"/\".$cur_cache_name[2].\"/\";\n\t\t$cache_dir .= $cache_sub_dir;\n\t\t_mkdir_m($cache_dir, 0777);\n\t\treturn $cache_dir. $this->_file_prefix. $cur_cache_name. $this->_file_ext;\n\t}",
"protected function fixFiles()\n {\n\n \tforeach (glob(base_path($this->passport_path) . '*.php') as $filename)\n \t{\n \t $file = file_get_contents($filename);\n \t file_put_contents($filename, str_replace($this->laravel_model, $this->mongo_model, $file));\n \t //$this->info($filename . \" has been Checked/Modified\");\n \t}\n\n }",
"private function createNewTempdir(){\n $tempdirname = '';\n do{\n $tempdirname = uniqid('temp_',true);\n }while(file_exists(FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.$tempdirname));\n\n if(@mkdir(FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.$tempdirname)){\n mkdir(FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.$tempdirname.DIRECTORY_SEPARATOR.'gallery');\n }else{\n die(json_encode(array('state'=>'error','data'=> $this->text('e28').': '.FRONTEND_ABSDIRPATH.ARTICLEIMAGESPATH.'!')));\n }\n return $tempdirname;\n }",
"function directory_mapper($path)\n{\n $maxDepth = 3;\n $minDepth = 3;\n $iterator = new RecursiveIteratorIterator(\n new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS),\n RecursiveIteratorIterator::SELF_FIRST,\n RecursiveIteratorIterator::CATCH_GET_CHILD// Ignore \"Permission denied\"\n );\n $iterator->setMaxDepth($maxDepth);\n\n $paths = array($path);\n foreach ($iterator as $path => $dir) {\n if ($iterator->getDepth() >= $minDepth) {\n if ($dir->isDir()) {\n if (file_exists($dir . DIRECTORY_SEPARATOR . \"meta\")) {\n $paths[] = $path;\n }\n }\n }\n }\n array_shift($paths);\n return $paths;\n}",
"private function createDir($fileName)\n {\n // Split filename into array every x chars\n $filename_arr = str_split($fileName, $this->folder_chars);\n\n $upload_root_dir = $this->getUploadRootDir();\n\n // Create any directories which don't exist yet\n $i = 0;\n while ($i < $this->folder_depth) {\n\n // Set current absolute dir to check for existence\n $dir = $upload_root_dir . '/' . $filename_arr[$i];\n\n // Create dir if none exists\n if (!file_exists($dir)) {\n mkdir($dir);\n }\n\n // Set current dir as new parent folder\n $upload_root_dir = $dir;\n\n $i++;\n }\n }",
"protected static function moveTemporaryDirs()\n {\n if (static::isCapsular()) {\n // Rename directories\n $original = static::getCacheDirs(false);\n foreach (static::getCacheDirs(true) as $i => $tmpDir) {\n \\Includes\\Utils\\FileManager::unlinkRecursive($tmpDir);\n $originalDir = $original[$i];\n rename($originalDir, $tmpDir);\n }\n\n // Rename files\n $original = static::getDecoratorDataFiles(false);\n foreach (static::getDecoratorDataFiles(true) as $i => $tmpPath) {\n $destPath = $original[$i];\n if (file_exists($tmpPath)) {\n rename($tmpPath, $destPath);\n }\n }\n }\n }",
"function rebalanceDir($directory)\n{\n # Get file count for progress\n $countingIterator = new RecursiveDirectoryIterator($directory);\n $numFiles = 0;\n\n foreach (new RecursiveIteratorIterator($countingIterator) as $filename => $file) \n {\n if (!is_dir($filename))\n {\n $numFiles++;\n }\n }\n \n\n # Now \"rebalance\"\n $iterator = new RecursiveDirectoryIterator($directory);\n $progressCounter = 0;\n $lastPercentage = 0;\n\n foreach (new RecursiveIteratorIterator($iterator) as $filename => $file) \n {\n if (!is_dir($filename))\n {\n $progressCounter++;\n\n $newPercentage = intval(($progressCounter / $numFiles * 100));\n if ($newPercentage !== $lastPercentage)\n {\n print $newPercentage . \"%\" . PHP_EOL;\n $lastPercentage = $newPercentage;\n }\n \n \n $counter = 1;\n\n while (is_file($filename . $counter))\n {\n $counter++;\n }\n \n $newname = $filename . $counter;\n \n # We have to use copy first instead of rename because we need \n # new data blocks to be rewritten across all drives. Performing\n # a rename would just change the metadata.\n copy($filename, $newname);\n unlink($filename);\n \n # Rename the file back to what it was originally called.\n rename($newname, $filename);\n }\n }\n}",
"private function _determine_write_this()\n\t{\n\t\t// Not a directory and doesn't exist already...\n\t\tif (substr($this->_current['filename'], -1) !== '/' && !file_exists($this->destination . '/' . $this->_current['filename']))\n\t\t{\n\t\t\t$this->_write_this = true;\n\t\t}\n\t\t// File exists... check if it is newer.\n\t\telseif (substr($this->_current['filename'], -1) !== '/')\n\t\t{\n\t\t\t$this->_write_this = $this->overwrite || filemtime($this->destination . '/' . $this->_current['filename']) < $this->_current['mtime'];\n\t\t}\n\t\t// Folder... create.\n\t\telseif ($this->destination !== null && !$this->single_file)\n\t\t{\n\t\t\t// Protect from accidental parent directory writing...\n\t\t\t$this->_current['filename'] = strtr($this->_current['filename'], array('../' => '', '/..' => ''));\n\n\t\t\tif (!file_exists($this->destination . '/' . $this->_current['filename']))\n\t\t\t{\n\t\t\t\tmktree($this->destination . '/' . $this->_current['filename']);\n\t\t\t}\n\t\t\t$this->_write_this = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_write_this = false;\n\t\t}\n\t}",
"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}",
"abstract protected function getFilesDestination();",
"function rScanDir($scanMe) {\r\n\t\tglobal $path, $tmpPath, $cur_folder, $tags2;\r\n\t\tforeach($scanMe as $folder)\r\n\t\t{\r\n\t\t\tif(is_dir($path.$tmpPath.$folder) && $folder !=\".\" && $folder !=\"..\")\r\n\t\t\t{\r\n\t\t\t\t$cur_folder[] = $tmpPath.$folder;\r\n\t\t\t\techo \"getTagString input:\".$tmpPath.$folder.\"<br/>\";\r\n\t\t\t\t$tags2[] = getTagString($tmpPath.$folder);\r\n\t\t\t\t$tmpPath .= $folder.\"/\";\r\n\t\t\t\trScanDir(scandir($path.$tmpPath));\r\n\t\t\t}\r\n\t\t}\r\n\t\t$tmpPath = substr($tmpPath, 0, strrpos($tmpPath, \"/\"));\r\n\t\t$tmpPath = substr($tmpPath, 0, strrpos($tmpPath, \"/\")+1);\r\n\t}",
"protected function syncSharedFolders()\n\t{\n\t\t$currentRelease = $this->releasesManager->getCurrentReleasePath();\n\t\tforeach ($this->rocketeer->getShared() as $file) {\n\t\t\t$this->share($currentRelease.'/'.$file);\n\t\t}\n\t}",
"protected function createDirectories()\n {\n if (! is_dir(app_path('Http/Controllers/Teamwork'))) {\n mkdir(app_path('Http/Controllers/Teamwork'), 0755, true);\n }\n if (! is_dir(app_path('Listeners/Teamwork'))) {\n mkdir(app_path('Listeners/Teamwork'), 0755, true);\n }\n if (! is_dir(base_path('resources/views/teamwork'))) {\n mkdir(base_path('resources/views/teamwork'), 0755, true);\n }\n if (! is_dir(base_path('resources/views/teamwork/emails'))) {\n mkdir(base_path('resources/views/teamwork/emails'), 0755, true);\n }\n if (! is_dir(base_path('resources/views/teamwork/members'))) {\n mkdir(base_path('resources/views/teamwork/members'), 0755, true);\n }\n }",
"public function mkDir($path);",
"function checkPaths() {\n\tif(!file_exists(MODEL_PATH)) {\n\t\tmkdir(MODEL_PATH);\n\t}\n\tif(!file_exists(ENTITY_PATH)) {\n\t\tmkdir(ENTITY_PATH);\n\t}\n\tif(!file_exists(REPOSITORY_PATH)) {\n\t\tmkdir(REPOSITORY_PATH);\n\t}\n}",
"public function cleanUpFolder()\r\n {\r\n $fs = new Filesystem();\r\n\r\n foreach($this->file_list as $file) :\r\n if ( preg_match('#^'.$this->destination_dir.'/#', $file))\r\n $fs->remove($file);\r\n endforeach;\r\n }",
"public function parseFiles()\n {\n $this->files->each(function ($file) {\n $this->store[] = $this->getTree($this->parseFile($file), $file);\n });\n }",
"function recurseDir($dir) {\r\n if(is_dir($dir)) {\r\n if($dh = opendir($dir)){\r\n while($file = readdir($dh)){\r\n if($file != '.' && $file != '..' && $file != \"Thumbs.db\"){\r\n //This builds the complete file path\r\n $filePath = $dir . \"/\" . $file;\r\n //if statement to see if its a directory or file\r\n if(is_dir($filePath)){\r\n //This splits the file path and returns and array\r\n $parentDirPath = explode(\"/\",$filePath);\r\n //this figures out what the parent directory is\r\n $parentDir = count($parentDirPath) -2;\r\n //This figures out waht the current directory is most like to be removed\r\n //$curDir = count($parentDirPath) -2;\r\n //This gets the last part of the file path and sets the name of the directory or file\r\n $name = end($parentDirPath);\r\n //This is test code to tell what the code is doing will be removed for actual db population\r\n echo $name . \" Is a Directory and its parent directory is \" . $parentDirPath[$parentDir] . \"<br / >\";\r\n //This escapes all characters for the db queries\r\n $name = mysql_real_escape_string($name);\r\n //This escapes the parent dir for the query below\r\n $parentDir = mysql_real_escape_string($parentDirPath[$parentDir]);\r\n //$parentDir = $parentDirPath[$parentDir];\r\n $dir = mysql_real_escape_string($dir);\r\n //Build the query to get the parent directory id\r\n $getParentDirId = mysql_query(\"SELECT id FROM directories WHERE name = '$parentDir' \")\r\n or die(mysql_error());\r\n //While loop to set the parent id for use\r\n while($row = mysql_fetch_array($getParentDirId)){\r\n $parentDirId = $row[id];\r\n }\r\n echo \"parent id \" . $parentDirId;\r\n //Build the query to check if the file already exists in the dg\r\n $checkExists = mysql_query(\"SELECT COUNT(id) AS 'exists' FROM directories WHERE name = '$name' AND parent = '$parentDirId' AND path = '$dir'\")\r\n or die(mysql_error());\r\n //While loop to set the exists variable\r\n while($row = mysql_fetch_array($checkExists)){\r\n $exists = $row[exists];\r\n echo \" This is the $exists\";\r\n\r\n //If statment that checks the exists variable to see if it needs to add the current information to the db\r\n if($exists <1){\r\n //Query to insert data into database\r\n $result = mysql_query(\"INSERT INTO directories (id,path, name, parent) VALUES (NULL,'$dir', '$name', '$parentDirId]') \") or die(mysql_error());\r\n }\r\n }\r\n //Since this is a directory this calls the function again to loop back through a subfolder\r\n recurseDir($filePath);\r\n\r\n }elseif(is_file($filePath)){\r\n //This splits the filepath and returns and array\r\n $parentDirPath = explode(\"/\",$filePath);\r\n //This gets the paretnt dir to the file might not be needed\r\n $parentDir = count($parentDirPath) -3;\r\n //This gets the directory that the file is located\r\n $curDir = count($parentDirPath) -2;\r\n //This gets the last part of the file path and sets the name of the directory or file\r\n $name = end($parentDirPath);\r\n //This returns the filesize in MB need to write function to have it do gb & kb depending on size\r\n $fileSize = round(filesize($filePath) /1048576);\r\n //This splits the filename from the extension and returns and array\r\n $getExtentsion = explode(\".\", $name);\r\n //This sets the extension\r\n $extenstion = $getExtentsion[1];\r\n //This sets the filename\r\n $fileName = $getExtentsion[0];\r\n //This is test code to tell what the code is doing will be removed for actual db population\r\n /* echo \"<br />\\t\\t\" . $fileName . \" Is a file Located in \" . $parentDirPath[$curDir] . \" The parent directory is \" . $parentDirPath[$parentDir] .\r\n \" and a file size of \" . $fileSize . \" MB and an extenstion of \" . $extenstion . \"<br />\";*/\r\n /*echo \"<br />\\t\\t\" . $fileName . \" Is Located in \" . $parentDirPath[$curDir] . \" parent directory is \" . $parentDirPath[$parentDir] .\r\n \" size of \" . $fileSize . \" MB extenstion \" . $extenstion . \"<br />\";*/\r\n //echo \"this is what you are trying to echo \" . $directory_tree_file['pDir'];\r\n\r\n }else{\r\n //echo $filePath . \" WTF?<br />\";\r\n }\r\n\r\n }\r\n }//End while\r\n }\r\n closedir($dh);\r\n }\r\n}",
"public function testOnNewDirectory() {\n\n $obj = new FileSystemStorageProvider($this->logger, $this->directory);\n\n $obj->onNewDirectory($this->dir1);\n $this->assertFileExists($this->directory . \"/1\");\n\n $obj->onNewDirectory($this->dir2);\n $this->assertFileExists($this->directory . \"/1/2\");\n\n $obj->onNewDirectory($this->dir3);\n $this->assertFileExists($this->directory . \"/1/2/3\");\n }"
] | [
"0.6514632",
"0.6415947",
"0.62935805",
"0.6164809",
"0.59838384",
"0.5964056",
"0.590012",
"0.58860165",
"0.58860165",
"0.5814953",
"0.57366836",
"0.56986713",
"0.56957483",
"0.5694783",
"0.5622184",
"0.5614624",
"0.5602318",
"0.55879045",
"0.55843985",
"0.55655247",
"0.552982",
"0.5522652",
"0.5521412",
"0.55124235",
"0.549693",
"0.54903525",
"0.54901385",
"0.5478449",
"0.5472289",
"0.5458414",
"0.5450186",
"0.54377776",
"0.54023814",
"0.54016197",
"0.54015374",
"0.53941184",
"0.53904366",
"0.5358861",
"0.53491896",
"0.5342837",
"0.5335189",
"0.53029925",
"0.5282351",
"0.52790844",
"0.524793",
"0.52476513",
"0.52392983",
"0.5238722",
"0.52219546",
"0.5208151",
"0.52004904",
"0.5189894",
"0.5185195",
"0.51828784",
"0.51813203",
"0.51779693",
"0.5176315",
"0.5170165",
"0.5160825",
"0.51550734",
"0.5151778",
"0.5149563",
"0.5121746",
"0.51113147",
"0.5109363",
"0.51063484",
"0.50969106",
"0.50906134",
"0.508303",
"0.50736266",
"0.5073065",
"0.5071078",
"0.50694263",
"0.5068394",
"0.50618166",
"0.50575596",
"0.5057059",
"0.50554264",
"0.5037901",
"0.5034172",
"0.503387",
"0.503337",
"0.50167996",
"0.50157624",
"0.5009906",
"0.50042343",
"0.50017315",
"0.5001416",
"0.50003207",
"0.49952757",
"0.4989232",
"0.49884212",
"0.4988392",
"0.49813166",
"0.49800897",
"0.49762565",
"0.4970331",
"0.49671248",
"0.49668252",
"0.49653396"
] | 0.6575896 | 0 |
Prepares array with expected exceptions for processed files. | private function prepareExpectedExceptions(string $dirname): array
{
return [
"$dirname/first/file_first.exe" => new Exception('Some error occurred'),
"$dirname/second/file_third.exe" => new Exception('Another error found'),
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function invalidFiles()\n\t{\n\t\treturn array('error'=>'invalid');\n\t}",
"private static function throwInProcess($trace = null): array\n {\n if($trace instanceof Throwable){\n if(AppContainer::get('debugBackTrace')){\n $file = $trace->getTrace()[0]['file'] ?? '';\n $line = $trace->getTrace()[0]['line'] ?? '';\n }\n\n return array_merge_recursive([\n 'file' => $file ?? $trace->getFile(),\n 'line' => $line ?? $trace->getLine()\n ],static::getExtraStaticExceptionSupplement());\n }\n\n return array_merge_recursive([\n 'file' => ($trace[0]['file'] ?? null),\n 'line' => ($trace[0]['line'] ?? null)\n ],static::getExtraStaticExceptionSupplement());\n }",
"private function getInitialErrors()\n\t{\n\t\t$errors = [];\n\n\t\t// Make sure our file doesn't exist (unless we're appending)\n\t\tif(file_exists($this->config['file']) && ! $this->append)\n\t\t{\n\t\t\t$errors[] = 'File exists';\n\t\t}\n\n\t\t// Create our file\n\t\tif( ! touch($this->config['file']))\n\t\t{\n\t\t\t$errors[] = 'Could not create file';\n\t\t}\n\n\t\t// Make sure we can write to our file\n\t\tif( ! is_writable($this->config['file']))\n\t\t{\n\t\t\t$errors[] = 'Cannot write to file';\n\t\t}\n\n\t\treturn empty($errors) ? false : $errors;\n\t}",
"public function getMandatoryExceptions()\n {\n if ($this->_mandatoryExceptions === null) {\n $this->_mandatoryExceptions = [];\n\n $exceptions = $this->_config->get('dataprocessing/mandatory/exceptions');\n\n if (!empty($exceptions)) {\n if (is_array($exceptions['exception']) && is_int(key($exceptions['exception']))) {\n foreach ($exceptions['exception'] as $exception) {\n $this->_mandatoryExceptions[] = Cemes::loadModule('Helper/Exception', [$exception], 'Fci');\n }\n } else {\n $this->_mandatoryExceptions[] = Cemes::loadModule(\n 'Helper/Exception',\n [$exceptions['exception']],\n 'Fci'\n );\n }\n }\n }\n\n return $this->_mandatoryExceptions;\n }",
"#[ArrayShape(['request' => \"array\", 'debugBackTrace' => \"array|mixed\"])]\n private static function getExtraStaticExceptionSupplement() : array\n {\n return [\n 'request' => [\n request()->method() => static::getRequest(),\n 'queryParams' => request()->query->all()\n ],\n 'debugBackTrace' => AppContainer::has(Constants::debugBackTrace)\n ? AppContainer::get(Constants::debugBackTrace)\n : debug_backtrace()\n ];\n }",
"private function ensureInitials()\n\t{\n\t\t$errors = $this->getInitialErrors();\n\n\t\tif($errors)\n\t\t{\n\t\t\tthrow new \\Exception(implode('<br>', $errors), 1);\n\t\t}\n\t}",
"private function prepareArray()\n {\n $tempItems = trim(Input::get('items'));\n $items = explode(PHP_EOL, $tempItems);\n $badItemsToTest = ['shp#', 'totals', 'total', 'shipment', 'shipment#', ''];\n\n $finalArray = array();\n\n foreach ($items as $item) {\n\n if (in_array(strtolower(trim($item)), $badItemsToTest) == false) {\n array_push($finalArray, trim($item));\n }\n\n }\n return $finalArray;\n\n\n }",
"public function dataParseExceptionDataProvider(): array\n {\n return array_merge(\n $this->prepareNonUniqueNameTestData()\n );\n }",
"public function provideInvalidConfig()\n {\n return array(\n array('\\GSOcr\\Exception\\RuntimeException', array()),\n array('\\GSOcr\\Exception\\RuntimeException', array('ocr' => array())),\n array('\\GSOcr\\Exception\\RuntimeException', array('ocr' => array('service' => 'test'))),\n );\n }",
"private function prepareFailter(array $def) : array {\n foreach($def as $k => &$v) {\n if (static::isFilter($v)) continue;\n if ( ! static::array_is_num($v)) {\n $def[$k] = new static($v);\n continue;\n }\n }\n return $def; \n }",
"public function invalidArrayForArrayConfigurationProvider() {}",
"private function normalizeFiles(): array\n {\n $files = $_FILES;\n $normalized = [];\n foreach ($files as $key => $value) {\n if ($value instanceof UploadedFileInterface) {\n $normalized[$key] = $value;\n } elseif (\\is_array($value) && isset($value['tmp_name'])) {\n $normalized[$key] = $this->createUploadedFileFromSpec($value);\n } elseif (\\is_array($value)) {\n $normalized[$key] = $this->normalizeFiles($value);\n } else {\n throw new \\InvalidArgumentException('Invalid value in files specification');\n }\n }\n return $normalized;\n }",
"public function provideExceptionalCreationScenario()\n {\n return [\n [__DIR__],\n [__DIR__ . DIRECTORY_SEPARATOR]\n ];\n }",
"function _fillFiles()\n\t{\n\t\t// directory from which we import (real path)\n\t\t$importDirectory = ereg_replace(\n\t\t\t\t\"^(.*)/$\", \n\t\t\t\t'\\1', \n\t\t\t\tereg_replace(\"^(.*)/$\", '\\1', $_SERVER[\"DOCUMENT_ROOT\"]) . $this->from);\n\t\t\n\t\t// when running on windows we have to change slashes to backslashes\n\t\tif (runAtWin()) {\n\t\t\t$importDirectory = str_replace(\"/\", \"\\\\\", $importDirectory);\n\t\t}\n\t\t$this->_files = array();\n\t\t$this->_depth = 0;\n\t\t$this->_postProcess = array();\n\t\t$this->_fillDirectories($importDirectory);\n\t\t// sort it so that webEdition files are at the end (that templates know about css and js files)\n\t\t\n\n\t\t$tmp = array();\n\t\tforeach ($this->_files as $e) {\n\t\t\tif ($e[\"contentType\"] == \"folder\") {\n\t\t\t\tarray_push($tmp, $e);\n\t\t\t}\n\t\t}\n\t\tforeach ($this->_files as $e) {\n\t\t\tif ($e[\"contentType\"] != \"folder\" && $e[\"contentType\"] != \"text/webedition\") {\n\t\t\t\tarray_push($tmp, $e);\n\t\t\t}\n\t\t}\n\t\tforeach ($this->_files as $e) {\n\t\t\tif ($e[\"contentType\"] == \"text/webedition\") {\n\t\t\t\tarray_push($tmp, $e);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->_files = $tmp;\n\t\t\n\t\tforeach ($this->_postProcess as $e) {\n\t\t\tarray_push($this->_files, $e);\n\t\t}\n\t}",
"public function getExceptions()\n {\n return array(\n array($this->getMock('\\Exception')),\n array($this->getMock('\\RuntimeException')),\n );\n }",
"public function provider_load_exception() {\n return array(\n array(\n 'text',// Field.\n array(// Post.\n \n ),\n ),\n array(\n 'text',// Field.\n array(// Post.\n 'text1',\n 'text2',\n NULL,\n FALSE,\n ),\n ),\n );\n }",
"public function providerFileNotFoundExceptions(): array\n {\n return $this->getKeyedArray([\n [\n 'TUFTestFixtureDelegated',\n 'timestamp.json',\n [\n 'root' => 5,\n 'timestamp' => null,\n 'snapshot' => null,\n 'targets' => 5,\n ],\n ],\n [\n 'TUFTestFixtureDelegated',\n '5.snapshot.json',\n [\n 'root' => 5,\n 'timestamp' => 5,\n 'snapshot' => null,\n 'targets' => 5,\n ],\n ],\n [\n 'TUFTestFixtureDelegated',\n '5.targets.json',\n [\n 'root' => 5,\n 'timestamp' => 5,\n 'snapshot' => 5,\n 'targets' => 3,\n ],\n ],\n [\n 'TUFTestFixtureSimple',\n 'timestamp.json',\n [\n 'root' => 2,\n 'timestamp' => 2,\n 'snapshot' => 2,\n 'targets' => 2,\n ],\n ],\n [\n 'TUFTestFixtureSimple',\n '2.snapshot.json',\n [\n 'root' => 2,\n 'timestamp' => 2,\n 'snapshot' => 2,\n 'targets' => 2,\n ],\n ],\n [\n 'TUFTestFixtureSimple',\n '2.targets.json',\n [\n 'root' => 2,\n 'timestamp' => 2,\n 'snapshot' => 2,\n 'targets' => 2,\n ],\n ],\n ]);\n }",
"abstract function bootErrorAction(array $errors = null);",
"public function throwNameExtOfFile( $sName ){\n return Array( $this->throwNameOfFile( $sName ), $this->throwExtOfFile( $sName ) );\n }",
"private function err_to_array() {\n return array(\n 'code' => $this->code,\n 'reason' => $this->http_status_code_string($this->code),\n 'message' => $this->message,\n );\n }",
"private function _setFileObject() {\n try {\n $fileArry = $_FILES;\n $_FILES = array();\n\n $fName = $fType = $fTmpName = $fErr = $fSize = array();\n foreach ($fileArry as $key => $val) {\n $fArr = explode('_', $key);\n $fKey = $fArr[0];\n $fPos = $fArr[1];\n\n $fName[] = $val['name'];\n $fType[] = $val['type'];\n $fTmpName[] = $val['tmp_name'];\n $fErr[] = $val['error'];\n $fSize[] = $val['size'];\n\n $_FILES[$fKey] = array(\n 'name' => $fName,\n 'type' => $fType,\n 'tmp_name' => $fTmpName,\n 'error' => $fErr,\n 'size' => $fSize\n );\n }\n } catch (Exception $ex) {\n throw new Exception('Error in _setFileObject function - ' . $ex);\n }\n }",
"private function prepareFiles() {\n $zip = new ZipArchive;\n if ($zip->open(self::PARSE_DIR . '/' . self::ARCHIVE_FILENAME) === TRUE) {\n $zip->extractTo($this->tmpFolder);\n $zip->close();\n } else {\n $this->errors[] = 'Невозможно распаковать архив!';\n }\n }",
"public static function failing_files() : array {\n\t\t$directory = dirname( __DIR__ ) . '/fixtures/ruleset/Lipe/fail';\n\n\t\treturn static::get_files_from_dir( $directory );\n\t}",
"public function getErrorList() : array {\n\t\t$file = func_get_arg( 0 );\n\t\tswitch ( $file ) {\n\t\t\tcase 'SlowMetaQueryUnitTest.success.inc':\n\t\t\t\treturn [];\n\n\t\t\tcase 'SlowMetaQueryUnitTest.fail.inc':\n\t\t\t\treturn [\n\t\t\t\t\t7 => 1,\n\t\t\t\t\t14 => 1,\n\t\t\t\t\t27 => 1,\n\t\t\t\t\t37 => 1,\n\t\t\t\t\t47 => 1,\n\t\t\t\t\t59 => 1,\n\t\t\t\t\t78 => 1,\n\t\t\t\t\t94 => 1,\n\t\t\t\t\t98 => 1,\n\t\t\t\t\t105 => 1,\n\t\t\t\t];\n\t\t}\n\t\treturn [];\n\t}",
"private function getInFiles(): array\n {\n $htmlFiles = glob(\n $this->inDir . DIRECTORY_SEPARATOR . '*.{html, htm}',\n GLOB_BRACE\n );\n\n $validFiles = array_filter($htmlFiles, 'is_file');\n\n if (!empty($validFiles)) {\n return $validFiles;\n } else {\n throw new \\Exception(\"No valid file in $this->inDir\");\n }\n }",
"protected static function exception()\n {\n foreach (self::fetch('exceptions') as $file) {\n Bus::need($file);\n }\n }",
"public function invalidArrayForStringConfigurationProvider() {}",
"static public function parse_environment_exceptions( $exs ) {\n\t\t$exceptions = $exs->exceptions();\n\n\t\t$commands = '';\n\t\t$required_changes = '';\n\t\t$before_errors = array();\n\t\t$later_errors = array();\n\t\t$operation_error_already_shown = false;\n\n\t\tforeach ( $exceptions as $ex ) {\n\t\t\tif ( $ex instanceof Util_WpFile_FilesystemOperationException ) {\n\t\t\t\tif ( !$operation_error_already_shown ) {\n\t\t\t\t\t$m = $ex->getMessage();\n\t\t\t\t\tif ( strlen( $m ) > 0 ) {\n\t\t\t\t\t\t$before_errors[] = $m;\n\t\t\t\t\t\t// if multiple operations failed when\n\t\t\t\t\t\t// they tried to fix environment - show only first\n\t\t\t\t\t\t// otherwise can duplication information about\n\t\t\t\t\t\t// absense of permissions\n\t\t\t\t\t\t$operation_error_already_shown = true;\n\t\t\t\t\t}\n\t\t\t\t\tif ( $ex instanceof Util_WpFile_FilesystemWriteException ) {\n\t\t\t\t\t\t$required_changes .=\n\t\t\t\t\t\t\tsprintf( __( 'Create the <strong>%s</strong> file and paste the following text into it:\n <textarea>%s</textarea> <br />', 'w3-total-cache' ), $ex->filename(), esc_textarea( $ex->file_contents() ) );\n\t\t\t\t\t} else if ( $ex instanceof Util_WpFile_FilesystemModifyException ) {\n\t\t\t\t\t\t\t$modification_content = $ex->file_contents();\n\t\t\t\t\t\t\tif ( strlen( $modification_content ) > 0 )\n\t\t\t\t\t\t\t\t$modification_content =\n\t\t\t\t\t\t\t\t\t'<textarea style=\"height: 100px; width: 100%;\">' .\n\t\t\t\t\t\t\t\t\tesc_textarea( $modification_content ) . '</textarea>';\n\t\t\t\t\t\t\t$required_changes .=\n\t\t\t\t\t\t\t\t$ex->modification_description() .\n\t\t\t\t\t\t\t\t$modification_content .\n\t\t\t\t\t\t\t\t'<br />';\n\t\t\t\t\t\t} else if ( $ex instanceof Util_WpFile_FilesystemCopyException ) {\n\t\t\t\t\t\t\t$commands .= 'cp ' . $ex->source_filename() . ' ' .\n\t\t\t\t\t\t\t\t$ex->destination_filename() . '<br />';\n\t\t\t\t\t\t} else if ( $ex instanceof Util_WpFile_FilesystemMkdirException ) {\n\t\t\t\t\t\t\t$commands .= 'mkdir ' . $ex->folder() . '<br />';\n\t\t\t\t\t\t\t$commands .= 'chmod 777 ' . $ex->folder() . '<br />';\n\t\t\t\t\t\t} else if ( $ex instanceof Util_WpFile_FilesystemRmException ) {\n\t\t\t\t\t\t\t$commands .= 'rm ' . $ex->filename() . '<br />';\n\t\t\t\t\t\t} else if ( $ex instanceof Util_WpFile_FilesystemRmdirException ) {\n\t\t\t\t\t\t\t$commands .= 'rm -rf ' . $ex->folder() . '<br />';\n\t\t\t\t\t\t} else if ( $ex instanceof Util_WpFile_FilesystemChmodException ) {\n\t\t\t\t\t\t\t$commands .= 'chmod 777 ' . $ex->filename() . '<br />';\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if ( $ex instanceof Util_Environment_Exception ) {\n\t\t\t\t\t$t = $ex->technical_message();\n\t\t\t\t\tif ( strlen( $t ) > 0 ) {\n\t\t\t\t\t\t$t = '<br />' .\n\t\t\t\t\t\t\t'<a class=\"w3tc_read_technical_info\" href=\"#\">' .\n\t\t\t\t\t\t\t__( 'Technical info', 'w3-total-cache' ).'</a>' .\n\t\t\t\t\t\t\t'<div class=\"w3tc_technical_info\" style=\"display: none\">' .\n\t\t\t\t\t\t\t$t . '</div>';\n\t\t\t\t\t}\n\n\t\t\t\t\t$later_errors[] = $ex->getMessage() . $t;\n\t\t\t\t} else {\n\t\t\t\t// unknown command\n\t\t\t\t$later_errors[] = $ex->getMessage();\n\t\t\t}\n\t\t}\n\n\t\tif ( strlen( $commands ) > 0 ) {\n\t\t\t$required_changes .= __( 'Execute next commands in a shell:', 'w3-total-cache' ) .\n\t\t\t\t'<br><strong>' . $commands . '</strong>';\n\t\t}\n\n\t\treturn array(\n\t\t\t'before_errors' => $before_errors,\n\t\t\t'required_changes' => $required_changes,\n\t\t\t'later_errors' => $later_errors\n\t\t);\n\t}",
"public function testLoadReturnsCorrectDataWithExceptionsThrownByDataLoaders(): void\n {\n $this->prepareVFSDirectoryStructure();\n $fullPath = $this->getFullPath('container');\n $expectedFilesMap = ['FileSecond' => 'first/file_second.exe', 'SomeExt' => 'some_ext.exe'];\n $expectedLoadData = ['FileSecond' => ['param1' => 'with_value'], 'SomeExt' => ['param2' => 'without_value']];\n $expectedExceptions =\n array_fill_keys([\"$fullPath/first/file_first.exe\", \"$fullPath/second/file_third.exe\"], new Exception());\n $dataLoaderMockCallbackParams = [$fullPath, $expectedFilesMap, $expectedLoadData, $expectedExceptions];\n $dataLoaderMockCallback = $this->prepareDataLoaderMockCallbackWithExceptions(...$dataLoaderMockCallbackParams);\n $directoryDataLoader = $this->prepareDirectoryDataLoader($dataLoaderMockCallback);\n\n $actualLoadData = $directoryDataLoader->load($fullPath, '/^.*\\.exe$/');\n\n static::assertArraysAreSame($expectedLoadData, $actualLoadData);\n }",
"protected function processFiles(): array\n {\n $allFields = $this->request->getPostData();\n\n $validator = $this->validation();\n\n $files = [];\n foreach ($this->request->getUploadedFiles() as $file) {\n //validate this current file\n $errors = $validator->validate([\n 'file' => [\n 'name' => $file->getName(),\n 'type' => $file->getType(),\n 'tmp_name' => $file->getTempName(),\n 'error' => $file->getError(),\n 'size' => $file->getSize(),\n ]\n ]);\n\n /**\n * @todo figure out why this failes\n */\n if (!defined('API_TESTS')) {\n if (count($errors)) {\n foreach ($errors as $error) {\n throw new UnprocessableEntityException((string) $error);\n }\n }\n }\n\n $fileSystem = Helper::upload($file);\n\n //add settings\n foreach ($allFields as $key => $settings) {\n $fileSystem->set($key, $settings);\n }\n\n $files[] = $fileSystem;\n }\n\n return $files;\n }",
"protected function detectMissingFiles() {}",
"public function createAttachments()\n {\n $_attachment = [];\n $_attachments = [];\n foreach($this->attachments as $attachment) {\n if (!file_exists($attachment)) {\n throw new Exception (\"file is not exist!\");\n }\n\n if (!is_file($attachment)) {\n throw new Exception (\"it is not file!\");\n }\n\n $_attachment['FileName'] = basename($attachment);\n $_attachment['Data'] = file_get_contents($attachment);\n //$_attachment['ContentType'] = mime_content_type($attachment);\n array_push($_attachments, $_attachment);\n }\n\n return $_attachments;\n }",
"public function providerRefreshException(): array\n {\n return static::getKeyedArray([\n [\n '4.root.json',\n ['signed', 'newkey'],\n 'new value',\n new SignatureThresholdExpception('Signature threshold not met on root'),\n [\n 'root' => 3,\n 'timestamp' => 3,\n 'snapshot' => 3,\n 'targets' => 3,\n ],\n ],\n [\n '5.root.json',\n ['signed', 'newkey'],\n 'new value',\n new SignatureThresholdExpception('Signature threshold not met on root'),\n [\n 'root' => 4,\n 'timestamp' => 3,\n 'snapshot' => 3,\n 'targets' => 3,\n ],\n ],\n [\n 'timestamp.json',\n ['signed', 'newkey'],\n 'new value',\n new SignatureThresholdExpception('Signature threshold not met on timestamp'),\n [\n 'root' => 5,\n 'timestamp' => null,\n 'snapshot' => 3,\n 'targets' => 3,\n ],\n ],\n [\n '5.snapshot.json',\n ['signed', 'newkey'],\n 'new value',\n new MetadataException(\"The 'snapshot' contents does not match hash 'sha256' specified in the 'timestamp' metadata.\"),\n [\n 'root' => 5,\n 'timestamp' => 5,\n 'snapshot' => null,\n 'targets' => 3,\n ],\n ],\n [\n '5.snapshot.json',\n ['signed', 'version'],\n 6,\n new MetadataException(\"Expected snapshot version 5 does not match actual version 6.\"),\n [\n 'root' => 5,\n 'timestamp' => 5,\n 'snapshot' => null,\n 'targets' => 3,\n ],\n ],\n [\n '5.targets.json',\n ['signed', 'version'],\n 6,\n new MetadataException(\"Expected targets version 5 does not match actual version 6.\"),\n [\n 'root' => 5,\n 'timestamp' => 5,\n 'snapshot' => 5,\n 'targets' => 3,\n ],\n ],\n ]);\n }",
"private function setExceptionData()\n {\n $data = [\n 'exception' => $this->classShortName,\n 'file' => $this->getFile(),\n 'line' => $this->getLine(),\n ];\n\n if (!App::environment('prod')) {\n $data['trace'] = $this->getTraceAsString();\n }\n\n return $data;\n }",
"protected function getBasicFiles(): array\n {\n $array = [\n $this->folderPaths['logs'] . DIRECTORY_SEPARATOR . '.gitignore' => \"!.gitignore\\n\",\n $this->folderPaths['framework'] . DIRECTORY_SEPARATOR . '.gitignore' => 'down' . \"\\n\",\n $this->folderPaths['tests'] . DIRECTORY_SEPARATOR . 'AbstractTestCase.php' => $this->generateAbstractTestCaseClass(),\n $this->folderPaths['tests'] . DIRECTORY_SEPARATOR . 'bootstrap.php' => $this->generateBootstrapFile(),\n ];\n\n if (! self::$isTest) {\n $array['phpunit.xml'] = $this->getPhpunitXml();\n }\n\n return $array;\n }",
"public function invalidArrayForArrayConfigurationIgnoreCaseProvider() {}",
"private function _getErrorsMessages() : array\n\t{\n\t\t$messages = [\n\t __\\UploadedFilesHandler::ERROR_MOVE_UPLOADED_FILE => 'Przenoszenie pliku z folderu tymczasowego nie powiodło się.',\n\t __\\UploadedFilesHandler::ERROR_FILE_STILL_EXISTS => 'Plik o tej samej nazwie już istnieje pomimo próby zmiany nazwy.',\n\t __\\UploadedFilesHandler::ERROR_FILE_TOO_BIG => 'Przesłany plik jest zbyt duży.',\n\n\t \\UPLOAD_ERR_INI_SIZE => 'Przesłany plik jest zbyt duży (rozmiar określa konfiguracja PHP).',\n\t \\UPLOAD_ERR_FORM_SIZE => 'Przesłany plik jest zbyt duży.',\n\t \\UPLOAD_ERR_PARTIAL => 'Plik został przesłany tylko częściowo.',\n\t \\UPLOAD_ERR_NO_FILE => 'Nie przesłano żadnego pliku.',\n\t \\UPLOAD_ERR_NO_TMP_DIR => 'Nie określono folderu tymczasowego do przesyłania plików.',\n\t \\UPLOAD_ERR_CANT_WRITE => 'Zapis przesyłanego pliku do folderu tymczasowego jest niemożliwy.',\n\t \\UPLOAD_ERR_EXTENSION => 'Przesyłanie pliku nie powiodło się z powodu rozszerzenia PHP.',\n\n\t 'unknown' => 'Wystąpił błąd PHP podczas przesyłania pliku.',\n\t\t];\n\n\t\t$errors = $this->_handler->getErrors();\n\n\t\tforeach ($errors as $fileName => $errorCode) {\n\t\t\t$errors[$fileName] = $messages[$errorCode] ?? $messages['unknown'];\n\t\t}\n\n\t\treturn $errors;\n\t}",
"protected function cleanExecutionArrays() {}",
"function init_errArr ($function_name) {\n\treturn(array(ERR_CODE=>0, ERR_FUNCTION_NAME=>$function_name, ERR_DESCR=>\"\",\n\t\tERR_LONG_DESCR=>\"\", ERR_SQLSTATE=>\"\", ERR_SQLSTATE_MSG=>\"\", ERR_AFFECTED_ROWS=>0, ERR_INSERT_ID=>0));\n}",
"public static function createShipmentsError(): array\n {\n $wsdl = __DIR__ . '/../../_files/bcs-3.3.2/geschaeftskundenversand-api-3.3.2.wsdl';\n $singleResponse = __DIR__ . '/../../_files/createshipment/singleShipmentError.xml';\n $multiResponse = __DIR__ . '/../../_files/createshipment/multiShipmentError.xml';\n\n $authStorage = AuthenticationStorageProvider::authSuccess();\n\n $singleLabelRequest = ShipmentRequestProvider::createSingleShipmentError();\n $singleLabelResponse = \\file_get_contents($singleResponse);\n\n $multiLabelRequest = ShipmentRequestProvider::createMultiShipmentError();\n $multiLabelResponse = \\file_get_contents($multiResponse);\n\n return [\n 'single label validation error' => [$wsdl, $authStorage, $singleLabelRequest, $singleLabelResponse],\n 'multi label validation error' => [$wsdl, $authStorage, $multiLabelRequest, $multiLabelResponse],\n ];\n }",
"private static function fixFileArray(array &$arr){\n $fileKeys = array('name', 'type', 'tmp_name', 'error', 'size');\n foreach($_FILES as $basename => $fileArr){\n $res = array();\n foreach($fileKeys as $key){\n if( array_key_exists($key, $fileArr) ){\n if( is_array($fileArr[$key]) ){\n $subkey = self::flatten_file($fileArr[$key]);\n foreach($subkey as $k => $v){\n $res[$basename.$k.'['.$key.']'] = ($key == 'type' ? strtolower($v) : $v);\n if( $key == 'name' && !array_key_exists($basename.$k.'[ext]', $res) )\n $res[$basename.$k.'[ext]'] = get::fullext($v);\n }\n }else{\n $res[$basename.'['.$key.']'] = ($key == 'type' ? strtolower($fileArr[$key]) : $fileArr[$key]);\n if( $key == 'name' && !array_key_exists($basename.'[ext]', $res) )\n $res[$basename.'[ext]'] = get::fullext($fileArr[$key]);\n }\n }\n }\n foreach($res as $path => $v){\n $pa = formElement::getFieldPath($path, false, false);\n $ref = &$arr;\n while( count($pa) > 0 ){\n $idx = array_shift($pa);\n if( !array_key_exists($idx, $ref) )\n $ref[$idx] = array();\n $ref = &$ref[$idx];\n }\n $ref = $v;\n unset($ref);\n }\n }\n }",
"public function clearExceptions()\r\r\n {\r\r\n $this->exceptions = array();\r\r\n }",
"protected function clean(): array\n {\n $array = [];\n\n if (! self::$isTest) {\n $array[] = 'README.md';\n }\n\n return $array;\n }",
"public function getExceptions();",
"public function testRefusesToProvideQuotationIfFileSpecifiedInFileArrayDoesNotExist()\n {\n $jobs = array(\n 'job_01' => array(\n 'type' => 'file',\n 'file_key' => 'file_01',\n 'lc_src' => 'en',\n 'lc_tgt' => 'ja',\n 'tier' => 'standard',\n ),\n );\n\n $files = array('file_01' => __DIR__.'/testfiles/non_existent_file');\n\n $serviceAPI = new Service();\n\n $this->expectException(Exception::class);\n $this->expectExceptionMessage('Could not find file');\n $serviceAPI->quote($jobs, $files);\n }",
"public function generateZipArchiveDataProviderException() {\n return [\n ['command_which_doesnt_exist'],\n ['zip -j /tmp/pii_data/filename.zip /tmp/pii_data/filename.csv'],\n ['zip -j /usr/filename.zip /dev/null'],\n ['zip -j /usr/filename.zip /etc/hosts'],\n ];\n }",
"public function testException() {\n\t\ttry {\n\t\t\t$array = array( 'ABC' );\n\t\t\t$percentages = new Percentages( $array );\n\t\t} catch ( \\RuntimeException $expected ) {\n\t\t\treturn;\n\t\t}\n\t\t$this->fail( 'An expected exception has not been raised.' );\n\t}",
"public function testMakePostFault(array $fileUpInfoArr, array $exPropertyValuesArr)\n {\n $fileName = $fileUpInfoArr['name'];\n $srcPath = __DIR__ . '/../localdir/' . $fileName;\n $tmpPath = $fileUpInfoArr['tmp_name'];\n if ($tmpPathAvailable = copy($srcPath, $tmpPath)) {\n $imgUpService = new ImageUploadTestService();\n $imgUpValidator = new ImageUploadValidator($fileUpInfoArr);\n $oldNumberOfViews = ImageUploadTestService::getAndSetTotalNumberOfViews(TRUE);\n $postMgr = EntityManagerFactory::getPostManager();\n $oldNumberOfPosts = $postMgr->getNumberOfPosts();\n try {\n $imgUpValidator->checkIfFileIsCorrupted();\n $imgUpValidator->checkFileErrorValue();\n $imgUpValidator->checkFileMimeType();\n $imgUpValidator->checkFileSize();\n $imgUpValidator->checkFileWeight();\n $imgUpService->moveFile($tmpPath, $imgUpValidator->getMimeType());\n } catch (RuntimeException $ex) {\n $this->assertEquals($exPropertyValuesArr['code'], $ex->getCode());\n $this->assertEquals($exPropertyValuesArr['message'], $ex->getMessage());\n unlink($tmpPath);\n }\n $updatedNumberOfViews = ImageUploadTestService::getAndSetTotalNumberOfViews(TRUE);\n $updatedNumberOfPosts = $postMgr->getNumberOfPosts();\n $this->assertEquals($oldNumberOfViews, $updatedNumberOfViews);\n $this->assertEquals($oldNumberOfPosts, $updatedNumberOfPosts);\n } else {\n $this->assertTrue($tmpPathAvailable, $srcPath . ' could not be copied to ' . $tmpPath);\n }\n }",
"protected function assertErrorLogEntries() {}",
"public function set_group_exceptions($cmarray) {\n $this->groupexceptions = $cmarray;\n }",
"public function testIncompatibleArrays(): void\n {\n $this->expectException(IncompatibleVariableTypesException::class);\n $this->expectErrorMessage(\"Array must have same key type\");\n $this->unify(\n $this->createHashmap($this->createString(), $this->createString()),\n $this->createSequenceArray($this->createString())\n );\n }",
"public function test_OffsetSetException_NoExt()\n {\n $this->setExpectedException('Q\\Exception', \"Unable to create section 'test': No extension specified for Config_Dir '{$this->dir}' or for the Config_File object setting.\");\n $config = new Config_Dir($this->dir); \n $config['test'] = new Config_File();\n }",
"public function testRefusesToProvideQuotationIfFileKeyParameterDoesNotHaveCorrespondingRecordInFilesArray()\n {\n $jobs = array(\n 'job_01' => array(\n 'type' => 'file',\n 'file_key' => 'no_such_file',\n 'lc_src' => 'en',\n 'lc_tgt' => 'ja',\n 'tier' => 'standard',\n ),\n );\n\n $files = array('file_01' => __DIR__.'/testfiles/test_file1.txt');\n\n $serviceAPI = new Service();\n\n $this->expectException(Exception::class);\n $this->expectExceptionMessage('is missing in filepath array');\n $serviceAPI->quote($jobs, $files);\n }",
"public function validarArquivo(){\n\n if (empty($this->aRegistrosRetencao)) {\n throw new Exception( _M( self::MENSAGENS . 'erro_validar_arquivo') );\n }\n\n /**\n * Verificamos os registros e caso ocorra inconsistencia populamos o array de Registros inconsistentes\n */\n foreach ($this->aRegistrosRetencao as $oRegistroRetencao) {\n\n /**\n * Validamos se existe CGM cadastrado para o cnpj TOMADOR\n */\n if (CgmFactory::getInstanceByCnpjCpf($oRegistroRetencao->q91_cnpjtomador) == false) {\n\n $this->aRegistrosInconsistentes[] = array( \"sequencial_registro\" => $oRegistroRetencao->q91_sequencialregistro,\n \"registro\" => $oRegistroRetencao->q91_cnpjtomador,\n \"erro\" => self::TOMADOR_SEM_CGM );\n }\n }\n }",
"public function setUp()\n\t {\n\t\tdefine(\"EXCEPTION_UNABLE_TO_EXPAND\", 1);\n\t\tdefine(\"EXCEPTION_UNUSED_ITEMS\", 2);\n\t\tdefine(\"EXCEPTION_INVALID_DOCUMENT\", 3);\n\t\tdefine(\"EXCEPTION_ROOT_INDEX_NOT_VALID\", 4);\n\t }",
"public function testProcessorInvalidFile()\n {\n $xml = '\n Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc\n accumsan leo quis arcu convallis faucibus. Mauris pharetra dolor\n faucibus, ultrices ex in, porttitor urna. Aliquam erat volutpat.\n Curabitur consectetur purus ex, at porta ex viverra in. Nullam\n rutrum sem quis lacus pellentesque rutrum. Quisque vitae arcu eros.\n Maecenas luctus enim at vehicula varius. In lacinia lorem vehicula\n elementum fermentum. Aenean venenatis ac massa eu maximus. Lorem\n ipsum dolor sit amet, consectetur adipiscing elit. Quisque et\n varius eros.\n ';\n\n $processor = new Processor();\n $user = new User();\n $version = new Version($user);\n\n $this->expectException(\\Exception::class);\n $processor->process($xml, $version);\n }",
"public function provideFileAnExpectedNames()\n {\n return [\n [__FILE__, pathinfo(__FILE__, PATHINFO_FILENAME)],\n ['.htaccess', ''],\n ['name', 'name'],\n ['a.combined.filename.with.multiple.ext.separator', 'a.combined.filename.with.multiple.ext']\n ];\n }",
"public function testConstructDoubleArray()\n {\n $filter = new FileRename([\n 0 => [\n 'source' => $this->oldFile,\n 'target' => $this->newFile]]);\n\n $this->assertEquals(\n [0 => [\n 'source' => $this->oldFile,\n 'target' => $this->newFile,\n 'overwrite' => false,\n 'randomize' => false,\n ]],\n $filter->getFile()\n );\n $this->assertEquals($this->newFile, $filter($this->oldFile));\n $this->assertEquals('falsefile', $filter('falsefile'));\n }",
"public function _getValidationErrors(): array\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if (null !== ($v = $this->getDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getYear())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_YEAR] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getMonth())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MONTH] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getDay())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DAY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSeason())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SEASON] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getText())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TEXT] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_DATE])) {\n $v = $this->getDate();\n foreach($validationRules[self::FIELD_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CITATION_DOT_DATE_OF_PUBLICATION, self::FIELD_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATE])) {\n $errs[self::FIELD_DATE] = [];\n }\n $errs[self::FIELD_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_YEAR])) {\n $v = $this->getYear();\n foreach($validationRules[self::FIELD_YEAR] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CITATION_DOT_DATE_OF_PUBLICATION, self::FIELD_YEAR, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_YEAR])) {\n $errs[self::FIELD_YEAR] = [];\n }\n $errs[self::FIELD_YEAR][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MONTH])) {\n $v = $this->getMonth();\n foreach($validationRules[self::FIELD_MONTH] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CITATION_DOT_DATE_OF_PUBLICATION, self::FIELD_MONTH, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MONTH])) {\n $errs[self::FIELD_MONTH] = [];\n }\n $errs[self::FIELD_MONTH][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DAY])) {\n $v = $this->getDay();\n foreach($validationRules[self::FIELD_DAY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CITATION_DOT_DATE_OF_PUBLICATION, self::FIELD_DAY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DAY])) {\n $errs[self::FIELD_DAY] = [];\n }\n $errs[self::FIELD_DAY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SEASON])) {\n $v = $this->getSeason();\n foreach($validationRules[self::FIELD_SEASON] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CITATION_DOT_DATE_OF_PUBLICATION, self::FIELD_SEASON, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SEASON])) {\n $errs[self::FIELD_SEASON] = [];\n }\n $errs[self::FIELD_SEASON][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CITATION_DOT_DATE_OF_PUBLICATION, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_BACKBONE_ELEMENT, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n return $errs;\n }",
"private function getDefaultExceptions($controller) {\n return array(\n array(\"OperationConflictException\", $controller->responser->Conflict()),\n array(\"DataAccessResultException\", $controller->responser->InternalServerError()),\n array(\"DbOperationException\", $controller->responser->InternalServerError()),\n array(\"InvalidAccessParamsException\", $controller->responser->BadRequest()),\n array(\"AuthorizationException\", $controller->responser->Forbidden()),\n array(\"Exception\", $controller->responser->InternalServerError()),\n );\n }",
"public function getErrosArray(){\n\t\treturn $this->erros;\n\t}",
"public function testProcessException1()\n {\n $unit1 = $this->getUnit('test');\n $unit1->setReversedMapping([\n 'name' => 'field3',\n ]);\n $unit1->setReversedConnection([\n 'id' => 'field4',\n ]);\n $unit1->setMapping([\n 'field1' => 'name',\n 'field2' => 'code',\n ]);\n $unit1->setFilesystem($this->getFS(\n [\n ['Pete', 'tst1']\n ]\n ));\n $unit1->setTmpFileName('customer_tmp.csv');\n\n $action = $this->getAction([$unit1]);\n $action->process($this->getResultMock());\n }",
"function testErrorWhenSavingAMixedArrayOfConfig(){\n\t\tTestsHelper::Print(\"testing magratheaConfig confirming an error when config file is invalid...\");\n\t\t$confs = array(\n\t\t\t'this_section' => array(\n\t\t\t\t'this_var' => 'ok', \n\t\t\t\t'this_other_var' => 'ok' ), \n\t\t\t'simple_item' => 'ok'\n\t\t );\n\t\t$this->magConfig->setConfig($confs);\n//\t\t\t$this->expectException(new PatternExpectation(\"/section/i\"));\n\t\t$this->expectException(\\Magrathea2\\Exceptions\\MagratheaConfigException::class);\n\t\t$this->magConfig->Save(true);\n\t}",
"public function seedMap()\n\t{\n\t\t// Tag, C1, C2, $Expected, Exception\n\t\treturn array(\n\t\t\t\t// Exception\n\t\t\t\tarray(null, null, null, null, true),\n\t\t\t\tarray('tag', 2, array(4), true),\n\t\t\t\tarray('tag', 2, array('foo'), false),\n\t\t\t\t);\n\t}",
"protected function prepareForValidation() {\n\t\t$this->importStatus = [\n\t\t\tContentUserReportViewHelper::COPY_CONTENT_JOB_NOT_STARTED,\n\t\t\tContentUserReportViewHelper::COPY_CONTENT_JOB_RUNNING,\n\t\t\tContentUserReportViewHelper::COPY_CONTENT_JOB_COMPLETED,\n\t\t\tContentUserReportViewHelper::COPY_CONTENT_JOB_FAILED,\n\t\t];\n\t}",
"protected function postProcessArray() {\n foreach (self::$files as $key => $item) {\n // remove link from tree nodes\n if (in_array($item['id'], self::$_treenodes)) {\n self::$files[$key]['href'] = ModUtil::url('DocTastic', $this->userType, 'view');\n }\n if ($item['parent_id'] == 0) continue;\n // remove entries with disallowed extensions\n if (in_array(FileUtil::getExtension($item['name']), $this->_disallowedExtensions)) {\n unset(self::$files[$key]);\n }\n }\n }",
"protected function prepareForValidation()\n {\n $this->merge([\n self::ATTRIBUTE_REFERER => $this->prepareArray($this->input(self::ATTRIBUTE_REFERER)),\n self::ATTRIBUTE_IP => $this->prepareArray($this->input(self::ATTRIBUTE_IP)),\n ]);\n }",
"public function providerAttackRepoException(): array\n {\n return [\n [\n 'TUFTestFixtureAttackRollback',\n new RollbackAttackException('Remote timestamp metadata version \"$2\" is less than previously seen timestamp version \"$3\"'),\n [\n 'root' => 3,\n 'timestamp' => 3,\n 'snapshot' => 3,\n 'targets' => 3,\n ],\n ],\n ];\n }",
"public function getPreparationSteps(): array\n {\n // Most formats do not have extra preparation steps.\n return [];\n }",
"public function testFileExceptions() {\n $xsl_service = new ExcelFileProcessorService();\n\n try {\n $xsl_service->processFile('foo');\n $this->fail();\n } catch (\\Exception $e) {\n $this->assertEquals($e->getMessage(), 'The file does not exists');\n }\n }",
"public function provideSdkExceptions()\n {\n $invalidPayload = '\\eBayEnterprise\\RetailOrderManagement\\Payload\\Exception\\InvalidPayload';\n $networkError = '\\eBayEnterprise\\RetailOrderManagement\\Api\\Exception\\NetworkError';\n $unsupportedOperation = '\\eBayEnterprise\\RetailOrderManagement\\Api\\Exception\\UnsupportedOperation';\n $unsupportedHttpAction = '\\eBayEnterprise\\RetailOrderManagement\\Api\\Exception\\UnsupportedHttpAction';\n $baseException = 'Exception';\n $creditCardException = 'Radial_CreditCard_Exception';\n return [\n [$invalidPayload, $creditCardException],\n [$networkError, $creditCardException],\n [$unsupportedOperation, $unsupportedOperation],\n [$unsupportedHttpAction, $unsupportedHttpAction],\n [$baseException, $baseException],\n ];\n }",
"protected function prepareForValidation()\n {\n $this->merge([\n 'emails' => $this->extractEmailAddresses($this->emails),\n ]);\n }",
"public function test_OffsetSetException_DifferentTransformers()\n {\n $this->setExpectedException('Q\\Exception', \"Unable to create section 'abc': Extension specified for Config_Dir '{$this->dir}' and extension specified for Config_File object setting are different.\");\n $config = new Config_Dir($this->dir, array('ext'=>'mock')); \n $config['abc'] = new Config_File('yaml:path.yaml');\n }",
"function prepareFiles($filterIdFiles = null)\r{\r global $files, $preparedFiles, $preparedFilesIndirect;\r $preparedFiles = [];\r $preparedFilesIndirect = [];\r\r foreach ($files as $file) {\r if ($filterIdFiles === null || in_array($file->id, $filterIdFiles))\r prepareFile($file);\r }\r\r foreach ($files as $file) {\r if ($filterIdFiles === null || in_array($file->id, $filterIdFiles))\r prepareFileIndirect($file);\r }\r}",
"public function testAllWithBadStorage()\n {\n $storage = new ChainStorage(array(\n $this->getBadStorageStub(),\n ));\n\n $this->setExpectedException('Transfer\\Storage\\Exception\\BadStorageIterableException');\n $this->assertEquals(null, $storage->all());\n }",
"private function ensureUploadedFileIsValid(): void\n {\n if ($this->hasMoveTo === true) {\n throw new RuntimeException(\"Uploaded file has already been moved.\");\n }\n\n if ($this->error !== UPLOAD_ERR_OK) {\n throw new RuntimeException(\"Uploaded file error: \" . self::UPLOAD_ERRORS[$this->error]);\n }\n }",
"public function prepareForValidation()\n {\n if (is_string($this->images)) {\n $this->merge([\n 'images' => json_decode($this->images, true),\n ]);\n }\n }",
"public function testConstructSingleArray()\n {\n $filter = new FileRename([\n 'source' => $this->oldFile,\n 'target' => $this->newFile]);\n\n $this->assertEquals(\n [0 => [\n 'source' => $this->oldFile,\n 'target' => $this->newFile,\n 'overwrite' => false,\n 'randomize' => false,\n ]],\n $filter->getFile()\n );\n $this->assertEquals($this->newFile, $filter($this->oldFile));\n $this->assertEquals('falsefile', $filter('falsefile'));\n }",
"public function testErrorMessageArray()\n {\n $errorResponse = json_decode('{\n \"error\": {\n \"code\": \"UNPROCESSABLE_ENTITY\",\n \"message\": [\"Bad format\", \"Bad format 2\"],\n \"errors\": []\n }\n }', true);\n\n try {\n Requestor::handleApiError(null, 404, $errorResponse);\n } catch (EasyPostException $error) {\n $this->assertEquals('Bad format, Bad format 2', $error->getMessage());\n }\n }",
"protected function initializeCompatibilityLoadedExtArray() {}",
"public static function invalidToArrayDataProvider() {\n\t\treturn array(\n\t\t\tarray(new DateTime()),\n\t\t\tarray(array())\n\t\t);\n\t}",
"public function validateMultiple()\n {\n if (is_array($this->name)) {\n for ($i = 0; $i < count($this->name); $i++) {\n $this->name[$i] = strtolower($this->name[$i]);\n $name = explode(\".\", $this->name[$i]);\n // image name\n $this->name[$i] = sha1($name[0] . time() . rand());\n // image extension\n $this->ext[$i] = array_values(array_slice($name, -1))[0];\n\n if (!in_array($this->ext[$i], $this->extensions)) {\n $this->uploadErrors[] = \"error File type not allowed\";\n }\n if ($this->size[$i] > 50000000) {\n $this->uploadErrors[] = \"Image File is too large\";\n }\n if ($this->errors[$i] > 0) {\n $this->uploadErrors[] = \"error uploading File\";\n }\n $this->image[$i] = $this->name[$i] . \".\" . $this->ext[$i];\n\n }\n }\n }",
"public static function provideInvalidConfigurationForConstructor()\n {\n return [\n [5126],\n [97.65],\n [true],\n [false]\n ];\n }",
"protected static function initializeBasicErrorReporting() {}",
"public function testMigrateExceptionKeysMissing() {\n $configuration = [\n 'path' => $this->standardCharsPath,\n ];\n $this->expectException(\\InvalidArgumentException::class);\n $this->expectExceptionMessage('You must declare \"ids\" as a unique array of fields in your source settings.');\n new CSV($configuration, $this->pluginId, $this->pluginDefinition, $this->migration);\n }",
"public function prepareFile()\n {\n // TODO: Implement prepareFile() method.\n }",
"public function test_OffsetSetException_NoExtForDir()\n {\n $this->setExpectedException('Q\\Exception', \"Unable to create section 'test': No extension specified for Config_Dir '{$this->dir}', creating a section requires setting a Config_File object.\");\n $config = new Config_Dir($this->dir); \n $config['test'] = array();\n }",
"protected function initializeErrorHandling() {}",
"public function invalidArrayForStringConfigurationIgnoreCaseProvider() {}",
"function __construct() {\n\t\t$this->exception_method = [];\n\t\tparent::__construct();\n\t\t\n\t}",
"public function testConstructSingleValueWithFilesArray()\n {\n $filter = new FileRename($this->newFile);\n\n $this->assertEquals(\n [0 => [\n 'source' => '*',\n 'target' => $this->newFile,\n 'overwrite' => false,\n 'randomize' => false,\n ]],\n $filter->getFile()\n );\n $this->assertEquals(\n ['tmp_name' => $this->newFile],\n $filter(['tmp_name' => $this->oldFile])\n );\n $this->assertEquals('falsefile', $filter('falsefile'));\n }",
"protected static function _validate()\n\t{\n\t\tif (!file_exists(self::$jar)) {\n\t\t\tthrow new Exception('MergeMinify_Minification:$jar(' . self::$jar . ') is not a valid file.');\n\t\t}\n\t\tif (!is_dir(self::$tmpDir) || !is_writable(self::$tmpDir)) {\n\t\t\tthrow new Exception('MergeMinify_Minification:$temp(' . self::$temp . ') is not a valid directory.');\n\t\t}\n\t}",
"public function provideUnwritableFiles()\n {\n return [\n [static::$FIXTURE_PATH . 'unwritable.file']\n ];\n }",
"public function provideInvalidConfiguration(): array\n {\n return [\n [\n \"Cryptor names should be unique. 'foo' name is duplicated\",\n [\n 'cryptors' => [\n 'rsa' => ['foo' => []],\n 'aes' => [\n 'foo' => [\n 'key_size' => Fixtures::bits(),\n 'key_path' => $this->existentKeyFile,\n 'binary_output' => true\n ]\n ],\n ],\n ],\n ],\n [\n 'The child node \"key_size\" at path \"gtt_crypt.cryptors.aes.foo\" must be configured',\n [\n 'cryptors' => [\n 'rsa' => ['foo' => []],\n 'aes' => [\n 'foo' => []\n ],\n ],\n ],\n ],\n [\n sprintf('Installed version of defuse/php-encryption package provide only %d bits key size', Fixtures::bits()),\n [\n 'cryptors' => [\n 'rsa' => ['foo' => []],\n 'aes' => [\n 'foo' => [\n 'key_size' => 999,\n ]\n ],\n ],\n ],\n ],\n [\n 'The child node \"key_path\" at path \"gtt_crypt.cryptors.aes.foo\" must be configured',\n [\n 'cryptors' => [\n 'rsa' => ['foo' => []],\n 'aes' => [\n 'foo' => [\n 'key_size' => Fixtures::bits(),\n ]\n ],\n ],\n ],\n ],\n [\n 'The child node \"binary_output\" at path \"gtt_crypt.cryptors.aes.foo\" must be configured',\n [\n 'cryptors' => [\n 'rsa' => ['foo' => []],\n 'aes' => [\n 'foo' => [\n 'key_size' => Fixtures::bits(),\n 'key_path' => $this->existentKeyFile,\n ]\n ],\n ],\n ],\n ],\n ];\n }",
"protected function init()\n {\n if ($this->file->hasError) {\n throw new CException(sprintf(\n 'File could not be uploaded: %s',\n $this->getUploadError($this->file->getError())\n ));\n }\n }",
"public function buildFilesForFilterTest()\n {\n // are used as the test method arguments. If we want to use an array\n // as a test data set, we need to return a nested array\n return array(\n array(\n $this->buildFilesSet1()[0],\n array(\n 'internal' => array(\n 'example/image2',\n ),\n 'external' => array(\n 'example/image1',\n ),\n ),\n ),\n array(\n $this->buildFilesSet2()[0],\n array(\n 'internal' => array(\n 'example/image2',\n 'example/image3',\n 'example/image4',\n ),\n 'external' => array(\n 'example/image1',\n 'example/image5',\n ),\n ),\n ),\n );\n }",
"protected function fixFilesArray($files)\n {\n $finals = array();\n $pathes = self::findPathes($files['name']);\n $keys = array_keys($files);\n\n $data = array();\n foreach($pathes as $path) {\n foreach($keys as $key) {\n\t$data[$key] = self::findData($path, $files[$key]);\n }\n self::setData($finals, $path, $data);\n }\n return $finals;\n }",
"public function testSetMultipleInvalidArgumentKeyInIterableHasReservedCharacter(): void\n {\n $arr = array(\n 'key1' => 'value1',\n 'key2' => 'value2',\n 'ke}y3' => 'value3',\n 'key4' => 'value4',\n 'key5' => 'value5'\n );\n $this->expectException(\\InvalidArgumentException::class);\n $this->testNotStrict->setMultiple($arr);\n }",
"public function translateFactoryLoadExceptions(UnitTester $I)\n {\n $I->wantToTest('Translate\\Factory - load() - exceptions');\n\n $options = $this->arrayConfig['logger'];\n $factory = new LoggerFactory(new AdapterFactory());\n\n $I->expectThrowable(\n new LoggerException(\n 'Config must be array or Phalcon\\Config\\Config object'\n ),\n function () use ($factory) {\n $factory->load(1234);\n }\n );\n\n $I->expectThrowable(\n new LoggerException(\n 'You must provide \"name\" option in factory config parameter.'\n ),\n function () use ($factory, $options) {\n $newOptions = $options;\n unset($newOptions['name']);\n\n $factory->load($newOptions);\n }\n );\n }",
"public function getExceptionDataProvider()\n {\n $data = [];\n\n for ($i = 0; $i < 1000; $i += 100) {\n $data[] = [\n 'message-' . $i,\n $i,\n ];\n }\n\n return $data;\n }"
] | [
"0.6146828",
"0.57658017",
"0.5709773",
"0.55879205",
"0.55602115",
"0.5477499",
"0.5459971",
"0.54564464",
"0.5432163",
"0.53801334",
"0.5376249",
"0.5364127",
"0.5356354",
"0.53372884",
"0.53310853",
"0.5229744",
"0.5216477",
"0.51984054",
"0.5193085",
"0.51860154",
"0.51847655",
"0.5173005",
"0.5171061",
"0.5167672",
"0.5155329",
"0.51423",
"0.5139742",
"0.5131191",
"0.5129",
"0.5118363",
"0.5098552",
"0.5091731",
"0.5085441",
"0.50780666",
"0.50648785",
"0.50641316",
"0.5061013",
"0.50379443",
"0.50089526",
"0.50052404",
"0.50017923",
"0.4999962",
"0.49967965",
"0.49955744",
"0.49857903",
"0.49807802",
"0.49650958",
"0.49591053",
"0.49583828",
"0.49566782",
"0.4952554",
"0.49418128",
"0.49306017",
"0.49280903",
"0.4917954",
"0.4912702",
"0.49095508",
"0.48837414",
"0.48800623",
"0.48604786",
"0.4859343",
"0.48587292",
"0.4855482",
"0.48552206",
"0.4852816",
"0.4839598",
"0.48246735",
"0.48213074",
"0.48141894",
"0.4810665",
"0.48068222",
"0.48042855",
"0.47992602",
"0.47986817",
"0.47948727",
"0.47865272",
"0.47840962",
"0.47830677",
"0.47810522",
"0.4780993",
"0.4779713",
"0.47763285",
"0.47756946",
"0.4774301",
"0.47675416",
"0.47656703",
"0.47639543",
"0.47628906",
"0.4760865",
"0.4742692",
"0.4738851",
"0.47354567",
"0.4724783",
"0.4723144",
"0.47168517",
"0.47017795",
"0.46926275",
"0.46918887",
"0.46830893",
"0.4676884"
] | 0.69515383 | 0 |
Prepares function that takes mock object for data loader and performs its additional preparation considering thrown exceptions. | private function prepareDataLoaderMockCallbackWithExceptions(string $path, array $expectedFilesMap, ?array $expectedLoadData, array $expectedFilesExceptions): callable
{
$callback = $this->prepareDataLoaderMockCallback($path, $expectedFilesMap, $expectedLoadData);
return static function (MockInterface $dataLoaderMock) use ($callback, $expectedFilesExceptions) {
$callback($dataLoaderMock);
foreach ($expectedFilesExceptions as $expectedFile => $exception) {
$dataLoaderMock->shouldReceive('load')->withArgs([$expectedFile])->andThrow($exception);
}
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _prepare() {}",
"public function testLoadReturnsCorrectDataWithExceptionsThrownByDataLoaders(): void\n {\n $this->prepareVFSDirectoryStructure();\n $fullPath = $this->getFullPath('container');\n $expectedFilesMap = ['FileSecond' => 'first/file_second.exe', 'SomeExt' => 'some_ext.exe'];\n $expectedLoadData = ['FileSecond' => ['param1' => 'with_value'], 'SomeExt' => ['param2' => 'without_value']];\n $expectedExceptions =\n array_fill_keys([\"$fullPath/first/file_first.exe\", \"$fullPath/second/file_third.exe\"], new Exception());\n $dataLoaderMockCallbackParams = [$fullPath, $expectedFilesMap, $expectedLoadData, $expectedExceptions];\n $dataLoaderMockCallback = $this->prepareDataLoaderMockCallbackWithExceptions(...$dataLoaderMockCallbackParams);\n $directoryDataLoader = $this->prepareDirectoryDataLoader($dataLoaderMockCallback);\n\n $actualLoadData = $directoryDataLoader->load($fullPath, '/^.*\\.exe$/');\n\n static::assertArraysAreSame($expectedLoadData, $actualLoadData);\n }",
"abstract public function prepareData();",
"abstract protected function _prepare();",
"public function prepare()\n {\n $this->status = $this->response->getStatusCode();\n\n $rawResponseData = $this->response->getBody()->getContents();\n\n $this->body = $rawResponseData ? \\GuzzleHttp\\json_decode($rawResponseData, true) : '';\n\n $this->errors = isset($this->body['errors']) ? $this->body['errors'] : [];\n\n if ($this->throwException && (substr($this->status, 0, 1) != 2)) {\n $this->throwException($this->status, $this->errors);\n }\n\n //Set data\n if ($this->body) {\n //This happens when array was expected but it is empty\n if (empty($this->body['data'])) {\n $this->data = collect([]);\n } else {\n $document = Document::createFromArray($this->body);\n $hydrator = new ClassHydrator();\n $hydrated = $hydrator->hydrate($document);\n $this->data = is_array($hydrated) ? collect($hydrated) : $hydrated;\n }\n }\n\n //Set meta\n if (isset($this->body['meta'])) {\n $this->meta = $this->body['meta'];\n }\n }",
"protected function _prepareMockObjects()\n {\n $this->requestMock = $this->getMockBuilder(\\Magento\\Framework\\App\\Request\\Http::class)\n ->disableOriginalConstructor()\n ->getMock();\n $this->objectManagerMock = $this->createMock(\\Magento\\Framework\\ObjectManagerInterface::class);\n $this->storeManagerMock = $this->getMockForAbstractClass(\\Magento\\Store\\Model\\StoreManagerInterface::class);\n $this->storeModelMock = $this->createPartialMock(\\Magento\\Store\\Model\\Store::class, ['__wakeup', 'getId']);\n $this->reviewMock = $this->createPartialMock(\n \\Magento\\Review\\Model\\Review::class,\n ['__wakeup', 'create', 'save', 'getId', 'getResource', 'aggregate', 'getEntityIdByCode']\n );\n $this->reviewFactoryMock = $this->createPartialMock(\\Magento\\Review\\Model\\ReviewFactory::class, ['create']);\n $this->ratingMock = $this->createPartialMock(\n \\Magento\\Review\\Model\\Rating::class,\n ['__wakeup', 'setRatingId', 'setReviewId', 'addOptionVote']\n );\n $this->ratingFactoryMock = $this->createPartialMock(\\Magento\\Review\\Model\\RatingFactory::class, ['create']);\n $this->resultFactoryMock = $this->getMockBuilder(\\Magento\\Framework\\Controller\\ResultFactory::class)\n ->disableOriginalConstructor()\n ->getMock();\n $this->resultRedirectMock = $this->getMockBuilder(\\Magento\\Backend\\Model\\View\\Result\\Redirect::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n $this->resultFactoryMock->expects($this->any())\n ->method('create')\n ->with(ResultFactory::TYPE_REDIRECT, [])\n ->willReturn($this->resultRedirectMock);\n }",
"protected function setUp()\n {\n $this->object = new ResolverException;\n }",
"protected function setUp() {\n $this->object = new BadFunctionCallException;\n $this->setCommonInterface(ExceptionInterface::class)->setParentClass(PlatformBadFunctionCallException::class);\n }",
"public function prepare() {}",
"public function prepare() {}",
"protected function prepare()\n\t{\n\t}",
"public function test_prepare_item() {}",
"protected function setUp()\n {\n $this->object = new Loader;\n }",
"protected function _preload() {\n }",
"protected function prepare()\n {\n $this->register('require', function($context, $path) {\n $context->requireAsset($path);\n });\n\n $this->register('depend_on', function($context, $path) {\n $context->dependOn($path);\n });\n\n $this->register('require_tree', function($context, $path) {\n $context->requireTree($path);\n });\n\n $this->body = $this->getData();\n\n if (preg_match(static::HEADER_PATTERN, $this->getData(), $matches)) {\n $this->header = $matches[0];\n $this->body = substr($this->getData(), strlen($matches[0])) ?: '';\n }\n\n $this->processed = array();\n }",
"abstract public function prepareToStore();",
"abstract protected function prepareData( $data );",
"protected function setUp()\n {\n include_once __DIR__ . '/ErrorAware.php';\n $this->object = new ErrorAware();\n }",
"protected function prepareData()\n {\n parent::prepareData();\n $this->prepareConfigurableProductOptions();\n $this->prepareAttributeSet();\n }",
"protected function preprocessData() {}",
"public function prepareImport();",
"public function setUp()\n {\n foreach (glob(__DIR__.'/../data/*.json') as $jsonFile) {\n if (basename($jsonFile) != 'json_output_test_json_fixed.json') {\n unlink($jsonFile);\n }\n }\n\n $this->data = [\n [1, 'PHP Developer', 'Mazen Kenjrawi'],\n [4, 'Dummy Classes', 'Foo Bar'],\n ];\n\n $this->headingFields = ['id', 'Title', 'Name'];\n\n $this->Loader = new Loader();\n }",
"protected function setUp()\n {\n $this->factory = new CallableReaderFactory();\n }",
"public function prepare()\n {\n }",
"protected function setUp() {\n\t\t$this->object = new Filter_Fail;\n\t}",
"public function setup():void{\n parent::setUp();\n $this->withExceptionHandling();\n }",
"protected function setUp() {\n parent::setUp();\n $this->tempJson = $this->json;\n }",
"public function setUp()\n {\n $decereal = new ModelDeserialiser();\n $decereal->reset();\n $bar = new SimpleMetadataProvider('Data', 'Data');\n unset($bar);\n DateTime::setTimeProvider([new Carbon(), 'now']);\n }",
"public function setUp()\n {\n $folder = dirname(__DIR__) . '/fixtures';\n\n $this->keyVal(true);\n $this->_mutableLoader = new Loader($folder);\n $this->_immutableLoader = new Loader($folder, true);\n }",
"protected function prepareEntityManager(): void\n\t{\n\t\ttry {\n\t\t\t$this->assertEntityManagerOpen();\n\t\t\t$this->assertEntityManagerClear();\n\t\t\t$this->assertGoodDatabaseConnection();\n\t\t} catch (EntityManagerClosedException $e) {\n\t\t\tthrow $e;\n\t\t} catch (Throwable $e) {\n\t\t\tthrow new QueueSetupException('Error in queue setup while running a job', 0, $e);\n\t\t}\n\t}",
"protected function setUp()\n {\n $this->loader = $this->getMock('Che\\LogStock\\Loader\\LogAdapterLoader');\n $this->fallbackAdapter = $this->getMock('Che\\LogStock\\Adapter\\LogAdapter');\n $this->factory = new AdapterLoaderFactory($this->loader, $this->fallbackAdapter);\n }",
"protected function setUp() {\n $this->object = new Qwin_Exception;\n }",
"public function prepare() {\n $this->customTaxonomies = [];\n\n // Get custom taxonomy with selectors\n $this->prepareCustomTaxonomyWithSelectors();\n\n // Get manually added custom post taxonomy\n $this->prepareManuallyAddedCustomTaxonomy();\n\n // If there is no custom taxonomy, stop.\n if(empty($this->customTaxonomies)) return;\n\n // Store it\n $this->bot->getPostData()->setCustomTaxonomies($this->customTaxonomies);\n }",
"abstract protected function prepareContext(): void;",
"protected function setUp()\n {\n $this->object = new LazyClassDefinition('\\stdClass');\n \n }",
"protected function setUp()\n\t{\n\t\t$this->object = $this->getMockForAbstractClass(\n\t\t\t'Ruon\\\\Loader\\\\LoaderAbstract'\n\t\t);\n\t}",
"protected function setUp() {\r\n parent::setUp();\r\n\r\n $this->_utils = $this->getProvider()->get('PM\\Main\\Utils');\r\n }",
"public function __prepare()\n {\n $this->objectManager->create('Mage\\CatalogRule\\Test\\TestStep\\DeleteAllCatalogRulesStep')->run();\n }",
"private function prepare(){\r\n \r\n $autoload = &$this->settings->autoload; \r\n \r\n if(isset($autoload)){\r\n \r\n foreach($autoload AS $key => $class){\r\n \r\n $settings = &$this->settings->{$key};\r\n \r\n if(isset($settings)){\r\n\r\n $this->{$key} = new $class($settings);\r\n }\r\n }\r\n }\r\n }",
"protected function setUp()\n {\n parent::setUp();\n\n $this->parameters = new EncodingParameters(\n $paths = ['some.path'],\n $fieldsets = ['type' => ['field1', 'field2']]\n );\n\n $this->container = Mockery::mock(ContainerInterface::class);\n }",
"public static function setup()\n\t{\n\t\tif (false === self::$data_cache_provider)\n\t\t{\n\t\t\tself::$data_cache_provider = new aw_cache();\n\t\t}\n\t}",
"protected function preProcess() {}",
"public function setUp() {\n try {\n $this->classname= $this->testClassName();\n $this->interfacename= $this->testClassName('I');\n } catch (IllegalStateException $e) {\n throw new PrerequisitesNotMetError($e->getMessage());\n }\n\n // Create an archive\n $this->tempfile= new TempFile($this->name);\n $archive= new Archive($this->tempfile);\n $archive->open(ARCHIVE_CREATE);\n\n $this->add($archive, $this->classname, '\n uses(\"util.Comparator\", \"'.$this->interfacename.'\");\n class '.$this->classname.' extends Object implements '.$this->interfacename.', Comparator { \n public function compare($a, $b) {\n return strcmp($a, $b);\n }\n }\n ');\n $this->add($archive, $this->interfacename, 'interface '.$this->interfacename.' { } ');\n $archive->create();\n \n // Setup classloader\n $this->classloader= new ArchiveClassLoader($archive);\n ClassLoader::getDefault()->registerLoader($this->classloader, TRUE);\n }",
"public function prepare();",
"public function prepare();",
"protected function setUp()\n {\n $this->dir = sys_get_temp_dir() . '/q-config_dirtest-' . md5(uniqid());\n \n mkdir($this->dir);\n mkdir(\"{$this->dir}/dir1\");\n mkdir(\"{$this->dir}/dir2\");\n touch(\"{$this->dir}/file1.mock\");\n touch(\"{$this->dir}/file2.mock\");\n touch(\"{$this->dir}/dir1/file3.mock\");\n touch(\"{$this->dir}/dir1/file4.mock\");\n \n $this->file = \"{$this->dir}/file1.mock\";\n \n Q\\Transform::$drivers['from-mock'] = 'Config_Mock_Unserialize';\n }",
"protected function prepareForValidation()\n {\n $this->merge([\n 'nome' => $this->nome,\n 'nascimento' => convertDateToDatabase($this->nascimento),\n 'cpf' => returnOnlyNumbers($this->cpf),\n 'email' => $this->email,\n ]);\n }",
"public function _before()\n {\n $this->markTestSkipped('Mocking up php functions doesnt work for zephir extensions.');\n $_FILES = [\n 'photo' => [\n 'name' => ['f0', 'f1', ['f2', 'f3'], [[[['f4']]]]],\n 'type' => [\n 'text/plain',\n 'text/csv',\n ['image/png', 'image/jpeg'],\n [[[['application/octet-stream']]]],\n ],\n 'tmp_name' => ['t0', 't1', ['t2', 't3'], [[[['t4']]]]],\n 'error' => [0, 0, [0, 0], [[[[8]]]]],\n 'size' => [10, 20, [30, 40], [[[[50]]]]],\n ],\n ];\n $request = new Request();\n $request->setDI($this->tester->getApplication()->getDI());\n $uploadedFiles = $request->getUploadedFiles();\n $files = [];\n /** @var Request\\File $file */\n foreach ($uploadedFiles as $file) {\n $files[] = [\n 'name' => $file->getName(),\n 'tmp_name' => $file->getTempName(),\n 'type' => $file->getType(),\n 'size' => $file->getSize(),\n 'error' => $file->getError(),\n ];\n }\n $this->files = $files;\n Test::func(\n 'Phalcon\\Validation\\Validator',\n 'getimagesize',\n function ($tmpName) {\n $tmpSizes = [\n 't0' => null,\n 't1' => null,\n 't2' => [500, 500],\n 't3' => [1000, 1000],\n 't4' => null,\n ];\n\n return $tmpSizes[$tmpName];\n }\n );\n Test::func(\n 'Phalcon\\Validation\\Validator',\n 'finfo_open',\n function ($mimeType) {\n return null;\n }\n );\n Test::func(\n 'Phalcon\\Validation\\Validator',\n 'finfo_file',\n function ($tmp, $tmpName) {\n $tmpTypes = [\n 't0' => 'text/plain',\n 't1' => 'text/csv',\n 't2' => 'image/png',\n 't3' => 'image/jpeg',\n 't4' => 'application/octet-stream',\n ];\n\n return $tmpTypes[$tmpName];\n }\n );\n Test::func(\n 'Phalcon\\Validation\\Validator',\n 'is_uploaded_file',\n function ($tmpName) {\n return true;\n }\n );\n Test::func(\n 'Phalcon\\Validation\\Validator',\n 'finfo_close',\n function ($tmp, $tmpName) {\n }\n );\n $_SERVER[\"REQUEST_METHOD\"] = \"POST\";\n }",
"public function setUp()\n {\n $this->stubException1 = new stub1stubException();\n $this->stubException2 = new stub2stubException();\n $this->stubException3 = new stubException('message');\n }",
"protected function setUp()\n {\n $this->object = new CommonTransformer;\n }",
"protected function setUp()\n {\n parent::setUp();\n $driver = new StorageDriver(\n new Storage('/', new Filesystem(new LocalDriver(sys_get_temp_dir()))),\n '/cache_test'\n );\n $this->object = new CachePool($driver);\n }",
"protected function setUp() {\n\t\t$this->_tableGateway = $this->_getCleanMock('Zend_Db_Table_Abstract');\n\t\t$this->_adapter = $this->_getCleanMock('Zend_Db_Adapter_Abstract');\n\t\t$this->_rowset = $this->_getCleanMock('Zend_Db_Table_Rowset_Abstract');\n\t\t$this->_tableGateway->expects($this->any())->method('getAdapter')->will($this->returnValue($this->_adapter));\n\n\t\t$this->object = new GTW_Model_User_Mapper($this->_tableGateway);\n\t}",
"protected function prepareValidations() {}",
"protected function setUp()\n\t{\n\t\t$this->object = $this->getMockForAbstractClass(\n 'Ruon\\\\Loader\\\\LoaderAutoloadAbstract'\n );\n\t}",
"public function __before() {\n\t\t// runs after this->data is set up, but before the class methods are run\n\t}",
"protected function _before()\n {\n $this->repo = m::mock('Gzero\\Cms\\Repositories\\BlockReadRepository');\n $this->finder = new BlockFinder($this->repo, new CacheManager(app()));\n }",
"abstract protected function prepareModels();",
"protected function setUp() {\n\t\tparent::setUp();\n\n\t\t$this->object = new Transit($this->data);\n\t\t$this->object->setDirectory(TEMP_DIR);\n\t}",
"private function _loadDataToTemporaryTable(){\n\n }",
"protected function init()\n {\n $classParser = $this->getContainer()->get('classParser');\n $classParser->setAllowedMethods( array($this->allowedMethod) );\n $this->data = $classParser->getData($this->paths, $this->cacheFile);\n }",
"function setUp() {\n\n $this->oLayer0 = new exceptions\\layer0\\ClassLayer0();\n\n }",
"protected function beforeGetData()\n {\n\n }",
"protected function setUp() {\n\t\t$this->objectRegistry = new \\F3\\FLOW3\\Object\\TransientRegistry();\n\t}",
"private function setMockDataConfig() {\n\n }",
"protected function prepareDetailsTables()\n\t{\n\t}",
"public function prepare()\r\n\t{\r\n\t\treturn null; // nothing\r\n\t}",
"protected function setUp()\n {\n $this->object = new Constructor_Callable(array($this, 'methodConstructor'));\n $this->called = false;\n }",
"public function testBadLoaderDefined() {\n $this->expectException('\\\\Phloem\\\\Exception\\\\LoaderException');\n\n $this->factory->setLoader('bad', true);\n $this->factory->getLoader('filename.bad');\n }",
"public function setUp()\n {\n $this->adapter = $this->getAdapterMock();\n $this->driver = $this->getDriverMock();\n $this->storage = $this->getStorageMock();\n $this->injector = $this->getInjectorMock();\n }",
"protected function fixture_setup() {\r\n $this->service = SQLConnectionService::get_instance($this->configuration);\r\n test_data_setup($this->service);\r\n }",
"public function prepare( $data );",
"protected function setUp()\n {\n $this->scheduledStructure = $this->createMock(\\Magento\\Framework\\View\\Layout\\ScheduledStructure::class);\n $this->context = $this->createMock(\\Magento\\Framework\\View\\Layout\\Reader\\Context::class);\n $this->readerPool = $this->createMock(\\Magento\\Framework\\View\\Layout\\ReaderPool::class);\n }",
"public function prepareArguments() {}",
"public function setUp()\n\t {\n\t\tdefine(\"EXCEPTION_UNABLE_TO_EXPAND\", 1);\n\t\tdefine(\"EXCEPTION_UNUSED_ITEMS\", 2);\n\t\tdefine(\"EXCEPTION_INVALID_DOCUMENT\", 3);\n\t\tdefine(\"EXCEPTION_ROOT_INDEX_NOT_VALID\", 4);\n\t }",
"public function testProcessException1()\n {\n $unit1 = $this->getUnit('test');\n $unit1->setReversedMapping([\n 'name' => 'field3',\n ]);\n $unit1->setReversedConnection([\n 'id' => 'field4',\n ]);\n $unit1->setMapping([\n 'field1' => 'name',\n 'field2' => 'code',\n ]);\n $unit1->setFilesystem($this->getFS(\n [\n ['Pete', 'tst1']\n ]\n ));\n $unit1->setTmpFileName('customer_tmp.csv');\n\n $action = $this->getAction([$unit1]);\n $action->process($this->getResultMock());\n }",
"protected function setUp()\n {\n $this->cicindelaStab = $this->getMock('Net_Cicindela');\n $this->object = new Net_Cicindela_Dataset('test', $this->cicindelaStab);\n }",
"abstract protected function prepareContextItem();",
"public function translateFactoryLoadExceptions(UnitTester $I)\n {\n $I->wantToTest('Translate\\Factory - load() - exceptions');\n\n $options = $this->arrayConfig['logger'];\n $factory = new LoggerFactory(new AdapterFactory());\n\n $I->expectThrowable(\n new LoggerException(\n 'Config must be array or Phalcon\\Config\\Config object'\n ),\n function () use ($factory) {\n $factory->load(1234);\n }\n );\n\n $I->expectThrowable(\n new LoggerException(\n 'You must provide \"name\" option in factory config parameter.'\n ),\n function () use ($factory, $options) {\n $newOptions = $options;\n unset($newOptions['name']);\n\n $factory->load($newOptions);\n }\n );\n }",
"public function prepare()\n {\n if (!isset($this->preparer)) {\n throw new Exception('Preparer not set');\n }\n\n $this->preparer->preparePacket($this);\n }",
"public function prepare()\n {\n $this->timeTracker = $this->getInjector()->inject('TimeTracker');\n $this->env = $this->getInjector()->inject('Environment');\n $this->env->parseFile(__DIR__.'/../environment.json');\n $this->toggleShowErrors();\n return $this;\n }",
"abstract public function prepare(): self;",
"public static function setUpBeforeClass() {\n\t\t$loader = new \\Mockery\\Loader();\n\t\t$loader->register();\n\t}",
"protected function prepareInsertData(){\n\t\tthrow new Exception('Unknown Error!', REST_ER_PAGE_NOTFOUND);\n\t}",
"protected function setUp()\n {\n $this->hotelMapperService = new HotelMapperService();\n $this->jsonHotels = json_encode($this->getHotelsRequestExample());\n $this->mappedHotels = $this->hotelMapperService->mapJsonToHotels($this->jsonHotels);\n $this->sort = new Sort($this->mappedHotels);\n }",
"protected function setUp()\n {\n $this->request = new Request();\n $this->response = new Response();\n\n $this->request->load();\n $this->response->load();\n }",
"protected function setUp()\n {\n $this->request = new Request();\n $this->response = new Response();\n\n $this->request->load();\n $this->response->load();\n }",
"private function prepareContainer() {\n $container_class = 'Drupal\\Core\\DependencyInjection\\Container';\n $methods = get_class_methods($container_class);\n /** @var ContainerInterface $container */\n $this->containerMock = $container = $this->getMockBuilder($container_class)\n ->disableOriginalConstructor()\n ->setMethods($methods)\n ->getMock();\n \\Drupal::setContainer($container);\n\n $this->containerMock->method('get')->willReturnCallback([\n $this,\n 'containerMockGetServiceCallback'\n ]);\n }",
"protected function setUp(): void\n {\n $logger = $this->getMockBuilder(NullLogger::class)\n ->disableOriginalConstructor()\n ->setMethods(['info', 'notice', 'warning', 'error', 'critical', 'alert', 'emergency'])\n ->getMock();\n $logger\n ->expects(self::never())\n ->method('info');\n $logger\n ->expects(self::never())\n ->method('notice');\n $logger\n ->expects(self::never())\n ->method('warning');\n $logger\n ->expects(self::never())\n ->method('error');\n $logger\n ->expects(self::never())\n ->method('critical');\n $logger\n ->expects(self::never())\n ->method('alert');\n $logger\n ->expects(self::never())\n ->method('emergency');\n\n $cache = new Psr16Cache(new NullAdapter());\n\n /** @var \\Psr\\Log\\NullLogger $logger */\n $factory = new DetectorFactory($cache, $logger);\n $this->object = $factory();\n }",
"private function prepareDataLoaderMockCallback(string $path, array $expectedFilesMap, ?array $expectedLoadData = null): callable\n {\n return static function (MockInterface $dataLoaderMock) use ($expectedFilesMap, $expectedLoadData, $path) {\n foreach ($expectedFilesMap as $key => $expectedFile) {\n $filePath = \"$path/$expectedFile\";\n $returnData = $expectedLoadData[$key] ?? [];\n $dataLoaderMock->shouldReceive('load')->withArgs([$filePath])->andReturn($returnData);\n }\n };\n }",
"public function setUp(): void\n {\n $this->setUpWithNoResult();\n }",
"abstract protected function insertMockRoutableContextObjects(array $data = []);",
"protected function setUp()\n {\n // driver\n $driver = new Driver\\FilesystemDriver([\n 'hash_level' => 1,\n 'file_pref' => 'cache.',\n 'file_suff' => '.txt'\n ]);\n\n $this->cache = new CachePool($driver);\n\n $this->object = new CacheItem('test', $this->cache, [\n 'ttl' => 60\n ]);\n\n }",
"public function setUp()\n {\n $this->paramErrors = new ParamErrors();\n }",
"public function __construct()\n {\n $pdoDouble = \\Mockery::mock('PDO');\n parent::__construct($pdoDouble);\n }",
"abstract protected function constructTestHelper();",
"protected function setUp(): void\n {\n $this->object = new HydrationOptions();\n }",
"abstract function prepare_data(&$data_arr);",
"function prepare() {\n\t\t\tcopy( \\Rum::config()->fixtures . '/Address Book.csv', __ROOT__ . '/app/data/Address Book.csv' );\n\t\t}",
"public function setup() {\n\t\t$this->setupDetectors();\n\t\t$this->registerExceptionHandler();\n\t}",
"protected function setUp()\n {\n parent::setUp();\n $this->prepareContextApiMock();\n }"
] | [
"0.5979687",
"0.5914579",
"0.5826315",
"0.57918215",
"0.5667025",
"0.56505",
"0.5598819",
"0.55500215",
"0.54599345",
"0.54593045",
"0.5455182",
"0.54247904",
"0.54060197",
"0.5368319",
"0.5326129",
"0.53247416",
"0.5299341",
"0.5240314",
"0.52171725",
"0.5202056",
"0.51643586",
"0.51386976",
"0.5112995",
"0.50937825",
"0.50866556",
"0.50841594",
"0.5081797",
"0.5080734",
"0.50634044",
"0.5053504",
"0.50500745",
"0.5042136",
"0.5040866",
"0.50390726",
"0.5016824",
"0.5016576",
"0.5006708",
"0.49921608",
"0.49724215",
"0.49694237",
"0.49635476",
"0.49614233",
"0.4956115",
"0.49475136",
"0.49475136",
"0.49383983",
"0.49308527",
"0.49289727",
"0.49281517",
"0.49225414",
"0.49211094",
"0.49141172",
"0.49094445",
"0.49045447",
"0.490447",
"0.4902919",
"0.48998627",
"0.48982468",
"0.48955578",
"0.48931134",
"0.48924202",
"0.4891893",
"0.488858",
"0.4887253",
"0.48855543",
"0.48571035",
"0.4856293",
"0.48535067",
"0.4853252",
"0.48515555",
"0.4850654",
"0.48500037",
"0.48440248",
"0.4841799",
"0.4839597",
"0.48327678",
"0.48311967",
"0.48274544",
"0.48246735",
"0.48147404",
"0.48106137",
"0.48057747",
"0.48040447",
"0.4801143",
"0.47996417",
"0.47996417",
"0.4796254",
"0.4795828",
"0.47900575",
"0.47852626",
"0.47847345",
"0.4784536",
"0.4782042",
"0.47796792",
"0.4779459",
"0.47793642",
"0.4776006",
"0.476821",
"0.4762311",
"0.4761689"
] | 0.53517723 | 14 |
Getter method of Id | public function getId() {
return $this->Id;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getId(): mixed;",
"public function getId() ;",
"public function getId() {}",
"public function getId() {}",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId();",
"public function getId()\n { // getter ID\n return $this->id;\n }",
"public function getId ();",
"function getId(){\n\t\t\treturn $this->$id;\n\t\t}",
"abstract function getId();",
"public function GetId () ;",
"function id() {\n $function = 'get' . get_class($this) . 'Id';\n return $this->$function();\n }",
"function get_id() {\n return $this->get_mapped_property('id');\n }",
"public function get_id();",
"public function get_id();",
"public function getID();",
"public function getID();",
"public function getID();",
"abstract public function getId();",
"abstract public function getId();",
"abstract public function getId();",
"function get_id() {\n\t\treturn $this->id;\n\t}",
"function getId();",
"protected function getId()\n {\n return $this->id;\n }",
"public function getID() : string;",
"public function getId() : string;",
"function getId() {\n\t\treturn $this->id;\n\t}",
"public function getId ()\n {\n return $this->id;\n }",
"function get_id() {\n\t\treturn $this->id;\n\n\t}",
"function get_id()\n {\n return $this->id;\n }",
"public function getId()\n {\n return $this -> id;\n }",
"abstract public function get_id();",
"function getId() {\n\t\treturn $this->getData('id');\n\t}",
"function getId() {\n\t\treturn $this->getData('id');\n\t}",
"public function getId(): string;"
] | [
"0.8656057",
"0.86055464",
"0.8575822",
"0.8575822",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.85184586",
"0.8511003",
"0.8464907",
"0.84380066",
"0.83816683",
"0.83676046",
"0.8367395",
"0.83436793",
"0.83243555",
"0.83243555",
"0.83095986",
"0.83095986",
"0.83095986",
"0.8305898",
"0.8305898",
"0.8305898",
"0.82803667",
"0.82800806",
"0.82733893",
"0.82617515",
"0.8257269",
"0.8252984",
"0.82485163",
"0.8238518",
"0.8230663",
"0.822693",
"0.82247156",
"0.822361",
"0.822361",
"0.8215105"
] | 0.0 | -1 |
Setter method of Id | public function setId($pId) {
$this->Id = $pId;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function SetId($value) { $this->id=$value; }",
"public function setId($id) ;",
"public function setId($x) { $this->id = $x; }",
"function setId($id) {\r\n $this->_id = $id;\r\n }",
"public function setId($id) { $this->id = $id; }",
"function setId($id) {\n\t\t$this->_id = $id;\n\t}",
"public function setId($id){\n $this->_id = $id;\n }",
"public function setId()\n\t{\n\t}",
"function setId($id){\n\t\t$this->id = $id;\n\t}",
"function setId($value){\n\t\t//echo \"setting ID to \".$value;\n\t\t$this->_id=$value;\n\t\t//echo \"ID set to \".$this->_id;\n\t\treturn $this;\n\t}",
"public function setId($id){ $this->id=$id;}",
"function setId($value) {\n $this->_id = intval($value);\n }",
"public function setId($id){\n\t\tself::$_id[get_class($this)] = $id;\n\t}",
"function setId($id){\r\n\t\t$this->id = $id;\r\n\t}",
"public function SetId ($id);",
"public function setId($id){\n $this->id = $id;\n }",
"public function setId($id){\n $this->id = $id;\n }",
"public function setId($id){\n $this->id = $id;\n }",
"function setId($id) {\n $this->id = $id;\n }",
"function setId($id) {\n $this->id = $id;\n }",
"public function setId($id)\n {\n $this->id = $id;\n\n \n }",
"public function setId($_id);",
"public function setId($Id){\n return $this->Id=$Id;\n }",
"public function setId($id);",
"public function setId($id);",
"public function setId($id);",
"public function setId($id);",
"public function setId($id);",
"public function setId($id);",
"public function setId($id);",
"public function setId($id);",
"public function setId($id);",
"public function setId($id);",
"public function setId($id);",
"public function setId($id);",
"public function setId($id);",
"function setId($id)\n {\n $this->id = $id;\n }",
"public function setId($id) \n {\n $this->id = $id;\n }",
"function setId($id) {\r\n\t\t// Set id and wipe data\r\n\t\t$this->_id = $id;\r\n\t}",
"function set_id($id) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id)\n {\n $this->id = $id;\n }",
"public function setId($id) {\n $this->id = $id;\n }",
"public function setId(string $id);",
"public function setID($id);",
"public function setId($var){\n\t\t$this->id=$var;\n\t}",
"public function setId($id){\n\t\t$this->id = $id;\n\t}",
"function setId($id) {\n\t\treturn $this->setData('id', $id);\n\t}",
"public function setId($id) {\r\n $this->_id = $id;\r\n }",
"function setId($id) {\n\t\t$this->setData('id', $id);\n\t}",
"function set_id($id)\n {\n $this->id = $id;\n }",
"public function setId($id) {\n\t\t$this->id = (integer)$id;\n\t}",
"public function setID($id) {\n $this->id = $id; \n }",
"public function setId($Id) \n {\n $this->Id = $Id;\n }",
"public function setId($id) {\r\n $this->id = $id;\r\n }",
"public function setId($id) {\r\n $this->id = $id;\r\n }",
"private function setId($id)\n {\n $this->id = $id;\n }",
"public function setId($id)\n {\n $this->_id = (int) $id;\n }",
"public function setId($id)\n {\n $this->id = $id;\n }",
"public function setId( $id )\n {\n $this->id = $id;\n }",
"function setId($id)\n\t{\n\t\t// Set id\n\t\t$this->_id\t = $id;\n\t}",
"public function setId($id){\n $this->id = (string) $id;\n }",
"public function setId($id) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id){\n $this->id = $id;\n }",
"public function setId($id)\n {\n $id = (int) $id;\n \n if ($id > 0)\n {\n $this->_id = $id;\n }\n }",
"public function setId($id){\n $this->id=$id;\n }",
"public function setId($id)\n {\n $this->_id = (int) $id;\n }",
"public function setId( $id ) {\n\t\t$this->id = $id;\n\t}",
"public function setId( $id ) {\n\t\t$this->id = $id;\n\t}",
"function setId($id) {\r\n // Set id and wipe data\r\n $this->_id = $id;\r\n $this->_data = null;\r\n }",
"public function setId(int $id)\n {\n $this->id = $id;\n }",
"public function set_id($_id){\n $this->_id = $_id;\n\n return $this;\n }",
"public function setId(int $id)\n {\n }",
"public function setId($id){\n\t\t\t$this->id = $id;\n\t\t}",
"static public function setId($id){\n \tif (self::$_id != $id){\n \t\tself::$_id = $id;\n \t\tself::regenerate();\n \t}\n }",
"private function setID($id) {\r\n\t\t$this->id = $id;\r\n\t}",
"public function setId($data)\n {\n $this->_Id=$data;\n return $this;\n }",
"public function setId($data)\n {\n $this->_Id=$data;\n return $this;\n }",
"public function setId($id): void;",
"public function setId($value) {\r\n\t\t$this->_id = $value;\r\n\t\treturn $this;\r\n\t}",
"function get_id($id){\n\t\t$this->id = $id;\n\t}",
"public function setId($id)\n {\n $this->_id = $id;\n }",
"function setId($id)\n\t{\n\t\t// Set id and wipe data\n\t\t$this->_id\t\t= $id;\n\t\t//$this->_data\t= null;\n\t}",
"public function setId($id)\r\n\t\t{\r\n\t\t\t$this->_id = $id;\r\n\t\t}",
"public function set_id($id){\n $this->id = $id;\n }",
"function setId($id) {\n // Set id and wipe data\n $this->_id = $id;\n //die($id);\n $this->_data = null;\n }",
"public function setId($id) {\n $this->id = $id;\n }",
"public function setId($id) {\n $this->id = $id;\n }",
"public function setId($id) {\n $this->id = $id;\n }",
"public function setId($id) {\n $this->id = $id;\n }",
"public function setID($value) {\r\n //if (!is_numeric($value)) die(\"setID() only accepts a numerical ID value\");\r\n $this->id = $value;\r\n }",
"public function setId($id)\r\n\t{\r\n\t\t$this->id = $id;\r\n\t}",
"public function setId($id)\r\n {\r\n $this->_id = (int) $id;\r\n }",
"public function setID($id){\n $this->id = $id;\n }",
"public function setNameAndId() {}",
"public function setId($id)\n {\n\n $this->idKey = $id;\n $this->context->element = $id;\n\n }",
"public function setId($id)\n {\n $this->_id = (int)$id;\n }",
"public function setId(string $id): void;"
] | [
"0.84399366",
"0.7996232",
"0.7990166",
"0.79112154",
"0.7885811",
"0.78799695",
"0.78699154",
"0.78645426",
"0.7853421",
"0.7852973",
"0.7840574",
"0.78364265",
"0.7833876",
"0.78303826",
"0.7808982",
"0.77888733",
"0.77888733",
"0.77888733",
"0.7781866",
"0.7781866",
"0.7735479",
"0.7733874",
"0.7706783",
"0.76959",
"0.76959",
"0.76959",
"0.76959",
"0.76959",
"0.76959",
"0.76959",
"0.76959",
"0.76959",
"0.76959",
"0.76959",
"0.76959",
"0.76959",
"0.769446",
"0.76915187",
"0.7691434",
"0.7681719",
"0.76662344",
"0.7635277",
"0.7623022",
"0.76203984",
"0.76071215",
"0.75971603",
"0.7572658",
"0.7569278",
"0.75675493",
"0.75589436",
"0.7551362",
"0.7532649",
"0.75291276",
"0.75253314",
"0.75253314",
"0.7524672",
"0.7521686",
"0.7518009",
"0.7517762",
"0.75130475",
"0.7507539",
"0.75050217",
"0.75050217",
"0.75050217",
"0.75050217",
"0.75050217",
"0.7504544",
"0.7499494",
"0.74872386",
"0.74801856",
"0.74761987",
"0.74761987",
"0.74524593",
"0.74480224",
"0.7443181",
"0.7439657",
"0.743922",
"0.7437232",
"0.74362653",
"0.74342066",
"0.74342066",
"0.74196136",
"0.7411766",
"0.74093187",
"0.74057615",
"0.7403319",
"0.7395508",
"0.7392231",
"0.73919904",
"0.73858446",
"0.73858446",
"0.73858446",
"0.73858446",
"0.738559",
"0.7373302",
"0.7372637",
"0.73721856",
"0.7368804",
"0.73506033",
"0.73451686",
"0.7342869"
] | 0.0 | -1 |
Getter method of Hash | public function getHash() {
return $this->Hash;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getHash();",
"final public function getHash() {}",
"public function getHash() {}",
"public function getHash()\n {\n return $this->getData(self::HASH);\n }",
"public function getHash(): string;",
"public function getHash(): string;",
"public function getHash(): string;",
"public function getHash(): string;",
"public function getHash()\n\t{\n\t\treturn $this->_hash ;\n\t}",
"public function getHash()\n {\n return $this->hash;\n }",
"public function getHash()\n {\n return $this->hash;\n }",
"public function getHash()\n {\n return $this->hash;\n }",
"public function getHash()\n {\n return $this->hash;\n }",
"public function getHash()\n {\n return $this->hash;\n }",
"public function getHash()\n {\n return $this->hash;\n }",
"public function getHash()\n\t{\n\t\treturn $this->hash;\n\t}",
"public function getHash(): string\n {\n return $this->data->hash;\n }",
"public function getHash()\n\t{\n\t\tif (!$this->hash)\n\t\t{\n\t\t\t$this->createHash();\n\t\t\t$this->getFromDB($this->hash);\n\t\t}\n\n\t\treturn $this->hash;\n\t}",
"public function hash();",
"public function getHash() {\n\t\treturn sha1( serialize( $this->property ) );\n\t}",
"public function hash(): string;",
"public function getHash(){\n\t\treturn $this->name->getHash();\n\t}",
"public function hashCode() {\n return $this->_hash;\n }",
"function DataHash(){\n return($this->data);\n }",
"public function getUserHash () {\n\t\treturn ($this->userHash);\n\t}",
"public function hash() {\n if(isset($this->cache['hash'])) return $this->cache['hash'];\n\n // add a unique hash\n $checksum = sprintf('%u', crc32($this->uri()));\n return $this->cache['hash'] = base_convert($checksum, 10, 36);\n }",
"public function getBlockHash();",
"public function getHashIndex();",
"public function get_hash($key = 0)\n {\n }",
"public function getHash()\n {\n\tif ( !$this->hash )\n\t{\n\t $array= array(\n\t $this->isPrimaryKey(),\n\t $this->isNullable(),\n\t $this->dbName,\n\t $this->getDefaultValue(),\n\t $this->getType(),\n\t get_class($this)\n\t );\n\t $this->hash= md5(implode('|', $array));\n\t}\n\treturn $this->hash;\n }",
"public function getHashService();",
"public function getHashIndex() {\n\t\treturn $this->_hashIndex;\n\t}",
"public function getHashIndex()\n {\n return $this->hashIndex;\n }",
"public function getHashIdentifier() : string;",
"public function getStateHash()\n {\n return $this->_hash;\n }",
"public function getHash() /*: string*/ {\n if ($this->hash === null) {\n throw new \\Exception(\"Hash is not initialized\");\n }\n return $this->hash;\n }",
"public function getUserHash() {\n\t\treturn $this->userHash;\n\t}",
"public function getUserHash() {\n\t\treturn $this->userHash;\n\t}",
"public function hash() {\n\t\t$hash = parent::get('hash');\n\t\tif($hash) return $hash; \t\n\t\t$this->set('hash', md5($this->basename())); \n\t\treturn parent::get('hash'); \n\t}",
"function getHash(){\r\n\r\n\t\t$hash = array();\r\n \r\n\t\t$hash['id'] = $this->id;\r\n\t\t$hash['user_id'] = $this->user_id;\r\n\t\t$hash['username'] = $this->username;\r\n\t\t$hash['gender'] = $this->gender;\r\n\t\t$hash['dob'] = $this->dob;\r\n\t\t$hash['country_id'] = $this->country_id;\r\n\t\t$hash['picture'] = $this->picture;\r\n\t\t$hash['link'] = $this->link;\r\n\t\t$hash['phone'] = $this->phone;\r\n\t\t$hash['likes'] = $this->likes;\r\n\t\t$hash['dislikes'] = $this->dislikes;\r\n\t\t$hash['hobbies'] = $this->hobbies;\r\n\t\t$hash['is_active'] = $this->is_active;\r\n\t\t$hash['created_on'] = $this->created_on;\r\n\t\t$hash['last_modified_on'] = $this->last_modified_on;\r\n\r\n\t\treturn $hash;\r\n\t}",
"public function getHashSum()\n {\n return $this->hashSum;\n }",
"public function getHash()\n {\n if (null === $this->_hash) {\n $this->_hash = md5(\n $this->getNumber() .\n $this->_string .\n $this->_message\n );\n }\n\n return $this->_hash;\n }",
"public function getLockHash() {}",
"public function hashCode(): string;",
"function hash()\n\t{\n\t\treturn sha1(time().serialize($this));\n\t}",
"public function getHashCount() {}",
"public function getHashCount() {}",
"public function getHash(): string\n {\n return $this->commitData['sha'];\n }",
"public function getStateHash()\n {\n return $this->stateHash;\n }",
"public function hashCode() : string;",
"private static function _getHash(self $item) {}",
"public function getHash($k) {\n $array = $this->URL_HASHES;\n return $array[$k];\n }",
"public function hash() {\r\n\t\t$cacheParams = explode(',',$this->cacheParams);\r\n\t\t$hash ='';\r\n\t\tforeach($cacheParams as $param) {\r\n\t\t\t$param = trim($param);\r\n\t\t\t$hash .= @$this->$param;\r\n\t\t}\r\n\t\treturn md5($hash);\r\n\t}",
"public function getHash() {\n return md5($this->email . $this->getSalt() . $this->getPassword());\n }",
"abstract protected static function getHashAlgorithm() : string;",
"public function getHash(): ?string\n {\n return $this->hash;\n }",
"public function getHash()\n {\n return $this->getValue('nb_commerce_product_category_hash');\n }",
"public function getReferenceHash()\n {\n return $this->reference_hash;\n }",
"public function hash()\n\t\t{\n\t\t\tif (!$this->hash) {\n\t\t\t\t$this->hash = md5($this->name.'-'.$this->size);\n\t\t\t}\n\n\t\t\treturn $this->hash;\n\t\t}",
"public function getHash()\n {\n return sprintf(\n '%s::%s::%s',\n $this->package,\n $this->class,\n $this->method\n );\n }",
"public function hash($value);",
"protected function getHashKey()\n {\n return $this->getHashKeyForId($this->getId());\n }",
"public function getHashCode()\n {\n return $this->hash_code;\n }",
"public function getHash()\n {\n return md5($this->template);\n }",
"public function getHash()\n {\n return md5($this->template);\n }",
"protected function getHashMethod()\r\n {\r\n return $this->processor_data['processor_params']['hash_method'];\r\n }",
"public function hashCode();",
"public function GetPasswordHash ();",
"public function jsonSerialize()\n {\n return $this->hash;\n }",
"public function getProfileHash() {\n\t\treturn ($this->profileHash);\n\t}",
"public function getRHash()\n {\n return $this->r_hash;\n }",
"public function getHash()\n\t{\n\t\t// Create a string that should uniquely represent the media instance.\n\t\t// We'll base it on the table name, concatenated with a '.', followed by the\n\t\t// ID value.\n\t\t$string = $this->getTable().'.'.$this->getKey();\n\n\t\t// We will use the SHA1 algorithm, as it is less prone to collision attacks,\n\t\t// while still being quick enough for mass hashing.\n\t\treturn hash('sha1', $string);\n\t}",
"final public function getHash(): string\n {\n return serialize([\n \\get_class($this),\n $this->acceptedExtension(),\n $this->getJsModule(),\n ]);\n }",
"public function getHashCode();",
"abstract protected static function getHashOptions() : array;",
"final public function computeHash()\n {\n return md5(serialize([\n $this->sql,\n $this->values,\n $this->safe,\n $this->usePlaceholders,\n ]));\n }",
"public function hash()\n {\n return $this->adapter->md5File($this->path);\n }",
"public function calculateHash()\n {\n return hash(\"sha512\", $this->index.$this->previousHash.$this->timestamp.((string)$this->data).$this->nonce);\n }",
"protected function hashLockClause_getHashInt() {}",
"public function getHashAttribute()\n {\n return Hashids::encode($this->attributes['id']);\n }",
"public function getHash(): string\n {\n return hash_hmac('sha256', $this->token, Config::SECRET_KEY);\n }",
"public function getVolHash() {\n\t\treturn ($this->volHash);\n\t}",
"public function getHash($hash)\n {\n return $this->user->where('hash' , '=' , $hash)->first();\n }",
"public function hashCode() {\n return $this->getClassName().$this->name;\n }",
"public function getHashSignedById(): string;",
"public function getHashes() {\n return $this->URL_HASHES;\n }",
"public function getChildHash()\n {\n return $this->childHash;\n }",
"protected function calculateHash()\n {\n return md5((string)$this->toCookie());\n }",
"private function getHash($url){\r\n return $url;\r\n }",
"public function getHashUnused()\n\t{\n\t\tif (!$this->isUsed())\n\t\t{\n\t\t\t$this->unused = static::getByDomain($this->domain, $this->user);\n\t\t\treturn $this->unused->getHash();\n\t\t}\n\n\t\treturn $this->getHash();\n\t}",
"public function toArray() {\n return $this->_hash;\n }",
"public function getHash() : string {\n\t\t// sha256 = 64 characters\n\t\treturn hash_hmac('sha256', $this->token, getenv('ENCRYPTION_KEY'));\n\t}",
"public function GetDigest()\n {\n return hash_final($this->_resource, true);\n }",
"public function computeHash()\n {\n $this->setLastnamecanonical($this->lastname);\n $this->setFirstnamecanonical($this->firstname);\n\n $this->hash = sha1(\n $this->firstnameCanonical.\n $this->lastnameCanonical.\n (($this->birthdate instanceof \\DateTime) ? $this->birthdate->format('Y-m-d') : '')\n );\n\n return $this->hash;\n }",
"abstract public function getDataxTrackHash();",
"public function setHash($var)\n {\n GPBUtil::checkString($var, True);\n $this->hash = $var;\n\n return $this;\n }",
"public function setHash($var)\n {\n GPBUtil::checkString($var, True);\n $this->hash = $var;\n\n return $this;\n }",
"protected function hashMemcache()\n\t{\n\t\treturn self::generateHash($this->getMode(), $this->getTrackKey(), $this->getApplicationID());\n\t}",
"protected function generateHash() {\r\n\t\t$relevantData = array('company','country','firstname','lastname','jobstatus');\r\n\t\tforeach($relevantData as $relevantField) {\r\n\t\t\t$getterMethod = 'get_'. ucfirst($relevantField);\r\n\t\t\t$badgeDataString = '';\r\n\t\t\t\r\n\t\t\tif(method_exists($this, $getterMethod)) {\r\n\t\t\t\t$badgeDataString .= $this->$getterMethod();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn md5($badgeDataString);\r\n\t}",
"public function hashCode() {\n return '$'.$this->getName();\n }"
] | [
"0.8884286",
"0.88645095",
"0.88564086",
"0.8349848",
"0.8294789",
"0.8294789",
"0.8294789",
"0.8294789",
"0.82874364",
"0.828709",
"0.828709",
"0.828709",
"0.828709",
"0.828709",
"0.828709",
"0.82666934",
"0.80812466",
"0.7840916",
"0.77972424",
"0.76769257",
"0.7643674",
"0.76432693",
"0.7566684",
"0.7476976",
"0.7397469",
"0.73857343",
"0.7274527",
"0.7273048",
"0.72577477",
"0.7232469",
"0.7221901",
"0.7218714",
"0.7205631",
"0.7204107",
"0.7185915",
"0.7175708",
"0.7160839",
"0.7160839",
"0.71467745",
"0.71263677",
"0.71229154",
"0.7067299",
"0.70275354",
"0.70204014",
"0.7018673",
"0.6993397",
"0.6993397",
"0.69696075",
"0.69392264",
"0.69266564",
"0.6907866",
"0.68977153",
"0.68913627",
"0.68895006",
"0.6875546",
"0.68570024",
"0.6845526",
"0.6841832",
"0.68275416",
"0.6819179",
"0.6794562",
"0.6792961",
"0.6791122",
"0.6757859",
"0.6757859",
"0.673263",
"0.67219955",
"0.67131436",
"0.6711703",
"0.66830105",
"0.6672911",
"0.6661408",
"0.6658315",
"0.6657241",
"0.6632714",
"0.66263735",
"0.6625387",
"0.661481",
"0.6599381",
"0.65973175",
"0.65773296",
"0.65753317",
"0.65668464",
"0.65435874",
"0.65285444",
"0.6522654",
"0.65142447",
"0.65067434",
"0.6505149",
"0.6474084",
"0.6463901",
"0.64330673",
"0.6420278",
"0.6416814",
"0.6414553",
"0.6406228",
"0.6406228",
"0.6386296",
"0.6384786",
"0.6363714"
] | 0.8145095 | 16 |
Setter method of Hash | public function setHash($pHash) {
$this->Hash = $pHash;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setHash(/*string*/ $value) /*: this*/ {\n $this->hash = $value;\n return $this;\n }",
"public function setHash($_hash)\n\t{\n\t\t$this->_hash = $_hash ;\n\t}",
"function setHash($hash) {\n $this->h = pack('H*', $hash);\n }",
"public function setHash($hash)\n {\n $this->hash = $hash;\n }",
"public function setHash($hash)\n {\n return $this->setData(self::HASH, $hash);\n }",
"public function setHashIndex($value);",
"public function set($key, $value = null, $hash = 'request') {\n\t\t$this->_hashes[$hash][$key] = $value;\n\t}",
"public function setHash($var)\n {\n GPBUtil::checkString($var, True);\n $this->hash = $var;\n\n return $this;\n }",
"public function setHash($var)\n {\n GPBUtil::checkString($var, True);\n $this->hash = $var;\n\n return $this;\n }",
"protected function loadHash()\n {\n $this->valueHash = $this->calculateHash();\n }",
"public function setHash($hash)\n {\n $this->hash = $hash;\n return $this;\n }",
"public function setHash($hash)\n {\n $this->hash = $hash;\n return $this;\n }",
"function setHash($hash)\n {\n // \\phpseclib\\Crypt\\Hash supports algorithms that PKCS#1 doesn't support. md5-96 and sha1-96, for example.\n switch ($hash) {\n case 'md2':\n case 'md5':\n case 'sha1':\n case 'sha256':\n case 'sha384':\n case 'sha512':\n $this->hash = new Hash($hash);\n $this->hashName = $hash;\n break;\n default:\n $this->hash = new Hash('sha1');\n $this->hashName = 'sha1';\n }\n $this->hLen = $this->hash->getLength();\n }",
"public function setHash($hash)\n\t{\n\t\t$this->hash = $hash;\n\n\t\treturn $this;\n\t}",
"public function setHashIndex($value) {\n\t\t$this->_hashIndex = $value;\n\t}",
"protected function setHashIndexKey(): void\n {\n $this->hashIndexKey = $this->index . (empty($this->indexType)\n ? self::HASH_INDEX_GLUE\n : (self::HASH_INDEX_GLUE . $this->indexType . self::HASH_INDEX_GLUE));\n }",
"public function setHash($hash)\n {\n $this->hash = $hash;\n\n return $this;\n }",
"public function setHash($hash)\n {\n $this->vkarg_hash = $hash;\n\n return $this;\n }",
"public function setT3Hashes() {}",
"public function __set($key, $val);",
"public function generateHash()\n {\n $this->hash = sha1(serialize($this->toArray()));\n }",
"public function __set($key, $value);",
"public function setHashIndex($value)\n {\n $this->hashIndex = $value;\n }",
"public function setHash($type = 'sha1')\n {\n $this->_hashType = ($type != 'sha1' AND $type != 'md5') ? 'sha1' : $type;\n }",
"function hash_set($name = 'user', $value = null) {\n return self::data_set($name, $value ? $value : sha1(uniqid()));\n }",
"public function setRandomHash()\n\t{\n\t\t$this->hash = Str::random(8);\n\n\t\treturn $this;\n\t}",
"public function hash();",
"public function testSetHash()\n {\n $validator = new File\\Md5('12345');\n $validator->setHash('12333');\n $this->assertEquals(['12333' => 'md5'], $validator->getMd5());\n\n $validator->setHash(['12321', '12121']);\n $this->assertEquals(['12321' => 'md5', '12121' => 'md5'], $validator->getMd5());\n }",
"public function hash($value);",
"public function hash(string $value)\n {\n }",
"function MyApp_Setup_Hash2Object($fid,$hash,$moduleobj=NULL,$tothis=TRUE)\n {\n $filedef=$this->SetupFileDefs[ $fid ];\n if ($filedef[ \"Destination\" ]!=\"\")\n {\n $dest=$filedef[ \"Destination\" ];\n if ($tothis) { $this->$dest=$hash; }\n if ($moduleobj)\n {\n $moduleobj->$dest=$hash;\n }\n }\n else\n {\n foreach ($hash as $key => $value)\n {\n if ($tothis) { $this->$key=$value; }\n if ($moduleobj)\n {\n $moduleobj->$key=$value;\n }\n }\n }\n }",
"public function hsetnx($hash, $key, $value)\n {\n return (int) $this->command('hsetnx', [$hash, $key, $value]);\n }",
"abstract public function set ($key, $value);",
"abstract public function set($key, $value);",
"abstract public function set($key, $value);",
"public function hash() {\n\t\t$hash = parent::get('hash');\n\t\tif($hash) return $hash; \t\n\t\t$this->set('hash', md5($this->basename())); \n\t\treturn parent::get('hash'); \n\t}",
"abstract public function set();",
"public function set( $key, $value );",
"public function set( $key, $value );",
"public function getHash() {}",
"public function __set(string $key, $val): void;",
"public function hashCode() {\n return $this->_hash;\n }",
"public /*void*/ function __set(/*scalar*/ $key, /*mixed*/ $value){}",
"public function __set($key, $value) {\n\t}",
"public function __construct($hash = array())\n {\n foreach ($hash as $key => $value) {\n $this->push($key, $value);\n }\n }",
"public function hset(string $key, string $field, mixed $value): void\n {\n }",
"public function __set($key, $value)\n {\n }",
"public function __set($key, $value)\n {\n }",
"public function __set($key, $value)\n {\n }",
"protected function hashPassword() {\n\t\t$this->password = Password::hash($this->password);\n\t}",
"public function def($key, $value = null, $hash = 'request') {\n\t\tif (!$this->has($key, $hash)) $this->set($key, $value, $hash);\n\t}",
"public function __set($key, $value)\n {\n }",
"public function setStateHash($var)\n {\n GPBUtil::checkString($var, False);\n $this->stateHash = $var;\n\n return $this;\n }",
"function __set( $key, $value ) {\n\t\t$this->{$key} = $value;\n\t}",
"public function setHash(string $hash = null) : CNabuDataObject\n {\n $this->setValue('nb_commerce_product_category_hash', $hash);\n \n return $this;\n }",
"final public function getHash() {}",
"function dxHashToClass($hash = \"\")\n {\n //$_SESSION[\"logger\"]->logInfo(get_class( $this ) . '->dxHashToClass', $hash);\n if (is_array($hash)) {\n $_SESSION[\"logger\"]->info(get_class($this) . '->dxHashToClass', $hash);\n foreach (array_keys(get_class_vars(get_class($this))) as $k) {\n if (isset($hash[$k])) {\n\n $this->__set($k, $hash[$k]);\n\n }\n }\n }\n $_SESSION[\"logger\"]->info($this->toDebugStr());\n\n }",
"function DataHash(){\n return($this->data);\n }",
"public function set(string $key, $data);",
"public function SetPasswordHash ($passwordHash);",
"public function put($key, $value) {\n $this->_hash[$key]= $value;\n }",
"public function set($key, $data);",
"function setfixedHash($recCopy,$fields='')\t{\n\n\t\tif ($fields)\t{\n\t\t\t$fieldArr = t3lib_div::trimExplode(',',$fields,1);\n\t\t\treset($fieldArr);\n\t\t\twhile(list($k,$v)=each($fieldArr))\t{\n\t\t\t\t$recCopy_temp[$k]=$recCopy[$v];\n\t\t\t}\n\t\t} else {\n\t\t\t$recCopy_temp=$recCopy;\n\t\t}\n\t\t$rec='';\n\t\tif (is_array($recCopy)) {\n\t\t\t$rec=implode('|',$recCopy_temp);\n\t\t}\n\t\t$encStr = $rec.'|'.$this->conf['authcodeFields.']['addKey'].'|'.$GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'];\n\t\t$hash = substr(md5($encStr),0,$this->codeLength);\n\t\treturn $hash;\n\t}",
"public function getHash();",
"abstract public function Set(string $key, $value) : void;",
"public function SET_hash($field_names_and_values) {\n\t\t//$this->scriptForceHint('UPDATE');\n\t\tif (!$field_names_and_values) throw new Exception(\"Attempting to SET an empty associative array\");\n\t\tforeach ($field_names_and_values as $field_name => $value) {\n\t\t\t$this->SET_once($field_name, $value);\n\t\t}\t\n\t}",
"public function set($key, $value) {\n\n }",
"public function set()\n {\n $args = func_get_args();\n $num = func_num_args();\n if ($num == 2) {\n self::$data[$args[0]] = $args[1];\n } else {\n if (is_array($args[0])) {\n foreach ($args[0] as $k => $v) {\n self::$data[$k] = $v;\n }\n }\n }\n }",
"public function __set($key, $value){\n \t$this->$key = $value;\n }",
"public function setHashSum($hashSum)\n {\n $this->hashSum = $hashSum;\n return $this;\n }",
"public function setHashIndex(int $value): self\n {\n $this->hashIndex = $value;\n\n return $this;\n }",
"protected function setHash(DataModel $item, &$data)\n\t{\n\t\t// Sanity check\n\t\tif (!(\n\t\t\t$item->hasField('lft') && \n\t\t\t$item->hasField('rgt') && \n\t\t\t$item->hasField('hash') && \n\t\t\t$item->hasField('slug')\n\t\t))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$slugField = $item->getFieldAlias('slug');\n\n\t\t// sha1 hash of 'null' is 'da39a3ee5e6b4b0d3255bfef95601890afd80709',\n\t\t// so avoid setting the hash if no slug has been set. Set from input first.\n\t\tif ( isset($slugField, $data) )\n\t\t{\n\t\t\t$data['hash'] = sha1( $data[$slugField] );\n\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $slug = $item->getFieldValue($slugField) )\n\t\t{\n\t\t\t$data['hash'] = $slug;\n\n\t\t\treturn;\n\t\t}\n\t}",
"function __set ($key, $value)\n {\n $this->A[$key] = $value;\n }",
"public function set ($key, $value);",
"public function hashCode()\n {\n // TODO: Implement hashCode() method.\n }",
"function setMGFHash($hash)\n {\n // \\phpseclib\\Crypt\\Hash supports algorithms that PKCS#1 doesn't support. md5-96 and sha1-96, for example.\n switch ($hash) {\n case 'md2':\n case 'md5':\n case 'sha1':\n case 'sha256':\n case 'sha384':\n case 'sha512':\n $this->mgfHash = new Hash($hash);\n break;\n default:\n $this->mgfHash = new Hash('sha1');\n }\n $this->mgfHLen = $this->mgfHash->getLength();\n }",
"public static function setHasher(HashInterface $hasher)\n {\n static::$hasher = $hasher;\n }",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function setData($data)\n\t{\n\t\t$this->_data = unserialize($data);\n\t\t$this->_hashFunc = $this->_data['hashFunc'];\n\t}",
"public function set($key, $value) {\n\t\t$this->_value = Hash::set($this->_value, $key, $value);\n\n\t\treturn $this;\n\t}",
"public function setSha256($val)\n {\n $this->_propDict[\"sha256\"] = $val;\n return $this;\n }",
"function hash()\n\t{\n\t\treturn sha1(time().serialize($this));\n\t}",
"public function set_hash($string){\n\t\t\t$string = hash($this->hash_algorithm, $string . $this->password_salt);\n\t\t\t$string = $this->password_addenda . $string . $this->password_addenda;\n\t\t\treturn $string;\n\n\t\t}",
"public function putref($key, $value) {\n $this->_hash[$key]= $value;\n }"
] | [
"0.7376823",
"0.72074234",
"0.6938163",
"0.6804157",
"0.65981936",
"0.65814596",
"0.6539141",
"0.64508617",
"0.64508617",
"0.64463377",
"0.64154243",
"0.64154243",
"0.6295391",
"0.62946796",
"0.62716836",
"0.62374294",
"0.61831814",
"0.6108998",
"0.61061704",
"0.6095194",
"0.6080127",
"0.6061436",
"0.6048999",
"0.5917076",
"0.5908043",
"0.5906029",
"0.59017587",
"0.58897495",
"0.5884658",
"0.58415496",
"0.58358026",
"0.5812521",
"0.5805297",
"0.5802754",
"0.5802754",
"0.57965314",
"0.57915056",
"0.5781269",
"0.5781269",
"0.5768813",
"0.5761186",
"0.5753703",
"0.574593",
"0.5739531",
"0.57325464",
"0.570141",
"0.56950825",
"0.56946295",
"0.56946295",
"0.5693232",
"0.56924355",
"0.56919193",
"0.56828094",
"0.5652372",
"0.5621728",
"0.56158835",
"0.56106675",
"0.56025153",
"0.55967814",
"0.55942965",
"0.5591505",
"0.5590585",
"0.557834",
"0.5575053",
"0.55709076",
"0.55638456",
"0.5559131",
"0.55496",
"0.5544574",
"0.5534307",
"0.55264646",
"0.5518005",
"0.5516553",
"0.55105525",
"0.55042636",
"0.5495841",
"0.5488609",
"0.5485867",
"0.5485867",
"0.5485867",
"0.5485867",
"0.5485867",
"0.5485867",
"0.5485867",
"0.5485867",
"0.5485867",
"0.5485867",
"0.5485867",
"0.5485867",
"0.5485867",
"0.5485867",
"0.5485867",
"0.5485867",
"0.5485867",
"0.54834306",
"0.546669",
"0.54588455",
"0.54504466",
"0.54404235",
"0.543332"
] | 0.6602643 | 4 |
/ Get all kameties for the given user method GET | public function getUserAllKameties($user_id){
// Get a MySQL DB connection
$this->conn = $this->dbConnect->connect();
$stmt = mysqli_prepare($this->conn, "SELECT k.id, k.kameti_name, k.admin_id, k.kameti_start_date, k.kameti_members, k.kameti_amount,
k.kameti_interest_rate, k.bid_start_time, k.bid_end_time, k.bid_amount_minimum, k.bid_timer, k.lucky_draw_amount, k.lucky_members,
k.runnerup_percentage, k.kameti_rule, k.kameti_status FROM kameti k, kameti_members km WHERE km.kameti_id = k.id AND km.member_id = ?");
$this->throwExceptionOnError();
mysqli_stmt_bind_param($stmt, 'i', $user_id);
$this->throwExceptionOnError();
mysqli_stmt_execute($stmt);
$this->throwExceptionOnError();
$rows = array();
mysqli_stmt_bind_result($stmt, $item->id, $item->kameti_name, $item->admin_id, $item->kameti_start_date, $item->kameti_members, $item->kameti_amount,
$item->kameti_interest_rate, $item->bid_start_time, $item->bid_end_time, $item->bid_amount_minimum, $item->bid_timer, $item->lucky_draw_amount,
$item->lucky_members, $item->runnerup_percentage, $item->kameti_rule, $item->kameti_status);
$this->throwExceptionOnError();
while (mysqli_stmt_fetch($stmt)) {
$rows[] = $item;
$item = new stdClass();
mysqli_stmt_bind_result($stmt, $item->id, $item->kameti_name, $item->admin_id, $item->kameti_start_date, $item->kameti_members, $item->kameti_amount,
$item->kameti_interest_rate, $item->bid_start_time, $item->bid_end_time, $item->bid_amount_minimum, $item->bid_timer, $item->lucky_draw_amount,
$item->lucky_members, $item->runnerup_percentage, $item->kameti_rule, $item->kameti_status);
}
mysqli_stmt_free_result($stmt);
mysqli_close($this->conn);
if(count($rows) > 0){
return $rows;
}else{
return NULL;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getallAction()\n\t{\n\t\t$resource_id = (int) $this->getRequest()->getParam('resource_id');\n\t\t$resource_type = $this->getRequest()->getParam('resource_type');\n\t\t\n\t\t$Likes = new Application_Model_Likes();\n\t\t\n\t\t$ret = $Likes->getUsersLiked($resource_type, $resource_id);\n\t\t\n\t\t$this->getHelper('json')->sendJson($ret);\n\t}",
"public function getMyTickets() /* /tickets/my-tickets */\n\t{\n\t\t$tickets = Auth::user()->tickets;\n\t\treturn Response::json([\n\t\t 'tickets' => $tickets->toArray()\n\t\t]);\n\t}",
"public function getTestomonials_get(){\n $user_id=$_GET['user_id'];\n $profile_type=$_GET['profile_type'];\n\t\t$result = $this->dashboard_model->getTestomonials($user_id,$profile_type);\n\t\treturn $this->response($result);\n }",
"public function allItemsByUser() \n {\n $this->checkUserIsLogged();\n $params = Route::getUrlParameters();\n $idUser = $params['idUser'];\n $item = new Item;\n $items = $item->allItemsByUser($idUser);\n View::renderJson($items);\n }",
"public function index_get()\n {\n $response = $this->UserM->all_user();\n $this->response($response);\n }",
"public function getList($user);",
"public function get_all_hotspot_user(){\n return $this->query('/ip/hotspot/user/getall');\n }",
"public function listsAllergiesGet()\r\n {\r\n $response = Allergies::all(); \r\n return response()->json($response, 200); \r\n }",
"public function getUserTodosAction()\n {\n $todo = new Workapp_Todo();\n $this->_helper->json($todo->getTodoList(array('user_id' => $this->getDeviceSession()->getUserId())));\n }",
"public function allForUser($userId);",
"public function allForUser($userId);",
"public function retrieveKeys()\n {\n return $this->start()->uri(\"/api/key\")\n ->get()\n ->go();\n }",
"public function japiGet_All()\n\t{\n\t\tif (Yii::app()->user->isGuest)\n\t\t\treturn array('ret'=>'failed', 'reason'=>'not login');\n\n\t\t$games=User::model()->findByPk(Yii::app()->user->id)->own_games;\n\t\t$games_info = array();\n\t\tforeach ($games as $game)\t\n\t\t\tarray_push($games_info, $game->attributes);\n\t\treturn array('ret'=>'ok', 'list'=>$games_info);\n\t}",
"public function index() {\n $loggedUser = Auth::user();\n $users = User::where('hotel', $loggedUser->hotel)\n ->where('id', '!=', $loggedUser->id)->get();\n\n return response()->json(['message' => 'OK', 'users' => $users], 200);\n }",
"public function getUsers();",
"public function getUsers();",
"public function getUsers();",
"public function getOffers(Request $request){\n // check params \n if(!$this->requiredParams($request, ['key'])){\n return response()->json(['status' => 'error' , 'message' => 'missing params' ] , 400);\n }\n\n $key = $this->checkParam($request->key);\n if ($key !== self::KEY) {\n return response()->json(['status' => 'error' , 'message' => 'invalid request' ] , 400);\n }\n\n\n\n $offers = Offer::with('shops')->where('active','1')->orderBy('created_at', 'DESC')->take(5)->get();\n\n return response()->json(['status' => 'success' , 'message' => 'OK', 'data' => $offers] , 200);\n\n }",
"public function getBeauticianKit(GetBeauticianKitRequest $request) {\n $beauticianId = $request->input('beauticianId');\n $response = BeauticianServiceProvider::getBeauticianKitList($beauticianId);\n return $this->sendJsonResponse($response);\n }",
"public function index()\n {\n $user = Auth::user();\n $clients = Client::where('user_id', $user->id)->paginate(10);\n return response()->json([\n 'clients' => $clients\n ]);\n }",
"public function helloworld_get() {\n $users = [\n ['id' => 0, 'name' => 'John', 'email' => 'john@example.com'],\n ['id' => 1, 'name' => 'Jim', 'email' => 'jim@example.com'],\n ];\n\n\t\t// Set the response and exit\n\t\t$this->response( $users, 200 );\n\t}",
"public function get($user) { \r\n return $this->makeRequest('get', \"/users/{$user}\");\r\n }",
"function users() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $query = \"select * from users;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n\n if ($r->num_rows > 0) {\n $result = array(); \n while ($row = $r->fetch_assoc()) {\n $result[] = $row;\n } \n $this->response(json_encode($result), 200);\n } else {\n $this->response('',204);\n }\n }",
"public function show($key)\n {\n //\n $user = User::where('user_key' ,'!=' , $key)->get(['avatar','lastname','name','user_key']);\n\n return Response()->json([\n 'users' => $user,\n ],200);\n }",
"public function index()\n {\n return koperasi::with('get_user','get_user_pinjam')->latest()->paginate(5);\n }",
"public function getClients(Request $request){\n\t\t$columns = array(\n\t\t\t0 => 'id',\n\t\t\t1 => 'name',\n\t\t\t2 => 'email',\n\t\t\t3 => 'active',\n\t\t\t4 => 'created_at',\n\t\t\t5 => 'action'\n\t\t);\n\n\t\t$totalData = User::where('is_admin',0)->count();\n\t\t$limit = $request->input('length');\n\t\t$start = $request->input('start');\n\t\t$order = $columns[$request->input('order.0.column')];\n\t\t$dir = $request->input('order.0.dir');\n\n\t\tif(empty($request->input('search.value'))){\n\t\t\t$users = User::where('is_admin',0)->offset($start)\n\t\t\t\t->limit($limit)\n\t\t\t\t->orderBy($order,$dir)\n\t\t\t\t->get();\n\t\t\t$totalFiltered = User::where('is_admin',0)->count();\n\t\t}else{\n\t\t\t$search = $request->input('search.value');\n\t\t\t$users = User::where([\n\t\t\t\t['is_admin',0],\n\t\t\t\t['name', 'like', \"%{$search}%\"],\n\t\t\t ])\n ->orWhere([\n ['is_admin',0],\n ['email', 'like', \"%{$search}%\"],\n ])\n ->orWhere([\n ['is_admin',0],\n ['created_at', 'like', \"%{$search}%\"],\n ])\n\t\t\t\t->offset($start)\n\t\t\t\t->limit($limit)\n\t\t\t\t->orderBy($order, $dir)\n\t\t\t\t->get();\n\t\t\t$totalFiltered = User::where([\n\t\t\t\t['is_admin',0],\n\t\t\t\t['name', 'like', \"%{$search}%\"],\n\t\t\t ])\n\t\t\t\t->orWhere([\n ['is_admin',0],\n ['email', 'like', \"%{$search}%\"],\n ])\n\t\t\t\t->orWhere([\n ['is_admin',0],\n ['created_at', 'like', \"%{$search}%\"],\n ])\n\t\t\t\t->count();\n\t\t}\n\n\n\t\t$data = array();\n\n\t\tif($users){\n\t\t\tforeach($users as $r){\n\t\t\t\t$edit_url = route('clients.edit',$r->id);\n\t\t\t\t$students_url = route('client-students',$r->id);\n\t\t\t\t$nestedData['id'] = '<td><label class=\"checkbox checkbox-outline checkbox-success\"><input type=\"checkbox\" name=\"clients[]\" value=\"'.$r->id.'\"><span></span></label></td>';\n\t\t\t\t$nestedData['name'] = $r->name;\n\t\t\t\t$nestedData['email'] = $r->email;\n\t\t\t\tif($r->active){\n\t\t\t\t\t$nestedData['active'] = '<span class=\"label label-success label-inline mr-2\">Active</span>';\n\t\t\t\t}else{\n\t\t\t\t\t$nestedData['active'] = '<span class=\"label label-danger label-inline mr-2\">Inactive</span>';\n\t\t\t\t}\n\n\t\t\t\t$nestedData['created_at'] = date('d-m-Y',strtotime($r->created_at));\n\t\t\t\t$nestedData['action'] = '\n <div class=\"text-center\">\n <td>\n <a title=\"Show Students\" class=\"btn btn-icon btn-light btn-hover-warning btn-sm\"\n href=\"'.$students_url.'\">\n <span class=\"svg-icon svg-icon-md svg-icon-warning\">\n <!--begin::Svg Icon | path:assets/media/svg/icons/Communication/Write.svg-->\n <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" version=\"1.1\">\n <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <polygon points=\"0 0 24 0 24 24 0 24\"/>\n <path d=\"M18,8 L16,8 C15.4477153,8 15,7.55228475 15,7 C15,6.44771525 15.4477153,6 16,6 L18,6 L18,4 C18,3.44771525 18.4477153,3 19,3 C19.5522847,3 20,3.44771525 20,4 L20,6 L22,6 C22.5522847,6 23,6.44771525 23,7 C23,7.55228475 22.5522847,8 22,8 L20,8 L20,10 C20,10.5522847 19.5522847,11 19,11 C18.4477153,11 18,10.5522847 18,10 L18,8 Z M9,11 C6.790861,11 5,9.209139 5,7 C5,4.790861 6.790861,3 9,3 C11.209139,3 13,4.790861 13,7 C13,9.209139 11.209139,11 9,11 Z\" fill=\"#000000\" fill-rule=\"nonzero\" opacity=\"0.3\"/>\n <path d=\"M0.00065168429,20.1992055 C0.388258525,15.4265159 4.26191235,13 8.98334134,13 C13.7712164,13 17.7048837,15.2931929 17.9979143,20.2 C18.0095879,20.3954741 17.9979143,21 17.2466999,21 C13.541124,21 8.03472472,21 0.727502227,21 C0.476712155,21 -0.0204617505,20.45918 0.00065168429,20.1992055 Z\" fill=\"#000000\" fill-rule=\"nonzero\"/>\n </g>\n </svg>\n <!--end::Svg Icon-->\n </span>\n </a>\n <a class=\"btn btn-icon btn-light btn-hover-primary btn-sm\" onclick=\"event.preventDefault();viewInfo('.$r->id.');\" title=\"View Client\" href=\"javascript:void(0)\">\n <span class=\"svg-icon svg-icon-md svg-icon-primary\">\n <!--begin::Svg Icon | path:assets/media/svg/icons/General/Settings-1.svg-->\n <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" version=\"1.1\">\n <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <rect x=\"0\" y=\"0\" width=\"24\" height=\"24\"></rect>\n <path d=\"M7,3 L17,3 C19.209139,3 21,4.790861 21,7 C21,9.209139 19.209139,11 17,11 L7,11 C4.790861,11 3,9.209139 3,7 C3,4.790861 4.790861,3 7,3 Z M7,9 C8.1045695,9 9,8.1045695 9,7 C9,5.8954305 8.1045695,5 7,5 C5.8954305,5 5,5.8954305 5,7 C5,8.1045695 5.8954305,9 7,9 Z\" fill=\"#000000\"></path>\n <path d=\"M7,13 L17,13 C19.209139,13 21,14.790861 21,17 C21,19.209139 19.209139,21 17,21 L7,21 C4.790861,21 3,19.209139 3,17 C3,14.790861 4.790861,13 7,13 Z M17,19 C18.1045695,19 19,18.1045695 19,17 C19,15.8954305 18.1045695,15 17,15 C15.8954305,15 15,15.8954305 15,17 C15,18.1045695 15.8954305,19 17,19 Z\" fill=\"#000000\" opacity=\"0.3\"></path>\n </g>\n </svg>\n <!--end::Svg Icon-->\n </span>\n </a>\n <a title=\"Edit Client\" class=\"btn btn-icon btn-light btn-hover-success btn-sm\"\n href=\"'.$edit_url.'\">\n <span class=\"svg-icon svg-icon-md svg-icon-success\">\n <!--begin::Svg Icon | path:assets/media/svg/icons/Communication/Write.svg-->\n <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" version=\"1.1\">\n <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <rect x=\"0\" y=\"0\" width=\"24\" height=\"24\"></rect>\n <path d=\"M12.2674799,18.2323597 L12.0084872,5.45852451 C12.0004303,5.06114792 12.1504154,4.6768183 12.4255037,4.38993949 L15.0030167,1.70195304 L17.5910752,4.40093695 C17.8599071,4.6812911 18.0095067,5.05499603 18.0083938,5.44341307 L17.9718262,18.2062508 C17.9694575,19.0329966 17.2985816,19.701953 16.4718324,19.701953 L13.7671717,19.701953 C12.9505952,19.701953 12.2840328,19.0487684 12.2674799,18.2323597 Z\" fill=\"#000000\" fill-rule=\"nonzero\" transform=\"translate(14.701953, 10.701953) rotate(-135.000000) translate(-14.701953, -10.701953)\"></path>\n <path d=\"M12.9,2 C13.4522847,2 13.9,2.44771525 13.9,3 C13.9,3.55228475 13.4522847,4 12.9,4 L6,4 C4.8954305,4 4,4.8954305 4,6 L4,18 C4,19.1045695 4.8954305,20 6,20 L18,20 C19.1045695,20 20,19.1045695 20,18 L20,13 C20,12.4477153 20.4477153,12 21,12 C21.5522847,12 22,12.4477153 22,13 L22,18 C22,20.209139 20.209139,22 18,22 L6,22 C3.790861,22 2,20.209139 2,18 L2,6 C2,3.790861 3.790861,2 6,2 L12.9,2 Z\" fill=\"#000000\" fill-rule=\"nonzero\" opacity=\"0.3\"></path>\n </g>\n </svg>\n <!--end::Svg Icon-->\n </span>\n </a>\n <a class=\"btn btn-icon btn-light btn-hover-danger btn-sm\" onclick=\"event.preventDefault();del('.$r->id.');\" title=\"Delete Client\" href=\"javascript:void(0)\">\n <span class=\"svg-icon svg-icon-md svg-icon-danger\">\n <!--begin::Svg Icon | path:assets/media/svg/icons/General/Trash.svg-->\n <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" version=\"1.1\">\n <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\n <rect x=\"0\" y=\"0\" width=\"24\" height=\"24\"></rect>\n <path d=\"M6,8 L6,20.5 C6,21.3284271 6.67157288,22 7.5,22 L16.5,22 C17.3284271,22 18,21.3284271 18,20.5 L18,8 L6,8 Z\" fill=\"#000000\" fill-rule=\"nonzero\"></path>\n <path d=\"M14,4.5 L14,4 C14,3.44771525 13.5522847,3 13,3 L11,3 C10.4477153,3 10,3.44771525 10,4 L10,4.5 L5.5,4.5 C5.22385763,4.5 5,4.72385763 5,5 L5,5.5 C5,5.77614237 5.22385763,6 5.5,6 L18.5,6 C18.7761424,6 19,5.77614237 19,5.5 L19,5 C19,4.72385763 18.7761424,4.5 18.5,4.5 L14,4.5 Z\" fill=\"#000000\" opacity=\"0.3\"></path>\n </g>\n </svg>\n <!--end::Svg Icon-->\n </span>\n </a>\n </td>\n </div>\n ';\n\t\t\t\t$data[] = $nestedData;\n\t\t\t}\n\t\t}\n\n\t\t$json_data = array(\n\t\t\t\"draw\"\t\t\t=> intval($request->input('draw')),\n\t\t\t\"recordsTotal\"\t=> intval($totalData),\n\t\t\t\"recordsFiltered\" => intval($totalFiltered),\n\t\t\t\"data\"\t\t\t=> $data\n\t\t);\n\n\t\techo json_encode($json_data);\n\n\t}",
"public function getResultsOfUser($user_id);",
"public function retrieveUserActions()\n {\n return $this->start()->uri(\"/api/user-action\")\n ->get()\n ->go();\n }",
"public function index($user)\n {\n $mycourses = Course::userCourse($user)\n ->where('progress','>', -1);\n\n if(!$mycourses){\n return response()->json(400);\n //400: Bad request. The standard option for requests that fail to pass validation.\n }else{\n foreach($mycourses as $mycourse){\n if(!Course::where('id', $mycourse->course_id)->exists()){\n $mycourses->forget($mycourse);\n }\n }\n if(!$mycourses){\n return response()->json(400);\n }else{\n $mycourses->sortByDesc('id');\n return response()->json($mycourses,200);\n //200: OK. The standard success code and default option.\n }\n }\n }",
"public function getRequesterCompaniesWithRequests(usuario $user)\n {\n return parent::getRequesterCompanies($user, true, false, true);\n }",
"public function get_all()\n {\n $sql = <<<SQL\n SELECT \n pigeon_keys.id as keys_id, pigeon_keys.users_id, profiles.first_name, profiles.last_name, users.username, pigeon_keys.key, pigeon_keys.level, pigeon_keys.date_created\n FROM \n profiles , users, {$this->rest_keys_table} pigeon_keys\n WHERE\n pigeon_keys.users_id = users.id\n AND\n profiles.user_id = users.id\nSQL;\n\n return $this->db->query($sql)->result_array();\n\n }",
"public function listsCountiesget()\r\n {\r\n $response = County::all();\r\n return response()->json($response, 200);\r\n }",
"public function get() {\n $return = array();\n $users = new User();\n $users->order_by('name', 'asc');\n $users->get();\n foreach ($users as $user) {\n $return[] = array(\n \"id\" => $user->id,\n 'name' => $user->name\n );\n }\n echo json_encode($return);\n }",
"public function index()\n {\n $kids = Kid::all();\n return $this->showAll($kids);;\n }",
"function GET()\n {\n $user = $this->router()->user();\n \n if ( ! $user->mayManageUsers())\n {\n throw new NotAuthorized();\n }\n \n $users = array();\n foreach(User::listAllIds() as $id)\n {\n $user = User::loadById($id);\n $users[] = array(\n \"email\" => $user->email(),\n \"id\" => $user->id(),\n \"name\" => $user->name(),\n \"privileges\" => $user->privileges()\n );\n }\n $this->setReturnVariable(\"data\", array(\"users\" => $users));\n }",
"public function getUserOperationsAction()\n {\n $operation = new Workapp_Operation();\n $this->_helper->json($operation->getOperationList(array('user_id' => $this->getDeviceSession()->getUserId())));\n }",
"function getUsers(){\n }",
"function getUsers(){\n }",
"public function index()\n {\n //check if cache is set or not ($key,$seperator,$current_page,$no_pagination_var,$before_page,$isPagination)\n //CacheExpiration::checkCache('parties',false,0,0,0,false);\n\n // Get parties\n $parties = Cache::rememberForever('parties', function() {\n return Party::orderBy('fullname_el', 'asc')->get();\n });\n \n return $this->apiHelper::returnResource('Party', $parties);\n }",
"public function SelectAll()\n {\n $users = DB::table('users')->get();\n\n if ($users <> \"[]\") {\n return response()->json(\n\n $users\n ,\n 200\n );\n }\n }",
"public function index()\n {\n $sectors = Sector::all();\n foreach ($sectors as $value) {\n $value->users;\n }\n return SectorResource::collection($sectors);\n }",
"public function getUsersAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $users = $em->getRepository('UserBundle:User')->findAll();\n\n return $this->json(array(\n 'users' => $users,\n ));\n }",
"public function index()\n {\n $this->repository->pushCriteria(app('Prettus\\Repository\\Criteria\\RequestCriteria'));\n $users = $this->repository->all();\n\n return response()->json([\n 'data' => $users,\n ]);\n }",
"public function index()\n {\n $travels = Travel::with('user')->get();\n return response()->json($travels);\n }",
"public function index(Request $request)\n {\n\n $users = Model::search('tookit')->get();\n dd($users);\n\n\n\n $builder = QueryBuilder::for(Model::class)\n ->with(['roles'])\n ->allowedFilters(Model::$allowedFilters)\n ->allowedSorts(Model::$allowedSorts);\n\n return Resource::collection(\n\n $request->get('pageSize') !== '-1'\n ?\n $builder->paginate($request->get('pageSize'),['*'],'page')\n :\n $builder->get()\n\n );\n }",
"function GETDataKelas_All(){\r\n\r\n // Perintah Get Data Kelas\r\n return $this->MKelas->GET();\r\n }",
"public function index()\n {\n $id = Auth::guard('society')->id();\n $society = Society::find($id);\n if ($society->privilege == 1) {\n return Society::all();\n }\n return Response::json([\"error\" => \"You are not authorised\"]);\n }",
"public function byUser()\n {\n # code...\n $garages = Garage::with('state', 'images', 'tags')->where('user_id', auth()->user()->id)->orderBy('id', 'desc')->get();\n return response()->json($garages, 200);\n }",
"public function index()\n {\n $folksonomies = $this->folksonomies->getFolksonomysPaginated(config('core.interaction.folksonomy.default_per_page'))->items();\n $res = [\n 'status' => $folksonomies ? 'OK' : 'error',\n 'result' => $folksonomies,\n ];\n return response()->json($res);\n }",
"public function users(Request $request)\n {\n $bandId = $request->query->getInt('bandId');\n /** @var UserBandRepository $repository */\n $repository = $this->getDoctrine()->getRepository(UserBand::class);\n\n $users = $repository->getBandUsers($bandId);\n return $this->json(\n [ 'success' => true,\n 'users' => $users,\n ]\n );\n }",
"public function allUser(){\n\n\t\t\t$data=$this->all('oops');\n\t\t\treturn $data;\n\t\t}",
"public function getKameti($kameti_id, $user_id) {\n\t\t// Get a MySQL DB connection\n\t\t$this->conn = $this->dbConnect->connect();\n\n\n\t\t$stmt = mysqli_prepare($this->conn, \"SELECT k.id, k.kameti_name, k.admin_id, k.kameti_start_date, k.kameti_members, k.kameti_amount,\n k.kameti_interest_rate, k.bid_start_time, k.bid_end_time, k.bid_amount_minimum, k.bid_timer, k.lucky_draw_amount, k.lucky_members,\n k.runnerup_percentage, k.kameti_rule, k.kameti_status FROM kameti k, kameti_members km WHERE km.kameti_id = k.id AND km.kameti_id = ? AND km.member_id = ?\");\n\t\t$this->throwExceptionOnError();\n\n\t\tmysqli_stmt_bind_param($stmt, 'ii', $kameti_id, $user_id);\n\t\t$this->throwExceptionOnError();\n\n\t\tmysqli_stmt_execute($stmt);\n\t\t$this->throwExceptionOnError();\n\n\n\t\tmysqli_stmt_bind_result($stmt, $item->id, $item->kameti_name, $item->admin_id, $item->kameti_start_date, $item->kameti_members, $item->kameti_amount,\n $item->kameti_interest_rate, $item->bid_start_time, $item->bid_end_time, $item->bid_amount_minimum, $item->bid_timer, $item->lucky_draw_amount,\n $item->lucky_members, $item->runnerup_percentage, $item->kameti_rule, $item->kameti_status);\n\t\t$this->throwExceptionOnError();\n\n\n mysqli_stmt_store_result($stmt);\n $this->throwExceptionOnError();\n\n\t\tmysqli_stmt_fetch($stmt);\n\t\t$this->throwExceptionOnError();\n\n $rows = mysqli_stmt_num_rows($stmt);\n mysqli_stmt_free_result($stmt);\n mysqli_close($this->conn);\n\n\t\tif($rows > 0){\n\t\t\treturn $item;\n\t\t}else{\n\t\t\treturn NULL;\n\t\t}\n }",
"public function index()\n {\n $this->request->allowMethod(['get']);\n\n $this->set('data', $this->Users->find());\n }",
"public function all($user, $api) {\n if(!$result = $this->cacheService->get('pkm.storage')) {\n\n # if no cached result was found, perform the search on the database.\n $result = $this->get();\n\n # generate response for each marker\n foreach($result as $k => &$row)\n $row = $this->response($row, !$api);\n\n # set cache if is production\n if(getenv('APP_ENV') != 'local')\n $this->cacheService->set('pkm.storage', $result, 3600);\n }\n\n $data = [];\n\n # if user was found on first request\n if($user) {\n\n # get markers which are owned by the user.\n # @todo add caching for user.id.markers\n $x = \\DB::table('markers')\n ->where('markers.user_id', $user->id)\n ->get();\n\n # genera response\n foreach($x as &$row)\n $data[$row->uuid] = $this->generateDefaultOwnedMarkerResponse();\n\n # get reported markers\n # @todo add caching for user.id.reports\n $x = \\DB::table('reports')\n ->join('markers', 'markers.id', '=', 'reports.marker_id')\n ->where('reports.user_id', $user->id)\n ->select(['markers.uuid'])\n ->get();\n\n foreach($x as &$row) {\n\n # if marker was already retrieved, update its values\n if(isset($data[$row->uuid])) {\n\n $data[$row->uuid]['report'] = true;\n continue;\n }\n\n # if not, generate default response\n $data[$row->uuid] = $this->generateDefaultReportedMarkerResponse();\n }\n\n # get spotted markers\n # @todo add caching for user.id.sights\n $x = \\DB::table('sights')\n ->join('markers', 'markers.id', '=', 'sights.marker_id')\n ->where('sights.user_id', $user->id)\n ->select(['markers.uuid'])\n ->get();\n\n foreach($x as &$row) {\n\n # if marker was already retrieved, update its values\n if(isset($data[$row->uuid])) {\n\n $data[$row->uuid]['seen'] = true;\n continue;\n }\n\n # if not, generate default response\n $data[$row->uuid] = $this->generateDefaultSpottedMarkerResponse();\n }\n }\n\n # create response\n $response = [\n 'markers' => $result,\n 'data' => $data\n ];\n\n return $response;\n }",
"public function get_userSkills_get(){\n\t\textract($_GET);\n\t\t$result = $this->dashboard_model->get_userSkills($user_id,$profile_type);\n\t\treturn $this->response($result);\t\t\t\n\t}",
"public function my_courses_get() {\n $response = array();\n $auth_token = $_GET['auth_token'];\n $logged_in_user_details = json_decode($this->token_data_get($auth_token), true);\n\n if ($logged_in_user_details['user_id'] > 0) {\n $response = $this->api_model->my_courses_get($logged_in_user_details['user_id']);\n }else{\n\n }\n return $this->set_response($response, REST_Controller::HTTP_OK);\n }",
"public function viewCoins($method) {\n if ($method == \"GET\") {\n header(\"Content-Type: application/json; charset=UTF-8\");\n echo CryptoDB::getAll(); \n } else {\n header('HTTP/1.1 404 Not Found');\n }\n }",
"public function index() // Secured Endpoint \n {\n $users = Cache::rememberForever('users', \n fn() => DB::table('users')->get());\n \n return response()->json([\n 'success' => true,\n 'payload' => $users\n ]);\n }",
"public function findAllByUser($user)\n {\n $dql = 'SELECT t FROM FTApiBundle:ApiToken t\n WHERE t.user = :user';\n\n return $this->getEntityManager()\n ->createQuery($dql)\n ->setParameter('user', $user)\n ->getResult();\n }",
"public function index()\n {\n $user = $this->user();\n\n// if ($user == null) {\n// throw new UnauthorizedHttpException(\"Bearer\", \"You are not authorized to see all users.\", null, 0x00C00301);\n// }\n\n if (!policy($user)->canSeeAll($user)) {\n throw new HttpException(403, \"You are not authorized to see all users.\", null, [], 0x00C00302);\n }\n\n $users = $this->repository->all();\n\n return $this->response->collection($users, new UserTransformer, [\"key\" => \"users\"]);\n }",
"public function all(): JsonResponse\n {\n $users = $this->user->get();\n return new JsonResponse($users, JsonResponse::HTTP_OK);\n }",
"public function fetch_all_users_get(){\n\n header(\"Access-Controll-Allow-Origin: *\");\n\n $data = $this->Users_Model->fetch_all_users();\n\n $this->response($data);\n\n }",
"public function index()\n {\n\n auth('api')->user()->authorizeRoles(['admin']);\n\n\t $users = $this->user->paginate('10');\n\n\t return response()->json($users, 200);\n }",
"public function get_curies()\n {\n }",
"public function index()\n {\n $query = [];\n if(!$this->user->is_admin){\n array_push($query,['user_id','=',$this->user->id]);\n }\n return $this->helper->get(null,$query);\n }",
"public function apiListTahun($idUser)\n {\n return $dataKrit = DataKriteria::where('id_user', '=', $idUser)\n ->select('tahun')\n ->distinct()\n ->get();\n }",
"function list(){\n $res = $res = $this->client->request('GET',$this->path,[]);\n $this->checkResponse($res,array(200));\n return $res;\n }",
"public function getUserList($type = 'all'): void{\n\n if(Session::isLogin()){\n\n if($type === 'anime'){\n $userList = UserList::where('user_list.user_id', Session::getUser()['id'])->where('type', 'Anime')->getAll();\n }else if($type === 'manga'){\n $userList = UserList::where('user_list.user_id', Session::getUser()['id'])->where('type', 'Manga')->getAll();\n }else{\n $userList = UserList::where('user_list.user_id', Session::getUser()['id'])->getAll();\n }\n \n if(isset($_GET['id'])){\n foreach($userList as $artwork){\n if($artwork->id === $_GET['id']){\n echo json_encode($userList);\n exit;\n }\n }\n }\n }\n \n if(!empty($userList))\n echo json_encode($userList);\n else\n echo json_encode([]);\n }",
"public function getKebun(Request $request){\n $getKebun = Kebun::where('company_id', $request->get('id'))->pluck('name', 'id');\n\n return response()->json($getKebun);\n }",
"public function getAllUserRequests($user_id) {\n $stmt = $this->conn->prepare(\"SELECT r.* , e.name, e.mobile from service_request r inner join employee e on (r.employee_id = e.id) where r.user_id= ? && (r.status = 0 || r.status = 1)\");\n $stmt->bind_param(\"i\", $user_id);\n $stmt->execute();\n $requests = $stmt->get_result();\n $stmt->close();\n return $requests;\n }",
"public function index()\n\t{\n $models = User::with('status')->get();\n return $this->getCollectionResponse($models);\n\t}",
"public function getUsers(){\n $users = User::all();\n return response([ 'users' => $users ]);\n }",
"public function index()\n {\n $user=Auth::guard('api')->user();\n \n if($user->type!=\"client\"){\n return redirect('/login'); \n }\n return $user->bids;\n }",
"protected function get() {\n $subc = \"get_\".$this->sub_collection;\n if ($subc !== null && method_exists($this, $subc)) {\n $this->im_here();\n if ($this->sub_collection == \"users\") {\n $current_users = intval($this->params->number);\n while (1) {\n $this->clear_inactive_users();\n $users = $this->get_users();\n if (sizeof($users) !== $current_users) {\n return $users;\n }else {\n sleep(1);\n }\n }\n }\n return $this->$subc();\n }else {\n $this->write_error(\"Request error!\");\n }\n }",
"public function ShowAll( )\n {\n $dataArray = array(\n );\n \n $response = ServiceAPIUtils::CallAPIService( $dataArray,\"/User/ShowAll/123\", \"json\" );\n \n return $response;\n }",
"public function get_all($thing){\n if($thing != \"users\"){\n $sql = 'SELECT * FROM ' . $thing;\n $this->query($sql);\n $rows = $this->all();\n return json_encode($rows);\n }else{\n // not returning passwords for obvious reasons\n $sql = 'SELECT id, first_name, last_name, email FROM ' . $thing;\n $this->query($sql);\n $rows = $this->all();\n return json_encode($rows);\n }\n }",
"public static function traerTodosLosChoferes()\n {\n $objetoAccesoDato = AccesoDatos::dameUnObjetoAcceso();\n $consulta = $objetoAccesoDato->RetornarConsulta(\"SELECT * \n FROM usuarios AS u, choferes AS c \n WHERE u.id_usuario=c.id_usuario\");\n \n $consulta->execute();\n $consulta = $consulta->fetchAll(PDO::FETCH_ASSOC);\n return json_encode($consulta);\n }",
"public function myHierarchy_get(){\n\t\t$userId = $this->token_payload[\"user_id\"];\n\t\tresponse($this,true,200,$this->getAllAccessibleProfiles($userId));\n\t}",
"public function getUsers(){\n if($this->get_request_method() != \"GET\"){\n $this->response('',406);\n }\n $role = $_REQUEST[\"role\"];\n\n $query=\"SELECT * FROM `usuario` WHERE `rol` = \" . $role;\n\n $this->db->get($query);\n }",
"public function getAuthenticated($user) { \r\n return $this->makeRequest('get', \"/user\");\r\n }",
"public function index()\n {\n\n $users = User::all();\n\n if($users){\n $responses['percent'] = ['Good' => 0, 'Fair' => 0, 'Neutral' => 0, 'Bad' => 0];\n $responses['number'] = ['Good' => 0, 'Fair' => 0, 'Neutral' => 0, 'Bad' => 0];\n foreach($responses['percent'] as $key => $value){\n $responses['percent'][$key] = round(count(User::where(\"response\", $key)->get()) * 100 / count($users), 2);\n $responses['number'][$key] = round(count(User::where(\"response\", $key)->get()), 2);\n }\n }\n \n return response()->json($responses);\n }",
"public function listUserKab()\n { \n $users = $this->apiHeaderNav();\n return view('user.userListForAdmUserKab',['data'=>$users]);\n }",
"public function index()\n {\n $user = request()->user();\n $categories = Category::where('user_id', $user->id)->orderBy('id', 'desc')->get();\n return response()->json([\n 'success' => true,\n 'categories' => $categories\n ]);\n }",
"public function get_all ();",
"public function userIndex()\n {\n return Serie::with([\n 'genre1',\n 'genre2'\n ])->ownedBy(auth()->user()->id)\n ->get();\n }",
"public function index()\n\t\t{\n\t\t\treturn response()\n\t\t\t\t\t->json(Quote::with('user')->get());\n\t\t}",
"public function getAll() { \r\n return $this->makeRequest('get', \"/games/top\");\r\n }",
"public static function handlesCuries(): array\n {\n $curies = MessageResolver::findAllUsingMixin('gdbots:iam:mixin:search-users-request:v1', false);\n $curies[] = 'gdbots:iam:request:search-users-request';\n return $curies;\n }",
"public function obat_get()\n\t{\n\t\t$data = $this->Obat->getAllObat();\n\t\tif ($data) {\n\t\t\t$this->response($data,200);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response([\n\t\t\t\t'error'=>false,\n\t\t\t\t'message'=>'Obat kosong'\n\t\t\t],200);\n\t\t}\n\t}",
"public function myAction()\n {\n $auth = $this->get('core.auth.action_listener');\n $user = $auth::$user;\n\n if (!$user) {\n throw $this->createNotFoundException('Unable to find User entity.');\n }\n\n $em = $this->getDoctrine()->getManager();\n $entities = $em->getRepository('UCrmCoreBundle:Client')->findAllOfUser($user);\n\n return [\n 'entities' => $entities,\n 'user' => $user\n ];\n }",
"public function getAll() {}",
"public function getAll() {}",
"public function getAll() {}",
"public function getAll() {}",
"public function getAll() {}",
"public function get_kids()\r\n\t\t{\r\n\t\t\treturn json_decode( $this->make_request( self::PROG_ENDPOINT . \"?filter_producer__name=KIDS\" ) );\r\n\t\t}",
"public function getList() {\n\t\t$this->request = array('uri' => array('path' => 'users.json'));\n\n\t\treturn $this->find('all');\n\t}",
"public function all()\n {\n Log::info('Retrieving all rooms');\n return response()->json(Room::with('images','features','user')->get());\n\n }",
"function all($request){\r\n global $context;\r\n $i= new $this->model;\r\n\r\n if(!$this->authRequired){\r\n $i->supperUser();\r\n }\r\n\r\n $data=$i->get();\r\n\r\n if($request->UseApi() ){\r\n json_success(\"Success\",$data);//where(['id','<','50'])->orderBy('id','desc')->limit(2,1)->\r\n }else{\r\n return $this->view(compact('data'));\r\n }\r\n\r\n }",
"function get_all_get(){\n $result = $this->lecturers_model->get_all();\n $this->response($result); \n\n }"
] | [
"0.6317976",
"0.62305975",
"0.5933661",
"0.59324116",
"0.5930103",
"0.5797931",
"0.5757145",
"0.5743135",
"0.5730664",
"0.5713504",
"0.5713504",
"0.5660568",
"0.5654491",
"0.5625056",
"0.5618116",
"0.5618116",
"0.5618116",
"0.56083935",
"0.56072336",
"0.55942976",
"0.559362",
"0.55840933",
"0.5543841",
"0.55192",
"0.5496727",
"0.5487005",
"0.54709774",
"0.54671687",
"0.5466884",
"0.5451018",
"0.5447513",
"0.544535",
"0.5425772",
"0.54024804",
"0.53836423",
"0.5383497",
"0.5376105",
"0.5376105",
"0.53498554",
"0.53477544",
"0.53470224",
"0.534499",
"0.5334461",
"0.53323287",
"0.5316296",
"0.53162855",
"0.5306986",
"0.5304346",
"0.5298449",
"0.5297326",
"0.5296068",
"0.5295032",
"0.5285604",
"0.52828544",
"0.5279836",
"0.52783215",
"0.52766633",
"0.5265658",
"0.5264159",
"0.526199",
"0.5261765",
"0.5260348",
"0.5250553",
"0.5250473",
"0.52444065",
"0.52404255",
"0.5236583",
"0.5211289",
"0.52095884",
"0.52017367",
"0.5200237",
"0.51950085",
"0.5192083",
"0.5186616",
"0.51864433",
"0.51851964",
"0.5181707",
"0.51794523",
"0.5179206",
"0.5179205",
"0.5171296",
"0.5163678",
"0.5161014",
"0.51561755",
"0.5156118",
"0.51541233",
"0.51517427",
"0.5149623",
"0.51486367",
"0.5146182",
"0.5143387",
"0.5143387",
"0.5143387",
"0.51433337",
"0.51433337",
"0.51428753",
"0.5142573",
"0.5141015",
"0.51301533",
"0.5127832"
] | 0.6650836 | 0 |
Fetching single kameti method GET | public function getKameti($kameti_id, $user_id) {
// Get a MySQL DB connection
$this->conn = $this->dbConnect->connect();
$stmt = mysqli_prepare($this->conn, "SELECT k.id, k.kameti_name, k.admin_id, k.kameti_start_date, k.kameti_members, k.kameti_amount,
k.kameti_interest_rate, k.bid_start_time, k.bid_end_time, k.bid_amount_minimum, k.bid_timer, k.lucky_draw_amount, k.lucky_members,
k.runnerup_percentage, k.kameti_rule, k.kameti_status FROM kameti k, kameti_members km WHERE km.kameti_id = k.id AND km.kameti_id = ? AND km.member_id = ?");
$this->throwExceptionOnError();
mysqli_stmt_bind_param($stmt, 'ii', $kameti_id, $user_id);
$this->throwExceptionOnError();
mysqli_stmt_execute($stmt);
$this->throwExceptionOnError();
mysqli_stmt_bind_result($stmt, $item->id, $item->kameti_name, $item->admin_id, $item->kameti_start_date, $item->kameti_members, $item->kameti_amount,
$item->kameti_interest_rate, $item->bid_start_time, $item->bid_end_time, $item->bid_amount_minimum, $item->bid_timer, $item->lucky_draw_amount,
$item->lucky_members, $item->runnerup_percentage, $item->kameti_rule, $item->kameti_status);
$this->throwExceptionOnError();
mysqli_stmt_store_result($stmt);
$this->throwExceptionOnError();
mysqli_stmt_fetch($stmt);
$this->throwExceptionOnError();
$rows = mysqli_stmt_num_rows($stmt);
mysqli_stmt_free_result($stmt);
mysqli_close($this->conn);
if($rows > 0){
return $item;
}else{
return NULL;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function index_get() {\n $id = (int) $this->get('id');\n $this->load->model('Equipe_model');\n\n if($id<=0){\n $retorno = $this->Equipe_model/*em*/->getAll();\n } else {\n $retorno = $this->Equipe_model->getOne($id);\n }\n\n $this->set_response($retorno,REST_Controller_Definitions::HTTP_OK);\n }",
"function index_get() {\n $id = $this->get('id_formk');\n if ($id == '') {\n $admintaxi = $this->db->get('t_form_kotamobagu')->result();\n } else {\n $this->db->where('id_formk', $id);\n $admintaxi = $this->db->get('t_form_kotamobagu')->result();\n }\n $this->response($admintaxi, 200);\n }",
"public function index_get() {\n $action = $this->get('action');\n switch ($action) {\n case \"retrieve_get\":\n $this->retrieve_get();\n break;\n default:\n $this->not_found();\n break;\n }\n }",
"public function index_get()//index_get() adalah standar untug Rest GET\n {\n $id= $this->get('id');//dari methode get, ambil key 'id' \n if($id===null){ //jka $id kosong\n $mahasiswa = $this->m_mahasiswa->getdata('mahasiswa')->result_array();//get semua data pada tabel mahasiswa dan dijadikan array assosiatif\n }else{\n $id= $this->get('id');//dari methode get ambil 'id'\n $w=array('id'=>$id); //array untuk where\n $mahasiswa =$this->m_mahasiswa->getdata_where($w,'mahasiswa')->result_array(); //perintah db ambil data pada tabel mahasiswa yang memilii id=$id kemudian simpan ke $mahasiswa dengan hasil array assosiatif.\n }\n \n if($mahasiswa){ //jika data ada\n $this->response([\n 'status' => true, //status= true\n 'data' => $mahasiswa //data= $mahasiswa\n ], REST_Controller::HTTP_OK);\n }else{\n $this->response([\n 'status' => false, //status= false\n 'message' => 'id not fount' //message not found\n ], REST_Controller::HTTP_NOT_FOUND);// status http menjadi 404 notfound\n }\n }",
"public function obat_get()\n\t{\n\t\t$data = $this->Obat->getAllObat();\n\t\tif ($data) {\n\t\t\t$this->response($data,200);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response([\n\t\t\t\t'error'=>false,\n\t\t\t\t'message'=>'Obat kosong'\n\t\t\t],200);\n\t\t}\n\t}",
"function index_get() {\n $id = $this->get('id'); // Mengecek apakah ada property id pada address sehingga data yang ditampilkan dapat diseleksi berdasarkan id atau ditampikan semua\n if ($id == '') {\n $kontak = $this->db->get('telepon')->result(); // Jika id tidak ada maka data ditampilkan semua\n } else {\n $this->db->where('id', $id);\n $kontak = $this->db->get('telepon')->result(); // Data ditampilkan berdasarkan id yang terdapat di property address\n }\n $this->response($kontak, 200);\n }",
"public function getGet ();",
"public static function get() {\n return self::call(\"GET\");\n }",
"public function index_get(){\n $id = $this->get('id');\n if ($id == '') {\n $response = $this->BayiM->get_all();\n } else {\n $this->db->where('id', $id);\n $response = $this->BayiM->get_all();\n }\n $this->response($response);\n }",
"function index_get()\n {\n $key = $this->get('id');\n if (!$key) {\n $this->response($this->supplies->all(), 200);\n } else {\n $result = $this->supplies->get($key);\n if ($result != null)\n $this->response($result, 200);\n else\n $this->response(array('error' => 'Supplies item not found!'), 404);\n }\n }",
"public function readAction(){\n\n //Pega o id do veiculo\n $veiculo = Application::getParam('id');\n if($veiculo === null){\n return json_encode(array(\n 'success' => false,\n 'message' => 'Veiculo é inválido ou não existe.',\n 'code' => 0\n ));\n }\n\n try {\n //Pega o veiculo solicitado\n $model = Veiculo::findOneBy(array('id' => $veiculo));\n }\n catch (\\Exception $e){\n\n //Caso algo dê errado, retorna uma menssagem de erro\n return json_encode(array(\n 'success' => false,\n 'message' => $e->getMessage(),\n 'code' => $e->getCode()\n ));\n }\n\n //Retorna os dados encontrados\n return json_encode(array(\n 'success' => true,\n 'data' => array($model->toArray()),\n 'total' => 1\n ));\n }",
"public function index()\n {\n $client = new Client();\n $kirim = $client->get(env('API_URL').'/rangkumannilai');\n return $kirim->getBody(); \n }",
"public function index_get($id = 0)\n\t{\n if(!empty($id)){\n $data = $this->db->get_where($_table, [$_id => $id])->row_array();\n }else{\n $data = $this->db->get($_table)->result();\n }\n \n $this->response($data, REST_Controller::HTTP_OK);\n\t}",
"public function get($key){\n\t\treturn $this->callAction('get',array($key));\n\t}",
"public function get($where = array()){\n // yapmak için kullanacagimiz kodlar gelecek\n\n }",
"public function get($id){\n }",
"public function index_get()\n\t{\n\t\ttry{\n $this->checkCanCandidateId();\n\t\t\t$id = $this->getParameterId();\n $filters = array(\n \"id\" => $id,\n\t\t\t\t\"{$this->_candidateIdFkKey}\" =>$this->getCanCandidateId()\n\t\t\t);\n\t\t\t$list = $this->_model->getById($id, $filters);\n if (count($list)==0){\n \tthrow new Exception ('対象が存在していません。', REST_ER_PAGE_NOTFOUND);\n \t}\n\t\t\t$this->response($list);\n\t\t}catch( Exception $e ){\n\t\t\t$message = $e->getMessage();\n\t\t\t$code = $e->getCode();\n\t\t\t$this->error_response($message,$code);\n\t\t}\n\n\t}",
"public function get($parametros){\n //echo var_dump($parametros);\n $this->vigilaModel = new VigilaModel();\n if(!empty($parametros[0])){\n switch($parametros[0]){\n\n case 'getAllVigila':\n return $this->vigilaModel->getAllVigila();\n break;\n\n default:\n return [ \"error\"=>\"No hay parámetros para buscar una solicitud\"];\n break;\n }\n }\n }",
"public function getById() {}",
"public function index_get() {\n\t\t$nim \t = $this->get('nim');\n\t\t$tanggal = '2018-09-05'; //date('Y-m-d'); set date manual\n\n\t\t$data_pilih = $this->db->query('\n\t\t\tSELECT\n\t\t\ttb_matakuliah.matakuliah, tb_jadwal.jdwl_id\n\t\t\tFROM \n\t\t\ttb_matakuliah, tb_jadwal, tb_jdwl_mhs, tb_mahasiswa\n\t\t\tWHERE \n\t\t\ttb_matakuliah.kode_mk = tb_jadwal.kode_mk AND\n\t\t\ttb_jadwal.jdwl_id = tb_jdwl_mhs.jadwal_id AND\n\t\t\ttb_jdwl_mhs.nim = tb_mahasiswa.nim AND\n\t\t\ttb_mahasiswa.nim = \"'.$nim.'\" AND\n\t\t\ttb_jadwal.tanggal = \"'.$tanggal.'\"\n\t\t\t')->result();\n\t\t$this->response( array( 'status'=>200, 'result'=>$data_pilih ) );\n\n\t}",
"public function find_get($id=null){\n\t\t//echo 'usuarioinscrito número ' . $id;\n\t\tif (!$id){\n\t\t\t$this->response(null,400);\n\t\t}\n $curso = $this->cursosmodel->get($id);\n\t\t$usuarioinscrito = $this->usuariosinscritosmodel->get($id);\n if (!is_null($curso)){\n if (!is_null($usuarioinscrito)){\n $this->response(array('response'=> $usuarioinscrito),200);\n }else{\n $this->response(array('response'=>array( )),200);\n }\n }else{\n $this->response(array('error'=>'El curso no existe'),400);\n }\n\t\t\n\t\t\t\n\t}",
"public function get( $id ){}",
"function item_get()\n {\n $key = $this->get('id');\n $result = $this->supplies->get($key);\n if ($result != null)\n $this->response($result, 200);\n else\n $this->response(array('error' => 'Supplies item not found!'), 404);\n }",
"public function index_get()\n\t{\n\t\t$employee = new EmployeeModel;\n\t\t$result_emp =$employee->get_employee();\n\t\t$this->response($result_emp,200);\n\t}",
"public function getTestomonials_get(){\n $user_id=$_GET['user_id'];\n $profile_type=$_GET['profile_type'];\n\t\t$result = $this->dashboard_model->getTestomonials($user_id,$profile_type);\n\t\treturn $this->response($result);\n }",
"public function getAction(){\n if(isset($_GET[\"apikey\"]) && isset($_GET[\"id\"]))\n {\n $api = $this->getRequest()->getParam('apikey');\n \n $select = $this->_model_usuarios->select()\n ->where(\"api_key = ?\", $api); \n \n if ($select->query()->rowCount() == 1){\n $id_espectaculo = $this->getRequest()->getParam('id'); \n $select = $this->_model_espectaculo->select()\n ->where(\"id_espectaculo = ?\", $id_espectaculo); \n \n if($select->query()->rowCount() == 1){\n\n $select = $this->_model_sesion->select()\n ->where(\"id_espectaculo = ?\", $id_espectaculo);\n\n $lista_eventos = $select->query()->fetchAll();\n\n $this->_helper->json($lista_eventos);\n }else{\n $this->_helper->json(\"Error con id\");\n }\n }else{\n $this->_helper->json(\"Error con la apikey\");\n }\n }else{\n $this->_helper->json(\"Falta la apikey\");\n }\n }",
"function GETDataKelas_All(){\r\n\r\n // Perintah Get Data Kelas\r\n return $this->MKelas->GET();\r\n }",
"public function query_get($key) {\n\t\t\treturn \\uri\\query::get($this->object, $key);\n\t\t}",
"function get_provinsi(){\n\t\t$curl = curl_init();\n\n\t\tcurl_setopt_array($curl, array(\n\t\t\tCURLOPT_URL => \"http://api.rajaongkir.com/starter/province?id=12\",\n\t\t\tCURLOPT_RETURNTRANSFER => true,\n\t\t\tCURLOPT_ENCODING => \"\",\n\t\t\tCURLOPT_MAXREDIRS => 10,\n\t\t\tCURLOPT_TIMEOUT => 30,\n\t\t\tCURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n\t\t\tCURLOPT_CUSTOMREQUEST => \"GET\",\n\t\t\tCURLOPT_HTTPHEADER => array(\n\t\t\t\t\"key: 8f22875183c8c65879ef1ed0615d3371\"\n\t\t\t\t),\n\t\t\t));\n\n\t\t$response = curl_exec($curl);\n\t\t$err = curl_error($curl);\n\n\t\tcurl_close($curl);\n\n\t\tif ($err) {\n\t\t\techo \"cURL Error #:\" . $err;\n\t\t} else {\n\t\t\techo $response;\n\t\t}\n\t}",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function get();",
"public function modelFetch(){\n\t\t\t$maphongban = isset($_GET[\"maphongban\"])&&is_numeric($_GET[\"maphongban\"])?$_GET[\"maphongban\"]:0;\n\t\t\t//lay bien ket noi de thao tac csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//thuc hien truy van, tra ket qua ve mot object\n\t\t\t$query = $conn->query(\"select * from phongban where maphongban=$maphongban\");\n\t\t\t//tra ve mot ban ghi\n\t\t\treturn $query->fetch();\n\t\t}",
"public function get( $id );",
"public function getById()\n {\n }",
"public function index_get(){\n //documentación de CodeIngter\n\n $query = $this->db->query('SELECT * FROM `lineas`');\n\n $res = array('error'=> FALSE, 'lineas'=> $query->result_array());\n $this->response($res);\n\n }",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function get($id);",
"public function index()\n {\n try {\n $ruang_kelas = RuangKelas::get();\n \n return apiReturn($ruang_kelas, \"Berhasil menampilkan data ruang kelas\");\n } catch (\\Throwable $th) {\n return apiCatch();\n }\n }",
"public function index_get () {\n\t\tif ( ! $this->get('id') ) { \n \tself::error($this->config->item(\"api_bad_request_code\"));\n return; \n }\n\n $Language = new Language();\n\n if ( ! $Language->Load( $this->get(\"id\") ) ) {\n \tself::error($this->config->item(\"api_not_found_code\"));\n \treturn;\n }\n\n $this->response( $Language->Export() );\n\t}",
"function get(string $id);",
"public function getAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Client_Service_Besttj::getBesttj(intval($id));\n\t\tif(!$info) $this->output(-1, '操作失败.');\n\t\t$this->output(0, '', $info);\n\t}",
"public function preparatoriaOrdenByInstitucion_get()\n {\n if (count($this->get())>1) {\n $response = array(\n \"status\" => \"error\",\n \"status_code\" => 409,\n \"message\" => \"Too many data was sent\",\n \"validations\" =>array(\n \"id\"=>\"send Id (get) to get specific item or empty to get all items \"\n ),\n \"data\"=>null\n );\n }else{\n \n $query = $this->db->query(\"select * from Vw_Prep group by idInstitucion\")->result();\n \n\n if ($query) {\n $response = array(\n \"status\" => \"success\",\n \"status_code\" => 201,\n \"message\" => \"Articulo cargado correctamente\",\n \"validations\" =>null,\n \"data\"=>$query\n );\n }else{\n $response = array(\n \"status\" => \"error\",\n \"status_code\" => 409,\n \"message\" => \"No datos proveidos\",\n \"validations\" =>null,\n \"data\"=>null\n );\n }\n \n \n }\n $this->response($response,200);\n }",
"public function get($params = []);",
"public function fetch_kelompok(){\n $id_jur=$this->input->get('jurusan');\n $act=$this->input->get('act');\n $data=$this->Models->fetch_kelompok($id_jur,$act);\n echo json_encode($data);\n }",
"abstract public function get($id);",
"abstract public function get($id);",
"abstract public function get($id);",
"public function index_get(){\n $rev_aut = $this->rautor_model->get();\n\n $this->response( array( 'revistas-autores' => $rev_aut), 200 );\n\n // Comprobar que la respuesta no sea nulo\n if ( !is_null($rev_aut) ) {\n $this->response( array( 'revistas-autores' => $rev_aut), 200 );\n } else {\n $this->response( array('error' => 'No hay revistas-autores en la base de datos..'), 404 );\n }\n }",
"public function index_get()\n {\n $config = array(\n 'id' => $this->get('id'),\n 'fields' => $this->get('fields'),\n 'type_id' => $this->get('type_id'),\n 'search' => $this->get('search'),\n 'limit' => $this->get('limit'),\n 'per_page' => $this->get('per_page'),\n 'page' => $this->get('page'),\n 'offset' => $this->get('offset'),\n 'order_type' => $this->get('order_type'),\n 'order_col' => $this->get('order_col')\n );\n\n //Validamos los permisos para crear usuarios\n if (!$this->ion_auth->is_admin()) \n {\n $this->response([\n 'status' => FALSE,\n 'message' => 'No tenés permisos'\n ], REST_Controller::HTTP_UNAUTHORIZED);\n }\n \n //Filtered rows\n $rows = $this->Rest_model->get($config);\n //Obtenemos el total\n $total_rows = $this->Rest_model->total();\n //Obtenemos la cuenta del total\n $count_query = $this->Rest_model->get($config, 1); //El 1 representa obtener el total de la query sin limite\n\n //Validamos que exista\n if($this->get('id') && empty($rows))\n {\n //Devolvemos un error en caso de que no exista\n $this->response([\n 'status' => FALSE,\n 'message' => 'El registro no existe'\n ], REST_Controller::HTTP_BAD_REQUEST);\n }\n\n //Traemos propiedades del objeto\n if(!empty($this->get('id')) && !empty($rows))\n {\n //$rows->assign = $this->Rest_model->get_assigned($config);\n }\n\n //Armamos la respuesta\n $response = array(\n 'data' => $rows,\n 'results' => array(\n 'recordsTotal' => $total_rows,\n 'recordsFiltered' => $count_query,\n )\n );\n \n //Si tenemos una respuesta con datos la devolvemos.\n if ($response)\n {\n $this->response($response, REST_Controller::HTTP_OK);\n }\n else\n {\n //Set the response and exit\n $this->response([\n 'status' => FALSE,\n 'message' => 'No se encontraron registros'\n ],REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code\n }\n }",
"public function get($id)\n {\n }",
"public function get($id)\n {\n }",
"public function index_get()\n {\n $maxid = 0;\n $row = $this->db->query('SELECT MAX(id) as `maxid` FROM `tb_surat`')->row();\n if(isset($row)){\n $maxid = $row->maxid + 1;\n $this->response([\n 'success' => false,\n 'message' => 'Data Gagal Dikirim',\n 'data' => $maxid\n ], 200);\n }\n }",
"public function get($key=null){\n\n //get data\n if($key!==null){\n return $this->client->get($key);\n }\n\n return null;\n\n }",
"public function get($status = NULL){\n\n }",
"function get($name) {\r\n\t\treturn $this->_send(array('cmd'=>'get', 'name'=>$name));\r\n\t}",
"public function index()\n {\n // return response()->json(Khoa::get(), 200);\n \n $khoa = Khoa::with('hinhanhkhoa','donvihoptac','nganh.hinhanhnganh','bomon')->get();\n return response()->json($khoa, 200);\n }",
"public function get(string $id);",
"public function show($key)\n {\n //\n $user = User::where('user_key' ,'!=' , $key)->get(['avatar','lastname','name','user_key']);\n\n return Response()->json([\n 'users' => $user,\n ],200);\n }",
"function actionsForGetMethod()\n {\n if (isset($this->id)) { /* If the variable id exists, it request to the model for the specific element */\n $data = $this->api->get($this->id);\n } else { /* If it does not exist, request all the elements */\n $data = $this->api->get();\n }\n\n /* It eliminates the last element of the array $ data, since usually, it usually brings two elements,\n one with the information, and another NULL which is not needed */\n array_pop($data);\n\n if (count($data) == 0) {\n /* If the variable id exists but the array of $ data does not produce a result,\n it means that the element does not exist */\n if (isset($this->id)) {\n $this->print_json(404, \"Not Found\", null);\n } else {\n /* But if the variable id exists and does not bring $ data, since we do not look for a specific\n element, it means that the entity has no elements to show */\n $this->print_json(204, \"Not Content\", null);\n }\n } else {\n $this->print_json(200, \"OK\", $data); /* Print the requested information */\n }\n }",
"public function index()\n {\n $client = new Client(['base_uri' => 'http://127.0.0.1:8000/api/skorpoint']);\n $request = $client->request('GET');\n // $response = json_decode($request->getBody());\n // echo $response[0]->id;\n $response = $request->getBody();\n return $response;\n }",
"public function index()\n {\n return koperasi::with('get_user','get_user_pinjam')->latest()->paginate(5);\n }",
"public function sendGet()\n\t{\n\t\t$ch = curl_init(\"http://localhost/rest/index.php/book\");\n\t\t//a true, obtendremos una respuesta de la url, en otro caso, \n\t\t//true si es correcto, false si no lo es\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t//establecemos el verbo http que queremos utilizar para la petición\n\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n\t\t//obtenemos la respuesta\n\t\t$response = curl_exec($ch);\n\t\t// Se cierra el recurso CURL y se liberan los recursos del sistema\n\t\tcurl_close($ch);\n\t\tif(!$response) {\n\t\t return false;\n\t\t}else{\n\t\t\tvar_dump($response);\n\t\t}\n\t}",
"public function index_get(){\n $response = $this->PersonM->all_person();\n $this->response($response);\n }",
"public function index_get($id = 0)\n\t{\n if(!empty($id)){\n $data = $this->db->get_where(\"mobil\", ['id' => $id])->row_array();\n }else{\n $data = $this->db->get(\"mobil\")->result();\n }\n \n $this->response($data, REST_Controller::HTTP_OK);\n\t}",
"private function GET() {\n global $_GET;\n $getData = array();\n foreach($_GET as $key => $value) {\n $getData[$key] = $value;\n }\n $this -> response[\"response\"] = $getData;\n return;\n }",
"public function executeGetone(sfWebRequest $request){\n $currentPost = Doctrine_Core::getTable('CustomerCategory')->find(136);\n// $this->getResponse()->setHttpHeader('Content-type','application/json');\n\n //hoac bo find(id) +\n// ->createQuery('a')\n// ->where('a.id = ?', $request->getParameter('id'))\n// ->fetchOne()\n\n\n// $q = Doctrine_Core::getTable('CustomerCategory')->createQuery()->where('id = ?', $request->getParameter('id'))->execute();\n $dataArr = [\n 'statusCode' => self::HTTP_OK,\n 'data' => [\n 'id' => $currentPost->id,\n 'name' => $currentPost->name,\n ]\n ];\n\n return $this->renderText(json_encode($dataArr));\n }",
"function _dispen_hari(){\n\t\t$CI =& get_instance();\n\t\t$api_url \t= URL_API_SIA.'sia_sistem/data_view';\n\t\t$parameter = array('api_kode' =>200002, 'api_subkode' => 1, 'api_search' => array());\n\t\t$data \t\t= $CI->s00_lib_api->get_api_jsob($api_url,'POST',$parameter);\n\t\treturn $data[0]->KADALUWARSA_HARI1;\n\t}"
] | [
"0.70211375",
"0.69812393",
"0.6942719",
"0.69262797",
"0.675624",
"0.67075497",
"0.67035294",
"0.66204756",
"0.6586014",
"0.6579268",
"0.6573352",
"0.6528168",
"0.65071625",
"0.64692885",
"0.6461983",
"0.64581776",
"0.64457476",
"0.641772",
"0.64052075",
"0.63913375",
"0.63811153",
"0.6361312",
"0.6325911",
"0.6310138",
"0.62680846",
"0.6263823",
"0.6260827",
"0.6259136",
"0.62585163",
"0.6257179",
"0.6257179",
"0.6257179",
"0.6257179",
"0.6257179",
"0.6257179",
"0.6257179",
"0.6257179",
"0.6257179",
"0.6257179",
"0.6257179",
"0.6257179",
"0.6257179",
"0.6257179",
"0.6257179",
"0.6257179",
"0.6257179",
"0.6257179",
"0.6250586",
"0.62436324",
"0.6227875",
"0.62174946",
"0.6216725",
"0.6216725",
"0.6216725",
"0.6216725",
"0.6216725",
"0.6216725",
"0.6216725",
"0.6216725",
"0.6216725",
"0.6216725",
"0.6216725",
"0.6216725",
"0.6216725",
"0.6216725",
"0.6216725",
"0.6216725",
"0.6216725",
"0.6216725",
"0.6216725",
"0.6216725",
"0.62108046",
"0.62076974",
"0.6201627",
"0.61874336",
"0.6166871",
"0.61661416",
"0.6160543",
"0.61493206",
"0.61493206",
"0.61493206",
"0.6148126",
"0.61402214",
"0.61255383",
"0.61255383",
"0.61174726",
"0.6114263",
"0.610882",
"0.61082727",
"0.6106721",
"0.61005634",
"0.60998654",
"0.60809004",
"0.607892",
"0.60768074",
"0.6075016",
"0.6073877",
"0.60632885",
"0.6051281",
"0.6047516",
"0.6044657"
] | 0.0 | -1 |
Deleting the kameti from the kameti table if the user is admin of the kameti. and there is no auction againest it. | public function deleteKameti($kameti_id, $user_id) {
// Get a MySQL DB connection
$this->conn = $this->dbConnect->connect();
// insert query
$stmt = mysqli_prepare($this->conn, "DELETE FROM $this->tablename WHERE (id=? AND admin_id=?)");
$this->throwExceptionOnError();
mysqli_stmt_bind_param($stmt,'ii', $kameti_id, $user_id);
$this->throwExceptionOnError();
$result = mysqli_stmt_execute($stmt);
$this->throwExceptionOnError();
mysqli_stmt_free_result($stmt);
mysqli_close($this->conn);
// Check for successful deletion
if ($result) {
return TRUE;
}else{
return FALSE;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteuser_vizitki($user_id) {\n\tglobal $database;\n\n\t// DELETE vizitki ENTRIES AND COMMENTS\n\t$database->database_query(\"DELETE FROM se_vizitkientries, se_vizitkicomments USING se_vizitkientries LEFT JOIN se_vizitkicomments ON se_vizitkientries.vizitkientry_id=se_vizitkicomments.vizitkicomment_vizitkientry_id WHERE se_vizitkientries.vizitkientry_user_id='$user_id'\");\n\n\t// DELETE COMMENTS POSTED BY USER\n\t$database->database_query(\"DELETE FROM se_vizitkicomments WHERE vizitkicomment_authoruser_id='$user_id'\");\n\n\t// DELETE STYLE\n\t$database->database_query(\"DELETE FROM se_vizitkistyles WHERE vizitkistyle_user_id='$user_id'\");\n\n}",
"function deleteMe()\n\t\t{\n\t\t\tif(empty($this->id))\n\t\t\t\treturn false;\n\n\t\t\tglobal $wpdb;\n\t\t\t$this->sqlQuery = \"DELETE FROM $wpdb->pmpro_membership_orders WHERE id = '\" . $this->id . \"' LIMIT 1\";\n\t\t\tif($wpdb->query($this->sqlQuery) !== false)\n\t\t\t{\n\t\t\t\tdo_action(\"pmpro_delete_order\", $this->id, $this);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}",
"public function deleteAdmin() {\n\t\t$numRows = $this->db->delete();\n\t\tif($numRows===1) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"public function delete(User $user, Kamar $kamar)\n {\n return ($user->poli != null) && ($user->poli->id_poli == $kamar->ruang->gedung->id_poli);\n }",
"public function deleteAction(){\n //farewell brave knight, your cosmo will stay with us forever...\n $this->getDM()->remove($this->getKnight());\n $this->getDM()->flush();\n //go back to home (indexAction) to show the grid of knights\n $this->redirect()->toRoute(\"home\");\n }",
"function deleteItemFromDB()\n {\n if ($this->isAdmin()) {\n $this->loadThis();\n } else {\n echo $this->user_model->deleteSystemUser($_POST['id']);\n }\n }",
"public function forceDelete(User $user, Kamar $kamar)\n {\n return ($user->poli != null) && ($user->poli->id_poli == $kamar->ruang->gedung->id_poli);\n }",
"function delete_buku_tamu($id_bukutamu){\n $id_bukutamu = array('id_buku_tamu' => $id_bukutamu);\n $this->load->model('fungsi');\n $this->fungsi->Delete('apps_siperat_buku_tamu', $id_bukutamu);\n redirect(base_url('/admin/'),'refresh');\n\t}",
"function hapus_admin($id_admin)\n\t\t{\n\t\t\t$this->db->where('id_admin', $id_admin);\n\t\t\t$this->db->delete('admin');\n\t\t}",
"public function adminDeleteAllByUser($userId)\n\t{\n\t\t// get the user\n\t\t$user = $this->getUser($userId);\n\t\t// get the authkeys for that user\n\t\t$authKeys = $user->authKey()->get();\n\t\t// delete links between the user and any authkeys\n\t\t$user->authKey()->detach();\n\t\t// We need to delete any authkeys that have been detached\n\t\t// and that don't belong to another user\n\t\t$authKeys->each(function($authKey) {\n\t\t\t// If there is no user for the authkey\n\t\t\tif( $authKey->user()->get()->isEmpty() ) {\n\t\t\t\t// soft delete authkey\n\t\t\t\t$authKey->forceDelete();\n\t\t\t}\n\t\t});\n\t\t\n\t\t// return a code 204 header and no content\n\t\treturn $this->setHttpStatusCode('204')->respondWithEmpty();\n\t}",
"function wp_deleted_user($wp_user_id) {\n\t\tglobal $wpdb;\n\t\tif($wpdb->get_var('SELECT wp_user_id FROM '.$this->get_wpdb_prefix().'teachers WHERE wp_user_id = '.esc_sql($wp_user_id))) {\n\t\t\t$wpdb->query('DELETE FROM '.$this->get_wpdb_prefix().'teachers WHERE wp_user_id = '.esc_sql($wp_user_id));\n\t\t}\n\t}",
"protected function deleteAdminUserFixture()\n {\n if ($this->userName) {\n $users = Mage::getModel('admin/user')->getCollection();\n $users->addFieldToFilter('username', array( 'eq' => $this->userName));\n $users->load();\n foreach ( $users as $user ) {\n $user->delete();\n }\n }\n \n if ($this->roleName) {\n $roles = Mage::getModel('api/roles')->getCollection();\n $roles->addFieldToFilter('role_name', array('eq' => $this->roleName));\n $roles->load();\n foreach ( $roles as $role ) {\n $role->delete();\n }\n }\n }",
"public function test_users_destroy_valid_from_admin_removes_from_db(){\n $this->signInAdmin();\n $this->delete(route('users.destroy', ['user' => 5])); \n $this->assertDatabaseMissing('users', ['id' => 5]);\n }",
"public function ukloniKorisnika($idKor){\n $korisnikModel = new KorisnikModel();\n $korisnik = $korisnikModel->find($idKor);\n if($korisnik->tip == 'admin'){\n $this->session->set('porukaGreska','Ne mozete ukloniti drugog administratora!');\n return redirect()->to(site_url(\"Admin/profil/$idKor\"));\n }\n $korisnikModel->delete($idKor);\n \n $ocenioModel = new OcenioModel();\n $ocenioModel->where('idOcenjen',$idKor)->delete();\n \n $objavaModel = new ObjavaModel();\n $objaveZaBrisanje = $objavaModel->where('idKor',$idKor)->findAll();\n \n foreach($objaveZaBrisanje as $objava){\n $komentarModel = new KomentarModel();\n $komentarModel->where('idObj',$objava->idObj)->delete();\n \n $this->db->table('prijavljen')->where('idObj' ,$objava->idObj)->delete();\n $objavaModel->delete($objava->idObj);\n }\n return redirect()->to(site_url(\"Admin/index\"));\n }",
"public function delete(User $user, Appoientment $appoientment)\n {\n return $user->type == User::ADMIN_TYPE;\n }",
"public function brisanjeNalogaU($ucenik){\n\t\t\t\t\n\t\t\t$query = $this->db->get_where('users', array('id' => $ucenik));\n\t\n\t\t\t\t\n\t\n\t\t\tif(empty($query->row_array())){\n\t\t\t\treturn false;\n\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->db->where('id', $ucenik);\t\n\t\t\t\t$this->db->delete('users');\n\t\t\t\t\n\t\t\t\t$this->db->where('id', $ucenik);\n\t\t\t\t$this->db->delete('ucenik');\n\t\t\t\t\n\t\t\t\treturn true;\n\t\t\t\t\n\t\t\t} \n\t\t}",
"function deleteThemengebietes() {\n\t\t$status = $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_topic_detail', 'uid='.intval(t3lib_div::_POST('uid')));\n\t\treturn $status;\n\t}",
"Public Function PermanentDelete()\n\t{\n\t\t$this->_db->delete('bevomedia_user', 'ID = ' . $this->id);\n\t\t$this->_db->delete('bevomedia_user_info', 'ID = ' . $this->id);\n\t}",
"public function delete() {\r\n\r\n if ( ! current_user_can( 'activate_plugins' ) ) {\r\n return;\r\n }\r\n\r\n $this->deleteOrdersTable();\r\n delete_option( 'ce_option' );\r\n delete_option( 'ce_coins_alerts' );\r\n delete_transient( 'ce_flush_rules' );\r\n flush_rewrite_rules();\r\n\r\n }",
"function del($dbconn){\n\n\t\t$query = \"DELETE FROM aikidoka WHERE id = \" . $this->id . \";\";\n\t\t$result = $dbconn->qry($query);\n\t\t\n\t\t/* exams */\n\t\t$query = \"DELETE FROM exams WHERE aikidokafk = \" . $this->id . \";\";\n\t\t$resultinst = $dbconn->qry($query);\n\n\t\t/* exams */\n\t\t$query = \"DELETE FROM attendance WHERE aikidokafk = \" . $this->id . \";\";\n\t\t$resultinst = $dbconn->qry($query);\n\n\t\treturn $result;\n\n\t}",
"public function destroy()\n {\n $userId = Helper::getIdFromUrl('user');\n \n if ((Helper::checkUrlIdAgainstLoginId($userId)) !== 'super-admin') {\n Usermodel::load()->destroy($userId);\n } else { \n View::render('errors/403.view', [\n 'message' => 'You cannot delete yourself!',\n ]);\n }\n }",
"function setDelete(){\n\t\t$msg\t= \"===========\\tELIMINADO LA CUENTA \" . $this->mNumeroCuenta . \"\\r\\n\";\n\t\t$cuenta\t= $this->mNumeroCuenta;\n\t\t$socio\t= $this->mSocioTitular;\n\t\t$xQL\t= new MQL();\n\t\t\t//Cuenta\n\t\t\t$SQLDCuenta \t= \"DELETE FROM captacion_cuentas WHERE numero_cuenta = $cuenta AND numero_socio = $socio \";\n\t\t\t$x = $xQL->setRawQuery($SQLDCuenta);\n\n\t\t\tif ($x[\"stat\"] == false ){\n\t\t\t\t$msg\t.= date(\"H:i:s\") . \"\\tERROR\\t\" . $x[\"error\"] . \"\\r\\n\";\n\t\t\t} else {\n\t\t\t\t$msg\t.= date(\"H:i:s\") . \"\\tSUCESS\\t Eliminando la Cuenta (\" . $x[\"info\"] . \")\\r\\n\";\n\t\t\t}\n\t\t\t//Firma\n\t\t\t/*$SQLDFirma \t= \"DELETE FROM socios_firmas WHERE numero_de_cuenta = $cuenta \";\n\t\t\t$x = my_query($SQLDFirma);\n\n\t\t\tif ($x[\"stat\"] == false ){\n\t\t\t\t$msg\t.= date(\"H:i:s\") . \"\\tERROR\\t\" . $x[\"error\"] . \"\\r\\n\";\n\t\t\t} else {\n\t\t\t\t$msg\t.= date(\"H:i:s\") . \"\\tSUCESS\\tEliminando las Firmas (\" . $x[\"info\"] . \")\\r\\n\";\n\t\t\t}*/\n\t\t\t//sdpm\n\t\t\t$SQLD_SDPM \t= \"DELETE FROM captacion_sdpm_historico WHERE cuenta = $cuenta \";\n\t\t\t$x = $xQL->setRawQuery($SQLD_SDPM);\n\n\t\t\tif ($x[\"stat\"] == false ){\n\t\t\t\t$msg\t.= date(\"H:i:s\") . \"\\tERROR\\t\" . $x[\"error\"] . \"\\r\\n\";\n\t\t\t} else {\n\t\t\t\t$msg\t.= date(\"H:i:s\") . \"\\tSUCESS\\t\" . $x[\"info\"] . \"\\r\\n\";\n\t\t\t}\n\n\t\t\t//Movimientos\n\t\t\t$SQLDOpes\t= \"DELETE FROM operaciones_mvtos WHERE docto_afectado = $cuenta AND socio_afectado = $socio \";\n\t\t\t$x = $xQL->setRawQuery($SQLDOpes);\n\t\t\tif ($x[\"stat\"] == false ){\n\t\t\t\t$msg\t.= date(\"H:i:s\") . \"\\tERROR\\t\" . $x[\"error\"] . \"\\r\\n\";\n\t\t\t} else {\n\t\t\t\t$msg\t.= date(\"H:i:s\") . \"\\tSUCESS\\t\" . $x[\"info\"] . \"\\r\\n\";\n\t\t\t}\n\n\t\t\t$SQLDRecs\t= \"DELETE FROM operaciones_recibos WHERE docto_afectado = $cuenta AND numero_socio = $socio \";\n\t\t\t$x = $xQL->setRawQuery($SQLDRecs);\n\t\t\tif ($x[\"stat\"] == false ){\n\t\t\t\t$msg\t.= date(\"H:i:s\") . \"\\tERROR\\t\" . $x[\"error\"] . \"\\r\\n\";\n\t\t\t} else {\n\t\t\t\t$msg\t.= date(\"H:i:s\") . \"\\tSUCESS\\t\" . $x[\"info\"] . \"\\r\\n\";\n\t\t\t}\n\n\t\t\t//Actualizar el Credito Relacionado\n\t\t\t$SQLDCC\t= \"UPDATE creditos_solicitud\n\t\t\t\t\t\tSET contrato_corriente_relacionado = \" . CTA_GLOBAL_CORRIENTE . \"\n\t\t\t\t\t\tWHERE contrato_corriente_relacionado = $cuenta \";\n\t\t\t$x = $xQL->setRawQuery($SQLDCC);\n\t\t\tif ($x[\"stat\"] == false ){\n\t\t\t\t$msg\t.= date(\"H:i:s\") . \"\\tERROR\\t\" . $x[\"error\"] . \"\\r\\n\";\n\t\t\t} else {\n\t\t\t\t$msg\t.= date(\"H:i:s\") . \"\\tSUCESS\\tActualizando Creditos Relacionados (\" . $x[\"info\"] . \") \\r\\n\";\n\t\t\t}\n\t\treturn $msg;\n\t}",
"public function delete($id_matakuliah)\n\t{\n\t\tif ($this->_access === 'BAAK')\n\t\t{\n\t\t\tif ($this->MatakuliahModel->dataExists('matakuliah', array('id_matakuliah' => $id_matakuliah)) === 1)\n\t\t\t{\n\t\t\t\techo ($this->MatakuliahModel->delete($id_matakuliah) === TRUE ? 'TRUE' : 'FALSE');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo \"ERROR\";\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"!LOGIN\";\n\t\t\tredirect(base_url('/auth/logout'));\n\t\t}\n\t}",
"public function delete(){\n foreach ( $this->playeractiveitems as $playeractiveitem ){\n $playeractiveitem->delete();\n }\n parent::delete();\n }",
"public function delBuku($kd_buku){\n if(!$this->isLoggedIn()){\n return false;\n }\n\n try {\n // Ambil data user dari database\n $query = $this->db->prepare(\"\n DELETE\n FROM\n `sibukudb`.`buku`\n WHERE `kd_buku` = :kd_buku\n \");\n $query->bindParam(\":kd_buku\", $kd_buku);\n $query->execute();\n $this->message = \"!! data berhasil didelete\";\n return true;\n } catch (PDOException $e) {\n echo $e->getMessage();\n return false;\n }\n }",
"public function forceDelete(User $user, Appoientment $appoientment)\n {\n return $user->type == User::ADMIN_TYPE;\n }",
"function hapus_pengguna($id){\n\n $this->db->where('id_user', $id);\n $this->db->delete('tb_user'); \n\n \n \n\t}",
"public function delete() {\n\t\t$deleted = delete_metadata_by_mid( 'user', $this->get_id() );\n\n\t\tforeach ( get_user_meta( $this->get_user()->ID, self::META_KEY ) as $entry ) {\n\t\t\tif ( ! isset( $entry['created_at'] ) || $entry['created_at'] + HOUR_IN_SECONDS < ITSEC_Core::get_current_time_gmt() ) {\n\t\t\t\tdelete_user_meta( $this->get_user()->ID, self::META_KEY, $entry );\n\t\t\t}\n\t\t}\n\n\t\tif ( ! empty( $this->data['log'] ) ) {\n\t\t\tITSEC_Log::add_process_stop( $this->data['log'] );\n\t\t}\n\n\t\treturn $deleted;\n\t}",
"function rimuoviCliente($id_cliente){\nif(trovaCliente($id_cliente)){\n mysql_query(\"DELETE utente,sensore,rilevazione FROM utente\nINNER JOIN sensore ON `utente`.`id_cliente` = `sensore`.`id_clienteFK`\nINNER JOIN rilevazione ON `sensore`.`id_sensore` = `rilevazione`.`id_sensoreFK`\nWHERE id_cliente = '\".$id_cliente.\"' \");\n\nreturn true;\n}\n\nelse {\nreturn false;\n}\n}",
"function Delete()\n\t{\t$sql = \"DELETE FROM adminusers WHERE auserid=\" . (int)$this->userid;\n\t\tif($result = $this->db->Query($sql))\n\t\t{\tif($this->db->AffectedRows())\n\t\t\t{\t$sql = \"DELETE FROM adminuserctry WHERE auserid=\" . (int)$this->userid;\n\t\t\t\t$this->db->Query($sql);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}",
"public function deleteUser() {\r\n\t\tif($this->session->userdata('SISBW')['level'] === 'superAdmin') {\r\n\t\t\t$this->user->deleteUser();\r\n\t\t\tredirect('adminUser');\r\n\t\t} else {\r\n\t\t\tredirect('adminUser');\r\n\t\t}\r\n\r\n\t\treturn true;\r\n\t}",
"public function delete(){\n global $wpdb;\n $table_name = $wpdb->prefix.static::$_table;\n return $wpdb->delete($table_name,[$this->getPk()=>$this->getPkValue()]);\n }",
"public function deleteUser()\n {\n\n $this->displayAllEmployees();\n $id = readline(\"Unesite broj ispred zaposlenika kojeg želite izbrisati :\");\n $check = readline(\"Jeste li sigurni? da/ne: \");\n\n if ($check === 'da'){\n $this->employeeStorage->deleteEmployee($id);\n }\n\n }",
"public function delete(){\n\t\t$kiwi_class = Model_Kiwi::get_classname( get_class($this) ); //returns User for Model_User\n\t\t$pcol = $this->kiwi_primary_key();\n\t\t$pk = $this->$pcol;\n\t\t$mc_key = static::kiwi_mc_key($kiwi_class, $pk);\n\t\tif (empty($pk))\n\t\tthrow new ActiveRecordException(\"Cannot delete, no primary key defined for: \" . $kiwi_class);\n\t\t//FIRST delete the key from memcache\n\t\tstatic::delete_from_memcache($mc_key, $kiwi_class);\n\t\t$return_status = false;\n\t\t//DO NOT DELETE - just soft delete\n\t\tif( Kohana::$config->load('gameconfig.mysql_hard_delete_disabled') &&\n\t\t\t\tin_array( Model_Kiwi::get_table_name($kiwi_class), ActiveRecord\\Model::$soft_delete_enabled_tables)\t){\n\t\t\tKohana::$log->add(Log::DEBUG, \"Mysql Deletes are disabled - using soft delete\");\n\t\t\t$return_status = $this->update_attribute(ActiveRecord\\Model::$soft_deleted_column, 1);\n\t\t}else{\n\t\t\t$return_status = static::table()->delete(array($pcol => $pk));\n\t\t}\n\t\treturn $return_status ;\n\t}",
"public function deleteUser($no_ktp)\n {\n //Untuk mendelete data pembeli di database\n $this->db->table('pembeli')->deleteUser($no_ktp);\n //menampilkan pesan berhasil didelete\n session()->setFlashdata('pesan', 'data berhasil dihapus');\n //pindah page ke tampilUser jika sudah dilakukan\n return redirect()->to(base_url('tampilUser'));\n }",
"final public function delete() {\n global $config; \n # Borrar el elemento de la base de datos\n $this->db->query(\"DELETE FROM guarderia_2 WHERE id_guarderia = $this->id\");\n # Redireccionar a la página principal del controlador\n $this->functions->redir($config['site']['url'] . 'sedes/&success=true');\n }",
"function alertDelete(){\r\n $conn= databaseConnection();\r\n $staff=$_POST[\"staff\"]; \r\n $stocktake= $_POST[\"stocktake\"];\r\n $isLeader= $_POST[\"isLeader\"];\r\n //echo $isLeader;\r\n if($isLeader=='true')\r\n { \r\n $sql = \"UPDATE tblStockTakes\r\n SET SupervisorUserId=null\r\n WHERE StockTakeId='$stocktake';\";\r\n } \r\n else if($isLeader=='false')\r\n { \r\n $sql = \"DELETE FROM tblStockTakeUsers \r\n WHERE StockTakeId ='$stocktake'\r\n AND UserId ='$staff';\";\r\n }\r\n $result = mysqli_query($conn, $sql);\r\n if ($conn->query($sql) === TRUE) {\r\n echo \"Staff Deleted successfully\";\r\n } else {\r\n echo \"Error updating record: \" . $conn->error;\r\n }\r\n mysqli_close($conn);\r\n }",
"public function delete(){\r\n\t\tglobal $DB;\r\n\t\tif($this->id > 0){\r\n\t\t\t$sql = \"UPDATE personalization_orders\r\n\t\t\t\t\tSET\r\n\t\t\t\t\tstatus = 0\r\n\t\t\t\t\tWHERE id = {$this->id}\";\r\n\t\t\tif($DB->no_result($sql)){\r\n\t\t\t\tCachehandler::removeCache(Cachehandler::genKeyword($this));\r\n\t\t\t\tunset($this);\r\n\t\t\t\treturn true;\r\n\t\t\t} else {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function delete()\n\t{\n\t\tif (!$this->auth($_SESSION['leveluser'], 'detailfasilitaskesehatan', 'delete')) {\n\t\t\techo $this->pohtml->error();\n\t\t\texit;\n\t\t}\n\t\tif (!empty($_POST)) {\n\t\t\t$query = $this->podb->deleteFrom('detailfasilitaskesehatan')->where('id', $this->postring->valid($_POST['id'], 'sql'));\n\t\t\t$query->execute();\n\t\t\t$this->poflash->success('Detailfasilitaskesehatan has been successfully deleted', 'admin.php?mod=detailfasilitaskesehatan');\n\t\t}\n\t}",
"public function deleteOrder(){\r\n $cookies = new CookieModel();\r\n $cookie_id = $cookies -> read();\r\n $Form = M('userinfo');\r\n $condition_in['stuid'] = $cookie_id;\r\n $data = $Form->where($condition_in)->find();\r\n if (! $data['manager']) $this->redirect('/');\r\n\r\n $key = $_REQUEST['id'];\r\n //$key = 2;\r\n $condition['id'] = $key;\r\n $form = M(\"orderinfo\");\r\n $data = $form->where($condition)->delete();\r\n $this->redirect('/index.php/Admin/index');\r\n //$this->display();\r\n }",
"public function Delete(){\n $query = \"DELETE FROM user where id=\".$this->id;\n\n $result = $this->dbh->exec($query);\n if ($result) {\n Message::setMessage(\"<div class='yes'>Removed Permanently</div>\");\n } else {\n\n Message::setMessage(\"<div class='no'>Failed to Remove</div>\");\n }\n Utility::redirect(\"volunteers.php\");\n }",
"function hapus_user($id) {\n global $conn;\n \n mysqli_query($conn, \"DELETE FROM admin WHERE id_admin = '$id'\");\n return mysqli_affected_rows($conn);\n }",
"function user_delete( $userID ) {\r\n global $wpdb;\r\n\r\n if ( function_exists('is_multisite' ) && is_multisite() ) {\r\n $blogids = $wpdb->get_col( $wpdb->prepare( \"SELECT blog_id FROM $wpdb->blogs\" ) );\r\n } else {\r\n $blogids[] = 1;\r\n }\r\n\r\n foreach ( $blogids as $blog_id ) {\r\n //Checking DB prefix\r\n if ( 1 < $blog_id )\r\n $tb_prefix = $wpdb->base_prefix . $blog_id . '_';\r\n else\r\n $tb_prefix = $wpdb->base_prefix;\r\n\r\n $member_id = $this->get_members_by_wp_user_id( $userID, $blog_id );\r\n\r\n if ( 0 < $member_id ) {\r\n $wpdb->query( $wpdb->prepare( \"DELETE FROM {$tb_prefix}enewsletter_member_group WHERE member_id = %d\", $member_id ) );\r\n $wpdb->query( $wpdb->prepare( \"DELETE FROM {$tb_prefix}enewsletter_members WHERE member_id = %d\", $member_id ) );\r\n }\r\n }\r\n }",
"public function hapus($user_id){\n $this->db->where('user_id', $user_id);\n $this->db->delete('tbl_users'); // Untuk mengeksekusi perintah delete data\n }",
"function deleteSubAdmin($user_id)\n\t{\n\t\t$this->db->delete('tbl_user', array('user_id' => $user_id));\t\t\n\t\treturn 1;\t\t\n\t}",
"public function destroy(kartustok $kartustok)\n {\n //\n }",
"function dataDeletesk($id) {\n\t\t\t\t$koneksi = $this->koneksi;\n\t\t\t\t// SQL\n\t\t\t\t$query\t\t= \"DELETE FROM sk\n\t\t\t\t\t\t\t WHERE id= '$id'\";\n\t\t\t\t\n\t\t\t\t$sql\t\t= mysqli_query($koneksi,$query);\n\t\t\t\t\n\t\t\t\t// CEK SQL\n\t\t\t\tif($sql == TRUE) {\n\t\t\t\t\treturn TRUE;\n\t\t\t\t} \n\t\t\t\telse {\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\t}",
"function delete() {\n\t\t$sql = \"DELETE FROM \".$this->hr_db.\".hr_amphur\n\t\t\t\tWHERE amph_id=?\";\n\t\t$this->hr->query($sql, array($this->amph_id));\n\t}",
"public function delete(User $user)\n {\n return $user->idquyenhan == 2;\n }",
"public function delete() {\n $stmt = $this->pro->prepare('delete from user where id = :id');\n $stmt->bindValue(':id', $this->id);\n return $stmt->execute() == 1;\n }",
"function deleteUser_PrivilageById($id) {\n\t\t$SQL=\"DELETE FROM user_privilage_tab WHERE id='$id'\";\n\t\t$this->db->executeQuery($SQL);\n\n\t}",
"public function delete_nalvf_by_kam_id($kam_id){\n $this->db->where('kam_id',$kam_id);\n $this->db->delete('tbl_non_al_vehicle_fleet');\n $result = $this->db->affected_rows();\n return $result;\n }",
"public function delete(User $user, MuzaiEducation $muzaiEducation)\n {\n //\n }",
"function delete() {\n\t\t\n\t\t$this->autoRender = false;\n\t\t$this->layout = \"\";\n\t\t\n\t\tConfigure::write('debug', 0);\n\t\t\n\t\t$id = $this->Session->read('Member.memberid');\n\t\t\n\t\t// id 4 means trash\n\t\t\n\t\t$activeid = 4;\n\t\t\t$this->Member->updateAll(array(\n\t\t\t\t'Member.active' => \"'\" . $activeid . \"'\"\n\t\t\t), array(\n\t\t\t\t'Member.id' => $id\n\t\t\t));\n\t\t\n\t\techo \"deleted\";\n\t\t\t\n\t\n\t/*\tif ($id) {\n\t\t\t\n\t\t\t$delete = $this->Member->delete($id);\n\t\t\t\n\t\t \tif ($delete) {\n\t\t\t\t$meta = $this->userMeta->deleteAll(array(\n\t\t\t\t\t'userMeta.member_id' => $id\n\t\t\t\t));\n\t\t\t\t$course = $this->TutCourse->deleteAll(array(\n\t\t\t\t\t'TutCourse.member_id' => $id\n\t\t\t\t));\n\t\t\t\t$event = $this->TutEvent->deleteAll(array(\n\t\t\t\t\t'TutEvent.tutor_id' => $id\n\t\t\t\t));\n\t\t\t\t$image = $this->UserImage->deleteAll(array(\n\t\t\t\t\t'UserImage.user_id' => $id\n\t\t\t\t));\n\t\t\t\t\n\t\t\t}\n\t\t\tif ($meta) {\n\t\t\t\techo \"deleted\";\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} */\n\t\t\n\t\t\n\t\n\t\n\t}",
"public function deleteUser()\n {\n $this->delete();\n }",
"public function forceDelete(User $user)\n {\n return $user->idquyenhan == 2;\n }",
"function small_groups_clean_database( ) {\n\t\t\n\t\tdelete_option( 'small_groups_plugin_version' );\n\t\tdelete_option( 'small_groups_install_date' );\n\n\t\t// plugin specific database entries\n\t\tdelete_option( 'SMALL_GROUPS_posts_to_posts_plugin' );\n\t\t\n\t\tdelete_option( 'SMALL_GROUPS_deactivate_posts_to_posts' );\n\t\t\n\t\t// user specific database entries\n\t\tdelete_user_meta( get_current_user_id( ), 'SMALL_GROUPS_prompt_timeout', $meta_value );\n\t\tdelete_user_meta( get_current_user_id( ), 'SMALL_GROUPS_start_date', $meta_value );\n\t\tdelete_user_meta( get_current_user_id( ), 'SMALL_GROUPS_hide_notice', $meta_value );\n\n}",
"public function hapus()\n {\n $id = $this->input->post('id');\n $gambar = $this->input->post('gambar');\n if ($this->barang_m->delete($id)) {\n // hapus file\n if (!file_exists('./assets/img-user/' . $gambar) || $gambar == '' || unlink('./assets/img-user/' . $gambar)) {\n echo \"true\";\n } else {\n echo \"true-false\";\n }\n $this->cache->delete('homepage');\n $this->cache->delete('list_kategori');\n } else {\n echo \"false\";\n }\n }",
"public function delete_user(Request $request){\n Session::put('menu_item_parent', 'users');\n Session::put('menu_item_child', '');\n Session::put('menu_item_child_child', '');\n\n $user = User::where('userIdx', $request->userIdx)->get()->first();\n if(!$user){\n Session::flash('flash_error', 'Record you are looking to delete is not found or already deleted.');\n return \"success\";\n }\n if($user){\n if($user->userStatus == 1){\n $subusers = User::where('companyIdx', $user->companyIdx)->get();\n if($subusers->count() > 0){\n foreach ($subusers as $user) {\n $provider = Provider::where('userIdx', $user->userIdx)->get()->first();\n if($provider){\n $offer = Offer::where('providerIdx', $provider->providerIdx)->get()->first();\n if($offer){\n $products = OfferProduct::where('offerIdx', $offer->offerIdx)->get();\n foreach ($products as $product) {\n RegionProduct::where('productIdx', $product->productIdx)->delete();\n }\n OfferProduct::where('offerIdx', $offer->offerIdx)->delete();\n\n OfferCountry::where('offerIdx', $offer->offerIdx)->delete();\n OfferSample::where('offerIdx', $offer->offerIdx)->delete();\n OfferTheme::where('offerIdx', $offer->offerIdx)->delete();\n Offer::where('providerIdx', $provider->providerIdx)->delete();\n }\n \n Provider::where('userIdx', $user->userIdx)->delete();\n }\n BillingInfo::where('userIdx', $user->userIdx)->delete();\n User::where('userIdx', $user->userIdx)->delete();\n }\n }\n User::where('userIdx', $request->userIdx)->delete();\n Session::flash('flash_success', 'User has been deleted successfully');\n echo \"success\";\n } else if($user->userStatus == 2){\n try{\n $provider = Provider::where('userIdx', $request->userIdx)->get()->first();\n if($provider){\n $offer = Offer::where('providerIdx', $provider->providerIdx)->get()->first();\n if($offer){\n $products = OfferProduct::where('offerIdx', $offer->offerIdx)->get();\n foreach ($products as $product) {\n RegionProduct::where('productIdx', $product->productIdx)->delete();\n }\n\n OfferProduct::where('offerIdx', $offer->offerIdx)->delete();\n OfferCountry::where('offerIdx', $offer->offerIdx)->delete();\n OfferSample::where('offerIdx', $offer->offerIdx)->delete();\n OfferTheme::where('offerIdx', $offer->offerIdx)->delete();\n Offer::where('providerIdx', $provider->providerIdx)->delete();\n }\n \n Provider::where('userIdx', $request->userIdx)->delete();\n }\n BillingInfo::where('userIdx', $user->userIdx)->delete();\n User::where('userIdx', $request->userIdx)->delete();\n Session::flash('flash_success', 'User has been deleted successfully');\n echo \"success\";\n }catch(Exception $e){\n echo \"fail\";\n }\n }\n }else echo \"fail\";\n }",
"public function hapus($idk)\r\n {\r\n //mengecek level pada session\r\n if ($this->auth->ceklevel() != 'admin') {\r\n header('location:' . url);\r\n }\r\n $this->db->query(\"DELETE FROM tb_kelas WHERE id_kelas='$idk'\");\r\n if (mysqli_affected_rows($this->db) == 1) {\r\n echo \"<script>\r\n alert('Kelas dengan id \" . $idk . \" berhasil dihapus');\r\n document.location.href = 'datakelas.php';\r\n </script>\";\r\n } else {\r\n echo \"<script>\r\n alert('Kelas dengan id \" . $idk . \" gagal dihapus');s\r\n document.location.href = 'datakelas.php';\r\n </script>\";\r\n }\r\n }",
"function kilman_cleanup() {\n global $DB;\n\n // Find surveys that don't have kilmans associated with them.\n $sql = 'SELECT qs.* FROM {kilman_survey} qs '.\n 'LEFT JOIN {kilman} q ON q.sid = qs.id '.\n 'WHERE q.sid IS NULL';\n\n if ($surveys = $DB->get_records_sql($sql)) {\n foreach ($surveys as $survey) {\n kilman_delete_survey($survey->id, 0);\n }\n }\n // Find deleted questions and remove them from database (with their associated choices, etc.).\n return true;\n}",
"function delete_m_jadwal_praktek_antrian($pk)\n {\n $response = $this->db->delete('m_jadwal_praktek_antrian',array('pk'=>$pk));\n if($response)\n {\n return \"m_jadwal_praktek_antrian deleted successfully\";\n }\n else\n {\n return \"Error occuring while deleting m_jadwal_praktek_antrian\";\n }\n }",
"function delete_(){\r\nglobal $mod_id;\r\nglobal $db;\r\n\r\n$sql =\"DELETE \";\r\n$sql .=\"FROM tbl_bhi \";\r\n$sql .=\"WHERE kode_bhi= '$_GET[kode_bhi]' \";\r\n\r\n$sqlresult = $db->Execute($sql);\r\n\r\n$user_id = base64_decode($_SESSION['UID']);\r\n $ip_now = $_SERVER['REMOTE_ADDR'];\r\n $sql2=\"INSERT INTO tbl_log (url, waktu, module, user_id ) VALUES ('$ip_now',now(),'Hapus data >> master BHI','$user_id') \";\r\n $db->Execute($sql2);\r\n}",
"function delete(){\r\n\t\tglobal $wpdb;\r\n\t\t$sql = $wpdb->prepare(\"DELETE FROM \". $wpdb->prefix.EM_BOOKINGS_TABLE . \" WHERE booking_id=%d\", $this->id);\r\n\t\treturn ( $wpdb->query( $sql ) !== false );\r\n\t}",
"public function delete(User $user, Jadwal $jadwal)\n {\n //\n }",
"public function delKate($id){\n\t\t$this->db->delete('kategori', array(\"idkategori\" => $id));\n\t}",
"public function delete($kolom, $isi)\n {\n $this->db->where($kolom,$isi)->delete($this->table);\n return true;\n }",
"function slettDeltagelser($aktivitet)\n{\n if (eksistererAktivitet($aktivitet)) {\n $delta = Deltagelse::where(\"Aktivitet\", \"=\", $aktivitet);\n $delta->delete();\n\n return true;\n }\n return false;\n}",
"function deleteUnsaveNode()\n {\n //vymaze az po 2 hodinach ak sa nezmeni stav\n $list = $this->getFluent()->where(\"status = 'not_in_system' AND add_date < ( NOW() - 60*2 )\")->fetchAll();\n\n if (!empty($list)) {\n\n foreach ($list as $l) {\n\n $this->delete($l['id_node']);\n\n $module_name = $this->context->getService('ModuleContainer')->fetch($l['id_type_module'])->service_name;\n\n $this->context->getService($module_name)->delete($l['id_node']);\n }\n }\n }",
"public function adminRemove()\r\n\t{\r\n\t\treturn;\r\n\t}",
"public function test_users_destroy_valid_from_leader_removes_from_db(){\n $this->signInLeader();\n $this->delete(route('users.destroy', ['user' => 5])); \n $this->assertDatabaseMissing('users', ['id' => 5]);\n }",
"function delete()\n {\n $GLOBALS['DB']->exec(\"DELETE FROM stores WHERE id = {$this->getId()};\");\n $GLOBALS['DB']->exec(\"DELETE FROM stores_brands WHERE store_id = {$this->getId()};\");\n }",
"function delete()\n {\n $this->dbInit();\n \n $this->Database->query( \"DELETE FROM eZTrade_OrderOptionValue WHERE OrderItemID='$this->ID'\" );\n\n $this->Database->query( \"DELETE FROM eZTrade_OrderItem WHERE ID='$this->ID'\" );\n \n return true;\n }",
"function delete() {\n db_begin_work();\n $delete = parent::delete();\n if($delete && !is_error($delete)) {\n unlink($this->getAvatarPath());\n \tunlink($this->getAvatarPath(true));\n\n ProjectUsers::deleteByUser($this);\n Assignments::deleteByUser($this);\n Subscriptions::deleteByUser($this);\n StarredObjects::deleteByUser($this);\n PinnedProjects::deleteByUser($this);\n UserConfigOptions::deleteByUser($this);\n Reminders::deleteByUser($this);\n\n search_index_remove($this->getId(), 'User');\n\n $cleanup = array();\n event_trigger('on_user_cleanup', array(&$cleanup));\n\n if(is_foreachable($cleanup)) {\n foreach($cleanup as $table_name => $fields) {\n foreach($fields as $field) {\n $condition = '';\n if(is_array($field)) {\n $id_field = array_var($field, 'id');\n $name_field = array_var($field, 'name');\n $email_field = array_var($field, 'email');\n $condition = array_var($field, 'condition');\n } else {\n $id_field = $field . '_id';\n $name_field = $field . '_name';\n $email_field = $field . '_email';\n } // if\n\n if($condition) {\n db_execute('UPDATE ' . TABLE_PREFIX . \"$table_name SET $id_field = 0, $name_field = ?, $email_field = ? WHERE $id_field = ? AND $condition\", $this->getName(), $this->getEmail(), $this->getId());\n } else {\n db_execute('UPDATE ' . TABLE_PREFIX . \"$table_name SET $id_field = 0, $name_field = ?, $email_field = ? WHERE $id_field = ?\", $this->getName(), $this->getEmail(), $this->getId());\n } // if\n } // foreach\n } // foreach\n } // if\n\n db_commit();\n return true;\n } else {\n db_rollback();\n return $delete;\n } // if\n }",
"function remove_tmpuser($lrdata) {\n tep_db_query(\"delete from \" . TABLE_CONFIGURATION . \" where configuration_key = '\".$lrdata['session'].\"'\");\n }",
"public function actionClean()\n {\n $old_time = date('Y-m-d H:m:s', strtotime('-1 hour'));\n $users = User::find()\n ->where(['confirm' => 0])\n ->andWhere(['<','create_date', $old_time])\n ->each();\n\n\n foreach($users as $user) {\n\n\n $user->delete();\n\n }\n\n return ExitCode::OK;\n }",
"public function deleteAction() {\n\t\t $userId = $this->_request->getParam('userId');\n\t\t if($userId){\n\t\t $model_lucky = new Model_Lucky();\n\t\t $model_lucky->delete_where(array('user_id' => $userId));\n\t\t \n\t\t$this->_helper->json(1);\n\t\t}\n\t \n }",
"public function forceDelete(User $user, MuzaiEducation $muzaiEducation)\n {\n //\n }",
"function instance_delete() {\n global $COURSE, $DB;\n\n // we seek the DB to find if the block's instance exists\n $result = $DB->get_record('block_group_choice', array('course_id' => $COURSE->id, 'instance_id' => $this->instance->id));\n if($result) { // if the block's instance has been found ...\n // ... the block's instance row is deleted from the DB table \n $DB->delete_records_list('block_group_choice','id', array($result->id));\n }\n return true;\n }",
"public function EliminarDetallesVentas()\n{\n\tif($_SESSION['acceso'] == \"administrador\") {\n\n\t\tself::SetNames();\n\n\t\t$sql = \" select * from detalleventas where codventa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(strip_tags($_GET[\"codventa\"])) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num > 1)\n\t\t{\n\n\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t$stmt = $this->dbh->prepare($sql2);\n\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t$num = $stmt->rowCount();\n\n\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t$existenciadb = $p[0][\"existencia\"];\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t$sql = \" update productos set \"\n\t.\" existencia = ? \"\n\t.\" where \"\n\t.\" codproducto = ?;\n\t\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindParam(1, $existencia);\n\t$stmt->bindParam(2, $codproducto);\n\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t$existencia = $existenciadb + $cantventa;\n\t$stmt->execute();\n\n\t$sql = \" delete from detalleventas where coddetalleventa = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindParam(1,$coddetalleventa);\n\t$coddetalleventa = base64_decode($_GET[\"coddetalleventa\"]);\n\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->bindParam(1,$codventa);\n\t$stmt->bindParam(2,$codproducto);\n\t$codventa = strip_tags(strip_tags($_GET[\"codventa\"]));\n\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t$stmt->execute();\n\n################## CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS #################\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($codproducto));\n\t\t$num = $stmt->rowCount();\n if($num>0) {\n\n$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto = '\".$codproducto.\"'\";\n\n\t$array=array();\n\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t$this->p[] = $row;\n\n\t\t$codproducto = $row['codproducto'];\n\t\t$codingrediente = $row['codingrediente'];\n\t\t$cantracion = $row['cantracion'];\n\t\t$cantingrediente = $row['cantingrediente'];\n\t\t$costoingrediente = $row['costoingrediente'];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codproducto = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codventa);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$stmt->bindParam(3,$codingrediente);\n\t\t$codventa = strip_tags(strip_tags($_GET[\"codventa\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$codingrediente = strip_tags($codingrediente);\n\t\t$stmt->execute();\n\n\t\t$update = \" update ingredientes set \"\n\t\t.\" cantingrediente = ? \"\n\t\t.\" where \"\n\t\t.\" codingrediente = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($update);\n\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t$racion = rount($cantracion*$cantventa,2);\n\t\t$cantidadracion = rount($cantingrediente+$racion,2);\n\t\t$stmt->execute();\n\n\t\t }\n}\n############ FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS REGISTRADOS ##############\n\n\t$sql4 = \"select * from ventas where codventa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql4);\n\t\t$stmt->execute( array(strip_tags($_GET[\"codventa\"])) );\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$paea[] = $row;\n\t\t}\n\t\t$subtotalivasive = $paea[0][\"subtotalivasive\"];\n\t\t$subtotalivanove = $paea[0][\"subtotalivanove\"];\n\t\t$iva = $paea[0][\"ivave\"]/100;\n\t\t$descuento = $paea[0][\"descuentove\"]/100;\n\t\t$totalivave = $paea[0][\"totalivave\"];\n\t\t$totaldescuentove = $paea[0][\"totaldescuentove\"];\n\t\t$totaldb = $paea[0][\"totalpago\"];\n\t\t$montopagado = $paea[0][\"montopagado\"];\n\t\t\t\n\t\t\n$sql3 = \"select sum(importe) as importe, sum(importe2) as importe2, sum(preciocompra) as preciocompra from detalleventas where codventa = ? and ivaproducto = 'SI'\";\n\t\t$stmt = $this->dbh->prepare($sql3);\n\t\t$stmt->execute( array(strip_tags($_GET[\"codventa\"])));\n\t\t$num = $stmt->rowCount();\n\t\t \n\t\t if($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$pae[] = $row;\n\t\t\t}\n\t\t$preciocompraiva = ($pae[0][\"preciocompra\"]== \"\" ? \"0\" : $pae[0][\"preciocompra\"]);\n\t\t$importeivasi = ($pae[0][\"importe\"]== \"\" ? \"0\" : $pae[0][\"importe\"]);\n\t\t$importe2si = ($pae[0][\"importe2\"]== \"\" ? \"0\" : $pae[0][\"importe2\"]);\n\t\n$sql5 = \"select sum(importe) as importe, sum(importe2) as importe2, sum(preciocompra) as preciocompra from detalleventas where codventa = ? and ivaproducto = 'NO'\";\n\t\t$stmt = $this->dbh->prepare($sql5);\n\t\t$stmt->execute( array(strip_tags($_GET[\"codventa\"])));\n\t\t$num = $stmt->rowCount();\n\t\t \n\t\t if($roww = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$p[] = $roww;\n\t\t\t}\n\t\t$preciocompra = ($roww[\"preciocompra\"]== \"\" ? \"0\" : $roww[\"preciocompra\"]);\n\t\t$importeivano = ($roww[\"importe\"]== \"\" ? \"0\" : $roww[\"importe\"]);\n\t\t$importe2 = ($roww[\"importe2\"]== \"\" ? \"0\" : $roww[\"importe2\"]);\n\t\t\nif(base64_decode($_GET[\"ivaproducto\"])==\"SI\"){\t\n\n\t\t$sql = \" update ventas set \"\n\t\t\t .\" subtotalivasive = ?, \"\n\t\t\t .\" totalivave = ?, \"\n\t\t\t .\" totaldescuentove = ?, \"\n\t\t\t .\" totalpago= ?, \"\n\t\t\t .\" montodevuelto= ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codventa = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $subtotal);\n\t\t$stmt->bindParam(2, $totaliva);\n\t\t$stmt->bindParam(3, $totaldescuentove);\n\t\t$stmt->bindParam(4, $totalpago);\n\t\t$stmt->bindParam(5, $devuelto);\n\t\t$stmt->bindParam(6, $codventa);\n\t\t\n\t\t$subtotal= strip_tags($importeivasi);\n $totaliva= rount($subtotal*$iva,2);\n\t\t$tot= rount($subtotal+$subtotalivanove+$totaliva,2);\n\t\t$totaldescuentove= rount($tot*$descuento,2);\n\t\t$totalpago= rount($tot-$totaldescuentove,2);\n\t\t$devuelto= ($montopagado== \"0.00\" ? \"0\" : rount($montopagado-$totalpago,2));\n\t\t$codventa = strip_tags($_GET[\"codventa\"]);\n\t\t$stmt->execute();\n\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\nif (base64_decode($_GET[\"tipopagove\"])==\"CONTADO\"){\n\n$sql = \"select ingresos from arqueocaja where codcaja = '\".strip_tags($_GET[\"codcaja\"]).\"' and statusarqueo = '1'\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\t$ingreso = ($row['ingresos']== \"\" ? \"0.00\" : $row['ingresos']);\n\n\t\t$sql = \" update arqueocaja set \"\n\t\t.\" ingresos = ? \"\n\t\t.\" where \"\n\t\t.\" codcaja = ? and statusarqueo = '1';\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $txtTotal);\n\t\t$stmt->bindParam(2, $codcaja);\n\n\t\t$calculo=rount($totaldb-$totalpago,2);\n\t\t$txtTotal = rount($ingreso-$calculo,2);\n\t\t$codcaja = strip_tags($_GET[\"codcaja\"]);\n\t\t$stmt->execute();\n\t}\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\n\t\t\n\t\t } else {\n\n $sql = \" update ventas set \"\n\t\t\t .\" subtotalivanove = ?, \"\n\t\t\t .\" totaldescuentove = ?, \"\n\t\t\t .\" totalpago= ?, \"\n\t\t\t .\" montodevuelto= ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codventa = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $subtotal);\n\t\t$stmt->bindParam(2, $totaldescuentove);\n\t\t$stmt->bindParam(3, $totalpago);\n\t\t$stmt->bindParam(4, $devuelto);\n\t\t$stmt->bindParam(5, $codventa);\n\t\t\n\t\t$subtotal= strip_tags($importeivano);\n\t\t$tot= rount($subtotal+$subtotalivasive+$totalivave,2);\n\t\t$totaldescuentove= rount($tot*$descuento,2);\n\t\t$totalpago= rount($tot-$totaldescuentove,2);\n\t\t$devuelto= ($montopagado== \"0.00\" ? \"0\" : rount($montopagado-$totalpago,2));\n\t\t$codventa = strip_tags($_GET[\"codventa\"]);\n\t\t$stmt->execute();\n\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\nif (base64_decode($_GET[\"tipopagove\"])==\"CONTADO\"){\n\n$sql = \"select ingresos from arqueocaja where codcaja = '\".strip_tags($_GET[\"codcaja\"]).\"' and statusarqueo = '1'\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\t$ingreso = ($row['ingresos']== \"\" ? \"0.00\" : $row['ingresos']);\n\n\t\t$sql = \" update arqueocaja set \"\n\t\t.\" ingresos = ? \"\n\t\t.\" where \"\n\t\t.\" codcaja = ? and statusarqueo = '1';\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $txtTotal);\n\t\t$stmt->bindParam(2, $codcaja);\n\n\t\t$calculo=rount($totaldb-$totalpago,2);\n\t\t$txtTotal = rount($ingreso-$calculo,2);\n\t\t$codcaja = strip_tags($_GET[\"codcaja\"]);\n\t\t$stmt->execute();\n\t}\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\n\t\t\n\t } \n\necho \"<div class='alert alert-info'>\";\necho \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>\";\necho \"<center><span class='fa fa-check-square-o'></span> EL DETALLE DE VENTA DE PRODUCTO FUE ELIMINADO EXITOSAMENTE </center>\";\necho \"</div>\";\nexit;\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t\t$num = $stmt->rowCount();\n\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$p[] = $row;\n\t\t\t}\n\t\t\t$existenciadb = $p[0][\"existencia\"];\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t\t$sql = \" update productos set \"\n\t\t\t.\" existencia = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codproducto = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $existencia);\n\t\t\t$stmt->bindParam(2, $codproducto);\n\t\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t\t$existencia = $existenciadb + $cantventa;\n\t\t\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$codventa);\n\t\t\t$stmt->bindParam(2,$codproducto);\n\t\t\t$codventa = strip_tags(strip_tags($_GET[\"codventa\"]));\n\t\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t\t$stmt->execute();\n\n\n################## CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS #######################\n$sql = \"select * from productosvsingredientes where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($codproducto));\n\t\t$num = $stmt->rowCount();\nif($num>0) {\n\n\n\t$sql = \"select * from productosvsingredientes LEFT JOIN ingredientes ON productosvsingredientes.codingrediente = ingredientes.codingrediente where productosvsingredientes.codproducto = '\".$codproducto.\"'\";\n\n\t$array=array();\n\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\n\t\t$codproducto = $row['codproducto'];\n\t\t$codingrediente = $row['codingrediente'];\n\t\t$cantracion = $row['cantracion'];\n\t\t$cantingrediente = $row['cantingrediente'];\n\t\t$costoingrediente = $row['costoingrediente'];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codproducto = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codventa);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$stmt->bindParam(3,$codingrediente);\n\t\t$codventa = strip_tags(strip_tags($_GET[\"codventa\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$codingrediente = strip_tags($codingrediente);\n\t\t$stmt->execute();\n\n\n\t\t$update = \" update ingredientes set \"\n\t\t.\" cantingrediente = ? \"\n\t\t.\" where \"\n\t\t.\" codingrediente = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($update);\n\t\t$stmt->bindParam(1, $cantidadracion);\n\t\t$stmt->bindParam(2, $codingrediente);\n\n\t\t$cantventa = strip_tags(base64_decode($_GET[\"cantventa\"]));\n\t\t$racion = rount($cantracion*$cantventa,2);\n\t\t$cantidadracion = rount($cantingrediente+$racion,2);\n\t\t$stmt->execute();\n\n\n\t\t }\n\n}\n################### FIN DE CONSULTO LA TABLA PARA VERIFICAR SI EXISTEN PRODUCTOS ###################\n\n\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\n\tif (base64_decode($_GET[\"tipopagove\"])==\"CONTADO\"){\n\n\t\t$sql4 = \"select * from ventas where codventa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql4);\n\t\t$stmt->execute( array(strip_tags($_GET[\"codventa\"])) );\n\t\t$num = $stmt->rowCount();\n\n\t\t\tif($roww = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$paea[] = $roww;\n\t\t\t}\n\t\t$totaldb = $roww[\"totalpago\"];\n\n\t\t$sql = \"select ingresos from arqueocaja where codcaja = '\".strip_tags($_GET[\"codcaja\"]).\"' and statusarqueo = '1'\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\tif (isset($row['ingresos'])) { $ingreso = $row['ingresos']; } else { $ingreso ='0.00'; }\n\t\t//$ingreso = $row['ingresos'];\n\n\t\t$sql = \" update arqueocaja set \"\n\t\t.\" ingresos = ? \"\n\t\t.\" where \"\n\t\t.\" codcaja = ? and statusarqueo = '1';\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $txtTotal);\n\t\t$stmt->bindParam(2, $codcaja);\n\n\t\t$txtTotal = rount($ingreso-$totaldb,2);\n\t\t$codcaja = strip_tags($_GET[\"codcaja\"]);\n\t\t$stmt->execute();\n\t}\n#################### AQUI AGREGAMOS EL INGRESO A ARQUEO DE CAJA ####################\n\n#################### AQUI ACTUALIZAMOS EL STATUS DE MESA ####################\n\t\t$sql = \" update mesas set \"\n\t\t.\" statusmesa = ? \"\n\t\t.\" where \"\n\t\t.\" codmesa = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $statusmesa);\n\t\t$stmt->bindParam(2, $codmesa);\n\n\t\t$statusmesa = strip_tags('0');\n\t\t$codmesa = base64_decode($_GET[\"codmesa\"]);\n\t\t$stmt->execute();\n#################### AQUI ACTUALIZAMOS EL STATUS DE MESA ####################\n\n\t\t$sql = \" delete from ventas where codventa = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codventa);\n\t\t$codventa = strip_tags($_GET[\"codventa\"]);\n\t\t$stmt->execute();\n\n\t\t$sql = \" delete from detalleventas where coddetalleventa = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$coddetalleventa);\n\t\t$coddetalleventa = base64_decode($_GET[\"coddetalleventa\"]);\n\t\t$stmt->execute();\n\n\techo \"<div class='alert alert-info'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>\";\n\techo \"<center><span class='fa fa-check-square-o'></span> EL DETALLE DE VENTA DE PRODUCTO FUE ELIMINADO EXITOSAMENTE </center>\";\n\techo \"</div>\";\n\texit;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\techo \"<div class='alert alert-info'>\";\n\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×</button>\";\n\techo \"<center><span class='fa fa-check-square-o'></span> USTED NO PUEDE ELIMINAR DETALLES EN VENTAS, NO ERES EL ADMINISTRADOR DEL SISTEMA</center>\";\n\techo \"</div>\";\n\texit;\n\t\t}\n\t}",
"public function delete() {\n $conexion = StorianDB::connectDB();\n $borrado = \"DELETE FROM cuento WHERE id=\\\"\".$this->id.\"\\\"\";\n $conexion->exec($borrado);\n }",
"function del($id) {\n\t\t\t$this->save(array('id'=>$id,'deleted'=>1));\n\t\t\t\n\t\t\t//*** set the deleted flag on all auctions using this product\n\t\t\t$auctions=$this->Auction->find('all', array('conditions'=>array('product_id'=>$id)));\n\t\t\tforeach ($auctions as $auction) {\n\t\t\t\t$auction['Auction']['deleted']=1;\n\t\t\t\t$this->Auction->create();\n\t\t\t\t$this->Auction->save($auction);\n\t\t\t}\n\t\t\treturn true;\n\t\t}",
"public function delete($admin) {\n //$categorie = Category::where('job_cat_id','=',$category)->first();\n Admin::where('id', $admin)->delete();\n // $categorie->delete();\n return redirect()->route('Manage_Admins');\n }",
"public function delete() {\n\n if (!$this->isUsed()) {\n // Database deletion\n $result = Db::getInstance()->delete($this->def['table'], '`' . $this->def['primary'] . '` = ' . (int) $this->id);\n\n if (!$result) {\n return false;\n }\n\n // Database deletion for multilingual fields related to the object\n\n if (!empty($this->def['multilang'])) {\n Db::getInstance()->delete(bqSQL($this->def['table']) . '_lang', '`' . $this->def['primary'] . '` = ' . (int) $this->id);\n }\n\n return $result;\n } else {\n return false;\n }\n\n }",
"function deleteTeachAcc($u_id, $merch_id){\r\n\tglobal $dbc;\r\n\t\r\n\t$query = 'DELETE FROM teach_req '.\r\n\t\t\t 'WHERE u_id = \\''. $u_id .'\\' '.\r\n\t\t\t 'AND merch_id = \\''. $merch_id .'\\';';\r\n\t\r\n\t$result = mysqli_query($dbc, $query);\r\n\tif(!$result){\r\n\t\tdie('Error - '. mysqli_errno($dbc));\r\n\t}\r\n\t\r\n}",
"public static function remove() {\n if ($u = static::check_record_existence()) {\n if ($u->remove())\n flash('Usuário deletado com sucesso.');\n else\n flash('Algo ocorreu errado. Tente novamente mais tarde.', 'error');\n }\n\n go_paginate();\n }",
"public function delExpApp($username)\n { \n $values=array();\n $dateNow=date('Y-m-d');\n $timeNow=date('H:i:s');\n $sqlDel=\"DELETE FROM appointment WHERE (username = '\".$username.\"') AND ((appointment_date < '\".$dateNow.\"') OR (appointment_date < '\".$dateNow.\"' AND appointment_time<'\".$timeNow.\"'))\";\n $this->execute($sqlDel,$values);\n }",
"public function beforeDelete()\n\t{\n\t\t foreach ($this->towns as $towns){\n\t\t \t$towns->delete();\n\t\t }\n\t}",
"public function deleteUsuario(){\n $conexion = new Database();\n\t\tif ($this->codigo){\n $sql = sprintf('DELETE FROM agenda_usuario WHERE usuario_id = %d',\n $this->codigo);\n $conexion->exec( $sql );\n }\n }",
"public function test_users_destroy_admin_403(){\n $this->signInUser();\n $response = $this->delete(route('users.destroy', ['user' => 1]));\n $response->assertStatus(403);\n }",
"public function userDeleted();",
"public function delete(User $user, KitchenExportColumn $kitchenExportColumn) {\n\t\treturn $user->user_type == Admin::class;\n\n\t}",
"public function hapusKuis(Request $request){\n if($request->ajax()){\n \n $kuis = Kuis::findOrFail($request->id);\n $countSoal = $kuis->soal->count();\n if($countSoal > 0){ //there at least 1 soal, the quiz should not be able to be deleted.\n \n return response(\"$kuis->title tidak bisa dihapus, karena terdapat soal dalam kuis\");\n }\n else{\n\n $kuis->delete();\n return response(\"deleted\");\n }\n }\n else{\n return response(\"not ajax\");\n }\n }",
"public function delete () {\n $this->db->delete('emprestimos', array('id_emprestimo' => $this->id_emprestimo));\n }",
"public function delete() {\n $this->isdeleted = 1;\n $this->deleteduser = \\Yii::$app->user->getId();\n $this->deletedtime = date(\"Y-m-d H:i:s\");\n \n return parent::update(FALSE, ['isdeleted', 'deletedtime', 'deleteduser']);\n }",
"function DELETEDataKelas ($id_kelas){\r\n\r\n //Perintah Delete Data Siswa\r\n $this->MKelas->DELETE($id_kelas);\r\n }",
"public function deleteUser(){\n\t\t$sql = \"SELECT COUNT(aid) AS theCount FROM administrator where uid=:uid\";\n\n\t\tif($stmt = $this->_db->prepare($sql)){\n\t\t\t$stmt->bindParam(\":uid\", $_SESSION['UID'], PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t\t$row = $stmt->fetch();\n\t\t\tif($row['theCount']==0){\n\t\t\t\treturn \"<h2> Error </h2>\" . \n\t\t\t\t\t\"<p> Only administrators can do this. </p>\";\n\t\t\t}\n\t\t\t$stmt ->closeCursor();\n\t\t}\n\t\telse{\n\t\t\treturn \"Something went wrong checking the admin table.\";\n\t\t}\n\t\t\n\t\t//TODO: send the deleted user an email telling them they have been deleted\n\t\t\n\t\t$sql = \"DELETE FROM user WHERE uid=:uid\";\n\t\tif($stmt = $this->_db->prepare($sql)){\n\t\t\t$stmt->bindParam(\":uid\", $_GET['u'], PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t}\n\t\telse{\n\t\t\treturn \"Something went wrong deleting the user.\";\n\t\t}\n\n\t\treturn \"done\";\n\t}",
"function index_delete() {\n $id = $this->delete('id');\n $id_pemesanan = $this->delete('id_pemesanan');\n $id_komplain_nonmarket = $this->delete('id_komplain_nonmarket');\n $id_komplain = $this->delete('id_komplain');\n $id_sp = $this->delete('id_sp');\n $id_pelanggan = $this->delete('id_pelanggan');\n $id_pemasukan = $this->delete('id_pemasukan');\n $id_SKP = $this->delete('id_SKP');\n $idTagihan = $this->delete('idTagihan');\n $idKategori = $this->delete('idKategori');\n $idSupplier = $this->delete('idSupplier');\n $idBarang = $this->delete('idBarang');\n $id_about = $this->delete('id_about');\n $id_article = $this->delete('id_article');\n $id_banner = $this->delete('id_banner');\n $id_pegawai = $this->delete('idpegawai');\n $id_absen = $this->delete('id_absen');\n $id_status = $this->delete('id_status');\n $id_karyawan = $this->delete('id_karyawan');\n $id_sdm = $this->delete('id_sdm');\n\n if ($id != '') {\n $this->db->where('id', $id);\n $delete = $this->db->delete('login');\n } elseif ($id_pemesanan != '') {\n $this->db->where('id_pemesanan', $id_pemesanan);\n $delete = $this->db->delete('pemesanan');\n } elseif ($id_komplain_nonmarket != '') {\n $this->db->where('id_komplain_nonmarket', $id_komplain_nonmarket);\n $delete = $this->db->delete('komplain_nonmarket');\n } elseif ($id_komplain != '') {\n $this->db->where('id_komplain', $id_komplain);\n $delete = $this->db->delete('komplain');\n } elseif ($id_sp != '') {\n $this->db->where('id_sp', $id_sp);\n $delete = $this->db->delete('status_pemasangan');\n } elseif ($id_pelanggan != '') {\n $this->db->where('id_pelanggan', $id_pelanggan);\n $delete = $this->db->delete('pelanggan');\n } elseif ($id_pemasukan != '') {\n $this->db->where('id_pemasukan', $id_pemasukan);\n $delete = $this->db->delete('finance');\n } elseif ($id_SKP != '') {\n $this->db->where('id_SKP', $id_SKP);\n $delete = $this->db->delete('skp');\n } elseif ($idTagihan != '') {\n $this->db->where('idTagihan', $idTagihan);\n $delete = $this->db->delete('tagihan');\n } elseif ($idKategori != '') {\n $this->db->where('idKategori', $idKategori);\n $delete = $this->db->delete('kategori');\n } elseif ($idSupplier != '') {\n $this->db->where('idSupplier', $idSupplier);\n $delete = $this->db->delete('supplier');\n } elseif ($idBarang != '') {\n $this->db->where('idBarang', $idBarang);\n $delete = $this->db->delete('inventory');\n } elseif ($id_about != '') {\n $this->db->where('id_about', $id_about);\n $delete = $this->db->delete('about');\n } elseif ($id_article != '') {\n $this->db->where('id_article', $id_article);\n $delete = $this->db->delete('article');\n } elseif ($id_banner != '') {\n $this->db->where('id_banner', $id_banner);\n $delete = $this->db->delete('banner');\n } elseif ($id_pegawai != '') {\n $this->db->where('idpegawai', $id_pegawai);\n $delete = $this->db->delete('pegawai');\n } elseif ($id_absen != '') {\n $this->db->where('id_absen', $id_absen);\n $delete = $this->db->delete('absensi');\n } elseif ($id_status != '') {\n $this->db->where('id_status', $id_status);\n $delete = $this->db->delete('status_karyawan');\n } elseif ($id_karyawan != '') {\n $this->db->where('id_karyawan', $id_karyawan);\n $delete = $this->db->delete('karyawan');\n } elseif ($id_sdm != '') {\n $this->db->where('id_sdm', $id_sdm);\n $delete = $this->db->delete('sdm');\n }\n if ($delete) {\n $this->response(array('status' => 'success'), 201);\n } else {\n $this->response(array('status' => 'fail', 502));\n }\n }",
"function delete_siswa_by_rombel($id_kelas)\n {\n $this->db->where('id_kelas', $id_kelas);\n $this->db->where('id_tahun', $_SESSION['id_tahun_pelajaran']);\n $this->db->delete('rombel');\n }",
"public function beforeDelete() {\n // Console doesn't have Yii::$app->user, so we skip it for console\n if (php_sapi_name() != 'cli') {\n // Don't let delete yourself\n if (Yii::$app->user->id == $this->id) {\n return false;\n }\n\n // Don't let non-superadmin delete superadmin\n if (!Yii::$app->user->isSuperadmin AND $this->superadmin == 1) {\n return false;\n }\n }\n\n return parent::beforeDelete();\n }"
] | [
"0.60716885",
"0.5873969",
"0.578274",
"0.57605726",
"0.57594717",
"0.5754898",
"0.575462",
"0.5735711",
"0.5686735",
"0.5677489",
"0.56684875",
"0.56604344",
"0.56414515",
"0.5638211",
"0.5631469",
"0.56186247",
"0.561515",
"0.5610497",
"0.56069535",
"0.5590474",
"0.55769104",
"0.5576178",
"0.55719787",
"0.5571814",
"0.5552307",
"0.5550493",
"0.55304956",
"0.55183315",
"0.55132186",
"0.551302",
"0.5507391",
"0.55023235",
"0.5499484",
"0.5490985",
"0.548143",
"0.5480258",
"0.54780895",
"0.5471138",
"0.54663855",
"0.54587674",
"0.5440158",
"0.5438789",
"0.54366606",
"0.54256815",
"0.54255843",
"0.54222035",
"0.5416622",
"0.5406296",
"0.5405032",
"0.5403508",
"0.53985864",
"0.53954285",
"0.53886276",
"0.5383381",
"0.5381453",
"0.5377131",
"0.53758645",
"0.53643304",
"0.53615797",
"0.5357531",
"0.53572446",
"0.5356776",
"0.5356105",
"0.5353976",
"0.535231",
"0.53380644",
"0.5334125",
"0.5333893",
"0.53333014",
"0.5331485",
"0.53244305",
"0.5324062",
"0.53228664",
"0.53226537",
"0.532194",
"0.5321685",
"0.53207153",
"0.5319311",
"0.5307382",
"0.5307213",
"0.53005505",
"0.52947307",
"0.5288984",
"0.52871937",
"0.5286095",
"0.52810836",
"0.5277786",
"0.52770805",
"0.5276873",
"0.5275508",
"0.52719146",
"0.5271192",
"0.5271144",
"0.52706635",
"0.527036",
"0.52670497",
"0.52658856",
"0.5264895",
"0.52612907",
"0.52599186"
] | 0.6798481 | 0 |
Is am I admin of the kameti | public function amIAdminOfKameti($kameti_id, $admin_id) {
// Get a MySQL DB connection
$this->conn = $this->dbConnect->connect();
// insert query
$stmt = mysqli_prepare($this->conn, "SELECT COUNT(*) AS COUNT FROM $this->tablename WHERE (id=? AND admin_id=?)");
$this->throwExceptionOnError();
mysqli_stmt_bind_param($stmt,'ii', $kameti_id, $admin_id);
$this->throwExceptionOnError();
mysqli_stmt_execute($stmt);
$this->throwExceptionOnError();
mysqli_stmt_bind_result($stmt, $count);
$this->throwExceptionOnError();
mysqli_stmt_fetch($stmt);
$this->throwExceptionOnError();
mysqli_stmt_free_result($stmt);
mysqli_close($this->conn);
// Check for successful count
if ($count > 0) {
return TRUE;
}else{
return FALSE;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function am_i_admin() \n {\n return ($_SESSION['_user'] == AV_DEFAULT_ADMIN || $_SESSION['_is_admin']);\n }",
"public function isAdmin();",
"private function isAdmin() {\n\t\tif (Auth::user()->user == 1) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t}",
"public function isAdmin() {}",
"protected function userIsAdmin ()\n {\n $tokenHeader = apache_request_headers();\n $token = $tokenHeader['token'];\n $datosUsers = JWT::decode($token, $this->key, $this->algorithm);\n\n if($datosUsers->nombre==\"admin\")\n {\n return true;\n }\n else\n {\n return false;\n } \n }",
"public function isAdmin() {\n return $this->admin; // cerca la colonna admin nella tabella users\n }",
"function isAdmin()\n\t{\n\t\treturn $this->role == 3;\n\t}",
"function isAdmin(){\r\n\r\n\t\tif($this->user_type == 'Admin'){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function isAdmin()\n {\n return ($this->username === \"admin\");\n }",
"public function adminControl()\n {\n $row = $this->currentUserData();\n if(isset($_SESSION['sess_user_type']) &&\n $_SESSION['sess_user_type'] == 'admin' && $row['user_type'] == 'admin'){\n return true;\n }\n }",
"function isAdmin() {\n return ($this->userType == 'admin');\n }",
"public function is_admin() {\n return $this->session->get(\"niveau_acces\") >= 2;\n }",
"public function isAdmin()\n\t{\n\t\t$this->reply(true);\n\t}",
"public function isAdmin()\n {\n return $this->type == self::TYPE_ADMIN ;\n }",
"public function isAdmin()\n {\n if($this->u_r_id==null )\n {\n $this->u_r_id = array();\n $this->u_r_id[]=0;\n\n\n }\n foreach ($this->u_r_id as $int)\n {\n if($int==1)\n return true;\n }\n return false;\n }",
"public function isAdmin()\n {\n return $this->group_id === 1;\n }",
"public function isAdmin(){\n if($this->role==\"admin\"){\n return true;\n }\n return false;\n }",
"public function isAdmin(){\n return $this->role=='admin';\n }",
"protected function isAdmin()\n\t{\n\t\treturn is_admin();\n\t}",
"public function isAdmin()\n {\n return $this->role == 1;\n }",
"function is_admin()\n {\n //is a user logged in?\n\n //if so, check admin status\n\n //returns true/false\n\n }",
"public function isAdmin()\n {\n }",
"public function is_admin(){\n\t\treturn $this->account_type == \"manager\";\n\t}",
"public function getIsAdmin();",
"public function getIsAdmin();",
"function isAdmin(){\n\t\treturn ($this->userlevel == ADMIN_LEVEL || $this->username == ADMIN_NAME);\n\t}",
"public function isAdmin()\n {\n return $this->hasCredential('admin');\n }",
"public function isAdmin(): bool\n {\n return $this->is_admin === true;\n }",
"public function isAdmin(){\n $user = \\Auth::user();//ambil data user yang login dan berusaha akses menu di bawah\n return $user->isAdmin;//kembalikan nilai bahwa user ini admin atau bukan..\n }",
"public function is_admin()\n\t{\n\t\t$user = $this->get_current_user();\n\t\tif($user !== NULL)\n\t\t{\n\t\t\tif($user['auth'] == 255)\n\t\t\t{\n\t\t\t\treturn 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}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"function is_admin()\n\t{\n\t\treturn strtolower($this->ci->session->userdata('DX_role_name')) == 'admin';\n\t}",
"function is_user_admin()\n {\n }",
"protected function isAdminUser() {}",
"function isAdmin(){\n $user = $this->loadUser(Yii::app()->user->id);\n return intval($user->role) == 1;\n }",
"function isAdmin(){\n $user = $this->loadUser(Yii::app()->user->id);\n return intval($user->role) == 1;\n }",
"public static function isAdmin() {\r\n\r\n return Session::get('admin') == 1;\r\n\r\n }",
"function isAdmin(){\n\t\treturn (isset($this->params['admin']) && $this->params['admin']);\n\t}",
"function isAdmin() {\n\tif (isset($_SESSION['user']) && $_SESSION['user']['user_type'] == 'admin' ) {\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}",
"function isAdmin() {\n\t\t$me = $_SESSION[\"me\"];\n\t\t$check = mf(mq(\"select `id`,`url` from `[p]musicplayer` where `id`='{$me}' limit 1\"));\n\t\tif ($check[\"url\"] == \"admin\") {\n\t\t\treturn true;\n\t\t}\n\t}",
"protected function isCurrentUserAdmin() {}",
"protected function isCurrentUserAdmin() {}",
"public function isAdmin(){\n $user = Auth::guard('web') -> user();\n if ($user -> state != 1) {\n return 0;\n }\n else {\n return 1;\n }\n }",
"private function isAdmin() : bool\n {\n return $this->role('admin');\n }",
"function is_admin(){\r\n if (isset($_SESSION['admin']) && $_SESSION['admin']){\r\n return true;\r\n }\r\n return false;\r\n }",
"public function isAdmin() {\n return $this->hasPermission('is_admin');\n }",
"public static function isAdmin()\n {\n return auth()->check() && auth()->user()->panichd_admin;\n }",
"static function getIsAdmin() {\n\t\t$user = ctrl_users::GetUserDetail();\n\t\tif($user['usergroupid'] == 1) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"function isAdmin() {\n $user = $this->loadUser(Yii::app()->user->id);\n return intval($user->role) == 1;\n }",
"public function isAdmin(){\n $role = $this->role->type;\n\n return $role === 'admin';\n }",
"public function isAdmin()\n\t{\n\t\treturn $this->is_admin;\n\t}",
"public function isAdmin()\n {\n return $this->role == 'admin';\n }",
"public function isAdmin()\n {\n return (\\Auth::user()->role == 'admin');\n }",
"public static function isAdmin(){\n if(self::exists('auth_type')&& self::get('auth_type')=='admin'){\n return true;\n }else\n return false;\n\n }",
"public function isAdmin(){\n if($this->role->name = 'Administrator'){\n return true;\n }\n return false;\n }",
"public function isAdmin(){\n return $this->hasRoles([\"admin\"]);\n }",
"function isAdmin() {\n if (\\Illuminate\\Support\\Facades\\Auth::user()->rol_id == 1) {\n return true;\n } else {\n return false;\n }\n }",
"public function getIsAdministrator() {}",
"public function isAdmin() {\n\t\t\n\t\treturn $this->is_admin;\n\t\t\n\t}",
"public function isAdmin()\n {\n return ($this->role == 1) ? true : false;\n }",
"public function isAdmin()\n {\n $p = User::getUser();\n if($p)\n {\n if($p->canAccess('Edit products') === TRUE)\n {\n return TRUE;\n }\n }\n return FALSE;\n }",
"function isAdmin() {\n //FIXME: This needs to (eventually) evaluate that the user is both logged in *and* has admin credentials.\n //Change to false to see nav and detail buttons auto-magically disappear.\n return true;\n}",
"public function isAdmin(): bool\n {\n return $this->type() === self::ADMIN;\n }",
"public function isAdmin()\n {\n return $this->affiliation == self::AFFILIATION_ADMIN;\n }",
"public function IsAdmin() {\n\t\t\treturn $this->intPersonTypeId == PersonType::Administrator;\n\t\t}",
"static public function isAdmin(){\n if ( isset($_SESSION['admin']) && ($_SESSION['admin'] == 1)){\n return true;\n } else {\n return false;\n }\n }",
"public static function authAdmin() {\n if (Yii::$app->user->can(\"administrator\") || Yii::$app->user->can(\"adminsite\")) {\n return TRUE; //admin ใหญ่\n }\n }",
"public function isAdmin() {\n\t\t$groupId = $this->Session->read('UserAuth.User.user_group_id');\n\t\tif($groupId==ADMIN_GROUP_ID) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function isAdmin()\n {\n $quarkCookie = Mage::getModel('core/cookie')->get('quark_bar');\n\n $quarkSession = $this->getCollection()\n ->addFieldToFilter('identifier', $quarkCookie)\n ->getData();\n\n if (count($quarkSession)) {\n return true;\n }\n\n return false;\n }",
"public function isAdmin()\n\t{\n\t\treturn ($this->role == self::ROLE_ADMIN);\n\t}",
"public function isAdmin()\n {\n return ($this->type === User::ADMIN_USER);\n }",
"function iAmAdmin(){\n $adminIDs = Array( 1, 2 );\n \n return in_array( $_SESSION['userid'], $adminIDs );\n }",
"public function is_admin() {\n if($this->is_logged_in() && $this->user_level == 'a') {\n return true;\n } else {\n // $session->message(\"Access denied.\");\n }\n }",
"public function IsAdmin ();",
"public function isAdmin()\n {\n if (strtolower($this->name) == 'administrator')\n {\n return true;\n }\n\n return false;\n }",
"public static function isAdmin()\n {\n if (Yii::$app->user->isGuest) {\n return false;\n }\n $model = User::findOne(['username' => Yii::$app->user->identity->username]);\n if ($model == null) {\n return false;\n } elseif ($model->id_user_role == 1) {\n return true;\n }\n return false;\n }",
"function user_is_admin() {\n\tif(user_is_connect() && $_SESSION['membre']['statut'] == 2) {\n\t\t// si l'utilisateur est connecté et que son statut est égal à 2 alors il est admin\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}",
"public function isAdmin()\n\t{\n\t\treturn $this->isAdmin;\n\t}",
"public function isAdmin(){\n if($this->role->name == 'Administrator' && $this->is_active == 1){\n return true;\n }\n return false;\n }",
"public function check_admin() {\n return current_user_can('administrator');\n }",
"public function isUserOnAdminArea()\n\t{\n\t\treturn is_admin();\n\t}",
"function isAdmin()\n {\n if($this->role != ROLE_ADMIN) { return true; }\n else {return false; }\n }",
"function is_admin()\n\t{\n\t\t$ci =& get_instance();\n\t\treturn $ci->auth_model->is_admin();\n\t}",
"function is_admin()\n\t{\n\t\t$ci =& get_instance();\n\t\treturn $ci->auth_model->is_admin();\n\t}",
"public function is_admin()\n {\n return $this->type == 0;\n }",
"public function memberIsAdmin()\n {\n return $_SESSION['__COMMENTIA__']['member_role'] === 'admin';\n }",
"function IsAdmin()\n{\n\treturn false;\n}",
"public function isAdmin()\n {\n return $this->getAttribute('type') === User::ADMIN_TYPE;\n }",
"public function isAdmin()\n {\n return $this->is_admin;\n }",
"public function isAdmin() {\n\t\treturn $this->admin;\n\t}",
"public function isAdmin(): bool\n {\n return $this->is_admin;\n }",
"function getIsAdmin(){\n\t\treturn ( $this->user && $this->user->access_level >= User::LEVEL_ADMIN );\n\t}",
"public function checkAdmin()\n {\n // there ..... need\n // END Check\n $auth = false;\n if($auth) {\n return true;\n }\n else{\n return false;\n }\n }",
"public function isAdmin()\n {\n return $this->user_role === User::ROLE_ADMIN;\n }",
"public function isAdmin()\n {\n return $this->hasRole('ROLE_ADMIN');\n }",
"private function isAdmin() : bool\n {\n return $this->user->hasRole('admin');\n }",
"public function is_admin(): bool {\n\t\treturn $this->is_admin;\n\t}",
"public function checkAdmin();",
"public function isAdmin(){\n\t\tparent::isAdmin();\n\t}",
"function is_admin() {\n\tif(\n\t\tisset($_SESSION['admin']->iduser) \n\t\t&& !empty($_SESSION['admin']->iduser) \n\t\t&& $_SESSION['admin']->type = 'admin'\n\t\t&& $_SESSION['active']->type = 1\n\t\t&& $_SESSION['confirmed']->type = 1\n\t) return TRUE;\n\t\t\t\n\treturn FALSE;\n}",
"public function isAdmin()\n {\n return $this->isSuperUser() || $this->isMemberOf('admin');\n }",
"public function isUserAdmin()\n\t{\n\t\treturn (Bn::getValue('user_type') == 'A');\n\t}"
] | [
"0.8172257",
"0.8004361",
"0.7991985",
"0.7986922",
"0.7986205",
"0.7955102",
"0.79475635",
"0.7943028",
"0.7918099",
"0.79033536",
"0.79027635",
"0.790255",
"0.7894503",
"0.7890771",
"0.7889741",
"0.78859085",
"0.7862337",
"0.7841297",
"0.7840277",
"0.7830475",
"0.78050333",
"0.78039855",
"0.78038436",
"0.7803786",
"0.7803786",
"0.7791512",
"0.7788359",
"0.7774153",
"0.7763517",
"0.7763063",
"0.7757968",
"0.7748525",
"0.77440464",
"0.7742242",
"0.7742242",
"0.77413034",
"0.77388436",
"0.77372473",
"0.7732771",
"0.7720128",
"0.77172375",
"0.7716298",
"0.7707139",
"0.7703689",
"0.76818097",
"0.76771325",
"0.76641595",
"0.7662869",
"0.76534355",
"0.7651006",
"0.7649777",
"0.7647541",
"0.76454926",
"0.7645136",
"0.7642345",
"0.7635629",
"0.7626253",
"0.7622986",
"0.7621369",
"0.7614529",
"0.76134646",
"0.7611384",
"0.7610079",
"0.7599979",
"0.7599153",
"0.7588612",
"0.7585552",
"0.7581355",
"0.7569504",
"0.7568424",
"0.7563295",
"0.75622547",
"0.7560908",
"0.7554268",
"0.7553602",
"0.7552488",
"0.75520205",
"0.75511885",
"0.75453717",
"0.75443137",
"0.7542217",
"0.75385886",
"0.75385886",
"0.7536596",
"0.7535893",
"0.7535695",
"0.7534384",
"0.75335354",
"0.7524991",
"0.7519184",
"0.7519025",
"0.7518584",
"0.7508629",
"0.75077045",
"0.75023127",
"0.7500812",
"0.7499718",
"0.74985665",
"0.74873",
"0.7484598",
"0.74828446"
] | 0.0 | -1 |
Utility function to throw an exception if an error occurs while running a mysql command. | private function throwExceptionOnError($link = null) {
if($link == null) {
$link = $this->conn;
}
if(mysqli_error($link)) {
$msg = mysqli_errno($link) . ": " . mysqli_error($link);
echo "$msg";
throw new Exception('MySQL Error - '. $msg);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function raiseError($message = '') {\n throw new DbQueryException($message . '. ' . mysql_error($this->connectionId), __FILE__, __LINE__);\n }",
"private function mySQLError( $message )\n {\n throw new Exception('MySQL error: ' . $message . '<br /><br />');\n }",
"private function error()\n {\n // Throw an exception, as the query failed\n throw new QueryExecutionException('Mysqli error '.$this->client->errno.': '.$this->client->error);\n }",
"function DieWithBadSql($loc, $sql)\n{\n DieWithMsg($loc, array(\"SQL Querry Failure!\", \"SQL=\" . $sql));\n}",
"public function sql_errno() {}",
"public function sql_errno() {}",
"public function execute($sql, $options = array()) {\n if (($result = @mysql_query($sql)) === false) {\n if (array_key_exists('exception', $options) && $options['exception'] != '')\n throw new dbException($options['exception']);\n else\n throw new dbException(mysql_error());\n }\n\n return $result;\n }",
"function runMyQuery($sql){\n\tif(!mysqli_query($GLOBALS['conn'], $sql)){\n\t\tthrow new Exception(\"The following query did not succeed: \".$sql.\"\\n Because:\".$GLOBALS['conn']->error.\"\\n\");\n\t}\n}",
"function dbError() {\n exit(\"Error connecting to the database\");\n}",
"static private function fail($message) {\n if (self::getConfig('throwException')) {\n throw new DbException($message);\n }\n die($message . PHP_EOL);\n }",
"private static function throwProperDbException($e, $query)\n {\n list($sqlstate, $errno, $msg) = $e->errorInfo;\n $msg = \"SQL Error $errno: $msg\\n\\nThe query was:\\n\".$query.\"\\n\";\n switch ($errno) {\n case 1205: throw new DbLockWaitTimeoutException($msg);\n default: throw new DbException($msg);\n }\n }",
"public function handle_error() {\n $last_operation = $this->add_last_operation;\n $data = array(\n 'function_name' => is_array($last_operation[0]) ? $last_operation[0][1] : $last_operation[0],\n 'function_name_complete' => is_array($last_operation[0]) ? (is_string($last_operation[0][0]) ? $last_operation[0][0].':' : get_class($last_operation[0][0]).'->').$last_operation[0][1] : $last_operation[0],\n 'args' => $last_operation[1]\n );\n\n switch (strtolower($data['function_name'])) {\n case 'autoexecute':\n $data['table'] = $data['args'][0];\n $data['fields'] = $data['args'][1];\n $data['operation'] = $data['args'][2];\n break;\n }\n\n $data['debug'] = $last_operation;\n if (class_exists('e_database'))\n throw new e_database($this->adodb->ErrorMsg(),$data,$this->adodb->ErrorNo());\n else\n throw new Exception($this->adodb->ErrorMsg(),$this->adodb->ErrorNo());\n }",
"#[@test, @expect('rdbms.SQLConnectException')]\n public function connectFailedThrowsException() {\n DriverManager::getConnection(str_replace(\n ':'.$this->db(FALSE)->dsn->getPassword().'@', \n ':hopefully-wrong-password@', \n $this->dsn\n ))->connect();\n }",
"function die_mysql($mes,$query=NULL) {\n global $trace;\n if ($trace)\n if ($query)\n $mes .= ' ['.htmlspecialchars($query).']';\n $mes .= ': '.htmlspecialchars(mysql_error());\n die($mes);\n}",
"private function throw_sql_exception($class)\r\n {\r\n\t\t$errno = mysqli_errno($this->cn); $error = mysqli_error($this->cn);\r\n\t\t$msg = $error.\"<br /><br /><b>Error number:</b> \".$errno;\r\n throw new Exception($msg);\r\n }",
"#[@test, @expect('rdbms.SQLStatementFailedException')]\n public function malformedStatement() {\n $this->db()->query('select insert into delete.');\n }",
"function db_error($query, $errno, $error) { \n die('<font color=\"#000000\"><b>' . $errno . ' - ' . $error . '<br><br>' . $query . '<br><br><small><font color=\"#ff0000\">[STOP]</font></small><br><br></b></font>');\n }",
"function db_query($sql, $args=array()) {\n global $DBH;\n $sth = $DBH->prepare($sql);\n try {\n $sth->execute($args);\n } catch(PDOException $e) {\n //error_log(sprintf(\"query: '%s', args: [%s]\", $sql, implode(',', $args)));\n if($e->getCode() == '23000') {\n // '23000' is actually integrity constraint violation, but in case\n // of MySQL it's the same as duplicate key exception.\n $ne = new PDODuplicateKey($e->getMessage(), $e->getCode(), $e);\n $ne->errorInfo = $e->errorInfo;\n throw $ne;\n }\n throw $e;\n }\n return $sth;\n}",
"private function runSql(String $query)\n {\n try {\n\n $this->driver->exec($query);\n\n } catch (\\PDOException $e) {\n\n if ($e->getCode() === 1062) {\n //not sure what to do here\n return;\n } else {\n throw $e;\n }\n }\n\n }",
"public function testErrornousSingleResultSqlQuery() {\r\n $this->setExpectedException('Exception', 'Error in query: errornous sql query');\r\n $this->getPersistenceAdapter()->executeSingleResultQuery('errornous sql query');\r\n }",
"function _db_errno($link = NULL) {\n\treturn @mysql_errno($link);\n}",
"private function runQuery(array $input){\n\n $result = mysql_query($input['query'], $this->link);\n\n if (!($result)){\n throw new DatabaseExceptions(array(\n 'num' =>304,\n 'message' => \"Query: \\\"$sql\\\" failed. \" . mysql_errno($this->link) . \": \" . mysql_error($this->link),\n ));\n }\n\n return $result;\n }",
"public function testExecuteFailure() {\n $stub = $this->getMockBuilder(\"\\Examples\\ThriftServices\\Hive\\HivePDOStatement\")\n ->disableOriginalConstructor()\n ->setMethods(array(\"call\"))\n ->getMock();\n \n $stub->queryString = \"SELECT * FROM test\";\n \n $mockLogger = $this->getMockBuilder(\"\\Logger\")\n ->disableOriginalConstructor()\n ->setMethods(array(\"error\"))\n ->getMock();\n \n $mockLogger->expects($this->once())\n ->method(\"error\");\n \n $property = new \\ReflectionProperty($stub, \"logger\");\n $property->setAccessible(true);\n $property->setValue($stub, $mockLogger);\n \n $stub->expects($this->once())\n ->method(\"call\")\n ->will($this->returnCallback(\n function() {\n throw new \\Exception(\"Call failed!\");\n }\n )\n );\n \n $this->assertFalse($stub->execute());\n \n $property = new \\ReflectionProperty($stub, \"operationHandle\");\n $property->setAccessible(true);\n $this->assertNull($property->getValue($stub));\n }",
"private function throwException()\n {\n throw new CacheException(\\odbc_errormsg(), (int) \\odbc_error());\n }",
"function exec_catch( $cur ){\n try{\n oci_execute( $cur, OCI_DEFAULT );\n }catch(Exception $e){\n ##\n ## Might be something in buffer, so check first\n ##\n $this->get_dbms_output();\n $this->error( $e->getMessage() );\n }\n }",
"public function sql_failed($sql, $line, $file, $print=false) {\n $str = _QUERYERR . \": \" . htmlentities($sql)\n .\"<br/>\"\n . mysql_error($this->con) . \" \"\n . _ERRFROM . \" \" . $file . \" \" . _INLINE . \" \" . $line\n . Content::getLineShift();\n if($print) {\n echo $str;\n }\n return $str;\n }",
"function databaseConsoleErrorHandler($message, $info){\n if (!error_reporting()) return;\n console::writeLine(\"SQL Error: {$message}\");\n console::writeLine(print_r($info));\n exit;\n}",
"protected function mySqlError(string $method): void\n {\n $message = 'MySQL Error no: '.$this->mysqli->errno.\"\\n\";\n $message .= $this->mysqli->error;\n $message .= \"\\n\";\n $message .= $method;\n $message .= \"\\n\";\n\n throw new RuntimeException('%s', $message);\n }",
"public function test_execute_compound_command()\n\t{\n\t\t$db = Database::factory();\n\n\t\t$this->setExpectedException('Database_Exception', 'SQL syntax', 1064);\n\n\t\t$db->execute_command(\n\t\t\t'DELETE FROM '.$db->quote_table($this->_table).';'\n\t\t\t.'DELETE FROM '.$db->quote_table($this->_table)\n\t\t);\n\t}",
"public function testErrornousNoResultSqlQuery() {\r\n $this->setExpectedException('Exception', 'Error in query: errornous sql query');\r\n $this->getPersistenceAdapter()->executeNoResultQuery('errornous sql query');\r\n }",
"public function sql_error() {}",
"public function sql_error() {}",
"public function testCanExecuteSqlQueries()\n\t {\n\t\t$this->assertEquals(false, $this->object->exec(\"SELECT * FROM nonexistenttable\"));\n\t\t$this->assertInstanceOf(\"\\Logics\\Foundation\\SQL\\MySQLresult\", $this->object->exec(\"SELECT * FROM MySQLdatabase\"));\n\n\t\t$this->object = new MySQLdatabase($GLOBALS[\"DB_HOST\"], \"nonexistentdb\", $GLOBALS[\"DB_USER\"], $GLOBALS[\"DB_PASSWD\"]);\n\t\t$this->assertEquals(false, $this->object->exec(\"SELECT * FROM MySQLdatabase\"));\n\t }",
"public function redis_Scripting_script_invalid_command()\n {\n // Start from scratch\n $this->assertGreaterThanOrEqual(0, $this->redis->delete($this->key));\n $this->expectException(ScriptCommandException::class);\n $this->assertEquals(1, $this->redis->script('return'));\n }",
"public function exec($sql)\n {\n if ($this->debug === TRUE) {\n $start = microtime(TRUE);\n }\n \n $result = mysql_query($sql, $this->link);\n \n if ($result === FALSE) {\n $errstr = \"Invalid query: \" . $sql . PHP_EOL;\n $errstr .= \"Server returned: \" . mysql_errno($this->link) . \": \" . mysql_error($this->link);\n throw new Exception($errstr);\n }\n \n if ($this->debug === TRUE) {\n $end = microtime(TRUE);\n $time = sprintf(\"%.8F\", $end - $start);\n $this->queries[] = array(\n \"sql\" => $sql,\n \"sec\" => $time\n );\n }\n }",
"public function executeStatement($sql)\n {\n try {\n $result = $this->di->db->query($sql);\n if (!$result) {\n throw new \\Exception($this->di->db->last_error, 1);\n }\n } catch (\\Exception $e) {\n $this->di->logger->debug($sql.' / '.$this->di->db->last_error, 'Statement Error');\n }\n }",
"function checkForDbError($preparedStatement) {\n\t\t\t$error = $preparedStatement->errorInfo();\n\t\t\tif ($error != null && count($error) > 0 && $error[0] > 0)\n\t\t\t\tdie(\"Insert failed on: $error[2]\");\n\t}",
"public function DoQuery($query) {\r\n\t\t$this->result = mysqli_query($this->mysqli, $query); //Necessary? or trigger_error(\"Error\");\r\n\r\n\t\tif (mysqli_error($this->mysqli)) {\r\n\t\t\tthrow new MyException('<p>Could not run SQL query:<br><pre>' . $query . \"</pre></p><p><i>MySQL Error:</i><br>\" . mysqli_error($this->mysqli) . \"</p>\\n\");\r\n\t\t\treturn NULL;\r\n\t\t} else {\r\n\t\t\treturn mysqli_insert_id($this->mysqli);\r\n\t\t}\r\n\t}",
"public function throw_error($msg = null)\n {\n if (empty($msg)) {\n $msg = 'An error occurred while interacting with a database ' .\n \"using <strong>{$this->to_string()}</strong> adapter.\";\n }\n CREO('application_error_code', 500);\n CREO('application_error', $msg);\n }",
"public function delegateQueryExceptionProcess($query, array $args, array $options, $message, \\Exception $e);",
"public function execute_query($sql) {\n try {\n $result = mysql_query($sql);\n return $result;\n } catch (Exception $e) {\n return $e;\n }\n }",
"function db_query($link, $query) {\n\n if (!isset($link)) {\n throw new Exception('Connection with MySQL server needed before execute a SQL query.');\n }\n else {\n return mysqli_query($link, $query);\n }\n}",
"function runDBQuery($queryString) {\n\t$query = @mysql_query($queryString) or throwMySQLError(mysql_error(), $queryString);\n\treturn $query;\n}",
"function check_mysql()\n\t{\n\t\tif (mysql_errno()>0)\n\t\t\tdie(\"<br>.MySQL error\".mysql_errno().\":\".mysql_error());\n\t\t\treturn;\n\t}",
"public function testErrorHandling()\n\t{\n\t\tR::nuke();\n\t\tR::store( R::dispense( 'book' ) );\n\t\tR::freeze( FALSE );\n\t\tR::find( 'book2', ' id > 0' );\n\t\tpass();\n\t\tR::find( 'book', ' id2 > ?' );\n\t\tpass();\n\t\t$exception = NULL;\n\t\ttry {\n\t\t\tR::find( 'book', ' id = ?', array( 0, 1 ) );\n\t\t} catch( \\Exception $e ) {\n\t\t\t$exception = $e;\n\t\t}\n\t\tasrt( ( $exception instanceof SQL ), TRUE );\n\t\tR::freeze( TRUE );\n\t\t$exception = NULL;\n\t\ttry {\n\t\t\tR::find( 'book2', ' id > 0' );\n\t\t} catch( \\Exception $e ) {\n\t\t\t$exception = $e;\n\t\t}\n\t\tasrt( ( $exception instanceof SQL ), TRUE );\n\t\t$exception = NULL;\n\t\ttry {\n\t\t\tR::find( 'book', ' id2 > 0' );\n\t\t} catch( \\Exception $e ) {\n\t\t\t$exception = $e;\n\t\t}\n\t\tasrt( ( $exception instanceof SQL ), TRUE );\n\t}",
"public function testErrornousMultipleResultSqlQuery() {\r\n $this->setExpectedException('Exception', 'Error in query: errornous sql query');\r\n $this->getPersistenceAdapter()->executeMultipleResultQuery('errornous sql query');\r\n }",
"public function testExecuteWithInvalidAmountMessages()\n {\n $commandTester = $this->createCommandTester(new WorkerCommand());\n\n $this->expectException(\\InvalidArgumentException::class);\n $commandTester->execute([\n 'name' => 'basic_queue',\n '--messages' => -1\n ]);\n }",
"public function test_execute_compound_query()\n\t{\n\t\t$db = Database::factory();\n\n\t\t$this->setExpectedException('Database_Exception', 'SQL syntax', 1064);\n\n\t\t$db->execute_query(\n\t\t\t'SELECT * FROM '.$db->quote_table($this->_table).';'\n\t\t\t.'SELECT * FROM '.$db->quote_table($this->_table)\n\t\t);\n\t}",
"public function testFault()\n {\n \t$client = new RPC_Client_Exec('/bin/' . md5(microtime()));\n \t$rpc = $client->getInterface();\n \t\n \t$this->setExpectedException('Q\\RPC_Fault', \"Execution of command failed\");\n \t$result = $rpc->test();\n\t}",
"abstract public function query($sql, $errorLevel = E_USER_ERROR);",
"protected static function catchException($query, $e) {\n self::destroyCon();\n $err = \"<p>Problem running this query: $query </p>\";\n $err .= \"<p>Exception: $e</p>\";\n trigger_error($err);\n }",
"function run_query(string $query) {\n $connection = @mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);\n if (mysqli_connect_errno()) {\n throw new Exception(\"Database connection failed: \" . mysqli_connect_error());\n }\n\n if(!$result = mysqli_query($connection, $query)) {\n throw new Exception(mysqli_error($connection));\n } else {\n return $result;\n }\n}",
"private function throwExceptionOnError($link = null) {\n\t\tif($link == null) {\n\t\t\t$link = $this->connection;\n\t\t}\n\t\tif(mysqli_error($link)) {\n\t\t\t$msg = mysqli_errno($link) . \": \" . mysqli_error($link);\n\t\t\tthrow new Exception('MySQL Error - '. $msg);\n\t\t}\t\t\n\t}",
"private function throwExceptionOnError($link = null) {\n\t\tif($link == null) {\n\t\t\t$link = $this->connection;\n\t\t}\n\t\tif(mysqli_error($link)) {\n\t\t\t$msg = mysqli_errno($link) . \": \" . mysqli_error($link);\n\t\t\tthrow new Exception('MySQL Error - '. $msg);\n\t\t}\t\t\n\t}",
"private function _perform_mysql_query($sql){\n $this->debugBacktrace();\n \n if($this->isEnabledSqlLogging){\n \n $currentdatetime = new DateTime(\"now\", new DateTimeZone('Asia/Dhaka'));\n $FormattedDateTime = $currentdatetime->format('d-m-Y h:i:s A'); //date('Y-m-d H:i:s');\n $logContent = \"\\n\\n\";\n $logContent .= \"-------------------\" . $FormattedDateTime . \"----------------------------\";\n $logContent .= \"\\n\";\n $logContent .= $sql;\n\n file_put_contents(\"ZeroSQL_LOG.txt\", $logContent, FILE_APPEND | LOCK_EX );\n }\n\n if($this->isEnabledSqlPrinting){\n echo \"<br>\" . $sql . \"<br>\";\n }\n\n $query = mysqli_query($this->connection, $sql);\n /*\n For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returning resultset, mysql_query() returns a resource on success, or FALSE on error.\n For other type of SQL statements, INSERT, UPDATE, DELETE, DROP, etc, mysql_query() returns TRUE on success or FALSE on error.\n */\n if ($query === false) {\n //$error_description = \"An error has occured while working with database.\";\n \n $error = \"MySQL Error:\". mysqli_error($this->connection);\n $error_description = \"Failed to execute the following SQL statement: $sql. \" . $error;\n throw new ZeroException($error_description);\n }\n\n return $query;\n }",
"function error_number()\n\t{\n\t\treturn $this->_mysql_errno;\n\t}",
"function msql_error()\n{\n}",
"static function error_mysql($noError, $error, $archivo, $linea, $clase, $funcion, $metodo, $script, $sql)\n {\n if($noError == 1062)\n {\n exit('El registro que intentas agregar ya se encuentra registrado. Verifica la información e intenta nuevamente.');\n }\n \n switch($noError)\n {\n case 1045: #error al conectar con la base de datos\n print('<h3>Error al conectar con la base de datos "'.MYSQL_NAME.'".</h3>\n <p>Verifica que las siguientes sugerencias se encuentren configuradas correctamente en el archivo <code>config.php</code>.</p>\n <ul>\n <li>Tu nombre de usuario y contraseñ están correctamente escritos?</li>\n <li>El nombre del host está correctamente escrito?</li>\n <li>El servidor de base de datos, está correindo y escuchando por su puerto?</li>\n </ul>');\n break;\n case 1049: # error al seleccionar la BD\n print '<h3>No es posible seleccionar la base de datos "'.MYSQL_NAME.'".</h3>\n <p>Verifica que las siguientes sugerencias se encuentren configuradas correctamente en el archivo <code>config.php</code>.</p>\n <ul>\n <li>El nombre de la base de datos está escrito correctamente?</li>\n <li>Existe la base de datos?</li>\n </ul>';\n break;\n case 1146://tabla no existe\n case 1064:\n print 'Error de sintaxis</h3><p><code>'.$sql.'</code>';\n break;\n case 0:\n default:\n print $error;\n break;\n }\n exit();\n }",
"function mysql_fatal_err()\n{\n echo <<<_END\n </br>OOPS !!!!!!\n </br>We are sorry, but it was not possible to complete\n </br>the requested task.\n </br>\n _END;\n}",
"protected function queryFail($msg) {\n\n trigger_error($msg);\n $this->durationLap();\n return NULL;\n }",
"public function testExecuteWithNonExistingQueue()\n {\n $commandTester = $this->createCommandTester(new WorkerCommand());\n\n $this->expectException(\\InvalidArgumentException::class);\n $commandTester->execute([\n 'name' => 'non-existing-queue'\n ]);\n }",
"function sqlError($query = '', $error = '') {\n $dateTime = date(\"M-j-Y\") . ' - ' . date(\"G:i\");\n $message = htmlspecialchars(\"\\nQuery failed ($dateTime):\\n{$query}\\nMySQL error:\\n{$error}\\n********************\", ENT_QUOTES);\n \n error_log($message, 3, HOME . \"MySQL.txt\");\n \n return \"<div>Query failed</div>\";\n}",
"public function exec(string $sql): int\n {\n try {\n $result = $this->connection->exec($sql);\n\n assert($result !== false);\n\n return $result;\n } catch (PDOException $exception) {\n throw Exception::new($exception);\n }\n }",
"public function testExceptExceptionWithEmptyDatabse()\n {\n $this->expectException(\"ArgumentCountError\");\n $database = new \\Database();\n }",
"public function testErrors()\n {\n $database = Database::create(['driver' => 'sqlite', 'dsn' => 'sqlite::memory:']);\n $query = new Query($database);\n $superQuery = new QueryProxy($query);\n\n $this->assertException(InvalidArgumentException::class, function () use ($superQuery) {\n $superQuery->where(new \\stdClass);\n }, function (InvalidArgumentException $exception) {\n $this->assertInstanceOf(QueryScribeInvalidArgumentException::class, $exception->getPrevious());\n });\n\n $this->assertException(InvalidReturnValueException::class, function () use ($superQuery) {\n $superQuery->apply(function () {\n return 'hello';\n });\n }, function (InvalidReturnValueException $exception) {\n $this->assertInstanceOf(QueryScribeInvalidReturnValueException::class, $exception->getPrevious());\n });\n }",
"function log_pdo_db_error ( $php_self = '', $call_id = 0, $db = null, $sql = '' , $params = '' , $method_name = '', $call_style = '', $error = '' ) {\n\t\tif ( !$db ) {\n\t\t\t$db_connect_result = pdo_db_connect ();\n\t\t\tif ( $db_connect_result['rc'] == '1' ) {\n\t\t\t\t$db = $db_connect_result['db'];\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} //!$db\n\t\t\n\t\t$params = serialize( $params );\n\t\t$error_sql = \"INSERT INTO tbl_db_errors ( php_self, call_id, sql_query, params, method_name, call_style, member_id, error ) VALUES ( ?,?,?,?,?,?,?,? )\";\n\t\t$error_params = array( $php_self, $call_id, $sql, $params, $method_name, $call_style, NULL, $error );\n\t\t$stmt = $db->prepare( $error_sql );\n\t\t$stmt->execute( $error_params );\n\t\t$result = $stmt-> rowCount();\n\t\treturn true;\n\t}",
"private function query($query) {\n $result = $this->connection->query($query);\n if (!$result) {\n throw new DatabaseException(\"Error occurred processing SQL statement '$query': \"\n . $this->connection->error,\n $this->connection->errno);\n }\n\n return $result;\n }",
"public function sql_errno()\n {\n return $this->link->errno;\n }",
"protected function _error($sql)\n\t{\n\t\t$params = compact('sql');\n\t\treturn $this->_filter(__METHOD__,\n\t\t\t\t\t\t\t $params,\n\t\t\tfunction ($self, $params) {\n\t\t\t\t$sql = $params['sql'];\n\t\t\t\tlist($code, $error) = $self->error();\n\t\t\t\tthrow new QueryException(\"{$sql}: {$error}\", $code);\n\t\t\t});\n\t}",
"protected function error()\n\t{\t\t\n\t\tif(self::$arrDbConf[$this -> databaseName] !== 1)\n\t\tthrow new SystemException('Không tồn tại con trỏ database!');\n\t\telseif($this -> tableName ==='')\n\t\tthrow new SystemException('Không tồn tại tên bảng!');\n\t\telse\n\t\treturn true;\n\t}",
"function check_db_error($obj, $errmsg = '##Database Error##')\n {\n if ($this->isError($obj))\n $this->abort($errmsg, ': ', mysql_error());\n }",
"private function throwExceptionOnError ($link = null)\n {\n if ($link == null) {\n $link = $this->connection;\n }\n\n if (mysqli_error($link)) {\n $msg = mysqli_errno($link) . \": \" . mysqli_error($link);\n throw new Exception('MySQL Error - ' . $msg);\n }\n }",
"function Sql_queryE( $query ) {\n\tglobal $db;\n\tmysql_query( $query, $db );\n\t$sqlerr=mysql_errno()*1;\n\treturn $sqlerr;\n}",
"function die_if_sql_failed($result, $link, $data, $sql) // Colorize: green\n { // Colorize: green\n if (!$result) // Colorize: green\n { // Colorize: green\n $error_details = \"SQL Failed: \" . $sql . \" Error: \" . $link->error; // Colorize: green\n error_log($error_details); // Colorize: green\n // Colorize: green\n db_disconnect($link); // Colorize: green\n // Colorize: green\n $data[\"message\"] = \"Database error\"; // Colorize: green\n $data[\"details\"] = $error_details; // Colorize: green\n // Colorize: green\n die(json_encode($data)); // Colorize: green\n } // Colorize: green\n }",
"function doExceptions($dbName){\n\t\n\tdbQuery(\"ALTER TABLE $dbName.Event ADD `What_are_you_selling` TEXT NOT NULL;\");\n\techo(\"ALTER TABLE $dbName.Event ADD `What_are_you_selling` TEXT NOT NULL;\");\n\n\treturn true;\n}",
"private function logSqlError(string $query, string $message): void\n {\n $this->log->insertLog(2, $message . \" QUERY : \" . $query);\n }",
"function _db_error($link = NULL) {\n\treturn @mysql_error($link);\n}",
"function assertException($statement, $code) {\n extract($GLOBALS);\n $except = false;\n try { eval($statement . \";\"); }\n catch (ArogitaSyncException $e) {\n assert($e->getCode() == $code, \"Wrong exception thrown for $statement, expected code $code, found $e->code\");\n $except = true;\n }\n assert($except, \"Exception $code expected, no exception thrown for $statement\");\n}",
"private function printError(string $message = 'SQL is not correct, please enter the correct SQL'): void\n {\n $this->cliView->printErrorInCli($message);\n $this->run();\n }",
"function eeps_MySQL_doQueryWithoutResult($db, $query, $params)\n{\n $out = null;\n\n try {\n $sth = $db->prepare($query); // $sth = statement handle\n $out = $sth->execute($params);\n } catch (PDOException $e) {\n error_log(\"--- eeps MySQL preparation or execution error \" . $e->getMessage());\n die();\n }\n return $out; // exit status of command\n}",
"public function query($sql) {\n\t\t// TODO: implement\n\t\t//$this -> error();\n\t\tif($sql == '')\n\t\tthrow new SystemException('Không tồn tại câu lệnh sql');\n\t\telse\n\t\t{\n\t\t\t$dbName = $this -> databaseName;\n\t\t\t$query = $dbName() -> query($sql);\n\t\t\treturn $query;\n\t\t}\n\t}",
"function checkError($db, $ret, $string){\n\t\tif(!$ret){\n\t echo pg_last_error($db);\n\t } else {\n\t echo $string;\n\t }\n\t}",
"function exec_ex($cmd) {\n\tif (($cmd = strval($cmd)) === '') {\n\t\tdo_exception(__LINE__);\n\t}\n\n\t$out = null;\n\t$ret = 0;\n\texec($cmd, $out, $ret);\n\n\tif ($ret) {\n\t\tdo_exception(__LINE__, $ret);\n\t}\n\n\treturn true;\n}",
"public function testExecuteUpdateBatchNoStatementsThrowsException()\n {\n $this->expectException(BadRequestException::class);\n\n $db = self::$database;\n $res = $db->runTransaction(function ($t) {\n $res = $t->executeUpdateBatch([]);\n\n $t->commit();\n\n return $res;\n });\n }",
"function testFindCommandThrowsException()\n {\n $console = new Console();\n\n $this->setExpectedException('App\\Core\\Console\\CommandNotFoundException');\n\n $console->findCommand(\"nonexistent-command-test\");\n\n }",
"public function testThrowExceptionIfErrorsNoErrors()\n {\n $sqlStatementMock = $this->getMockBuilder(\\PDOStatement::class)\n ->disableOriginalConstructor()\n ->getMock();\n\n // This is the error code returned by mysql if no errors have occurred.\n $sqlStatementMock->expects($this->once())\n ->method('errorCode')\n ->willReturn('00000');\n\n $result = $this->testObject->throwExceptionIfErrors($sqlStatementMock);\n\n $this->assertFalse($result);\n }",
"function checkMySQL(){\r\n\tif(((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_errno($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_errno()) ? $___mysqli_res : false))){\r\n\t\techo \"<BR>***\";\r\n\t\tdie('Error: '.((is_object($GLOBALS[\"___mysqli_ston\"])) ? mysqli_error($GLOBALS[\"___mysqli_ston\"]) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false)));\r\n\t}\r\n}",
"public function testExecuteWithException()\n {\n $this->cart->expects($this->once())\n ->method('removeFailedSku')\n ->willThrowException(new \\Exception());\n $this->logger->expects($this->once())->method('critical');\n $this->messageManager->expects($this->once())->method('addError');\n $this->createInstance();\n $result = $this->controller->execute();\n\n $this->assertSame($result, $this->resultRaw);\n }",
"function do_exception($line, $code = -1) {\n\tthrow new Exception(\"Error at line: {$line}\", $code);\n}",
"function performQuery($dbname, $user, $password, $string) {\n\n\t$db = getDatabase($dbname,$user,$password);\n\n\t$result = mysql_query($string, $db);\n\n\tif ($result <= 0) {\n\t\n\t\tdisplayDBError($db,$string); \n\t\tmysql_close($db);\n\t\texit(1);\n\n\t} // end if\n\n\tmysql_close($db);\n\n\treturn $result;\n\n}",
"public function execute()\n {\n $binds = func_get_args();\n foreach( $binds as $index => $name ) {\n $this->binds[$index+1] = $name;\n }\n $cnt = 1;\n $query = $this->query;\n foreach( $this->binds as $ph => $pv ) {\n $query = str_replace( \":$cnt\", mysql_escape_string($pv), $query );\n $cnt++;\n }\n $this->result = mysql_query( $query, $this->dbh );\n if( !$this->result ) {\n throw new MySQLException( 'MySQL query failed', 2 );\n }\n return $this;\n }",
"public function ejecutar($sql){\r\n $sql=trim($sql);\r\n if(empty($sql))\r\n throw new Exception(\"La sentencia de ejecucion esta vacia\");\r\n\r\n $resultado=mysql_query ($sql, $this->conexion);\r\n if($resultado===FALSE)\r\n throw new Exception(\"No fue posible ejecutar $sql\");\r\n\r\n return $this->getUltimoId();\r\n }",
"public function testGetQueryException(): void\n {\n $em = $this->getEntityManagerMock();\n $this->getQueryBuilderMock($em);\n\n $driver = new DoctrineDriver([], $em, 'entity');\n $this->expectException(DoctrineDriverException::class);\n $driver->getQueryBuilder();\n }",
"function fail($text){\r\n $this->customCommand($text,'failed','','');\r\n throw new Exception($text);\r\n }",
"public static function printDatabaseError($exception, $exit = true) {\n self::printError('internal_database_error', $exception->__toString(), $exit);\n }",
"function db_query($query)\n{\n $ret = mysqli_query(DB::get_connection(), $query, MYSQLI_STORE_RESULT);\n if (!$ret) {\n throw new Exception (mysqli_error(DB::get_connection()));\n }\n\n return $ret;\n}",
"public function alter($sql)\n { \n if ($this->debug === TRUE) {\n $start = microtime(TRUE);\n }\n \n $result = mysql_query($sql, $this->link);\n \n if ($result === FALSE) {\n $errstr = \"Invalid query: \" . $sql . PHP_EOL;\n $errstr .= \"Server returned: \" . mysql_errno($this->link) . \": \" . mysql_error($this->link);\n throw new Exception($errstr);\n }\n \n if ($this->debug === TRUE) {\n $end = microtime(TRUE);\n $time = sprintf(\"%.8F\", $end - $start);\n $this->queries[] = array(\n \"sql\" => $sql,\n \"sec\" => $time\n );\n }\n \n return mysql_affected_rows($this->link);\n }",
"public function throwError();",
"public function testPrepareThrowsRuntimeExceptionOnInvalidSqlWithErrorReportingDisabled()\n {\n error_reporting(0);\n $sql = \"INVALID SQL\";\n $this->statement->setSql($sql);\n\n $this->expectException(\n RuntimeException::class,\n 'Error message'\n );\n $this->statement->prepare();\n }",
"function sql_error($dbh=NULL)\n {\n global $SQL_DBH;\n $db = (!is_null($dbh) ? $dbh : $SQL_DBH);\n if ( is_object($db) )\n $error = $db->errorInfo();\n else\n $error = array('Handle is not object','','');\n if ($error[0] != '00000') {\n return $error[0].'-'.$error[1].' '.$error[2];\n }\n else return '';\n }"
] | [
"0.7142196",
"0.6599205",
"0.6449005",
"0.6087789",
"0.60871047",
"0.60871047",
"0.60711086",
"0.6056221",
"0.6003004",
"0.5992195",
"0.5885079",
"0.5871486",
"0.58710325",
"0.5776313",
"0.5728811",
"0.5720119",
"0.5718892",
"0.57080954",
"0.56776124",
"0.5653252",
"0.5644621",
"0.56357527",
"0.56090957",
"0.5587492",
"0.5542209",
"0.5516612",
"0.54914504",
"0.548346",
"0.5482126",
"0.54702574",
"0.5450064",
"0.5450064",
"0.54413867",
"0.542957",
"0.5424821",
"0.5414296",
"0.54074156",
"0.54020476",
"0.538677",
"0.5381572",
"0.53808945",
"0.5377756",
"0.53760725",
"0.5368493",
"0.5364072",
"0.535872",
"0.5349427",
"0.53358525",
"0.53223515",
"0.52858365",
"0.5281407",
"0.5278708",
"0.5270526",
"0.5270526",
"0.5270417",
"0.5266914",
"0.5265786",
"0.5241939",
"0.52229756",
"0.5207121",
"0.5197624",
"0.5186557",
"0.51858395",
"0.5185827",
"0.5179109",
"0.5170338",
"0.5164772",
"0.5159061",
"0.51545024",
"0.5148631",
"0.5147423",
"0.51472247",
"0.5140347",
"0.5130671",
"0.5124953",
"0.511844",
"0.51126117",
"0.5111839",
"0.5110456",
"0.51061124",
"0.51028603",
"0.5101247",
"0.5099953",
"0.5092726",
"0.5091586",
"0.50903386",
"0.50782025",
"0.50689363",
"0.50651115",
"0.5044303",
"0.5042979",
"0.50281537",
"0.50228363",
"0.501165",
"0.50074863",
"0.500477",
"0.4997571",
"0.4990122",
"0.49849615",
"0.49822453"
] | 0.53809017 | 40 |
A basic feature test example. | public function test_unauthenticated_error()
{
$response = $this->get($this->apiUrl('user'));
$response->assertStatus(401);
$response->assertJson([
'message' => 'Unauthenticated.'
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testBasicFeatures()\n {\n return $this->doTheRealTest(false);\n }",
"public function testExample()\n {\n }",
"public function testBasicExample()\n {\n $this->visit('/')\n ->see('TROLOLOLO');\n }",
"function test_sample() {\n\n\t\t$this->assertTrue( true );\n\n\t}",
"public function testBasicExample()\n {\n $this->assertTrue(true);\n }",
"public function test() {\n \t\n\t\tprint_r('hello stef');\n \t\n }",
"public function testExample()\n {\n //this test is empty as we have not yet decided if we want to use dusk\n\n // $this->get('/')\n // ->click('About')\n // ->seePageIs('/about');\n }",
"public function testBasicExample()\n {\n $this->visit('/')\n ->see('API tester');\n }",
"function testSample() {\n\t\t$this->assertTrue( true );\n\t}",
"public function testExample()\n\t{\n\t\t$this->assertTrue(true);\n\t}",
"function test_basic_example()\n {\n $user = factory(App\\Entities\\User::class)->create([\n 'name' => 'Valentin Plechuc',\n ]);\n\n $this->actingAs($user, 'api');\n\n $this->visit('/api/user')\n ->see('Valentin Plechuc');\n\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n \n }",
"public function testBasicExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/admin/news/create')\n ->type('title', '123')\n ->type('text', 'test123')\n ->press('Добавить новость')\n\n ->assertSee('Мало букв в поле Заголовок');\n });\n }",
"public function testExample()\n {\n $this->visit('ticket')\n ->see('Listado de Tickets')\n ->seeLink('Ver Ticket') \n ->visit('ticket/1')\n ->see('Quod et autem sed')\n ->seeLink('Ver todos los tickets')\n ->click('Ver todos los tickets')\n ->see('Listado de Tickets')\n ->seeLink('Agregar un ticket', 'ticket/crear');\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testBasicExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->assertSee('Login to Airtel Sales Force System');\n });\n }",
"public function testBasicExample()\n {\n $this->visit('/')\n ->see('html');\n }",
"public function testGetFeatureDetailsUsingGET()\n {\n }",
"function test_sample() {\n\t\t$this->assertTrue( true );\n\t}",
"public function testExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->assertSee('React JS examples');\n });\n }",
"public function testBasicExample()\n {\n $this->visit('/')\n ->see('URL Notes');\n }",
"public function testBasicTest()\n {\n\n }",
"public function testExample()\n {\n dump(\"testExample\");\n $this->assertTrue(true);\n }",
"public function testBasicExample()\n {\n $this->visit('/')\n ->see('Laravel')\n ->see('Login')\n ->see('Register');\n }",
"public function testBasicExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->assertSee('Laravel');\n });\n }",
"public function testExample()\n {\n $this->visit('/')\n ->see('WELCOME');\n }",
"function test_sampleme() {\n\t\t// Replace this with some actual testing code.\n\t\t$this->assertTrue( true );\n\t}",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"public function testBasicExample()\n {\n $this->visit('/')\n ->see('Laravel');\n }",
"public function testExample()\n {\n\n \n $this->assertTrue(true);\n \n return true;\n }",
"public function testExample()\n {\n $this->actingAs( \\App\\User::first() )\n ->visit('/city')\n ->see('City List');\n }",
"public function testBasicExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/')\n ->with('.special-text', function ($text) {\n $text->assertSee('title1');\n });\n\n // 確認商品數量\n $browser->click('.check_product')\n ->waitForDialog(5)\n ->assertDialogOpened('商品數量充足')\n ->acceptDialog();\n\n // 設定中斷點\n eval(\\Psy\\sh());\n });\n }",
"public function testExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs(User::find(1))\n ->visitRoute('subscription', ['id' => '1'])\n ->radio('gender', 'L')\n ->type('fullName', 'GHF')\n ->type('birthdate', '04/24/1999')\n ->type('phone', '088177552')\n ->type('address', 'Bandung')\n ->press('Submit');\n });\n }",
"public function test()\n {\n $this->executeScenario();\n }",
"public function testBasicExample()\n {\n $this->visit('/')\n ->see('Laravel 5');\n }",
"public function testBasicExample()\n {\n $this->visit('/')\n ->see('Laravel 5');\n }",
"public function testBasicExample()\n {\n $this->visit('/')\n ->see('Laravel 5');\n }",
"public function testExample(): void\n {\n $this->assertTrue(true);\n }",
"public function testExample()\n {\n $this->browse(function (Browser $browser) {\n $browser->visit('/login')\n ->assertSee('SIGN IN')\n ->type('email', 'user@gmail.com')\n ->type('password', '123456')\n ->press('LOGIN')\n ->assertPathIs('/home')\n ->visit('/addProduct')\n ->type('nama_product', 'air jordan')\n ->type('harga_product', '100000')\n ->type('stock_product', '100000')\n ->type('deskripsi', 'haip bis parah ngga sih')\n ->select('kategori_product', 'Lainnya')\n ->select('nama_marketplace', 'Shopee')\n ->attach('img_path', __DIR__.'\\test.jpg')\n ->press('Submit');\n });\n }",
"public function testBasicExample()\n {\n $user = User::first();\n $this->be($user);\n $this->visit('/')\n ->see('Welcome Back');\n\n }",
"public function testBasicExample()\n {\n $this->assertEquals(1, 1);\n }",
"public function testExample()\n {\n // lets make it risky to destroy the green\n }",
"public function test() {\n\n\t}",
"public function testExample()\n {\n $this->visit('/')\n ->type('daniel.lambert@gas-elec.co.uk', 'email')\n ->type('7encoeaz', 'password')\n ->press('submit')\n ->see('You\\'ve logged into your online dashboard');\n }"
] | [
"0.75703996",
"0.7326855",
"0.7060016",
"0.70380056",
"0.69854325",
"0.69819707",
"0.6968778",
"0.69384074",
"0.6893094",
"0.6865566",
"0.6839218",
"0.6836121",
"0.68062127",
"0.6803488",
"0.68033314",
"0.67734396",
"0.6747173",
"0.67426485",
"0.67172587",
"0.67116183",
"0.670938",
"0.6702531",
"0.6689865",
"0.6679145",
"0.66718197",
"0.66691923",
"0.6653451",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.6640096",
"0.66365665",
"0.6623849",
"0.662012",
"0.66165954",
"0.6614679",
"0.6604926",
"0.65999097",
"0.65999097",
"0.65999097",
"0.6595679",
"0.6585578",
"0.6569086",
"0.65643984",
"0.65440404",
"0.65173525",
"0.65039146"
] | 0.0 | -1 |
/ Description Function is to display video conferencing container Created 25 November 2014 Created By Dave Brown | public function conference ($appointment_hash = NULL)
{
/* - - - - -Avoid page from caching -*/
$this->output->set_header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
$this->output->set_header('Cache-Control: no-cache, no-store, must-revalidate, max-age=0');
$this->output->set_header('Cache-Control: post-check=0, pre-check=0', FALSE);
$this->output->set_header('Pragma: no-cache');
/* - - - - -Avoid page from caching Ends - - - - - - */
$history_appointments = NULL;
if (empty($appointment_hash))
{
show_404();
}
$get_current_appointment = $this->get_current_appointment();
if (!empty($get_current_appointment) && encryptor('encrypt', $get_current_appointment->id) != $appointment_hash)
{
redirect(base_url('appointments/conference/' . encryptor('encrypt', $get_current_appointment->id)));
}
/* Fetching all Appointment Details*/
$conditions = $params = array();
$conditions['appointments.id'] = encryptor('decrypt', $appointment_hash);
$conditions['appointments.status'] = ACTIVE;
$conditions['appointments.end_time >= '] = date('Y-m-d H:i:s');
$params['join'][] = array(
'table' => 'appointment_details',
'conditions' => 'appointments.id = appointment_details.appointment_id'
);
/*Getting prescription Details if exists or not*/
$params['join'][] = array(
'table' => 'prescriptions',
'conditions' => 'prescriptions.appointment_id = appointments.id',
'type' => 'left'
);
$params['fields'] = 'appointments.id, appointments.call_status,
appointments.start_time, appointments.end_time,
appointments.tokbox_session_key, appointment_details.token,
appointment_details.user_id, appointment_details.user_type,
prescriptions.id AS prescription_id, history, examination,
diagnosis, management, prescriptions.app_id AS prescription_app_id,
outcome_description';
$params['return_field'] = 'user_type';
$get_apppointment_details = $this->appointment_model->get_all($conditions, $params);
/* Fetching appointment details ends */
if (empty($get_apppointment_details))
{
redirect(base_url($this->current_module));
}
/* Fetching Previous Appointments of the Patient with doctornow doctors */
$conditions = $params = array();
$conditions['appointments.status'] = ACTIVE;
$conditions['appointments.id <> '] = current($get_apppointment_details)->id;
$conditions['appointment_details.user_id'] = $get_apppointment_details[USER_PATIENT]->user_id;
$conditions['appointments.start_time < '] = date('Y-m-d h:i:s');
$params['join'][] = array(
'table' => 'appointment_details',
'conditions' => 'appointments.id = appointment_details.appointment_id AND appointment_details.user_type = ' . USER_PATIENT
);
$params['join'][] = array(
'table' => 'appointment_details AS ADDOC',
'conditions' => 'appointments.id = ADDOC.appointment_id AND ADDOC.user_type = ' . USER_DOCTOR
);
/*Getting doctor Details*/
$params['join'][] = array(
'table' => 'users',
'conditions' => 'users.id = ADDOC.user_id',
);
$params['fields'] = 'appointments.id, appointments.start_time, users.first_name, users.last_name';
$history_appointments = $this->appointment_model->get_all($conditions, $params);
/*-----------------History Appointments Ends------------------*/
/*Fetching Patient details from third party database via curl request*/
$patient_details = post_curl_request(THIRD_PARTY_API_URL, json_encode(array(
'action' => 'reviewpatient',
'patientid' => $get_apppointment_details[USER_PATIENT]->user_id,
)));
/*Fetching patient Notes details from third party database via curl request*/
$patient_notes = post_curl_request(THIRD_PARTY_API_URL, json_encode(array(
'action' => 'getappointmentinformation',
'patientid' => $get_apppointment_details[USER_PATIENT]->user_id,
'appointmentid' => $get_apppointment_details[USER_PATIENT]->id
)));
if (json_decode($patient_notes) && json_decode($patient_notes) != NULL)
{
$patient_notes_str = current(json_decode($patient_notes))->PatientNote;
}
/* Saving tokbox data into session for call, if call is pending */
if (current($get_apppointment_details)->call_status == CALL_PENDING)
{
$tokbox_data = array(
'tokbox_session_key' => $get_apppointment_details[USER_DOCTOR]->tokbox_session_key,
'tokbox_token' => $get_apppointment_details[USER_DOCTOR]->token
);
$this->session->set_userdata('tokbox_data', $tokbox_data);
}
/* Template description */
$page_variables['container']['patient_notes'] = !empty($patient_notes_str) ? $patient_notes_str : NULL;
$page_variables['container']['get_apppointment_details'] = $get_apppointment_details;
$page_variables['container']['appointment_hash'] = $appointment_hash;
$page_variables['container']['history_appointments'] = $history_appointments;
$page_variables['container']['patient_details'] = !empty($patient_details) ? current(json_decode($patient_details)) : array();
$page_variables['container']['patient_id'] = !empty($get_apppointment_details[USER_PATIENT]->user_id) ? $get_apppointment_details[USER_PATIENT]->user_id : 0;
$data['page_view']['container'] = 'appointments_module/conference';
$page_variables['right_container']['get_apppointment_details'] = $get_apppointment_details;
$data['page_view']['right_container'] = 'appointments_module/right_conference';
//Variables For Footer
$data['title'] = 'Doctor\'s Schedule | ' . SITE_NAME;
/* Extra css classes to add in template */
$data['extra_wrapper_class'] = 'live-appointment';
//$data['extra_container_class'] = 'c-full';
/* -------Ends----- */
$data['js_script'] = 'appointments_module/js_script';
$data['get_apppointment_details'] = $get_apppointment_details;
$data['current_module'] = $this->current_module;
$data['page_variables'] = $page_variables;
parent::fronttemplate($data);
/* Template Description Ends */
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pavi_the_display_video($args = array()){\n echo pavi_get_display_video($args);\n}",
"function pavi_shortcode_video($atts = array()){\n \n return pavi_get_display_video($atts);\n}",
"public function createVideo();",
"public function process() {\n // Add oembed streams to video file types.\n $video = file_type_load('video');\n $video->mimetypes[] = 'video/oembed';\n $video->streams[] = 'oembed';\n file_type_save($video);\n\n // Oembed specific display settings for videos.\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__default__oembed';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '560',\n 'height' => '340',\n 'wmode' => '',\n );\n file_display_save($file_display);\n\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__default__oembed_thumbnail';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '180',\n 'height' => '',\n );\n file_display_save($file_display);\n\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__preview__oembed_thumbnail';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '100',\n 'height' => '75',\n );\n file_display_save($file_display);\n\n $file_display = new \\stdClass();\n $file_display->api_version = 1;\n $file_display->name = 'video__teaser__oembed_thumbnail';\n $file_display->weight = -10;\n $file_display->status = TRUE;\n $file_display->settings = array(\n 'width' => '100',\n 'height' => '75',\n );\n file_display_save($file_display);\n\n }",
"function grve_print_media_video( $video_mode, $video_webm, $video_mp4, $video_ogv, $video_embed ) {\n\tglobal $wp_embed;\n\t$video_output = '';\n\n\tif( empty( $video_mode ) && !empty( $video_embed ) ) {\n\t\t$video_output .= '<div class=\"grve-media\">';\n\t\t$video_output .= $wp_embed->run_shortcode( '[embed]' . $video_embed . '[/embed]' );\n\t\t$video_output .= '</div>';\n\t} else {\n\n\t\tif ( !empty( $video_webm ) || !empty( $video_mp4 ) || !empty( $video_ogv ) ) {\n\t\t\t$video_output .= '<div class=\"grve-media\">';\n\t\t\t$video_output .= ' <video controls>';\n\n\t\t\tif ( !empty( $video_webm ) ) {\n\t\t\t\t$video_output .= '<source src=\"' . $video_webm . '\" type=\"video/webm\">';\n\t\t\t}\n\t\t\tif ( !empty( $video_mp4 ) ) {\n\t\t\t\t$video_output .= '<source src=\"' . $video_mp4 . '\" type=\"video/mp4\">';\n\t\t\t}\n\t\t\tif ( !empty( $video_ogv ) ) {\n\t\t\t\t$video_output .= '<source src=\"' . $video_ogv . '\" type=\"video/ogg\">';\n\t\t\t}\n\t\t\t$video_output .=' </video>';\n\t\t\t$video_output .= '</div>';\n\n\t\t}\n\t}\n\n\techo $video_output;\n\n}",
"function ShowVideoRight()\n{\n\techo(\"<tr><td height='2'></td></tr>\");\n\t$str0=\"select value1 from options where name='video'\";\n\t$result0=mysql_query($str0) or die(mysql_error());\n\t$row0=mysql_fetch_array($result0);\n\tif ($row0['value1']==1)\n\t{ \n\t\techo(\"<tr><td valign='middle' background='images/menuphai.png' class='topbartitle' height='30'\"); \n\t\techo(\"width='216'>\");\n\t\n\t\techo(\" \".getPara('video','value2'));\n\t\t/*echo(\"<tr><td bgcolor='\");\n\t\techo(background());\n\t\techo(\"' class='leftmenumainitem'\"); \n\t\techo(\"width='216' valign='top'><img src='image/point.jpg' /> \");\n\t\techo(getPara('video','value2'));*/\n\t\techo(\"</td>\");\n\t\t\t\n\t\t//echo(\"</tr><tr><td height='200' background='pic/bodybar.jpg'><div class='topnews'>\");\n\t\techo(\"</tr><tr><td height='176'>\");\n\t\t$str00=\"select * from video where trang_thai='1' and hot='1' order by id desc limit 0,1\";\n\t\t$result00=mysql_query($str00) or\tdie(mysql_error());\n\t\twhile ($row00=mysql_fetch_array($result00))\n\t\t{\n\t\t\techo(\"<div id=\\\"MediaPlayer333\\\">\n\t\t\t<object id=\\\"player\\\" classid=\\\"clsid: D27CDB6E-AE6D-11cf-96B8-444553540000\\\" name=\\\"player\\\" width=\\\"214\\\" height=\\\"175\\\">\n\t\t\t<param name=\\\"movie\\\" value=\\\"jwplayer/player.swf\\\"/>\n\t\t\t<param name=\\\"allowfullscreen\\\" value=\\\"true\\\" />\n\t\t\t<param name=\\\"allowscriptaccess\\\" value=\\\"always\\\" />\n\t\t\t<param name=\\\"flashvars\\\" value=\".$row00['link'].\" />\n\t\t\t<embed\n\t\t\ttype=\\\"application/x-shockwave-flash\\\"\n\t\t\tid=\\\"player2\\\"\n\t\t\tname=\\\"player2\\\"\n\t\t\tsrc=\\\"jwplayer/player.swf\\\"\n\t\t\twidth=\\\"214\\\"\n\t\t\theight=\\\"175\\\"\n\t\t\tallowscriptaccess=\\\"always\\\"\n\t\t\tallowfullscreen=\\\"true\\\"\n\t\t\tflashvars=\\\"file=\".$row00['link'].\"\\\">\n\t\t\t</embed>\n\t\t\t</object>\n\t\t\t</div>\");\n\t\t}\n\t\tmysql_free_result($result00);\n\t\t\n\t\t$str1=\"select * from video where trang_thai='1' and hot='1' order by id desc limit 0,5\";\n\t\t$result=mysql_query($str1) or\n\t\t\tdie(mysql_error());\n\t\t\t\n\t\t\techo(\"<ul class='box2video'>\");\n\t\t\t$stt=1;\n\t\twhile ($row=mysql_fetch_array($result))\n\t\t{\n\t\t\t\n\t\t\techo(\"<li>\");\n\t\t\techo(\"<a href=\\\"#\\\" id=\\\"abcd\\\" onclick=\\\"JavaScript:showVideo3('LOAD\".$row[\"id\"].\"');\\\" >\n \".$row['ghi_chu'].\"</a>\");\n\t\t\techo(\"</li>\");\n\t\t\t$stt++;\n\t \t}\n\t\t\t\n\t\t\techo(\"</ul>\");\n\t\t\n\t\t//echo($row['value3']);\n\t\t\n\t\tmysql_free_result($result);\n\t\techo(\"</td></tr>\");\n\t\t//echo(\"<tr><td background='pic/bottombar.jpg'\"); \n\t\t//echo(\" height='12'></tr>\");\n\t\techo(\"<script language=\\\"JavaScript\\\">\n\nvar HttPRequest = false;\n\nfunction showVideo3(str)\n\t\t {\n\t\t\n\t\tHttPRequest = false;\n\t\t\n\t\tif (window.XMLHttpRequest) { // Mozilla, Safari,...\n\t\t\n\t\tHttPRequest = new XMLHttpRequest();\n\t\t\n\t\tif (HttPRequest.overrideMimeType) {\n\t\t\n\t\tHttPRequest.overrideMimeType('text/html');\n\t\t\n\t\t}\n\t\t\n\t\t} else if (window.ActiveXObject) { // IE\n\t\t\n\t\ttry {\n\t\t\n\t\tHttPRequest = new ActiveXObject(\\\"Msxml2.XMLHTTP\\\");\n\t\t\n\t\t} catch (e) {\n\t\t\n\t\ttry {\n\t\t\n\t\tHttPRequest = new ActiveXObject(\\\"Microsoft.XMLHTTP\\\");\n\t\t\n\t\t} catch (e) {}\n\t\t\n\t\t}\n\t\t\n\t\t}\n\t\tif (!HttPRequest) {\n\t\t\n\t\talert('Cannot create XMLHTTP instance');\n\t\t\n\t\treturn false;\n\t\t\n\t\t}\n\t\tvar url = 'aj3.php';\n\t\t\n\t\tvar pmeters =\n\n\t\t\\\"str=\\\" + str;\n\t\tHttPRequest.open('POST',url,true);\n\t\t\n\t\tHttPRequest.setRequestHeader(\\\"Content-type\\\", \\\"application/x-www-form-urlencoded\\\");\n\t\t\n\t\tHttPRequest.setRequestHeader(\\\"Content-length\\\", pmeters.length);\n\t\t\n\t\tHttPRequest.setRequestHeader(\\\"Connection\\\", \\\"close\\\");\n\t\t\n\t\tHttPRequest.send(pmeters);\n\t\t\n\t\tHttPRequest.onreadystatechange = function()\n\t\t\n\t\t{\n\t\t\n\t\tif(HttPRequest.readyState == 3) // Loading Request\n\t\t\n\t\t{\n\t\tdocument.getElementById(\\\"MediaPlayer333\\\").innerHTML = \\\"Now is Loading...\\\";\n\t\t}\n\t\tif(HttPRequest.readyState == 4) // Return Request\n\t\t\n\t\t{\n\t\tdocument.getElementById(\\\"MediaPlayer333\\\").innerHTML = HttPRequest.responseText;\n\t\t}\n\t\t\t \t\t\n\t\t}\n\t\t\n\t\t}\n\t\t</script>\");\t\n\t}\n\tmysql_free_result($result0);\n}",
"function video() {\n echo json_encode(array('element' => '<video controls autoplay> <source src=\"skysignagelight.1564484463.mp4\" type=\"video/mp4\"></video>'));\n exit;\n }",
"public function displayMedia()\n {\n // section 127-0-1-1--35dee990:156e03a0457:-8000:00000000000008CC begin\n // section 127-0-1-1--35dee990:156e03a0457:-8000:00000000000008CC end\n }",
"function emc_video() {\r\n\r\n\t// get the URL field\r\n\t$url = get_field( 'url' );\r\n\tif ( empty( $url ) ) {\r\n\t\t_e( '<em>URL field is empty.</em>', 'emc' );\r\n\t\treturn false;\r\n\t}\r\n\r\n\tif ( strpos( $url, 'rackcdn.com' ) ) {\r\n\r\n\t\t// get the URL for the medium featured image, to serve as video poster\r\n\t\t$thumb_id = get_post_thumbnail_id( get_the_ID() );\r\n\t\t$thumb_src = wp_get_attachment_image_src( $thumb_id, 'large' );\r\n\r\n\t\t// assemble our EMC RackSpace HTML5 video embed with Flash fallback\r\n\t\t$shortcode = sprintf( '[video mp4=\"%1$s\" poster=\"%2$s\" width=\"%3$s\" height=\"%4$s\"]',\r\n\t\t\tesc_url( $url ),\r\n\t\t\tesc_attr( $thumb_src[0] ),\r\n\t\t\t'100%',\r\n\t\t\t'auto'\r\n\t\t);\r\n\r\n\t\t$video = do_shortcode( $shortcode );\r\n\r\n\t} else {\r\n\r\n\t\t// we have something other than RackSpace for a video link\r\n\t\t$video = wp_oembed_get( esc_url( get_field( 'url' ) ) );\r\n\r\n\t}\r\n\r\n\t// Determine the duration\r\n\t$duration = ( get_field( 'duration' ) ) ? get_field( 'duration' ) : __( 'Not specified', 'emc' );\r\n\t$duration = sprintf( __( 'Duration: %s', 'emc' ), esc_html( $duration ) );\r\n\r\n\t// Get help text\r\n\t$help = get_page_by_path( 'video-problems-text', OBJECT, 'post' );\r\n\r\n\t// Assemble our final HTML\r\n\t$html = '<div class=\"emc-video\">';\r\n\t$html .= $video;\r\n\t$html .= '<div class=\"emc-toggle-section emc-video-meta\">';\r\n\t$html .= '<span class=\"emc-video-duration\">' . esc_html( $duration ) . '</span>';\r\n\t$html .= '<a class=\"emc-toggle-link\">' . esc_html__( 'Having video problems?', 'emc' ) . '</a>';\r\n\t$html .= '<div class=\"emc-toggle-content\">';\r\n\t$html .= apply_filters( 'the_content', $help->post_content );\r\n\t$html .= '</div><!-- .emc-toggle-content -->';\r\n\t$html .= '</div><!-- .emc-video-meta -->';\r\n\t$html .= '</div><!-- .emc-video -->';\r\n\r\n\techo $html;\r\n\r\n}",
"function tpl_show($video)\n{\n global $smarty, $config;\n\n // imageurl\n $video['imgurl'] = getThumbnail($video['imgurl'], $video['title']);\n\n // make soft linebreaks:\n $video['filename'] = preg_replace('/(_|\\.|-)/', '$1<wbr />', $video['filename']);\n\n // split comma-separated countries, prevent empty array\n $video['country'] = preg_split('/,\\s*/', $video['country'], -1, PREG_SPLIT_NO_EMPTY);\n\n // split comma-separated multiple languages, prevent empty array\n $video['language'] = preg_split('/,\\s*/', $video['language'], -1, PREG_SPLIT_NO_EMPTY);\n\n // humanreadable filesize:\n $video['filesize'] = round($video['filesize']/(1024*1024), 2);\n\n // break plot and comment\n $video['plot'] = nl2br($video['plot']);\n $video['comment'] = nl2br($video['comment']);\n\n\t// cast\n $smarty->assign('cast_toggle', $config['showcasttoggle']);\n $show_cast = true;\n if ($config['showcasttoggle'])\n {\n $show_cast = (isset($_GET['show_cast']) && $_GET['show_cast'] == '1');\n }\n $smarty->assign('show_cast', $show_cast);\n $video['cast'] = [];\n if ($show_cast)\n {\n \t$video['cast'] = prepare_cast($video['actors']);\n }\n\n // prepare the custom fields\n customfields($video, 'out');\n\n // hide owner if not using multi-user\n if (!$config['multiuser']) unset($video['owner']);\n\n // get drilldown url for image\n if ($video['imdbID'])\n {\n require_once './engines/engines.php';\n $smarty->assign('link', engineGetContentUrl($video['imdbID'], engineGetEngine($video['imdbID'])));\n }\n\n // add episodes information\n if (array_key_exists('episodes', $video) && is_array($video['episodes']))\n {\n // allow multiple columns\n $smarty->assign('listcolumns', session_get('listcolumns'));\n }\n\n $smarty->assign('castcolumns', $config['castcolumns']);\n $smarty->assign('video', $video);\n\n // get genre ids and names\n $smarty->assign('genres', getItemGenres($video['id'], true));\n\n // make engines available\n $smarty->assign('engines', $config['engine']);\n\n // allow XML export\n foreach (array('xls','pdf','xml') as $export)\n {\n if ($config[$export]) $smarty->assign($export, 'show.php?id='.$video['id'].'&');\n }\n // new-style way of exporting\n // $smarty->assign('exports', listExports('show.php?id='.$video['id'].'&'));\n}",
"function show_one_video_front_end($video_id,$menu_class,$cate_lang,$width,$height,$skin_media='default.zip'){\n\n\t\t$str_select=\"*\";\n\t\t$arr_where=array($this->_table.'.video_public'=>1,$this->_table.'.video_id'=>$video_id,'category_sub.menu_class'=>$menu_class,'category_sub.cate_lang'=>$cate_lang,'category_sub.cate_public'=>1);\n\n\t\t$this->db->select($str_select);\n\t\t$this->db->join('category_sub',$this->_table.'.cate_id=category_sub.cate_id');\n\t\t$this->db->where($arr_where);\n\n\t\t$query=$this->db->get($this->_table);\n\t\t$arr_video=$query->row_array();\n\n\t\t$string_video='';\n\n\t\tif(is_array($arr_video) && !empty($arr_video)){\n\n\t\t\tif(preg_match(\"/youtube.com/\",element('video_file',$arr_video,''))){\n\n\t\t\t\t$string_youtube=\"<iframe width='\".$width.\"' height='\".$height.\"' src='\".element('video_file',$arr_video,'').\"' frameborder='0' allowfullscreen></iframe>\";\n\t\t\t\treturn $string_youtube;\n\t\t\t}\n\n\t\t\t$string_flashvars=\"netstreambasepath=\".base_url();\n\t\t\t$string_flashvars.= \"&playlist.position=none\";\n\t\t\t$string_flashvars.= \"&playlist.size=0\";\n\t\t\t$string_flashvars.= \"&skin=\".base_url().DIR_PUBLIC.\"mediaplayer/skin/\".$skin_media;\n\t\t\t$string_flashvars.= \"&config=\".base_url().DIR_PUBLIC.\"mediaplayer/config/config.xml\";\n\t\t\t$string_flashvars.= \"&title=\".element('video_name',$arr_video,'');\n\t\t\t$string_flashvars.= \"&file=\".base_src_video(element('video_file',$arr_video,''));\n\t\t\tif(element('video_img',$arr_video,'') != \"\")\n\t\t\t\t$string_flashvars.= \"&image=\".base_src_img(element('video_img',$arr_video,''));\n\n\t\t\t$string_video=\"<object width='\".$width.\"' height='\".$height.\"' \";\n\t\t\t$string_video.= \"classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' \";\n\t\t\t$string_video.= \"codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' \";\n\t\t\t$string_video.= \"align='center' style='overflow:hidden'>\";\n\n\t\t\t$string_video.= \"<param name='movie' value='\".base_url().DIR_PUBLIC.\"mediaplayer/player.swf'>\";\n\t\t\t$string_video.= \"<param name='quality' value='high'>\";\n\t\t\t$string_video.= \"<param name='allowscriptaccess' value='always'>\";\n\t\t\t$string_video.= \"<param name='wmode' value='transparent'>\";\n\t\t\t$string_video.= \"<param name='allowfullscreen' value='true'>\";\n\t\t\t$string_video.= \"<param name='flashvars' value='\".$string_flashvars.\"'>\";\n\t\t\t$string_video.= \"<embed width='\".$width.\"' height='\".$height.\"' \";\n\t\t\t$string_video.= \"type='application/x-shockwave-flash' \";\n\t\t\t$string_video.= \"pluginspage='http://www.macromedia.com/go/getflashplayer' \";\n\t\t\t$string_video.= \"align='center' style='overflow:hidden' \";\n\n\t\t\t$string_video.= \"src='\".base_url().DIR_PUBLIC.\"mediaplayer/player.swf' \";\n\t\t\t$string_video.= \"quality='high' \";\n\t\t\t$string_video.= \"allowscriptaccess='always' \";\n\t\t\t$string_video.= \"wmode='transparent' \";\n\t\t\t$string_video.= \"allowfullscreen='true' \";\n\t\t\t$string_video.= \"flashvars='\".$string_flashvars.\"'>\";\n\t\t\t$string_video.= \"</object>\";\n\t\t}\n\t\treturn $string_video;\n\n\t}",
"function show_one_video($video_id,$width,$height,$skin_media='default.zip'){\n\n\t\t$str_select=\"*\";\n\t\t$arr_where=array($this->_table.'.video_id'=>$video_id);\n\n\t\t$this->db->select($str_select);\n\t\t$this->db->where($arr_where);\n\n\t\t$query=$this->db->get($this->_table);\n\t\t$arr_video=$query->row_array();\n\n\t\t$string_video='';\n\n\t\tif(is_array($arr_video) && !empty($arr_video)){\n\n\t\t\tif(preg_match(\"/youtube.com/\",element('video_file',$arr_video,''))){\n\n\t\t\t\t$string_youtube=\"<iframe width='\".$width.\"' height='\".$height.\"' src='\".element('video_file',$arr_video,'').\"' frameborder='0' allowfullscreen></iframe>\";\n\t\t\t\treturn $string_youtube;\n\t\t\t}\n\n\t\t\t$string_flashvars=\"netstreambasepath=\".base_url();\n\t\t\t$string_flashvars.= \"&playlist.position=none\";\n\t\t\t$string_flashvars.= \"&playlist.size=0\";\n\t\t\t$string_flashvars.= \"&skin=\".base_url().DIR_PUBLIC.\"mediaplayer/skin/\".$skin_media;\n\t\t\t$string_flashvars.= \"&config=\".base_url().DIR_PUBLIC.\"mediaplayer/config/config.xml\";\n\t\t\t$string_flashvars.= \"&title=\".element('video_name',$arr_video,'');\n\t\t\t$string_flashvars.= \"&file=\".base_src_video(element('video_file',$arr_video,''));\n\t\t\tif(element('video_img',$arr_video,'') != \"\")\n\t\t\t\t$string_flashvars.= \"&image=\".base_src_img(element('video_img',$arr_video,''));\n\n\t\t\t$string_video=\"<object width='\".$width.\"' height='\".$height.\"' \";\n\t\t\t$string_video.= \"classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' \";\n\t\t\t$string_video.= \"codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' \";\n\t\t\t$string_video.= \"align='center' style='overflow:hidden'>\";\n\n\t\t\t$string_video.= \"<param name='movie' value='\".base_url().DIR_PUBLIC.\"mediaplayer/player.swf'>\";\n\t\t\t$string_video.= \"<param name='quality' value='high'>\";\n\t\t\t$string_video.= \"<param name='allowscriptaccess' value='always'>\";\n\t\t\t$string_video.= \"<param name='wmode' value='transparent'>\";\n\t\t\t$string_video.= \"<param name='allowfullscreen' value='true'>\";\n\t\t\t$string_video.= \"<param name='flashvars' value='\".$string_flashvars.\"'>\";\n\t\t\t$string_video.= \"<embed width='\".$width.\"' height='\".$height.\"' \";\n\t\t\t$string_video.= \"type='application/x-shockwave-flash' \";\n\t\t\t$string_video.= \"pluginspage='http://www.macromedia.com/go/getflashplayer' \";\n\t\t\t$string_video.= \"align='center' style='overflow:hidden' \";\n\n\t\t\t$string_video.= \"src='\".base_url().DIR_PUBLIC.\"mediaplayer/player.swf' \";\n\t\t\t$string_video.= \"quality='high' \";\n\t\t\t$string_video.= \"allowscriptaccess='always' \";\n\t\t\t$string_video.= \"wmode='transparent' \";\n\t\t\t$string_video.= \"allowfullscreen='true' \";\n\t\t\t$string_video.= \"flashvars='\".$string_flashvars.\"'>\";\n\t\t\t$string_video.= \"</object>\";\n\t\t}\n\t\treturn $string_video;\n\n\t}",
"function the_embed_video( $video_embed_code, $width = 500, $height = 281 ) {\n\techo get_embed_video( $video_embed_code, $width, $height );\n}",
"protected function render() {\n $settings = $this->get_settings_for_display();\n if(!empty($settings['rh_canvas_type']) && $settings['rh_canvas_type'] == 'video') {\n wp_enqueue_script('rhvideocanvas');\n if ( ! empty( $settings['rh_vid_mp4'] )) {\n $this->add_render_attribute( 'rh_vid_data', 'data-mp4', $settings['rh_vid_mp4'] );\n }else if(!empty($settings['rh_vid_mp4_inner']['url'])){\n $this->add_render_attribute( 'rh_vid_data', 'data-mp4', $settings['rh_vid_mp4_inner']['url'] );\n }\n if ( ! empty( $settings['rh_vid_webm'] )) {\n $this->add_render_attribute( 'rh_vid_data', 'data-webm', $settings['rh_vid_webm'] );\n }else if(!empty($settings['rh_vid_webm_inner']['url'])){\n $this->add_render_attribute( 'rh_vid_data', 'data-webm', $settings['rh_vid_webm_inner']['url'] );\n }\n if ( ! empty( $settings['rh_vid_ogv'] )) {\n $this->add_render_attribute( 'rh_vid_data', 'data-ogv', $settings['rh_vid_ogv'] );\n }else if(!empty($settings['rh_vid_ogv_inner']['url'])){\n $this->add_render_attribute( 'rh_vid_data', 'data-ogv', $settings['rh_vid_ogv_inner']['url'] );\n }\n if ( ! empty( $settings['rh_vid_poster'] )) {\n $this->add_render_attribute( 'rh_vid_data', 'poster', $settings['rh_vid_poster']['url'] );\n }\n if ( ! empty( $settings['rh_vid_breakpoint'] )) {\n $this->add_render_attribute( 'rh_vid_data', 'data-breakpoint', $settings['rh_vid_breakpoint'] );\n }\n if ( ! empty( $settings['rh_vid_fallback'] )) {\n $this->add_render_attribute( 'rh_vid_data', 'data-fallback', $settings['rh_vid_fallback']['url'] );\n }\n if ( ! empty( $settings['rh_vid_fallback_tablet'] )) {\n $this->add_render_attribute( 'rh_vid_data', 'data-fallback-tablet', $settings['rh_vid_fallback_tablet']['url'] );\n }\n if ( ! empty( $settings['rh_vid_fallback_mobile'] )) {\n $this->add_render_attribute( 'rh_vid_data', 'data-fallback-mobile', $settings['rh_vid_fallback_mobile']['url'] );\n }\n if ( ! empty( $settings['rh_load_iter'] )) {\n $this->add_render_attribute( 'rh_vid_data', 'data-loaditer', 'true' );\n }\n $loop = (empty( $settings['disableloop'] )) ? ' loop' : '';\n $autoplay = (empty( $settings['disableautoplay'] )) ? ' autoplay' : '';\n echo '<video'.$loop.$autoplay.' playsinline muted class=\"rh-video-canvas rh_and_canvas\" '.$this->get_render_attribute_string( 'rh_vid_data' ).'></video>';\n }else if(!empty($settings['rh_canvas_type']) && $settings['rh_canvas_type'] == 'masksvg') {\n wp_enqueue_script('rhblobcanvas');\n $widgetId = $this->get_id();\n \n if(!empty($settings['svg_image']['id'])){\n $image_url = Group_Control_Image_Size::get_attachment_image_src($settings['svg_image']['id'], 'image', $settings);\n $imageData = wp_get_attachment_image_src($settings['svg_image']['id'],'full');\n $h = $imageData[2];\n $w = $imageData[1];\n $imageProportion = $h/$w;\n $realHeight = $settings['svg_size']['size'] * $imageProportion;\n $this->add_render_attribute('_svgrapper', 'data-resize', $realHeight);\n }\n $this->add_render_attribute('_svgrapper', 'data-numpoints', $settings['numPoints']['size']);\n $this->add_render_attribute('_svgrapper', 'data-minradius', $settings['minmaxRadius']['sizes']['start']);\n $this->add_render_attribute('_svgrapper', 'data-maxradius', $settings['minmaxRadius']['sizes']['end']);\n $this->add_render_attribute('_svgrapper', 'data-minduration', $settings['minmaxDuration']['sizes']['start']);\n $this->add_render_attribute('_svgrapper', 'data-maxduration', $settings['minmaxDuration']['sizes']['end']);\n $this->add_render_attribute('_svgrapper', 'data-tensionpoints', $settings['tensionPoints']['size']);\n\n if(empty($settings['svgimage_x']['size'])){\n $posX = 0;\n }else{\n $posX = $settings['svgimage_x']['size'];\n }\n if(empty($settings['svgimage_y']['size'])){\n $posY = 0;\n }else{\n $posY = $settings['svgimage_y']['size'];\n }\n ?>\n <div data-id=\"<?php echo esc_attr($widgetId); ?>\" class=\"rh-svgblob-wrapper rh_and_canvas\" <?php echo ''.$this->get_render_attribute_string( '_svgrapper' )?>>\n <svg class=\"rh-svg-blob\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 600 600\" preserveAspectRatio=\"xMidYMid meet\" xml:space=\"preserve\">\n \n <?php if(!empty($settings['svg_image']['id']) && $settings['svgfilltype'] == 'image'){ ?>\n <defs>\n <pattern id=\"pattern-<?php echo esc_attr($widgetId); ?>\" patternUnits=\"userSpaceOnUse\" patternContentUnits=\"userSpaceOnUse\" width=\"<?php echo ''.$settings['svg_size']['size'].$settings['svg_size']['unit']; ?>\" height=\"<?php echo ''.$realHeight.$settings['svg_size']['unit']; ?>\" x=\"<?php echo ''.$posX.$settings['svgimage_x']['unit']; ?>\" y=\"<?php echo ''.$posY.$settings['svgimage_y']['unit']; ?>\">\n \n <image id=\"img-pattern\" xlink:href=\"<?php echo ''.$image_url; ?>\" width=\"<?php echo ''.$settings['svg_size']['size'].$settings['svg_size']['unit']; ?>\" height=\"<?php echo ''.$realHeight.$settings['svg_size']['unit']; ?>\"> </image>\n </pattern>\n </defs>\n <?php } ?>\n <?php if($settings['svgfilltype'] == 'gradient'){ ?>\n <defs>\n <linearGradient id=\"pattern-<?php echo esc_attr($widgetId); ?>\" x1=\"<?php echo ''.$settings['gradientx1']['size'].$settings['gradientx1']['unit']; ?>\" x2=\"<?php echo ''.$settings['gradientx2']['size'].$settings['gradientx2']['unit']; ?>\" y1=\"<?php echo ''.$settings['gradienty1']['size'].$settings['gradienty1']['unit']; ?>\" y2=\"<?php echo ''.$settings['gradienty2']['size'].$settings['gradienty2']['unit']; ?>\">\n <stop style=\"stop-color: <?php echo ''.$settings['gradientcolor1'];?>\" offset=\"0\"/>\n <stop style=\"stop-color: <?php echo ''.$settings['gradientcolor2'];?>\" offset=\"1\"/>\n </linearGradient>\n </defs>\n <?php } ?>\n\n\n <path id=\"rhblobpath-<?php echo esc_attr($widgetId); ?>\"></path>\n \n <?php if(!empty($settings['svg_image']['id']) || $settings['gradientcolor1'] != ''):?>\n <style>\n #rhblobpath-<?php echo esc_attr($widgetId); ?>{\n fill: url(#pattern-<?php echo ''.$this->get_id(); ?>);\n }\n </style>\n <?php else:?>\n <style>\n #rhblobpath-<?php echo esc_attr($widgetId); ?>{\n fill: <?php echo ''.$settings['fill_color'];?>;\n }\n </style> \n <?php endif;?>\n\n\n </svg>\n </div>\n <?php\n wp_enqueue_script('gsap');\n } \n }",
"function _static8($options)\n\t{\n\t?>\n <div id=\"slideshow\" class=\"gradient\">\n \t\t\n <div class=\"video-container\">\n\t\t\t\t\n\t\t\t\t<?php\n\t\t\t\t\t\n\t\t\t\t\tif ( $options['sc_vb_video_type'] == 'self' ) { \n\t\t\t\t\t\techo '<video autoplay class=\"video\" loop id=\"the-video\"> ';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( !empty ( $options['sc_vb_sh_video1'] ) ) { \n\t\t\t\t\t\t\t\techo '<source src=\"'.$options['sc_vb_sh_video1'].'\"/> ';\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 ( !empty ( $options['sc_vb_sh_video2'] ) ) { \n\t\t\t\t\t\t\t\techo '<source src=\"'.$options['sc_vb_sh_video2'].'\" type=\\'video/ogg; codecs=\"theora, vorbis\"\\'/> ';\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( !empty ( $options['sc_vb_sh_video_cover'] ) ) { \n\t\t\t\t\t\t\t\techo '<img src=\"'.$options['sc_vb_sh_video_cover'].'\"> ';\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t\n\t\t\t\t\t\techo '</video>';\n\t\t\t\t\t}\n\t\t\t\t\telseif ( $options['sc_vb_video_type'] == 'iframe' && !empty ( $options['sc_vb_embed'] ) ){\n\t\t\t\t\t\techo get_video_from_link( $options['sc_vb_embed'] ,'' , '400','600');\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\techo '<div class=\"captions\">';\n\t\t\t\t\t\n\t\t\t\t\t\tif ( !empty ( $options['sc_vb_line1'] ) ) { \n\t\t\t\t\t\t\techo '<span class=\"line\">'.do_shortcode($options['sc_vb_line1']).'</span>';\n\t\t\t\t\t\t} \n\t\t\t\t\t\n\t\t\t\t\t\tif ( !empty ( $options['sc_vb_line2'] ) ) { \n\t\t\t\t\t\t\techo '<span class=\"line\">'.do_shortcode($options['sc_vb_line2']).'</span>';\n\t\t\t\t\t\t} \n\t\t\t\t\t\n\t\t\t\t\techo '</div>';\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t?>\n\t\t\t\t\n </div>\n \n </div><!-- end slideshow -->\n\t<?php\n\t}",
"function plgContentplug_hwd_vs_videoplayer()\r\n\t{\r\n\t}",
"public function video(){\n\t\t$data=array();\n\t\t$this->load->view('administrador/admin_video',$data);\n\t}",
"private function youku_video() {\n\t\twp_embed_register_handler( 'embed_handler_youku', '#http://v.youku.com/v_show/id_(.*?).html#i', function($matches, $attr, $url, $rawattr){\n\t\t\t// error_log(print_r($matches, true));error_log(print_r($attr, true));error_log(print_r($url, true));error_log(print_r($rawattr, true));\n\n\t\t\t$src = 'http://player.youku.com/embed/' . $matches[1];\n\n\t\t\tif ( !empty($rawattr['width']) && !empty($rawattr['height']) ) {\n\t\t\t\t$width = (int) $rawattr['width'];\n\t\t\t\t$height = (int) $rawattr['height'];\n\t\t\t} else {\n\t\t\t\tlist( $width, $height ) = wp_expand_dimensions( 622, 350, $attr['width'], $attr['height'] );\n\t\t\t}\n\n\t\t\t$html = '<div class=\"embed-responsive embed-responsive-16by9\"><iframe height=' . esc_attr($height) . ' width=' . esc_attr($width) . ' src=\"' . esc_attr($src) . '\" frameborder=0 allowfullscreen></iframe></div>';\n\n\t\t\treturn apply_filters( 'embed_youku', $html, $matches, $attr, $url, $rawattr);\n\t\t});\n\t}",
"function show_video_active($arr_cate_id,$menu_class,$cate_lang,$width,$height,$skin_media='default.zip'){\n\n\t\t$str_select=\"*\";\n\t\t$arr_where=array($this->_table.'.video_public'=>1,$this->_table.'.video_active'=>1,'category_sub.menu_class'=>$menu_class,'category_sub.cate_lang'=>$cate_lang,'category_sub.cate_public'=>1);\n\n\t\t$this->db->select($str_select);\n\t\t$this->db->join('category_sub',$this->_table.'.cate_id=category_sub.cate_id');\n\t\t$this->db->where($arr_where);\n\t\t$this->db->where_in($this->_table.'.cate_id',$arr_cate_id);\n\n\t\t$query=$this->db->get($this->_table);\n\t\t$arr_video=$query->row_array();\n\n\t\t$string_video='';\n\n\t\tif(is_array($arr_video) && !empty($arr_video)){\n\n\t\t\tif(preg_match(\"/youtube.com/\",element('video_file',$arr_video,''))){\n\n\t\t\t\t$string_youtube=\"<iframe width='\".$width.\"' height='\".$height.\"' src='\".element('video_file',$arr_video,'').\"' frameborder='0' allowfullscreen></iframe>\";\n\t\t\t\treturn $string_youtube;\n\t\t\t}\n\n\t\t\t$string_flashvars=\"netstreambasepath=\".base_url();\n\t\t\t$string_flashvars.= \"&playlist.position=none\";\n\t\t\t$string_flashvars.= \"&playlist.size=0\";\n\t\t\t$string_flashvars.= \"&skin=\".base_url().DIR_PUBLIC.\"mediaplayer/skin/\".$skin_media;\n\t\t\t$string_flashvars.= \"&config=\".base_url().DIR_PUBLIC.\"mediaplayer/config/config.xml\";\n\t\t\t$string_flashvars.= \"&title=\".element('video_name',$arr_video,'');\n\t\t\t$string_flashvars.= \"&file=\".base_src_video(element('video_file',$arr_video,''));\n\t\t\tif(element('video_img',$arr_video,'') != \"\")\n\t\t\t\t$string_flashvars.= \"&image=\".base_src_img(element('video_img',$arr_video,''));\n\n\t\t\t$string_video=\"<object width='\".$width.\"' height='\".$height.\"' \";\n\t\t\t$string_video.= \"classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' \";\n\t\t\t$string_video.= \"codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' \";\n\t\t\t$string_video.= \"align='center' style='overflow:hidden'>\";\n\n\t\t\t$string_video.= \"<param name='movie' value='\".base_url().DIR_PUBLIC.\"mediaplayer/player.swf'>\";\n\t\t\t$string_video.= \"<param name='quality' value='high'>\";\n\t\t\t$string_video.= \"<param name='allowscriptaccess' value='always'>\";\n\t\t\t$string_video.= \"<param name='wmode' value='transparent'>\";\n\t\t\t$string_video.= \"<param name='allowfullscreen' value='true'>\";\n\t\t\t$string_video.= \"<param name='flashvars' value='\".$string_flashvars.\"'>\";\n\t\t\t$string_video.= \"<embed width='\".$width.\"' height='\".$height.\"' \";\n\t\t\t$string_video.= \"type='application/x-shockwave-flash' \";\n\t\t\t$string_video.= \"pluginspage='http://www.macromedia.com/go/getflashplayer' \";\n\t\t\t$string_video.= \"align='center' style='overflow:hidden' \";\n\n\t\t\t$string_video.= \"src='\".base_url().DIR_PUBLIC.\"mediaplayer/player.swf' \";\n\t\t\t$string_video.= \"quality='high' \";\n\t\t\t$string_video.= \"allowscriptaccess='always' \";\n\t\t\t$string_video.= \"wmode='transparent' \";\n\t\t\t$string_video.= \"allowfullscreen='true' \";\n\t\t\t$string_video.= \"flashvars='\".$string_flashvars.\"'>\";\n\t\t\t$string_video.= \"</object>\";\n\t\t}\n\t\treturn $string_video;\n\n\t}",
"function getVideoEmebed($url, $config, $width, $height) {\r\n\t\t$uniqueUid = ' rgmi'.$this->getUniqueID().' '; \r\n\t\t$video = '<span class=\"rgmediaimages-player'.$uniqueUid.'\">\r\n <embed src=\"'.t3lib_extMgm::siteRelpath('rgmediaimages').'res/mediaplayer.swf\" width=\"'.$width.'\" height=\"'.$height.'\" allowfullscreen=\"true\" allowscriptaccess=\"always\" flashvars=\"&file='.$url.'&'.$config.'\" />\r\n </span>';\r\n\t\treturn $video;\t\r\n\t}",
"function fa_video_output( $video, $before = '', $after = '', $with_assets = true, $echo = true ){\t\n\t$width \t\t= $video['width'];\n\t$height \t= fa_player_height( $video['aspect'] , $video['width'] );\n\t$exclude \t= array('width', 'aspect');\n\t\n\t$styles = array(\n\t\t'width: 100%',\n\t\t'height:' . $height . 'px',\n\t\t'max-width:' . $width . 'px' \n\t);\n\t\n\t$el_data = array();\n\tforeach( $video as $k => $v ){\n\t\tif( in_array( $k, $exclude ) ){\n\t\t\tcontinue;\n\t\t}\n\t\t// booleans get converted to 0 or 1\n\t\tif( is_bool( $v ) ){\n\t\t\t$v = (int) $v;\n\t\t}\n\t\t\n\t\t$el_data[] = 'data-' . $k . '=\"' . $v . '\"';\n\t}\n\t\n\t$el_data[] = 'data-ssl=\"' . (int) is_ssl() . '\"';\n\t\n\t$output = $before . '<div class=\"fa-video-player\" style=\"' . implode('; ', $styles) . '\" ' . implode(' ', $el_data) . '><!-- video container --></div>' . $after;\n\tif( $echo ){\n\t\techo $output;\n\t}\n\t\n\tif( $with_assets ){\n\t\tfa_load_style('video-player');\n\t\tfa_load_script('video-player2', array( 'jquery' ) );\n\t\t/**\n\t\t * Video player script action. Allows third party plugins to load\n\t\t * other assets.\n\t\t */\n\t\tdo_action( 'fa_embed_video_script_enqueue' );\t\t\n\t}\n\t\n\treturn $output;\t\n}",
"protected function render() {\n wp_enqueue_style('autostop-video-css');\n\n $settings = $this->get_settings_for_display();\n\n\n $video_url = $this->get_hosted_video_url();\n\n if ( empty( $video_url ) ) {\n return;\n }\n\n ob_start();\n\n $this->render_hosted_video();\n\n $video_html = ob_get_clean();\n\n\n if ( empty( $video_html ) ) {\n echo esc_url( $video_url );\n\n return;\n }\n\n $this->add_render_attribute( 'video-wrapper', 'class', 'elementor-wrapper' );\n\n if ( ! $settings['lightbox'] ) {\n $this->add_render_attribute( 'video-wrapper', 'class', 'elementor-fit-aspect-ratio' );\n }\n\n $this->add_render_attribute( 'video-wrapper', 'class', 'elementor-open-' . ( $settings['lightbox'] ? 'lightbox' : 'inline' ) );\n\n\n if ( ! empty( $settings['link']['url'] ) ) {\n $this->add_render_attribute( 'button', 'href', $settings['link']['url'] );\n $this->add_render_attribute( 'button', 'class', 'elementor-button-link' );\n\n if ( $settings['new_tab'] == \"yes\" ) {\n $this->add_render_attribute( 'button', 'target', '_blank' );\n }\n }\n $this->add_render_attribute( 'button', 'class', 'elementor-button' );\n $this->add_render_attribute( 'button', 'role', 'button' );\n if ( ! empty( $settings['button_css_id'] ) ) {\n $this->add_render_attribute( 'button', 'id', $settings['button_css_id'] );\n }\n if ( ! empty( $settings['size'] ) ) {\n $this->add_render_attribute( 'button', 'class', 'elementor-size-' . $settings['size'] );\n }\n if ( $settings['hover_animation'] ) {\n $this->add_render_attribute( 'button', 'class', 'elementor-animation-' . $settings['hover_animation'] );\n }\n\n ?>\n <div <?php echo $this->get_render_attribute_string( 'video-wrapper' ); ?>>\n\n <?php if($settings['overlay_block'] == \"yes\"): ?>\n\n <div class=\"super-video-stopper\" id=\"video-stopper-<?php echo($this->get_id()); ?>\"\n <?php if(!(\\Elementor\\Plugin::$instance->preview->is_preview_mode() || \\Elementor\\Plugin::$instance->editor->is_edit_mode())){echo ('style=\"display:none;\"');} ?> >\n <div>\n <center>\n <div class=\"elementor-heading-title\">\n <?php echo($settings['title_text']); ?>\n </div>\n <div class=\"elementor-widget-container\">\n <div class=\"elementor-button-wrapper\">\n <a <?php echo $this->get_render_attribute_string( 'button' ); ?>>\n <?php $this->render_text(); ?>\n </a>\n </div>\n </div>\n </center>\n </div>\n </div>\n\n <?php endif; ?>\n\n\n <?php\n if ( ! $settings['lightbox'] ) {\n echo $video_html; // XSS ok.\n }\n\n if ( $this->has_image_overlay() ) {\n $this->add_render_attribute( 'image-overlay', 'class', 'elementor-custom-embed-image-overlay' );\n\n if ( $settings['lightbox'] ) {\n $lightbox_url = $video_url;\n\n $lightbox_options = [\n 'type' => 'video',\n 'videoType' => 'hosted',\n 'url' => $lightbox_url,\n 'modalOptions' => [\n 'id' => 'elementor-lightbox-' . $this->get_id(),\n 'entranceAnimation' => $settings['lightbox_content_animation'],\n 'entranceAnimation_tablet' => $settings['lightbox_content_animation_tablet'],\n 'entranceAnimation_mobile' => $settings['lightbox_content_animation_mobile'],\n 'videoAspectRatio' => $settings['aspect_ratio'],\n ],\n ];\n\n $lightbox_options['videoParams'] = $this->get_hosted_params();\n\n $this->add_render_attribute( 'image-overlay', [\n 'data-elementor-open-lightbox' => 'yes',\n 'data-elementor-lightbox' => wp_json_encode( $lightbox_options ),\n ] );\n\n if ( Plugin::$instance->editor->is_edit_mode() ) {\n $this->add_render_attribute( 'image-overlay', [\n 'class' => 'elementor-clickable',\n ] );\n }\n } else {\n $this->add_render_attribute( 'image-overlay', 'style', 'background-image: url(' . \\Elementor\\Group_Control_Image_Size::get_attachment_image_src( $settings['image_overlay']['id'], 'image_overlay', $settings ) . ');' );\n }\n ?>\n <div <?php echo $this->get_render_attribute_string( 'image-overlay' ); ?>>\n <?php if ( $settings['lightbox'] ) : ?>\n <?php echo \\Elementor\\Group_Control_Image_Size::get_attachment_image_html( $settings, 'image_overlay' ); ?>\n <?php endif; ?>\n\n\n\n <?php if ( 'yes' === $settings['show_play_icon'] ) : ?>\n <div class=\"elementor-custom-embed-play\" role=\"button\">\n <i class=\"eicon-play\" aria-hidden=\"true\"></i>\n <span class=\"elementor-screen-only\"><?php echo __( 'Play Video', 'yx-super-cat' ); ?></span>\n </div>\n <?php endif; ?>\n </div>\n <?php } ?>\n </div>\n <script>\n var $jq = jQuery.noConflict();\n var video = $jq(\"#video-<?php echo($this->get_id()); ?>\");\n var stopper = $jq(\"#video-stopper-<?php echo($this->get_id()); ?>\");\n var end = parseInt(\"<?php echo($settings['end']); ?>\");\n var interval_<?php echo($this->get_id()); ?> = setInterval(function(){\n if(end && video.get(0).currentTime >= end){\n if(video.get(0).webkitExitFullScreen){video.get(0).webkitExitFullScreen()}\n if(document.webkitExitFullscreen){document.webkitExitFullscreen()}\n if(document.mozCancelFullscreen){document.mozCancelFullscreen()}\n if(document.exitFullscreen){document.exitFullscreen()}\n if (document.exitPictureInPicture){document.exitPictureInPicture()}\n video.get(0).pause();\n <?php\n //window.elementorProFrontend.modules.linkActions.runAction(\"#elementor-action%3Aaction%3Dpopup%3Aopen%20settings%3DeyJpZCI6IjI2MSIsInRvZ2dsZSI6ZmFsc2V9\");\n if($settings['auto_open'] == \"yes\"){\n if(substr($settings[\"auto_link\"][\"url\"], 0, 17) == \"#elementor-action\"){\n echo('window.elementorProFrontend.modules.linkActions.runAction(\"'.$settings[\"auto_link\"][\"url\"].'\");');\n }else{\n echo('window.location = \"'.$settings[\"auto_link\"][\"url\"].'\";');\n }\n }\n if($settings['overlay_block'] == \"yes\"){\n echo('$jq(\"#video-stopper-' . $this->get_id() . '\").show();');\n }\n\n ?>\n clearInterval(interval_<?php echo($this->get_id()); ?>);\n }\n }, 300);\n </script>\n <?php\n }",
"function getMov($url, $width, $height) {\r\n\t\t$url = trim($url);\r\n\t\t$url = str_replace('http://', '', $url);\r\n\t\r\n\t\t$height = $height+16;\r\n $video = '<object classid=\"clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B\" codebase=\"http://www.apple.com/qtactivex/qtplugin.cab\" width=\"'.$width.'\" height=\"'.$height.'\" >\r\n <param name=\"src\" value=\"http://'.$url.'\">\r\n <param name=\"autoplay\" value=\"true\">\r\n <param name=\"type\" value=\"video/quicktime\" width=\"'.$width.'\" height=\"'.$height.'\"> \r\n <embed src=\"http://'.$url.'\" width=\"'.$width.'\" height=\"'.$height.'\" autoplay=\"false\" type=\"video/quicktime\" pluginspage=\"http://www.apple.com/quicktime/download/\">\r\n </object>';\r\n return $video;\r\n\t}",
"function sp_video_sc( $atts ) {\n\n\textract( shortcode_atts( array(\n\t\t'mp4' => '',\n\t\t'webm' => '',\n\t\t'ogg' => '',\n\t\t'track' => '',\n\t\t'poster' => '',\n\t\t'aspect_ratio' => '1.7',\n\t\t'preload' => false,\n\t\t'autoplay' => false,\n\t), $atts ) );\n\n\tglobal $post;\n\n\tif ( $mp4 )\n\t\t$mp4 = '<source src=\"' . $mp4 . '\" type=\"video/mp4\" />';\n\n\tif ( $webm )\n\t\t$webm = '<source src=\"' . $webm . '\" type=\"video/webm\" />';\n\n\tif ( $ogg )\n\t\t$ogg = '<source src=\"' . $ogg . '\" type=\"video/ogg\" />';\n\n\tif ( $track)\n\t\t$track = '<track kind=\"subtitles\" src=\"' . $track . '\" srclang=\"en\" label=\"English\">';\n\n\tif ( $poster)\n\t\t$poster = ' poster=\"' . $poster . '\"';\n\n\tif ( $preload )\n\t\t$preload = 'preload=\"' . $preload . '\"';\n\n\tif ( $autoplay )\n\t\t$autoplay = 'autoplay';\n\t\t\n\t$output = \"<video id='video-js-id-$post->ID' class='video-js vjs-default-skin' width='700' height='405' controls {$preload} {$autoplay} {$poster} data-setup='{}' data-aspect-ratio='{$aspect_ratio}'>\n\t\t\t{$mp4}\n\t\t\t{$webm}\n\t\t\t{$ogg}\n\t\t\t{$track}\n\t\t</video>\";\n\treturn $output;\t\n\n}",
"public function show(Video $video)\n {\n //\n }",
"public function show(Video $video)\n {\n //\n }",
"public function show(Video $video)\n {\n //\n }",
"public function show(Video $video)\n {\n //\n }",
"public function myvideo_render_main_screen_function() {\n\t\t\\add_action( 'bp_template_content', array( $this, 'bp_myvideo_tab_action' ) );\n\t\t\\bp_core_load_template( \\apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );\n\t}",
"function videoScreen($video,$screenshot,$ss=1,$tw=320,$th=180 , $q=0)\n{\n\tshell_exec(\"ffmpeg -i \".escapeshellarg($video).\" -an -ss $ss -q $q -crf $q -vframes 1 -y \".escapeshellarg($screenshot).\" 2>&1\"); \n\n\tif(getimagesize($thumbnail))\n\t{\n\t\treturn true;\n\t}\n\t\telse\n\t{\n\t\treturn false;\n\t}\n}",
"function grve_print_portfolio_video( $video_mode = '' ) {\n\n\t$video_webm = grve_post_meta( 'grve_portfolio_video_webm' );\n\t$video_mp4 = grve_post_meta( 'grve_portfolio_video_mp4' );\n\t$video_ogv = grve_post_meta( 'grve_portfolio_video_ogv' );\n\t$video_embed = grve_post_meta( 'grve_portfolio_video_embed' );\n\n\tgrve_print_media_video( $video_mode, $video_webm, $video_mp4, $video_ogv, $video_embed );\n}",
"function bb_video($arguments = array()) {\n\t\t$content = $this->parseArray(array('[/video]'), array());\n\n\t\t$params['width'] = 570;\n\t\t$params['height'] = 360;\n\t\t$params['iframe'] = true;\n\t\t$previewthumb = '';\n\n\t\t$type = null;\n\t\t$id = null;\n\t\t$matches = array();\n\n\t\t//match type and id\n\t\tif (strstr($content, 'youtube.com') OR strstr($content, 'youtu.be')) {\n\t\t\t$type = 'youtube';\n\t\t\tif (preg_match('#(?:youtube\\.com/watch\\?v=|youtu.be/)([0-9a-zA-Z\\-_]{11})#', $content, $matches) > 0) {\n\t\t\t\t$id = $matches[1];\n\t\t\t}\n\t\t\t$params['src'] = '//www.youtube.com/embed/' . $id . '?autoplay=1';\n\t\t\t$previewthumb = 'https://img.youtube.com/vi/' . $id . '/0.jpg';\n\t\t} elseif (strstr($content, 'vimeo')) {\n\t\t\t$type = 'vimeo';\n\t\t\tif (preg_match('#vimeo\\.com/(?:clip\\:)?(\\d+)#', $content, $matches) > 0) {\n\t\t\t\t$id = $matches[1];\n\t\t\t}\n\t\t\t$params['src'] = '//player.vimeo.com/video/' . $id . '?autoplay=1';\n\n\t\t\t$videodataurl = 'http://vimeo.com/api/v2/video/' . $id . '.php';\n\t\t\t$data = '';\n\t\t\t$downloader = new UrlDownloader;\n\t\t\tif ($downloader->isAvailable()) {\n\t\t\t\t$data = $downloader->file_get_contents($videodataurl);\n\t\t\t}\n\t\t\tif ($data) {\n\t\t\t\t$data = unserialize($data);\n\t\t\t\t$previewthumb = $data[0]['thumbnail_medium'];\n\t\t\t}\n\t\t} elseif (strstr($content, 'dailymotion')) {\n\t\t\t$type = 'dailymotion';\n\t\t\tif (preg_match('#dailymotion\\.com/video/([a-z0-9]+)#', $content, $matches) > 0) {\n\t\t\t\t$id = $matches[1];\n\t\t\t}\n\t\t\t$params['src'] = '//www.dailymotion.com/embed/video/' . $id . '?autoPlay=1';\n\t\t\t$previewthumb = 'http://www.dailymotion.com/thumbnail/video/' . $id;\n\t\t} elseif (strstr($content, 'godtube')) {\n\t\t\t$type = 'godtube';\n\t\t\tif (preg_match('#godtube\\.com/watch/\\?v=([a-zA-Z0-9]+)#', $content, $matches) > 0) {\n\t\t\t\t$id = $matches[1];\n\t\t\t}\n\t\t\t$params['id'] = $id;\n\t\t\t$params['iframe'] = false;\n\n\t\t\t$previewthumb = 'http://www.godtube.com/resource/mediaplayer/' . $id . '.jpg';\n\t\t}\n\n\t\tif (empty($type) OR empty($id)) {\n\t\t\treturn '[video] Niet-ondersteunde video-website (' . htmlspecialchars($content) . ')';\n\t\t}\n\t\treturn $this->video_preview($params, $previewthumb);\n\t}",
"function signage_panes_video_render($subtype, $conf, $panel_args, $context = NULL) {\n $block = new stdClass();\n\n // Set default value of video_playlist in case we have existing\n // video panes.\n if (!isset($conf['video_playlist'])) {\n $conf['video_playlist'] = 0;\n }\n\n // Determine which provider to build for.\n switch ($conf['video_provider']) {\n case 0:\n if ($conf['video_playlist']) {\n // Extract the playlistID from the video embed code.\n preg_match(YOUTUBE_PLAYLIST_REGEX_PATTERN, $conf['video_embed_code'], $matches);\n $vid = $matches[1];\n } else {\n // Extract the videoID from the video embed code.\n preg_match(YOUTUBE_REGEX_PATTERN, $conf['video_embed_code'], $matches);\n $vid = $matches[1];\n }\n\n // Rebuild the URL according to newest standard using admin settings for parameters.\n if ($conf['video_playlist']) {\n $url = '//www.youtube.com/embed?listType=playlist&list=' . $vid . '&';\n } else {\n $url = '//www.youtube.com/embed/' . $vid . '?';\n }\n\n $params = '';\n $params .= 'theme=' . variable_get('signage_panes_video_youtube_theme') . '&';\n $params .= 'autoplay=' . variable_get('signage_panes_video_youtube_autoplay') . '&';\n $params .= 'loop=' . variable_get('signage_panes_video_youtube_loop') . '&';\n $params .= 'vq=' . variable_get('signage_panes_video_youtube_vq') . '&';\n $params .= 'rel=' . variable_get('signage_panes_video_youtube_rel') . '&';\n $params .= 'showinfo=' . variable_get('signage_panes_video_youtube_showinfo') . '&';\n $params .= 'modestbranding=' . variable_get('signage_panes_video_youtube_modestbranding') . '&';\n $params .= 'cc_load_policy=' . variable_get('signage_panes_video_youtube_cc_load_policy') . '&';\n $params .= 'iv_load_policy=' . variable_get('signage_panes_video_youtube_iv_load_policy') . '&';\n $params .= 'controls=' . variable_get('signage_panes_video_youtube_controls') . '&';\n $params .= 'autohide=' . variable_get('signage_panes_video_youtube_autohide');\n\n if (!$conf['video_playlist']) {\n $params .= '&playlist=' . $vid;\n }\n\n // Recreate embed code based on most recent IFrame version of the HTML5 player from YouTube provider.\n $embed_code = 'width=' . variable_get('signage_panes_video_youtube_width') .\n ' height=' . variable_get('signage_panes_video_youtube_height') .\n ' src=' . $url . '' . $params .\n ' frameborder=0 allowfullscreen=false';\n\n break;\n\n case 1:\n // Extract the videoID from the video embed code.\n preg_match(VIMEO_REGEX_PATTERN, $conf['video_embed_code'], $matches);\n $vid = $matches[1];\n\n // Rebuild the URL according to newest standard using admin settings for\n // parameters.\n $url = '//player.vimeo.com/video/' . $vid;\n $params = '';\n $params .= 'autoplay=' . variable_get('signage_panes_video_vimeo_autoplay') . '&';\n $params .= 'loop=' . variable_get('signage_panes_video_vimeo_loop') . '&';\n $params .= 'color=' . variable_get('signage_panes_video_vimeo_color') . '&';\n $params .= 'portrait=' . variable_get('signage_panes_video_vimeo_portrait') . '&';\n $params .= 'title=' . variable_get('signage_panes_video_vimeo_title') . '&';\n $params .= 'byline=' . variable_get('signage_panes_video_vimeo_byline');\n\n // Recreate embed code based on most recent IFrame version of the HTML5\n // player from Vimeo provider.\n $embed_code = 'src=' . $url . '?' . $params .\n ' width=' . variable_get('signage_panes_video_vimeo_width') .\n ' height=' . variable_get('signage_panes_video_vimeo_height') .\n ' frameborder=0 webkitallowfullscreen mozallowfullscreen allowfullscreen';\n\n break;\n }\n\n // Create the block settings.\n $block->title = '';\n $block->content = '\n <div class=\"flexible-container\">\n\t <iframe ' . $embed_code . '></iframe>\n\t</div>\n ';\n\n return $block;\n}",
"function vcex_video_oembed( $video = '', $classes = '', $params = array() ) {\n\tif ( function_exists( 'wpex_video_oembed' ) ) {\n\t\treturn wpex_video_oembed( $video, $classes, $params );\n\t}\n\treturn wp_oembed_get( $video );\n}",
"function show_list_video($arr_cate_id,$menu_class,$cate_lang,$width,$height,$skin_media='default.zip'){\n\n\t\t$str_select=\"*\";\n\t\t$arr_where=array($this->_table.'.video_public'=>1,'category_sub.menu_class'=>$menu_class,'category_sub.cate_lang'=>$cate_lang,'category_sub.cate_public'=>1);\n\t\t$str_order=$this->_table.'.video_order asc';\n\t\t$str_order_1=$this->_table.'.video_update_date desc';\n\n\t\t$this->db->select($str_select);\n\t\t$this->db->join('category_sub',$this->_table.'.cate_id=category_sub.cate_id');\n\t\t$this->db->where($arr_where);\n\t\t$this->db->where_in($this->_table.'.cate_id',$arr_cate_id);\n\t\t$this->db->order_by($str_order);\n\t\t$this->db->order_by($str_order_1);\n\n\t\t$query=$this->db->get($this->_table);\n\t\t$arr_video=$query->result_array();\n\n\t\t$string_video='';\n\t\t$string_youtube='';\n\n\t\tif(is_array($arr_video) && !empty($arr_video)){\n\n\t\t\t$string_flashvars=\"netstreambasepath=\".base_url();\n\t\t\t$string_flashvars.= \"&skin=\".base_url().DIR_PUBLIC.\"mediaplayer/skin/\".$skin_media;\n\t\t\t$string_flashvars.= \"&config=\".base_url().DIR_PUBLIC.\"mediaplayer/config/config.xml\";\n\t\t\t$string_flashvars.= \"&playlist=\";\n\t\t\t$string_flashvars_json=\"[[JSON]][\";\n\n\t\t\t$string_flashvars_temp=\"\";\n\t\t\tforeach($arr_video as $key=> $value){\n\n\t\t\t\tif(preg_match(\"/youtube.com/\",element('video_file',$value,''))){\n\n\t\t\t\t\t$string_youtube.=\"<div class='object_video_youtube'><iframe width='\".$width.\"' height='\".$height.\"' src='\".element('video_file',$value,'').\"' frameborder='0' allowfullscreen></iframe></div>\";\n\t\t\t\t}\n\t\t\t\telse{\n\n\t\t\t\t\t$string_flashvars_temp.= \"{\";\n\t\t\t\t\t$string_flashvars_temp.= \"\\\"file\\\":\\\"\".base_src_video(element('video_file',$value,'')).\"\\\",\";\n\t\t\t\t\t$string_flashvars_temp.= \"\\\"title\\\":\\\"\".element('video_name',$value,'').\"\\\"\";\n\t\t\t\t\tif(element('video_img',$value,'') != \"\")\n\t\t\t\t\t\t$string_flashvars_temp.= \",\\\"image\\\":\\\"\".base_src_img(element('video_img',$value,'')).\"\\\"\";\n\t\t\t\t\t$string_flashvars_temp.= \"},\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$string_flashvars_temp=$string_flashvars_json.substr($string_flashvars_temp,0,-1);\n\t\t\t$string_flashvars_temp.= \"]\";\n\t\t\t$string_flashvars_temp=rawurlencode($string_flashvars_temp);\n\n\t\t\t$string_flashvars.=$string_flashvars_temp;\n\n\t\t\t$string_video=\"<object width='\".$width.\"' height='\".$height.\"' \";\n\t\t\t$string_video.= \"classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' \";\n\t\t\t$string_video.= \"codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0' \";\n\t\t\t$string_video.= \"align='center' style='overflow:hidden'>\";\n\n\t\t\t$string_video.= \"<param name='movie' value='\".base_url().DIR_PUBLIC.\"mediaplayer/player.swf'>\";\n\t\t\t$string_video.= \"<param name='quality' value='high'>\";\n\t\t\t$string_video.= \"<param name='allowscriptaccess' value='always'>\";\n\t\t\t$string_video.= \"<param name='wmode' value='transparent'>\";\n\t\t\t$string_video.= \"<param name='allowfullscreen' value='true'>\";\n\t\t\t$string_video.= \"<param name='flashvars' value='\".$string_flashvars.\"'>\";\n\t\t\t$string_video.= \"<embed width='\".$width.\"' height='\".$height.\"' \";\n\t\t\t$string_video.= \"type='application/x-shockwave-flash' \";\n\t\t\t$string_video.= \"pluginspage='http://www.macromedia.com/go/getflashplayer' \";\n\t\t\t$string_video.= \"align='center' style='overflow:hidden' \";\n\n\t\t\t$string_video.= \"src='\".base_url().DIR_PUBLIC.\"mediaplayer/player.swf' \";\n\t\t\t$string_video.= \"quality='high' \";\n\t\t\t$string_video.= \"allowscriptaccess='always' \";\n\t\t\t$string_video.= \"wmode='transparent' \";\n\t\t\t$string_video.= \"allowfullscreen='true' \";\n\t\t\t$string_video.= \"flashvars='\".$string_flashvars.\"'>\";\n\t\t\t$string_video.= \"</object>\";\n\t\t}\n\t\treturn $string_video.$string_youtube;\n\n\t}",
"public function render()\n {\n return view('components.video');\n }",
"public function videogame()\n {\n // TODO\n }",
"function emvideo_dotsub_video($embed, $width, $height, $field, $item, $node, $autoplay) {\n $output = theme('emvideo_dotsub_flash', $item, $width, $height, $autoplay);\n return $output;\n}",
"function dm_brightcove_embed_shortcode($atts) {\n\textract(shortcode_atts(array(\n\t\t'width' => 400,\n\t\t'height' => 220,\n\t\t'player_id' => '1083378382001',\n\t\t'player_key' => 'AQ~~,AAAA7SJlvPE~,hKj__M4BL26l6pXW6JlVCmbP5q8je1e_',\n\t\t'video_id' => ''\n\t), $atts));\n\n\tob_start();\n?>\n\t<div class=\"brightcove_video\">\n\t\t<script src=\"http://admin.brightcove.com/js/BrightcoveExperiences.js\"></script>\n\t\t<object id=\"myExperience<?php echo $video_id; ?>\" class=\"BrightcoveExperience\">\n\t\t\t<param name=\"bgcolor\" value=\"#FFFFFF\" />\n\t\t\t<param name=\"width\" value=\"<?php echo $width; ?>\" />\n\t\t\t<param name=\"height\" value=\"<?php echo $height; ?>\" />\n\t\t\t<param name=\"playerID\" value=\"<?php echo $player_id; ?>\" />\n\t\t\t<param name=\"playerKey\" value=\"<?php echo $player_key; ?>\" />\n\t\t\t<param name=\"isVid\" value=\"true\" />\n\t\t\t<param name=\"isUI\" value=\"true\" />\n\t\t\t<param name=\"dynamicStreaming\" value=\"true\" />\n\t\t\t<param name=\"@videoPlayer\" value=\"<?php echo $video_id; ?>\" />\n\t\t</object>\n\t\t<script>\n\t\t\tbrightcove.createExperiences();\n\t\t</script>\n\t</div>\n<?php\n\t$output = ob_get_clean();\n\treturn $output;\n}",
"private function putFullWidthVideoLayer( $videoData ) {\n\n\t\t/*\n\t\tif($videoData[\"found\"] == false)\n return(false);\n\n $autoplayonlyfirsttime = \"\";\n $autoplay = UniteFunctionsRev::boolToStr($videoData[\"autoplay\"]);\n if($autoplay == \"true\"){\n $autoplayonlyfirsttime = UniteFunctionsRev::boolToStr($videoData[\"autoplayonlyfirsttime\"]);\n $autoplayonlyfirsttime = ' data-autoplayonlyfirsttime=\"'. $autoplayonlyfirsttime.'\"';\n }\n $nextslide = UniteFunctionsRev::boolToStr($videoData[\"nextslide\"]);\n\n $htmlParams = 'data-x=\"0\" data-y=\"0\" data-speed=\"500\" data-start=\"10\" data-easing=\"easeOutBack\"';\n\n if($videoData[\"previewimage\"] != '') $htmlParams.= ' data-videoposter=\"'.$videoData[\"previewimage\"].'\"';\n\n $videoID = $videoData[\"videoID\"];\n\n $setBase = (is_ssl()) ? \"https://\" : \"http://\";\n\n $mute = (UniteFunctionsRev::strToBool($videoData['mute'])) ? ' data-volume=\"mute\"' : '';\n\n if($videoData[\"type\"] == \"youtube\"): //youtube\n ?> <div class=\"tp-caption fade fullscreenvideo \" data-nextslideatend=\"<?php echo $nextslide?>\" data-autoplay=\"<?php echo $autoplay?>\"<?php echo $autoplayonlyfirsttime; ?> <?php echo $htmlParams?><?php echo $mute; ?>><iframe src=\"<?php echo $setBase; ?>www.youtube.com/embed/<?php echo $videoID?>?enablejsapi=1&version=3&html5=1&hd=1&controls=1&showinfo=0;\" allowfullscreen=\"true\" width=\"100%\" height=\"100%\"></iframe></div><?php\n else: //vimeo\n ?> <div class=\"tp-caption fade fullscreenvideo\" data-nextslideatend=\"<?php echo $nextslide?>\" data-autoplay=\"<?php echo $autoplay?>\"<?php echo $autoplayonlyfirsttime; ?> <?php echo $htmlParams?><?php echo $mute; ?>><iframe src=\"<?php echo $setBase; ?>player.vimeo.com/video/<?php echo $videoID?>?title=0&byline=0&portrait=0;api=1\" width=\"100%\" height=\"100%\"></iframe></div><?php\n\t\tendif;*/\n\t}",
"function VideoLink($vdetails,$type=NULL)\r\n{\r\n return video_link($vdetails,$type);\r\n}",
"public function embed_video() {\r\n\t\tglobal $wp_embed;\r\n\t\treturn $wp_embed->run_shortcode( '[embed]'. $this->video .'[/embed]' );\r\n\t}",
"function getVideos($url, $width, $height, $config) {\r\n \t$video = '';\r\n\r\n\t\t$url = trim($url);\r\n\t\t$url = str_replace('http://', '', $url);\r\n\r\n // youtube\r\n if (strpos($url,'outube.com')) {\r\n $found = 1;\r\n $split = explode('=',$url);\r\n $video = 'new SWFObject(\"http://www.youtube.com/v/'.$split[1].'\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");';\r\n // Dailymotion\r\n } elseif (strpos($url,'ailymotion.co')) {\r\n $found = 1;\r\n $video = 'new SWFObject(\"http://'.$url.'\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");';\r\n // video.google.com/.de\r\n } elseif (strpos($url,'ideo.google.')) {\r\n $found = 1; \r\n $split = explode('=',$url);\r\n $video = 'new SWFObject(\"http://video.google.com/googleplayer.swf?docId='.$split[1].'&hl='.$GLOBALS['TSFE']->lang.'\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");'; \r\n // Metacafe\r\n } elseif (strpos($url,'metacafe.')) {\r\n $found = 1;\r\n $split = explode('/',$url);\r\n $video = 'new SWFObject(\"http://www.metacafe.com/fplayer/'.$split[2].'/.swf\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");'; \r\n // MyVideo.de\r\n } elseif (strpos($url,'yvideo.de')) {\r\n $found = 1;\r\n $split = explode('/',$url);\r\n $video = 'new SWFObject(\"http://www.myvideo.de/movie/'.$split[2].'\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");'; \r\n // clipfish.de\r\n\t\t} elseif (strpos($url,'lipfish.de')) {\r\n $found = 1;\r\n $split = explode('=',$url);\r\n $video = 'new SWFObject(\"http://www.clipfish.de/videoplayer.swf?as=0&videoid='.$split[1].'\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");'; \r\n\t\t// sevenload\r\n\t\t} elseif (strpos($url,'sevenload.com')) {\r\n $found = 1;\r\n $split = explode('/',$url);\r\n $video = 'new SWFObject(\"http://de.sevenload.com/pl/'.$split[2].'/'.$width.'x'.$height.'/swf\", \"sfwvideo\", \"'.$width.'\",\"'.$height.'\", \"9\", \"#'.$config['backgroundColor'].'\", \"wmode\", \"transparent\");'; \r\n } \r\n\r\n\t\treturn $video;\r\n\t}",
"function mytheme_video($file, $image, $width, $height, $color){\r\n\r\n\t//Template URL\r\n\t$template_url = get_template_directory_uri();\r\n\t\r\n\t//Unique ID\r\n\t$id = \"video-\".gener_random(15);\r\n\t\r\n\t$object_height = $height + 39;\r\n\r\n\t//JS\r\n\t$output = '<script type=\"text/javascript\">'.\"\\n\";\r\n\t$output .= 'var flashvars = {};'.\"\\n\";\r\n\t$output .= 'flashvars.player_width=\"'.$width.'\";'.\"\\n\";\r\n\t$output .= 'flashvars.player_height=\"'.$height.'\"'.\"\\n\";\r\n\t$output .= 'flashvars.player_id=\"'.$id.'\";'.\"\\n\";\r\n\t$output .= 'flashvars.thumb=\"'.$image.'\";'.\"\\n\";\r\n\t$output .= 'flashvars.colorTheme=\"'.$color.'\";'.\"\\n\";\r\n\t$output .= 'var params = { \"wmode\": \"transparent\" };'.\"\\n\";\r\n\t$output .= 'params.wmode = \"transparent\";'.\"\\n\";\r\n\t$output .= 'params.quality = \"high\";';\r\n\t$output .= 'params.allowFullScreen = \"true\";'.\"\\n\";\r\n\t$output .= 'params.allowScriptAccess = \"always\";'.\"\\n\";\r\n\t$output .= 'params.quality=\"high\";'.\"\\n\";\r\n\t$output .= 'var attributes = {};'.\"\\n\";\r\n\t$output .= 'attributes.id = \"'.$id.'\";'.\"\\n\";\r\n\t$output .= 'swfobject.embedSWF(\"'.$template_url.'/flash/video.swf?fileVideo='.$file.'\", \"'.$id.'\", \"'.$width.'\", \"'.$object_height.'\", \"9.0.0\", false, flashvars, params, attributes);'.\"\\n\";\r\n\t$output .= '</script>'.\"\\n\\n\";\r\n\t\r\n\t$output .= '<div class=\"video-bg\" style=\"width:'.$width.'px; height:'.$height.'px; background-image:url('.$image.')\">'.\"\\n\";\r\n\t$output .= '</div>'.\"\\n\";\r\n\t\r\n\t//HTML\r\n\t$output .= '<div id=\"'.$id.'\">'.\"\\n\";\r\n\t\t$output .= '<a href=\"http://www.adobe.com/go/getflashplayer\">'.\"\\n\";\r\n\t\t\t\t$output .= '<img src=\"http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif\" alt=\"Get Adobe Flash player\" />'.\"\\n\";\r\n\t\t$output .= '</a>'.\"\\n\";\r\n\t$output .= '</div>';\r\n\r\n\treturn $output;\r\n \r\n}",
"public function videoconferenciaSubirVolumen( ) {\n $this->subirVolumen();\n //$this->setComando(\"SUBIR_VOLUMEN\");\n }",
"protected function getVideo()\n {\n $names = $this->generateVideoName();\n $command = implode(' ', [\n $this->getVideoServiceConfig('video_app'),\n '-i ' . $this->getVideoServiceConfig('video_source'),\n '-c copy',\n '-f mp4',\n '-t ' . $this->getVideoServiceConfig('video_length'),\n $names['file'],\n '1> ' . $names['log'],\n '2>&1',\n ]);\n\n if (0 === stripos(PHP_OS, 'WIN')) {\n pclose(popen('start /B ' . $command, 'r'));\n } else {\n pclose(popen($command . ' &', 'r'));\n }\n\n $this->createNewRecording($names['file']);\n if ($this->checkLog($names['log'])) {\n $this->getVideo();\n }\n }",
"function wp_embed_handler_video($matches, $attr, $url, $rawattr)\n {\n }",
"function printVideo($photo_id, $secret){\n\n\t\t$video = $this->getPhotoSizes($photo_id);\n\t\t$output = '<object style=\"max-width: 100% important;\" type=\"application/x-shockwave-flash\" width=\"'.$video->sizes->size[9]->width.'\" height=\"'.$video->sizes->size[9]->height.'\" data=\"'.$video->sizes->size[9]->source.'\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\">';\n\t\t$output .= '<param name=\"flashvars\" value=\"intl_lang=en-us&photo_secret='.$secret.'&photo_id='.$photo_id.'&flickr_show_info_box=false\"></param>';\n\t\t$output .= '<param name=\"movie\" value=\"'.$video->sizes->size[9]->source.'\"></param>';\n\t\t$output .= '<param name=\"bgcolor\" value=\"#000000\"></param>';\n\t\t$output .= '<param name=\"allowFullScreen\" value=\"true\"></param>';\n\t\t$output .= '<embed type=\"application/x-shockwave-flash\" src=\"'.$video->sizes->size[9]->source.'\" bgcolor=\"#000000\" allowfullscreen=\"true\" flashvars=\"intl_lang=en-use&photo_secret='.$secret.'&photo_id='.$photo_id.'&flickr_show_info_box=false\" height=\"'.$video->sizes->size[9]->height.'\" width=\"'.$video->sizes->size[9]->width.'\"></embed>';\n\t\t$output .= '</object>';\n\n\t\t/* Return HTML */\n\t\treturn $output;\n\t}",
"public function hdmi()\n {\n }",
"public function show(VideoType $video_type)\n {\n //\n }",
"public function render(Video $video): string;",
"function info( $args, $assoc_args ) {\n\t\t$video = new MBInfoVideo();\n\t\t$content = $args[0];\n\t\t$html = $video->parse_short_code($assoc_args, $content);\n\t\techo $html;\n\t}",
"function register_port_video_widget() {\n register_widget( 'port_video' );\n}",
"function mars_video_meta() {}",
"function video_cck_tudou_video($embed, $width, $height, $field, $item, $autoplay) {\n $output = theme('video_cck_tudou_flash', $embed, $width, $height, $autoplay);\n return $output;\n}",
"public function actionVideo()\n {\n $title = '微站设置/视频设置';\n //title of webpage,you can find title in /web/pub/top.php eg:wechat demo\n $keywords = 'wechat demo';\n //title of webpage,you can find title in /web/pub/top.php eg:''\n $description = '';\n return $this -> render('video',[\n 'title' => $title,//title of webpage,you can find title in the head of /web/pub/top.php\n 'keywords' => $keywords,//keywords of webpage,you can find keywords in the head of /web/pub/top.php\n 'description' => $description//description of webpage,you can find description in the head of /web/pub/top.php\n ]);\n }",
"public static function live_preview() { }",
"function get_media_background_video( $videos, $loop=false ) {\n\tob_start();\n?>\n\t<video class=\"hidden-xs-down media-background media-background-video object-fit-cover\" autoplay muted playsinline <?php if ( $loop ) { ?>loop<?php } ?>>\n\t\t<?php if ( isset( $videos['webm'] ) ) : ?>\n\t\t<source src=\"<?php echo $videos['webm']; ?>\" type=\"video/webm\">\n\t\t<?php endif; ?>\n\n\t\t<?php if ( isset( $videos['mp4'] ) ) : ?>\n\t\t<source src=\"<?php echo $videos['mp4']; ?>\" type=\"video/mp4\">\n\t\t<?php endif; ?>\n\t</video>\n\t<button class=\"media-background-video-toggle btn play-enabled hidden-xs-up\" type=\"button\" data-toggle=\"button\" aria-pressed=\"false\" aria-label=\"Play or pause background videos\">\n\t\t<span class=\"fa fa-pause media-background-video-pause\" aria-hidden=\"true\"></span>\n\t\t<span class=\"fa fa-play media-background-video-play\" aria-hidden=\"true\"></span>\n\t</button>\n<?php\n\treturn ob_get_clean();\n}",
"function emvideo_dotsub_embedded_link($video_code) {\n//http://dotsub.com/view/... \n return 'http://dotsub.com/view/'. $video_code;\n}",
"public function forgeVideo()\n {\n // Check if we have a video creation array.\n if ($this->provider && isset($this->provider['render']['video'])) {\n // Start iframe tag.\n $video = '<video';\n\n foreach ($this->provider['render']['video'] as $attribute => $val) {\n if (! is_array($val)) {\n $video .= sprintf(' %s=\"%s\"', $attribute, $val);\n }\n }\n // Close start of video tag.\n $video .='>';\n\n // Add inner elements.\n $video .= $this->forgeInnerElements($this->provider['render']['video'], true);\n\n // Wrap video tag.\n $video .= '</video>';\n\n $video .= $this->forgeScript();\n\n return $video;\n }\n }",
"function emvideo_dotsub_preview($embed, $width, $height, $field, $item, $node, $autoplay) {\n $output = theme('emvideo_dotsub_flash', $item, $width, $height, $autoplay);\n return $output;\n}",
"public function getFrameVideo(){\n return $this->frameVideo; \n }",
"function _video($src, $width, $height, $atts = null) {\n // prepare width and height\n if(is_null($atts)) $atts = array();\n $atts['width'] = (int) $width;\n $atts['height'] = (int) $height;\n if(!$atts['width']) $atts['width'] = 320;\n if(!$atts['height']) $atts['height'] = 240;\n\n $posterUrl = '';\n $files = array();\n $isExternal = media_isexternal($src);\n\n if ($isExternal) {\n // take direct source for external files\n list(/*ext*/, $srcMime) = mimetype($src);\n $files[$srcMime] = $src;\n } else {\n // prepare alternative formats\n $extensions = array('webm', 'ogv', 'mp4');\n $files = media_alternativefiles($src, $extensions);\n $poster = media_alternativefiles($src, array('jpg', 'png'));\n if(!empty($poster)) {\n $posterUrl = ml(reset($poster), '', true, '&');\n }\n }\n\n $out = '';\n // open video tag\n $out .= '<video '.buildAttributes($atts).' controls=\"controls\"';\n if($posterUrl) $out .= ' poster=\"'.hsc($posterUrl).'\"';\n $out .= '>'.NL;\n $fallback = '';\n\n // output source for each alternative video format\n foreach($files as $mime => $file) {\n if ($isExternal) {\n $url = $file;\n $linkType = 'externalmedia';\n } else {\n $url = ml($file, '', true, '&');\n $linkType = 'internalmedia';\n }\n $title = $atts['title'] ? $atts['title'] : $this->_xmlEntities(utf8_basename(noNS($file)));\n\n $out .= '<source src=\"'.hsc($url).'\" type=\"'.$mime.'\" />'.NL;\n // alternative content (just a link to the file)\n $fallback .= $this->$linkType($file, $title, null, null, null, $cache = null, $linking = 'linkonly', $return = true);\n }\n\n // finish\n $out .= $fallback;\n $out .= '</video>'.NL;\n return $out;\n }",
"function display($group_id = NULL) {\n\t\tglobal $bp;\n\t\t$root_url = get_bloginfo( \"url\" ) . \"/\";\n\n\t\techo do_shortcode('[videowhisper_watch channel=\"' .$bp->groups->current_group->slug. '\"]');\n\t}",
"function crumble_video($atts, $content = null) {\r\n\t\textract ( shortcode_atts(\r\n\t\t\tarray(\r\n\t\t\t\t'id' => '',\r\n\t\t\t\t'type' => '',\r\n\t\t\t\t'width' => '',\r\n\t\t\t\t'height' => '220'\r\n\t\t\t), $atts ) );\r\n\t\t\r\n\r\n\r\n\r\n\t\t\tif( $type == 'youtube' ) { \r\n\t\t\t\t$code = '<iframe width=\"' . $width . '\" height=\"' .$height . '\" src=\"http://www.youtube.com/embed/'. $id . '\" frameborder=\"0\" allowfullscreen></iframe>';\r\n\t\t\t} \r\n\t\t\t\r\n\t\t\tif( $type == 'vimeo') { \r\n\t\t\t\t$code = '<iframe src=\"http://player.vimeo.com/video/' . $id . '?title=0&byline=0&portrait=0&color=ba0d16\" width=\"' . $width . '\" height=\"' . $height . '\"></iframe>';\r\n\t\t\t} \r\n\t\t\t\r\n\t\t\tif($type == 'dailymotion') { \r\n\t\t\t\t$code = '<iframe width=\"' . $width . '\" height=\"' . $height . '\" src=\"http://www.dailymotion.com/embed/video/'. $id . '?logo=0\"></iframe>';\r\n\t\t\t } \r\n\t\t\t \r\n\t\t$code = '<div class=\"video-frame\">' . $code . '</div>';\r\n\r\n\t\t\t\r\n\t\treturn $code;\r\n\t}",
"function showIMG($url,\t$w=90,\t$h=90){\r\n\t$img = '';\r\n\t$extimg =\"jpg,jpe,peg,fif,png,gif,bmp\";\r\n\tif(stristr($extimg,\tsubstr($url,-3,3))){\r\n\t\t$h\t =\tempty($h) ? \"\" : ' height=\"'.$h.'\"';\r\n\t\t$w\t =\tempty($w) ? \"\" : ' width=\"'.$w.'\"';\r\n\t\t$img = \t'<img src=\"'.$url.'\" '.$w. $h .' border=\"0\" />';\r\n\t}\r\n\t\r\n\t$extvideo=\"swf,wmv,wav\";\r\n\tif(stristr($extvideo, substr($url,-3,3))){\r\n\t\t$img ='<embed name=\"flash\" src=\"'.$url.'\" quality=\"high\" bgcolor=\"#96BCE3\" z-index=\"0\" '\r\n\t\t.'wmode=\"transparent\" width=\"'.$w.'\" height=\"'.$h.'\" type=\"application/x-shockwave-'\r\n\t\t.'flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?'\r\n\t\t.'P1_Prod_Version=ShockwaveFlash\"></embed>';\r\n\t}\r\n\t//file flash movie\r\n\tif(substr($url,-3,3)==\"flv\"){\r\n\t\t$img='<embed src=\"flvplayer.swf\" z-index=\"0\" wmode=\"transparent\" type=\"application/x-shockwave-flash\" flashvars=\"file='.base_url_site().'/'\r\n\t\t. $url.'&image=images/waitting.gif;location=flvplayer.swf&autostart=false\" '\r\n\t\t.'allowfullscreen=\"true\" height=\"'.$h.'\" width=\"'.$w.'\"></embed>';\t\t\r\n\t}\r\n\treturn $img;\r\n}",
"public function getVideo()\n {\n return $this->forgeVideo();\n }",
"function show_video_details_status($INstatus_id) {\r\n\r\n $num_rows = mysql_query(\"SELECT * FROM video_file WHERE Status_id = '$INstatus_id' \");\r\n if (mysql_num_rows($num_rows) > 0) {\r\n $db = new mysqli(\"localhost\", \"myparkco_my_park\", \"+DE[Gu^z}ctW?QnAX6\", \"myparkco_mypark\");\r\n\r\n $query = \"SELECT * FROM video_file WHERE Status_id = '$INstatus_id'\";\r\n\r\n $response = $db->query($query);\r\n\r\n\r\n while ($row = $response->fetch_assoc()) {\r\n $video_name = $row['Video_name'];\r\n $video_by = $row['Video_by'];\r\n $video_description = $row['Video_description'];\r\n $video_album = $row['Video_album'];\r\n $video_uploaded = $row['Uploaded_date'];\r\n }\r\n\r\n $video_details = '<div class=\"container col-md-10 \">\r\n </br>\r\n \r\n \r\n \r\n \r\n</div>\r\n';\r\n } else {\r\n\r\n echo 'error';\r\n ;\r\n }\r\n return $video_details;\r\n}",
"function filter_kaltura_callback($link) {\n $width = filter_kaltura::$defaultwidth;\n $height = filter_kaltura::$defaultheight;\n $source = '';\n\n // Convert KAF URI anchor tags into iframe markup.\n $count = count($link);\n if ($count > 7) {\n // Get the height and width of the iframe.\n $properties = explode('||', $link[$count - 1]);\n\n $width = $properties[2];\n $height = $properties[3];\n\n if (4 != count($properties)) {\n return $link[0];\n }\n\n $source = filter_kaltura::$kafuri . '/browseandembed/index/media/entryid/' . $link[$count - 4] . $link[$count - 3];\n }\n\n // Convert v3 anchor tags into iframe markup.\n if (7 == count($link) && $link[1] == filter_kaltura::$apiurl) {\n $source = filter_kaltura::$kafuri.'/browseandembed/index/media/entryid/'.$link[4].'/playerSize/';\n $source .= filter_kaltura::$defaultwidth.'x'.filter_kaltura::$defaultheight.'/playerSkin/'.$link[3];\n }\n\n $params = array(\n 'courseid' => filter_kaltura::$pagecontext->instanceid,\n 'height' => $height,\n 'width' => $width,\n 'withblocks' => 0,\n 'source' => $source\n\n );\n\n $url = new moodle_url('/filter/kaltura/lti_launch.php', $params);\n\n $iframe = html_writer::tag('iframe', '', array(\n 'width' => $width,\n 'height' => $height,\n 'class' => 'kaltura-player-iframe',\n 'allowfullscreen' => 'true',\n 'allow' => 'autoplay *; fullscreen *; encrypted-media *; camera *; microphone *; display-capture *;',\n 'src' => $url->out(false),\n 'frameborder' => '0'\n ));\n\n $iframeContainer = html_writer::tag('div', $iframe, array(\n 'class' => 'kaltura-player-container'\n ));\n\n return $iframeContainer;\n}",
"function sp_add_video ($url, $width = 620, $height = 349) {\n\t\n\t$video_url = @parse_url($url);\n\n\tif ( $video_url['host'] == 'www.youtube.com' || $video_url['host'] == 'youtube.com' ) {\n\t\tparse_str( @parse_url( $url, PHP_URL_QUERY ), $my_array_of_vars );\n\t\t$video = $my_array_of_vars['v'] ;\n\t\t$output .='<iframe width=\"'.$width.'\" height=\"'.$height.'\" src=\"http://www.youtube.com/embed/'.$video.'?rel=0\" frameborder=\"0\" allowfullscreen></iframe>';\n\t}\n\telseif( $video_url['host'] == 'www.youtu.be' || $video_url['host'] == 'youtu.be' ){\n\t\t$video = substr(@parse_url($url, PHP_URL_PATH), 1);\n\t\t$output .='<iframe width=\"'.$width.'\" height=\"'.$height.'\" src=\"http://www.youtube.com/embed/'.$video.'?rel=0\" frameborder=\"0\" allowfullscreen></iframe>';\n\t}\n\telseif( $video_url['host'] == 'www.vimeo.com' || $video_url['host'] == 'vimeo.com' ){\n\t\t$video = (int) substr(@parse_url($url, PHP_URL_PATH), 1);\n\t\t$output .='<iframe src=\"http://player.vimeo.com/video/'.$video.'\" width=\"'.$width.'\" height=\"'.$height.'\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';\n\t}\n\telseif( $video_url['host'] == 'www.dailymotion.com' || $video_url['host'] == 'dailymotion.com' ){\n\t\t$video = substr(@parse_url($url, PHP_URL_PATH), 7);\n\t\t$video_id = strtok($video, '_');\n\t\t$output .='<iframe frameborder=\"0\" width=\"'.$width.'\" height=\"'.$height.'\" src=\"http://www.dailymotion.com/embed/video/'.$video_id.'\"></iframe>';\n\t}\n\t\n\treturn $output;\n}",
"public function group_video_main_screen_function() {\n\t\t// add title and content here - last is to call the members plugin.php template.\n\t\t\\add_action( 'bp_template_content', array( $this, 'group_video_meeting_content_action' ) );\n\t\t\\bp_core_load_template( \\apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );\n\t\t// echo do_shortcode ( '[youzer_groups per_page=\"10\"]' );\n\t}",
"function signage_panes_video_admin_info($subtype, $conf, $contexts) {\n if (!empty($conf)) {\n $block = new stdClass();\n $block->title = $conf['override_title'] ? $conf['override_title_text'] : '';\n $block->content = t('Showing embedded video from @video_provider provider.', array(\n '@video_provider' => $conf['video_provider'],\n ));\n return $block;\n }\n}",
"function show_video_rating($params)\n{\n global $cbvid;\n return $cbvid->show_video_rating($params);\n}",
"function theme_emvideo_dotsub_flash($item, $width, $height, $autoplay) {\n\n $output = '';\n if ($item['embed']) {\n \n $embed_url = isset($item['data']['flash']['url']) ? $item['data']['flash']['url'] : 'http://dotsub.com/static/players/portalplayer.swf?plugins=dotsub&uuid=' . $item['value'];\n \n $autoplay = $autoplay ? 'true' : 'false';\n $fullscreen = variable_get('emvideo_dotsub_full_screen', 1) ? 'true' : 'false';\n \n $output = '<object width=\"'. $width .'\" height=\"'. $height .'\">';\n $output .= '<param name=\"movie\" value=\"'. $embed_url .'&type=video&lang=eng\">';\n $output .= '<param name=\"allowFullScreen\" value=\"'. $fullscreen .'\" />';\n $output .= '<param name=\"allowscriptaccess\" value=\"always\"></param>';\n $output .= '<embed src=\"'. $embed_url .'&type=video&lang=eng\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"'. $fullscreen .'\" width=\"'. $width .'\" height=\"'. $height .'\"></embed>';\n $output .= '</object>';\n }\n return $output;\n}",
"function df_get_video_embed($vurl,$width,$height){\r\n $image_url = parse_url($vurl);\r\n // Test if the link is for youtube\r\n if($image_url['host'] == 'www.youtube.com' || $image_url['host'] == 'youtube.com'){\r\n $array = explode(\"&\", $image_url['query']);\r\n return '<iframe src=\"http://www.youtube.com/embed/' . substr($array[0], 2) . '?wmode=transparent\" frameborder=\"0\" width=\"'.$width.'\" height=\"'.$height.'\" allowfullscreen></iframe>'; // Returns the youtube iframe embed code\r\n // Test if the link is for the shortened youtube share link\r\n } else if($image_url['host'] == 'www.youtu.be' || $image_url['host'] == 'youtu.be'){\r\n $array = ltrim($image_url['path'],'/');\r\n return '<iframe src=\"http://www.youtube.com/embed/' . $array . '?wmode=transparent\" frameborder=\"0\" width=\"'.$width.'\" height=\"'.$height.'\" allowfullscreen></iframe>'; // Returns the youtube iframe embed code\r\n // Test if the link is for vimeo\r\n } else if($image_url['host'] == 'www.vimeo.com' || $image_url['host'] == 'vimeo.com'){\r\n $hash = substr($image_url['path'], 1);\r\n return '<iframe src=\"http://player.vimeo.com/video/' . $hash . '?title=0&byline=0&portrait=0\" width=\"'.$width.'\" height=\"'.$height.'\" frameborder=\"0\" webkitAllowFullScreen allowfullscreen></iframe>'; // Returns the vimeo iframe embed code\r\n }\r\n}",
"public function ViewVideo($user_id){\r\n\t\t\t$select = $this->db->query(\"SELECT * FROM $this->_dataMasjid WHERE $this->_UserID='$user_id' \");\r\n\t\t\t$view = $select->fetch_object();\r\n\t\t\treturn $view;\r\n\t\t}",
"function init(){\r\n \t\n //\t$this->flashvars['f'] = \"js:escape('\".$this->flashvars['f'].\"')\";\r\n\n\r\n Yii::app()->getClientScript()\r\n ->registerScriptFile($this->baseUrl.'/offlights.js') \r\n \t->registerScriptFile($this->baseUrl.'/ckplayer.js');\r\n echo '<div id=\"video\" style=\"position:relative;z-index: 100;width:100%;height:400px;float: left;\"><div id=\"a1\"></div></div>';\r\n return parent::init();\r\n }",
"function video_cck_tudou_preview($embed, $width, $height, $field, $item, $autoplay) {\n $output = theme('video_cck_tudou_flash', $embed, $width, $height, $autoplay);\n return $output;\n}",
"function visualizzaFotoVideo($dati)\n {\n foreach($dati as $media)\n {\n $contenuto = '<li>';\n\n if ($media->type === 'video')\n {\n $poster = $media->images->low_resolution->url;\n $source = $media->videos->standard_resolution->url;\n $contenuto .= \"<video class='media video-js vjs-default-skin' width='250' height='250' poster='{$poster}' data-setup='{'controls':true, 'preload': 'auto'}'><source src='{$source}' type='video/mp4' /></video>\";\n }\n else\n {\n $image = $media->images->low_resolution->url;\n $contenuto .= \"<img class='media' src='{$image}'/>\";\n }\n\n $avatar = $media->user->profile_picture;\n $username = $media->user->username;\n $commento = $media->caption->text;\n $contenuto .= \"<div class='content'><div class='avatar' style='background-image: url({$avatar})'></div><p>{$username}</p><div class='comment'>{$commento}</div></div>\";\n\n echo $contenuto . '</li>';\n }\n }",
"public function view_videos($args)\n {\n $this->registry->template->Title = \"HiiFan News Portal :: Admin Home Page : View Videos\";\n $videoListArray = $this->registry->model->run(\"getAllVideoList\", $args);\n $this->registry->template->PresentPage = $args['start_page'];\n $this->registry->template->VideoListArray = $videoListArray;\n $this->registry->template->show(\"view_videos\");\n }",
"function quadro_options_video_banner() {\n\t?>\n\t<aside class=\"qi-aside banner\">\n\t\t<a href=\"https://artisanthemes.io/kb?utm_source=Indigo&utm_medium=theme&utm_content=101videoBanner\">\n\t\t\t<img src=\"<?php echo get_template_directory_uri(); ?>/images/admin/video-training-banner.jpg\"/>\n\t\t</a>\n\t</aside>\n\t<?php\n}",
"function ht_post_format_video() {\r\n\r\n\t// Get post meta values\r\n\t$st_pf_video_oembed = get_post_meta( get_the_ID(), 'st_video_oembed', true ); \r\n\t$st_pf_video = get_post_meta(get_the_ID(), 'st_video', true); \r\n\t$st_pf_video_poster = get_post_meta(get_the_ID(), 'st_video_poster', true);\r\n\t\r\n\t\r\n\tif ( is_single() ) {\r\n\t\r\n if ( $st_pf_video_oembed != '' || $st_pf_video != '' ) { ?>\r\n <figure class=\"entry-video\"> \r\n\r\n <?php if ( $st_pf_video_oembed ) {\r\n \r\n echo wp_oembed_get($st_pf_video_oembed, array('width'=>658));\r\n \r\n } else {\r\n\t\t\t\t\t\r\n\t\t\t\t// Get attachment URLs\r\n\t\t\t\t$st_pf_video_file_url = wp_get_attachment_url( $st_pf_video );\r\n\t\t\t\t$st_pf_video_file_poster_url = wp_get_attachment_url( $st_pf_video_poster );\r\n\t\t\t\t\r\n\t\t\t\tif ( $st_pf_video_file_poster_url != null ) {\r\n\t\t\t\t\techo do_shortcode( '[video src=\"'. $st_pf_video_file_url .'\" width=\"658\" height=\"100%\" poster=\"'. $st_pf_video_file_poster_url .'\"]' );\r\n\t\t\t\t} else {\r\n\t\t\t\t\techo do_shortcode( '[video src=\"'. $st_pf_video_file_url .'\" width=\"658\" height=\"100%\"]' );\t\r\n\t\t\t\t}\r\n \r\n } ?>\r\n </figure>\r\n <?php } ?>\r\n \r\n <?php \r\n\t} else {\r\n\tif( has_post_thumbnail() && !is_author() ) { ?>\r\n\t<figure class=\"entry-thumb\"> \r\n\t<?php the_post_thumbnail( 'post' ); ?>\t\r\n\t</figure>\r\n\t<?php }\t\r\n\t}\r\n\r\n}",
"function wrap_embed_with_div($html, $url, $attr) {\n\n return '<div class=\"video_wrapper\"><div class=\"video-container\">' . $html . '</div></div>';\n\n}",
"function wp_embed_handler_googlevideo($matches, $attr, $url, $rawattr)\n {\n }",
"function the_header_video_url()\n {\n }",
"public function viewVideoAction()\n\t{\n\t\t$userSession = new Container('fo_user');\n\t\t$pageSession = new Container('fo_page');\n\t\t$this->layout('frontend');\n\t\t$request \t\t= $this->getRequest();\n\t\t$message\t\t= '';\n\t\t$errorMessage\t= '';\n\t\t\n\t\t$request\t= $this->getRequest();\n\t\t$id\t\t\t= $this->params()->fromRoute('id', 0);\n\t\t$originalID\t= base64_decode($id);\n\t\t$videoArray\t= $this->getVideoDetails($originalID);\n\t\t\n\t\t//\tTrack Video Views\n\t\tif(!isset($pageSession->pageSession['last_video']) || (isset($pageSession->pageSession['last_video']) && $pageSession->pageSession['last_video'] != $originalID)) {\n\t\t\t$this->trackVideoViews($originalID);\n\t\t\t$pageSession->pageSession\t= array('last_video' => $originalID);\n\t\t\t\n\t\t\t//\tAssign the recently viewed video in session\n\t\t\t$mediaArray\t\t\t\t\t\t= $userSession->mediaSession;\n\t\t\t$videosArray\t\t\t\t\t= $mediaArray['videos'];\n\t\t\t$videosArray[strtotime('now')]\t= $originalID;\n\t\t\t$mediaArray['videos']\t\t\t= $videosArray;\n\t\t\t$userSession->mediaSession\t\t= $mediaArray;\n\t\t}\n\t\t//\tMedia Tags\n\t\t$mediaIdArray[]\t= (string)$videoArray['_id'];\n\t\t$mediaTags\t\t= $this->getMediaTags($mediaIdArray, 1);\n\t\t\n\t\t//echo '<pre>===>'; print_r($mediaTags); echo '</pre>';\n\t\t//\tRecommended Videos\n\t\t$videoSession \t\t= new Container('fo_videos_recommended');\n\t\t$recommendedArray\t= array('title'\t\t=> $videoArray['media_title'],\n\t\t\t\t\t\t\t\t\t'category'\t=> $videoArray['media_category'],\n\t\t\t\t\t\t\t\t\t'tags'\t\t=> $mediaTags,\n\t\t\t\t\t\t\t\t\t'id'\t\t=> new \\MongoId($videoArray['_id']));\n\t\t$videoSession->videoSession\t= $recommendedArray;\n\t\t\n\t\t$tempUserSession= $userSession->mediaSession;\n\t\t$extFriendsArray= array();\n\t\t\n\t\tif(isset($tempUserSession['friends']) && is_array($tempUserSession['friends']) && count($tempUserSession['friends']) > 0 && count($mediaIdArray) > 0) {\n\t\t\t$extFriendsArray\t= $this->getExtendedFriends($tempUserSession['friends'], $mediaIdArray);\n\t\t}\n\t\t\n\t\t$likes\t\t= $this->getVideoLikes((string)$videoArray['_id']);\n\t\t$like\t= 0;\n\t\t$dislike= 0;\n\t\tif(is_array($likes) && count($likes) > 0) {\n\t\t\tforeach($likes as $lkey => $lvalue) {\n\t\t\t\tif($lvalue['rating'] == 'like') {\n\t\t\t\t\t$like++;\n\t\t\t\t} else if($lvalue['rating'] == 'dislike') {\n\t\t\t\t\t$dislike++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn new ViewModel(array(\n\t\t\t'userObject'\t=> $userSession->userSession,\n\t\t\t'message'\t\t=> $message,\n\t\t\t'errorMessage'\t=> $errorMessage,\n\t\t\t'extended'\t\t=> $extFriendsArray,\n\t\t\t'videoArray'\t=> $videoArray,\n\t\t\t'like'\t\t\t=> $like,\n\t\t\t'dislike'\t\t=> $dislike,\n\t\t\t'action'\t\t=> $this->params('action'),\n\t\t\t'controller'\t=> $this->params('controller'),\n\t\t));\n }",
"public function getShow($video)\n\t{\n // redirect to the frontend\n\t}",
"public function videoconferenciaBajarVolumen( ) {\n $this->bajarVolumen();\n //$this->setComando(\"BAJAR_VOLUMEN\");\n }",
"function video_link($vdetails,$type=NULL)\r\n{\r\n global $myquery;\r\n #checking what kind of input we have\r\n if(is_array($vdetails))\r\n {\r\n if(empty($vdetails['title']))\r\n {\r\n #check for videoid\r\n if(empty($vdetails['videoid']) && empty($vdetails['vid']) && empty($vdetails['videokey']))\r\n {\r\n return BASEURL;\r\n }else{\r\n if(!empty($vdetails['videoid']))\r\n $vid = $vdetails['videoid'];\r\n elseif(!empty($vdetails['vid']))\r\n $vid = $vdetails['vid'];\r\n elseif(!empty($vdetails['videokey']))\r\n $vid = $vdetails['videokey'];\r\n else\r\n return BASEURL;\r\n }\r\n }\r\n }else{\r\n if(is_numeric($vdetails))\r\n $vid = $vdetails;\r\n else\r\n return BASEURL;\r\n }\r\n #checking if we have vid , so fetch the details\r\n if(!empty($vid))\r\n $vdetails = get_video_details($vid);\r\n\r\n //calling for custom video link functions\r\n $functions = cb_get_functions('video_link');\r\n if($functions)\r\n {\r\n foreach($functions as $func)\r\n {\r\n $array = array('vdetails'=>$vdetails,'type'=>$type);\r\n if(function_exists($func['func']))\r\n {\r\n $returned = $func['func']($array);\r\n if($returned)\r\n {\r\n $link = $returned;\r\n return $link;\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n $plist = \"\";\r\n if(SEO == 'yes'){\r\n\r\n if($vdetails['playlist_id'])\r\n $plist = '?&play_list='.$vdetails['playlist_id'];\r\n\r\n $vdetails['title'] = strtolower($vdetails['title']);\r\n\r\n switch(config('seo_vido_url'))\r\n {\r\n default:\r\n $link = BASEURL.'/video/'.$vdetails['videokey'].'/'.SEO(clean(str_replace(' ','-',$vdetails['title']))).$plist;\r\n break;\r\n\r\n case 1:\r\n {\r\n $link = BASEURL.'/'.SEO(clean(str_replace(' ','-',$vdetails['title']))).'_v'.$vdetails['videoid'].$plist;\r\n }\r\n break;\r\n\r\n case 2:\r\n {\r\n $link = BASEURL.'/video/'.$vdetails['videoid'].'/'.SEO(clean(str_replace(' ','-',$vdetails['title']))).$plist;\r\n }\r\n break;\r\n\r\n case 3:\r\n {\r\n $link = BASEURL.'/video/'.$vdetails['videoid'].'_'.SEO(clean(str_replace(' ','-',$vdetails['title']))).$plist;\r\n }\r\n break;\r\n }\r\n\r\n\r\n }else{\r\n if($vdetails['playlist_id'])\r\n $plist = '&play_list='.$vdetails['playlist_id'];\r\n $link = BASEURL.'/watch_video.php?v='.$vdetails['videokey'].$plist;\r\n }\r\n if(!$type || $type=='link')\r\n return $link;\r\n elseif($type=='download')\r\n return BASEURL.'/download.php?v='.$vdetails['videokey'];\r\n}",
"public function viewAction() {\n\n //IF SITEREVIEWVIDEO SUBJECT IS NOT THEN RETURN\n if (!$this->_helper->requireSubject('sitereview_video')->isValid())\n return;\n\n //GET LOGGED IN USER INFORMATION\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n\n //GET VIDEO ITEM\n $sitereview_video = Engine_Api::_()->getItem('sitereview_video', $this->getRequest()->getParam('video_id'));\n\n //GET SITEREVIEW ITEM\n $sitereview = Engine_Api::_()->getItem('sitereview_listing', $sitereview_video->listing_id);\n $this->view->can_create = 1;\n $can_edit = 1;\n\n if (Engine_Api::_()->sitereview()->hasPackageEnable()) {\n if (!Engine_Api::_()->sitereviewpaidlisting()->allowPackageContent($sitereview->package_id, \"video\"))\n return $this->_forwardCustom('requireauth', 'error', 'core');\n }\n\n //CHECKING THE USER HAVE THE PERMISSION TO VIEW THE VIDEO OR NOT\n if ($viewer_id != $sitereview_video->owner_id && $can_edit != 1 && ($sitereview_video->search != 1 || $sitereview_video->status != 1)) {\n return $this->_forwardCustom('requireauth', 'error', 'core');\n }\n\n $params = array();\n\n //GET LISTING CATEGORY TABLE\n $tableCategory = Engine_Api::_()->getDbTable('categories', 'sitereview');\n\n $category_id = $sitereview->category_id;\n if (!empty($category_id)) {\n\n $params['categoryname'] = Engine_Api::_()->getItem('sitereview_category', $category_id)->getCategorySlug();\n\n $subcategory_id = $sitereview->subcategory_id;\n\n if (!empty($subcategory_id)) {\n\n $params['subcategoryname'] = Engine_Api::_()->getItem('sitereview_category', $subcategory_id)->getCategorySlug();\n\n $subsubcategory_id = $sitereview->subsubcategory_id;\n\n if (!empty($subsubcategory_id)) {\n\n $params['subsubcategoryname'] = Engine_Api::_()->getItem('sitereview_category', $subsubcategory_id)->getCategorySlug();\n }\n }\n }\n\n $params['location'] = $sitereview->location;\n\n $params['tag'] = $sitereview->getKeywords(', ');\n\n $params['listing_type_title'] = ucfirst($this->_listingType->title_plural);\n\n $params['listing_title'] = $sitereview->getTitle();\n\n //SET META KEYWORDS\n Engine_Api::_()->sitereview()->setMetaKeywords($params);\n\n //CHECK THE VERSION OF THE CORE MODULE\n $coremodule = Engine_Api::_()->getDbtable('modules', 'core')->getModule('core');\n $coreversion = $coremodule->version;\n $checkVersion = Engine_Api::_()->sitereview()->checkVersion($coreversion, '4.1.0');\n if ($checkVersion == 0) {\n $this->_helper->content->render();\n } else {\n $this->_helper->content\n ->setNoRender()\n ->setEnabled()\n ;\n }\n }",
"function aidtransparency_print_vimeo_videos($post = null, $number = 2)\r\n{\r\n global $post;\r\n $vidoesStr = false; //types_render_field(\"home_page_vimeo\", array( 'post_id' => $post->ID, 'raw' => true ) );\r\n $videoIds = array_map( 'trim', explode(',', $vidoesStr) );//Make into array and trim members\r\n if(count($videoIds) > 0) :\r\n $count = 1;\r\n ?>\r\n <div class=\"videos\">\r\n <?php foreach ($videoIds as $videoId) : if( $count > $number ) continue; ?>\r\n <div class=\"video <?php print sweetapple_get_row_class($count, 2);?>\" >\r\n <a href=\"http://vimeo.com/<?php echo $videoId;?>\" class=\"vimeo-video\" data-vimeoid=\"<?php echo $videoId;?>\">View this Vimeo video</a>\r\n </div>\r\n <?php $count++; endforeach;?>\r\n </div><!--.videos -->\r\n <?php endif;\r\n}",
"function cs_pb_video($die = 0){\n\tglobal $cs_node, $count_node, $post;\n\tif ( isset($_POST['action']) ) {\n\t\t$name = $_POST['action'];\n\t\t$counter = $_POST['counter'];\n\t\t$video_element_size = '25';\n\t\t$video_url = '';\n\t\t$video_width = '';\n\t\t$video_height = '';\n\t}\n\telse {\n\t\t$name = $cs_node->getName();\n\t\t\t$count_node++;\n\t\t\t$video_element_size = $cs_node->video_element_size;\n\t\t\t$video_url = $cs_node->video_url;\n\t\t\t$video_width = $cs_node->video_width;\n\t\t\t$video_height = $cs_node->video_height;\n\t\t\t\t$counter = $post->ID.$count_node;\n}\n?> \n\t<div id=\"<?php echo $name.$counter?>_del\" class=\"column parentdelete column_<?php echo $video_element_size?>\" item=\"video\" data=\"<?php echo element_size_data_array_index($video_element_size)?>\" >\n \t<div class=\"column-in\">\n <h5><?php echo ucfirst(str_replace(\"cs_pb_\",\"\",$name))?></h5>\n <input type=\"hidden\" name=\"video_element_size[]\" class=\"item\" value=\"<?php echo $video_element_size?>\" >\n <a href=\"javascript:hide_all('<?php echo $name.$counter?>')\" class=\"options\">Options</a> \n <a href=\"#\" class=\"delete-it btndeleteit\">Del</a> \n <a class=\"decrement\" onclick=\"javascript:decrement(this)\">Dec</a> \n <a class=\"increment\" onclick=\"javascript:increment(this)\">Inc</a>\n\t\t</div>\n \t<div class=\"poped-up\" id=\"<?php echo $name.$counter?>\" style=\"border:none; background:#f8f8f8;\" >\n <div class=\"opt-head\">\n <h5>Edit Video Options</h5>\n <a href=\"javascript:show_all('<?php echo $name.$counter?>')\" class=\"closeit\"> </a>\n </div>\n <div class=\"opt-conts\">\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Video URL</label></li>\n <li class=\"to-field\">\n \t<input type=\"text\" name=\"video_url[]\" class=\"txtfield\" value=\"<?php echo $video_url?>\" />\n <p>Enter Video URL (Youtube, Vimeo or any other supported by wordpress)</p>\n </li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Width</label></li>\n <li class=\"to-field\"><input type=\"text\" name=\"video_width[]\" class=\"txtfield\" value=\"<?php echo $video_width?>\" /></li>\n </ul>\n <ul class=\"form-elements\">\n <li class=\"to-label\"><label>Height</label></li>\n <li class=\"to-field\"><input type=\"text\" name=\"video_height[]\" class=\"txtfield\" value=\"<?php echo $video_height?>\" /></li>\n </ul>\n <ul class=\"form-elements noborder\">\n <li class=\"to-label\"></li>\n <li class=\"to-field\">\n \t<input type=\"hidden\" name=\"cs_orderby[]\" value=\"video\" />\n <input type=\"button\" value=\"Save\" style=\"margin-right:10px;\" onclick=\"javascript:show_all('<?php echo $name.$counter?>')\" />\n </li>\n </ul>\n </div>\n </div>\n </div>\n<?php\n\tif ( $die <> 1 ) die();\n}",
"public function embedAction() {\n\n //GET SUBJECT (EITHER VIDEO TYPE OR SITEREVIEW_VIDEO TYPE)\n $this->view->video = $video = Engine_Api::_()->core()->getSubject();\n\n //CHECK THAT EMBEDDING IS ALLOWED OR NOT\n if (!Engine_Api::_()->getApi('settings', 'core')->getSetting('sitereview_video.embeds', 1)) {\n $this->view->error = 1;\n return;\n } else if (isset($video->allow_embed) && !$video->allow_embed) {\n $this->view->error = 2;\n return;\n }\n\n //GET EMBED CODE\n $this->view->embedCode = $video->getEmbedCode();\n }",
"function video_cck_dailymotion_video($embed, $width, $height, $field, $item, $autoplay) {\n $output = theme('video_cck_dailymotion_flash', $embed, $width, $height, $autoplay);\n return $output;\n}",
"function videoCategory($categoryId, $catName, $clientKey){\n\t?>\n<div id=\"div-<?php echo $catName; ?>\" class=\"border-bg\" style=\"padding-bottom: 0px !important;\">\n<div class=\"page-header\">\n<h4>\n<span class=\"icons thirty2 <?php echo \"icon\".$catName; ?>\"></span> <?php echo $catName; ?>\n<ul class=\"nav nav-pills pull-right hide-videos\">\n<li class=\"dropdown pull-right\">\n<a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\"><i class=\"fa fa-ellipsis-v color-a\"></i></a>\n<ul class=\"dropdown-menu\" role=\"menu\"><li><a class=\"pointer\" onclick=\"hideVideos('div-islam')\">Hide these videos</a></li></ul>\n</li>\n</ul> </h4>\n</div> \n<ul id=\"islam\" class=\"media\">\n <?php\n\t\n\t\n\t$ch = curl_init();\ncurl_setopt($ch, CURLOPT_URL, \"https://www.googleapis.com/youtube/v3/videos?part=snippet,statistics,contentDetails&chart=mostPopular®ionCode=PK&videoCategoryId=\".$categoryId.\"&maxResults=6&key=\".$clientKey.\"\");\ncurl_setopt($ch, CURLOPT_HEADER, 0);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_TIMEOUT, 100);\ncurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n$output = curl_exec($ch);\necho curl_error($ch);\ncurl_close($ch);\n \n$searchResponse = json_decode($output,true);\n// print_r($searchResponse);\n\tforeach ($searchResponse['items'] as $searchResult) {\n\t$videoId = $searchResult['id'];\n\t$videoTitle =$searchResult['snippet']['title'];\n\t$thumb= $searchResult['snippet']['thumbnails']['high']['url'];\n\t$duration=$searchResult['contentDetails']['duration'];\n\t$publishedAt=$searchResult['snippet']['publishedAt'];\n\t$viewCount=$searchResult['statistics']['viewCount'];\n\t?>\n\n <li class=\"homethumb hov\">\n <div class=\"mediathumb\">\n <a title=\"<?php echo $videoTitle ?>\" href=\"video/<?php echo $videoId; ?>\">\n <img src=\"<?php echo $thumb ?>\" alt=\"<?php echo $videoTitle; ?>\">\n <span class=\"duration\"><?php fix_duration($duration); ?></span>\n </a> \n </div> \n <h4><a title=\"<?php echo $videoTitle; ?>\" href=\"video/<?php echo $videoId; ?>\" class=\"medialink\"><?php echo shortString($videoTitle, 33); ?></a></h4>\n <div class=\"viewsanduser\">Posted <?php publushDateFix($publishedAt); ?><br>Views: <?php echo number_format($viewCount); ?></div> \n </li> \n\t\n\t\t<?php\n\t\t\n\t\t}\n?>\n\n</ul>\n<div id=\"unhide\" align=\"center\" style=\"display:none\"><a class=\"unhide\" onclick=\"unhide('div-islam')\">Click here to Unhide this section</a></div>\n</div>\n<?php\n}",
"public function show(UploadVideo $uploadVideo)\n {\n //\n }",
"function videoSlide($idCategory)\n{\n global $connection;\n\n $query = \"SELECT videos.*\n FROM videos\n INNER JOIN video_con_category\n ON videos.id_video = video_con_category.id_video\n AND video_con_category.id_category = '$idCategory'\n LIMIT 5\";\n $result = mysqli_query($connection, $query);\n $count = mysqli_num_rows($result);\n\n if ($count <= 0) {\n echo '<h3>Nessun video trovato</h3>';\n } else {\n while ($row = mysqli_fetch_array($result)) {\n $idVideo = $row['id_video'];\n $titleVideo = $row['title_video'];\n $thumbnail = $row['photo_from_video'];\n $tipologia = $row['tipologia_video'];\n\n if ($tipologia == 1 || $tipologia == 3) {\n $thumbnailLink = 'thumbnail_video/'.$thumbnail;\n $videoLink = 'video_details.php?id='.$idVideo;\n } else {\n $thumbnailLink = 'image/podcast.jpg';\n $videoLink = 'podcast_details.php?id='.$idVideo;\n }\n\n echo '<div class=\"item\">\n <div class=\"zmovo-video-item-box\">\n <div class=\"zmovo-video-box-inner\">\n <div class=\"zmovo-v-box-img gradient\">\n <img src=\"'.$thumbnailLink.'\" alt=\"\" style=\"max-height: 250px !important;\">\n <div class=\"ply-btns\">\n <a href=\"'.$videoLink.'\" data-video-url=\"\" class=\"ply-btn\"><img src=\"image/play.svg\" alt=\"\"></a>\n </div>\n <div class=\"zmovo-v-box-content\">\n <a href=\"'.$videoLink.'\">'.$titleVideo.'</a>\n </div>\n </div>\n </div>\n </div>\n </div>';\n }\n }\n}",
"function video($row){\n\t//global $row;\n?>\n\t<div id=\"col2\">\n\t\t<P>content should appear under here</p>\n\t\t<P><?php echo $row['content']; ?></p>\n\t<div id=\"col3\">\n\t\t<a href=\"#\" class=\"box\">next</a>\n\t</div>\n\t</body>\n\t</html>\n<?php\n}",
"function showxml($rs_video, $playlistautoplay) {\n ## xml file header displaying here\n ob_clean();\n header(\"content-type: text/xml\");\n echo '<?xml version=\"1.0\" encoding=\"utf-8\"?>';\n echo '<playlist autoplay=\"' . $playlistautoplay . '\" random=\"false\">';\n $current_path = 'components/com_hdflvplayer/videos/';\n $hdvideo = $video = '';\n\n $db = JFactory::getDBO();\n\n $query_ads = \"SELECT count(id) FROM #__hdflvplayerads WHERE published=1 AND typeofadd='mid' \"; ## and home=1\";## and id=11;\";\n $db->setQuery($query_ads);\n $midadsCount = $db->loadResult();\n\n\n ## Check whether or not, video available\n if (count($rs_video) > 0) {\n\n foreach ($rs_video as $rows) {\n $timage = '';\n $streamername = '';\n\n ## fetch Video, thumb, Preview,HD URL for upload method videos\n if ($rows->filepath == 'File' || $rows->filepath == 'FFmpeg') {\n\n ## Get Video URL\n if ($rows->videourl != '') {\n $video = JURI::base() . $current_path . $rows->videourl;\n } else {\n $video = '';\n }\n \n ## Get Video HD URL\n if ($rows->hdurl != '') {\n $hdvideo = JURI::base() . $current_path . $rows->hdurl ;\n } else {\n $hdvideo = '';\n }\n \n ## Get Preview image URL\n $previewimage = JURI::base() . $current_path . $rows->previewurl;\n \n ## Get Thumb Image URL\n $timage = JURI::base() . $current_path . $rows->thumburl;\n }\n\n ## fetch Video, thumb, Preview,HD URL for URL method videos\n elseif ($rows->filepath == 'Url') {\n $video = $rows->videourl;\n $previewimage = $rows->previewurl;\n $timage = $rows->thumburl;\n $hdvideo = $rows->hdurl;\n }\n\n ## fetch Video, thumb, Preview,HD URL for YouTube method videos\n elseif ($rows->filepath == 'Youtube') {\n $video = $rows->videourl;\n $previewimage = $rows->previewurl;\n $timage = $rows->thumburl;\n if ($rows->hdurl != '') {\n $hdvideo = $rows->hdurl;\n }\n }\n\n ## Checks for streamer option\n if ($rows->streameroption == 'lighttpd') { ## If it lighttpd\n $streamername = $rows->streameroption;\n } else {\n $streamername = $rows->streamerpath;\n }\n if ($rows->streameroption == 'rtmp') { ## If it RTMP\n $streamername = $rows->streamerpath;\n } else {\n $streamername = '';\n }\n\n ## Checks for postroll ads enabled\n if ($rows->postrollid != '') {\n if ($rows->postrollads == 0) {\n $postrollads = 'false';\n } else {\n $postrollads = 'true';\n }\n } else {\n $postrollads = 'false';\n }\n\n ## Checks for preroll ads enabled\n if ($rows->prerollid != '') {\n if ($rows->prerollads == 0) {\n $prerollads = \"false\";\n } else {\n $prerollads = \"true\";\n }\n } else {\n $prerollads = \"false\";\n }\n\n ## Checks for Mid-roll ad\n if ($midadsCount > 0) {\n if ($rows->midrollads == 0) {\n $midrollads = 'false'; \n } else {\n $midrollads = 'true';\n }\n } else {\n $midrollads = 'false';\n }\n \n ## Checks for IMA ad\n $imaads = $rows->imaads;\n if ($imaads == 0) {\n $imaad = 'false'; \n } else {\n $imaad = 'true';\n }\n\n ## Fetche Download, target URL, Post-roll, Pre-roll Ad Ids\n if ($rows->download == 0) {\n $download = 'false';\n } else {\n $download = 'true';\n }\n if ($rows->targeturl == '') {\n $targeturl = '';\n } else {\n $targeturl = $rows->targeturl;\n }\n if ($rows->postrollads == '1') {\n $postrollid = $rows->postrollid;\n } else {\n $postrollid = 0;\n }\n if ($rows->prerollads == '1') {\n $prerollid = $rows->prerollid;\n } else {\n $prerollid = 0;\n }\n\n $user = JFactory::getUser();\n $memberid = $user->get('id');\n \n ## Checks for member Access\n if (version_compare(JVERSION, '1.6.0', 'ge')) {\n $uid = $user->get('id');\n if ($uid) {\n $query = $db->getQuery(true);\n $query->select('g.id AS group_id')\n ->from('#__usergroups AS g')\n ->leftJoin('#__user_usergroup_map AS map ON map.group_id = g.id')\n ->where('map.user_id = ' . (int) $uid);\n $db->setQuery($query);\n $message = $db->loadObjectList();\n foreach ($message as $mess) {\n $accessid[] = $mess->group_id;\n }\n } else {\n $accessid[] = 1;\n }\n } else {\n $accessid = $user->get('aid');\n }\n\n if (version_compare(JVERSION, '1.6.0', 'ge')) {\n $query = $db->getQuery(true);\n if ($rows->access == 0)\n $rows->access = 1;\n $query->select('rules as rule')\n ->from('#__viewlevels AS view')\n ->where('id = ' . (int) $rows->access);\n $db->setQuery($query);\n $message = $db->loadResult();\n $accessLevel = json_decode($message);\n }\n\n $member = \"true\";\n\n if (version_compare(JVERSION, '1.6.0', 'ge')) {\n $member = \"false\";\n foreach ($accessLevel as $useracess) {\n if (in_array(\"$useracess\", $accessid) || $useracess == 1) {\n $member = \"true\";\n break;\n }\n }\n } else {\n if ($rows->access != 0) {\n if ($accessid != $rows->access && $accessid != 2) {\n $member = \"false\";\n }\n }\n }\n\n ## Checks for Islive\n $islive = 'false';\n if ($streamername != '') {\n ($rows->islive == 1) ? $islive = 'true' : $islive = 'false';\n }\n if (!preg_match('/vimeo/', $video)) {\n\n echo '<mainvideo member=\"' . $member . '\" uid=\"'.$memberid.'\" \n views=\"' . $rows->times_viewed . '\"\n streamer_path=\"' . $streamername . '\"\n video_isLive=\"' . $islive . '\"\n video_id = \"' . htmlspecialchars($rows->id) . '\"\n video_url = \"' . htmlspecialchars($video) . '\"\n thumb_image = \"' . htmlspecialchars($timage) . '\"\n preview_image = \"' . htmlspecialchars($previewimage) . '\"\n allow_midroll = \"' . $midrollads . '\"\n allow_ima = \"' . $imaad . '\"\n allow_postroll = \"' . $postrollads . '\"\n allow_preroll = \"' . $prerollads . '\"\n postroll_id = \"' . $postrollid . '\"\n preroll_id = \"' . $prerollid . '\"\n allow_download = \"' . $download . '\"\n video_hdpath = \"' . $hdvideo . '\"\n copylink = \"\">\n <title><![CDATA[' . htmlspecialchars($rows->title) . ']]></title>\n <tagline targeturl=\"\"><![CDATA[' . htmlspecialchars(strip_tags($rows->description)) . ']]></tagline>\n </mainvideo>';\n }\n }\n }\n echo '</playlist>';\n exit();\n }",
"public function getHTML5Video() {\r\n if (empty($this->mime) && file_exists(RP_DOWNLOAD_DIR . $this->filepath)) {\r\n $this->getThumbnail(); \r\n }\r\n \r\n $mime = explode(\"/\", $this->mime); \r\n \r\n if ($mime[0] != \"video\") {\r\n return false;\r\n }\r\n \r\n $avlib = self::getAVLib();\r\n \r\n $videos = array();\r\n \r\n set_time_limit(1200);\r\n \r\n /**\r\n * Mp4\r\n */\r\n \r\n $dstfile = sprintf(\"%s/%s.v3.mp4\", pathinfo($this->filepath, PATHINFO_DIRNAME), pathinfo($this->filepath, PATHINFO_FILENAME));\r\n \r\n if (!file_exists(RP_DOWNLOAD_DIR . $dstfile)) {\r\n exec(sprintf(\"%s -i %s%s -vcodec h264 -acodec aac -strict -2 -ar 64k %s%s\", $avlib, RP_DOWNLOAD_DIR, $this->filepath, RP_DOWNLOAD_DIR, $dstfile), $return);\r\n }\r\n \r\n $finfo = finfo_open(FILEINFO_MIME_TYPE); \r\n $mime = finfo_file($finfo, RP_DOWNLOAD_DIR . $dstfile);\r\n \r\n $videos['mp4'] = array(\r\n \"absolute\" => RP_DOWNLOAD_DIR . $dstfile,\r\n \"file\" => $dstfile,\r\n \"size\" => filesize(RP_DOWNLOAD_DIR . $dstfile),\r\n \"mime\" => $mime\r\n );\r\n \r\n /**\r\n * WebM\r\n */\r\n \r\n $dstfile = sprintf(\"%s/%s.v3.webm\", pathinfo($this->filepath, PATHINFO_DIRNAME), pathinfo($this->filepath, PATHINFO_FILENAME));\r\n \r\n if (!file_exists(RP_DOWNLOAD_DIR . $dstfile)) {\r\n exec(sprintf(\"%s -i %s%s -acodec libvorbis -ac 2 -ab 96k -ar 44100 %s%s\", $avlib, RP_DOWNLOAD_DIR, $this->filepath, RP_DOWNLOAD_DIR, $dstfile), $return);\r\n }\r\n \r\n $finfo = finfo_open(FILEINFO_MIME_TYPE); \r\n $mime = finfo_file($finfo, RP_DOWNLOAD_DIR . $dstfile);\r\n \r\n $videos['webm'] = array(\r\n \"absolute\" => RP_DOWNLOAD_DIR . $dstfile,\r\n \"file\" => $dstfile,\r\n \"size\" => filesize(RP_DOWNLOAD_DIR . $dstfile),\r\n \"mime\" => $mime\r\n );\r\n \r\n return $videos;\r\n }",
"function flex_video_shortcode($atts, $content = NULL) {\n $a = shortcode_atts( array(\n 'aspect' => ''\n ), $atts );\n $aspect = ($a['aspect'] == 'standard') ? '' : 'widescreen';\n $content = '<div class=\"flexvideo '.$aspect.'\">'.$content.'</div>';\n return $content;\n}"
] | [
"0.6867807",
"0.6546226",
"0.6408567",
"0.62680405",
"0.6258868",
"0.62035555",
"0.6196014",
"0.61593914",
"0.61022085",
"0.6093533",
"0.6092264",
"0.60245377",
"0.6018343",
"0.60150695",
"0.60010564",
"0.60003734",
"0.59733105",
"0.59440535",
"0.59158",
"0.5873707",
"0.57781523",
"0.5772073",
"0.57702684",
"0.5767584",
"0.5767034",
"0.5767034",
"0.5767034",
"0.5767034",
"0.5756696",
"0.5753841",
"0.57518214",
"0.57390404",
"0.5726061",
"0.5715091",
"0.5698967",
"0.5692593",
"0.56872565",
"0.5683227",
"0.5681866",
"0.56773216",
"0.5657437",
"0.56481624",
"0.56327176",
"0.563009",
"0.56046677",
"0.55957186",
"0.5592824",
"0.55887294",
"0.55781746",
"0.55723333",
"0.5570699",
"0.5560083",
"0.5546741",
"0.5545806",
"0.5542261",
"0.5535946",
"0.5533772",
"0.55276644",
"0.54999125",
"0.54983723",
"0.5497932",
"0.54963243",
"0.54876405",
"0.5479614",
"0.5473685",
"0.5473594",
"0.54734075",
"0.54625446",
"0.5454592",
"0.5450105",
"0.5410641",
"0.5396386",
"0.5390373",
"0.53842264",
"0.53778666",
"0.537444",
"0.5371932",
"0.536688",
"0.5364844",
"0.53643167",
"0.5359179",
"0.5357388",
"0.5348204",
"0.53334975",
"0.53251857",
"0.53152084",
"0.5313065",
"0.53090984",
"0.5308976",
"0.529828",
"0.52976155",
"0.52958333",
"0.52940845",
"0.5291197",
"0.5290733",
"0.5288161",
"0.5283182",
"0.5279278",
"0.52769375",
"0.52731496",
"0.5273136"
] | 0.0 | -1 |
/ Description Starting a call of conference on pressing start call button Author Dave Brown Created 27 Nov 2014 | public function start_call()
{
if (post_data('tokbox_session_key') == NULL || post_data('tokbox_token') == NULL)
{
exit(json_encode(array('status' => '0')));
}
$this->session->set_userdata('tokbox_data', post_data());
exit(json_encode(array('status' => '1')));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionCall()\n {\n $req = Yii::$app->request;\n \n $phoneTo = (int)$req->get('phoneTo');\n if (!is_numeric($phoneTo)) return 'Phone must be a number';\n\n $phoneFrom = self::PHONE_ADMIN;\n $sid = $req->get('sid');\n $token = $req->get('token');\n \n $twiloiSet = (isset($sid) && isset($token));\n if (!$twiloiSet) return \"Twilio API call. From: $phoneFrom To: $phoneTo\";\n\n $client = new Client($sid, $token);\n\n $call = $client->calls->create(\n $phoneTo,\n $phoneFrom,\n [\"url\" => \"http://demo.twilio.com/docs/voice.xml\"]\n );\n echo $call->sid;\n }",
"function processCallStart($request) {\n //$logFusion =& LoggerManager::getLogger('fusion');\t\n $connector = $this->getConnector();\n\t$direction = $request->get('direction');\n $callerNumber = $request->get('callerIdNumber');\n\t$request->set('callstatus','callstart');\n\t$request->set('Direction', $direction);\n\tif ($direction == 'inbound' || $direction == 'outbound') { \t \t \n\t if ($direction=='oubound') {\n \t\t$userInfo = PBXManager_Record_Model::getUserInfoWithNumber($callerNumber);\n\t\tif ($request->get('callerIdNumber')) {\n \t $to = $request->get('callerIdNumber');\n \t} else if ($request->get('callerIdName')) {\n \t $to = $request->get('callerIdName');\n \t} \n \t$request->set('to', $to);\n \t$customerInfo = PBXManager_Record_Model::lookUpRelatedWithNumber($to);\n\t\tif ($userInfo) \n\t\t $connector->handleCallStartFusion($request, $userInfo, $customerInfo);\n\t\telse {\n\t\t //CRM User is not found \n\t\t $param['status'] = \"404 Not Found\";\n\t\t $param['message'] = \"CRM User Not Found\";\t \n\t\t $connector->respondToIncomingCallStart($param);\n\t\t}\n\t } else {\n\t //inbound call\n\t\t//$logFusion->debug(\"PBX PROCESSCALLSTART\");\n \t$customerInfo = PBXManager_Record_Model::lookUpRelatedWithNumber($request->get('callerIdNumber'));\n\t\t//$logFusion->debug(\"PBX PROCESSCALLSTART customerInfo_id=\".$customerInfo['id']);\n \t$request->set('from', $request->get('callerIdNumber'));\n\t\t//CRM User is unknown now \t\n\t\t$userInfo = PBXManager_Record_Model::getUserInfoAdmin();\t \n\t\t$connector->handleCallStartFusion($request, $userInfo, $customerInfo);\n\t }\t \n\t} else {\n\t//local call\n\t\t$request->set('Direction', 'local');\n\t\t//$logFusion->debug(\"PBX processCallStart Local callerIdNumber=\".$request->get('callerIdNumber').\" callerNumber=\".$callerNumber);\t \n \t$customerInfo = PBXManager_Record_Model::lookUpRelatedWithNumberLocal($request->get('callerIdNumber'));\n\t\t$userInfo = PBXManager_Record_Model::getUserInfoWithNumber($callerNumber);\n\t\tif (!$userInfo)\n\t\t $userInfo = PBXManager_Record_Model::getUserInfoAdmin();\t \n\t\t$connector->handleCallStartFusion($request, $userInfo, $customerInfo);\n\t}\n }",
"function on_start(){\n //$userID = $u->getUserID();\n \n //print \"runnin\";\n //$cartEventClassName = 'ScottcAffiliateRelation';\n //$cartEventClassPath = 'packages/scottc_affiliates/libraries/affiliate_relation.php';\n $eventClassName = 'AffiliateGateway';\n $eventClassPath = 'packages/affiliate_gateway/libraries/affiliate_gateway.php';\n \n define(\"ENABLE_APPLICATION_EVENTS\", true);\n \n Events::extend('on_start', $eventClassName, 'eventOnStart', $eventClassPath, $_GET);\n //Events::extend('on_page_view', 'AffiliateGateway', 'eventOnStart', 'packages/affiliate_gateway/libraries/affiliate_gateway.php');\n \n // if($_GET){\n // Loader::library('affiliate_relation',SCOTTECOMAFFILATESPACKAGEHANDLE);\n // $har = new ScottcAffiliateRelation($_GET);\n // }\n }",
"function runningPlay() {\n\t\t// request information about the new challenge ...\n\t\t// ... and callback to function newChallenge() ...\n//\t\t$this->addCall('GetCurrentChallengeInfo', array(), '', 'newChallenge');\n\t}",
"function coppa_start()\n\t{\n\t\t$coppa_date = date( 'j-F y', mktime(0,0,0,date(\"m\"),date(\"d\"),date(\"Y\")-13) );\n\t\t\n\t\t$this->ipsclass->lang['coppa_form_text'] = str_replace( \"<#FORM_LINK#>\", \"<a href='{$this->ipsclass->base_url}act=Reg&CODE=12'>{$this->ipsclass->lang['coppa_link_form']}</a>\", $this->ipsclass->lang['coppa_form_text']);\n\t\t\n\t\t$this->output .= $this->ipsclass->compiled_templates['skin_register']->coppa_start($coppa_date);\n\t\t\n\t\t$this->page_title = $this->ipsclass->lang['coppa_title'];\n\t\t\n \t$this->nav = array( $this->ipsclass->lang['coppa_title'] );\n \t}",
"public function actionStartListening()\n {\n if (!isset($_REQUEST['source']))\n {\n echo json_encode(array('errors' => array('Unknown connection type')));\n\n Yii::app()->end();\n }\n\n\n $source = strtoupper ($_REQUEST['source']);\n $communication_type = !empty($_REQUEST['communication_type']) ? strtoupper ($_REQUEST['communication_type']) : 'COMMUNICATION_TYPE_NONE' ;\n\n $last_connection = Listener::getLastConnectionInfo($source);\n\n if ($last_connection && !$last_connection['stopped'])\n {\n echo json_encode(array('ok_still' => 1));\n\n Yii::app()->end();\n }\n\n\n\n $command = Yii::app()->params['applications']['php_exe_path'] . ' -f ' . Yii::app()->params['console_app_path'] . ' listen '. $source .' '. $communication_type .' Admin';\n It::runAsynchCommand($command);\n\n echo json_encode(array('ok' => 1));\n\n Yii::app()->end();\n }",
"public function startConversation(Conversation $Conversation)\n\t{\n\t}",
"function processStartupCallFusion($request) {\n\t//$logFusion =& LoggerManager::getLogger('fusion');\n\t//$logFusion->debug(\"PBX processStartupCallFusion callstatus=\".$request->get('callstatus').\" uuid=\".$request->get('uuid').\" CallUUID=\".$request->get('callUUID'));\n\t$connector = $this->getConnector();\n\t$connector->handleStartupCallFusion($request);\t\n }",
"public function __construct(public \\GreyZero\\WebCallCenter\\Models\\Call $call){}",
"public function phone_encounter()\n\t{\n\t\t$this->loadModel('ScheduleCalendar');\n\t\t$this->loadModel('ScheduleType');\n\t\t$this->loadModel('PracticeLocation');\n\t\t$patient_id = $this->params['named']['patient_id'];\n\t\t$location = $this->params['named']['location_id'];\n\t\t$type = $this->ScheduleType->find('first', array('fields' => 'appointment_type_id','conditions' => array('type' =>'Phone Call')));\n\t\t$practice_location = $this->PracticeLocation->find('first', array('conditions' => array('location_id' => $location), 'fields' => 'default_visit_duration'));\n\t\t$time = __date('H:i');\n\t\t$duration = $practice_location['PracticeLocation']['default_visit_duration'];\n\n\t\tif(empty($duration)) \n\t\t\t$duration = 15; // set duration 15 mins if it is empty\n\n\t\t$encounterCount = $this->EncounterMaster->find('count', array('conditions' => array('patient_id' => $patient_id), 'recursive' => -1));\n\t\tif($encounterCount > 0) {\n\t\t\t$reason_for_visit = 'Follow Up';\n\t\t} else {\n\t\t\t$reason_for_visit = 'New Visit';\n\t\t}\n $scheduleData = array(\n\t\t\t'patient_id' => $patient_id,\n\t\t\t'location' => $location,\n\t\t\t'reason_for_visit' => $reason_for_visit,\n\t\t\t'provider_id' => $this->Session->Read('UserAccount.user_id'),\n\t\t\t'date' => __date('Y-m-d'),\n\t\t\t'starttime' => $time,\n\t\t\t'duration' => $duration,\n\t\t\t'endtime' => __date('H:i', strtotime(\"+$duration minutes\")),\n\t\t\t'visit_type' => $type['ScheduleType']['appointment_type_id']\n\t\t);\n $this->ScheduleCalendar->save($scheduleData);\n\t\t$calendar_id = $this->ScheduleCalendar->id;\n\t\tif($calendar_id > 0)\n\t\t{\n\t\t\t$this->loadModel('PatientDemographic');\n\t\t\t$patient_status = $this->PatientDemographic->field('status', array('patient_id' => $patient_id));\n\t\t\tif ($patient_status == 'New' && $encounterCount > 0)\n\t\t\t{\n\t\t\t\t//$dataDemographic['PatientDemographic']['patient_id'] = $patient_id;\n\t\t\t\t//$dataDemographic['PatientDemographic']['status'] = 'Active';\n\t\t\t\t//$this->PatientDemographic->save($dataDemographic);\n\t\t\t}\n\t\t\t$this->EncounterMaster->execute($this, $calendar_id, '', 'Phone');\n\t\t}\n\t}",
"public function register_start()\n {\n\n echo \"Started a New Action \";\n $project = readline(\"On what project are you working on? \");\n $this->project = $project;\n date_default_timezone_set('Europe/Berlin');\n //Array that keeps the localtime \n $arrayt = localtime();\n //calculates seconds rn for further use\n $timeRN = $arrayt[0] + ($arrayt[1] * 60) + ($arrayt[2] * 60 * 60); //in seconds\n\n $dateRN = date('Y-m-d');\n if (file_exists($this->save)) {\n $json_already = file_get_contents($this->save);\n }\n $json = json_decode($json_already);\n\n $array[] = array(\n\n 'Time' => $dateRN,\n 'Starttime' => $timeRN,\n 'Endtime' => \"\",\n 'Project' => $this->project,\n 'Worked' => \"\"\n\n );\n\n $json[] = $array;\n $json_decoded = json_encode($json);\n\n file_put_contents($this->save, $json_decoded);\n }",
"public function startAction() {\n session_unset();\n\n \t$br = new bookingRecord();\n \t$br->save();\n\n $this->View('booking_start');\n }",
"public function track_helper_connection_start() {\n\t\tWC_Tracks::record_event( 'extensions_subscriptions_connect' );\n\t}",
"function beginRound()\n\t\t{\n\t\t// request information about the new challenge ...\n\t\t// ... and callback to function newChallenge() ...\n\n\t\t}",
"public function actionStart($at=false,$in=false)\n {\n // Start the competition $in number of seconds from now\n }",
"public function addConference($confno,$record=\"true\")\n {\n //$confno confirence number to set\n $conf= $this->doc->createElement(\"conference\",$confno);\n $conf ->setAttribute( \"record\", $record ); // to enable conference recording, record = 'true'\n // record file you can get http://recordings.kookoo.in/<kookoo-username>/<did><confno>.wav\n $this->response->appendChild($conf);\n }",
"public function actionStart() {\n\n Session::initNewBooking();\n Wizard2::initStepsClient();\n Wizard2::setActiveStep(Wizard2::VIEW_FIND_CARERS); //first step active\n\n $request = Yii::app()->request;\n $postCode = $request->getParam('postCode', '');\n\n $this->redirect(array('site/findCarers' /* , 'postCode' => $postCode */));\n }",
"public function talk();",
"public function display() {\n\t\tglobal $CALL_NOW;\n\t\t$this->action->getResponse()->setSlot(\"additnl_save\", $this->action->getPartial(\"contact_save\"));\n\t\t$this->action->EMAIL = $this->loginProfile->getEMAIL();\n\t\t$this->action->PHONE_NUMBER_OWNER = $this->loginProfile->getPHONE_NUMBER_OWNER();\n\t\t$this->action->PHONE_OWNER_NAME = $this->loginProfile->getPHONE_OWNER_NAME();\n\t\t$this->action->MOBILE_NUMBER_OWNER = $this->loginProfile->getMOBILE_NUMBER_OWNER();\n\t\t$this->action->MOBILE_OWNER_NAME = $this->loginProfile->getMOBILE_OWNER_NAME();\n\t\t$this->action->HOROSCOPE_MATCH = $this->loginProfile->getHOROSCOPE_MATCH();\n\t\t$timetocallstart = $this->loginProfile->getTIME_TO_CALL_START();\n\t\t$timetocallend = $this->loginProfile->getTIME_TO_CALL_END();\n\t\t$time_to_call_start = substr($timetocallstart, 0, 2);\n\t\t$start_am_pm = trim(substr($timetocallstart, 2, 4));\n\t\t$this->action->time_to_call_start = $time_to_call_start;\n\t\t$this->action->start_am_pm = $start_am_pm;\n\t\t$time_to_call_end = substr($timetocallend, 0, 2);\n\t\t$end_am_pm = trim(substr($timetocallend, 2, 4));\n\t\t$this->action->time_to_call_end = $time_to_call_end;\n\t\t$this->action->end_am_pm = $end_am_pm;\n\t\t$this->action->COUNTRY_RES_VAL = $this->loginProfile->getDecoratedCountry();\n\t\t$this->action->COUNTRY_RES = DropDownCreator::createDD(\"cityAndCountry\", $this->loginProfile->getCOUNTRY_RES(),\"\",\"\",1);\n\t\tif($this->loginProfile->getCITY_RES()==='0')\n\t\t\t$this->action->CITY_SELECTED='0';\n\t\telse\n\t\t\t$this->action->CITY_SELECTED = \"|{|\" . $this->loginProfile->getCITY_RES();\n\t\t$this->action->RES_STATUS = $this->loginProfile->getRES_STATUS();\n\t\t$this->action->FAMILYINFO = $this->loginProfile->getFAMILYINFO();\n\t\t$this->action->PARENTS_CONTACT = $this->loginProfile->getPARENTS_CONTACT();\n\t\t$this->action->PARENT_PINCODE = $this->loginProfile->getPARENT_PINCODE();\n\t\t$this->action->SHOW_PARENTS_CONTACT = $this->loginProfile->getSHOW_PARENTS_CONTACT();\n\t\t$this->action->CONTACT = $this->loginProfile->getCONTACT();\n\t\t$this->action->SHOWADDRESS = $this->loginProfile->getSHOWADDRESS();\n\t\t$this->action->PINCODE = $this->loginProfile->getPINCODE();\n\t\t$this->action->PHONE_RES = $this->loginProfile->getPHONE_RES();\n\t\t$this->action->PHONE_MOB = $this->loginProfile->getPHONE_MOB();\n\t\t$this->action->SHOWPHONE_RES = $this->loginProfile->getSHOWPHONE_RES();\n\t\t$this->action->SHOWPHONE_MOB = $this->loginProfile->getSHOWPHONE_MOB();\n\t\t$this->action->MESSENGER_ID = $this->loginProfile->getMESSENGER_ID();\n\t\t$this->action->MESSENGER_CHANNEL = $this->loginProfile->getMESSENGER_CHANNEL();\n\t\t$this->action->SHOWMESSENGER = $this->loginProfile->getSHOWMESSENGER();\n\t\t$this->action->CALL_NOW = $CALL_NOW;\n\t\tif ($this->loginProfile->getISD() == '') $Country_Code = get_code('COUNTRY', $this->loginProfile->getCOUNTRY_RES());\n\t\telse $Country_Code = \"+\".$this->loginProfile->getISD();\n\t\tif ($this->loginProfile->getSTD() == '' && $this->loginProfile->getCOUNTRY_RES() == 51) $State_Code = get_code('CITY_INDIA', $this->loginProfile->getCITY_RES());\n\t\telse $State_Code = $this->loginProfile->getSTD();\n\t\t$ccc = create_code(\"COUNTRY\");\n\t\t$csc = create_code(\"CITY_INDIA\");\n\t\t$this->action->country_isd_code = $ccc;\n\t\t$this->action->india_std_code = $csc;\n\t\t$this->action->country_code = $Country_Code;\n\t\t$this->action->country_code_mob = $Country_Code;\n\t\t$this->action->state_code = $State_Code;\n\t\t$extendedContacts = $this->loginProfile->getExtendedContacts(\"onlyValues\");\n\t\t$this->action->ALT_MOBILE_ISD = $extendedContacts[ALT_MOBILE_ISD];\n\t\t$this->action->ALT_MOBILE = $extendedContacts[ALT_MOBILE];\n\t\t$this->action->ALT_MOBILE_NUMBER_OWNER = $extendedContacts[ALT_MOBILE_NUMBER_OWNER];\n\t\t$this->action->ALT_SHOWPHONE_MOB = $extendedContacts[SHOWALT_MOBILE];\n\t\t$this->action->ALT_MOBILE_OWNER_NAME = $extendedContacts[ALT_MOBILE_OWNER_NAME];\n\t\t$this->action->ALT_MESSENGER_CHANNEL = $extendedContacts[ALT_MESSENGER_CHANNEL];\n\t\t$this->action->ALT_SHOWMESSENGER = $extendedContacts[SHOW_ALT_MESSENGER];\n\t\t$this->action->ALT_MESSENGER_ID = $extendedContacts[ALT_MESSENGER_ID];\n\t\t$this->action->blackberry_pin = $extendedContacts[BLACKBERRY];\n\t\t$this->action->linkedin_url = $extendedContacts[LINKEDIN_URL];\n\t\t$this->action->FB_URL = $extendedContacts[FB_URL];\n\t\t$this->action->SHOWBLACKBERRY = $extendedContacts[SHOWBLACKBERRY];\n\t\t$this->action->SHOWLINKEDIN = $extendedContacts[SHOWLINKEDIN];\n\t\t$this->action->SHOWFACEBOOK = $extendedContacts[SHOWFACEBOOK];\n\t\tif ($CALL_NOW) if ($extendedContacts[CALL_ANONYMOUS] == 'Y') {\n\t\t\t$this->action->ALT_SHOWPHONE_MOB = 'CN';\n\t\t\t$this->action->SHOWPHONE_RES = 'CN';\n\t\t\t$this->action->SHOWPHONE_MOB = 'CN';\n\t\t}\n\t}",
"function oncall_config_form($form, &$form_state) {\n $team_select = array();\n $leader = 0;\n\n if ($team = oncall_get_team('available')) {\n foreach ($team as $member) {\n if ($member['leader'] == 1) {\n $leader = $member['ocid'];\n }\n $team_select[$member['ocid']] = $member['name'];\n }\n }\n \n // select team leader\n $form['oncall_point'] = array(\n '#type' => 'select', \n '#title' => t('On Call Point Person'), \n '#default_value' => $leader, \n '#options' => $team_select, \n '#empty_option' => t('No Leader'), \n '#tree' => FALSE, \n '#description' => t('Select the person who is leading the team. A caller to this service is given the option to connect directly to the leader. If no leader is selected, the direct connect option is not available.'),\n );\n \n // sms message\n $form['oncall_sms'] = array(\n '#type' => 'textarea',\n '#title' => t('SMS Message Text'),\n '#description' => t('The message to be sent when a new help request comes in. Include the variable @url to include a link to listen to the message.'),\n '#default_value' => variable_get('oncall_sms_msg', 'A new help request has been received. Listen here @url'),\n '#rows' => 3,\n );\n \n // welcome message\n $form['welcome'] = array(\n '#type' => 'fieldset', \n '#title' => t('Welcome Message'), \n );\n $form['welcome']['welcome_current'] = array(\n '#markup' => theme('oncall_audio', array('src' => oncall_get_message('welcome'))),\n );\n $form['welcome']['oncall_welcome'] = array(\n '#type' => 'file',\n '#size' => 22,\n '#description' => t('The mp3 audio file that will be played every time a person calls the On Call line.'),\n );\n \n // 'no status' message\n $form['nostatus'] = array(\n '#type' => 'fieldset', \n '#title' => t('No New Status Message'), \n );\n $form['nostatus']['nostatus_current'] = array(\n '#markup' => theme('oncall_audio', array('src' => oncall_get_message('nostatus'))), \n );\n $form['nostatus']['oncall_nostatus'] = array(\n '#type' => 'file',\n '#size' => 22,\n '#description' => t('The mp3 audio file that will be played when there are no recent status messages to report.'),\n );\n \n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Submit'),\n );\n \n return $form;\n}",
"public static function start()\n {\n self::registerDefault();\n\n $page = rex_request('page', 'string');\n $subpage = rex_request('subpage', 'string');\n $function = rex_request('function', 'string');\n\n if ($page === 'import_export' && $subpage === 'import' && $function === 'dbimport') {\n rex_register_extension('A1_AFTER_DB_IMPORT', function () {\n rex_developer_manager::synchronize(null, true);\n });\n } elseif ($page === 'developer' && $function === 'update') {\n rex_register_extension('OUTPUT_FILTER_CACHE', function () {\n rex_developer_manager::synchronize(null, true);\n });\n } else {\n self::synchronize(self::START_EARLY);\n rex_register_extension('OUTPUT_FILTER_CACHE', function () {\n rex_developer_manager::synchronize(rex_developer_manager::START_LATE);\n });\n }\n }",
"public function start();",
"public function start();",
"public function start();",
"public function start();",
"public function start();",
"public function start();",
"public function start();",
"public function start();",
"public function start();",
"public function start();",
"public function start();",
"public function start();",
"function startSurvey($respondent = null) {\n $this->autoRender = false; // turn off autoRender because we need total control over what view to render here\n $this->__clearEditSession(CLEAR_SURVEY); // clear any previous session variables\n $this->Session->write('Survey.type', 'user'); // write the survey type to the session\n $this->redirect(array('action' => 'runSurvey', 'respondentGUID' => $respondent)); // send to the main survey routine\n }",
"protected function _startForcedFaxNegotiation()\n {\n $this->_forcedFaxNegotiator->reset();\n $this->_forcedFaxNegotiator->setLeftCallLeg( $this->_sipCallLeg );\n $this->_forcedFaxNegotiator->setRightCallLeg( $this->_msCallLeg );\n $this->_forcedFaxNegotiator->addEventListener(\n Streamwide_Engine_Events_Event::CONNECTED,\n array(\n 'callback' => array( $this, 'onForcedFaxNegotiationComplete' ),\n 'options' => array( 'autoRemove' => 'before' )\n )\n );\n $this->_forcedFaxNegotiator->addEventListener(\n Streamwide_Engine_Events_Event::ERROR,\n array(\n 'callback' => array( $this, 'onForcedFaxNegotiationFailure' ),\n 'options' => array( 'autoRemove' => 'before' )\n )\n );\n $this->_forcedFaxNegotiator->connect();\n }",
"public function call()\n {\n // TODO: Implement call() method.\n }",
"function startRelaying() { }",
"public function newCall()\n {\n $this->cseq = 20;\n $this->call_id = null;\n $this->to_tag = null;;\n $this->from_tag = null;;\n \n /**\n * Body\n */\n $this->body = null;\n \n /**\n * Received Response\n */\n $this->response = null;\n $this->res_code = null;\n $this->res_contact = null;\n $this->res_cseq_method = null;\n $this->res_cseq_number = null;\n\n /**\n * Received Request\n */\n $this->req_method = null;\n $this->req_cseq_method = null;\n $this->req_cseq_number = null;\n $this->req_contact = null;\n \n $this->routes = array();\n $this->request_via = array();\n }",
"public function isInitialCall();",
"public static function onNewCall($call) {\n\t}",
"public function actionCreate($id) {\n $appointment = Appointment::find($id)->one();\n $model = new PortCallData();\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 'appointment' => $appointment,\n ]);\n }\n }",
"function displayStartup()\n\t{\n\t\t$this->tpl->addBlockFile(\"CONTENT\",\"content\",\"tpl.clientsetup.html\", \"setup\");\n\n\t\t$this->tpl->setVariable(\"TXT_INFO\",$this->lng->txt(\"info_text_first_client\"));\n\t\t$this->tpl->setVariable(\"TXT_HEADER\",$this->lng->txt(\"setup_first_client\"));\n\n\t\t$this->displayProcessPanel();\n\n\t\t$this->setButtonNext(\"ini\");\n\t}",
"public function startReqSession(){\n\n\t\t\t$message = '\n\t\t\t<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"\n\t\t\txmlns:shar=\"http://www.travelport.com/schema/sharedBooking_v34_0\"\n\t\t\txmlns:com=\"http://www.travelport.com/schema/common_v34_0\">\n\t\t\t<soapenv:Header/>\n\t\t\t<soapenv:Body>\n\t\t\t\t<shar:BookingStartReq TraceId=\"c7e2d212-0e77-458e-87e9-e4b361ffdd8\"\n\t\t\t\t TargetBranch=\"'.$this->uApi->getApiDetails('TARGET_BRANCH').'\" ProviderCode=\"'.$this->uApi->getApiDetails('PROVIDER').'\">\n\t\t\t\t<com:BillingPointOfSaleInfo OriginApplication=\"UAPI\"/>\n\t\t\t\t</shar:BookingStartReq>\n\t\t\t</soapenv:Body>\n\t\t\t</soapenv:Envelope>\n\t\t\t';\n\n\n\t\t\t$auth = base64_encode($this->uApi->getApiDetails('CREDENTIALS'));\n\t\t\t$soap_do = curl_init(\t\t$this->uApi->getApiDetails('PRE_PROD_URL_SESSIONED'));\n\t\t\t$header = array(\n\t\t\t\"Content-Type: text/xml;charset=UTF-8\",\n\t\t\t\"Accept: gzip,deflate\",\n\t\t\t\"Cache-Control: no-cache\",\n\t\t\t\"Pragma: no-cache\",\n\t\t\t\"SOAPAction: \\\"\\\"\",\n\t\t\t\"Authorization: Basic $auth\",\n\t\t\t\"Content-length: \".strlen($message),\n\t\t\t);\n\n\n\t\t\t// Sending CURL Request To Fetch Data From API\n\t\t\tcurl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 120);\n\t\t\tcurl_setopt($soap_do, CURLOPT_TIMEOUT, 120);\n\t\t\tcurl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false);\n\t\t\tcurl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false);\n\t\t\tcurl_setopt($soap_do, CURLOPT_POST, true );\n\t\t\tcurl_setopt($soap_do, CURLOPT_POSTFIELDS, $message);\n\t\t\tcurl_setopt($soap_do, CURLOPT_HTTPHEADER, $header);\n\t\t\tcurl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true);\n\t\t\t$resp = curl_exec($soap_do);\n\t\t\tcurl_close($soap_do);\n\n\t\t\t//write to file\n\t\t\t\t\t$this->logger('Req:\\r\\n\\t'.$message.'\\r\\nResp:'.$resp , time());\n\t\t\t//Loads the XML\n\t\t\t$xml = simplexml_load_string($resp);\n\t\t\treturn $xml;\n\t}",
"public function show(Call $call)\n {\n //\n }",
"public function start() {\r\n\t\tparent::start ();\r\n\t\tif (( string ) $this->data->ipaddr == 'dhcp') {\r\n\t\t\t$this->enableDHCP ();\r\n\t\t}\r\n\t}",
"protected function start(){\n \tLynx_Request::parse();\n }",
"function start() {\n\t\tif ($this->Time->hasAny(\"Time.user_id = '\" . $this->userid . \"' AND Time.stop = '0000-00-00 00:00:00'\")) {\n\t\t\t$this->flash('Du arbeitest doch schon', '/times/index');\n\t\t\texit();\n\t\t}\n\n\t\t$this->request->data['Time']['user_id'] = $this->userid;\n\t\t$this->request->data['Time']['start'] = date('Y-m-d H:i:s');\n\t\t$this->request->data['Time']['break'] = 0;\n\n\t\tif ($this->Time->save($this->request->data)) {\n\t\t\t$this->Session->setFlash('Started, Wohoo!', 'message_ok');\n\t\t\t$this->redirect('/times/index');\n\t\t} else {\n\t\t\t$this->Session->setFlash('Please correct errors below.', 'message_error');\n\t\t\t$this->set('users', $this->Time->User->find('list'));\n\t\t\t$this->set('customers', $this->Time->Customer->find('list'));\n\t\t\t$this->redirect('/times/index');\n\t\t}\n\t}",
"function init_call() {\n\tdomain_check();\n\tsession_check();\n\n\t$db = connect_database(); // Connect... to the... database...\n\n\tcreate_structure(); // Ensure the data tables exist\n\tprocess_action(); // Work how to respond\n\n\tsend_message('error', array('reason' => 'none', 'message' => 'Something went wrong'));\n}",
"public function handleOnEventStartLine() {\n\t\t$this->closeWidget(self::SETTING_TEAMSCORE_TITLE);\n\t\t$this->ifSpectatorShowAllScoreWidget();\n\t}",
"public function start()\n {\n // TODO: Implement start() method.\n }",
"public function start(){\n\n $this->callView();\n\n }",
"public function newCall()\n {\n $this->cseq = 20;\n $this->call_id = null;\n $this->to_tag = null;;\n $this->from_tag = null;;\n \n /**\n * Body\n */\n $this->body = null;\n \n /**\n * Received Response\n */\n $this->response = null;\n $this->res_code = null;\n $this->res_contact = null;\n $this->res_cseq_method = null;\n $this->res_cseq_number = null;\n\n /**\n * Received Request\n */\n $this->req_method = null;\n $this->req_cseq_method = null;\n $this->req_cseq_number = null;\n $this->req_contact = null;\n \n $this->routes = [];\n $this->request_via = [];\n }",
"public function __construct(Call $call, CallParticipant $participant)\n {\n $this->call = $call;\n $this->participant = $participant;\n }",
"function mailUser($transcript, $phoneNumber, $CallSid)\n{\n\t $inCallEmployeeId = getOne(\"select user_id from schedule where ph_id = (select ph_id from phone_numbers where phone_number like '%\".trim($phoneNumber).\"') and is_active=1\");\n\t$inCallEmployeeMail = getOne(\"select user_email from users where user_id = '\".$inCallEmployeeId.\"'\");\n\t$voiceURL = getOne(\"select recording_url from incomming_calls where call_sid = '\".$CallSid.\"'\");\n\t\n\t\n\tif(trim($inCallEmployeeMail) != \"\")\n\t{\n\t\t$message = \"\n\t\t\t<h3> New Call for you..!!</h3>\n\t\t\t<br />\n\t\t\tYou have a new message.<br />\n\t\t\tTranscription: \".$transcript.\"<br />\n\t\t\tVoice Url: \".$voiceURL.\"<br /><br />\n\t\t\tLog in to VBX scheduler for more details.<br />\n\t\t\tThanks.\t\t\n\t\t\";\n\t\tmailEmployee($inCallEmployeeMail, $message);\n\t}\n}",
"public function startListening();",
"public function Talk();",
"function oncall_page_config() {\n // check that the Twilio library loads and that configuration settings have been set\n $info = libraries_load('twilio-php');\n if (!$info['loaded']) {\n drupal_set_message(t('The Twilio API for PHP library is not loading'), 'warning');\n }\n \n $twilio_config = twiliophp_config_load();\n if (!isset($twilio_config['account_sid'])) {\n drupal_set_message(t('The Twilio account settings for Account SID and Auth Token have not yet been set.'), 'warning'); \n }\n \n // check that the On Call phone number has been set\n if (!variable_get('oncall_phone_number', \"\")) {\n drupal_set_message(t('You have not yet set an') . ' ' . l(t('application phone number.'), 'admin/config/services/oncall/extra'), 'warning');\n }\n\n $rows = array();\n $header = array(t('Person'), t('Phone Number'), t('Point Person'), t('Action'));\n if ($team = oncall_get_team('all')) {\n foreach ($team as $member) {\n $lead = ($member['leader'] == 1) ? 'Yes' : 'No';\n $name = ($member['available']) ? $member['name'] : $member['name'] . \" (unavailable)\";\n $rows[] = array($name, $member['phone'], $lead, l('edit', 'admin/config/services/oncall/member/edit/' . $member['ocid']));\n }\n }\n \n $out = \"<h3>The On Call Team</h3>\";\n $out .= theme('table', array('header' => $header, 'rows' => $rows));\n $out .= \"<h4>\" . l('Add A Team Member', 'admin/config/services/oncall/member/add') . \"</h4>\";\n $out .= drupal_render(drupal_get_form('oncall_config_form'));\n \n return $out;\n}",
"function forwardCall($num) {\r\n return \"<?xml version='1.0' encoding='UTF-8'?><Response><Dial>$num</Dial></Response>\"; \r\n}",
"function start();",
"function start();",
"public static function activate() {\n\t\tadd_option( 'wpr_future_events' );\n\t}",
"function Start(){\r\n\t\t\tglobal $email;\r\n\t\t\tglobal $errorCount;\r\n\t\t\t\r\n\t\t\t\t\t\t\tif (filter_var($email, FILTER_VALIDATE_EMAIL)){\r\n\t\t\t\t\t\t\t\t\tglobal $emailCheck;\r\n\t\t\t\t\t\t\t\t\t$emailCheck = true;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif (empty($email)){\r\n\t\t\t\t\t\t\t\tdisplayNameRequired(\"E-mail\");\r\n\t\t\t\t\t\t\t\t++$errorCount;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\telse if (!empty($email) && (!filter_var($email, FILTER_VALIDATE_EMAIL))){\r\n\t\t\t\t\t\t\t\tdisplayNameRequired(\"E-mail\");\r\n\t\t\t\t\t\t\t\t++$errorCount;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\r\n\t\tif(isset($_POST['Submit'])){\r\n\t\t\t//RedirectUser(); <--- Slight bug with this function, will work on it\r\n\t\t\tSubmitContent();\r\n\t\t\tBeginNewEntry();\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}",
"private function start_tour_pointer() {\n\t\t$selector = 'li.toplevel_page_formidable';\n\n\t\t$content = '<h3>' . __( 'Congratulations!', 'formidable' ) . '</h3>'\n\t\t\t\t\t. '<p>' . $this->opening_line() . ' ' . __( 'Click “Start Tour” to view a quick introduction of this plugin’s core functionality.', 'formidable' ) . '</p>';\n\t\t$opt_arr = array(\n\t\t\t'content' => $content,\n\t\t\t'position' => array( 'edge' => 'top', 'align' => 'center' ),\n\t\t);\n\n\t\t$this->button_array['button2']['text'] = __( 'Start Tour', 'formidable' );\n\t\t$this->button_array['button2']['function'] = sprintf( 'document.location=\"%s\";', admin_url( 'admin.php?page=formidable' ) );\n\n\t\t$this->print_scripts( $selector, $opt_arr );\n\t}",
"public function initiateCall(Request $request) {\n $params = $request->all();\n //validate incoming user input request\n $validator = Validator::make($request->all(), RequestRules::getRule('CLIENT_CASES'));\n\n if($validator->fails()) {\n return $this->validationError($validator->getMessageBag()->all(), HttpStatusCodes::UNPROCESSABLE_ENTITY);\n }\n\n $userDetails = User::where('client_id', $params['client_id'])->where('phonenumber', $params['phonenumber'])->first();\n $has_Subscription = Subscription::where('phonenumber', $params['phonenumber'])->first();\n \n if($userDetails){\n if($has_Subscription){\n try{\n $subData = $this->helper->getUserSubscriptionDataViaMobile($params['phonenumber']);\n //dd($subData);\n if($subData){\n $userData = $userDetails->toArray();\n $userDataContent = $this->jsonToArray($userData['content']);\n $subscriptionData = $has_Subscription->toArray();\n $subscriptionDataContent = $this->jsonToArray($subscriptionData['content']);\n \n // Create Case\n $caseparam = $params; // copy request data\n $caseparam['case_id'] = $this->generateDefaultStaticPassword(5);\n $caseparam['client_name'] = $userDataContent['firstname']. \" \". $userDataContent['lastname'];\n $caseparam['client_id'] = $params['client_id'];\n $caseparam['client_email'] = $userDataContent['email'];\n $caseparam['client_phonenumber'] = $userDataContent['phonenumber'];\n $caseparam['client_package'] = $userDataContent['package'];\n $caseparam['case_status'] = \"open\";\n $caseparam['sub_status'] = $userDataContent['status'];\n \n $caseQuery = new ClientCases();\n $caseDetails = $caseQuery->addCase($caseparam);\n\n if($caseDetails){\n $data = $caseparam;\n $msg = \"Call can Proceed to Doctor\";\n return $this->jsonoutput($msg, $data, HttpStatusCodes::OK);\n } else {\n return $this->validationError('Case not created. Call cannot proceed', HttpStatusCodes::BAD_REQUEST);\n }\n \n } else {\n return $this->validationError('No Active Subscription', HttpStatusCodes::BAD_REQUEST);\n }\n } catch(\\Exception $e) {\n //something went wrong\n return $this->exceptionError($e->getMessage(), HttpStatusCodes::BAD_REQUEST);\n \n }\n } else {\n return $this->validationError('No Subscription Package Exists for this User!', HttpStatusCodes::NOT_FOUND);\n }\n \n } else {\n return $this->validationError('Wrong Client ID or Phonenumber', HttpStatusCodes::BAD_REQUEST);\n }\n \n }",
"public function setCallSignature(string $call_sig):void{\n\t\t$this->call_sig = $call_sig;\n\t }",
"function _call_banner( $options )\n\t{\n\n\t\t\t$button = false;\n\t\t\t$div_size = 'span12';\n\t\t\t\n\t\t\tif ( !empty ( $options['cab_button_text'] ) && !empty ( $options['cab_button_link']['url'] ) ) {\n\t\t\t\t$button = true;\n\t\t\t\t$div_size = 'span10';\n\t\t\t}\n\t\t\n\t\t\tif ( !empty ( $options['cab_main_title'] ) || !empty ( $options['cab_sec_title'] ) ) {\n\t\t\t\t\n\t\t\t\techo '<div class=\"'.$div_size.'\">';\n\t\t\t\n\t\t\t\tif ( !empty ( $options['cab_main_title'] ) ) {\n\t\t\t\t\techo '<h3 class=\"m_title\" style=\"margin-top:25px;\">'.$options['cab_main_title'].'</h3>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( !empty ( $options['cab_sec_title'] ) ) {\n\t\t\t\t\techo '<p>'.$options['cab_sec_title'].'</p>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\techo '</div>';\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif ( $button ) {\n\t\t\t\techo '<div class=\"span2\">';\n\t\t\t\t\n\t\t\t\t\techo '<a href=\"'.$options['cab_button_link']['url'].'\" class=\"circlehover with-symbol\" data-size=\"\" data-position=\"top-left\" data-align=\"right\" target=\"'.$options['cab_button_link']['target'].'\">';\n\t\t\t\t\t\techo '<span class=\"text\">'.$options['cab_button_text'].'</span>';\n\t\t\t\t\t\tif ( !empty ( $options['cab_button_image'] ) ) {\n\t\t\t\t\t\t\techo '<span class=\"symbol\"><img src=\"'.$options['cab_button_image'].'\" alt=\"\"></span>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\techo '<span class=\"symbol\"><img src=\"'.MASTER_THEME_DIR.'/images/ok.png\" alt=\"\"></span>';\n\t\t\t\t\t\t}\n\t\t\t\t\techo '</a>';\n\t\t\t\techo '</div>';\n\t\t\t}\n\n\t}",
"function _call_banner( $options )\n\t{\n\n\t\t\t$button = false;\n\t\t\t$div_size = 'span12';\n\t\t\t\n\t\t\tif ( !empty ( $options['cab_button_text'] ) && !empty ( $options['cab_button_link']['url'] ) ) {\n\t\t\t\t$button = true;\n\t\t\t\t$div_size = 'span10';\n\t\t\t}\n\t\t\n\t\t\tif ( !empty ( $options['cab_main_title'] ) || !empty ( $options['cab_sec_title'] ) ) {\n\t\t\t\t\n\t\t\t\techo '<div class=\"'.$div_size.'\">';\n\t\t\t\n\t\t\t\tif ( !empty ( $options['cab_main_title'] ) ) {\n\t\t\t\t\techo '<h3 class=\"m_title\" style=\"margin-top:25px;\">'.$options['cab_main_title'].'</h3>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( !empty ( $options['cab_sec_title'] ) ) {\n\t\t\t\t\techo '<p>'.$options['cab_sec_title'].'</p>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\techo '</div>';\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif ( $button ) {\n\t\t\t\techo '<div class=\"span2\">';\n\t\t\t\t\n\t\t\t\t\techo '<a href=\"'.$options['cab_button_link']['url'].'\" class=\"circlehover with-symbol\" data-size=\"\" data-position=\"top-left\" data-align=\"right\" target=\"'.$options['cab_button_link']['target'].'\">';\n\t\t\t\t\t\techo '<span class=\"text\">'.$options['cab_button_text'].'</span>';\n\t\t\t\t\t\tif ( !empty ( $options['cab_button_image'] ) ) {\n\t\t\t\t\t\t\techo '<span class=\"symbol\"><img src=\"'.$options['cab_button_image'].'\" alt=\"\"></span>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\techo '<span class=\"symbol\"><img src=\"'.MASTER_THEME_DIR.'/images/ok.png\" alt=\"\"></span>';\n\t\t\t\t\t\t}\n\t\t\t\t\techo '</a>';\n\t\t\t\techo '</div>';\n\t\t\t}\n\n\t}",
"public function call(): void\n {\n $this->isCalled = true;\n }",
"function oncall_config_form_submit($form, &$form_state) {\n // set all team members to zero, then update the team member to leader\n db_update('oncall_team')\n ->fields(array('leader' => 0))\n ->execute();\n\n db_update('oncall_team')\n ->fields(array('leader' => 1))\n ->condition('ocid', $form_state['values']['oncall_point'], '=')\n ->execute();\n \n variable_set('oncall_sms_msg', $form_state['values']['oncall_sms']);\n\n $welcome_msg = $form_state['values']['oncall_welcome'];\n oncall_save_uploaded_message($welcome_msg, 'welcome');\n\n $nostatus_msg = $form_state['values']['oncall_nostatus'];\n oncall_save_uploaded_message($nostatus_msg, 'nostatus');\n}",
"function ical_subscribe() {\n \t$this->wireframe->print_button = false;\n\n $ical_url = assemble_url('ical', array(\n 'token' => $this->logged_user->getToken(true),\n ));\n\n $ical_subscribe_url = str_replace(array('http://', 'https://'), array('webcal://', 'webcal://'), $ical_url);\n\n $this->smarty->assign(array(\n 'ical_url' => $ical_url . '&subscribe=no',\n 'ical_subscribe_url' => $ical_subscribe_url\n ));\n }",
"public function start(): void {}",
"public function onAriEventStasisStart(StasisStart $stasisStart): void\n {\n $channelId = $stasisStart->getChannel()->getId();\n printf(\n \"The channel '%s' has entered the MyExampleStasisApp.\\n\",\n $channelId\n );\n\n /*\n * Now we make a call to the Asterisk REST Interface in order\n * to get the list of active channels on your Asterisk instance.\n */\n foreach ($this->ariChannelsClient->list() as $activeChannel) {\n printf(\n \"The channel (id: '%s' state: '%s') is active on your Asterisk server.\\n\",\n $activeChannel->getId(),\n $activeChannel->getState()\n );\n }\n }",
"public function init() {\n\t\t\n\t\tparent::init();\n\t\t\n\t\t$this->add_delayed_payment_support(\n\t\t\tarray(\n\t\t\t\t'option_label' => esc_html__( 'Subscribe contact to iContact only when payment is received.', 'gravityformsicontact' )\n\t\t\t)\n\t\t);\n\t\t\n\t}",
"public function start($id);",
"public function start() {\n\n // TODO: Maybe sometimes\n\n }",
"protected function initiateSubRequest() {}",
"function start() {\n\t\t\tglobal $account;\n\t\t\tglobal $objects;\n\t\t\tglobal $param;\n\t\t\tglobal $FicheCabinet;\n\n\t\t\tif(array_key_exists(\"FicheCabinet\",$objects))\n\t\t\t\t$FicheCabinet = $objects[\"FicheCabinet\"];\n\n\n\t\t\t// create ledger for this controler\n\t\t\t$ledgerFactory = new LedgerFactory();\n\t\t\t$ledger = $ledgerFactory->getLedger(\"Controler\",\"FicheCabinetControler\");\n\n\t\t\t//Create connection factory\n\t\t\t$cf = new ConnectionFactory();\n\n\t\t\t//create mappers\n\t\t\t$FicheCabinetMapper = new FicheCabinetMapper($cf->getConnection());\n\n\t\t\t$ledger->writeArray(I,\"Start\",\"Control Parameters = \",$param);\n\t\t\tswitch($param->action){\n\t\t\t\tcase ACTION_MANAGE:\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase ACTION_FIND:\n\t\t\t\t $FicheCabinet=New FicheCabinet();\n\t\t\t\t\t$FicheCabinet->cabinet = $account->cabinet;\n\t\t\t\t\t$result = $FicheCabinetMapper->findObject($FicheCabinet->beforeSerialisation($account));\n\n\t\t\t\t\t$FicheCabinet = $result->afterDeserialisation($account);\n\n\t\t\t\t\tforward($this->mappingTable[\"URL_NEW\"]);\n\n\t\t\t\t\t\tbreak;\n\n\n\n\t\t\t\tcase ACTION_SAVE:\n\t\t\t\t\texitIfNull($FicheCabinet);\n\n\t\t\t\t\t$errors = $FicheCabinet->check();\n\t\t\t\t\tif(count($errors) !=0) forward($this->mappingTable[\"URL_NEW\"],$errors);\n\n\t\t\t\t\t$result = $FicheCabinetMapper->updateObject($FicheCabinet->beforeSerialisation($account));\n\t\t\t\t\tif($result == false) {\n\t\t\t\t\t\tif($FicheCabinetMapper->lastError != NOTHING_UPDATED)\n\t\t\t\t\t\t\tforward(URL_CONTROLER_PERSISTENCE_ERROR,\"update failed\");\n\t\t\t\t\t}\n\t\t\t\t\tforward($this->mappingTable[\"URL_AFTER_UPDATE\"]);\n\n\t\t\t\t\tbreak;\n\n\n\t\t\t\tcase ACTION_LIST:\n\t\t\t\t\tglobal $rowsList;\n\t\t\t\t\t$rowsList = $FicheCabinetMapper->getTousCabinets();\n\t\t\t\t\t\n\t\t\t\t\tif($rowsList==false) forward(URL_CONTROLER_PERSISTENCE_ERROR,\"Find objects caused an error\");\n\n\t\t\t\t\tforward($this->mappingTable[\"URL_VIEW\"]);\n\n\t\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\techo(\"ACTION IS NULL\");\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\n\t\t}",
"public function subscribe($number, $campid)\t{\n\n\t\t//URL Query Information\n\t\t//---------------------\n\t\t//Static information\n\t\t$action = \"action=subscribe\"; \n\t\t//Dynamic information\n\t\t$mobile = \"mobile=\";\n\t\t$campaignid = \"campaignid=\";\n\t\t//Assemble the URL query\n\t\t$api_query = $action . \"&\" . $this->api_key . \"&\" . $mobile . $number . \"&\" . $campaignid . $campid;\n\t\n\t\n\t\t//Make the HTTPS request\n\t\t//----------------------\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, \n\t\t\t//Builds the final request URL by concatenating the base URL with the URL query\n\t\t\thttp_build_url('https://scale-secure.skycore.com/API/wxml/1.3/index.php?',\n\t\t\t\tarray(\n\t\t\t\t\t\n\t\t\t\t\t\"query\" => $api_query\n\t\t\t\t)\n\t\t));\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\t//Set this to 0 if testing on a dev site\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\t\t$result = curl_exec($ch);\n\n\t}",
"function run() {\n #CRM_Utils_System::setTitle(\"Create upcoming Recurring Contribution installments for Creditor $creditorId\");\n #\n #civicrm_api3('SepaContributionGroup', 'createnext', array('creditor_id' => $creditorId));\n civicrm_api3('SepaContributionGroup', 'createnext', array());\n\n CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/sepa'));\n }",
"public function start() {\n\t\t$this->invoke(\"start\");\n\t}",
"public static function StartConvert()\n\t{\n\t\t$request = self::PrepareRequest(self::URL.preg_replace(\"/^JSESSIONID=/\", \"/api/Conversion/start;jsessionid=\", self::$cookie));\n\t\tcurl_setopt($request, CURLOPT_HTTPHEADER, array( \"Content-Type: application/x-www-form-urlencoded\" ));\n\t\tcurl_setopt($request, CURLOPT_POSTFIELDS, self::PreparePOST());\n\t\t$response = curl_exec($request);\n\t\tcurl_close($request);\n\t}",
"public function start(): void;",
"public function start($start);",
"public function start() {}",
"public function start() {}",
"public function start() {}",
"public function start() {}",
"public function start() {}",
"public function start() {}",
"public function start() {}",
"public function start() {}",
"public function start() {}",
"public function start() {}",
"public static function userStartOver()\n {\n $askOptions = array(\n 'choices' => '[5 DIGITS]',\n 'timeout' => self::MESSAGE_TIMEOUT,\n 'mode' => self::MODE,\n 'onChoice' => 'BreweryMapUI::userZipEntry',\n 'onBadChoice' => 'BreweryMapUI::userBadChoice',\n 'attempts' => self::ATTEMPTS,\n );\n\n if (INCOMING_NETWORK == 'SMS') {\n $prompt = 'Text us a zip code to find breweries:';\n } else {\n $prompt = 'IM us a zip code to find breweries:';\n }\n \n\n $event = ask($prompt, $askOptions);\n }",
"public function start()\n\t{\n\t\t// reset first, will start automaticly after a full reset\n\t\t$this->data->directSet(\"resetNeeded\", 1);\n\t}",
"protected function startup() {\n\t\tif (null != $this->getParam('eid')) {\n\t\t\t$this->eid = $this->getParam('eid');\n\t\t\t$this->cid = EventModel::getCourseIDByEventID($this->eid);\n\t\t}\n\t\tparent::startup();\n\t}",
"public function start()\n {\n }",
"public function start()\n {\n }",
"public function start()\n {\n }",
"public static function debugPrintStartActionCode($eventCall, array $method)\n {\n $ret = '';\n if (Channels::$channelsMode === 'debug'\n && self::$_currentSystem !== 'Report'\n ) {\n $ret .= \"\\nif (Channels::\\$installing === FALSE) {\\n\";\n $ret .= \"\\$debugFunctionParams = array('params' => array());\\n\";\n $ret .= \"\\$debugFunctionParams['channel'] = '\".$eventCall.\"';\\n\";\n $ret .= '$debugFunctionParams[\\'system\\'] = \\''.$method['system'].\"';\\n\";\n $ret .= '$debugFunctionParams[\\'type\\'] = \\''.$method['type'].\"';\\n\";\n foreach ($method['params'] as $paramName) {\n $ret .= '$debugFunctionParams[\\'params\\'][\\'';\n $ret .= $paramName['name'].'\\'] = $'.$paramName['name'].\";\\n\";\n }\n\n $ret .= \"Channels::includeSystem('Report');\\n\";\n $ret .= \"Report::debugStartAction(\\$debugFunctionParams);\\n\";\n $ret .= \"}\\n\";\n }\n\n return $ret;\n\n }"
] | [
"0.6201243",
"0.5971165",
"0.5718586",
"0.56803584",
"0.5496088",
"0.5294584",
"0.5294503",
"0.5277004",
"0.52464396",
"0.51962215",
"0.5130221",
"0.50884056",
"0.50517595",
"0.50385004",
"0.50189155",
"0.50180614",
"0.5013572",
"0.49866393",
"0.49839064",
"0.49666828",
"0.49630398",
"0.49440008",
"0.49440008",
"0.49440008",
"0.49440008",
"0.49440008",
"0.49440008",
"0.49440008",
"0.49440008",
"0.49440008",
"0.49440008",
"0.49440008",
"0.49440008",
"0.49354887",
"0.49171352",
"0.4905568",
"0.49028364",
"0.48916382",
"0.48889148",
"0.4886769",
"0.48806402",
"0.4878491",
"0.4870855",
"0.48687768",
"0.486807",
"0.4861897",
"0.48579112",
"0.48248747",
"0.48243967",
"0.481888",
"0.48182333",
"0.48155802",
"0.48123786",
"0.48005944",
"0.47952053",
"0.47876197",
"0.47817084",
"0.4779944",
"0.47766805",
"0.47766805",
"0.47753188",
"0.47695047",
"0.47608325",
"0.4758478",
"0.47510478",
"0.4749611",
"0.4749611",
"0.47455993",
"0.47422734",
"0.47324345",
"0.47313267",
"0.47288692",
"0.47205782",
"0.47119275",
"0.4710329",
"0.47079074",
"0.47063443",
"0.47020224",
"0.4700985",
"0.4699047",
"0.46968046",
"0.46940678",
"0.46936908",
"0.46852773",
"0.4685016",
"0.4685016",
"0.46837643",
"0.46827292",
"0.46827292",
"0.46827292",
"0.46827292",
"0.46827292",
"0.46827292",
"0.46788442",
"0.46736705",
"0.46733785",
"0.46695092",
"0.46695092",
"0.46695092",
"0.4652756"
] | 0.5173821 | 10 |
/ Description Ending a call of conference on pressing end call button Author Dave Brown Created 27 Nov 2014 | public function end_call()
{
if (session_data('tokbox_data') == NULL)
{
return;
}
$this->appointment_model->save(array('call_status' => CALL_COMPLETED, 'id' => post_data('appointment_id')), 'update');
$this->session->unset_userdata('tokbox_data');
exit(json_encode(array('status' => '1', )));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function endConversation() {\n\t $this->expectUserResponse = false;\n }",
"public function ended();",
"public function end();",
"public function end();",
"public function end();",
"public function end();",
"public static function terminateConversation() {\n\t\t$curl = curl_init();\n\t\tcurl_setopt_array($curl, array(\n\t\t\tCURLOPT_HEADER => false,\n\t\t\tCURLOPT_RETURNTRANSFER => true,\n\t\t\tCURLOPT_SSL_VERIFYPEER => false,\n\t\t\tCURLOPT_SSL_VERIFYHOST => false,\n\t\t\tCURLOPT_URL => self::$ucwa_baseserver . self::$ucwa_path_terminate,\n\t\t\tCURLOPT_REFERER => self::$ucwa_baseserver . self::$ucwa_path_xframe,\n\t\t\tCURLOPT_POST => true,\n\t\t\tCURLOPT_POSTFIELDS => \"Exterminate!\",\n\t\t\tCURLOPT_HTTPHEADER => array(\n\t\t\t\t\"Authorization: Bearer \" . self::$ucwa_accesstoken,\n\t\t\t\t\"Content-Type: text/plain; charset=UTF-8\",\n\t\t\t\t\"X-Ms-Origin: \" . self::$ucwa_fqdn,\n\t\t\t),\n\t\t\tCURLOPT_TIMEOUT => 15,\n\t\t));\n\n\t\t$response = curl_exec($curl);\n\t\t$status = curl_getinfo($curl);\n\t\tcurl_close($curl);\t\n\t\t\n\t\tif ($status[\"http_code\"] == 204) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tself::_error(\"Can't terminate conversation for Skype UCWA\", $status);\t\n\t\t\treturn false;\t\n\t\t}\n\t}",
"public function appEnd()\n {\n }",
"public function appEnd()\n {\n }",
"public function end() {}",
"public function end() {}",
"public function end() {}",
"public function end()\n {\n $participantPollId = \\Session::get('participant_poll_id');\n\n $participantPoll = ParticipantPoll::find($participantPollId);\n\n $poll = Poll::find($participantPoll->poll_id);\n \n return view('poll.end', ['allow_sharing' => $poll->allow_sharing]);\n }",
"public function end()\n {\n }",
"public function endCall(Request $request)\n {\n $user_who_end_call = $request->user_id;\n $is_join_room = 0;\n $auth_user = Auth::user();\n $user_id = $auth_user->id;\n $user_type = $auth_user->user_type;\n $client_time_zone = UserHelper::getClientTimaZone($request->room_name);\n $commision = Cache::get('commision');\n\n $call = Call::where('room_name', '=', $request->room_name)->first();\n UserHelper::updateProviderCallStatus($call->service_provider_id, 0);\n $partner_id = \"\";\n $service_provider_id = \"\";\n $client_id = \"\";\n $check_if_call_joind = Call::where('room_name', '=', $request->room_name)\n ->where('room_status', '=', 'WAITING')\n ->first();\n if (!empty($check_if_call_joind)) {\n UserHelper::endCall($call->id, $user_id, $call->room_name);\n } else {\n DB::table('calls')->where('room_name', '=', $request->room_name)->update([\n 'room_status' => \"COMPLETED\",\n 'end_at' => date(\"Y-m-d H:i:s\")\n ]);\n $is_join_room = 1;\n $balance = 0;\n $call_duration = 0;\n $call_price = 0;\n $user_points = 0;\n if ($user_type == 1) {\n $ServiceProvider = ServiceProvider::findOrFail($call->service_provider_id);\n $partner_id = $ServiceProvider->user_id;\n $end = Carbon::parse($call->end_at);\n $start = Carbon::parse($call->start_at);\n $call_duration = $end->diffInMinutes($start);\n $seconds_duration = $end->diffInSeconds($start);\n $price_in_seconds = round(($seconds_duration/3600)*$ServiceProvider->price, 2);\n $user_points = UserHelper::getUserPoints($ServiceProvider->user_id);\n $call_price = (($call_duration/60)*$ServiceProvider->price)+($price_in_seconds);\n $call_price = round($call_price, 2)+($call_price*$commision);\n } elseif ($user_type == 2) {\n $client = UserHelper::getClientInfo($call->client_id);\n $partner_id = $client->user_id;\n $service_provider = ServiceProvider::where('user_id', '=', $auth_user->id)->first();\n $end = Carbon::parse($call->end_at);\n $start = Carbon::parse($call->start_at);\n $call_duration = $end->diffInMinutes($start);\n $seconds_duration = $end->diffInSeconds($start);\n $price_in_seconds = ($seconds_duration/3600)*$service_provider->price;\n $call_price = (($call_duration/60)*$service_provider->price)+($price_in_seconds);\n $call_price = round($call_price, 2)+($call_price*$commision);\n }\n $this->sendEndCallPushNotification(\n $partner_id,\n $user_who_end_call,\n $is_join_room,\n $request->room_name,\n $balance,\n $call_duration,\n $call_price,\n $user_points,\n $call->id\n );\n $cents = $call_price*100;\n $yallatalk_account = UserHelper::getYalltalkAccount();\n $client = UserClient::findOrFail($call->client_id);\n UserHelper::updateBalance($yallatalk_account->id, $call_price);\n UserHelper::updateBalance($client->user_id, $call_price);\n\n $transaction = new Transaction;\n $transaction->client_id = $call->client_id;\n $transaction->service_provider_id = $call->service_provider_id;\n $transaction->amount = $call_price;\n $transaction->currency = \"USD\";\n $transaction->call_id = $call->id;\n $transaction->clinet_balance = UserHelper::getClientBalance($call->client_id);\n $transaction->provider_balance = UserHelper::getProviderBalance($call->service_provider_id);\n $transaction->save();\n\n Stripe::setApiKey($this->stripe_api_secret);\n // Charge the user's card:\n try {\n $charge = Charge::create(array(\n \"amount\" => (int)($call_price*100),\n \"currency\" => \"USD\",\n \"description\" => __('messages.create_new_charge_description'),\n \"customer\" => $yallatalk_account->stripe_id,\n ));\n } catch (\\Exception $e) {\n return response()\n ->json([\n 'success' => false,\n 'message' => __('messages.fail_charge_message')\n ]);\n }\n }\n return response()\n ->json([\n 'success' => true,\n 'message' => __('messages.sens_notification_message')\n ]);\n }",
"public function endCurrentRound(){\n global $tpl, $lng, $ilCtrl, $ilTabs;\n\n $ilTabs->activateTab(\"showCurrentRound\");\n\n $this->object->endCurrentRound();\n $ilCtrl->redirect($this, \"showCurrentRound\");\n }",
"public function endCommunication()\n {\n $this->restAPI->keepAuth = false;\n $this->restAPI->logout();\n }",
"function end();",
"public function end_turn()\n\t{\n\t\t//\t\tpropre a la classe\n\t}",
"public function end(): void\n {\n }",
"function endRound() {\n\n\t\t$this->console_text('End Round');\n\t\t$this->releaseEvent('onEndRound', null);\n\t}",
"public function sendReplyEnd()\n {\n }",
"public static function getCloseCall()\n {\n return 'ATK.Dialog.getCurrent().close();';\n }",
"public function closeChargingRecordsCreation()\n {\n\n }",
"public function close()\r\n {\r\n parent::setContext();\r\n echo \"电梯关闭\";\r\n }",
"public function endAction() {\r\n $this->session->remove('auth');\r\n $this->flash->success('Obrigado!');\r\n\r\n return $this->dispatcher->forward([\r\n \"controller\" => \"peer\",\r\n \"action\" => \"index\"\r\n ]);\r\n }",
"function close() {\n\n if($this->time_start)\n $this->prn(\"\\nTime spent: \"\n .$this->endTimer().\" seconds\");\n\n if($this->format != \"plain\") \n $this->prn(\"\\n======================= \"\n .\"end logrecord ============================\\n\");\n\n $this->quit();\n }",
"function end_conf_app()\n\t{\n\t}",
"public function endAction()\n {\n // Play the game\n $session = $this->app->session;\n $title = \"Play the game\";\n $data = [\n \"winner\" => $session->get(\"winner\")\n ];\n\n $this->app->page->add(\"dice2/end\", $data);\n return $this->app->page->render([\n \"title\" => $title,\n ]);\n }",
"public function endCommunication()\n {\n $this->provider->keepAuth = false;\n $this->provider->logout();\n }",
"protected function endVCal()\n {\n return $this->assemble(['END:VCALENDAR']);\n }",
"public function end()\n\t{\n\t\tunset($this->attributes['hidden']);\n\t\t\n\t\t$this->privateName='button_'.Util::makeRandomKey();\n\t\t\n\t\tif(isset($this->attributes['listeners'])&&count($this->attributes['listeners'])>0)\n\t\t{\n\t\t\tforeach ($this->attributes['listeners'] as $type=>$type_params)\n\t\t\t{\n\t\t\t\t/**\n\t\t\t\t * if listener function source is not an array then the string is used directly\n\t\t\t\t */\n\t\t\t\tif (isset($type_params['parameters'])&&isset($type_params['source'])&&!is_array($type_params['source']))\n\t\t\t\t{\n\t\t\t\t\t$this->attributes['listeners'][$type]=$this->afExtjs->asMethod(array('parameters'=>$type_params['parameters'],'source'=>$type_params['source']));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->afExtjs->private[$this->privateName]=$this->afExtjs->Button($this->attributes);\n\t\t\n\t\treturn $this->privateName;\n\t}",
"public function onClose($connect)\n {\n// echo \"close\" . PHP_EOL;\n }",
"public function end()\n\t{\n\t\tTwitchHelper::log(TwitchHelper::LOG_INFO, \"Stream end\");\n\t}",
"public function setEndConferenceOnExit(bool $endConferenceOnExit): self\n {\n $this->options['endConferenceOnExit'] = $endConferenceOnExit;\n return $this;\n }",
"function processEndCallFusion($request) {\n $connector = $this->getConnector();\n $connector->handleEndCallFusion($request);\n }",
"function nc__dlg__end(){\n\n\t\t//output function name\n\t\tnc__util__func('class', 'nc__dlg__end');\n\n\t\t\t\t\t\t//end dialog for content body (starts in another function)\n\t\t\t\t\t\techo \"</div>\" .\n\n\t\t\t\t\t//end dialog content window (starts in another function)\n\t\t\t\t\t\"</div>\" .\n\n\t\t\t\t//end dialog body (starts in another function)\n\t\t\t\t\"</div>\" .\n\n\t\t\t//end end dialog bounding DIV (starts in another function)\n\t\t\t\"</div>\";\n\n\t}",
"public function finish()\n {\n // we'll need the arguments to send to mastodon\n $args = $this->arguments;\n\n // replace the availability id with a unique key\n $db_availability = $this->get_record();\n unset( $args['id'] );\n $args['noid']['participant.uid'] = $db_availability->get_participant()->uid;\n $args['noid']['availability.monday'] = $db_availability->monday;\n $args['noid']['availability.tuesday'] = $db_availability->tuesday;\n $args['noid']['availability.wednesday'] = $db_availability->wednesday;\n $args['noid']['availability.thursday'] = $db_availability->thursday;\n $args['noid']['availability.friday'] = $db_availability->friday;\n $args['noid']['availability.saturday'] = $db_availability->saturday;\n $args['noid']['availability.sunday'] = $db_availability->sunday;\n $args['noid']['availability.start_time'] = $db_availability->start_time;\n $args['noid']['availability.end_time'] = $db_availability->end_time;\n\n parent::finish();\n\n // now send the same request to mastodon\n $mastodon_manager = lib::create( 'business\\cenozo_manager', MASTODON_URL );\n $mastodon_manager->push( 'availability', 'edit', $args );\n }",
"public function onClose($clientChat)\n\t{\n\t}",
"abstract protected function doEnd();",
"function onClose(\\Ratchet\\ConnectionInterface $conn)\n {\n// echo 'BYE';\n }",
"function ticket_close($d){\n $url = $this->url.\"ticket_close\";\n $data['case_id'] =$d['case_id'] ;\n $data['action'] =$d['action'] ;\n $data['comfirm_closed_reason'] =$d['comfirm_closed_reason'] ;\n $data['submitter'] =$d['submitter'] ;\n $this->setTransactionToLog(\"method:\".__METHOD__);\n $result = $this->_exec($url,$data);\n }",
"public function onInvitePromptFinished( Streamwide_Engine_Events_Event $event )\n {\n $this->_armTimer();\n if ( !$this->_dtmfHandler->isListening() ) {\n $this->_listenForKeyPresses();\n }\n }",
"public function ZapDialOffHook($zapChannel, $number);",
"public function end_trace()\n {\n }",
"public function onClose();",
"public function onClose();",
"public function close()\n {\n Application::instance()->executeControlCommand($this->getJqControlId(), $this->getJqSetupFunction(), \"close\",\n Application::PRIORITY_LAST);\n }",
"Public function end()\n\t{\n\t\t$this->endTimer = microtime(TRUE);\n\t}",
"public function destroy(Call $call)\n {\n //\n }",
"abstract protected function onEnd(): void;",
"function quit(&$irc, &$data)\n\t{\n\t\tglobal $pickup;\n\t\tglobal $users;\n\t\tglobal $irc;\n\t\tglobal $pickupchannel;\n\t\tglobal $pickup;\n\t\tglobal $pickupstatus;\n\n\t\t//Get data\n\t\t$nick = $data->nick;\n\t\t$qauth = $users->nicktoqauth($nick);\n\n\t\t//Remove from pickup\n\t\tif($pickup->is_added($qauth))\n\t\t{\n\t\t\t$pickup->rm_player($qauth);\n SetTopic();\n\t\t}\n\n\t\t//Mark the user out the channel\n\t\t$users->mark_outchannel($qauth);\n\t}",
"function showEnd( $appctx )\n\t\t{\n\t\t$appctx->Moins() ;\n\t\t}",
"public function subscriptionClosedForADay() {\n\t\treturn response( 1, 200 )\n\t\t\t->cookie( 'doodleSubscriber', \"mrksohag\", config( 'constant.popupHideTimeInMinutes' ) );\n\t}",
"function _voipusernumber_logout_script() {\n $script = new VoipScript('voipusernumber_logout');\n global $user;\n watchdog('user', 'Voip call disassociated with user %name.', array('%name' => $user->name));\n $user = user_load(0);\n $script->addSet('user_uid', $user->uid);\n $script->addSet('user_name', $user->name);\n return $script;\n}",
"public function close_event($id = null)\n {\n if($this->Auth->user('level') != \"Officer\" && $this->Auth->user('level') != \"Admin\")\n $this->redirect(\n array('controller' => 'Users', 'action' => 'profilehub/' . $this->Auth->user('id')));\n \n $this->Event->id = $id;\n $this->Event->set(array('closed' => 1));\n $this->Event->save();\n $this->redirect('view/'. $id);\n }",
"private function endGame()\n {\n $this->hasWon = true;\n $this->calculatePoints();\n $this->setMessageToPlayer();\n }",
"public static function DelOffer(){\n\n\n\n\t\t}",
"function cancelSubscriptionAPI($subscriptionid, $userid, $relid) {\n\t$urlsubscriptionid = urlencode($subscriptionid);\n\t$nvpStr=\"ProfileID=$urlsubscriptionid&Action=Cancel&Note=Automated+cancellation.\";\n\t$httpParsedResponseAr = paypalCURLL('ManageRecurringPaymentsProfileStatus', $nvpStr);\n\tif(\"SUCCESS\" == strtoupper($httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($httpParsedResponseAr[\"ACK\"])) {\n\n\t\t//remove subcription id\n\t\t$update_qry = \"UPDATE tblhosting SET subscriptionid = '' WHERE id = $relid\";\n\n\t\ttry {\n\t\t $status = mysql_query($update_qry);\n\t\t if(!$status) {\n\t\t\t $error = mysql_error();\n\t\t\t\tthrow new Exception('Update subscriptionid to null is not successful :'.$error);\n\t\t }\n\t\t} catch (Exception $e) {\n\t\t echo 'Caught exception: ', $e->getMessage(), \"\\n\";\n\t\t}\n\t\t// Log success to WHMCS activity log\n\t\tlogactivity(\"MYWORKS DEBUG: Successfully terminated Paypal Subscription ID: $subscriptionid attached to Service ID: $relid and User ID: $userid\");\n\t} \n\telse {\n\t\t// Build failure message\n\t\tforeach ($httpParsedResponseAr as $key => $value) {\n\t\t\t$message .= \"Key: $key - Value: $value. \";\n\t\t}\n\t\t// Log failure to WHMCS activity log\n\t\tlogactivity(\"MYWORKS DEBUG: Failed to terminate Paypal Subscription ID: $subscriptionid attached to Service ID: $relid and User ID: $userid. Response was $message.\");\n\t}\n}",
"protected function sendEndRequest() : void\n {\n $message = \"DONE \" . $this->id;\n $this->sendRequest($message);\n }",
"public function closeBooking(\\HttpRequest $objRequest, \\HttpResponse $objResponse): \\SuccessService {\r\n $objSuccessService = new \\SuccessService();\r\n $objLoginEmployee = LoginServiceImpl::instance()->checkLoginEmployee()->getEmployeeInfo();\r\n $company_id = LoginServiceImpl::instance()->getLoginInfo()->getCompanyId();\r\n //获取channel\r\n $channel_id = $objRequest->channel_id;\r\n\r\n }",
"public function endPage() {}",
"function cancel(){\n\t\t//echo \"In Cancel\";\n\t\t\n\t\t//echo 'Das aktuelle Datum und die aktuelle Zeit ist: ';\n\t\t//echo JFactory::getDate('now', JFactory::getApplication()->getCfg('offset'))->toFormat() . \"\\n<br/><br/>\";\n\t\t\n\t\t//$date = JFactory::getDate();\n\t\t//$date->setOffset(JFactory::getApplication()->getCfg('offset'));\n\t \n\t \t//echo \"Offset: \" . JFactory::getApplication()->getCfg('offset');\n\t\t//echo 'Das aktuelle Datum und die aktuelle Zeit ist: ' . $date->toFormat() . \"\\n\";\n\t\t$date =& JFactory::getDate($time= 'now', $tzOffset=0);\n\n\t\t//$date->setOffset($mainframe->getCfg('offset'));\n\t\t//echo 'Das aktuelle Datum und die aktuelle Zeit ist: ' . $date->toFormat();\n\t\t\n\t\t//echo \"New date: \" . date('Y-m-d H:i:s');\n\n\t\t//return false;\n\t\t\n\t\t$insData =new stdClass();\n\t\t$insData->idt_drivin_event_apply = $_POST['appCanId'];\n\n\t\t//$date = new DateTime();\n\t\t$insData->dt_cancel = date('Y-m-d H:i:s'); //'CURRENT_TIMESTAMP';//$date->getTimestamp();\n\t\t\n\t\t$db = JFactory::getDBO();\n\t\tif(!$db->updateObject( '#__jevent_events_apply', $insData, 'idt_drivin_event_apply' )){\n\t\t\techo $database->stderr();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;//resendCancelEmailById($insData->idt_drivin_event_apply);\n\t}",
"public function phone_encounter()\n\t{\n\t\t$this->loadModel('ScheduleCalendar');\n\t\t$this->loadModel('ScheduleType');\n\t\t$this->loadModel('PracticeLocation');\n\t\t$patient_id = $this->params['named']['patient_id'];\n\t\t$location = $this->params['named']['location_id'];\n\t\t$type = $this->ScheduleType->find('first', array('fields' => 'appointment_type_id','conditions' => array('type' =>'Phone Call')));\n\t\t$practice_location = $this->PracticeLocation->find('first', array('conditions' => array('location_id' => $location), 'fields' => 'default_visit_duration'));\n\t\t$time = __date('H:i');\n\t\t$duration = $practice_location['PracticeLocation']['default_visit_duration'];\n\n\t\tif(empty($duration)) \n\t\t\t$duration = 15; // set duration 15 mins if it is empty\n\n\t\t$encounterCount = $this->EncounterMaster->find('count', array('conditions' => array('patient_id' => $patient_id), 'recursive' => -1));\n\t\tif($encounterCount > 0) {\n\t\t\t$reason_for_visit = 'Follow Up';\n\t\t} else {\n\t\t\t$reason_for_visit = 'New Visit';\n\t\t}\n $scheduleData = array(\n\t\t\t'patient_id' => $patient_id,\n\t\t\t'location' => $location,\n\t\t\t'reason_for_visit' => $reason_for_visit,\n\t\t\t'provider_id' => $this->Session->Read('UserAccount.user_id'),\n\t\t\t'date' => __date('Y-m-d'),\n\t\t\t'starttime' => $time,\n\t\t\t'duration' => $duration,\n\t\t\t'endtime' => __date('H:i', strtotime(\"+$duration minutes\")),\n\t\t\t'visit_type' => $type['ScheduleType']['appointment_type_id']\n\t\t);\n $this->ScheduleCalendar->save($scheduleData);\n\t\t$calendar_id = $this->ScheduleCalendar->id;\n\t\tif($calendar_id > 0)\n\t\t{\n\t\t\t$this->loadModel('PatientDemographic');\n\t\t\t$patient_status = $this->PatientDemographic->field('status', array('patient_id' => $patient_id));\n\t\t\tif ($patient_status == 'New' && $encounterCount > 0)\n\t\t\t{\n\t\t\t\t//$dataDemographic['PatientDemographic']['patient_id'] = $patient_id;\n\t\t\t\t//$dataDemographic['PatientDemographic']['status'] = 'Active';\n\t\t\t\t//$this->PatientDemographic->save($dataDemographic);\n\t\t\t}\n\t\t\t$this->EncounterMaster->execute($this, $calendar_id, '', 'Phone');\n\t\t}\n\t}",
"public function onAriEventStasisEnd(StasisEnd $stasisEnd): void\n {\n printf(\n \"The channel '%s' has left your example app.\\n\",\n $stasisEnd->getChannel()->getId()\n );\n }",
"function endOffer(Request $req) {\n WebUtil::requireAuthentication();\n\n $offerId = $req->getPathVars()['id'];\n if ($offerId) {\n $database = new Database();\n $dbConn = $database->connect();\n\n $stmt1 = $dbConn->prepare(\"SELECT * FROM offer WHERE id =:id\");\n $stmt1->bindParam(':id', $offerId);\n $stmt1->execute();\n\n if ($result = $stmt1->fetch()) {\n $userId = WebUtil::getUserAuth()->userId;\n if ($userId != $result['user_id']) {\n WebUtil::exitWithHttpCode(403); // not offer owner\n }\n if ($result['ended_date']) {\n WebUtil::exitWithHttpCode(422, \"offer already ended\");\n }\n\n $stmt2 = $dbConn->prepare(\"UPDATE offer SET ended_date = NOW() WHERE id =:id\");\n $stmt2->bindParam(':id', $offerId);\n if ($stmt2->execute()) {\n WebUtil::exitWithHttpCode(200);\n }\n }\n WebUtil::exitWithHttpCode(404);\n }\n WebUtil::exitWithHttpCode(400);\n }",
"public function finish()\n\t{\n\t\t\n\t}",
"function endCase() {\n\t}",
"public function unsubscribe()\n {\n echo \"<br>\";\n echo \"Action: Cancelling Subscription !\";\n unset($this->plan);\n unset($this->server);\n unset($this->serverList);\n\n }",
"public function closeBillingAgreement($requestParameters = array());",
"function _endpage()\n\t\t{\n\t\t\t$this->state=1;\n\t\t}",
"function update_end()\n {\n }",
"public function myReturnCallback() {\n return 'You can close this page';\n }",
"public function onStop();",
"public function end()\n\t{\n\t\t$this->set_process_state(false);\n\t}",
"function oncall_member_remove($form, &$form_state) {\n $ocid = $form_state['values']['ocid'];\n db_delete('oncall_team')\n ->condition('ocid', $ocid)\n ->execute();\n \n $form_state['redirect'] = 'admin/config/services/oncall'; \n}",
"public function cancel()\n {\n }",
"public function cancel()\n {\n }",
"function end()\n\t{\n\t\t$this->over = true;\n\t}",
"public function finish()\n {\n parent::finish();\n \n // this widget must have a parent, and it's subject must be a participant\n if( is_null( $this->parent ) || 'participant' != $this->parent->get_subject() )\n throw new exc\\runtime(\n 'Appointment widget must have a parent with participant as the subject.', __METHOD__ );\n\n $db_participant = new db\\participant( $this->parent->get_record()->id );\n \n // determine the time difference\n $db_address = $db_participant->get_first_address();\n $time_diff = is_null( $db_address ) ? NULL : $db_address->get_time_diff();\n\n // need to add the participant's timezone information as information to the date item\n $site_name = bus\\session::self()->get_site()->name;\n if( is_null( $time_diff ) )\n $note = 'The participant\\'s time zone is not known.';\n else if( 0 == $time_diff )\n $note = sprintf( 'The participant is in the same time zone as the %s site.',\n $site_name );\n else if( 0 < $time_diff )\n $note = sprintf( 'The participant\\'s time zone is %s hours ahead of %s\\'s time.',\n $time_diff,\n $site_name );\n else if( 0 > $time_diff )\n $note = sprintf( 'The participant\\'s time zone is %s hours behind %s\\'s time.',\n abs( $time_diff ),\n $site_name );\n\n $this->add_item( 'datetime', 'datetime', 'Date', $note );\n\n // create enum arrays\n $modifier = new db\\modifier();\n $modifier->where( 'active', '=', true );\n $modifier->order( 'rank' );\n $phones = array();\n foreach( $db_participant->get_phone_list( $modifier ) as $db_phone )\n $phones[$db_phone->id] = $db_phone->rank.\". \".$db_phone->number;\n \n // create the min datetime array\n $start_qnaire_date = $this->parent->get_record()->start_qnaire_date;\n $datetime_limits = !is_null( $start_qnaire_date )\n ? array( 'min_date' => substr( $start_qnaire_date, 0, -9 ) )\n : NULL;\n\n // set the view's items\n $this->set_item( 'participant_id', $this->parent->get_record()->id );\n $this->set_item( 'phone_id', '', false, $phones );\n $this->set_item( 'datetime', '', true, $datetime_limits );\n\n $this->set_variable( \n 'is_supervisor', \n 'supervisor' == bus\\session::self()->get_role()->name );\n\n $this->finish_setting_items();\n }",
"function bankopen_cancelSubscription($params)\n{\n // Gateway Configuration Parameters\n $APIKey = $params['APIKey'];\n $APISecret = $params['APISecret'];\n $testMode = $params['testMode'];\n $dropdownField = $params['dropdownField'];\n $radioField = $params['radioField'];\n $textareaField = $params['textareaField'];\n\n // Subscription Parameters\n $subscriptionIdToCancel = $params['subscriptionID'];\n\n // System Parameters\n $companyName = $params['companyname'];\n $systemUrl = $params['systemurl'];\n $langPayNow = $params['langpaynow'];\n $moduleDisplayName = $params['name'];\n $moduleName = $params['paymentmethod'];\n $whmcsVersion = $params['whmcsVersion'];\n\n // perform API call to cancel subscription and interpret result\n\n return array(\n // 'success' if successful, any other value for failure\n 'status' => 'success',\n // Data to be recorded in the gateway log - can be a string or array\n 'rawdata' => $responseData,\n );\n}",
"function endPage(){\n global $_inContainer, $_pageName, $_loadChosen;\n require('inc/pageend.php');\n}",
"public function closeEnrollment();",
"public function close():void\n\t{\n\t\tif( $this->_status === self::STATUSES['DONE'] )\n\t\t\t$this->_status= self::STATUSES['CLOSED'];\n\t}",
"public function cancel(): void;",
"public function endTask()\n\t{\n\t\trequire_once 'message_class.php';\n\t\t\n\t\t$this->unsetActive();\n\t\t$this->winnerid = $this->getBidLeaderID();\n\n\t\tif ($this->winnerid == null) //bid ended but nobody bid\n\t\t{\n\t\t\t$notifymessage = new message();\n\t\t\t$messageinfo = array();\n\t\t\t$messageinfo['taskID'] = $this->taskid;\n\t\t\t$messageinfo['content'] = \"Sorry! Bidding has ended for your task <a href='/ViewTask.php?id=\".$this->taskid.\"'>\".$this->title.\"</a>, but nobody bid on it!\";\n\t\t\t$messageinfo['receiverID'] = $this->userid;\n\t\t\t$messageinfo['isSystem'] = true;\n\t\t\t$notifymessage->send($messageinfo);\n\t\t}\n\t\telse //notify winner and lister\n\t\t{\n\t\t\t//notify winner\n\t\t\t$notifymessage = new message();\n\t\t\t$messageinfo = array();\n\t\t\t$messageinfo['taskID'] = $this->taskid;\n\t\t\t$messageinfo['content'] = \"Congratulations! You have won the bidding for the task <a href='/ViewTask.php?id=\".$this->taskid.\"'>\".$this->title.\"</a>!\";\n\t\t\t$messageinfo['receiverID'] = $this->winnerid;\n\t\t\t$messageinfo['isSystem'] = true;\n\t\t\t$notifymessage->send($messageinfo);\n\t\t\t\n\t\t\t//notify winner\n\t\t\t$notifymessage = new message();\n\t\t\t$messageinfo = array();\n\t\t\t$messageinfo['taskID'] = $this->taskid;\n\t\t\t$messageinfo['content'] = \"Heads up! Bidding has ended for your task <a href='/ViewTask.php?id=\".$this->taskid.\"'>\".$this->title.\"</a>!\";\n\t\t\t$messageinfo['receiverID'] = $this->userid;\n\t\t\t$messageinfo['isSystem'] = true;\n\t\t\t$notifymessage->send($messageinfo);\n\t\t}\n\t\t\n\t}",
"public function cancel();",
"function endRace($race) {\n\t\t$this->console_text('End Race');\n\t\t\n\n\t\t// get rankings and call endRaceRanking as soon as we have them ...\n\t\t// release new event ...\n\t\t$this->releaseEvent('onEndRace', $race);\t\t// $race is actually 2 sets of data, rankings & challenge info\n\t\t$this->endRaceRanking($race[0]);\n\t}",
"abstract public function closeControl();",
"public function setEndConferenceOnCustomerExit(bool $endConferenceOnCustomerExit): self\n {\n $this->options['endConferenceOnCustomerExit'] = $endConferenceOnCustomerExit;\n return $this;\n }",
"public static function goodbye()\n {\n $twiml = new Twiml();\n\n $twiml->say(\n 'Thank you for using Call Congress! ' .\n 'Your voice makes a difference. Goodbye.'\n )->hangup();\n\n return $twiml;\n }",
"public function endPageJS() {}",
"public function btnCalculator_Close() {\n\t\t\t$this->txtValue->Text = $this->dlgCalculatorWidget->Value;\n\t\t}",
"public function finish() {\r\n\t}",
"public function hangupCall(string $uuid): void\n {\n $this->sender->get(\"rest/calls/active/{$uuid}/\" . RestInterface::HANGUP_CALL);\n }",
"public function endPeriod() {\n $this->checkStopLoss();\n //Handle Trailing Stop\n $this->checkTrailingStop();\n $this->checkMarketIfTouched();\n //Check to see if take profit was hit\n $this->checkTakeProfit();\n }",
"public function finish()\n {\n parent::finish();\n \n // only allow higher than first tier roles to make direct calls\n $this->set_variable( 'allow_connect',\n 1 < lib::create( 'business\\session' )->get_role()->tier );\n $this->set_variable( 'sip_enabled',\n lib::create( 'business\\voip_manager' )->get_sip_enabled() );\n\n foreach( $this->get_record_list() as $record )\n {\n $this->add_row( $record->id,\n array( 'active' => $record->active,\n 'rank' => $record->rank,\n 'type' => $record->type,\n 'number' => $record->number ) );\n }\n\n $this->finish_setting_rows();\n }",
"public function terminate()\n {\n $this->endedAt = new DateTime();\n }",
"public function endAction()\n {\n $test = $this->session->remove('auth');\n\t\t\n $this->flash->success('Goodbye!' .$test);\n return $this->forward('apps/index');\n }",
"function resendCancelEmail(){\n\t\t//echo \"resend...\";\n\t\t$db\t\t= JFactory::getDbo();\n\t\t$query\t= $db->getQuery(true);\n\t\tif($_POST['cancelReId'] == '')\n\t\t\t$nId = $_POST['appCanId'];\n\t\telse\n\t\t\t$nId = $_POST['cancelReId'];\n\n\t\t$query->select($db->nameQuote('s_name'));\n\t\t$query->select($db->nameQuote('s_prename'));\n\t\t$query->select($db->nameQuote('s_address'));\n\t\t$query->select($db->nameQuote('s_plz'));\n\t\t$query->select($db->nameQuote('s_city'));\n\t\t$query->select($db->nameQuote('s_phone'));\n\t\t$query->select($db->nameQuote('s_email'));\n\t\t$query->select($db->nameQuote('idt_drivin_event_apply')); \n\t\t$query->select($db->nameQuote('s_title'));\t\t\n\t\t$query->from($db->nameQuote('#__jevent_events_apply'));\n\t\t$this->_id2 = $nId;\n\t\t$query->where($db->nameQuote('idt_drivin_event_apply') . '=' . $nId);\n\t\t//if(!$bCanceled)\n\t\t//\t$query->where($db->nameQuote('dt_Cancel') . ' is null');\n\t\t//else\n\t\t\t$query->where($db->nameQuote('dt_Cancel') . ' is not null');\n\t\t//echo \"SQLSTRING: \" . $query;\n\t\t$db->setQuery($query);\n\t\tif ($link = $db->loadRowList()) {\n\t\t\t$mailer = new jEventMailer();\n\t\t\t//$mailer->test();\n\t\t\t\n\t\t\tif(!$mailer->sendApplicationEmail2(1, $link, $this->getEventById2(), true)){\n\t\t\t\t$this->setError($mailer->error);\n\t\t\t\techo \"Eroooor \" . $mailer->error;\n\t\t\t}\n\t\t}else{\n\t\t\techo \"No Record Found! ReID: \". $nId;\n\t\t}\n\t\treturn true;\n\t\n\t}"
] | [
"0.61508363",
"0.5712381",
"0.56537205",
"0.56537205",
"0.56537205",
"0.56537205",
"0.5575623",
"0.5573642",
"0.5573642",
"0.5539961",
"0.5539961",
"0.5539961",
"0.55391794",
"0.55082256",
"0.55001557",
"0.54806036",
"0.5446951",
"0.538332",
"0.5374615",
"0.53479207",
"0.5332825",
"0.52844393",
"0.5273232",
"0.5267332",
"0.5252653",
"0.5248086",
"0.52403057",
"0.5239786",
"0.52254474",
"0.52006584",
"0.514644",
"0.51366794",
"0.51182604",
"0.50926983",
"0.50913244",
"0.5066572",
"0.50610375",
"0.506096",
"0.5050928",
"0.50498915",
"0.50226027",
"0.5017494",
"0.5012927",
"0.5011169",
"0.5004856",
"0.50002295",
"0.50002295",
"0.49939093",
"0.49836794",
"0.49535504",
"0.49520132",
"0.4951779",
"0.49500182",
"0.49449342",
"0.4943974",
"0.49395618",
"0.49389297",
"0.49284267",
"0.49280986",
"0.4927374",
"0.49224973",
"0.4910968",
"0.49058592",
"0.490226",
"0.48841244",
"0.48693904",
"0.48429647",
"0.4837797",
"0.48338035",
"0.48318788",
"0.4827146",
"0.4826524",
"0.4825859",
"0.48196882",
"0.48181152",
"0.48146558",
"0.48102766",
"0.48102766",
"0.47997832",
"0.4796439",
"0.47914395",
"0.4788877",
"0.47858557",
"0.47816527",
"0.47762686",
"0.47751287",
"0.47743583",
"0.47683087",
"0.47637227",
"0.47618467",
"0.47497115",
"0.47339946",
"0.47315305",
"0.47286415",
"0.47212684",
"0.47199",
"0.4710349",
"0.4703831",
"0.46984732",
"0.46983105"
] | 0.7518168 | 0 |
/ Description Function is called whn call is ended a result page gets open Author Dave Brown Created 28 Nov 2014 | public function conclusion ($appointment_hash = NULL)
{
$page_data = NULL;
if (empty($appointment_hash))
{
show_404();
}
/* Hash coming from url is nothing but an encrypted appointment id */
$apppointment_id = encryptor('decrypt', $appointment_hash);
/* Template description */
$page_variables['container'] = array();
$data['page_view']['container'] = 'appointments_module/conclusion';
$page_variables['right_container'] = array();
$data['page_view']['right_container'] = 'appointments_module/right_conclusion';
//Variables For Footer
$data['title'] = 'Doctor\'s Schedule | ' . SITE_NAME;
/* Extra css classes to add in template */
$data['extra_wrapper_class'] = 'live-appointment la-conclusn';
$data['extra_container_class'] = NULL;
/* -------Ends----- */
$data['js_script'] = 'appointments_module/js_script';
$data['current_module'] = $this->current_module;
$data['page_variables'] = $page_variables;
parent::fronttemplate($data);
/* Template Description Ends */
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPageClose() {}",
"public function endPage() {}",
"public function getPageOpen() {}",
"function _endpage()\n\t\t{\n\t\t\t$this->state=1;\n\t\t}",
"private function finish() {\n\t\t\t$this->db->close();\n\t\t\t$this->page->output();\n\t\t}",
"public function openReturn()\n {\n $this->returnOpen = true;\n }",
"public function finish()\n {\n $p = $this->page;\n if ($p->is_ajax_request) {\n exit_json($this->response);\n }\n\n $to = ($_GET['return_uri']) ?: $_SERVER['HTTP_REFERER'];\n $get = ($this->response['status'] == 'OK')\n ? array('status' => 'OK')\n : $this->response;\n\n $get = '?return='.rawurlencode(serialize($get));\n\n $p->redirect($to.$get, 302);\n }",
"function ldap_control_paged_result_response($link, $result, &$cookie = NULL, &$estimated = NULL)\n{\n}",
"protected function finish() {}",
"abstract protected function doEnd();",
"public function onFinish() {\n\t\t$this->onResponse->executeAll(false);\n\t\tparent::onFinish();\n\t}",
"public function end();",
"public function end();",
"public function end();",
"public function end();",
"public function getClose() {}",
"public function closeReturn()\n {\n $this->returnOpen = false;\n }",
"function endPage(){\n global $_inContainer, $_pageName, $_loadChosen;\n require('inc/pageend.php');\n}",
"public function releaseResult(){\n $this->respond(\"Wrong Way, Go Back\",400);\n }",
"public function finish();",
"public function finish();",
"function results_launcher($title, $page, $category_id, $max, $max_rows, $type, $max_page_links = 5, $start_name = 'start')\n{\n if ($max < 1) {\n $max = 1;\n }\n\n require_javascript('pagination');\n\n $out = new Tempcode();\n\n if ($max < $max_rows) { // If they don't all fit on one page\n $part = new Tempcode();\n $num_pages = ($max == 0) ? 0 : min(intval(ceil(floatval($max_rows) / floatval($max))), $max_page_links);\n for ($x = 0; $x < $num_pages; $x++) {\n $cat_url = build_url(array('page' => $page, 'type' => $type, $start_name => ($x == 0) ? null : ($x * $max), 'id' => $category_id), get_module_zone($page));\n $part->attach(do_template('RESULTS_LAUNCHER_PAGE_NUMBER_LINK', array('_GUID' => 'd19c001f3ecff62105f803d541f7d945', 'TITLE' => $title, 'URL' => $cat_url, 'P' => strval($x + 1))));\n }\n\n $num_pages = intval(ceil(floatval($max_rows) / floatval($max)));\n if ($num_pages > $max_page_links) {\n $url_stub = build_url(array('page' => $page, 'type' => $type, 'id' => $category_id), '_SELF');\n $part->attach(do_template('RESULTS_LAUNCHER_CONTINUE', array('_GUID' => '0a55d3c1274618c16bd6d8d2cf36676c', 'TITLE' => $title, 'MAX' => strval($max), 'NUM_PAGES' => integer_format($num_pages), 'URL_STUB' => $url_stub)));\n }\n\n $out->attach(do_template('RESULTS_LAUNCHER_WRAP', array('_GUID' => 'c1c01ee07c456832e7e66a03f26c2288', 'PART' => $part)));\n }\n\n return $out;\n}",
"abstract protected function onEnd(): void;",
"public function proceed();",
"public function execQuery()\n{\n\n $url = $this->getURL();\n // create curl resource \n $ch = curl_init(); \n\n //return the transfer as a string \n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n curl_setopt( $ch, CURLOPT_USERAGENT, \"MyUserAgent\" );\n\n // set url \n curl_setopt($ch, CURLOPT_URL, $url);\n\n // $output contains the output string \n $result = curl_exec($ch); \n\n $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); \n\n // Check if any error occurred\n if(curl_errno($ch))\n {\n echo 'Curl error: ' . curl_error($ch);\n }\n // close curl resource to free up system resources \n curl_close($ch); \n\n return $result;\n}",
"protected function handleResultRequest() {\n\t\t//no longer letting people in without these things. If this is\n\t\t//preventing you from doing something, you almost certainly want to be\n\t\t//somewhere else.\n\t\t$deadSession = false;\n\t\tif ( !$this->adapter->session_hasDonorData() ) {\n\t\t\t$deadSession = true;\n\t\t}\n\t\t$oid = $this->adapter->getData_Unstaged_Escaped( 'order_id' );\n\n\t\t$request = $this->getRequest();\n\t\t$referrer = $request->getHeader( 'referer' );\n\t\t$liberated = false;\n\t\tif ( $this->adapter->session_getData( 'order_status', $oid ) === 'liberated' ) {\n\t\t\t$liberated = true;\n\t\t}\n\n\t\t// XXX need to know whether we were in an iframe or not.\n\t\tglobal $wgServer;\n\t\tif ( $this->isReturnFramed() && ( strpos( $referrer, $wgServer ) === false ) && !$liberated ) {\n\t\t\t$sessionOrderStatus = $request->getSessionData( 'order_status' );\n\t\t\t$sessionOrderStatus[$oid] = 'liberated';\n\t\t\t$request->setSessionData( 'order_status', $sessionOrderStatus );\n\t\t\t$this->logger->info( \"Resultswitcher: Popping out of iframe for Order ID \" . $oid );\n\t\t\t$this->getOutput()->allowClickjacking();\n\t\t\t$this->getOutput()->addModules( 'iframe.liberator' );\n\t\t\treturn;\n\t\t}\n\n\t\t$this->setHeaders();\n\n\t\tif ( $deadSession ){\n\t\t\tif ( $this->adapter->isReturnProcessingRequired() ) {\n\t\t\t\twfHttpError( 403, 'Forbidden', wfMessage( 'donate_interface-error-http-403' )->text() );\n\t\t\t\tthrow new RuntimeException(\n\t\t\t\t\t'Resultswitcher: Request forbidden. No active donation in the session. ' .\n\t\t\t\t\t\"Adapter Order ID: $oid\"\n\t\t\t\t);\n\t\t\t}\n\t\t\t// If it's possible for a donation to go through without our\n\t\t\t// having to do additional processing in the result switcher,\n\t\t\t// we don't want to falsely claim it failed just because we\n\t\t\t// lost the session data. We also don't want to give any\n\t\t\t// information to scammers hitting this page with no session,\n\t\t\t// so we always show the thank you page. We don't want to do\n\t\t\t// any post-processing if we're not sure whether we actually\n\t\t\t// originated this attempt, so we return right after.\n\t\t\t$this->logger->warning(\n\t\t\t\t'Resultswitcher: session is dead, but the ' .\n\t\t\t\t'donor may have made a successful payment.'\n\t\t\t);\n\t\t\t$this->displayThankYouPage( 'dead session' );\n\t\t\treturn;\n\t\t}\n\t\t$this->logger->info( \"Resultswitcher: OK to process Order ID: \" . $oid );\n\n\t\tif ( $this->adapter->checkTokens() ) {\n\t\t\t$this->getOutput()->allowClickjacking();\n\t\t\t// FIXME: do we really need this again?\n\t\t\t$this->getOutput()->addModules( 'iframe.liberator' );\n\t\t\t// processResponse expects some data, so let's feed it all the\n\t\t\t// GET and POST vars\n\t\t\t$response = $this->getRequest()->getValues();\n\t\t\t// TODO: run the whole set of getResponseStatus, getResponseErrors\n\t\t\t// and getResponseData first. Maybe do_transaction with a\n\t\t\t// communication_type of 'incoming' and a way to provide the\n\t\t\t// adapter the GET/POST params harvested here.\n\t\t\t$this->adapter->processResponse( $response );\n\t\t\t$status = $this->adapter->getFinalStatus();\n\t\t\tswitch ( $status ) {\n\t\t\tcase FinalStatus::COMPLETE:\n\t\t\tcase FinalStatus::PENDING:\n\t\t\t\t$this->displayThankYouPage( $status );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$this->logger->info( \"Displaying fail page for final status $status\" );\n\t\t} else {\n\t\t\t$this->logger->error( \"Resultswitcher: Token Check Failed. Order ID: $oid\" );\n\t\t}\n\t\t$this->displayFailPage();\n\t}",
"function publishResults()\n{\n\n //return\n\n}",
"public function doExecute()\r\n\t\t{\r\n\t\t\t\r\n\t\t\t$strID = $this->request->getProperty(\"id\");\r\n\t\t\t$strType = $this->request->getProperty(\"type\");\r\n\t\t\t$doNotRedirect = $this->request->getProperty(\"printRedirect\");\r\n \r\n\t\t\t$configLinkResolver = $this->registry->getConfig(\"LINK_RESOLVER_ADDRESS\", true);\r\n\t\t\t$configSID = $this->registry->getConfig(\"APPLICATION_SID\", false, \"calstate.edu:xerxes\");\r\n\t\t\t$configBaseUrl = $this->registry->getConfig(\"BASE_URL\", true);\r\n\t\t\r\n\t\t\t// get the record from database\r\n\t\t\t\r\n\t\t\t$objData = new Xerxes_DataMap();\r\n\t\t\t$objDataRecord = $objData->getRecordByID($strID);\r\n\t\t\t\r\n\t\t\tif ( $objDataRecord == null ) throw new Exception(\"cannot find record\");\r\n\t\t\t\r\n\t\t\t$objRecord = $objDataRecord->xerxes_record;\r\n\t\t\t\r\n\t\t\t// redirect to the resource based on type\r\n\t\t\t\r\n\t\t\tif ( $strType == \"openurl\" )\r\n\t\t\t{\t\t\t\t\t\r\n\t\t\t\t$this->request->setRedirect($objRecord->getOpenURL($configLinkResolver, $configSID));\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$strUrl = $configBaseUrl . \"/?base=databases&action=proxy\";\r\n\t\t\t\t\r\n\t\t\t\tif ( $strType == \"html\" || $strType == \"pdf\" || $strType == \"online\" || $strType == \"construct\")\r\n\t\t\t\t{\r\n\t\t\t\t\t$link = $objRecord->getFullText(true);\r\n\t\t\t\t\t\r\n\t\t\t\t\tforeach ( $link as $arrLink )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ( $arrLink[2] == $strType)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t// see if this is a construct link, in which case pass it back thru\r\n\t\t\t\t\t\t\t// proxy for construction\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tif ( is_array($arrLink[1]) )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tforeach ( $arrLink[1] as $strField => $strValue )\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t$strUrl .= \"¶m=$strField=$strValue\";\r\n\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$strUrl .= \"&url=\" . urlencode($arrLink[1]);\t\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\tif ( method_exists($objRecord, \"getMetalibID\") )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$strUrl .= \"&database=\" . $objRecord->getMetalibID();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tthrow new Exception(\"unsupported redirect type\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$this->request->setRedirect($strUrl);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ($doNotRedirect == true )\r\n\t\t\t{\r\n\t\t\t\techo $this->request->getRedirect();\r\n\t\t\t\texit;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn 1;\t\t\t\t\t\r\n\t\t}",
"public function finish()\n\t{\n\t\t\n\t}",
"function close() \n {\n if($this->rsQry==false)\n {\n\t\t\t mysql_free_result($this->rsQry);\n\t\t\t unset($this->rsQry);\n }\n\t\t}",
"function query_more($sfConn, $queryLocator)\n {\n\t\techo(\"<P> query_more <P>\");\n try\n {\n // The query process\n\t\techo(\"<P> Query more <P>\");\necho(\"<P> QUERYLOCATOR, call!!! \" . \t$queryLocator . \" !! \" . \"<P>\");\n\t\t$queryResults = $sfConn->queryMore($queryLocator);\n\t\t\t\n // Put the result counts into an array to pass back as the result.\n $successful = array();\n array_push($successful, $queryResults);\n return $successful;\n exit;\n }\n\n catch (exception $e)\n {\n // This is reached if there is a major problem in the data or with\n // the salesforce.com connection. Normal data errors are caught by\n // salesforce.com\n\t\t\techo(\"<P> Major SalesForce error <P>\");\n echo $e->GetMessage();\n return false;\n exit;\n }\n \n }",
"public function end() {}",
"public function end() {}",
"public function end() {}",
"function pi_list_browseresults($showResultCount=1,$tableParams='',$wrapArr=array(), $pointerName = 'pointer', $hscText = TRUE)\t{\n\t\t/* $wrapArr = array(\n\t\t\t'browseBoxWrap' => '<div class=\"browseBoxWrap\">|</div>',\n\t\t\t'showResultsWrap' => '<div class=\"showResultsWrap\">|</div>',\n\t\t\t'browseLinksWrap' => '<div class=\"browseLinksWrap\">|</div>',\n\t\t\t'showResultsNumbersWrap' => '<span class=\"showResultsNumbersWrap\">|</span>',\n\t\t\t'disabledLinkWrap' => '<span class=\"disabledLinkWrap\">|</span>',\n\t\t\t'inactiveLinkWrap' => '<span class=\"inactiveLinkWrap\">|</span>',\n\t\t\t'activeLinkWrap' => '<span class=\"activeLinkWrap\">|</span>'\n\t\t); */\n\n\t\t\t// Initializing variables:\n\t\t$pointer = intval($this->piVars[$pointerName]);\n\t\t$count = intval($this->internal['res_count']);\n\t\t$results_at_a_time = t3lib_div::intInRange($this->internal['results_at_a_time'],1,1000);\n\t\t$totalPages = ceil($count/$results_at_a_time);\n\t\t$maxPages = t3lib_div::intInRange($this->internal['maxPages'],1,100);\n\t\t$pi_isOnlyFields = $this->pi_isOnlyFields($this->pi_isOnlyFields);\n\n\t\t\t// $showResultCount determines how the results of the pagerowser will be shown.\n\t\t\t// If set to 0: only the result-browser will be shown\n\t\t\t//\t \t\t 1: (default) the text \"Displaying results...\" and the result-browser will be shown.\n\t\t\t//\t \t\t 2: only the text \"Displaying results...\" will be shown\n\t\t$showResultCount = intval($showResultCount);\n\n\t\t\t// if this is set, two links named \"<< First\" and \"LAST >>\" will be shown and point to the very first or last page.\n\t\t$showFirstLast = $this->internal['showFirstLast'];\n\n\t\t\t// if this has a value the \"previous\" button is always visible (will be forced if \"showFirstLast\" is set)\n\t\t$alwaysPrev = $showFirstLast?1:$this->pi_alwaysPrev;\n\n\t\tif (isset($this->internal['pagefloat'])) {\n\t\t\tif (strtoupper($this->internal['pagefloat']) == 'CENTER') {\n\t\t\t\t$pagefloat = ceil(($maxPages - 1)/2);\n\t\t\t} else {\n\t\t\t\t// pagefloat set as integer. 0 = left, value >= $this->internal['maxPages'] = right\n\t\t\t\t$pagefloat = t3lib_div::intInRange($this->internal['pagefloat'],-1,$maxPages-1);\n\t\t\t}\n\t\t} else {\n\t\t\t$pagefloat = -1; // pagefloat disabled\n\t\t}\n\n\t\t\t// default values for \"traditional\" wrapping with a table. Can be overwritten by vars from $wrapArr\n\t\t$wrapper['disabledLinkWrap'] = '<td nowrap=\"nowrap\"><p>|</p></td>';\n\t\t$wrapper['inactiveLinkWrap'] = '<td nowrap=\"nowrap\"><p>|</p></td>';\n\t\t$wrapper['activeLinkWrap'] = '<td'.$this->pi_classParam('browsebox-SCell').' nowrap=\"nowrap\"><p>|</p></td>';\n\t\t$wrapper['browseLinksWrap'] = trim('<table '.$tableParams).'><tr>|</tr></table>';\n\t\t$wrapper['showResultsWrap'] = '<p>|</p>';\n\t\t$wrapper['browseBoxWrap'] = '\n\t\t<!--\n\t\t\tList browsing box:\n\t\t-->\n\t\t<div '.$this->pi_classParam('browsebox').'>\n\t\t\t|\n\t\t</div>';\n\n\t\t\t// now overwrite all entries in $wrapper which are also in $wrapArr\n\t\t$wrapper = array_merge($wrapper,$wrapArr);\n\n\t\tif ($showResultCount != 2) { //show pagebrowser\n\t\t\tif ($pagefloat > -1) {\n\t\t\t\t$lastPage = min($totalPages,max($pointer+1 + $pagefloat,$maxPages));\n\t\t\t\t$firstPage = max(0,$lastPage-$maxPages);\n\t\t\t} else {\n\t\t\t\t$firstPage = 0;\n\t\t\t\t$lastPage = t3lib_div::intInRange($totalPages,1,$maxPages);\n\t\t\t}\n\t\t\t$links=array();\n\n\t\t\t\t// Make browse-table/links:\n\t\t\tif ($showFirstLast) { // Link to first page\n\t\t\t\tif ($pointer>0)\t{\n\t\t\t\t\t$links[]=$this->cObj->wrap($this->pi_linkTP_keepPIvars($this->pi_getLL('pi_list_browseresults_first','<< First',$hscText),array($pointerName => null),$pi_isOnlyFields),$wrapper['inactiveLinkWrap']);\n\t\t\t\t} else {\n\t\t\t\t\t$links[]=$this->cObj->wrap($this->pi_getLL('pi_list_browseresults_first','<< First',$hscText),$wrapper['disabledLinkWrap']);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($alwaysPrev>=0)\t{ // Link to previous page\n\t\t\t\tif ($pointer>0)\t{\n\t\t\t\t\t$links[]=$this->cObj->wrap($this->pi_linkTP_keepPIvars($this->pi_getLL('pi_list_browseresults_prev','< Previous',$hscText),array($pointerName => ($pointer-1?$pointer-1:'')),$pi_isOnlyFields),$wrapper['inactiveLinkWrap']);\n\t\t\t\t} elseif ($alwaysPrev)\t{\n\t\t\t\t\t$links[]=$this->cObj->wrap($this->pi_getLL('pi_list_browseresults_prev','< Previous',$hscText),$wrapper['disabledLinkWrap']);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor($a=$firstPage;$a<$lastPage;$a++)\t{ // Links to pages\n\t\t\t\tif ($this->internal['showRange']) {\n\t\t\t\t\t$pageText = (($a*$results_at_a_time)+1).'-'.min($count,(($a+1)*$results_at_a_time));\n\t\t\t\t} else {\n\t\t\t\t\t$pageText = trim($this->pi_getLL('pi_list_browseresults_page','Page',$hscText).' '.($a+1));\n\t\t\t\t}\n\t\t\t\tif ($pointer == $a) { // current page\n\t\t\t\t\tif ($this->internal['dontLinkActivePage']) {\n\t\t\t\t\t\t$links[] = $this->cObj->wrap($pageText,$wrapper['activeLinkWrap']);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$links[] = $this->cObj->wrap($this->pi_linkTP_keepPIvars($pageText,array($pointerName => ($a?$a:'')),$pi_isOnlyFields),$wrapper['activeLinkWrap']);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$links[] = $this->cObj->wrap($this->pi_linkTP_keepPIvars($pageText,array($pointerName => ($a?$a:'')),$pi_isOnlyFields),$wrapper['inactiveLinkWrap']);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($pointer<$totalPages-1 || $showFirstLast)\t{\n\t\t\t\tif ($pointer==$totalPages-1) { // Link to next page\n\t\t\t\t\t$links[]=$this->cObj->wrap($this->pi_getLL('pi_list_browseresults_next','Next >',$hscText),$wrapper['disabledLinkWrap']);\n\t\t\t\t} else {\n\t\t\t\t\t$links[]=$this->cObj->wrap($this->pi_linkTP_keepPIvars($this->pi_getLL('pi_list_browseresults_next','Next >',$hscText),array($pointerName => $pointer+1),$pi_isOnlyFields),$wrapper['inactiveLinkWrap']);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($showFirstLast) { // Link to last page\n\t\t\t\tif ($pointer<$totalPages-1) {\n\t\t\t\t\t$links[]=$this->cObj->wrap($this->pi_linkTP_keepPIvars($this->pi_getLL('pi_list_browseresults_last','Last >>',$hscText),array($pointerName => $totalPages-1),$pi_isOnlyFields),$wrapper['inactiveLinkWrap']);\n\t\t\t\t} else {\n\t\t\t\t\t$links[]=$this->cObj->wrap($this->pi_getLL('pi_list_browseresults_last','Last >>',$hscText),$wrapper['disabledLinkWrap']);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$theLinks = $this->cObj->wrap(implode(chr(10),$links),$wrapper['browseLinksWrap']);\n\t\t} else {\n\t\t\t$theLinks = '';\n\t\t}\n\n\t\t$pR1 = $pointer*$results_at_a_time+1;\n\t\t$pR2 = $pointer*$results_at_a_time+$results_at_a_time;\n\n\t\tif ($showResultCount) {\n\t\t\tif ($wrapper['showResultsNumbersWrap']) {\n\t\t\t\t// this will render the resultcount in a more flexible way using markers (new in TYPO3 3.8.0).\n\t\t\t\t// the formatting string is expected to hold template markers (see function header). Example: 'Displaying results ###FROM### to ###TO### out of ###OUT_OF###'\n\n\t\t\t\t$markerArray['###FROM###'] = $this->cObj->wrap($this->internal['res_count'] > 0 ? $pR1 : 0,$wrapper['showResultsNumbersWrap']);\n\t\t\t\t$markerArray['###TO###'] = $this->cObj->wrap(min($this->internal['res_count'],$pR2),$wrapper['showResultsNumbersWrap']);\n\t\t\t\t$markerArray['###OUT_OF###'] = $this->cObj->wrap($this->internal['res_count'],$wrapper['showResultsNumbersWrap']);\n\t\t\t\t$markerArray['###FROM_TO###'] = $this->cObj->wrap(($this->internal['res_count'] > 0 ? $pR1 : 0).' '.$this->pi_getLL('pi_list_browseresults_to','to').' '.min($this->internal['res_count'],$pR2),$wrapper['showResultsNumbersWrap']);\n\t\t\t\t$markerArray['###CURRENT_PAGE###'] = $this->cObj->wrap($pointer+1,$wrapper['showResultsNumbersWrap']);\n\t\t\t\t$markerArray['###TOTAL_PAGES###'] = $this->cObj->wrap($totalPages,$wrapper['showResultsNumbersWrap']);\n\t\t\t\t// substitute markers\n\t\t\t\t$resultCountMsg = $this->cObj->substituteMarkerArray($this->pi_getLL('pi_list_browseresults_displays','Displaying results ###FROM### to ###TO### out of ###OUT_OF###'),$markerArray);\n\t\t\t} else {\n\t\t\t\t// render the resultcount in the \"traditional\" way using sprintf\n\t\t\t\t$resultCountMsg = sprintf(\n\t\t\t\t\tstr_replace('###SPAN_BEGIN###','<span'.$this->pi_classParam('browsebox-strong').'>',$this->pi_getLL('pi_list_browseresults_displays','Displaying results ###SPAN_BEGIN###%s to %s</span> out of ###SPAN_BEGIN###%s</span>')),\n\t\t\t\t\t$count > 0 ? $pR1 : 0,\n\t\t\t\t\tmin($count,$pR2),\n\t\t\t\t\t$count);\n\t\t\t}\n\t\t\t$resultCountMsg = $this->cObj->wrap($resultCountMsg,$wrapper['showResultsWrap']);\n\t\t} else {\n\t\t\t$resultCountMsg = '';\n\t\t}\n\n\t\t$sTables = $this->cObj->wrap($resultCountMsg.$theLinks,$wrapper['browseBoxWrap']);\n\n\t\treturn $sTables;\n\t}",
"private function show_result_after(){\n ?>\n </ol>\n </div>\n </body>\n </html>\n <?php\n }",
"public function complete();",
"public function complete();",
"public function done();",
"public function fine(){\n\t\treturn ob_end_flush();;\n\t}",
"function msgsrv_close ($link) {}",
"public function ended();",
"public function getOpen() {}",
"abstract protected function handleResult();",
"public function ee_breakouts_page_load() {}",
"function main()\n {\n $this->page_id = 113;\n $this->get_text();\n $this->body .= \"<table cellpadding=5 cellspacing=1 border=0 width=\\\"100%\\\">\\n\";\n if (strlen(trim($this->messages[500021])) > 0) {\n $this->body .= \"<tr class=\\\"browse_sellers_main_page_title\\\">\\n\\t<td valign=top height=20>\" . $this->messages[500021] . \"</td>\\n</tr>\\n\";\n }\n if (strlen(trim($this->messages[500022])) > 0) {\n $this->body .= \"<tr class=\\\"browse_sellers_main_page_message\\\">\\n\\t<td valign=top height=20>\" . $this->messages[500022] . \"</td>\\n</tr>\\n\";\n }\n $this->body .= \"<tr>\\n\\t<td valign=top>\\n\\t\";\n if (!$this->browse_main()) {\n $this->browse_error();\n }\n $this->body .= \"</td>\\n</tr>\\n\";\n $this->body .= \"</table>\\n\";\n $this->display_page();\n return true;\n }",
"protected function iterationComplete() { if(!$this->resultFreed) {\n try {\n $this->db->free_result($this->result);\n $this->resultFreed = true;\n } catch(Exception $ex) {}\n }\n }",
"function end();",
"function results_launcher($title,$page,$category_id,$max,$max_rows,$type,$max_page_links=5)\n{\n\tif ($max<1) $max=1;\n\n\trequire_javascript('javascript_results_browser');\n\n\t$out=new ocp_tempcode();\n\n\tif ($max<$max_rows) // If they don't all fit on one page\n\t{\n\t\t$part=new ocp_tempcode();\n\t\t$num_pages=($max==0)?0:min(intval(ceil($max_rows/$max)),$max_page_links);\n\t\tfor ($x=0;$x<$num_pages;$x++)\n\t\t{\n\t\t\t$cat_url=build_url(array('page'=>$page,'type'=>$type,'start'=>($x==0)?NULL:($x*$max),'id'=>$category_id),get_module_zone($page));\n\t\t\t$part->attach(do_template('RESULTS_LAUNCHER_PAGE_NUMBER_LINK',array('_GUID'=>'d19c001f3ecff62105f803d541f7d945','TITLE'=>$title,'URL'=>$cat_url,'P'=>strval($x+1))));\n\t\t}\n\n\t\t$num_pages=intval(ceil($max_rows/$max));\n\t\tif ($num_pages>$max_page_links)\n\t\t{\n\t\t\t$url_stub=build_url(array('page'=>$page,'type'=>$type,'id'=>$category_id),'_SELF');\n\t\t\t$part->attach(do_template('RESULTS_LAUNCHER_CONTINUE',array('_GUID'=>'0a55d3c1274618c16bd6d8d2cf36676c','TITLE'=>$title,'MAX'=>strval($max),'NUM_PAGES'=>integer_format($num_pages),'URL_STUB'=>$url_stub)));\n\t\t}\n\n\t\t$out->attach(do_template('RESULTS_LAUNCHER_WRAP',array('_GUID'=>'c1c01ee07c456832e7e66a03f26c2288','PART'=>$part)));\n\t}\n\n\treturn $out;\n}",
"function edreportnextpage_func()\n{\n\tglobal $wpHelper;\n\n $subject = isset($_GET['subject']) ? (int)$_GET['subject'] : '';\n $page = isset($_GET['page']) ? (int)$_GET['page'] : 1;\n $perpage = isset($_GET['perpage']) ? (int)$_GET['perpage'] : 10;\n $text = isset($_GET['textsearch']) ? sanitize_text_field($_GET['textsearch']) : '';\n\t$type = isset($_GET['type']) ? sanitize_text_field($_GET['type']) : '';\n $grades = isset($_GET['grades']) ? $_GET['grades'] : [];\n $status = isset($_GET['status']) ? $_GET['status'] : [];\n $wpHelper->queryStart(($perpage * $page));\n $wpHelper->queryLimit($perpage);\n $series = $wpHelper->series($subject, $grades, $text, 'none', $status, $type);\n if (!empty($series)) :\n foreach ($series as $s) :\n format_edseries($s, $status, $type);\n endforeach;\n else:\n if ($page == 1 ) echo \"<div class='noseriesfound'>No More Reviews Found</div>\";\n elseif ( !empty($text) ) echo \"<div class='noseriesfound'>No Reviews Found</div>\";\n endif;\n die();\n}",
"function results_are_paged()\n {\n }",
"function finishResult(& $result) \n {\n $pager = $this->_renderPager(\n $this->_getPages($result, 20), \n $result->pageNumber);\n $this->_html = str_replace(\n '{rows}', \n $this->_html, \n $this->_resultTemplate);\n $this->_html .= str_replace('{pager}', $pager, $this->_pagerTemplate);\n }",
"public function finish() {\r\n\t}",
"public function end() : void\n {\n ob_end_clean();\n }",
"public function extProc_finish() {}",
"public function extProc_finish() {}",
"public function finish() {}",
"public function finish() {}",
"public function finish() {}",
"public function finish() {}",
"public function finish() {}",
"public function finish() {}",
"public function finish() {}",
"public function finish() {}",
"public static function outputPage() {\n\t\tself::phpSetup();\n\t\t// Set the session\n global $clsession;\n $clsession =new SessionV4;\n //--------------------------------------------------------------\n // Exit if the web is closed for maintenance except\n // when the user is the master\n if( self::ISCLOSED && $_SESSION['usr'] != 'master' )\n exit(pageMaintenance::show());\n # --------------------------------------------------------------\n \t# Show the parameters entered with the request\n self::see();\n\t\tif( self::SEEPHPINFO ) phpinfo();\n\t\t# --------------------------------------------------------------\n\t\t# Reset the session if requested\n\t\tif( isset($_POST['reset']) && $_POST['reset'] == 'XRESET')\n\t\t\t$clsession->logout(sessionV4::NOACT);\n # --------------------------------------------------------------\n\t\t# Open the main class of the system\n\t\trequire_once('main.php');\n $clmain=new main;\n $s=$clmain->execute();\n $shses=(singleton::SHOWSESSION ? $clsession->getSession() : '');\n\t\treturn $s.$shses;\n\t}",
"public function myReturnCallback() {\n return 'You can close this page';\n }",
"public function do_paging()\n {\n }",
"function pi_list_browseresults($showResultCount=1,$tableParams='',$wrapArr=array(), $pointerName = 'ter_pointer', $hscText = TRUE)\t{\n\n\t\t// example $wrapArr-array how it could be traversed from an extension\n\t\t/* $wrapArr = array(\n\t\t\t'browseBoxWrap' => '<div class=\"browseBoxWrap\">|</div>',\n\t\t\t'showResultsWrap' => '<div class=\"showResultsWrap\">|</div>',\n\t\t\t'browseLinksWrap' => '<div class=\"browseLinksWrap\">|</div>',\n\t\t\t'showResultsNumbersWrap' => '<span class=\"showResultsNumbersWrap\">|</span>',\n\t\t\t'disabledLinkWrap' => '<span class=\"disabledLinkWrap\">|</span>',\n\t\t\t'inactiveLinkWrap' => '<span class=\"inactiveLinkWrap\">|</span>',\n\t\t\t'activeLinkWrap' => '<span class=\"activeLinkWrap\">|</span>'\n\t\t); */\n\n\t\t\t// Initializing variables:\n\t\t$pointer = intval($this->ter_pointer); \n\t\t$count = intval($this->internal['res_count']);\t\t\n \t$results_at_a_time = t3lib_div::intInRange($this->internal['results_at_a_time'],1,1000);\n\t\t$totalPages = ceil($count/$results_at_a_time);\n\n\t\t$maxPages = t3lib_div::intInRange($this->internal['maxPages'],1,100);\n\t\t$pi_isOnlyFields = $this->pi_isOnlyFields($this->pi_isOnlyFields);\n\n\t\t\t// $showResultCount determines how the results of the pagerowser will be shown.\n\t\t\t// If set to 0: only the result-browser will be shown\n\t\t\t//\t \t\t 1: (default) the text \"Displaying results...\" and the result-browser will be shown.\n\t\t\t//\t \t\t 2: only the text \"Displaying results...\" will be shown\n\t\t$showResultCount = intval($showResultCount);\n\n\t\t\t// if this is set, two links named \"<< First\" and \"LAST >>\" will be shown and point to the very first or last page.\n\t\t$showFirstLast = $this->internal['showFirstLast'];\n\n\t\t\t// if this has a value the \"previous\" button is always visible (will be forced if \"showFirstLast\" is set)\n\t\t$alwaysPrev = $showFirstLast?1:$this->pi_alwaysPrev;\n\n\t\tif (isset($this->internal['pagefloat'])) {\n\t\t\tif (strtoupper($this->internal['pagefloat']) == 'CENTER') {\n\t\t\t\t$pagefloat = ceil(($maxPages - 1)/2);\n\t\t\t} else {\n\t\t\t\t// pagefloat set as integer. 0 = left, value >= $this->internal['maxPages'] = right\n\t\t\t\t$pagefloat = t3lib_div::intInRange($this->internal['pagefloat'],-1,$maxPages-1);\n\t\t\t}\n\t\t} else {\n\t\t\t$pagefloat = -1; // pagefloat disabled\n\t\t}\n\n\t\t\t// default values for \"traditional\" wrapping with a table. Can be overwritten by vars from $wrapArr\n\t\t$wrapper['disabledLinkWrap'] = '<td nowrap=\"nowrap\"><p>|</p></td>';\n\t\t$wrapper['inactiveLinkWrap'] = '<td nowrap=\"nowrap\"><p>|</p></td>';\n\t\t$wrapper['activeLinkWrap'] = '<td'.$this->pi_classParam('browsebox-SCell').' nowrap=\"nowrap\"><p>|</p></td>';\n\t\t$wrapper['browseLinksWrap'] = trim('<table '.$tableParams).'><tr>|</tr></table>';\n\t\t$wrapper['showResultsWrap'] = '<p>|</p>';\n\t\t$wrapper['browseBoxWrap'] = '\n\t\t<!--\n\t\t\tList browsing box:\n\t\t-->\n\t\t<div '.$this->pi_classParam('browsebox').'>\n\t\t\t|\n\t\t</div>';\n\t\t\t\t\n\t\t\t// now overwrite all entries in $wrapper which are also in $wrapArr\n\t\t$wrapper = array_merge($wrapper,$wrapArr);\n\n\t\tif ($showResultCount != 2) { //show pagebrowser\n\t\t\tif ($pagefloat > -1) {\n\t\t\t\t$lastPage = min($totalPages,max($pointer+1 + $pagefloat,$maxPages));\n\t\t\t\t$firstPage = max(0,$lastPage-$maxPages);\n\t\t\t} else {\n\t\t\t\t$firstPage = 0;\n\t\t\t\t$lastPage = t3lib_div::intInRange($totalPages,1,$maxPages);\n\t\t\t}\n\t\t\t$links=array();\n\n\t\t\t\t// Make browse-table/links:\n\t\t\tif ($showFirstLast) { // Link to first page\n\t\t\t\tif ($pointer>0)\t{\n\t\t\t\t\t$links[]=$this->cObj->wrap($this->pi_linkTP_keepPIvars($this->pi_getLL('pi_list_browseresults_first','<< First',$hscText),array($pointerName => 0),$pi_isOnlyFields),$wrapper['inactiveLinkWrap']);\n\t\t\t\t} else {\n\t\t\t\t\t$links[]=$this->cObj->wrap($this->pi_getLL('pi_list_browseresults_first','<< First',$hscText),$wrapper['disabledLinkWrap']);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($alwaysPrev>=0)\t{ // Link to previous page\n\t\t\t\tif ($pointer>0)\t{\n\t\t\t\t\t$links[]=$this->cObj->wrap($this->pi_linkTP_keepPIvars($this->pi_getLL('pi_list_browseresults_prev','< Previous',$hscText),array($pointerName => ($pointer-1?$pointer-1:'0')),$pi_isOnlyFields),$wrapper['inactiveLinkWrap']);\n\t\t\t\t} elseif ($alwaysPrev)\t{\n\t\t\t\t\t$links[]=$this->cObj->wrap($this->pi_getLL('pi_list_browseresults_prev','< Previous',$hscText),$wrapper['disabledLinkWrap']);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor($a=$firstPage;$a<$lastPage;$a++)\t{ // Links to pages\n\t\t\t\tif ($this->internal['showRange']) {\n\t\t\t\t\t$pageText = (($a*$results_at_a_time)+1).'-'.min($count,(($a+1)*$results_at_a_time));\n\t\t\t\t} else {\n\t\t\t\t\t$pageText = trim($this->pi_getLL('pi_list_browseresults_page','Page',$hscText).' '.($a+1));\n\t\t\t\t}\n\t\t\t\tif ($pointer == $a) { // current page\n\t\t\t\t\tif ($this->internal['dontLinkActivePage']) {\n\t\t\t\t\t\t$links[] = $this->cObj->wrap($pageText,$wrapper['activeLinkWrap']);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$links[] = $this->cObj->wrap($this->pi_linkTP_keepPIvars($pageText,array($pointerName => ($a?$a:'0')),$pi_isOnlyFields),$wrapper['activeLinkWrap']);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$links[] = $this->cObj->wrap($this->pi_linkTP_keepPIvars($pageText,array($pointerName => ($a?$a:'0')),$pi_isOnlyFields),$wrapper['inactiveLinkWrap']);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($pointer<$totalPages-1 || $showFirstLast)\t{\n\t\t\t\tif ($pointer==$totalPages-1) { // Link to next page\n\t\t\t\t\t$links[]=$this->cObj->wrap($this->pi_getLL('pi_list_browseresults_next','Next >',$hscText),$wrapper['disabledLinkWrap']);\n\t\t\t\t} else {\n\t\t\t\t\t$links[]=$this->cObj->wrap($this->pi_linkTP_keepPIvars($this->pi_getLL('pi_list_browseresults_next','Next >',$hscText),array($pointerName => $pointer+1),$pi_isOnlyFields),$wrapper['inactiveLinkWrap']);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($showFirstLast) { // Link to last page\n\t\t\t\tif ($pointer<$totalPages-1) {\n\t\t\t\t\t$links[]=$this->cObj->wrap($this->pi_linkTP_keepPIvars($this->pi_getLL('pi_list_browseresults_last','Last >>',$hscText),array($pointerName => $totalPages-1),$pi_isOnlyFields),$wrapper['inactiveLinkWrap']);\n\t\t\t\t} else {\n\t\t\t\t\t$links[]=$this->cObj->wrap($this->pi_getLL('pi_list_browseresults_last','Last >>',$hscText),$wrapper['disabledLinkWrap']);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$theLinks = $this->cObj->wrap(implode(chr(10),$links),$wrapper['browseLinksWrap']);\n\t\t} else {\n\t\t\t$theLinks = '';\n\t\t}\n\n\t\t$pR1 = $pointer*$results_at_a_time+1;\n\t\t$pR2 = $pointer*$results_at_a_time+$results_at_a_time;\n\n\t\tif ($showResultCount) {\n\t\t\tif ($wrapper['showResultsNumbersWrap']) {\n\t\t\t\t// this will render the resultcount in a more flexible way using markers (new in TYPO3 3.8.0).\n\t\t\t\t// the formatting string is expected to hold template markers (see function header). Example: 'Displaying results ###FROM### to ###TO### out of ###OUT_OF###'\n\n\t\t\t\t$markerArray['###FROM###'] = $this->cObj->wrap($this->internal['res_count'] > 0 ? $pR1 : 0,$wrapper['showResultsNumbersWrap']);\n\t\t\t\t$markerArray['###TO###'] = $this->cObj->wrap(min($this->internal['res_count'],$pR2),$wrapper['showResultsNumbersWrap']);\n\t\t\t\t$markerArray['###OUT_OF###'] = $this->cObj->wrap($this->internal['res_count'],$wrapper['showResultsNumbersWrap']);\n\t\t\t\t$markerArray['###FROM_TO###'] = $this->cObj->wrap(($this->internal['res_count'] > 0 ? $pR1 : 0).' '.$this->pi_getLL('pi_list_browseresults_to','to').' '.min($this->internal['res_count'],$pR2),$wrapper['showResultsNumbersWrap']);\n\t\t\t\t$markerArray['###CURRENT_PAGE###'] = $this->cObj->wrap($pointer+1,$wrapper['showResultsNumbersWrap']);\n\t\t\t\t$markerArray['###TOTAL_PAGES###'] = $this->cObj->wrap($totalPages,$wrapper['showResultsNumbersWrap']);\n\t\t\t\t// substitute markers\n\t\t\t\t$resultCountMsg = $this->cObj->substituteMarkerArray($this->pi_getLL('pi_list_browseresults_displays','Displaying results ###FROM### to ###TO### out of ###OUT_OF###'),$markerArray);\n\t\t\t} else {\n\t\t\t\t// render the resultcount in the \"traditional\" way using sprintf\n\t\t\t\t$resultCountMsg = sprintf(\n\t\t\t\t\tstr_replace('###SPAN_BEGIN###','<span style=\"background-color:#FFFF00\" '.$this->pi_classParam('browsebox-strong').'>',$this->pi_getLL('pi_list_browseresults_displays','Displaying results ###SPAN_BEGIN###%s to %s</span> out of ###SPAN_BEGIN###%s</span>')),\n\t\t\t\t\t$count > 0 ? $pR1 : 0,\n\t\t\t\t\tmin($count,$pR2),\n\t\t\t\t\t$count);\n\t\t\t}\n\t\t\t$resultCountMsg = $this->cObj->wrap($resultCountMsg,$wrapper['showResultsWrap']);\n\t\t\t\n\t\t} else {\n\t\t\t$resultCountMsg = '';\n\t\t}\n\n\t\t$sTables = $this->cObj->wrap($theLinks.$resultCountMsg,$wrapper['browseBoxWrap']);\n\n\t\treturn $sTables;\n\t}",
"public static function close(){\n\t\t// do stuff\n\t\treturn ['success' => true, 'data' => null];\n\t}",
"public function close_output() {\n echo \"</body></html>\";\n }",
"public function close() {\n\t\tif ($this->queryresult != \"\")\n\t\t\tmysql_free_result($this->queryresult);\n\t\tmysql_close();\n\t}",
"public function isGetPagePreProcessCalledCallback() {}",
"protected function handleResultRequest() {\n\t\t// no longer letting people in without these things. If this is\n\t\t// preventing you from doing something, you almost certainly want to be\n\t\t// somewhere else.\n\t\t$deadSession = false;\n\t\tif ( !$this->adapter->session_hasDonorData() ) {\n\t\t\t$deadSession = true;\n\t\t}\n\t\t$oid = $this->adapter->getData_Unstaged_Escaped( 'order_id' );\n\n\t\t$request = $this->getRequest();\n\t\t$referrer = $request->getHeader( 'referer' );\n\t\t$liberated = false;\n\t\tif ( $this->adapter->session_getData( 'order_status', $oid ) === 'liberated' ) {\n\t\t\t$liberated = true;\n\t\t}\n\n\t\t// XXX need to know whether we were in an iframe or not.\n\t\tglobal $wgServer;\n\t\tif ( $this->isReturnFramed() && ( strpos( $referrer, $wgServer ) === false ) && !$liberated ) {\n\t\t\t$sessionOrderStatus = $request->getSessionData( 'order_status' );\n\t\t\t$sessionOrderStatus[$oid] = 'liberated';\n\t\t\t$request->setSessionData( 'order_status', $sessionOrderStatus );\n\t\t\t$this->logger->info( \"Resultswitcher: Popping out of iframe for Order ID \" . $oid );\n\t\t\t$this->getOutput()->allowClickjacking();\n\t\t\t$this->getOutput()->addModules( 'iframe.liberator' );\n\t\t\treturn;\n\t\t}\n\n\t\t$this->setHeaders();\n\t\t$userAgent = $request->getHeader( 'User-Agent' );\n\t\tif ( !$userAgent ) {\n\t\t\t$userAgent = 'Unknown';\n\t\t}\n\n\t\tif ( $this->isRepeatReturnProcess() ) {\n\t\t\t$this->logger->warning(\n\t\t\t\t'Donor is trying to process an already-processed payment. ' .\n\t\t\t\t\"Adapter Order ID: $oid.\\n\" .\n\t\t\t\t\"Cookies: \" . print_r( $_COOKIE, true ) . \"\\n\" .\n\t\t\t\t\"User-Agent: \" . $userAgent\n\t\t\t);\n\t\t\t$this->displayThankYouPage( 'repeat return processing' );\n\t\t\treturn;\n\t\t}\n\n\t\tif ( $deadSession ) {\n\t\t\tif ( $this->adapter->isReturnProcessingRequired() ) {\n\t\t\t\twfHttpError( 403, 'Forbidden', wfMessage( 'donate_interface-error-http-403' )->text() );\n\t\t\t\tthrow new RuntimeException(\n\t\t\t\t\t'Resultswitcher: Request forbidden. No active donation in the session. ' .\n\t\t\t\t\t\"Adapter Order ID: $oid.\\n\" .\n\t\t\t\t\t\"Cookies: \" . print_r( $_COOKIE, true ) . \"\\n\" .\n\t\t\t\t\t\"User-Agent: \" . $userAgent\n\t\t\t\t);\n\t\t\t}\n\t\t\t// If it's possible for a donation to go through without our\n\t\t\t// having to do additional processing in the result switcher,\n\t\t\t// we don't want to falsely claim it failed just because we\n\t\t\t// lost the session data. We also don't want to give any\n\t\t\t// information to scammers hitting this page with no session,\n\t\t\t// so we always show the thank you page. We don't want to do\n\t\t\t// any post-processing if we're not sure whether we actually\n\t\t\t// originated this attempt, so we return right after.\n\t\t\t$this->logger->warning(\n\t\t\t\t'Resultswitcher: session is dead, but the ' .\n\t\t\t\t'donor may have made a successful payment.'\n\t\t\t);\n\t\t\t$this->displayThankYouPage( 'dead session' );\n\t\t\treturn;\n\t\t}\n\t\t$this->logger->info( \"Resultswitcher: OK to process Order ID: \" . $oid );\n\n\t\tif ( $this->adapter->checkTokens() ) {\n\t\t\t// feed processDonorReturn all the GET and POST vars\n\t\t\t$requestValues = $this->getRequest()->getValues();\n\t\t\t$result = $this->adapter->processDonorReturn( $requestValues );\n\t\t\t$this->markReturnProcessed();\n\t\t\t$this->renderResponse( $result );\n\t\t\treturn;\n\t\t} else {\n\t\t\t$this->logger->error( \"Resultswitcher: Token Check Failed. Order ID: $oid\" );\n\t\t}\n\t\t$this->displayFailPage();\n\t}",
"function finish(){\r\n\t}",
"function end_process() {\n global $body, $page, $form, $head, $menu, $foot, $msg, $error, $link, $list;\n\n /* template processing */\n $body->set(\"message\", $msg);\n $body->set(\"error\", $error);\n $body->set(\"link\", $link);\n $body->set(\"list\", $list);\n\n $body->set(\"form\", $form);\n $page->set(\"head\", $head);\n $page->set(\"menu\", $menu);\n $page->set(\"foot\", $foot);\n $page->set(\"body\", $body);\n echo $page->fetch();\n\n @Mysql::getInstance()->disconnect();\n exit(0);\n}",
"function ifx_do($result_id)\n{\n}",
"public function endPageJS() {}",
"public function streamClosed();",
"private function doRs()\n\t{\n//\t\tprint $this->getStart().'-'.$this->getRowsPerPage();\n\t\tif(!isset($this->rs))\n\t\t{\n\t\t\t$this->criteria->setOffset($this->getStart());\n\t\t\t$this->criteria->setLimit($this->getRowsPerPage());\n\t\t\t$this->rs = call_user_func_array(\n\t\t\t\tarray(\n\t\t\t\t\t$this->getPeerClass(), \n\t\t\t\t\t$this->getPeerSelectMethod()\n\t\t\t\t), \n\t\t\t\tarray(\n\t\t\t\t\t$this->criteria,\n\t\t\t\t\t$this->con\n\t\t\t\t)\n\t\t\t);\n//\t\t\tCommon::printArray(BasePeer::createSelectSql($this->criteria,$temp=array()));\n//\t\t\tCommon::printArray($this->rs);\n\t\t\t$this->currentCount = count($this->rs);\n\t\t}\n\t}",
"function display_browse_result($browse_result)\n {\n $db = DataAccess::getInstance();\n if ($browse_result->RecordCount() > 0) {\n $browse_result->Move(0);\n $link_text = \"<a href=\" . $this->configuration_data['classifieds_file_name'] . \"?a=25&b=\" . $this->site_category . \"&c=\";\n\n //display the ads inside of this category\n $this->body .= \"<tr>\\n\\t<td height=20>\\n\\t\";\n $this->body .= \"<table cellpadding=3 cellspacing=1 border=0 align=center width=\\\"100%\\\">\\n\\t\";\n $this->body .= \"<tr class=\\\"column_headers\\\">\\n\\t\\t\";\n\n if ($this->seller_configuration_data->MODULE_DISPLAY_USERNAME) {\n $this->body .= \"<td>\" . $this->messages[1963] . \"</td>\\n\\t\";\n }\n\n\n\n if ($this->seller_configuration_data->MODULE_DISPLAY_BUSINESS_TYPE) {\n// $this->body .=\"<td>\".$link_text;\n// if ($this->browse_type == 43) $this->body .= \"44\";\n// elseif ($this->browse_type == 44) $this->body .= \"0\";\n// else $this->body .= \"43\";\n// $this->body .= \" class=\\\"column_headers\\\">\".$this->messages[1954].\"</a></td>\\n\\t\";\n\n $this->body .= \"<td>\" . $this->messages[1954] . \"</td>\\n\\t\";\n }\n\n if ($this->seller_configuration_data->MODULE_DISPLAY_COMPANY_NAME) {\n $this->body .= \"<td>\" . $this->messages[500023] . \"</td>\\n\\t\";\n }\n\n if ($this->seller_configuration_data->MODULE_DISPLAY_NAME) {\n $this->body .= \"<td>\" . $this->messages[1955] . \"</td>\\n\\t\";\n }\n if ($this->seller_configuration_data->MODULE_DISPLAY_OPTIONAL_FIELD_1) {\n $this->body .= \"<td >\" . $this->messages[1965] . \"</td>\\n\\t\";\n }\n if ($this->seller_configuration_data->MODULE_DISPLAY_OPTIONAL_FIELD_2) {\n $this->body .= \"<td >\" . $this->messages[1966] . \"</td>\\n\\t\";\n }\n\n if ($this->seller_configuration_data->MODULE_DISPLAY_OPTIONAL_FIELD_3) {\n $this->body .= \"<td >\" . $this->messages[1967] . \"</td>\\n\\t\";\n }\n\n if ($this->seller_configuration_data->MODULE_DISPLAY_OPTIONAL_FIELD_4) {\n $this->body .= \"<td >\" . $this->messages[1968] . \"</td>\\n\\t\";\n }\n\n if ($this->seller_configuration_data->MODULE_DISPLAY_OPTIONAL_FIELD_5) {\n $this->body .= \"<td >\" . $this->messages[1969] . \"</td>\\n\\t\";\n }\n\n if ($this->seller_configuration_data->MODULE_DISPLAY_OPTIONAL_FIELD_6) {\n $this->body .= \"<td >\" . $this->messages[1970] . \"</td>\\n\\t\";\n }\n\n if ($this->seller_configuration_data->MODULE_DISPLAY_OPTIONAL_FIELD_7) {\n $this->body .= \"<td >\" . $this->messages[1971] . \"</td>\\n\\t\";\n }\n\n if ($this->seller_configuration_data->MODULE_DISPLAY_OPTIONAL_FIELD_8) {\n $this->body .= \"<td >\" . $this->messages[1972] . \"</td>\\n\\t\";\n }\n\n if ($this->seller_configuration_data->MODULE_DISPLAY_OPTIONAL_FIELD_9) {\n $this->body .= \"<td >\" . $this->messages[1973] . \"</td>\\n\\t\";\n }\n\n if ($this->seller_configuration_data->MODULE_DISPLAY_OPTIONAL_FIELD_10) {\n $this->body .= \"<td >\" . $this->messages[1974] . \"</td>\\n\\t\";\n }\n if ($this->seller_configuration_data->MODULE_DISPLAY_ADDRESS) {\n $this->body .= \"<td >\" . $this->messages[1964] . \"</td>\\n\\t\";\n }\n if ($this->seller_configuration_data->MODULE_DISPLAY_CITY) {\n $this->body .= \"<td>\" . $this->messages[1956] . \"</td>\\n\\t\";\n }\n if ($this->seller_configuration_data->MODULE_DISPLAY_STATE) {\n $this->body .= \"<td>\" . $this->messages[1957] . \"</td>\\n\\t\";\n }\n if ($this->seller_configuration_data->MODULE_DISPLAY_COUNTRY) {\n $this->body .= \"<td>\" . $this->messages[1958] . \"</td>\\n\\t\";\n }\n if ($this->seller_configuration_data->MODULE_DISPLAY_ZIP) {\n $this->body .= \"<td>\" . $this->messages[1959] . \"</td>\\n\\t\";\n }\n if ($this->seller_configuration_data->MODULE_DISPLAY_PHONE1) {\n $this->body .= \"<td >\" . $this->messages[1975] . \"</td>\\n\\t\";\n }\n if ($this->seller_configuration_data->MODULE_DISPLAY_PHONE2) {\n $this->body .= \"<td >\" . $this->messages[1976] . \"</td>\\n\\t\";\n }\n\n $this->body .= \"</tr>\\n\\t\";\n\n $this->row_count = 0;\n while ($show_classifieds = $browse_result->FetchNextObject()) {\n if (($this->row_count % 2) == 0) {\n $css_class_tag = \"browsing_result_table_body_even \";\n } else {\n $css_class_tag = \"browsing_result_table_body_odd \";\n }\n $this->body .= \"<tr class=\" . $css_class_tag . \">\\n\\t\\t\";\n $seller_data = $this->get_user_data($show_classifieds->SELLER);\n\n $link = \"<a href=\\\"{$this->configuration_data['classifieds_file_name']}?a=6&b={$show_classifieds->SELLER}\\\">\";\n\n //display username\n if ($this->seller_configuration_data->MODULE_DISPLAY_USERNAME) {\n $this->body .= \"<td >$link\" . $seller_data->USERNAME . \"</a></td>\\n\\t\";\n }\n\n //display company type\n if ($this->seller_configuration_data->MODULE_DISPLAY_BUSINESS_TYPE) {\n// $this->body .=\"<td>\";\n// if ($seller_data->BUSINESS_TYPE == 1)\n// $this->body .= $this->messages[10010];\n// elseif ($seller_data->BUSINESS_TYPE == 2)\n// $this->body .= $this->messages[10009];\n// else\n// $this->body .= \" \";\n// $this->body .= \"</td>\\n\\t\";\n\n $this->body .= \"<td>\";\n if ($seller_data->BUSINESS_TYPE == 1) {\n $this->body .= $this->messages[1961];\n } elseif ($seller_data->BUSINESS_TYPE == 2) {\n $this->body .= $this->messages[1960];\n } else {\n $this->body .= \" \";\n }\n $this->body .= \"</td>\\n\\t\";\n }\n\n //display company name\n if ($this->seller_configuration_data->MODULE_DISPLAY_COMPANY_NAME) {\n $this->body .= \"<td>$link\" . stripslashes($seller_data->COMPANY_NAME) . \"</a></td>\\n\\t\";\n }\n\n //display name\n if ($this->seller_configuration_data->MODULE_DISPLAY_NAME) {\n $this->body .= \"<td>$link\" . stripslashes($seller_data->FIRSTNAME) . \" \" . stripslashes($seller_data->LASTNAME) . \"</a></td>\\n\\t\";\n }\n\n if ($this->seller_configuration_data->MODULE_DISPLAY_OPTIONAL_FIELD_1) {\n $this->body .= \"<td >\" . stripslashes($seller_data->OPTIONAL_FIELD_1) . \"</td>\\n\\t\";\n }\n\n if ($this->seller_configuration_data->MODULE_DISPLAY_OPTIONAL_FIELD_2) {\n $this->body .= \"<td >\" . stripslashes($seller_data->OPTIONAL_FIELD_2) . \"</td>\\n\\t\";\n }\n\n if ($this->seller_configuration_data->MODULE_DISPLAY_OPTIONAL_FIELD_3) {\n $this->body .= \"<td >\" . stripslashes($seller_data->OPTIONAL_FIELD_3) . \"</td>\\n\\t\";\n }\n\n if ($this->seller_configuration_data->MODULE_DISPLAY_OPTIONAL_FIELD_4) {\n $this->body .= \"<td >\" . stripslashes($seller_data->OPTIONAL_FIELD_4) . \"</td>\\n\\t\";\n }\n\n if ($this->seller_configuration_data->MODULE_DISPLAY_OPTIONAL_FIELD_5) {\n $this->body .= \"<td >\" . stripslashes($seller_data->OPTIONAL_FIELD_5) . \"</td>\\n\\t\";\n }\n\n if ($this->seller_configuration_data->MODULE_DISPLAY_OPTIONAL_FIELD_6) {\n $this->body .= \"<td >\" . stripslashes($seller_data->OPTIONAL_FIELD_6) . \"</td>\\n\\t\";\n }\n\n if ($this->seller_configuration_data->MODULE_DISPLAY_OPTIONAL_FIELD_7) {\n $this->body .= \"<td >\" . stripslashes($seller_data->OPTIONAL_FIELD_7) . \"</td>\\n\\t\";\n }\n\n if ($this->seller_configuration_data->MODULE_DISPLAY_OPTIONAL_FIELD_8) {\n $this->body .= \"<td >\" . stripslashes($seller_data->OPTIONAL_FIELD_8) . \"</td>\\n\\t\";\n }\n\n if ($this->seller_configuration_data->MODULE_DISPLAY_OPTIONAL_FIELD_9) {\n $this->body .= \"<td >\" . stripslashes($seller_data->OPTIONAL_FIELD_9) . \"</td>\\n\\t\";\n }\n\n if ($this->seller_configuration_data->MODULE_DISPLAY_OPTIONAL_FIELD_10) {\n $this->body .= \"<td >\" . stripslashes($seller_data->OPTIONAL_FIELD_10) . \"</td>\\n\\t\";\n }\n\n //display address\n if ($this->seller_configuration_data->MODULE_DISPLAY_ADDRESS) {\n $this->body .= \"<td >\" . stripslashes($seller_data->ADDRESS) . \" \" . stripslashes($seller_data->ADDRESS_2) . \"</td>\\n\\t\";\n }\n\n //display city\n if ($this->seller_configuration_data->MODULE_DISPLAY_CITY) {\n $this->body .= \"<td >\" . stripslashes($seller_data->CITY) . \"</td>\\n\\t\";\n }\n\n //display state\n if ($this->seller_configuration_data->MODULE_DISPLAY_STATE) {\n $this->body .= \"<td >\" . stripslashes($seller_data->STATE) . \"</td>\\n\\t\";\n }\n\n //display country\n if ($this->seller_configuration_data->MODULE_DISPLAY_COUNTRY) {\n $this->body .= \"<td >\" . stripslashes($seller_data->COUNTRY) . \"</td>\\n\\t\";\n }\n\n //display zip\n if ($this->seller_configuration_data->MODULE_DISPLAY_ZIP) {\n $this->body .= \"<td >\" . stripslashes($seller_data->ZIP) . \"</td>\\n\\t\";\n }\n\n //display phone\n if ($this->seller_configuration_data->MODULE_DISPLAY_PHONE1) {\n $this->body .= \"<td >\" . stripslashes($seller_data->PHONE) . \"</td>\\n\\t\";\n }\n\n //display phone2\n if ($this->seller_configuration_data->MODULE_DISPLAY_PHONE2) {\n $this->body .= \"<td >\" . stripslashes($seller_data->PHONE2) . \"</td>\\n\\t\";\n }\n\n $this->body .= \"</tr>\\n\\t\";\n $this->row_count++;\n } //end of while\n $this->body .= \"</table>\\n\\t</td>\\n</tr>\\n\";\n } else {\n //no classifieds in this category\n $this->body .= \"<tr class=\\\"no_sellers_in_category\\\">\\n\\t<td >\\n\\t\" . $this->messages[1962] . \"\\n\\t</td>\\n</tr>\\n\";\n }\n return;\n }",
"function renderBrowseResults($resultcount, $pointer, $listLength) {\n\t\t$listCode = tslib_CObj::getSubpart($this->fileContent, '###BROWSERESULTLIST###');\n\t\t$listElem = tslib_CObj::getSubpart($listCode, '###BROWSERESULT_ENTRY###');\n\n\t\tif ($listLength == 1) {\n\t\t\t//correction if listLength = 1, then we must subtract one page (even if a listlength of 1 makes no sense)\n\t\t\t$limiter = 1;\n\t\t}\n\t\telse {\n\t\t\t$limiter = 0;\n\t\t}\n\t\t// get the number of pages of the browseresult\n\t\t$noOfPages = intval($resultcount / $listLength) - $limiter;\n\t\t$piVarsCurrent = $this->piVars;\n\t\t// disable temporaly the piVars to prevent that the view is resetted\n\t\tunset ($this->piVars['catPlus_Rec']);\n\t\tunset ($this->piVars['catPlus']);\n\t\tunset ($this->piVars['catMinus']);\n\t\tunset ($this->piVars['catMinus_Rec']);\n\t\tunset ($this->piVars['catAll']);\n\t\tunset ($this->piVars['catEquals']);\n\t\tunset ($this->piVars['confirmDeleteUID']);\n\t\tunset ($this->piVars['editUID']);\n\t\tunset ($this->piVars['catEditUID']);\n\t\tunset ($this->piVars['pointer']);\n\t\tunset ($this->piVars['treeID']);\n\t\tunset ($this->piVars['msg']);\n\t\tunset ($this->piVars['level0']);\n\t\t$param_array = array();\n\t\tforeach ((array)$this->piVars as $piVar => $value) {\n\t\t\t$param_array['tx_damfrontend_pi1[' . $piVar . ']'] = $value;\n\t\t}\n\n\n\t\t$this->conf['filelist.']['browselink.']['typolink.']['additionalParams'] .= t3lib_div::implodeArrayForUrl('', $param_array);\n\n\t\t$cObj = $this->cObj;\n\n\t\tif ($resultcount % $listLength == 0) $noOfPages = $noOfPages - 1 + $limiter;\n\n\t\tfor ($z = 0; $z <= $noOfPages; $z++) {\n\t\t\tif ($z == $pointer) {\n\t\t\t\t// this is the current page\n\t\t\t\t$listElems .= tslib_CObj::substituteMarker($listElem, '###BROWSELINK###', $this->cObj->stdWrap($z + 1, $this->conf['filelist.']['browselinkCurrent.']));\n\t\t\t\tif ($this->conf['filelist.']['browselink.']['browselinkUsePrevNext'] == 1) {\n\t\t\t\t\t// previous link\n\t\t\t\t\tif ($z > 0) {\n\t\t\t\t\t\t$param_array['tx_damfrontend_pi1[pointer]'] = ($z - 1);\n\t\t\t\t\t\t$this->conf['filelist.']['browselinkPrev.']['typolink.']['additionalParams'] .= t3lib_div::implodeArrayForUrl('', $param_array);\n\t\t\t\t\t\t$listElemsPrevious .= tslib_CObj::substituteMarker($listElem, '###BROWSELINK###', $cObj->stdWrap($z + 1, $this->conf['filelist.']['browselinkPrev.']));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t//we are the first, so show only the label\n\t\t\t\t\t\t$listElemsPrevious = tslib_CObj::substituteMarker($listElem, '###BROWSELINK###', $this->cObj->stdWrap($this->pi_getLL('BROWSELINK_PREV'), $this->conf['filelist.']['browselinkFirst.']));\n\t\t\t\t\t}\n\t\t\t\t\tif ($z == $noOfPages) {\n\t\t\t\t\t\t//we are the the last page, so show only the label\n\t\t\t\t\t\t$listElemsNext = tslib_CObj::substituteMarker($listElem, '###BROWSELINK###', $this->cObj->stdWrap($this->pi_getLL('BROWSELINK_NEXT'), $this->conf['filelist.']['browselinkLast.']));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$param_array['tx_damfrontend_pi1[pointer]'] = ($z + 1);\n\t\t\t\t\t\t$this->conf['filelist.']['browselinkNext.']['typolink.']['additionalParams'] .= t3lib_div::implodeArrayForUrl('', $param_array);\n\t\t\t\t\t\t$listElemsNext .= tslib_CObj::substituteMarker($listElem, '###BROWSELINK###', $cObj->stdWrap($z + 1, $this->conf['filelist.']['browselinkNext.']));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// link to other result pages\n\t\t\t\t$param_array['tx_damfrontend_pi1[pointer]'] = $z;\n\t\t\t\t$this->conf['filelist.']['browselink.']['typolink.']['additionalParams'] .= t3lib_div::implodeArrayForUrl('', $param_array);\n\t\t\t\t$listElems .= tslib_CObj::substituteMarker($listElem, '###BROWSELINK###', $cObj->stdWrap($z + 1, $this->conf['filelist.']['browselink.']));\n\t\t\t}\n\t\t}\n\t\t$listElems = $listElemsPrevious . $listElems . $listElemsNext;\n\t\t$listCode = tslib_CObj::substituteSubpart($listCode, '###BROWSERESULT_ENTRY###', $listElems);\n\t\t$listCode = $this->cObj->stdWrap($listCode, $this->conf['filelist.']['browselink.']['resultList.']);\n\t\tunset($this->piVars['pointer']);\n\t\t$this->piVars = $piVarsCurrent;\n\t\treturn $listCode;\n\t}",
"public function get_results()\n {\n }",
"public function ProcessAjax()\n {\n exit; // <<----------- this should exit\n }",
"public function loadNextPage()\n {\n $nextPage = $this->results->getNextPage();\n $this->search($nextPage);\n }",
"public function get_results()\n {\n }",
"public function listing() {\n $this->response->setData(1);\r\n $this->response->setHeader('__OK', Http::Response(Http::OK));\r\n return TRUE;\r\n }",
"public function execute()\n\t{\n\t\t$isAjax = $this->getRequest()->isAjax();\n\t\tif ($isAjax){\n\t\t\t$layout = $this->_layout;\n\t\t\t$layout->getUpdate()->load(['listingtabs_index_ajax']);\n\t\t\t$layout->generateXml();\n $output = $layout->getOutput();\n $this->getResponse()->setHeader('Content-type', 'application/json');\n\t\t\tdie($this->jsonEncoder->encode(array('items_markup' => $output)));\n }\n\t\t$resultPage = $this->resultPageFactory->create();\n\t\t$resultPage->getConfig()->getTitle()->prepend(__('SM Listing Tabs'));\n\t\treturn $resultPage;\n\t}",
"function pi_list_browseresults($showResultCount = 1, $divParams = '', $spacer = false, $total_bodycount = 0) {\n\t\t\t// Initializing variables:\n\t\t$pointer = intval($this->piVars['pointer']);\n\t\t$count = $this->internal['res_count'];\n\t\t$results_at_a_time = t3lib_div::intInRange($this->internal['results_at_a_time'],1,1000);\n\t\t$maxPages = t3lib_div::intInRange($this->internal['maxPages'],1,100);\n\n\t\t$pR1 = $pointer * $results_at_a_time + 1;\n\t\t$pR2 = $pointer * $results_at_a_time + $results_at_a_time;\n\n\t\t$max = t3lib_div::intInRange(ceil($count/$results_at_a_time), 1, $maxPages);\n\n\n\t\t$links=array();\n\n\t\t\t// Make browse-table/links:\n\t\tif ($this->pi_alwaysPrev>=0) {\n\t\t\tif ($pointer > 0) {\n\t\t\t\t$links[] = $this->pi_linkTP_keepPIvars($this->pi_getLL('pi_list_browseresults_prev','< Previous',TRUE),array('pointer'=>($pointer-1 ? $pointer-1 : '')), 1);\n\t\t\t} elseif ($this->pi_alwaysPrev) {\n\t\t\t\t$links[] = $this->pi_getLL('pi_list_browseresults_prev','< Previous',TRUE);\n\t\t\t}\n\t\t}\n\n\t\tif ($max > 1) {\n\t\t\tif ($pointer >= $maxPages - 2) {\n\t\t\t\t$a = (integer) ($pointer - ($maxPages/2));\n\t\t\t} else {\n\t\t\t\t$a = 0;\n\t\t\t}\n\t\t\tif ($a < 0) {\n\t\t\t\t$a = 0;\n\t\t\t}\n\t\t\t// in order to have a correct value for $max we must include the value of the actual $pointer in the calculation\n\t\t\tfor($i=0; $i<$max; $i++) {\n\t\t\t\t$temp_links = array();\n\t\t\t\t// check that the starting point (equivalent of $pR1) doesn't exceed the total $count\n\t\t\t\tif($a * $results_at_a_time + 1 > $count){\n\t\t\t\t\t$i = $max; //quitt!!!\n\t\t\t\t}else{\n\t\t\t\t\t$temp_links[] = '';\n\t\t\t\t\t//beginning:\n\t\t\t\t\tif($pointer == $a){\n\t\t\t\t\t\t$temp_links[] .= '<span '.$this->pi_classParam('browsebox-SCell').'><strong>';\n\t\t\t\t\t}\n\t\t\t\t\t$temp_links[] .= $this->pi_linkTP_keepPIvars(trim($this->pi_getLL('pi_list_browseresults_page', 'Page', TRUE).' '.($a + 1)), array('pointer' => ( $a ? $a : '' )), 1);\n\t\t\t\t\t//ending:\n\t\t\t\t\tif($pointer == $a){\n\t\t\t\t\t\t$temp_links[] .= '</strong></span>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$a++;\n\t\t\t\t$links[] = implode('', $temp_links);\n\t\t\t}// end foreach\n\t\t}// end if max\n\n\t\t// neither $pointer nor the number-link ($a) must exceed the result of the calculation below!\n\t\tif ($pointer < ceil($count/$results_at_a_time)-1) {\n\t\t\t$links[] = $this->pi_linkTP_keepPIvars($this->pi_getLL('pi_list_browseresults_next','Next >',TRUE), array('pointer' => $pointer+1),1);\n\t\t}\n\t$sBox = '';\n\n\t\t$sBox .= '<!-- List browsing box: -->\n\t\t\t\t\t<div'.$this->pi_classParam('browsebox').'>';\n\t\tif($showResultCount){\n\t\t\t$sBox .= '<p>'; //paragraph for 'elements 1 to 20'\n\t\t\tif($this->internal['res_count']){\n\t\t\t\t$from_number = $this->internal['res_count'] > 0 ? $pR1 : 0;\n\t\t\t\t$to_number = min(array($this->internal['res_count'], $pR2));\n\n\n\t\t\t\t// don't know why I need this, found out by trial and error\n\t\t\t\tif($total_bodycount > 0 && !$this->piVars['char']){\n\t\t\t\t\t$to_number -= $total_bodycount;\n\t\t\t\t}\n\n\t\t\t\t$sBox .= sprintf(\n str_replace(\n\t\t\t\t\t\t\t\t\t\t\t'###SPAN_BEGIN###',\n\t\t\t\t\t\t\t\t\t\t\t'<span'.$this->pi_classParam('browsebox-strong').'>',\n\t\t\t\t\t\t\t\t\t\t\t$this->pi_getLL('pi_list_browseresults_displays', 'Displaying results ###SPAN_BEGIN###%s to %s</span> out of ###SPAN_BEGIN###%s</span>')\n\t\t\t\t\t\t\t\t\t\t),\n $from_number,\n\t\t\t\t\t\t\t\t\t\t//to (must substract local_bodycount here!!!)\n $to_number,\n //of a total of\n $this->internal['res_count']\n );\n\n\n\n\t\t\t}else{\n\t\t\t\t$sBox .= $this->pi_getLL('pi_list_browseresults_noResults','Sorry, no items were found.');\n\t\t\t}\n\t\t\t$sBox .= '</p>';\n\t\t}\n\t\t$sBox .= '<'.trim('p '.$divParams).'>'.implode($spacer, $links).'</p>';\n\t\t$sBox .= '</div>';\n\t\treturn $sBox;\n\t}",
"function Page_Terminate($url = \"\") {\r\r\tglobal $conn;\r\r\r\r\t// Page unload event, used in current page\r\r\tPage_Unload();\r\r\r\r\t// Global page unloaded event (in userfn*.php)\r\r\tPage_Unloaded();\r\r\r\r\t // Close Connection\r\r\t$conn->Close();\r\r\r\r\t// Go to url if specified\r\r\tif ($url <> \"\") {\r\r\t\tob_end_clean();\r\r\t\theader(\"Location: $url\");\r\r\t}\r\r\texit();\r\r}",
"public function end()\n {\n }",
"function close()\n {\n return 0;\n }",
"function seekPageInRecSet()\n\t{\n\t\t\n\t\t$this->resultData = $this->plugin->getGroupList( $this->searchClauseObj->getAllFieldsSearchValue() );\n\t\t$this->numRowsFromSQL = $this->resultData ? count( $this->resultData ) : 0;\n\t\t$this->recSet = $this->numRowsFromSQL;\n\t}",
"public function proceed()\n {\n }",
"function main()\n{\n //getRequestidhl();\n\t //getRequestidlap();\n\t getRequestidpl();\n\n\t\n}",
"public function doneAction()\n\t{\n\t\n\t}",
"public function closeCursor()\n {\n }",
"function end_amy_request()\n\t{\n\t\tDb::close_connection();\n\t}",
"function results()\n\t{\n\t\treturn null;\n\t}",
"abstract protected function renderComplete();",
"public function execute()\n {\n return $this->resultFactory->create(ResultFactory::TYPE_PAGE);\n }",
"public function startNewPage()\n {\n }"
] | [
"0.64441043",
"0.62756723",
"0.62633646",
"0.59221476",
"0.58350265",
"0.579203",
"0.5670952",
"0.5645398",
"0.56226367",
"0.5609703",
"0.55577624",
"0.55370647",
"0.55370647",
"0.55370647",
"0.55370647",
"0.5522437",
"0.5482688",
"0.5418413",
"0.54152465",
"0.5412134",
"0.5412134",
"0.54049426",
"0.53638214",
"0.5360453",
"0.53293073",
"0.5324841",
"0.5317463",
"0.53139013",
"0.5304301",
"0.5284631",
"0.52702385",
"0.52632505",
"0.52632505",
"0.52632505",
"0.5259708",
"0.5254155",
"0.52468",
"0.52468",
"0.5244873",
"0.52265537",
"0.52257663",
"0.52229685",
"0.5220478",
"0.5217042",
"0.52167577",
"0.5207796",
"0.52058834",
"0.51921016",
"0.5188167",
"0.5174432",
"0.51694965",
"0.5147775",
"0.51425016",
"0.5138982",
"0.5138248",
"0.51380485",
"0.5133618",
"0.51333433",
"0.5133",
"0.5133",
"0.5133",
"0.5133",
"0.5133",
"0.5132881",
"0.5132163",
"0.51272416",
"0.51244247",
"0.5117405",
"0.51144254",
"0.5114388",
"0.5112914",
"0.5112292",
"0.51091987",
"0.5107849",
"0.50788146",
"0.50682634",
"0.50602645",
"0.5058933",
"0.5056275",
"0.5051971",
"0.504413",
"0.5036615",
"0.5036163",
"0.50358254",
"0.50356823",
"0.5020373",
"0.501421",
"0.5013413",
"0.50133514",
"0.5006034",
"0.50007904",
"0.4995897",
"0.499261",
"0.4987947",
"0.4981499",
"0.4981227",
"0.49637848",
"0.49619806",
"0.49596283",
"0.4958282",
"0.49552435"
] | 0.0 | -1 |
/ Description Function is fetch prescriptions from api Author Dave Brown Created 11 December 2014 | public function get_prescription ($appointment_hash = NULL)
{
$page_data = NULL;
$prescriptions_arr = array();
if (get_data('term') == NULL)
{
return;
}
/*Fetching Patient details from third party database via curl request*/
$prescriptions = post_curl_request(THIRD_PARTY_API_URL, json_encode(array(
'action' => 'getformulary',
'lookfor' => get_data('term'),
)));
$prescriptions = !empty($prescriptions) ? json_decode($prescriptions) : array();
/*Converting to autocomplete understandable format*/
if (!empty($prescriptions))
{
foreach ($prescriptions as $val)
{
$prescriptions_arr[] = array('id' => current($val)->vpid, 'value' => current($val)->nm, 'unit_price' => current($val)->UnitPrice);
}
}
exit(json_encode($prescriptions_arr));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSubscriptions ()\n {\n try\n {\n $result = $this->apiCall('get',\"{$this->api['cms_manager_url']}/resources/subscriptions.json\",array(),'json');\n return $this->createResponse($result,'get My Subscriptions');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }",
"function getAllNews()\n{ \n\t $pubdate_params = array ( \n \"arg0\" => APPTIVO_BUSINESS_API_KEY,\n \"arg1\" => APPTIVO_BUSINESS_ACCESS_KEY\n\t );\n\t $plugin_params = array ( \n \"arg0\" => APPTIVO_BUSINESS_API_KEY,\n\t \"arg1\" => APPTIVO_BUSINESS_ACCESS_KEY\n );\n \n $response = get_data(APPTIVO_BUSINESS_SERVICES,'-news-publisheddate','-news-data','getLastPublishDate','getAllNews',$pubdate_params,$plugin_params);\n return $response;\n}",
"public function index()\n {\n $user = Auth::user(); \n\n $prescription = DB::table('prescriptions')->get()->toArray();\n\n return response($prescription, 201);\n }",
"public function viewprescriptions(){\n \n $prescriptions_table = TableRegistry::get('Prescriptions');\n $prescriptions = $prescriptions_table->find()->contain(['Users','Patients','Diagnosisreports','Labtests'])\n ->order(['creation_timestamp'=>'Desc']);\n $this->set('prescriptions', $prescriptions);\n $this->viewBuilder()->setLayout('backend');\n }",
"public function getSubscriptions();",
"public function prescriptionsDataSummary()\n {\n $prescriptions = Prescription::where('date', 'like', Carbon::now()->format('Y-m-') . \"%\")->get();\n $prescriptionBills = $prescriptions->whereIn('status', [Prescriptions::PENDING_PRESCRIPTION, Prescriptions::CONFIRMED_PRESCRIPTION])->count();\n $internalPrescriptions = $prescriptions->where('status', Prescriptions::NEW_PRESCRIPTION)->count();\n $paidPrescriptions = $prescriptions->where('status', Prescriptions::PAID_PRESCRIPTION)->count();\n return ResponseHelper::findSuccess('Explorations Data', [\n 'total_prescriptions' => $prescriptions->count(),\n 'prescription_bills' => $prescriptionBills,\n 'internal_prescriptions' => $internalPrescriptions,\n 'paid_prescriptions' => $paidPrescriptions\n ]);\n }",
"function wcs_get_subscriptions( $args ) {\n\tglobal $wpdb;\n\n\t$args = wp_parse_args( $args, array(\n\t\t\t'subscriptions_per_page' => 10,\n\t\t\t'paged' => 1,\n\t\t\t'offset' => 0,\n\t\t\t'orderby' => 'start_date',\n\t\t\t'order' => 'DESC',\n\t\t\t'customer_id' => 0,\n\t\t\t'product_id' => 0,\n\t\t\t'variation_id' => 0,\n\t\t\t'order_id' => 0,\n\t\t\t'subscription_status' => array( 'any' ),\n\t\t\t'meta_query_relation' => 'AND',\n\t\t)\n\t);\n\n\t// if order_id is not a shop_order\n\tif ( 0 !== $args['order_id'] && 'shop_order' !== get_post_type( $args['order_id'] ) ) {\n\t\treturn array();\n\t}\n\n\t// Ensure subscription_status is an array.\n\t$args['subscription_status'] = $args['subscription_status'] ? (array) $args['subscription_status'] : array();\n\n\t// Grab the native post stati, removing pending and adding any.\n\t$builtin = get_post_stati( array( '_builtin' => true ) );\n\tunset( $builtin['pending'] );\n\t$builtin['any'] = 'any';\n\n\t// Make sure status starts with 'wc-'\n\tforeach ( $args['subscription_status'] as &$status ) {\n\t\tif ( isset( $builtin[ $status ] ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$status = wcs_sanitize_subscription_status_key( $status );\n\t}\n\n\t// Prepare the args for WP_Query\n\t$query_args = array(\n\t\t'post_type' => 'shop_subscription',\n\t\t'post_status' => $args['subscription_status'],\n\t\t'posts_per_page' => $args['subscriptions_per_page'],\n\t\t'paged' => $args['paged'],\n\t\t'offset' => $args['offset'],\n\t\t'order' => $args['order'],\n\t\t'fields' => 'ids',\n\t\t'meta_query' => isset( $args['meta_query'] ) ? $args['meta_query'] : array(), // just in case we need to filter or order by meta values later\n\t);\n\n\t// Maybe only get subscriptions created by a certain order\n\tif ( 0 != $args['order_id'] && is_numeric( $args['order_id'] ) ) {\n\t\t$query_args['post_parent'] = $args['order_id'];\n\t}\n\n\t// Map subscription specific orderby values to internal/WordPress keys\n\tswitch ( $args['orderby'] ) {\n\t\tcase 'status' :\n\t\t\t$query_args['orderby'] = 'post_status';\n\t\t\tbreak;\n\t\tcase 'start_date' :\n\t\t\t$query_args['orderby'] = 'date';\n\t\t\tbreak;\n\t\tcase 'trial_end_date' :\n\t\tcase 'end_date' :\n\t\t\t// We need to orderby post meta value: http://www.paulund.co.uk/order-meta-query\n\t\t\t$date_type = str_replace( '_date', '', $args['orderby'] );\n\t\t\t$query_args = array_merge( $query_args, array(\n\t\t\t\t'orderby' => 'meta_value',\n\t\t\t\t'meta_key' => wcs_get_date_meta_key( $date_type ),\n\t\t\t\t'meta_type' => 'DATETIME',\n\t\t\t) );\n\t\t\t$query_args['meta_query'][] = array(\n\t\t\t\t'key' => wcs_get_date_meta_key( $date_type ),\n\t\t\t\t'compare' => 'EXISTS',\n\t\t\t\t'type' => 'DATETIME',\n\t\t\t);\n\t\t\tbreak;\n\t\tdefault :\n\t\t\t$query_args['orderby'] = $args['orderby'];\n\t\t\tbreak;\n\t}\n\n\t// Maybe filter to a specific user\n\tif ( 0 != $args['customer_id'] && is_numeric( $args['customer_id'] ) ) {\n\t\t$query_args['meta_query'][] = array(\n\t\t\t'key' => '_customer_user',\n\t\t\t'value' => $args['customer_id'],\n\t\t\t'type' => 'numeric',\n\t\t\t'compare' => ( is_array( $args['customer_id'] ) ) ? 'IN' : '=',\n\t\t);\n\t};\n\n\t// We need to restrict subscriptions to those which contain a certain product/variation\n\tif ( ( 0 != $args['product_id'] && is_numeric( $args['product_id'] ) ) || ( 0 != $args['variation_id'] && is_numeric( $args['variation_id'] ) ) ) {\n\t\t$query_args['post__in'] = wcs_get_subscriptions_for_product( array( $args['product_id'], $args['variation_id'] ) );\n\t}\n\n\tif ( ! empty( $query_args['meta_query'] ) ) {\n\t\t$query_args['meta_query']['relation'] = $args['meta_query_relation'];\n\t}\n\n\t$query_args = apply_filters( 'woocommerce_get_subscriptions_query_args', $query_args, $args );\n\n\t$subscription_post_ids = get_posts( $query_args );\n\n\t$subscriptions = array();\n\n\tforeach ( $subscription_post_ids as $post_id ) {\n\t\t$subscriptions[ $post_id ] = wcs_get_subscription( $post_id );\n\t}\n\n\treturn apply_filters( 'woocommerce_got_subscriptions', $subscriptions, $args );\n}",
"public function _list() {\n\t\t// assign user based on api key\n\t\tif (empty($this->params[0])) {\n\t\t\t$json = [\n\t\t\t\t'error' => 'No channel specified'\n\t\t\t];\n\t\t\treturn $json;\n\t\t}\n\t\t$account = filter_var($this->params[0], FILTER_SANITIZE_STRING);\n\t\t$params = array($account);\n\t\t$sql = \"SELECT * FROM \" . $this->db->sub_table . \" WHERE subscriber = $1 OR host_account = $1\";\n\t\t$result = pg_query_params($this->db->link, $sql, $params);\n\t\t$subscribed = [];\n\t\t$subscribers = [];\n\t\twhile ($row = pg_fetch_assoc($result)) {\n\t\t\tif ($row['host_account'] === $account) {\n\t\t\t\t$subscribers[] = $row['subscriber'];\n\t\t\t} \n\t\t\tif ($row['subscriber'] === $account) {\n\t\t\t\t$subscribed[] = $row['host_account'];\n\t\t\t}\n\t\t}\n\t\t$json = [\n\t\t\t'subscribed' => $subscribed,\n\t\t\t'subscribers' => $subscribers\n\t\t];\n\t\treturn json_encode($json);\n\t}",
"function listActiveSubscriptions(int $pageSize = 50, int $offset = 0){\nreturn $this->get(\"/subscription?pageSize={$pageSize}&offset={$offset}\");\n}",
"function get_subscriberList(){\n return selectQuery(TAB_SUBSCRIBERS, \"\", \"id DESC\");\n}",
"public function getSubscriptions() {\n\t\t$urlSubscriptions = \"http://www.reddit.com/reddits/mine.json\";\n\t\treturn $this->runCurl ( $urlSubscriptions );\n\t}",
"function &subscription_list($start=NULL, $limit=NULL, $direction=0, $where=NULL)\n\n {\n\n global $database, $user;\n\n \n\n\t $message_array = array();\n\n \n\n\t // MAKE SURE MESSAGES ARE ALLOWED\n\n\t $set_sql = \"select currency_sign from se_global_sms where id='1'\";\n\t $set_resource = $database->database_query($set_sql);\n $set_result = $database->database_fetch_assoc($set_resource);\n\t $currency_sign = $set_result[currency_sign];\n\n // BEGIN MESSAGE QUERY\n\n $sql = \"\n\n SELECT\n\n *\n\n FROM\n\n se_subscription\n\n \";\n\n // EXECUTE QUERY\n\n $resource = $database->database_query($sql);\n\n \n\n // GET MESSAGES\n\n\t while( $message_info=$database->database_fetch_assoc($resource) )\n\n {\n\n // CREATE AN OBJECT FOR MESSAGE AUTHOR/RECIPIENT\n\n $pm_user = new SEUser();\n\n $pm_user->user_info['sno'] = $message_info['sno'];\n\n $pm_user->user_info['text'] = $message_info['text'];\n\n $pm_user->user_info['value'] = $message_info['value'];\n\t\n\t $pm_user->user_info['sms_credit'] = $message_info['sms_credit'];\n\t \n $pm_user->user_displayname();\n\n \n\n // Remove breaks for preview\n\n $message_info['pm_body'] = str_replace(\"<br>\", \"\", $message_info['pm_body']);\n\n \n\n // SET MESSAGE ARRAY\n\n $message_array[] = array(\n\n 'pmconvo_sno' => $message_info['sno'],\n\t\t'pmconvo_destext' => $message_info['text'],\n 'pmconvo_text' => $message_info['text'].\" - \".$currency_sign.$message_info['value'].\" For \".$message_info['sms_credit'].\" SMS \",\n 'pm_value' => $message_info['value'],\n\t\t'pm_body' => $message_info['pm_body'] \n\n );\n\n \n\n unset($pm_user);\n\n }\n\n \n\n return $message_array;\n\n }",
"public function iN_LatestPaymentsSubscriptionsList() {\n\t\t$query = mysqli_query($this->db, \"SELECT DISTINCT\n\t\t\tS.subscription_id, S.iuid_fk, S.subscribed_iuid_fk, S.subscriber_name, S.plan_id, S.plan_amount,S.admin_earning, S.plan_amount_currency, S.created, S.status, U.iuid, U.i_username, U.i_user_fullname\n\t\t\tFROM i_users U FORCE INDEX(ixForceUser)\n\t\t\tINNER JOIN i_user_subscriptions S FORCE INDEX(ix_Subscribe)\n\t\t ON S.subscribed_iuid_fk = U.iuid AND U.uStatus IN('1','3')\n\t\t\tWHERE S.status = 'active' ORDER BY S.subscription_id DESC LIMIT 5\n\t\t\t\") or die(mysqli_error($this->db));\n\t\twhile ($row = mysqli_fetch_array($query)) {\n\t\t\t$data[] = $row;\n\t\t}\n\t\tif (!empty($data)) {\n\t\t\treturn $data;\n\t\t}\n\t}",
"function gen_prescriptions($PID) {\n\n $conn = sql_connect();\n\n $sql_pres = mysqli_query($conn, \"SELECT * FROM Prescriptions WHERE Patient='$PID';\");\n\n if (mysqli_num_rows($sql_pres)==0) {\n echo \"No prescriptions<br>\";\n return;\n }\n\n echo \"<table><tr><th> Drug </th>\";\n echo \"<th> Dosage </th>\";\n echo \"<th> Refill </th>\";\n echo \"<th> Expiration Date </th>\";\n echo \"<th> Expired? </th>\";\n echo \"<th> Prescribing Doctor </th></tr>\";\n\n while($pres = mysqli_fetch_assoc($sql_pres)) {\n\n echo \"<tr><td align='center'>\".$pres['Prescript_Name'].\"</td>\";\n echo \"<td align='center'>\".$pres['Dosage'].\"</td>\";\n echo \"<td align='center'>\".$pres['Refill'].\"</td>\";\n echo \"<td align='center'>\".$pres['Expiration_date'].\"</td>\";\n\n $current_time = date(\"Y-m-d H:i:s\");\n\n if($current_time > $pres['Expiration_date']) {\n echo \"<td align='center'> Yes </td>\";\n } else {\n echo \"<td align='center'> No </td>\";\n }\n\n $sql_doc = mysqli_query($conn, \"SELECT * FROM Doctors WHERE NPI='$pres[Prescribing_doc]';\");\n $doc = mysqli_fetch_assoc($sql_doc);\n\n echo \"<td align='center'>\".$doc['Name'].\"</td></tr>\";\n\n }\n\n echo \"</table>\";\n\n }",
"public function getSubscription($request);",
"function getProducts() {\n\techo \"Getting Products </br>\";\n\t$response = getRequest('/api/product');\n\tprintInfo($response);\n}",
"public function fetchAll() {\n $data = $this->repository->getAllsubscriptions ();\n foreach ( $data ['data'] as $ak => $av ) {\n unset ( $data ['data'] [$ak] ['id'] );\n }\n return ($data) ? $this->getSuccessJsonResponse ( [ 'message' => $data ] ) : $this->getErrorJsonResponse ( [ ], trans ( 'customer::subscription.showallError' ) );\n }",
"function ppt_resources_get_usd_stocks($data)\n{\n// return $data;\n if (!isset($data['year'])) {\n return services_error('Year is not defined!', 500);\n }\n\n $year = $data['year'];\n $accounts = [];\n // If there is no uid sent with the api so get the current user id.\n if (isset($data['uid'])) {\n $uid = $data['uid'];\n } else {\n global $user;\n $uid = $user->uid;\n }\n $countries = array();\n if (isset($data['countries'])) {\n $countries = $data['countries'];\n }\n $reps = array();\n if (isset($data['reps'])) {\n $reps = $data['reps'];\n }\n\n $user = user_load($uid);\n\n // Check if user selected accounts.\n if (isset($data['accounts'])) {\n $accounts = $data['accounts'];\n } else {\n $accounts = ppt_resources_get_role_accounts($user, $countries);\n }\n\n $products = [];\n // Check if user selected products.\n if (isset($data['products'])) {\n $products = get_products_dosages($data['products']);\n } else {\n // If the user is rep.\n if (is_rep($user)) {\n $products = get_products_for_current_user($uid);\n } else {\n $products = get_products_for_accounts($accounts);\n }\n }\n//return entity_metadata_wrapper('field_collection_item', 18045);\n $entries = get_entries($accounts, $products, NULL, $reps);\n $entries_records = get_entries_records_for_year($entries, $year, 'consumption_stock_entry');\n $reports = sum_records_per_field($entries_records, 'field_product', TRUE);\n return $reports;\n}",
"public function getSubscriptionList()\n {\n $recruiterOffice = RecruiterOffice::getAllOffices();\n $subscription['data'] = [];\n $customerId = RecruiterProfile::where(['user_id' => Auth::user()->id])->pluck('customer_id');\n if ($customerId[0] == null) {\n $subscription['customer'] = [];\n } else {\n $customer = \\Stripe\\Customer::retrieve($customerId[0]);\n $subscription['customer'] = [$customer];\n }\n foreach ($recruiterOffice as $office) {\n if ($office['free_trial_period'] != config('constants.ZeroValue')) {\n $subscription['data'] = $office;\n break;\n }\n }\n return $subscription;\n }",
"public static function getSubscriptionProductsList() {\n $sku = array();\n $query = db_select('commerce_product', 'cp');\n $query->fields('cp', array('sku'));\n $query->leftJoin('field_data_field_product', 'pr', 'cp.product_id = pr.entity_id');\n $query->condition('pr.bundle', 'subscription', '=');\n $result = $query->execute();\n while ($product = $result->fetchAssoc()) {\n $sku[] = $product['sku'];\n }\n return new Response(TRUE, $sku, NULL);\n }",
"public function index()\n {\n $id = Auth::id();\n $user = User::find($id);\n $prescriptions = $user->prescriptions()->get();\n //dd(compact($user, $prescriptions));\n\n return view('prescriptions.prescriptions', compact('prescriptions'));\n }",
"function subscriptions ($user_id) {\n global $sql;\n return $sql->sql_select_array_query(\"SELECT * FROM `subscription` WHERE user_id = '{$user_id}' ORDER BY id DESC\");\n }",
"public function getSubscriptionsByIdPerson($id_person){\n $this->db->where('ID_PERSON', $id_person);\n $this->db->order_by(\"DATE_SUBSCRIPTION\",\"DESC\");\n $query = $this->db->get($this->table);\n if ($query->num_rows() > 0) {\n return $query->result();\n }else{\n return false;\n }\n}",
"public function getsubscribers() {\r\n if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH']==\"XMLHttpRequest\") {\r\n $this->db->select()\r\n ->from('ci_subscribers sub')\r\n ->where('sub.status', 1)\r\n ->order_by('sid', 'ASC');\r\n $query = $this->db->get();\r\n $query = $query->result_array();\r\n print json_encode($query);\r\n }else{\r\n header(\"Location: \" . base_url());\r\n }\r\n }",
"public function subscriptions(Request $request) {\n\n try {\n\n $base_query = Subscription::BaseResponse()->where('subscriptions.status' , APPROVED);\n\n if ($request->id) {\n\n $user_details = User::find($request->id);\n\n if ($user_details) {\n\n if ($user_details->one_time_subscription == DEFAULT_TRUE) {\n\n $base_query->where('subscriptions.amount','>', 0);\n\n }\n\n } \n\n }\n\n $subscriptions = $base_query->orderBy('amount' , 'asc')->get();\n\n if($subscriptions) {\n\n foreach ($subscriptions as $key => $subscription_details) {\n \n $subscription_details->plan = $subscription_details->plan <= 1 ? $subscription_details->plan .\" month\" : $subscription_details->plan.\" months\";\n }\n\n }\n\n $response_array = ['success' => true, 'data' => $subscriptions];\n\n return response()->json($response_array, 200);\n\n } catch (Exception $e) {\n\n $message = $e->getMessage();\n\n $code = $e->getCode();\n\n $response_array = ['success' => false, 'error_messages' => $message, 'error_code' => $code];\n\n return response()->json($response_array);\n\n }\n }",
"public function retrieveOrders() {\r\n $client = new Client(\r\n str_replace('/public', '', get_site_url()),\r\n // get_site_url(),\r\n $this->consumer_key,\r\n $this->consumer_secret,\r\n [\r\n 'wp_api' => true,\r\n 'version' => 'wc/v3',\r\n 'query_string_auth' => true,\r\n 'timeout' => PADBSYNC_CURL_TIMEOUT\r\n ]\r\n );\r\n \r\n global $wpdb;\r\n \r\n $query = \"SELECT ID FROM {$wpdb->prefix}posts WHERE profaktura_status = %d AND post_type = %s ORDER BY post_date DESC\";\r\n \r\n $sql = $wpdb->prepare($query, [0, 'shop_order']);\r\n \r\n $dbOrdersProStatZero = $wpdb->get_results($sql);\r\n \r\n $allOrders = $client->get('orders');\r\n \r\n $orders = [];\r\n \r\n if (count($allOrders) > 0 && count($dbOrdersProStatZero) > 0) {\r\n foreach ($allOrders as $o) {\r\n foreach ($dbOrdersProStatZero as $d) {\r\n if ($o->id == $d->ID) {\r\n $orders[] = $o;\r\n continue;\r\n }\r\n }\r\n } \r\n }\r\n \r\n if (count($orders) < 1) {\r\n return new WP_REST_Response(['message' => 'No orders found!']);\r\n }\r\n \r\n return new WP_REST_Response($orders);\r\n }",
"function getDailyDeals(){\n\n global $flipkart_deals_page_transient_lifetime;\n $api_url = 'https://affiliate-api.flipkart.net/affiliate/offers/v1/dotd/json';\n\n function callFlipkartFeedsAPI($api_url){\n\n static $api_call_counter = 1;\n\n $api_response = wp_remote_get( $api_url ,\n array( 'timeout' => 10,\n 'headers' => array( 'Fk-Affiliate-Id' => 'couponmac',\n 'Fk-Affiliate-Token'=> '6eb39690116842ad937da289fa4e6e74' )\n ));\n\n if( is_array($api_response) ) {\n\n $api_response = $api_response['body'];\n $api_response = json_decode($api_response, true);\n\n set_transient( 'flipkart_daily_deals', $api_response, $flipkart_deals_page_transient_lifetime );\n\n return $api_response;\n }else{\n $api_call_counter++;\n if($api_call_counter>5){\n return '';\n }\n $api_response = callFlipkartFeedsAPI($api_url);\n return $api_response;\n }\n }\n\n return callFlipkartFeedsAPI($api_url);\n }",
"private function fetchSubscription($userId)\n {\n try {\n $customerId = RecruiterProfile::where(['user_id' => $userId])->pluck('customer_id');\n $customerWithSubscription = $this->fetchUser($customerId[0]);\n if ($customerWithSubscription['success'] == false) {\n $this->response['success'] = false;\n $this->response['data'] = null;\n $this->response['message'] = trans('messages.no_customer');\n } else {\n $this->response['success'] = true;\n $this->response['data'] = $customerWithSubscription;\n $this->response['message'] = trans('messages.customer_fetched');\n }\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n $this->response['success'] = false;\n $this->response['message'] = $e->getMessage();\n }\n return $this->response;\n }",
"public function listsubscriptions() {\n\t\t//load Topicmodel\n\t\t$this->load->model('Topicmodel');\n\t\t\n\t\t//Return result to jTable\n\t\t$jTableResult = array();\n\t\t$jTableResult['Result'] = \"OK\";\n\t\t$jTableResult['TotalRecordCount'] = $this->Topicmodel->countAllSubscriptionsByUser($this->userID);\n\t\t$jTableResult['Records'] = $this->Topicmodel->ListAllSubscriptionsByUser($this->userID,$this->input->get('jtSorting', TRUE), $this->input->get('jtPageSize', TRUE), $this->input->get('jtStartIndex', TRUE));\n\t\tprint json_encode($jTableResult);\n\t}",
"public function GetSubscriptionsRecords()\n {\n \t$output = array();\n \n \t$rs = mysql_query(\"SELECT * FROM subscriptions ORDER BY \" . $this->lang_name_field . \" ASC\");\n \n \tif(mysql_num_rows($rs)==0)\n \t{\n \t\t$output = 0;\n \t}\n \telse\n \t{\n \t\twhile($row=mysql_fetch_array($rs))\n \t\t{\n \t\t\t$output[] = array(\n\t \t\t\t\t\t\"subscription_id\" \t=> $row['subscription_id'],\n\t \t\t\t\t\t\"subscription_name_fr\"\t=> $row['subscription_name_fr'],\n\t \t\t\t\t\t\"subscription_name_en\"\t=> $row['subscription_name_en'],\n\t \t\t\t\t\t\"subscription_desc_fr\"\t=> $row['subscription_desc_fr'],\n\t \t\t\t\t\t\"subscription_desc_en\"\t=> $row['subscription_desc_en'],\n\t \t\t\t\t\t\"created_by_id\" \t\t=> $row['created_by_id'],\n\t \t\t\t\t\t\"created_date\" \t\t=> $row['created_date'],\n\t \t\t\t\t\t\"modified_by_id\" \t\t=> $row['modified_by_id'],\n\t \t\t\t\t\t\"modified_date\" \t\t=> $row['modified_date']\n \t\t\t);\n \t\t}\n \t}\n \n \treturn $output;\n }",
"function get_provinsi(){\n\t\t$curl = curl_init();\n\n\t\tcurl_setopt_array($curl, array(\n\t\t\tCURLOPT_URL => \"http://api.rajaongkir.com/starter/province?id=12\",\n\t\t\tCURLOPT_RETURNTRANSFER => true,\n\t\t\tCURLOPT_ENCODING => \"\",\n\t\t\tCURLOPT_MAXREDIRS => 10,\n\t\t\tCURLOPT_TIMEOUT => 30,\n\t\t\tCURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n\t\t\tCURLOPT_CUSTOMREQUEST => \"GET\",\n\t\t\tCURLOPT_HTTPHEADER => array(\n\t\t\t\t\"key: 8f22875183c8c65879ef1ed0615d3371\"\n\t\t\t\t),\n\t\t\t));\n\n\t\t$response = curl_exec($curl);\n\t\t$err = curl_error($curl);\n\n\t\tcurl_close($curl);\n\n\t\tif ($err) {\n\t\t\techo \"cURL Error #:\" . $err;\n\t\t} else {\n\t\t\techo $response;\n\t\t}\n\t}",
"function getSkus() {\n\techo \"Getting Skus </br>\";\n\t$response = getRequest('/api/sku');\n\tprintInfo($response);\n}",
"public function fetchApiInfoAll() {\n $data = $this->repository->getSubscriberInfo ();\n return ($data) ? $this->getSuccessJsonResponse ( [ 'message' => $data ] ) : $this->getErrorJsonResponse ( [ ], trans ( 'customer::subscription.showallError' ) );\n }",
"public function getSubscriptionPlan() {\n $categoryId = Config::get('custom_config.WOOCOMMERCE_CATEGORY_ID');\n if (empty($categoryId)) {\n return response()->json(\n ['error' => __('woocommerce category ID not set')\n ],\n 400\n );\n }\n $data = $this->wooCommerceService->getSubscriptionPlan();\n \\Log::info(\"===== data \", ['subscription_package' => $data]);\n\n if ($data) {\n return response()->json(['data' => $data], 200);\n }\n\n return response()->json(\n ['error' => __('messages.un_processable_request')\n ],\n 400\n );\n }",
"public function preRetrieve();",
"public function GetSubscriptionsList()\n {\n \t$output = array();\n \n \t$rs = mysql_query(\"SELECT subscription_id, \" . $this->lang_name_field . \" FROM subscriptions ORDER BY \" . $this->lang_name_field . \" ASC\");\n \n \tif(mysql_num_rows($rs)==0)\n \t{\n \t\t$output = 0;\n \t}\n \telse\n \t{\n \t\twhile($row=mysql_fetch_array($rs))\n \t\t{\n \t\t\t$output[] = array(\n\t \t\t\t\t\t\"subscription_id\" => $row['subscription_id'],\n\t \t\t\t\t\t\"subscription_name\"\t=> $row[$this->lang_name_field]\n \t\t\t);\n \t\t}\n \t}\n \n \treturn $output;\n }",
"public function getSubscriptionForLicense($licenseKey){\n $this->load->model('ls_api');\n $con = $this->getCon();\n $license = $this->getTableRowByKey(\"Licenses\",\"LicenseKey\",$licenseKey);\n echo \"Total Number of Licenses: $licCount<br>\\n\";\n// die();\n $selected = 0;\n $page = 100;\n $end = 180000;\n while($selected < $licCount){\n $res = $this->queryOLS(\"select * from Licenses order by licenseId limit $selected,$page\");\n $numI = mysqli_num_rows($res);\n echo \"Selected $selected, Number returned: $numI<br>\\n\";\n $i = $selected;\n $selected += $numI;\n if($selected > $end) die();\n \n $emails = [];\n while($license = $res->fetch_assoc()) {\n \n// var_dump($contact);\n $id = $license['licenseId'];\n $key = $license['licenseKey'];\n $ls_info = $this->ls_api->getLicenseInformation($key);\n $exp = $ls_info['UpgradeSubscriptionExpirationDate'];\n// echo \"$key expires on $exp\\n\";\n if(!$exp || $exp == '') continue;\n $exp = date(\"Y-m-d H:i:s\", strtotime($exp));\n echo \"$key expires on $exp\\n\";\n $this->updateOLS('Licenses', ['novaCareExpiration' => $exp], 'licenseId', $id);\n// die();\n \n }\n \n// die();\n }\n }",
"public function testFetchSubscriptionLink()\n {\n $data = $this->api->addon->fetch($this->addonId);\n \n $this->assertTrue(is_array($data->toArray()));\n \n $this->assertTrue($data['entity']=='addon');\n }",
"public function index()\n {\n $user = User::with(\"subscriptions\")->find(Auth::user()->id);\n $subscriptions = $user->subscriptions->toArray();\n\n return ResponseHelper::success($subscriptions, __(\"Retornando assinatura\"));\n }",
"public function makeSubscription()\n {\n\n $url = Credentials::getCredentials('/pre-approvals');\n\n $response = Http::withHeaders([\n 'Content-Type' => 'application/json',\n 'Accept' => 'application/vnd.pagseguro.com.br.v3+json;charset=ISO-8859-1'\n ])\n ->post($url, [\n 'plan' => $this->data['plan_reference'],\n 'sender' => [\n 'name' => 'Teste Usuário Sender',\n 'email' => 'teste@sandbox.pagseguro.com.br',\n 'hash' => $this->data['senderHash'],\n 'phone' => [\n 'areaCode' => '98',\n 'number' => '984283432'\n ],\n 'address' => [\n 'street' => 'Rua Teste',\n 'number' => '29',\n 'complement' => '',\n 'district' => 'São Bernado',\n 'city' => 'São Luis',\n 'state' => 'MA',\n 'country' => 'BRA',\n 'postalCode' => '65056000'\n ],\n 'documents' => [\n [\n 'type' => 'CPF',\n 'value' => '38868146029'\n ]\n ]\n ],\n 'paymentMethod' => [\n 'type' => 'CREDITCARD',\n 'creditCard' => [\n 'token' => $this->data['token'],\n 'holder' => [\n 'name' => 'Customer Credit Name',\n 'birthDate' => '30/10/1990',\n 'documents' => [\n [\n 'type' => 'CPF',\n 'value' => '38868146029'\n ]\n ],\n 'billingAddress' => [\n 'street' => 'Rua Teste',\n 'number' => '29',\n 'complement' => '',\n 'district' => 'São Bernado',\n 'city' => 'São Luis',\n 'state' => 'MA',\n 'country' => 'BRA',\n 'postalCode' => '65056000'\n ],\n 'phone' => [\n 'areaCode' => '98',\n 'number' => '984283432'\n ]\n ]\n\n ]\n ]\n ]);\n\n return $response->json();\n }",
"public static function getData($sub_id = null) {\n $report = array();\n $db = ClassesDb::getInstance();\n $today = ClassesDate::getInstance()->toSql();\n\n if ($sub_id) {\n $sql = \"SELECT id, url FROM subscription WHERE id = \".$db->quote($sub_id);\n }\n else {\n $sql = \"SELECT id, url FROM subscription WHERE /*is_valid = '1' AND*/ need_update = '1' ORDER BY id\";\n }\n $s = $db->prepare($sql);\n $s->execute();\n $feeds = $s->fetchAll(PDO::FETCH_KEY_PAIR);\n\n $report[] = count($feeds).\" subscriptions needed to get data\";\n\n\n $multihandler = curl_multi_init();\n $handlers = $result = array();\n\n foreach ($feeds as $key => $url) {\n $handlers[$key] = curl_init($url);\n curl_setopt($handlers[$key], CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($handlers[$key], CURLOPT_USERAGENT, 'Romeo Sierra Sierra Feed agent 0.5 by charlyecho (charlyecho.com/perso)');\n curl_setopt($handlers[$key], CURLOPT_CONNECTTIMEOUT, 30);\n curl_setopt($handlers[$key], CURLOPT_HEADER, FALSE);\n curl_setopt($handlers[$key], CURLOPT_TIMEOUT, 30);\n curl_setopt($handlers[$key], CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($handlers[$key], CURLOPT_COOKIESESSION, TRUE);\n curl_multi_add_handle($multihandler, $handlers[$key]);\n }\n\n $pendingConnex = null;\n do {\n $status = curl_multi_exec($multihandler, $pendingConnex);\n $info = curl_multi_info_read($multihandler);\n usleep(10000); // 10 ms\n } while ($pendingConnex > 0);\n\n foreach ($feeds as $key => $url) {\n $md5 = md5($url);\n $content = curl_multi_getcontent($handlers[$key]);\n\n $sql = \"UPDATE subscription SET \";\n\n if ($content) {\n if (strpos($content, \"xml\") !== false) {\n $sql .= \"is_valid = '1', need_parse = '1'\";\n $report[] = \"flux $key ($url), OK\";\n if (!file_put_contents(__DIR__.\"/../cache/rss/\" . $md5 . \".xml\", $content)) {\n continue;\n }\n }\n else {\n $sql .= \"is_valid = '0', need_parse = '0'\";\n $report[] = \"flux $key ($url) pas RSS, désactivé\";\n }\n }\n else {\n $sql .= \"is_valid = '0', need_parse = '0'\";\n $report[] = \"flux $key ($url) vide, désactivé\";\n continue;\n }\n $sql .= \", need_update= '0', recuperation_data_datetime = \".$db->quote($today);\n $sql .= \" WHERE id = \".$db->quote($key);\n $s = $db->prepare($sql);\n $s->execute();\n }\n\n foreach ($feeds as $key => $i) {\n curl_multi_remove_handle($multihandler, $handlers[$key]);\n }\n curl_multi_close($multihandler);\n\n return $report;\n }",
"public function listSubscriptions($request);",
"function get(){\n global $wpdb;\n global $DOPBSP;\n \n $calendars_ids = array();\n $query = array();\n $values = array();\n $api = isset($_GET['dopbsp_api']) && $_GET['dopbsp_api'] == 'true' ? true:false;\n \n if (!$api){\n $type = $_POST['type'];\n $calendar_id = $_POST['calendar_id'];\n $start_date = $_POST['start_date'];\n $end_date = $_POST['end_date'];\n $start_hour = $_POST['start_hour'];\n $end_hour = $_POST['end_hour'];\n $status_pending = $_POST['status_pending'] == 'true' ? true:false;\n $status_approved = $_POST['status_approved'] == 'true' ? true:false;\n $status_rejected = $_POST['status_rejected'] == 'true' ? true:false;\n $status_canceled = $_POST['status_canceled'] == 'true' ? true:false;\n $status_expired = $_POST['status_expired'] == 'true' ? true:false;\n $payment_methods = $_POST['payment_methods'] == '' ? array():explode(',', $_POST['payment_methods']);\n $search = $_POST['search'];\n $page = $_POST['page'];\n $per_page = $_POST['per_page'];\n $order = $_POST['order'];\n $order_by = $_POST['order_by'];\n }\n else{\n $type = isset($_GET['type']) ? $_GET['type']:'';\n \n if (isset($_GET['calendar_id'])\n && $_GET['calendar_id'] != ''){\n $calendars_requested = ','.$_GET['calendar_id'].',';\n }\n else{\n $calendars_requested = '';\n }\n \n if($type != 'ics') {\n $calendars_id = array();\n $key_pieces = explode('-', $_POST['key']);\n $calendars = $DOPBSP->classes->backend_calendars->get(array('user_id' => (int)$key_pieces[1]));\n\n foreach ($calendars as $calendar){\n if ($calendars_requested != ''){\n if (strpos($calendars_requested, ','.(string)$calendar->id.',') !== false){\n array_push($calendars_id, $calendar->id);\n }\n }\n else{\n array_push($calendars_id, $calendar->id);\n }\n }\n \n $calendar_id = implode(',', $calendars_id);\n } else {\n $calendar_id = $_GET['calendar_id'];\n }\n $start_date = isset($_GET['start_date']) ? $_GET['start_date']:'';\n $end_date = isset($_GET['end_date']) ? $_GET['end_date']:'';\n $start_hour = isset($_GET['start_hour']) ? $_GET['start_hour']:'00:00';\n $end_hour = isset($_GET['end_hour']) ? $_GET['end_hour']:'24:00';\n $status = isset($_GET['status']) ? $_GET['status']:'';\n $status_pending = strpos($status,'pending') !== false ? true:false;\n $status_approved = strpos($status,'approved') !== false ? true:false;\n $status_rejected = strpos($status,'rejected') !== false ? true:false;\n $status_canceled = strpos($status,'canceled') !== false ? true:false;\n $status_expired = strpos($status,'expired') !== false ? true:false;\n $payment_methods = isset($_GET['payment_methods']) && $_GET['payment_methods'] != '' ? explode(',', $_GET['payment_methods']):array();\n $search = isset($_GET['search']) ? $_GET['search']:'';\n $page = isset($_GET['page']) ? $_GET['page']:'1';\n $per_page = isset($_GET['per_page']) ? $_GET['per_page']:'10';\n $order = isset($_GET['order']) ? $_GET['order']:'ASC';\n $order_by = isset($_GET['order_by']) ? $_GET['order_by']:'check_in';\n \n if(strtolower($type) == 'ics') {\n $per_page = 1000000;\n }\n }\n \n /*\n * Calendars query.\n */\n if (strpos($calendar_id, ',') !== false){\n $calendars_ids = explode(',', $calendar_id);\n array_push($query, 'SELECT * FROM '.$DOPBSP->tables->reservations.' WHERE (calendar_id=%d');\n array_push($values, $calendars_ids[0]);\n \n for ($i=1; $i<count($calendars_ids); $i++){\n array_push($query, ' OR calendar_id=%d');\n array_push($values, $calendars_ids[$i]);\n }\n array_push($query, ')');\n }\n else{\n array_push($query, 'SELECT * FROM '.$DOPBSP->tables->reservations.' WHERE calendar_id=%d');\n array_push($values, $calendar_id);\n }\n \n\n /*\n * Days query.\n */\n if ($start_date != ''){\n if ($end_date != ''){\n array_push($query, ' AND (check_in >= %s AND check_in <= %s');\n array_push($values, $start_date);\n array_push($values, $end_date);\n \n array_push($query, ' OR check_out >= %s AND check_out <= %s AND check_out <> \"\")');\n array_push($values, $start_date);\n array_push($values, $end_date);\n }\n else{\n array_push($query, ' AND (check_in >= %s)');\n array_push($values, $start_date);\n }\n }\n elseif ($end_date != ''){\n array_push($query, ' AND check_in <= %s');\n array_push($values, $end_date);\n }\n \n /*\n * Source for sync\n */\n// if($type == 'ics') {\n array_push($query, ' AND reservation_from = %s');\n array_push($values, 'pinpoint');\n// }\n \n /*\n * Hours query.\n */\n array_push($query, ' AND (start_hour >= %s AND start_hour <= %s OR start_hour = \"\"');\n array_push($values, $start_hour);\n array_push($values, $end_hour);\n \n array_push($query, ' OR end_hour >= %s AND end_hour <= %s OR end_hour = \"\")');\n array_push($values, $start_hour);\n array_push($values, $end_hour);\n\n /*\n * Status query.\n */\n array_push($query, ' AND status = %s');\n array_push($values, 'approved');\n $status_init = true;\n \n\n /*\n * Payment query. \n */\n if (count($payment_methods) > 0){\n $payment_init = false;\n\n for ($i=0; $i < count($payment_methods); $i++){\n array_push($query, $payment_init ? ' OR payment_method=%s':' AND (payment_method=%s');\n array_push($values, $payment_methods[$i]);\n $payment_init = true;\n } \n array_push($query, ')'); \n }\n\n /*\n * Search query.\n */\n if ($search != ''){\n array_push($query, ' AND (id=%s OR transaction_id=%s OR form LIKE %s)');\n array_push($values, $search);\n array_push($values, $search);\n array_push($values, '%'.$search.'%');\n }\n \n /*\n * Exclude reservations with incomplete payment.\n */\n array_push($query, ' AND (token=\"\" OR (token<>\"\" AND (payment_method=\"none\" OR payment_method=\"default\")))');\n \n \n /*\n * Order query.\n */\n $order_value = $order == 'DESC' ? 'DESC':'ASC';\n \n switch ($order_by){\n case 'check_out':\n $order_by_value = 'check_out';\n break;\n case 'start_hour':\n $order_by_value = 'start_hour';\n break;\n case 'end_hour':\n $order_by_value = 'end_hour';\n break;\n case 'id':\n $order_by_value = 'id';\n break;\n case 'status':\n $order_by_value = 'status';\n break;\n case 'date_created':\n $order_by_value = 'date_created';\n break;\n default:\n $order_by_value = 'check_in';\n }\n \n array_push($query, ' ORDER BY '.$order_by_value.' '.($order_value));\n\n /*\n * ************************************************************* Get number of reservations.\n */\n if (!$api){\n $reservations_total = $wpdb->get_var($wpdb->prepare(str_replace('*', 'COUNT(*)', implode('', $query)), $values));\n }\n else{\n $reservations_total = 0;\n }\n\n /*\n * Pagination query.\n */\n array_push($query, ' LIMIT %d, %d');\n array_push($values, (($page-1)*$per_page));\n array_push($values, $per_page);\n \n /*\n * ************************************************************* Get reservations.\n */\n $reservations = $wpdb->get_results($wpdb->prepare(implode('', $query), $values));\n \n $csvReservations = array();\n $csvReservationHeader = array('ID', 'Calendar ID', 'Calendar Name', 'Check In', 'Check Out', 'Start Hour');\n $excelReservations = array();\n $excelReservationsData = array();\n $jsonReservationsData = array();\n $icsReservationsData = array();\n \n \n // ICS\n if(strtolower($type) == 'ics') {\n array_push($icsReservationsData, 'BEGIN:VCALENDAR');\n array_push($icsReservationsData, 'PRODID:-//Pinpoint.world//2.6.6//EN');\n array_push($icsReservationsData, 'CALSCALE:GREGORIAN');\n array_push($icsReservationsData, 'METHOD:PUBLISH');\n array_push($icsReservationsData, 'VERSION:2.0');\n \n// array_push($icsReservationsData, 'BEGIN:VTIMEZONE');\n \n \n// foreach($reservations as $reservation) {\n// /*\n// * Settings\n// */\n// $settings_calendar = $DOPBSP->classes->backend_settings->values($reservation->calendar_id, \n// 'calendar');\n// }\n \n array_push($icsReservationsData, 'X-WR-TIMEZONE:UTC');\n// array_push($icsReservationsData, 'BEGIN:STANDARD');\n// array_push($icsReservationsData, 'TZOFFSETFROM:+0200');\n// array_push($icsReservationsData, 'TZOFFSETTO:+0100');\n// array_push($icsReservationsData, 'END:STANDARD');\n// array_push($icsReservationsData, 'BEGIN:DAYLIGHT');\n// array_push($icsReservationsData, 'TZOFFSETFROM:+0100');\n// array_push($icsReservationsData, 'TZOFFSETTO:+0200');\n// array_push($icsReservationsData, 'END:DAYLIGHT');\n// array_push($icsReservationsData, 'END:VTIMEZONE');\n \n $timestamp = gmdate(\"Ymd\\THis\\Z\");\n \n foreach($reservations as $reservation) {\n \n \n $calendar = $wpdb->get_row($wpdb->prepare('SELECT * FROM '.$DOPBSP->tables->calendars.' WHERE id=%d',\n $reservation->calendar_id));\n /*\n * Settings\n */\n $settings_calendar = $DOPBSP->classes->backend_settings->values($reservation->calendar_id, \n 'calendar');\n \n // ICS\n array_push($icsReservationsData, 'BEGIN:VEVENT');\n array_push($icsReservationsData, 'UID:'.$reservation->uid);\n array_push($icsReservationsData, 'SUMMARY:['.$reservation->status.']'.' '.$calendar->name.' (R#'.$reservation->id.')');\n array_push($icsReservationsData, 'DTSTAMP:'.$timestamp);\n \n if($reservation->start_hour != '') {\n $reservation->check_out = $reservation->check_in;\n \n if($settings_calendar->timezone != '') {\n \n $dateTimeZone = new DateTimeZone($settings_calendar->timezone);\n \n // set hours to google timezone\n $start_hour_data = new DateTime($reservation->check_in.' '.$reservation->start_hour, $dateTimeZone);\n $start_hour_data->setTimeZone(new DateTimeZone('UTC'));\n $reservation->start_hour = $start_hour_data->format('H:i');\n $reservation->check_in = $start_hour_data->format('Y-m-d');\n \n if($settings_calendar->hours_interval_enabled == 'true'){\n $end_hour_data = new DateTime($reservation->check_out.' '.$reservation->end_hour, $dateTimeZone);\n $end_hour_data->setTimeZone(new DateTimeZone('UTC'));\n $reservation->end_hour = $end_hour_data->format('H:i');\n $reservation->check_out = $end_hour_data->format('Y-m-d');\n } else {\n $end_hour_data = new DateTime($reservation->check_out.' '.$reservation->end_hour, $dateTimeZone);\n $end_hour_data->setTimeZone(new DateTimeZone('UTC'));\n $end_hour_h = $end_hour_data->format('H').':'.$end_hour_data->format('i');\n\n $reservation->end_hour = $end_hour_h;\n $reservation->check_out = $end_hour_data->format('Y-m-d');\n }\n }\n array_push($icsReservationsData, 'DTSTART:'.str_replace('-','', $reservation->check_in).'T'.str_replace(':','',$reservation->start_hour).'00Z');\n } else {\n array_push($icsReservationsData, 'DTSTART;VALUE=DATE:'.str_replace('-','', $reservation->check_in));\n }\n \n if($reservation->end_hour != '') {\n array_push($icsReservationsData, 'DTEND:'.str_replace('-','', $reservation->check_out).'T'.str_replace(':','',$reservation->end_hour).'00Z');\n } else {\n \n if ($settings_calendar->days_morning_check_out == 'false'){\n // check_out + 1 day\n $check_out = new DateTime($reservation->check_out.' 00:00:00');\n $check_out->modify('+1 day');\n $reservation->check_out = $check_out->format('Y-m-d');\n }\n array_push($icsReservationsData, 'DTEND;VALUE=DATE:'.str_replace('-','', $reservation->check_out));\n }\n \n // \n $description = $this->getSyncDescription('|FORM|',\n $reservation);\n \n array_push($icsReservationsData, 'DESCRIPTION:'.substr($description, 0, 60));\n array_push($icsReservationsData, 'END:VEVENT');\n }\n \n array_push($icsReservationsData, 'END:VCALENDAR');\n \n echo implode(PHP_EOL, $icsReservationsData);\n exit;\n }\n\n foreach($reservations as $reservation) {\n $csvReservation = array();\n $reservations_form = json_decode($reservation->form);\n $reservation = (array)$reservation;\n \n $calendar = $wpdb->get_row($wpdb->prepare('SELECT * FROM '.$DOPBSP->tables->calendars.' WHERE id=%d',\n $reservation['calendar_id']));\n\n array_push($excelReservationsData, '<tr>');\n array_push($csvReservation, $reservation['id']);\n array_push($excelReservationsData, '<td>'.$reservation['id'].'</td>');\n\n if (!array_key_exists('id', $jsonReservationsData)) {\n $jsonReservationsData['id'] = array();\n }\n array_push($jsonReservationsData['id'], $reservation['id']);\n\n array_push($csvReservation, $reservation['calendar_id']);\n array_push($excelReservationsData, '<td>'.$reservation['calendar_id'].'</td>');\n\n array_push($csvReservation, $calendar->name);\n array_push($excelReservationsData, '<td>'.$calendar->name.'</td>');\n\n if (!array_key_exists('calendar_id', $jsonReservationsData)) {\n $jsonReservationsData['calendar_id'] = array();\n }\n array_push($jsonReservationsData['calendar_id'], $reservation['calendar_id']);\n\n array_push($csvReservation, $reservation['check_in']);\n array_push($excelReservationsData, '<td>'.$reservation['check_in'].'</td>');\n\n if (!array_key_exists('check_in', $jsonReservationsData)) {\n $jsonReservationsData['check_in'] = array();\n }\n array_push($jsonReservationsData['check_in'], $reservation['check_in']);\n \n if($reservation['check_out'] == '') {\n $reservation['check_out'] = ' ';\n }\n \n if($reservation['check_out'] == '') {\n unset($csvReservationHeader[3]);\n } else {\n array_push($csvReservation, $reservation['check_out']);\n array_push($excelReservationsData, '<td>'.$reservation['check_out'].'</td>');\n\n if (!array_key_exists('check_out', $jsonReservationsData)) {\n $jsonReservationsData['check_out'] = array();\n }\n array_push($jsonReservationsData['check_out'], $reservation['check_out']);\n }\n \n if($reservation['start_hour'] == '') {\n $reservation['start_hour'] = ' ';\n }\n\n if($reservation['start_hour'] == '') {\n\n if($reservation['check_out'] == '') {\n unset($csvReservationHeader[3]);\n } else {\n unset($csvReservationHeader[4]);\n }\n } else {\n array_push($csvReservation, $reservation['start_hour']);\n array_push($excelReservationsData, '<td>'.$reservation['start_hour'].'</td>');\n\n if (!array_key_exists('start_hour', $jsonReservationsData)) {\n $jsonReservationsData['start_hour'] = array();\n }\n array_push($jsonReservationsData['start_hour'], $reservation['start_hour']);\n }\n \n if($reservation['end_hour'] == '') {\n $reservation['end_hour'] = ' ';\n }\n\n// if($reservation['end_hour'] != '') {\n array_push($csvReservation, $reservation['end_hour']);\n array_push($excelReservationsData, '<td>'.$reservation['end_hour'].'</td>');\n\n if (!array_key_exists('end_hour', $jsonReservationsData)) {\n $jsonReservationsData['end_hour'] = array();\n array_push($csvReservationHeader, 'End hour');\n }\n array_push($jsonReservationsData['end_hour'], $reservation['end_hour']);\n// }\n\n if($reservation['price'] != 0) {\n array_push($csvReservation, $reservation['price']);\n array_push($excelReservationsData, '<td>'.$reservation['price'].'</td>');\n\n if (!array_key_exists('price', $jsonReservationsData)) {\n $jsonReservationsData['price'] = array();\n array_push($csvReservationHeader, 'Price');\n }\n array_push($jsonReservationsData['price'], $reservation['price']);\n }\n else{\n array_push($csvReservation, '0');\n array_push($excelReservationsData, '<td>0</td>');\n\n if (!array_key_exists('price', $jsonReservationsData)) {\n $jsonReservationsData['price'] = array();\n array_push($csvReservationHeader, 'Price');\n }\n }\n\n if($reservation['extras_price'] != 0) {\n array_push($csvReservation, $reservation['extras_price']);\n array_push($excelReservationsData, '<td>'.$reservation['extras_price'].'</td>');\n\n if (!array_key_exists('extras_price', $jsonReservationsData)) {\n $jsonReservationsData['extras_price'] = array();\n array_push($csvReservationHeader, 'Extras price');\n }\n array_push($jsonReservationsData['extras_price'], $reservation['extras_price']);\n }\n else{\n array_push($csvReservation, '0');\n array_push($excelReservationsData, '<td>0</td>');\n\n if (!array_key_exists('extras_price', $jsonReservationsData)) {\n $jsonReservationsData['extras_price'] = array();\n array_push($csvReservationHeader, 'Extras price');\n }\n }\n\n if($reservation['fees_price'] != 0) {\n array_push($csvReservation, $reservation['fees_price']);\n array_push($excelReservationsData, '<td>'.$reservation['fees_price'].'</td>');\n\n if (!array_key_exists('fees_price', $jsonReservationsData)) {\n $jsonReservationsData['fees_price'] = array();\n array_push($csvReservationHeader, 'Fees price');\n }\n array_push($jsonReservationsData['fees_price'], $reservation['fees_price']);\n }\n else{\n array_push($csvReservation, '0');\n array_push($excelReservationsData, '<td>0</td>');\n\n if (!array_key_exists('fees_price', $jsonReservationsData)) {\n $jsonReservationsData['fees_price'] = array();\n array_push($csvReservationHeader, 'Fees price');\n }\n }\n\n if($reservation['coupon_price'] != 0) {\n array_push($csvReservation, $reservation['coupon_price']);\n array_push($excelReservationsData, '<td>'.$reservation['coupon_price'].'</td>');\n\n if (!array_key_exists('coupon_price', $jsonReservationsData)) {\n $jsonReservationsData['coupon_price'] = array();\n array_push($csvReservationHeader, 'Coupon price');\n }\n array_push($jsonReservationsData['coupon_price'], $reservation['coupon_price']);\n }\n else{\n array_push($csvReservation, '0');\n array_push($excelReservationsData, '<td>0</td>');\n\n if (!array_key_exists('coupon_price', $jsonReservationsData)) {\n $jsonReservationsData['coupon_price'] = array();\n array_push($csvReservationHeader, 'Coupon price');\n }\n }\n\n if($reservation['deposit_price'] != 0) {\n array_push($csvReservation, $reservation['deposit_price']);\n array_push($excelReservationsData, '<td>'.$reservation['deposit_price'].'</td>');\n\n if (!array_key_exists('deposit_price', $jsonReservationsData)) {\n $jsonReservationsData['deposit_price'] = array();\n array_push($csvReservationHeader, 'Deposit price');\n }\n array_push($jsonReservationsData['deposit_price'], $reservation['deposit_price']);\n }\n else{\n array_push($csvReservation, '0');\n array_push($excelReservationsData, '<td>0</td>');\n\n if (!array_key_exists('deposit_price', $jsonReservationsData)) {\n $jsonReservationsData['deposit_price'] = array();\n array_push($csvReservationHeader, 'Deposit price');\n }\n }\n \n array_push($csvReservation, $reservation['price_total']);\n array_push($excelReservationsData, '<td>'.$reservation['price_total'].'</td>');\n\n if (!array_key_exists('price_total', $jsonReservationsData)) {\n $jsonReservationsData['price_total'] = array();\n array_push($csvReservationHeader, 'Total price');\n }\n array_push($jsonReservationsData['price_total'], $reservation['price_total']);\n array_push($csvReservation, $reservation['currency_code']);\n array_push($excelReservationsData, '<td>'.$reservation['currency_code'].'</td>');\n\n if (!array_key_exists('currency_code', $jsonReservationsData)) {\n $jsonReservationsData['currency_code'] = array();\n array_push($csvReservationHeader, 'Currency');\n }\n array_push($jsonReservationsData['currency_code'], $reservation['currency_code']);\n\n if($reservation['no_items'] != 0) {\n array_push($csvReservation, $reservation['no_items']);\n array_push($excelReservationsData, '<td>'.$reservation['no_items'].'</td>');\n\n if (!array_key_exists('no_items', $jsonReservationsData)) {\n $jsonReservationsData['no_items'] = array();\n array_push($csvReservationHeader, 'No. Items');\n }\n array_push($jsonReservationsData['no_items'], $reservation['no_items']);\n }\n else{\n array_push($csvReservation,'0');\n array_push($excelReservationsData, '<td>0</td>');\n\n if (!array_key_exists('no_items', $jsonReservationsData)) {\n $jsonReservationsData['no_items'] = array();\n array_push($csvReservationHeader, 'No. Items');\n }\n }\n \n // IP Address\n // if(isset($reservation['ip']) && $reservation['ip'] != '') {\n \n if (!array_key_exists('ip', $jsonReservationsData)) {\n $jsonReservationsData['ip'] = array();\n array_push($csvReservationHeader, 'IP address');\n }\n array_push($excelReservationsData, '<td>'.$reservation['ip'].'</td>');\n // }\n \n foreach($reservations_form as $key => $data) {\n\n if(!in_array($data->translation, $csvReservationHeader)) {\n array_push($csvReservationHeader, $data->translation);\n }\n array_push($csvReservation, $data->value);\n array_push($excelReservationsData, '<td>'.$data->value.'</td>');\n\n if (!array_key_exists(str_replace(\" \",\"\",strtolower($data->translation)), $jsonReservationsData)) {\n $jsonReservationsData[str_replace(\" \",\"\",strtolower($data->translation))] = array();\n }\n array_push($jsonReservationsData[str_replace(\" \",\"\",strtolower($data->translation))], $data->value);\n }\n array_push($csvReservations, implode(',', $csvReservation));\n array_push($excelReservationsData, '</tr>');\n }\n\n array_push($excelReservations, '<table>');\n array_push($excelReservations, ' <tr>');\n\n foreach($csvReservationHeader as $headerName) {\n array_push($excelReservations, ' <td>'.$headerName.'</td>');\n }\n array_push($excelReservations, ' </tr>');\n array_push($excelReservations, implode('', $excelReservationsData));\n\n array_push($excelReservations, '</table>');\n\n array_unshift($csvReservations, implode(',', $csvReservationHeader));\n \n if(strtolower($type) == 'csv') {\n echo implode('\\r\\n', $csvReservations);\n } else if(strtolower($type) == 'json') {\n echo json_encode($jsonReservationsData); \n } else {\n echo implode('', $excelReservations);\n }\n \n exit;\n }",
"public function getSubscribers(Request $request)\n {\n $url = \"https://api.mailerlite.com/api/v2/subscribers/\";\n\n $columns = [ \n 0 => 'email', \n 1 => 'name',\n 2 => 'country',\n 3 => 'datetime',\n 4 => 'datetime'\n ];\n\n $params = [\n 'offset' => $request->input('start'),\n // 'limit' => $request->input('length')\n ];\n\n $url = $url . '?' . http_build_query($params);\n\n $key = Session::get('apiKeySession');\n $search = $request->input('search.value'); \n \n if(!empty($search)){\n $url = \"https://api.mailerlite.com/api/v2/subscribers/search?query=$search\";\n }\n\n \n\n $curl = curl_init($url);\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\n $headers = [\n \"X-MailerLite-ApiKey: $key\",\n ];\n curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n\n $resp = curl_exec($curl);\n curl_close($curl);\n $result = json_decode($resp);\n\n $totalData = count((array) $result);\n $totalFiltered = $totalData; \n\n\n $data = [];\n\n if(!empty($result))\n {\n if(gettype($result) == \"array\"){\n\n foreach ($result as $res)\n {\n $fields = $res->fields;\n $country = \"\";\n $datetime = empty($res->date_subscribe) ? $res->date_created : $res->date_subscribe; //check if date_subscribe has value \n\n for ($i=0; $i < count($fields); $i++) { \n if($fields[$i]->key == \"country\"){\n $country = $fields[$i]->value;\n }\n }\n \n $nestedData= [\n 'email' => \"<a href='/subscriber/$res->id'>$res->email</a>\",\n 'name' => $res->name,\n 'country' => $country,\n 'date' => date('d/M/Y',strtotime($datetime)),\n 'time' => date(' H:i:s',strtotime($datetime)),\n 'delete' => \"<button class='btn btn-danger delete' data-id='$res->id'>Delete</button>\",\n 'datetime' => strtotime($datetime)\n ];\n \n $data[] = $nestedData;\n\n $order = $columns[$request->input('order.0.column')];\n $dir = $request->input('order.0.dir');\n\n usort($data, function ($item1, $item2) use ($order,$dir) {\n if($dir == \"asc\"){\n return $item1[$order] <=> $item2[$order];\n }else{\n return $item2[$order] <=> $item1[$order];\n }\n });\n }\n }else{\n \n $fields = $result->fields;\n $country = \"\";\n for ($i=0; $i < count($fields); $i++) { \n if($fields[$i]->key == \"country\"){\n $country = $fields[$i]->value;\n }\n }\n \n //check if date_subscribe has value \n $datetime = empty($result->date_subscribe) ? $result->date_created : $result->date_subscribe;\n\n $nestedData= [\n 'email' => \"<a href='/subscriber/$result->id'>$result->email</a>\",\n 'name' => $result->name,\n 'country' => $country,\n 'date' => date('d/M/Y',strtotime($datetime)),\n 'time' => date(' H:i:s',strtotime($datetime)),\n 'delete' => \"<button class='btn btn-danger delete' data-id='$result->id'>Delete</button>\"\n ];\n\n $data[] = $nestedData;\n\n }\n \n }\n \n return Datatables::of($data)\n ->addIndexColumn()\n ->rawColumns(['delete','email'])\n ->make(true);\n }",
"public function get_all_items_by_api()\n {\n\n $data = array('token' =>'ayaolwan');//'type' => 'fees_category');\n $data_string = json_encode($data);\n $curl = curl_init(base_url() . 'webServices/Itemapi');\n\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"GET\");\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($data_string))\n );\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data_string);\n\n $result = json_decode(curl_exec($curl), true);\n curl_close($curl);\n\n if ($result['status'])\n {\n echo json_encode($result['itemsList']);\n }\n\n\n }",
"public static function getPreinscripciones($id){ \r\n $conexion = Database::get(); \r\n \r\n $consulta = \"SELECT c.* FROM cursos c, preinscripciones p, usuarios u WHERE u.id = $id \r\n \t\t\tAND p.id_curso = c.id AND u.id= p.id_usuario AND c.activo = 1 ORDER BY p.timestamp ASC;\";\r\n \r\n $resultados = $conexion->query($consulta); \r\n $cursos = array();\r\n while ($curso = $resultados->fetch_object('CursoModel'))\r\n \t$cursos[] = $curso;\r\n \r\n $resultados->free();\r\n\t\t\t\r\n return $cursos;\r\n //return $portadas;\r\n }",
"public function index()\n {\n return PodcastResource::collection(Podcast::with('subscription')->orderBy('title', 'ASC')->get());\n }",
"function bpGetInvoice($invoiceId, $apiKey=false) {\r\n\t\r\n}",
"function query($params){\n\t$db = new Db();\n $OUTPUT = new Output();\n $coll = $db->selectCollection($params[\"collectionName\"]);\n $Subscribe = $db->selectCollection(\"Subscribers\");\n\t$AUTH = new Auth();\n\t$LuxFunctions = new LuxFunctions();\n\t$LuxFunctions->setDocument($params);\n\tif($LuxFunctions->is_avail(\"id\")){\n\t\t$query = array(\"_id\" => new MongoID($LuxFunctions->fetch_avail(\"id\")));\n\t\t$result = $coll->findOne($query);\n\t\n\t}else if($LuxFunctions->is_avail(\"query\")){\n\t\t$query = $LuxFunctions->fetch_avail(\"query\");\n\t\t// change to is_avail\t\n\t\tif(isset($params[\"distinct\"]) && $params[\"distinct\"]){\n \t$result = $coll->distinct($query);\n\t\n\t\t}else if(isset($params[\"aggregate\"]) && $params[\"aggregate\"]){\n \t$result = $coll->aggregate($query);\n\t\t}else{\n\t\t\t$result = $coll->find($query);\n\t\t}\n\t}\n\techo json_encode($result);\n\tif(isset($params[\"subscribe\"]) && $params[\"subscribe\"] == true){\n\t\t$key = array_keys($query);\n\t\t$value = array_values($query); \n\t\t$cursor = $Subscribe->findOne(array(\"query.\".$key[0] => $value[0]));\t\t\n\t\tif(isset($cursor)){\n\t\t\t$Subscribe->update(array(\"_id\" => $cursor[\"_id\"]) , array('$addToSet' => array(\"subscribers.clientId\" => $AUTH->getClientId())));\n\t\t}else{\n\t\t\t$newdoc = array(\"query\" => $query, \"subscribers\" => array(\"clientId\" => array($AUTH->getClientId())), \"timestamp\" => microtime(), \"parent_sub\" => null);\n\t\t\t$Subscribe->insert($newdoc);\n\t\t}\n\t}\n\tif(isset($params[\"publish\"]) && $params[\"publish\"] == true){\n\t\t $db->Publish($LuxFunctions->fetch_avail(\"doc\", false), $AUTH, $params[\"priority\"]);\t\n\t}\n}",
"public function LoadRecords()\n {\n \t$this->SetCulture();\n \t$this->subscriptions_records = $this->GetSubscriptionsRecords();\n }",
"function wsSticker() {\n\t\tif (! $this->AccessTokenValid) {\n\t\t\t$Resultado=$this->AccessTokenResult;\n\t\t\treturn $Resultado;\t\t\n\t\t}\t\t\n\t\t$this->GetItems(\"Active=1 AND DatePublish<='\" . date('Y-m-d') . \"' AND DateExpire>='\". date('Y-m-d') . \"'\",false,\"DatePublish DESC, Orden DESC\");\n\t\tif ($this->ItemsCount>0) {\n\t\t\t$Resultado['Success']=1;\n\t\t\t$Resultado['Items']=$this->Items;\n\t\t} else {\n\t\t\t$Resultado['Success']=0;\n\t\t\t$Resultado['Result']=\"No records found\";\n\t\t}\n\t\treturn $Resultado;\n\t}",
"function ppt_resources_get_planned_delivered($data)\n{\n $year = date('Y');\n $dates = get_year_dates($year);\n $start_date = $dates['start_date'];\n $end_date = $dates['end_date'];\n if (isset($data['uid'])) {\n $uid = $data['uid'];\n } else {\n global $user;\n $uid = $user->uid;\n }\n $user = user_load($uid);\n if (isset($data['countries'])) {\n $countries = $data['countries'];\n } else {\n $countries = get_user_countries($user);\n }\n // Check if user selected accounts.\n if (isset($data['accounts'])) {\n $accounts = $data['accounts'];\n } else {\n $accounts = ppt_resources_get_role_accounts($user, $countries, FALSE);\n }\n $products = [];\n // Check if user selected products.\n if (isset($data['products'])) {\n $products = $data['products'];\n } else {\n // If the user is rep.\n if (is_rep($user)) {\n $products = get_products_for_current_user($uid, FALSE, FALSE);\n } else {\n $products = get_target_products_for_accounts($accounts);\n }\n }\n\n $nodes = get_planned_orders_for_acconuts_per_year($year, $accounts);\n\n // Initialze empty months.\n $months = array(\n \"01\" => 'December',\n \"02\" => 'January',\n \"03\" => 'February',\n \"04\" => 'March',\n \"05\" => 'April',\n \"06\" => 'May',\n \"07\" => 'June',\n \"08\" => 'July',\n \"09\" => 'August',\n \"10\" => 'September',\n \"11\" => 'October',\n \"12\" => 'November',\n );\n $final_arr = [];\n if (isset($nodes)) {\n // Consider a product exists with mutiple accounts.\n foreach ($nodes as $nid => $item) {\n $node = node_load($nid);\n $planned_product_tid = $node->field_planned_product[\"und\"][0][\"target_id\"];\n if (in_array($planned_product_tid, $products)) {\n $planned_product = taxonomy_term_load($planned_product_tid);\n $planned_product_name = $planned_product->name;\n // Get node values for product (planned and delivered).\n if (isset($node->field_planned_period[\"und\"])) {\n $node_date = $node->field_planned_period[\"und\"][0]['value'];\n $planned_month = date(\"F\", strtotime($node_date));\n }\n $planned_quantity = 0;\n if (isset($node->field_planned_quantity[\"und\"])) {\n $planned_quantity = $node->field_planned_quantity[\"und\"][0][\"value\"];\n }\n if (isset($node->field_planned_actual_period[\"und\"])) {\n $node_date = $node->field_planned_actual_period[\"und\"][0]['value'];\n $delivery_month = date(\"F\", strtotime($node_date));\n }\n $delivered_quantity = 0;\n if (isset($node->field_planned_delivered_quantity[\"und\"])) {\n $delivered_quantity = $node->field_planned_delivered_quantity[\"und\"][0][\"value\"];\n }\n // If product already exists, update its values for node months.\n if (isset($final_arr[$planned_product_name])) {\n if (isset($final_arr[$planned_product_name][\"Planned\"][$planned_month])) {\n $final_arr[$planned_product_name][\"Planned\"][$planned_month][0] += (int) $planned_quantity;\n } else {\n $final_arr[$planned_product_name][\"Planned\"][$planned_month][0] = [(int) $planned_quantity];\n }\n if (isset($final_arr[$planned_product_name][\"Actual\"][$delivery_month])) {\n $final_arr[$planned_product_name][\"Actual\"][$delivery_month][0] += (int) $delivered_quantity;\n } else {\n $final_arr[$planned_product_name][\"Actual\"][$delivery_month] = [(int) $delivered_quantity];\n }\n } else {\n // Initialze product array with 0 for all months, then update it with current node data.\n $final_arr[$planned_product_name] = [\"Actual\" => [], \"Planned\" => []];\n for ($i = 1; $i <= 12; $i++) {\n $month = $months[sprintf('%02d', $i)];\n $final_arr[$planned_product_name][\"Actual\"][$month] = [0];\n $final_arr[$planned_product_name][\"Planned\"][$month] = [0];\n }\n $final_arr[$planned_product_name][\"Actual\"][$delivery_month] = [(int) $delivered_quantity];\n $final_arr[$planned_product_name][\"Planned\"][$planned_month] = [(int) $planned_quantity];\n }\n }\n }\n }\n // [product => [actual => [months], target => [months]]]\n return $final_arr;\n}",
"function get_preorders()\n\t{\n\t\tglobal $db;\n\n\t\t$itm = new items($this->pg);\n\n\t\t$this->preorders = array();\n\t\t$sql = \"SELECT pre_preorderID,pre_itemID,pre_status,pre_notes,pre_releasedate FROM preorders WHERE pre_storeID=\".$_SESSION['storeID'].\" ORDER BY pre_releasedate\";\n\t\t$result = mysql_query($sql,$db);\n\t\t$this->error->mysql(__FILE__,__LINE__);\n\t\twhile ($row = mysql_fetch_assoc($result))\n\t\t{\n\t\t\t$customers = array();\n\t\t\t$preorderID = $row['pre_preorderID'];\n\t\t\t$csql = \"SELECT * FROM preorder_customers WHERE prc_preorderID=$preorderID\";\n\t\t\t$cresult = mysql_query($csql,$db);\n\t\t\t$this->error->mysql(__FILE__,__LINE__);\n\t\t\twhile ($crow = mysql_fetch_assoc($cresult)) { $customers[] = $crow; }\n\t\t\t$row['customers'] = $customers;\n\n\t\t\t$this->set_itemID($row['pre_itemID']);\n\t\t\t$row['item_info'] = $this->item_info;\n\n\t\t\t$this->preorders[] = $row;\n\t\t}\n\t}",
"function display_cars()\n{\n //displays posted cars\n $url = set_url('advert');\n $url .= '?limit=10&page=1';\n $token = $_SESSION['token'];\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer ' . $token,]);\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = json_decode(curl_exec($cURLConnection));\n curl_close($cURLConnection);\n print_r($apiResponse);\n exit;\n}",
"public function getCustomerTest(){\n $this->load->helper('ExactOnline/vendor/autoload');\n $this->load->model('Exactonline_model');\n $this->load->model('Projects_model');\n $this->load->model('Shopify_exact_model');\n $this->load->library('Shopify_restapi');\n \n $projectId = 38;\n $this->Exactonline_model->setData(\n array(\n 'projectId' => $projectId,\n 'redirectUrl' => $this->Projects_model->getValue('exactonline_redirect_url', $projectId),\n 'clientId' => $this->Projects_model->getValue('exactonline_client_id', $projectId),\n 'clientSecret' => $this->Projects_model->getValue('exactonline_secret_key', $projectId),\n )\n );\n\n $offset = $this->Projects_model->getValue('exactonline_customers_offset', $projectId) ? $this->Projects_model->getValue('exactonline_customers_offset', $projectId) : NULL;\n $amount = $this->Projects_model->getValue('customers_amount', $projectId) ? $this->Projects_model->getValue('customers_amount', $projectId) : 1000;\n $customerId = isset($_GET['customerId'])?$_GET['customerId']:'';\n\n $connection = $this->Exactonline_model->makeConnection($projectId);\n /*echo \"<pre>\";\n print_r($connection);\n exit();*/\n if ($connection) {\n $customers = $this->Shopify_exact_model->getExactCustomersTest($connection, $customerId, NULL, $amount);\n echo \"<pre>\";\n print_r($customers);\n exit();\n }\n }",
"function display_charges_list(GuzzleHttp\\Message\\Response $response)\n{\n if (count($response->json()['response'])) {\n $charges = $response->json()['response'];\n print \"Available charges\\n\";\n foreach ($charges as $charge) {\n printf(\n \"token: %s | transaction date: %s | currency: %s | amount: %s | fees: %s\\n\",\n $charge['token'], $charge['created_at'], $charge['currency'],\n money_format('%(#5n', $charge['amount']),\n money_format('%(#5n', $charge['total_fees'])\n );\n }\n } else {\n print \"\\nNo charges available in response object\\n\";\n }\n}",
"public function prescriptions()\n\t{\n\t\treturn $this->hasMany('OEMR\\\\Models\\\\Prescription');\n\t}",
"public function fetchData()\n {\n $invoice = InvoiceAppointment::leftjoin('appointments as appt','appt.id','invoice_appointment.detail_id')\n ->leftjoin('appointment_status as appt_stat','appt_stat.appt_id','invoice_appointment.detail_id')\n ->where(fn($query) => $query\n ->where( 'appt.name', 'like', '%' . $this->search . '%')\n ->orWhere('invoice_appointment.total', 'like', '%' . $this->search . '%')\n )\n ->orderBy($this->sortBy, $this->sortDirection)\n ->paginate($this->perPage);\n $this->invappt = $invoice;\n\n /*For notifications*/\n $appoint = Appointment::leftjoin('appointment_status as apts','apts.appt_id','appointments.id')\n ->where('apts.status','Pending')\n ->latest()->get();\n $this->appt = $appoint;\n }",
"function obtainReportForSubscription(string $id){\nreturn $this->get(\"/subscription/report/{$id}\");\n}",
"public function getSubscriptions($date) {\n $start = $date . ' 00:00:00';\n $end = $date . ' 23:59:59';\n return $this->countByDate($start, $end, 'subscribe');\n }",
"function createSubscription($peram){\n\t global $wpdb;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\tif(!empty($peram[4])) {\n\t\t$namarr = explode(\" \",$peram[4]);\n\t\t$fname = $namarr[0];\n\t\t$lname = $namarr[1];\n\t} else {\n\t\t$fname = \"\";\n\t\t$lname = \"\";\n\t\t}\n\t$intervalLength = $peram[0];\n\t//------------------------------------\n\t$current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\t\n\t//--------------------------------------------\n\t// Common setup for API credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n // Subscription Type Info\n $subscription = new AnetAPI\\ARBSubscriptionType();\n $subscription->setName(\"Cnanny Monthly Subscription\");\n\n $interval = new AnetAPI\\PaymentScheduleType\\IntervalAType();\n $interval->setLength($intervalLength);\n $interval->setUnit(\"days\");\n\n $paymentSchedule = new AnetAPI\\PaymentScheduleType();\n $paymentSchedule->setInterval($interval);\n $paymentSchedule->setStartDate(new DateTime(date('Y-m-d')));\n $paymentSchedule->setTotalOccurrences(\"12\");\n $paymentSchedule->setTrialOccurrences(\"10\");\n\n $subscription->setPaymentSchedule($paymentSchedule);\n $subscription->setAmount($peram[0]);\n $subscription->setTrialAmount(\"0.00\");\n \n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($peram[1]); //////--- card no e.g. 4111111111111111\n $creditCard->setExpirationDate($peram[2]); //////////////--- expiry 1220\n\n $payment = new AnetAPI\\PaymentType();\n $payment->setCreditCard($creditCard);\n $subscription->setPayment($payment);\n\n $order = new AnetAPI\\OrderType();\n $order->setInvoiceNumber(\"1234354\"); \n $order->setDescription(\"Cnanny Monthly Subscription\"); \n $subscription->setOrder($order); \n \n $billTo = new AnetAPI\\NameAndAddressType();\n $billTo->setFirstName($fname);\n $billTo->setLastName($lname);\n\n $subscription->setBillTo($billTo);\n\n $request = new AnetAPI\\ARBCreateSubscriptionRequest();\n $request->setmerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setSubscription($subscription);\n $controller = new AnetController\\ARBCreateSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n \n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\") )\n {\n\t\t//$response->getSubscriptionId()\n\t\techo '<h2 class=\"page-heading\">Thank you! Your payment has been processed</h2>';\n\t\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t\techo '<div class=\"clearfix charged\"><span>Your credit card has been charged <span class=\"text-green\">$'.$monthpaid.'</span></span><br />';\n\t\t\n\t\t$oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500;\n\t\techo '<div class=\"clearfix charged\">\n\t\t\t\t\t\t\t<p>Your credit card will be automatically debited $'.$monthpaid.' a month until you hire a cNanny or <a href=\"'.site_url().'/subscription-cancellation\" class=\"text-black text-underline\">cancel your subscription</a>.</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\tWhen you hire your perfect cNanny, you will be charged a one-time placement fee of $'.$oncepaid.' only after she accepts the offer.\n\t\t\t\t\t\t\t\tYour monthly subscription will then be automatically cancelled.\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\t\t\n\t\t$subscrId = $response->getSubscriptionId();\n\t\t\n\t\t$table_name = $wpdb->prefix . 'payment';\t\n\t\t\t$ins = $wpdb->insert($table_name, array(\n\t\t\t'fname' => $fname,\n\t\t\t'lname' => $lname,\n\t\t\t'user_id' => $user_id,\n\t\t\t'amount' => $peram[0],\n\t\t\t'card' => base64_encode($peram[1]),\n\t\t\t'expiry' => $peram[2],\n\t\t\t'code' => '',\n\t\t\t'date_created' => current_time('mysql', 1),\n\t\t\t'status' => 'Active',\n\t\t\t'subscribe' => $subscrId,\n\t\t\t'res_code' => '-',\n\t\t\t'auth_code' => '-',\n\t\t\t'trans_code' => '-',\n\t\t\t'gcode' => '-',\n\t\t\t'res_des' => 'Success',\n\t\t));\t\n\t\t$paymentsuccess = 1;\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n\t\t$paymentsuccess = 1;\n }\n\n return $paymentsuccess;\n }",
"public function testSubscriptionsList()\n {\n }",
"public function getCatalogue()\n {\n\n $json = file_get_contents($this->getBaseURL());\n\n if ($json !== null) {\n $data = json_decode($json, true);\n\n if (count($data) > 0) {\n\n // On enregistre les tableaux dans lesquels on va se \"promener\"\n $tabResults = $data['response']['docs'];\n\n if (count($tabResults) > 0) {\n\n // Pour chaque tableau (dans le tableau \"docs\"), on enregistre le Label, l'URI et les auteurs (nom/prenom)\n foreach ($tabResults as $key => $element) {\n $publication = new Publication($element['label_s'], $element['authFullName_s'], $element['uri_s'], $element['modifiedDate_s']);\n\n $this->addPublication($publication);\n }\n\n } else {\n echo MESSAGE_NO_RESULTS_AVAILABLE_ERROR;\n }\n } else {\n die(MESSAGE_NO_DATA_AVAILABLE_ERROR);\n }\n } else {\n die(MESSAGE_PROBLEM_WITH_URL_ERROR);\n }\n\n return $this->publications;\n\n }",
"function j2_get_yt_subs() {\n $api_key = get_option('youtube_api_key');\n $channel_id = get_option('youtube_api_channel_id');\n\n // Return if the option fields do not exist\n if(!$api_key || !$channel_id)\n return false;\n\n $youtube_url = 'https://www.googleapis.com/youtube/v3/channels?part=statistics&id='.$channel_id.'&key='.$api_key;\n $data = @file_get_contents($youtube_url);\n $json_data = json_decode($data);\n\n if(!$json_data)\n return false;\n\n $subs = $json_data->items\n }",
"public function fetchSubscriptions(array $parameters = array())\n {\n /**\n * @var \\Omnipay\\Vindicia\\Message\\FetchSubscriptionsRequest\n */\n return $this->createRequest('\\Omnipay\\Vindicia\\Message\\FetchSubscriptionsRequest', $parameters);\n }",
"function past_orders_get()\n { \n $input = $this->get();\n \n if(!isset($input['id']) || $input['id'] == '' ||\n !isset($input['user_type']) || $input['user_type'] == '' ||\n !isset($input['page']) || $input['page'] == '') \n { \n $message = ['status' => FALSE,'message' => $this->lang->line('text_rest_invalidparam')];\n $this->set_response($message, REST_Controller::HTTP_BAD_REQUEST); // BAD_REQUEST (400)\n }\n else\n {\n if($input['page'] <= 0){\n $input['page'] = 1;\n }\n if($input['user_type'] == 'user'){\n $settings = $this->Common_model->getSettings('user');\n $sql = \"SELECT * from tbl_trip_details where (user_id = \".$input['id'].\" OR id IN (select order_id from tbl_splitfare where status = 'Accepted' AND receiver_id = \".$input['id'].\")) AND status IN ('Completed', 'Cancelled') ORDER BY id DESC LIMIT \".(($input['page'] - 1) * $settings['per_page']).\",\".$settings['per_page'];\n\n $trip_data = $this->db->query($sql)->result_array();\n }\n else{\n $settings = $this->Common_model->getSettings('driver');\n $trip_data = $this->db->query(\"SELECT * from tbl_trip_details where driver_id = \".$input['id'].\" AND status IN ('Completed', 'Cancelled') ORDER BY id DESC LIMIT \".(($input['page'] - 1) * $settings['per_page']).\",\".$settings['per_page'])->result_array();\n }\n\n if(empty($trip_data)){\n $message = ['status' => FALSE,'message' => $this->lang->line('past_trip_found_error')];\n $this->set_response($message, REST_Controller::HTTP_OK); // OK (200)\n }\n else{\n $past_data = array();\n foreach ($trip_data as $key => $value) {\n \n \n $value['user_data'] = $this->user_model->get_user($input['id']);\n if($value['driver_id'] != '' && $value['driver_id'] != 0){\n $value['driver_data'] = $this->driver_model->get_driver($value['driver_id']);\n }\n else{\n $value['driver_data'] = (object)array(); \n }\n \n $past_data[] = $this->Common_model->getOrderDetails($value['id']);\n }\n \n $message = ['status' => TRUE,'message' => $this->lang->line('past_trip_found_success'),'data'=>$past_data];\n $this->set_response($message, REST_Controller::HTTP_OK); // OK (200)\n }\n }\n }",
"public function index()\n {\n $search = [];\n $offset = isset($_GET['offset']) ? $_GET['offset'] : 0;\n $limit = isset($_GET['limit']) ? $_GET['limit'] : 10;\n\n //if(isset($_GET['all'])){\n $search['all'] = true;\n //}\n\n if(isset($_GET['user_id'])){\n $search['user_id'] = $_GET['user_id'];\n }\n\n $data = $this->user_subscription->getAll($offset, $limit, $search);\n $data['offset'] = isset($_GET['all']) ? 'all' :$offset;\n $data['limit'] = isset($_GET['all']) ? 'all' : $limit;\n $data['total'] = 0;\n \n $data['total'] = $this->user_subscription->count();\n\n return response()->json(['success'=> $data ], 200);\n }",
"public function syncAllSubscriptions()\n\t{\n\t\t\n\t\t/* If 1.4 and no backward, then leave */\n\t\tif (!$this->backward)\n\t\t\treturn;\n\t\t\t\n\t @ini_set('max_execution_time', 1000);\n\t\t\n\t include_once(dirname(__FILE__).'/lib/Stripe.php');\n\t\t\\Stripe\\Stripe::setApiKey(Configuration::get('STRIPE_MODE') ? Configuration::get('STRIPE_PRIVATE_KEY_LIVE') : Configuration::get('STRIPE_PRIVATE_KEY_TEST'));\n \n\t\t$stripe_customers = Db::getInstance()->ExecuteS('SELECT stripe_customer_id, id_customer FROM `'._DB_PREFIX_.'stripepro_customer` UNION SELECT stripe_customer_id,id_customer FROM `'._DB_PREFIX_.'stripepro_subscription` ');\n\t\t\n\t\tDb::getInstance()->Execute('TRUNCATE TABLE '._DB_PREFIX_.'stripepro_subscription');\n\t\t\n\t\tforeach($stripe_customers as $stripe_customer){\n\n\t\t/* Try to process the capture and catch any error message */\n\t\ttry\n\t\t{\n\t\t\t$result_json = \\Stripe\\Customer::retrieve($stripe_customer['stripe_customer_id']);\n\t\t\t\t\t\t\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\n\t\t\t$this->_errors['stripe_subscription_error'] = $e->getMessage();\n\t\t\tif (class_exists('Logger'))\n\t\t\t\tLogger::addLog($this->l('Stripe - Subscription update failed').' '.$e->getMessage(), 1, null, 'Customer', (int)Tools::getIsset('id_customer'), true);\n\t\t}\n\t\t\n\t\tif(!isset($this->_errors['stripe_subscription_error'])){\n\t\t\t\n $subs = $result_json->subscriptions->data;\n\t\t\t\n\t\t\tforeach($subs as $sub){\n\t\t\t Db::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'stripepro_subscription (`stripe_subscription_id`,`stripe_customer_id`,`id_customer`,`stripe_plan_id`,`quantity`,`current_period_start`,`current_period_end`, `status`,`date_add`) VALUES (\\''.$sub->id.'\\', \\''.$stripe_customer['stripe_customer_id'].'\\', \\''.$stripe_customer['id_customer'].'\\','.$sub->plan->id.', \\''.$sub->quantity.'\\', '.$sub->current_period_start.','.$sub->current_period_end.',\\''.$sub->status.'\\',NOW())');\n\t\t\t }\n\t\t\t}\t\t\n\n\t\t}\n\treturn true;\n\t\n\t}",
"public function getPR() {}",
"function Fetch_API_Payments($application_id)\n{\n\tsettype($application_id, 'int');\n\n\t$db = ECash::getMasterDb();\n\t$query = '-- /* SQL LOCATED IN file=' . __FILE__ . ' line=' . __LINE__ . ' method=' . __METHOD__ . \" */\n\t\tSELECT\n\t\t\tapi_payment_id,\n\t\t\tname_short event_type,\n\t\t\tamount,\n\t\t\tdate_event\n\t\tFROM\n\t\t\tapi_payment\n\t\t\tJOIN event_type USING (event_type_id)\n\t\tWHERE\n\t\t\tapplication_id = {$application_id}\n\t\tAND\n\t\t\tapi_payment.active_status = 'active'\n\t\";\n\n\t$result = $db->query($query);\n\treturn $result->fetchAll(PDO::FETCH_OBJ);\n\n}",
"function get_collection( $request ){\n \n $user_str = $request['user_id'];\n \n if( $user_str && $user = get_user_by('login', $user_str) ) \n {\n $return = array(); \n $collect_post = get_user_meta($user->ID, 'collect_post', true);\n \n if( $collect_post ){\n \n $tmp = json_decode($collect_post, true);\n \n $return['total'] = $tmp['total'];\n $return['project'] = array_map(\n function($p){ return array('id' => $p,'title' => get_the_title($p));}, \n array_unique($tmp['pid'])\n );\n\n }\n\n\n $response = new WP_REST_Response( $return);\n $response->header( 'Access-Control-Allow-Origin', apply_filters( 'access_control_allow_origin', '*' ) );\n $response->header( 'Cache-Control', 'max-age=' . apply_filters( 'api_max_age', WEEK_IN_SECONDS ) );\n return $response;\n }else{return ['alex' => 'china'];}\n\n }",
"public function whmcs_get_invoices($params = array()) {\n\t\t$params['action'] = 'GetInvoices';\n\t\t// return Whmcs_base::send_request($params);\n $load = new Whmcs_base();\n return $load->send_request($params);\n\t}",
"function get_subscriber($id){\n $query = selectRecord(TAB_SUBSCRIBERS, \"id = $id\");\n return $query;\n}",
"public function getPurchases() {\n\t\treturn $this->response['results'] ?: [];\n\t}",
"public function getAllInvoicesFromWebSerice() {\n $response = $this->_XeroOAuth->request('GET', $this->_XeroOAuth->url('Invoices', 'core'), array());\n if ($this->_XeroOAuth->response['code'] == 200) {\n $invoices = $this->_XeroOAuth->parseResponse($this->_XeroOAuth->response['response'], $this->_XeroOAuth->response['format']);\n return $invoices;\n } else {\n \\De\\Log::logApplicationInfo ( \"Caught Exception: \" . urldecode($response['response']) . ' -- File: ' . __FILE__ . ' Line: ' . __LINE__ );\n }\n }",
"public function GetSubscription()\n {\n \t$this->SetCulture();\n \t \n \t$rs = mysql_query(\"SELECT subscription_id, \" . $this->lang_name_field . \" FROM subscriptions WHERE subscription_id=\" . $this->subscription_id);\n \t \n \t$row = mysql_fetch_array($rs);\n \n \t$this->subscription_id\t\t= $row['subscription_id'];\n \t$this->subscription_name\t= $row[$this->lang_name_field];\n \t\n \n \tif (mysql_errno())\n \t{\n \t\treturn \"MySQL error \".mysql_errno().\": \".mysql_error().\"\\n<br>When executing:<br>\\n$rs\\n<br>\";\n \t}\n }",
"public function get_bl_customers(){\r\n\t\t//ClientId: ed4d82fc-b6d7-4518-a292-abad6eadb9fb\r\n\t\t//ClientSecret: d8a11026-4a8c-4650-b159-32c791e7a1b9\r\n\r\n\t\t$post_data = array(\r\n\t\t\t\"grant_type\"=>\"client_credentials\",\r\n\t\t\t\"scope\"=>\"\",\r\n\t\t\t\"client_id\"=>\"ed4d82fc-b6d7-4518-a292-abad6eadb9fb\",\r\n\t\t\t\"client_secret\"=>\"d8a11026-4a8c-4650-b159-32c791e7a1b9\"\r\n\t\t);\r\n\r\n\t\t$this->call_bl_api_auth($post_data);\r\n\t\t//$result = CallAPI(\"POST\",\"https://apigateway.blinfo.se/auth/oauth/v2/token\")\r\n\t}",
"function ppt_resources_get_delivered_planned_orders($data)\n{\n global $user;\n $months = array(\n \"01\" => 'December',\n \"02\" => 'January',\n \"03\" => 'February',\n \"04\" => 'March',\n \"05\" => 'April',\n \"06\" => 'May',\n \"07\" => 'June',\n \"08\" => 'July',\n \"09\" => 'August',\n \"10\" => 'September',\n \"11\" => 'October',\n \"12\" => 'November',\n );\n\n if (!isset($data['year'])) {\n return services_error('Year is not defined!', 500);\n }\n\n if (empty($data['accounts'])) {\n return services_error('Accounts is not defined!', 500);\n }\n\n if (empty($data['products'])) {\n return services_error('Products is not defined!', 500);\n }\n\n $year = $data['year'];\n $accounts = $data['accounts'];\n $products = $data['products'];\n $dates = get_year_dates($year);\n $start_date = $dates['start_date'];\n $end_date = $dates['end_date'];\n\n $query = new EntityFieldQuery();\n $query->entityCondition('entity_type', 'node')\n ->entityCondition('bundle', 'planned_order')\n ->fieldCondition('field_planned_account', 'target_id', $accounts, 'IN')\n ->fieldCondition('field_planned_product', 'target_id', $products, 'IN')\n ->fieldCondition('field_planned_actual_period', 'value', $start_date, '>=')\n ->fieldCondition('field_planned_actual_period', 'value', $end_date, '<=')\n ->addMetaData('account', user_load(1));\n\n $records = $query->execute();\n $final_arr = [];\n\n if (isset($records['node'])) {\n $nodes_ids = array_keys($records['node']);\n $nodes = node_load_multiple($nodes_ids);\n\n foreach ($nodes as $node) {\n // Get node planned product name.\n $planned_product_tid = $node->field_planned_product['und'][0]['target_id'];\n $planned_product = taxonomy_term_load($planned_product_tid);\n $planned_product_name = $planned_product->name;\n\n // Get node date for product (planned).\n if (isset($node->field_planned_actual_period['und'])) {\n $node_date = $node->field_planned_actual_period['und'][0]['value'];\n $delivered_month = date(\"F\", strtotime($node_date));\n }\n\n // Get node values for planned quantity.\n $delivered_quantity = 0;\n if (isset($node->field_planned_delivered_quantity['und'])) {\n $delivered_quantity = $node->field_planned_delivered_quantity['und'][0]['value'];\n }\n\n // If product already exists, update its values for node months.\n if (isset($final_arr['delivered'][$planned_product_name])) {\n if (isset($final_arr['delivered'][$planned_product_name][$delivered_month])) {\n $final_arr['delivered'][$planned_product_name][$delivered_month][0] += (int) $delivered_quantity;\n } else {\n $final_arr['delivered'][$planned_product_name][$delivered_month][0] = [(int) $delivered_quantity];\n }\n } else {\n // Initialze product array with 0 for all months, then update it with current node data.\n $final_arr['delivered'][$planned_product_name] = [];\n for ($i = 1; $i <= 12; $i++) {\n $month = $months[sprintf('%02d', $i)];\n $final_arr['delivered'][$planned_product_name][$month] = [0];\n }\n $final_arr['delivered'][$planned_product_name][$delivered_month] = [(int) $delivered_quantity];\n }\n }\n }\n return $final_arr;\n}",
"public function getSubscriptionDetails()\n {\n try {\n $subscriptions = $this->fetchSubscription(Auth::user()->id);\n $this->response['success'] = true;\n $this->response['data'] = $subscriptions;\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n $this->response['success'] = false;\n $this->response['message'] = $e->getMessage();\n }\n return $this->response;\n }",
"static function publishable_ids()\r\n {\r\n $xrate = current(current(WEBPAGE::$dbh->getAll(sprintf\r\n (\r\n \"select rate from tblCurrenciesExchangeRates where date = '%s' and currency_id = %s\", \r\n date('Y-m-d'),WEBPAGE::$conf['app']['xrate_local']))));\r\n $margin = $xrate * WEBPAGE::$conf['mod_sponsorship']['min_donation'];\r\n return WEBPAGE::$dbh->getAssoc(sprintf\r\n (\r\n \"select distinct\r\n lm.id, 1 + %s - datediff(curdate(),ckd.date) time_left,\r\n coalesce(rc.donations,0.00) donations,\r\n br.borrowers borrowers,\r\n lm.amount - coalesce(rc.donations,0.00) pending\r\n from\r\n (\r\n tblLoansMaster lm,\r\n (\r\n select\r\n lmd.master_id, lsh.date\r\n from\r\n tblLoanStatusHistory lsh,\r\n tblLoansMasterDetails lmd\r\n where\r\n lmd.loan_id = lsh.loan_id and\r\n lsh.status = 'G' and\r\n lsh.date < CURDATE() and\r\n lsh.date >= DATE_ADD(CURDATE(), INTERVAL -%s DAY)\r\n ) ckd\r\n )\r\n left join\r\n (\r\n select master_id,sum(donation) donations from tblLoansMasterSponsors group by master_id\r\n ) rc on rc.master_id = lm.id\r\n left join\r\n (\r\n select master_id,count(loan_id) borrowers from tblLoansMasterDetails lmd group by master_id\r\n ) br on br.master_id = lm.id\r\n where\r\n lm.borrower_type = 'B' and\r\n lm.check_status = 'R' and\r\n ckd.master_id = lm.id and\r\n br.borrowers >= %s and\r\n br.borrowers <= %s and\r\n coalesce(rc.donations,0.00) < lm.amount - %s\r\n order by\r\n lm.id\",\r\n WEBPAGE::$conf['mod_sponsorship']['publishing_margin'],\r\n WEBPAGE::$conf['mod_sponsorship']['publishing_margin'],\r\n WEBPAGE::$conf['mod_sponsorship']['publishing_min_borrowers'],\r\n WEBPAGE::$conf['mod_sponsorship']['publishing_max_borrowers'],\r\n $margin)\r\n );\r\n }",
"function fetch_save_api() {\n if (false === $doms_exchange_results = get_transient('doms_exchange')) {\n //* Request API URL\n $request = wp_remote_get('https://api.exchangeratesapi.io/latest?base=USD');\n\n //* Validate it and ensure that we got back a response that we expected.\n if (is_wp_error($request)) {\n return false; // Bail early\n }\n\n //* Retrieving the data\n $body = wp_remote_retrieve_body($request);\n\n //* Translate the JSON into a format we can read\n $rates = json_decode($body);\n $doms_exchange_results = set_transient('doms_exchange', $rates, 86400);\n }\n\n return $doms_exchange_results;\n}",
"public function all(){\n \t\t$response = $this->curl->get( $this->api_url, [ \n\t\t\t'access_token' => $this->token\n\t\t]);\n\n \t\tif( $response->success ){\n \t\t\t$products = [];\n\t\t\tforeach ($response->products as $product) {\n\t \t\t\t$tmp = new Product( $this );\n\t \t\t\t$tmp->fetch($product);\n\t \t\t\t$products[] = $tmp;\n\n\t \t\t\treturn $products;\n\t \t\t}//foreach\n \t\t}//if\n \t\telse{\n \t\t\t// Throw error according to status\n \t\t}//else\n\n \t}",
"function revSPORTapiRequest(string $api, string $endpoint, int $id = null, array $parameters = [])\n{\n date_default_timezone_set('Australia/Sydney');\n\n //Replace these with\n //revdemoclub\n $apiKey = '';\n $secretKey = '';\n $method = 'GET';\n //$url = 'https://lz-1.revolutionise.com.au/' . $api . '/' . $endpoint . '/';\n $url = 'https://lz-1-staging.revolutionise.com.au/' . $api . '/' . $endpoint . '/';\n //$url = 'https://lz-1.rev.local/' . $api . '/' . $endpoint . '/';\n\n if (empty($id) === false)\n {\n $url .= $id;\n }\n\n $now = time();\n $date = date('d M Y H:i:s', $now);\n $URLFriendlyDate = str_replace(' ', '', $date);\n $nonce = rand(100000, 999999); // generated randomly\n\n // Build the digest to send\n $digest = base64_encode(hash_hmac('sha256', $method . \"+/\" . $endpoint . \"/\" . (empty($id) ? '' : $id) . \"+$URLFriendlyDate+$nonce\", $secretKey));\n $x = array(\n 'api_key' => $apiKey,\n 'date' => $date,\n 'nonce' => $nonce,\n 'digest' => $digest\n );\n\n $postfields = array_merge($x, $parameters);\n\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //make sure it returns a response\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); // allow https verification if true\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); // allow https verification if true\n curl_setopt($ch, CURLOPT_POST, true); //tell it we are posting\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query_for_curl($postfields)); //tell it what to post\n //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json')); //response comes back as json\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: multipart/form-data')); //response comes back as json\n $response = curl_exec($ch);\n\n\n // Check if any error occurred\n if (!curl_errno($ch))\n {\n $info = curl_getinfo($ch);\n }\n // Close handle\n curl_close($ch);\n\n //$response = json_decode($response, true);\n\n return $response;\n}",
"public function getSubscriptionDetails($request);",
"function getProducts($page)\n{\n // Update the API URL with the page number\n $api_url = API_URL . '?page=' . $page;\n\n // Initialize the cURL\n $curl = curl_init();\n\n // Configure the cURL\n curl_setopt($curl, CURLOPT_URL, $api_url);\n curl_setopt($curl, CURLOPT_HEADER, true);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_USERPWD, API_USERNAME . ':' . API_PASSWORD);\n curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n\n // Execute the cURL\n $response = curl_exec($curl);\n\n // Extract the headers of the response\n $header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE);\n $header = substr($response, 0, $header_size);\n $header = getHeaders($header);\n\n // Get the total pages and total products from the headers\n $total_pages = $header['X-WP-TotalPages'];\n $total_products = $header['X-WP-Total'];\n\n // Extract body of the response\n $body = substr($response, $header_size);\n\n // Convert the body from string to array\n $body = json_decode($body);\n\n // Define an array to store the products\n $products = array();\n\n // Loop through the response\n foreach ($body as $item) {\n // Only if the catalog visibility is visible\n if ($item->catalog_visibility === 'visible') {\n // Instantiate an object of Product\n $product = new Product();\n\n // Assign the values\n $product->id = $item->id;\n $product->name = $item->name;\n $product->images = $item->images;\n\n // Push the object into the array\n array_push($products, $product);\n }\n }\n\n // Destroy the cURL instance\n curl_close($curl);\n\n // Encapsulate all the data in an array\n $data = array(\n \"total_pages\" => $total_pages,\n \"total_products\" => $total_products,\n \"products\" => $products\n );\n\n return $data;\n}",
"public function prescriptions()\n {\n return $this->hasManyThrough( Prescription::class, Appointment::class);\n }",
"function get_all_purchase_requests($db)\n{\n $sql = \"SELECT * FROM purchase_requests\";\n $st= $db->prepare($sql);\n $st->execute();\n $us = $st->fetchAll();\n return $us;\n}",
"public function getSellerList(Request $request){\n $pid=$request->pid;\n if(!empty($pid)){\n $pid_val=$pid;\n }else{\n $pid_val=\"\";\n }\n\n $filter_type=[]; //code is still need to improved\n //Get page number from Ajax\n if(isset($_POST[\"page\"])){\n $page_number = filter_var($_POST[\"page\"], FILTER_SANITIZE_NUMBER_INT, FILTER_FLAG_STRIP_HIGH); //filter number\n if(!is_numeric($page_number)){die('Invalid page number!');} //incase of invalid page number\n }else{\n $page_number = 1; //if there's no page number, set it to 1\n }\n $client = new Client();\n // Grab the client's handler instance.\n $clientHandler = $client->getConfig('handler');\n // Create a middleware that echoes parts of the request.\n $tapMiddleware = Middleware::tap(function ($request) {\n $request->getHeaderLine('Content-Type');\n // application/json\n $request->getBody();\n\n });\n\n\n $response = $client->request('POST', Config::get('ayra.apiList.SELLER_LIST'), [\n 'json' => [\n 'API_TOKEN' => '',\n 'category_id' =>$pid_val,\n 'filters' => $filter_type,\n 'is_gold_supplier' => '0',\n 'is_trade_assurance' => '0',\n 'moq' => '0',\n 'order' => 'asc',\n 'page' => $page_number,\n 'search_keyword' => '',\n 'sort' => '',\n ],\n 'handler' => $tapMiddleware($clientHandler)\n ]);\n // echo $response->getBody()->getContents();\n$data_arr=json_decode($response->getBody()->getContents());\n\n$item_per_page \t\t= $data_arr->data->per_page; //item to display per page\n//get total number of records from database\n\n$get_total_rows = $data_arr->data->total; //hold total records in variable\n//break records into pages\n$total_pages = ceil($get_total_rows/$item_per_page);\n//position of records\n$page_position = (($page_number-1) * $item_per_page);\n//Limit our results within a specified range.\n\n\n\n\n\n\n//Display records fetched from database.\n$html='<ul class=\"contents\">';\n// echo \"<pre>\";\nforeach ($data_arr->data->data as $key => $value) {\n\n if($value->image==\"\"){\n $avatar = new LetterAvatar($value->name);\n\n }else{\n $avatar=$value->image;\n }\n $html='<div class=\"pr_display_card\">\n <div class=\"row\">\n\n <div class=\"col-md-2\">\n <div class=\"pr_thumbnail\">\n\n <img width=\"145px\" class=\"img_circle\" src=\"'.$avatar.'\" >\n </div>\n </div>\n <div class=\"col-md-8\">\n <div class=\"pr_content_card\">\n <div class=\"company_list_card\">\n <ul class=\"list-inline\">\n <li>\n <span class=\"sh1\">'.$value->name.'</span> <span> '.$value->location.'</span>\n </li>\n </ul>\n <span class=\"splbxinh24\" >Main Product</span>\n </div>\n </div>\n <div class=\"navcontainer_aj\">\n <ul>';\n\n foreach ($value->main_products as $key => $mp_value) {\n // echo \"<pre>\";\n // print_r($mp_value);\n $pname1=str_replace('/', '-', $mp_value->name);\n $pname=str_replace(' ', '-', $pname1);\n\n echo $plinka=preg_replace('/\\s+/u', '-', trim($pname));\n echo \"<br>\";\n\n\n\n\n $urllink=route('seller-detail', ['id' =>$value->id,'name' =>$plinka]);\n\n $html .='<li><a href=\"'.URL::to('/product-detail/'.$mp_value->id.\"/\".$plinka).'\">\n <img src=\"'.$mp_value->image.'\" width=\"110%\" style=\"min-height:110px;\">\n <span class=\"ist\">'.$mp_value->name.'</span>\n\n </a>\n </li>';\n }\n\n\n\n $html .='</ul>\n </div>\n </div>\n <div class=\"col-md-1\">\n <span class=\"comp_img_tag_img\">\n <img src=\"'.$value->group_image.'\" alt\"\" width=\"75px\">\n </span>\n <a href=\"'.$urllink.'\" class=\"btn btn-primary btn-ms aj_button_req\" name=\"button\">View Details</a> </div>\n </div>\n </div>';\n\n echo $html .='</ul>';\n\n\n}\necho '<div align=\"center\">';\n// To generate links, we call the pagination function here.\necho $this->paginate_function($item_per_page, $page_number, $get_total_rows, $total_pages);\necho '</div>';\n\n}",
"public function apiFetch( $limit, $offset );",
"public function exchangeRate() {\n try{\n $client = new GuzzleHttp\\Client(['base_uri' => 'https://api.exchangeratesapi.io/']);\n // Latest endpoint \n $response = $client->request('GET', 'latest');\n $statusCode = $response->getStatusCode();\n if($statusCode == 200) {\n // Get body of the response and stringify\n $body = (string)$response->getBody();\n // Parse json to ApiResponse Object\n $apiResponse = new ApiResponse($body);\n // Print associative response to console\n print_r($apiResponse);\n }\n }catch(Exception $e){\n echo $e;\n }\n\n }",
"public function getCreditRequests()\n {\n $search['q'] = request('q');\n\n $partner = auth()->user()->companies->first();\n\n $creditRequests = CreditRequest::search($search['q'])->with('quotation.user','user','credits')->paginate(10);\n\n return $creditRequests;\n /*$creditRequestsPublic = CreditRequest::search($search['q'])->where('public',1)->with('quotation.user','user','shippings')->get()->all();\n \n $creditRequestsPrivate = CreditRequest::search($search['q'])->where('public', 0)->whereHas('suppliers', function($q) use($partner){\n $q->where('shipping_request_supplier.supplier_id', $partner->id);\n })->get()->all();\n\n $creditRequests = array_collapse([$creditRequestsPublic, $creditRequestsPrivate]);\n\n // dd($creditRequests);\n \n \n $paginator = paginate($creditRequests, 10);\n \n return $paginator; */\n \n \n\n \n \n }",
"function &getSubscriptions($rangeInfo = null) {\n\t\t$result =& $this->retrieveRange(\n\t\t\t'SELECT s.*, iss.*\n\t\t\tFROM\n\t\t\tsubscriptions s,\n\t\t\tsubscription_types st,\n\t\t\tinstitutional_subscriptions iss\n\t\t\tWHERE s.type_id = st.type_id\n\t\t\tAND st.institutional = 1\n\t\t\tAND s.subscription_id = iss.subscription_id\n\t\t\tORDER BY\n\t\t\tiss.institution_name ASC,\n\t\t\ts.subscription_id',\n\t\t\tfalse,\n\t\t\t$rangeInfo\n\t\t);\n\n\t\t$returner = new DAOResultFactory($result, $this, '_returnSubscriptionFromRow');\n\n\t\treturn $returner;\n\t}",
"abstract function getPairsFromAPI();",
"public function getPLNPrepaidPricelist()\n {\n $user = Auth::user();\n $quickbuy = false;\n if ($user->is_store) {\n $quickbuy = true;\n }\n $priceArr = [];\n // get all Prepaid Pricelist data from Cache if available or fresh fetch from API\n $prepaidPricelist = $this->getAllPrepaidPricelist();\n foreach ($prepaidPricelist['data'] as $row) {\n if ($row['category'] == 'PLN') {\n if ($row['price'] <= 40000) {\n $initPrice = $row['price'] + 50;\n }\n if ($row['price'] > 40000) {\n $initPrice = $row['price'] + 70;\n }\n // Here we add 4% (2% for Profit Sharing Conribution, 2% for Seller's profit)\n // We also round-up last 3 digits to 500 increments, all excess will be Seller's profit\n $addedPrice = $initPrice + 2000;\n $last3DigitsCheck = substr($addedPrice, -3);\n $check = 500 - $last3DigitsCheck;\n if ($check == 0) {\n $price = $addedPrice;\n }\n if ($check > 0 && $check < 500) {\n $price = $addedPrice + $check;\n }\n if ($check == 500) {\n $price = $addedPrice;\n }\n if ($check < 0) {\n $price = $addedPrice + (500 + $check);\n }\n\n if ($row['brand'] == 'PLN') {\n $priceArr[] = [\n 'buyer_sku_code' => $row['buyer_sku_code'],\n 'desc' => $row['desc'],\n 'price' => $price,\n 'brand' => $row['brand'],\n 'product_name' => $row['product_name'],\n 'seller_name' => $row['seller_name']\n ];\n }\n }\n }\n\n $pricelist = collect($priceArr)->sortBy('price')->toArray();\n $pricelistCall = null; //placeholder\n\n return view('member.app.shopping.prepaid_pricelist')\n ->with('title', 'Token PLN')\n ->with(compact('pricelist'))\n ->with(compact('pricelistCall'))\n ->with(compact('quickbuy'))\n ->with('type', 3);\n }",
"function alr_clima_provincias()\n{\n\t$response=array();\n\t$feed_url = \"http://api.tiempo.com/index.php?api_lang=ar&pais=67&affiliate_id=jcp8s666brbh\";\n\t$curl = curl_init();\n\tcurl_setopt($curl, CURLOPT_URL,$feed_url);\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 0);\n\t$xmlProv = curl_exec($curl);\n\tif(curl_errno($curl)==0) \n\t{\n\t\t$xml = simplexml_load_string($xmlProv);\n\t\tif(isset($xml->location->data[0]->name)) \n\t\t{\n\t\t\t$x=0;\n\t\t\tforeach ($xml->location->data as $prov) \n\t\t\t{\n\t\t\t\t$pid=intval($prov->name->attributes()->id);\n\t\t\t\t$response[$pid]=(string) $prov->name;\n\t\t\t\t$x++;\t \t\n \t }\n\t\t}\n\t}\n\tcurl_close($curl);\t\t\t\n\treturn $response;\n}",
"public function LoadList()\n {\n $this->SetCulture();\n $this->subscriptions_list = $this->GetSubscriptionsList();\n }",
"function user_subscription_plans()\n {\n global $ilance, $phrase, $ilconfig;\n \n $notice = $failedrenewalusernames = $noautopayrenewalusernames = $paidrenewalusernames = $freerenewalusernames = '';\n $failedrenewalcount = $noautopayrenewalcount = $paidrenewalcount = $freerenewalcount = 0;\n $slng = isset($_SESSION['ilancedata']['user']['slng']) ? $_SESSION['ilancedata']['user']['slng'] : 'eng'; \n \n\t\t// find all plans that have expired- don't include recurring subscriptions..\n $subscriptioncheck = $ilance->db->query(\"\n SELECT u.*, s.id, s.subscriptionid, s.user_id, s.paymethod, s.startdate, s.renewdate, s.autopayment as subscription_autopayment, s.active, s.cancelled, s.migrateto, s.migratelogic, s.recurring, s.invoiceid, s.roleid, s.autorenewal\n FROM \" . DB_PREFIX . \"subscription_user AS s,\n \" . DB_PREFIX . \"users AS u\n WHERE u.user_id = s.user_id\n AND s.renewdate <= '\" . DATETODAY . \" \" . TIMENOW . \"'\n AND s.cancelled = '0'\n AND s.recurring = '0'\n AND u.status = 'active'\n GROUP BY u.user_id\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($subscriptioncheck) > 0)\n {\n \t\n\t\t\t\n while ($res_subscription_check = $ilance->db->fetch_array($subscriptioncheck, DB_ASSOC))\n {\n // #### AUTO SUBSCRIPTION MIGRATION ############\n // did admin specify this subscription plan will migrate the user to another?\n if ($res_subscription_check['migrateto'] > 0)\n {\n $sql_subscription_plan = $ilance->db->query(\"\n SELECT subscriptionid, title_\" . $slng . \" AS title, description_\" . $slng . \" AS description, cost, length, units, subscriptiongroupid, roleid, active, canremove, visible_registration, visible_upgrade, icon, migrateto, migratelogic\n FROM \" . DB_PREFIX . \"subscription\n WHERE subscriptionid = '\" . $res_subscription_check['migrateto'] . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql_subscription_plan) > 0)\n {\n $subscription_plan_result = $ilance->db->fetch_array($sql_subscription_plan, DB_ASSOC);\n $sql_user = $ilance->db->query(\"\n SELECT user_id, email, username\n FROM \" . DB_PREFIX . \"users\n WHERE user_id = '\" . $res_subscription_check['user_id'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql_user) > 0)\n {\n $res_user = $ilance->db->fetch_array($sql_user, DB_ASSOC);\n switch ($res_subscription_check['migratelogic'])\n {\n\t\t\t\t\t\t\t\t// no transaction will be created\n case 'none':\n {\n $subscription_length = $this->subscription_length($subscription_plan_result['units'], $subscription_plan_result['length']);\n $subscription_renew_date = print_subscription_renewal_datetime($subscription_length);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"subscription_user\n SET active = 'yes',\n renewdate = '\" . $subscription_renew_date . \"',\n startdate = '\" . DATETIME24H . \"',\n subscriptionid = '\" . $subscription_plan_result['subscriptionid'] . \"',\n migrateto = '\" . $subscription_plan_result['migrateto'] . \"',\n migratelogic = '\" . $subscription_plan_result['migratelogic'] . \"',\n invoiceid = '0'\n WHERE user_id = '\" . $res_user['user_id'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $freerenewalusernames .= $res_user['username'] . ', ';\n $freerenewalcount++;\n break;\n } \n // insert waived transaction & activate new subscription plan\n\t\t\t\t\t\t\t\tcase 'waived':\n {\n $renewed_invoice_id = $ilance->accounting->insert_transaction(\n intval($res_subscription_check['subscriptionid']),\n 0,\n 0,\n intval($res_user['user_id']),\n 0,\n 0,\n 0,\n '{_subscription_payment_for} ' . $subscription_plan_result['title'] . ' (' . $subscription_plan_result['length'] . print_unit($subscription_plan_result['units']) . ')',\n '0.00',\n '0.00',\n 'paid',\n 'subscription',\n $res_subscription_check['paymethod'],\n DATETIME24H,\n DATEINVOICEDUE,\n DATETIME24H,\n '{_subscription_plan_migrated_to} ' . $subscription_plan_result['title'],\n 0,\n 0,\n 1\n );\n $subscription_length = $this->subscription_length($subscription_plan_result['units'], $subscription_plan_result['length']);\n $subscription_renew_date = print_subscription_renewal_datetime($subscription_length);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"subscription_user\n SET active = 'yes',\n renewdate = '\" . $subscription_renew_date . \"',\n startdate = '\" . DATETIME24H . \"',\n subscriptionid = '\" . $subscription_plan_result['subscriptionid'] . \"',\n migrateto = '\" . $subscription_plan_result['migrateto'] . \"',\n migratelogic = '\" . $subscription_plan_result['migratelogic'] . \"',\n invoiceid = '\" . $renewed_invoice_id.\"'\n WHERE user_id = '\" . $res_user['user_id'].\"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $freerenewalusernames .= $res_user['username'] . ', ';\n $freerenewalcount++;\n break;\n } \n // insert unpaid transaction & deactivate new subscription plan\n\t\t\t\t\t\t\t\tcase 'unpaid':\n {\n\t\t\t\t\t\t\t\t\tif ($res_subscription_check['active'] == 'yes')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// customer may log-in and make payment via online account\n\t\t\t\t\t\t\t\t\t\t$renewed_invoice_id = $ilance->accounting->insert_transaction(\n\t\t\t\t\t\t\t\t\t\t\t$res_subscription_check['subscriptionid'],\n\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t$res_user['user_id'],\n\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t'{_subscription_payment_for} ' . $subscription_plan_result['title'] . ' (' . $subscription_plan_result['length'] . print_unit($subscription_plan_result['units']) . ')',\n\t\t\t\t\t\t\t\t\t\t\tsprintf(\"%01.2f\", $subscription_plan_result['cost']),\n\t\t\t\t\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t\t\t\t\t'scheduled',\n\t\t\t\t\t\t\t\t\t\t\t'subscription',\n\t\t\t\t\t\t\t\t\t\t\t$res_subscription_check['paymethod'],\n\t\t\t\t\t\t\t\t\t\t\tDATETIME24H,\n\t\t\t\t\t\t\t\t\t\t\tDATEINVOICEDUE,\n\t\t\t\t\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t\t\t\t\t'{_subscription_plan_migrated_to} ' . $subscription_plan_result['title'],\n\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t1\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t// update subscription table\n\t\t\t\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"subscription_user\n\t\t\t\t\t\t\t\t\t\t\tSET active = 'no',\n\t\t\t\t\t\t\t\t\t\t\tsubscriptionid = '\" . $subscription_plan_result['subscriptionid'] . \"',\n\t\t\t\t\t\t\t\t\t\t\tmigrateto = '\" . $subscription_plan_result['migrateto'] . \"',\n\t\t\t\t\t\t\t\t\t\t\tmigratelogic = '\" . $subscription_plan_result['migratelogic'] . \"',\n\t\t\t\t\t\t\t\t\t\t\tinvoiceid = '\" . $renewed_invoice_id . \"'\n\t\t\t\t\t\t\t\t\t\t\tWHERE user_id = '\" . $res_user['user_id'] . \"'\n\t\t\t\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\t// log subscription email for today so we do not resend\n\t\t\t\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\tINSERT INTO \" . DB_PREFIX . \"subscriptionlog\n\t\t\t\t\t\t\t\t\t\t\t(subscriptionlogid, user_id, date_sent)\n\t\t\t\t\t\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t\t\t\t\tNULL,\n\t\t\t\t\t\t\t\t\t\t\t'\" . $res_user['user_id'] . \"',\n\t\t\t\t\t\t\t\t\t\t\t'\" . DATETODAY . \"')\n\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\t// insert subscription invoice reminder so we don't resend again today\n\t\t\t\t\t\t\t\t\t\t$dateremind = $ilance->datetimes->fetch_date_fromnow($ilconfig['invoicesystem_daysafterfirstreminder']);\n\t\t\t\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\tINSERT INTO \" . DB_PREFIX . \"invoicelog\n\t\t\t\t\t\t\t\t\t\t\t(invoicelogid, user_id, invoiceid, invoicetype, date_sent, date_remind)\n\t\t\t\t\t\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t\t\t\t\tNULL,\n\t\t\t\t\t\t\t\t\t\t\t'\" . $res_subscription_check['user_id'] . \"',\n\t\t\t\t\t\t\t\t\t\t\t'\" . $renewed_invoice_id . \"',\n\t\t\t\t\t\t\t\t\t\t\t'subscription',\n\t\t\t\t\t\t\t\t\t\t\t'\" . DATETODAY . \"',\n\t\t\t\t\t\t\t\t\t\t\t'\" . $dateremind . \"')\n\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t}\n $failedrenewalusernames .= $res_user['username'] . ', ';\n $failedrenewalcount++;\n break;\n } \n // create paid transaction\n\t\t\t\t\t\t\t\tcase 'paid':\n {\n $renewed_invoice_id = $ilance->accounting->insert_transaction(\n intval($res_subscription_check['subscriptionid']),\n 0,\n 0,\n intval($res_user['user_id']),\n 0,\n 0,\n 0,\n '{_subscription_payment_for} ' . $subscription_plan_result['title'] . ' (' . $subscription_plan_result['length'] . print_unit($subscription_plan_result['units']) . ')',\n sprintf(\"%01.2f\", $subscription_plan_result['cost']),\n sprintf(\"%01.2f\", $subscription_plan_result['cost']),\n 'paid',\n 'subscription',\n $res_subscription_check['paymethod'],\n DATETIME24H,\n DATEINVOICEDUE,\n DATETIME24H,\n '{_subscription_plan_migrated_to} ' . $subscription_plan_result['title'],\n 0,\n 0,\n 1\n );\n $subscription_length = $this->subscription_length($subscription_plan_result['units'], $subscription_plan_result['length']);\n $subscription_renew_date = print_subscription_renewal_datetime($subscription_length);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"subscription_user\n SET active = 'yes',\n renewdate = '\" . $subscription_renew_date . \"',\n startdate = '\" . DATETIME24H . \"',\n subscriptionid = '\" . $subscription_plan_result['subscriptionid'] . \"',\n migrateto = '\" . $subscription_plan_result['migrateto'] . \"',\n migratelogic = '\" . $subscription_plan_result['migratelogic'] . \"',\n invoiceid = '\" . $renewed_invoice_id . \"'\n WHERE user_id = '\" . $res_user['user_id'] . \"'\n \", 0, null, __FILE__, __LINE__);\n $paidrenewalusernames .= $res_user['username'] . ', ';\n $paidrenewalcount++;\n break;\n }\n }\n if ($res_subscription_check['migratelogic'] != 'none' AND $res_subscription_check['active'] == 'yes')\n {\n\t\t\t\t\t\t\t\t// obtain any unpaid subscription migration invoice\n\t\t\t\t\t\t\t\t$sql_new_invoice = $ilance->db->query(\"\n\t\t\t\t\t\t\t\t\tSELECT amount, invoiceid, description\n\t\t\t\t\t\t\t\t\tFROM \" . DB_PREFIX . \"invoices\n\t\t\t\t\t\t\t\t\tWHERE invoiceid = '\" . intval($renewed_invoice_id) . \"'\n\t\t\t\t\t\t\t\t\t\tAND (status = 'unpaid' OR status = 'scheduled')\n\t\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\tif ($ilance->db->num_rows($sql_new_invoice) > 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$res_new_invoice = $ilance->db->fetch_array($sql_new_invoice, DB_ASSOC);\n\t\t\t\t\t\t\t\t\tif ($res_subscription_check['subscription_autopayment'] == '1')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// subscription log > did we already sent an email to this customer?\n\t\t\t\t\t\t\t\t\t\t$senttoday = $ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\tSELECT subscriptionlogid\n\t\t\t\t\t\t\t\t\t\t\tFROM \" . DB_PREFIX . \"subscriptionlog\n\t\t\t\t\t\t\t\t\t\t\tWHERE user_id = '\" . $res_user['user_id'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t AND date_sent = '\" . DATETODAY . \"'\n\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\tif ($ilance->db->num_rows($senttoday) == 0)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t// log subscription email for today and send email to customer\n\t\t\t\t\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\t\tINSERT INTO \" . DB_PREFIX . \"subscriptionlog\n\t\t\t\t\t\t\t\t\t\t\t\t(subscriptionlogid, user_id, date_sent)\n\t\t\t\t\t\t\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t\t\t\t\t\tNULL,\n\t\t\t\t\t\t\t\t\t\t\t\t'\" . $res_user['user_id'] . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t'\" . DATETODAY . \"')\n\t\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\t\t// subscription renewal via online account balance\n\t\t\t\t\t\t\t\t\t\t\t$sq1_account_balance = $ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\t\tSELECT available_balance, total_balance\n\t\t\t\t\t\t\t\t\t\t\t\tFROM \" . DB_PREFIX . \"users\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE user_id = '\" . $res_user['user_id'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\t\tif ($ilance->db->num_rows($sq1_account_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\t$get_account_array = $ilance->db->fetch_array($sq1_account_balance, DB_ASSOC);\n\t\t\t\t\t\t\t\t\t\t\t\tif ($get_account_array['available_balance'] >= $res_new_invoice['amount'])\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$now_total = $get_account_array['total_balance'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$now_avail = $get_account_array['available_balance'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$new_total = ($now_total - $res_new_invoice['amount']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$new_avail = ($now_avail - $res_new_invoice['amount']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// re-adjust customers online account balance (minus subscription fee amount)\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"users\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSET available_balance = '\" . sprintf(\"%01.2f\", $new_avail) . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttotal_balance = '\" . sprintf(\"%01.2f\", $new_total) . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE user_id = '\" . $res_user['user_id'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// pay existing subscription invoice via online account\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"invoices\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSET status = 'paid',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaid = '\" . sprintf(\"%01.2f\", $res_new_invoice['amount']) . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaiddate = '\" . DATETIME24H . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE user_id = '\" . $res_user['user_id'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t AND invoiceid = '\" . $res_new_invoice['invoiceid'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// adjust members total amount received for referral payments from admin\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->accounting_payment->insert_income_reported($res_user['user_id'], sprintf(\"%01.2f\", $res_new_invoice['amount']), 'credit');\n\t\t\t\t\t\t\t\t\t\t\t\t\t// update customer subscription table with new subscription information\n\t\t\t\t\t\t\t\t\t\t\t\t\t$subscription_length = $this->subscription_length($subscription_plan_result['units'], $subscription_plan_result['length']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$subscription_renew_date = print_subscription_renewal_datetime($subscription_length);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// update subscription table\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"subscription_user\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSET active = 'yes',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\trenewdate = '\" . $subscription_renew_date . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartdate = '\" . DATETIME24H . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsubscriptionid = '\" . $subscription_plan_result['subscriptionid'] . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmigrateto = '\" . $subscription_plan_result['migrateto'] . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmigratelogic = '\" . $subscription_plan_result['migratelogic'] . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tinvoiceid = '\" . $res_new_invoice['invoiceid'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE user_id = '\" . $res_user['user_id'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->email->mail = $res_user['email'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->email->slng = fetch_user_slng($res_user['user_id']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->email->get('subscription_payment_renewed');\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->email->set(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{{customer}}' => $res_user['username'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{{amount}}' => $ilance->currency->format($res_new_invoice['amount']),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{{description}}' => $res_new_invoice['description'],\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$ilance->email->send();\n\t\t\t\t\t\t\t\t\t\t\t\t\t$paidrenewalusernames .= $res_user['username'] . ', ';\n\t\t\t\t\t\t\t\t\t\t\t\t\t$paidrenewalcount++; \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 }\n }\n }\n // #### REGULAR SUBSCRIPTION RENEWAL [NO AUTO-MIGRATION] #######\n else\n {\n $sql_user = $ilance->db->query(\"\n SELECT first_name, last_name, username, email, user_id\n FROM \" . DB_PREFIX . \"users\n WHERE user_id = '\" . $res_subscription_check['user_id'] . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql_user) > 0)\n {\n $res_user = $ilance->db->fetch_array($sql_user, DB_ASSOC);\n $ilance->subscription_plan->deactivate_subscription_plan($res_subscription_check['user_id']);\n if ($res_subscription_check['autorenewal'] > 0)\n {\n\t\t\t\t\t\t\t// obtain customer subscription plan information\n\t\t\t\t\t\t\t$sql_subscription_plan = $ilance->db->query(\"\n\t\t\t\t\t\t\t\tSELECT cost, title_\" . $slng . \" AS title, length, units, migrateto, migratelogic, subscriptionid\n\t\t\t\t\t\t\t\tFROM \" . DB_PREFIX . \"subscription\n\t\t\t\t\t\t\t\tWHERE subscriptionid = '\" . $res_subscription_check['subscriptionid'] . \"'\n\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\tif ($ilance->db->num_rows($sql_subscription_plan) > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$subscription_plan_result = $ilance->db->fetch_array($sql_subscription_plan, DB_ASSOC);\n\t\t\t\t\t\t\t\t// if the subscription plan's cost is free, auto-renew subscription for this user\n\t\t\t\t\t\t\t\tif ($subscription_plan_result['cost'] > 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$senttoday = $ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\tSELECT user_id\n\t\t\t\t\t\t\t\t\t\tFROM \" . DB_PREFIX . \"subscriptionlog\n\t\t\t\t\t\t\t\t\t\tWHERE user_id = '\" . $res_subscription_check['user_id'] . \"'\n\t\t\t\t\t\t\t\t\t\t AND date_sent = '\" . DATETODAY . \"'\n\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\tif ($ilance->db->num_rows($senttoday) == 0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// log subscription email for today and send email to customer\n\t\t\t\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\tINSERT INTO \" . DB_PREFIX . \"subscriptionlog\n\t\t\t\t\t\t\t\t\t\t\t(subscriptionlogid, user_id, date_sent)\n\t\t\t\t\t\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t\t\t\t\tNULL,\n\t\t\t\t\t\t\t\t\t\t\t'\" . $res_subscription_check['user_id'] . \"',\n\t\t\t\t\t\t\t\t\t\t\t'\" . DATETODAY . \"')\n\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\t// do we already have a scheduled subscription invoice for this customer?\n\t\t\t\t\t\t\t\t\t\t$sqlpaidchk = $ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\tSELECT invoiceid\n\t\t\t\t\t\t\t\t\t\t\tFROM \" . DB_PREFIX . \"invoices\n\t\t\t\t\t\t\t\t\t\t\tWHERE user_id = '\" . $res_user['user_id'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\tAND subscriptionid = '\" . $res_subscription_check['subscriptionid'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\tAND (status = 'scheduled' OR status = 'unpaid')\n\t\t\t\t\t\t\t\t\t\t\t\tAND invoicetype = 'subscription'\n\t\t\t\t\t\t\t\t\t\t\t\tAND (paid = '0.00' OR paid = '' OR paid = '0')\n\t\t\t\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\tif ($ilance->db->num_rows($sqlpaidchk) > 0)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t// yes customer already has pending subscription transaction associated to this subscription id so use this instead\n\t\t\t\t\t\t\t\t\t\t\t$respaid = $ilance->db->fetch_array($sqlpaidchk, DB_ASSOC);\n\t\t\t\t\t\t\t\t\t\t\t$renewed_invoice_id = $respaid['invoiceid'];\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$renewed_invoice_id = $ilance->accounting->insert_transaction(\n\t\t\t\t\t\t\t\t\t\t\t\tintval($res_subscription_check['subscriptionid']),\n\t\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t\tintval($res_user['user_id']),\n\t\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t\t'{_subscription_payment_for}' . ' ' . $subscription_plan_result['title'] . ' (' . $subscription_plan_result['length'] . print_unit($subscription_plan_result['units']) . ')',\n\t\t\t\t\t\t\t\t\t\t\t\tsprintf(\"%01.2f\", $subscription_plan_result['cost']),\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'scheduled',\n\t\t\t\t\t\t\t\t\t\t\t\t'subscription',\n\t\t\t\t\t\t\t\t\t\t\t\t$res_subscription_check['paymethod'],\n\t\t\t\t\t\t\t\t\t\t\t\tDATETIME24H,\n\t\t\t\t\t\t\t\t\t\t\t\tDATEINVOICEDUE,\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'',\n\t\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t\t1\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// insert subscription invoice reminder so we don't resend again today\n\t\t\t\t\t\t\t\t\t\t$dateremind = $ilance->datetimes->fetch_date_fromnow($ilconfig['invoicesystem_daysafterfirstreminder']);\n\t\t\t\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\tINSERT INTO \" . DB_PREFIX . \"invoicelog\n\t\t\t\t\t\t\t\t\t\t\t(invoicelogid, user_id, invoiceid, invoicetype, date_sent, date_remind)\n\t\t\t\t\t\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t\t\t\t\tNULL,\n\t\t\t\t\t\t\t\t\t\t\t'\" . $res_subscription_check['user_id'] . \"',\n\t\t\t\t\t\t\t\t\t\t\t'\" . intval($renewed_invoice_id) . \"',\n\t\t\t\t\t\t\t\t\t\t\t'subscription',\n\t\t\t\t\t\t\t\t\t\t\t'\" . DATETODAY . \"',\n\t\t\t\t\t\t\t\t\t\t\t'\" . $dateremind . \"')\n\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\t// obtain invoice information once again\n\t\t\t\t\t\t\t\t\t\t$sql_new_invoice = $ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\tSELECT totalamount, invoiceid, amount, description\n\t\t\t\t\t\t\t\t\t\t\tFROM \" . DB_PREFIX . \"invoices\n\t\t\t\t\t\t\t\t\t\t\tWHERE invoiceid = '\" . intval($renewed_invoice_id) . \"'\n\t\t\t\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\tif ($ilance->db->num_rows($sql_new_invoice) > 0)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$res_new_invoice = $ilance->db->fetch_array($sql_new_invoice, DB_ASSOC);\n\t\t\t\t\t\t\t\t\t\t\t// auto-payments checkup (user sets this option via subscription menu)\n\t\t\t\t\t\t\t\t\t\t\tif ($res_subscription_check['subscription_autopayment'] == '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// subscription renewal via online account balance\n\t\t\t\t\t\t\t\t\t\t\t\t$sq1_account_balance = $ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tSELECT available_balance, total_balance\n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM \" . DB_PREFIX . \"users\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE user_id = '\" . $res_user['user_id'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\t\t\tif ($ilance->db->num_rows($sq1_account_balance) > 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$get_account_array = $ilance->db->fetch_array($sq1_account_balance, DB_ASSOC);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// #### ONLINE ACCOUNT BALANCE CHECK UP ####################################\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($get_account_array['available_balance'] >= $res_new_invoice['totalamount'])\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$now_total = $get_account_array['total_balance'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$now_avail = $get_account_array['available_balance'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$new_total = ($now_total - $res_new_invoice['totalamount']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$new_avail = ($now_avail - $res_new_invoice['totalamount']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// re-adjust customers online account balance (minus subscription fee amount)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"users\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSET available_balance = '\" . sprintf(\"%01.2f\", $new_avail) . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttotal_balance = '\" . sprintf(\"%01.2f\", $new_total) . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE user_id = '\" . $res_user['user_id'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// pay existing subscription invoice via online account\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"invoices\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSET status = 'paid',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaid = '\" . sprintf(\"%01.2f\", $res_new_invoice['totalamount']) . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaiddate = '\" . DATETIME24H . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE user_id = '\" . $res_user['user_id'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t AND invoiceid = '\" . $res_new_invoice['invoiceid'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// record spending habits for this user\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->accounting_payment->insert_income_spent($res_user['user_id'], sprintf(\"%01.2f\", $res_new_invoice['totalamount']), 'credit');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// update customer subscription table with new subscription information\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$subscription_length = $this->subscription_length($subscription_plan_result['units'], $subscription_plan_result['length']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$subscription_renew_date = print_subscription_renewal_datetime($subscription_length);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"subscription_user\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSET active = 'yes',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trenewdate = '\" . $subscription_renew_date . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartdate = '\" . DATETIME24H . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmigrateto = '\" . $subscription_plan_result['migrateto'] . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmigratelogic = '\" . $subscription_plan_result['migratelogic'] . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tinvoiceid = '\" . $res_new_invoice['invoiceid'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE user_id = '\" . $res_user['user_id'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t AND subscriptionid = '\" . $subscription_plan_result['subscriptionid'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\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$ilance->email->mail = $res_user['email'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->email->slng = fetch_user_slng($res_user['user_id']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->email->get('subscription_payment_renewed');\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->email->set(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{{customer}}' => $res_user['username'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{{amount}}' => $ilance->currency->format($res_new_invoice['amount']),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{{description}}' => $res_new_invoice['description'],\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$ilance->email->send();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$paidrenewalusernames .= $res_user['username'] . ', ';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$paidrenewalcount++; \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}\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\t// create waived transaction\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$renewed_invoice_id = $ilance->accounting->insert_transaction(\n\t\t\t\t\t\t\t\t\t\tintval($res_subscription_check['subscriptionid']),\n\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\tintval($res_user['user_id']),\n\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t'{_subscription_payment_for}' . ' ' . $subscription_plan_result['title'] . ' (' . $subscription_plan_result['length'] . print_unit($subscription_plan_result['units']) . ')',\n\t\t\t\t\t\t\t\t\t\t'0.00',\n\t\t\t\t\t\t\t\t\t\t'0.00',\n\t\t\t\t\t\t\t\t\t\t'paid',\n\t\t\t\t\t\t\t\t\t\t'subscription',\n\t\t\t\t\t\t\t\t\t\t'account',\n\t\t\t\t\t\t\t\t\t\tDATETIME24H,\n\t\t\t\t\t\t\t\t\t\tDATEINVOICEDUE,\n\t\t\t\t\t\t\t\t\t\tDATETIME24H,\n\t\t\t\t\t\t\t\t\t\t'{_subscription_plan_was_renewed}',\n\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t1\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t// update subscription table\n\t\t\t\t\t\t\t\t\t$subscription_length = $this->subscription_length($subscription_plan_result['units'], $subscription_plan_result['length']);\n\t\t\t\t\t\t\t\t\t$subscription_renew_date = print_subscription_renewal_datetime($subscription_length);\n\t\t\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"subscription_user\n\t\t\t\t\t\t\t\t\t\tSET active = 'yes',\n\t\t\t\t\t\t\t\t\t\trenewdate = '\" . $subscription_renew_date . \"',\n\t\t\t\t\t\t\t\t\t\tstartdate = '\" . DATETIME24H . \"',\n\t\t\t\t\t\t\t\t\t\tsubscriptionid = '\" . $subscription_plan_result['subscriptionid'] . \"',\n\t\t\t\t\t\t\t\t\t\tmigrateto = '\" . $subscription_plan_result['migrateto'] . \"',\n\t\t\t\t\t\t\t\t\t\tmigratelogic = '\" . $subscription_plan_result['migratelogic'] . \"',\n\t\t\t\t\t\t\t\t\t\tinvoiceid = '\" . $renewed_invoice_id . \"'\n\t\t\t\t\t\t\t\t\t\tWHERE user_id = '\" . $res_user['user_id'] . \"'\n\t\t\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t$freerenewalusernames .= $res_subscription_check['username'] . ', ';\n\t\t\t\t\t\t\t\t\t$freerenewalcount++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n \t\t} \n\t }\n }\n }\n if (!empty($paidrenewalusernames))\n {\n $paidrenewalusernames = mb_substr($paidrenewalusernames, 0, -2);\n }\n else\n {\n $paidrenewalusernames = 'None';\n }\n $notice .= \"Renewed $paidrenewalcount paid subscription plans for the following users: $paidrenewalusernames. \";\n if (!empty($freerenewalusernames))\n {\n $freerenewalusernames = mb_substr($freerenewalusernames, 0, -2);\n }\n else\n {\n $freerenewalusernames = 'None';\n }\n $notice .= \"Renewed $freerenewalcount free subscription plans for the following users: $freerenewalusernames. \";\n }\n else\n {\n $notice .= \"No user subscription plans to expire at this time.\"; \n }\n return $notice;\n }",
"public function getAllActivePromo($post)\n { \n\n $language = isset($post['language'])?$post['language']:'';\n $promo_type = isset($post['promo_type'])?$post['promo_type']:'';\n $device = isset($post['device'])?$post['device']:'1';\n $page = isset($post['page'])?$post['page']:'';\n $perPage = isset($post['perPage'])?$post['perPage']:'';\n $page = ((int)$page > 0 )? $page : 1;\n $perPage = ((int)$perPage > 0 )? $perPage : 0;\n $pageStart = ($page - 1) * $perPage;\n $time = time();\n\n \n $wherQuery = ' AND promo_list.status = 1 and promo_list.id = promo_list_display_language.promo_list_id and delete_status=0 and promo_list_display_language.language_code = \"'.$language.'\" ';\n\n if(!empty($device)){\n $wherQuery .= ' AND ( CASE WHEN promo_list.device != \"\" THEN FIND_IN_SET('.$device.',promo_list.device) ELSE 1 END ) ';\n }\n\n if(!empty($post['player_id'])){\n\n $player_id = $post['player_id'];\n\n $user = ( isset($post['user_info']) && !empty($post['user_info']) ) ? $post['user_info'] : $this->getUserInfo($player_id);\n\n $affiliate_id = $user['affiliate_id'] ?? 0;\n $player_id = $user['id'] ?? 0;\n $player_group_id = $user['player_group_id'] ?? 0;\n $mobile_verification_status = $user['mobile_verification_status'] ?? 0;\n $is__security_pin = $user['is__security_pin'] ?? 0;\n $is__bank = $user['is__bank'] ?? 0;\n $promo_block = $user['promo_block'] ?? 0;\n\n if(!empty($promo_block)){\n $wherQuery .= ' AND 0 ';\n }\n\n /*$wherQuery .= ' AND apply_type = 1 AND \n ( CASE \n WHEN promo_list.target_type = 2 THEN FIND_IN_SET(\\''.$affiliate_id.'\\', promo_list.target_list)\n WHEN promo_list.target_type = 3 THEN FIND_IN_SET(\\''.$player_id.'\\', promo_list.target_list) \n ELSE 1 END )';*/\n\n $wherQuery .= ' AND \n ( CASE \n WHEN promo_list.target_type = 2 THEN FIND_IN_SET(\\''.$affiliate_id.'\\', promo_list.target_list)\n WHEN promo_list.target_type = 3 THEN FIND_IN_SET(\\''.$player_id.'\\', promo_list.target_list) \n ELSE 1 END )';\n \n \n if(!empty($player_group_id)){\n $wherQuery .= ' AND \n ( CASE \n WHEN promo_list.member_level_list != \"\" THEN FIND_IN_SET(\\''.$player_group_id.'\\', promo_list.member_level_list)\n ELSE 1 END )\n ';\n }\n\n // $wherQuery .= ' AND \n // ( CASE \n // WHEN (promo_list.verify_details != \"\" AND FIND_IN_SET(1, promo_list.verify_details) AND '.$mobile_verification_status.' != 1 )\n // THEN 0 ELSE 1 \n // END )';\n\n // $wherQuery .= ' AND \n // ( CASE \n // WHEN (promo_list.verify_details != \"\" AND FIND_IN_SET(2, promo_list.verify_details) AND '.$is__security_pin.' = 0 )\n // THEN 0 ELSE 1 \n // END )';\n // $wherQuery .= ' AND \n // ( CASE \n // WHEN (promo_list.verify_details != \"\" AND FIND_IN_SET(3, promo_list.verify_details) AND '.$is__bank.' = 0)\n // THEN 0 ELSE 1 \n // END )';\n \n // $getAllAppliedPromos = $this->callSql(\"SELECT GROUP_CONCAT(DISTINCT promo_list_id SEPARATOR ',') FROM promo_activity_list WHERE player_id =\".$player_id.\" \", \"value\");\n // $wherFindSet = '';\n // if(!empty($getAllAppliedPromos)){\n // $explodeArr = explode(',',$getAllAppliedPromos);\n // $find_setCond = '';\n // foreach ($explodeArr as $key => $value) {\n // if(!empty($find_setCond)){\n // $find_setCond .= ' OR FIND_IN_SET('.$value.',promo_list.conflict_promos) ';\n\n // }\n // else{\n // $find_setCond .= ' FIND_IN_SET('.$value.',promo_list.conflict_promos) ';\n\n // }\n // }\n // if(count($explodeArr) > 1){\n // $wherFindSet .= ' AND ('.$find_setCond.')';\n // }\n // else{\n // $wherFindSet .= ' AND '.$find_setCond.'';\n // }\n // $wherQuery .= ' AND ( CASE \n // WHEN (promo_list.conflict_promos !=\"\" '.$wherFindSet.' ) THEN\n // 0 ELSE 1 \n // END ) ';\n // } \n \n }\n\n // if(!empty($game_type)){ \n // $wherQuery .= ' AND FIND_IN_SET(\"'.$game_type.'\",promo_list.game_types) ';\n // }\n if(!empty($promo_type)){ \n if(is_array($promo_type)) {\n $promo_type = join(\",\",$promo_type);\n }\n if($promo_type==9) {\n $wherQuery .= ' AND promo_list.promo_type =6 AND promo_list.promo_sub_type=1 '; \n }else{\n $wherQuery .= ' AND promo_list.promo_type IN ('.$promo_type.') '; \n }\n\n \n }\n \n // if(!empty($promo_text)){ \n // $wherQuery .= ' AND promo_list.promo_name LIKE \"%'.$promo_type.'%\" ';\n // }\n\n $query = 'SELECT ';\n $query .= ' promo_list.id,\n promo_list.promo_name,\n promo_list.promo_start_time,\n promo_list.promo_end_time,\n promo_list.promo_sub_type,\n promo_list.promo_type,\n promo_list.promo_name,\n promo_list.is_hot_promo,\n promo_list.apply_type,\n promo_list.game_selection_type,\n promo_list.game_vendors_wallet_id,\n promo_list_display_language.banner_1,\n promo_list_display_language.banner_2,\n promo_list_display_language.description_web,\n promo_list_display_language.description_h5,\n promo_list_display_language.description_app,\n promo_list_display_language.icon,\n CASE\n WHEN promo_list.display_type = 2 THEN promo_list.display_type_url\n ELSE \"\"\n END AS promo_url\n ';\n $query .= ' FROM promo_list,promo_list_display_language WHERE \n ( CASE \n WHEN (promo_list.display_time_type = 1) THEN \n ( CASE \n WHEN promo_list.promo_end_time != 0 THEN promo_list.promo_start_time <= '.$time.' AND (promo_list.promo_end_time) >= '.$time.' \n WHEN promo_list.promo_end_time = 0 THEN promo_list.promo_start_time <= '.$time.' \n ELSE 1\n END )\n WHEN promo_list.display_time_type = 2 THEN promo_list.manual_start_status = 1 \n WHEN promo_list.display_time_type = 3 THEN \n ( CASE \n WHEN promo_list.display_end_time != 0 THEN promo_list.display_start_time <= '.$time.' AND (promo_list.display_end_time) >= '.$time.' \n WHEN promo_list.display_end_time = 0 THEN promo_list.display_start_time <= '.$time.' \n ELSE 1\n END ) \n ELSE 1\n END ) '.$wherQuery.' ORDER BY promo_list.sort_order ASC ';\n\n if(!isset($post['limit']) && $perPage > 0)\n {\n $query .= ' LIMIT '.$pageStart.','.$perPage.''; \n \n } \n \n $this->query($query);\n\n $dataList = $this->resultset();\n \n return $dataList;\n }",
"public function prescriptions() {\n return $this->hasManyThrough('App\\Prescription', 'App\\Patient', 'clinic_id', 'patient_id', 'id');\n }",
"public function index()\n {\n return formatResponse(false,([\n \"purchase_request_details\"=>$this->purchaseRequestDetail->latest()->get()\n ]));\n }"
] | [
"0.6288385",
"0.6215102",
"0.615818",
"0.60320324",
"0.5866467",
"0.5759675",
"0.57515764",
"0.5748731",
"0.5712739",
"0.5676245",
"0.56704015",
"0.56690484",
"0.561701",
"0.5594861",
"0.5583466",
"0.55826485",
"0.5579179",
"0.5561664",
"0.550477",
"0.54889935",
"0.5481133",
"0.54717916",
"0.54680806",
"0.5456736",
"0.54458207",
"0.544282",
"0.5425336",
"0.54189146",
"0.54172075",
"0.5409151",
"0.5403403",
"0.54025066",
"0.5395531",
"0.538506",
"0.5380295",
"0.5379289",
"0.5369303",
"0.53689784",
"0.5361411",
"0.53556037",
"0.53409135",
"0.53351235",
"0.53247553",
"0.53208375",
"0.5320457",
"0.52918017",
"0.5286281",
"0.52789575",
"0.52723885",
"0.5263753",
"0.5263402",
"0.5254432",
"0.5249089",
"0.5245001",
"0.52367175",
"0.5234153",
"0.52320355",
"0.5222367",
"0.52216774",
"0.5213023",
"0.520161",
"0.52004546",
"0.5198788",
"0.5196991",
"0.5164538",
"0.51629347",
"0.5159184",
"0.5158639",
"0.5157856",
"0.515157",
"0.51441795",
"0.51409125",
"0.51286125",
"0.5127788",
"0.511946",
"0.5116334",
"0.5115546",
"0.51110077",
"0.51093054",
"0.51059353",
"0.50929093",
"0.50654453",
"0.5059966",
"0.50586516",
"0.50581205",
"0.5058044",
"0.5056399",
"0.5053267",
"0.5051221",
"0.5045725",
"0.50367546",
"0.503599",
"0.50332975",
"0.5031288",
"0.50265396",
"0.5025717",
"0.50239205",
"0.5022317",
"0.5021109",
"0.50200427"
] | 0.5449934 | 24 |
/ Description Function is to save notes while the doctor's call is going on Author Dave Brown Created 24 December 2014 | public function save_appointment_notes ()
{
if (post_data('appointment_id') == NULL)
{
return;
}
$table_data = array();
$presc_status = FALSE;
$app_response = $app_return_response = $app_status = array();
$table_data['id'] = post_data('id') != NULL ? post_data('id') : 0;
$table_data['appointment_id'] = post_data('appointment_id');
$table_data['history'] = post_data('history') != NULL ? post_data('history') : NULL;
$table_data['examination'] = post_data('examination') != NULL ? post_data('examination') : NULL;
$table_data['diagnosis'] = post_data('diagnosis') != NULL ? post_data('diagnosis') : NULL;
$table_data['management'] = post_data('management') != NULL ? post_data('management') : NULL;
$table_data['medicine_prescription'] = post_data('prescription') != NULL ? json_encode(post_data('prescription')) : NULL;
$table_data['icd_description'] = post_data('icd_list') != NULL ? json_encode(post_data('icd_list')) : NULL;
$table_data['repeat_prescription'] = post_data('repeat_prescription') != NULL ? post_data('repeat_prescription') : 0;
/*--------------------Updating third party's API----------------------------------------*/
if (post_data('create_prescription') == TRUE)
{
$prescription = make_prescription_format(post_data('prescription'));
/*Creating Prescription at Third Party's database*/
$app_response = post_curl_request(THIRD_PARTY_API_URL, json_encode(array(
"action" => "postcreateprescription",
"patientid" => post_data('patient_id'),
"appointmentid" => post_data('appointment_id'),
"doctorid" => session_data('app_user_id'),
"endorsements" => count(post_data('prescription')),
"patientname" => post_data('PatientForename') . ' ' . post_data('PatientSurname'),
"deliveryaddress" => post_data('PatientAddress1') . ' ' .
post_data('PatientAddress2') . ' ' . post_data('PatientAddress3') . ' ' .
post_data('PatientAddress3') . '' . post_data('PatientAddress4') . ' ' .
post_data('PatientAddress5'),
"DOB" => post_data('PatientDOB'),
"Age" => post_data('PatientDOB') != NULL ? date('Y') - date('Y', uk_date_to_stamp(post_data('PatientDOB'))) : NULL,
"telephone" => post_data('PatientMobile'),
"deliverynote" => "New Prescription",
"repeatprescription" => post_data('repeat_prescription'),
"endorsement" => $prescription
)));
/* Updating Icd at Third Party's database */
if (post_data('icd_list') != NULL)
{
$app_return_response['icd_response'] = post_curl_request(THIRD_PARTY_API_URL, json_encode(array(
"action" => "postICDtopatient",
"patientid" => post_data('patient_id'),
"appointmentid" => post_data('appointment_id'),
"icdcodeselected" => post_data('icd_list')['key'],
"icdtitleselected" => post_data('icd_list')['value'],
)));
}
/*Creating patient notes at Third Party's database*/
$app_return_response['patient_notes_response'] = post_curl_request(THIRD_PARTY_API_URL, json_encode(array(
"action" => "postpatientnotes",
"patientid" => post_data('patient_id'),
"appointmentid" => post_data('appointment_id'),
"doctorid" => session_data('app_user_id'),
"history" => post_data('history'),
"examination" => post_data('examination'),
"diagnosis" => post_data('diagnosis'),
"management" => post_data('management'),
)));
if (!empty($app_response) && json_decode($app_response))
{
$presc_status = TRUE;
$table_data['app_id'] = json_decode($app_response);
/* Signing Prescription and updating Third Party's database*/
$app_return_response['sign_response'] = post_curl_request(THIRD_PARTY_API_URL, json_encode(array(
"action" => "prescriptionsign",
"prescriptionid" => $table_data['app_id'],
"doctorid" => session_data('app_user_id')
)));
}
/*-------------------------Updating third party's Database Ends-------------------------*/
if (!empty($app_return_response))
{
foreach ($app_return_response as $key => $val)
{
if (!empty($val) && json_decode($val) && !empty(json_decode($val)->Status) && json_decode($val)->Status == 1)
{
$app_status[$key] = TRUE;
}
else
{
$app_status[$key] = FALSE;
}
}
}
}
$presc_id = $this->appointment_model->save_prescription($table_data);
exit(json_encode(array(
'presc_id' => $presc_id,
'presc_status' => $presc_status,
'app_status' => $app_status,
)));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addPatientNotesToDatabase($fileNumber, $name, $phoneNo, $dateOfBirth, $progressNotes, $dentist)\n{\n $result = ['result' => false, 'message' => 'Unable to save patient Notes !'];\n $isPatientDataValid = isPatientDataValid($fileNumber, $name, $phoneNo, $dateOfBirth);\n if (!$isPatientDataValid['result']) {\n $result['message'] = $isPatientDataValid['message'];\n return $result;\n }\n $data = [\n 'FileNumber' => $fileNumber,\n 'PatientName' => $name,\n 'PatientNo' => $phoneNo,\n 'DOB' => $dateOfBirth,\n 'DentistName' => $dentist,\n ];\n $data['AppointmentDate'] = getDefaultDate();\n $data['AppointmentTime'] = getDefaultDate(null, true);\n $isDentistAvailable = isDentistAvailable($data['DentistName'], $data['AppointmentTime']);\n if (!$isDentistAvailable['result']) {\n $result['message'] = $isDentistAvailable['message'];\n return $result;\n }\n $data['ProgressNotes'] = $progressNotes;\n $appObject = getAppointmentObject($data);\n $appObject = setAppointmentId($appObject);\n $patientSaved = saveRecord(APPOINTMENTS_COLLECTION, $appObject, true);\n\n if ($patientSaved) {\n $result['message'] = \"Patient Notes Saved Successfully\";\n $result['result'] = true;\n return $result;\n }\n return $result;\n}",
"function __updateNotes()\n {\n\n //profiling\n $this->data['controller_profiling'][] = __function__;\n\n //prevent direct access\n if (!isset($_POST['posted'])) {\n //redirect to 'view' url instead\n $this_url = uri_string();\n $redirect = str_replace('update', 'view', $this_url);\n redirect($redirect);\n }\n\n //save sql here\n $result = $this->mynotes_model->updateNote($this->project_id, $this->data['vars']['my_id'], $this->input->post('mynotes_text'));\n $this->data['debug'][] = $this->mynotes_model->debug_data;\n\n //check\n if ($result) {\n $this->notices('success', $this->data['lang']['lang_request_has_been_completed'], 'noty'); //noty or html\n } else {\n $this->notices('error', $this->data['lang']['lang_request_could_not_be_completed'], 'noty'); //noty or html\n }\n\n //get the note\n $this->__viewNotes();\n\n }",
"public function actionSaveNotes()\r\n\t{\n\t\tif(isset($_POST['note']) && isset($_POST['id'])) {\n\t\t\t$employee_id = $_POST['id'];\n\t\t\t$model = $this->loadModel($employee_id, Yii::app()->user->id);\r\n\t\t\t$model->note = $_POST['note'];\n\t\t\t//var_dump($model);die;\r\n\t\t\t$model->save();\r\n\t\t\techo nl2br($model->note);\r\n\t\t}\r\n\t}",
"function createNote();",
"function save_note_to_disk ($note_id, $content) {\n \n if (!file_exists ('notes')) {\n # MAKE DIRECTORY\n mkdir ('notes');\n }\n \n $filename = \"notes/{$note_id}.txt\";\n \n if (!$handler = fopen ($filename, 'w+')) {\n return FALSE;\n }\n \n fwrite ($handler, $content);\n \n fclose ($handler);\n \n return TRUE;\n \n }",
"public function saveNotes(){\n\t \t$note = $this->input->post('notes');\n\t \t$barcode = $this->input->post('child_barcode');\n\n\t \t$update_note = $this->db->query(\"UPDATE LZ_DEKIT_US_DT SET PIC_NOTES = '$note' WHERE BARCODE_PRV_NO = $barcode\");\n\n\t \tif($update_note){\n\t \t\treturn 1;\n\t \t}else{\n\t \t\treturn 0;\n\t \t}\n\n\t }",
"function __editNotes()\n {\n\n //profiling\n $this->data['controller_profiling'][] = __function__;\n\n //get the note\n $this->__viewNotes();\n\n //visibility\n $this->data['visible']['wi_my_note_edit'] = 1;\n $this->data['visible']['wi_my_note_view'] = 0;\n\n }",
"function cust_note_insert(){\r\n\t}",
"public function add_note()\n {\n\n $cols = \"`desc`\";\n\n $value =\n \" '\" . $this->obj->all_data->notes->get_desc() . \"' \";\n\n\n $insert = $this->obj->insert(\"notes\", $cols, $value);\n return $insert;\n }",
"public function saveSellerNotes($id, $notes){\n dibi::update('orders', array('seller_notes' => $notes))\n ->where('order_id = %i', $id)->execute();\n }",
"function saveSampleNotes() {\n\t \n\t \n\t \n\t $data = $this->input->post();\n\t \t \t \n\t if ($this->products_model->saveSampleNotes($data)) {\n\t \n\t \tdie(nl2br($data['notes']));\t \t \n\t \t \t \n\t } else {\n\t\t \n\t\t die(\"ERROR\");\n\t\t \n\t }\n\t \t \n\t \n\t \n }",
"public function saveNote(array $note);",
"function addNote()\n {\n $replace = array();\n\n //current logged in user details\n $userInfo = $this->userInfo();\n\n $patientId = $this->value('patient_id');\n\n $msg = \"\";\n\n //save button clicked!\n if(\"Save\" == $this->value('submitted'))\n {\n $newNote = $this->value('note');\n\n if(strlen(trim($newNote)) == 0)\n {\n $msg = '<div style=\"padding-left:5px;color:red;\">Please enter a note for this patient.</div>';\n }\n else\n {\n $insertArr = array(\n 'patient_id' => $patientId,\n 'provider_id' => $userInfo['user_id'],\n 'note' => $this->encrypt_data($this->value('note')),\n 'created' => date('Y-m-d H:i:s', time())\n );\n\n $result = $this->insert('notepad', $insertArr);\n\n /* if(!$result)\n {\n $msg = '<div style=\"padding-left:5px;\">Failed adding a note.</div>';\n } */\n }\n $privateKey = $this->config['private_key'];\n\n // patient details\n $query = \"SELECT \n AES_DECRYPT(UNHEX(name_first),'{$privateKey}') as name_first,\n AES_DECRYPT(UNHEX(name_last),'{$privateKey}') as name_last \n FROM \n user WHERE user_id = \" . $patientId;\n $result = $this->execute_query($query);\n\n $row = $this->fetch_array($result);\n\n $replace = $this->notesList($patientId);\n $patientName = $row['name_first'] . \" \" . $row['name_last'];\n $replace['patient_id'] = $patientId;\n $replace['patientName'] = $patientName;\n $replace['statusMessage'] = $msg;\n }\n else\n {\n $replace = $this->notesList($patientId);\n }\n\n $replace['patient_id'] = $patientId;\n\n $this->output = $this->build_template($this->get_template(\"addNote\"), $replace);\n }",
"public function SaveNote($note)\n {\n $dataArray = $this->getAllNotes();\n\n if (array_key_exists($note->getNoteID(), $dataArray)) {\n try {\n $dbh = new \\PDO('sqlite:' . $this->fileName);\n $dbh->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n $sql = \"UPDATE note SET subjectLine='\" . $note->getSubjectLine() . \"', authorName='\" . $note->getAuthorName() . \"', date='\" . $note->getDate() . \"', noteBody='\" . $note->getNoteBody() . \"', numOfChar=\" . $note->getNumOfChar() . \" WHERE id=\" . $note->getNoteID();\n // $sql = \"UPDATE note SET subjectLine= :subjectLine, authorName= :authorName , date= :date, noteBody= :noteBody, numOfChar= :numOfChar WHERE id= :id\";\n\n\n // Prepare statement\n $stmt = $dbh->prepare($sql);\n/*\n $stmt->bindParam(':subjectLine',$note->getSubjectLine() , PDO::PARAM_STR, 12);\n $stmt->bindParam(':authorName', $note->getAuthorName() , PDO::PARAM_STR, 12);\n $stmt->bindParam(':noteBody', $note->getNoteBody() , PDO::PARAM_STR, 12);\n $stmt->bindParam(':date', $note->getDate() , PDO::PARAM_STR, 12);\n $stmt->bindParam(':numOfChar', $note->getNumOfChar(), PDO::PARAM_INT);\n $stmt->bindParam(':id', $note->getNoteID(), PDO::PARAM_INT);\n*/\n // execute the query\n $stmt->execute();\n\n // echo a message to say the UPDATE succeeded\n echo $stmt->rowCount() . \" records UPDATED successfully\";\n } catch (PDOException $e) {\n echo $sql . \"<br>\" . $e->getMessage();\n }\n\n $conn = null;\n\n } else {\n //echo \"No note key found\";\n try {\n $dbh = new \\PDO('sqlite:' . $this->fileName);\n $dbh->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n\n\n $dbh->exec(\"INSERT INTO note (subjectLine,noteBody,authorName,date,numOfChar) VALUES ('\" . $note->getSubjectLine() . \"','\" . $note->getNoteBody() . \"','\" . $note->getAuthorName() . \"','\" . $note->getDate() . \"',\" . $note->getNumOfChar() . \")\");\n\n\n $dbh = null;\n } catch (PDOException $e) {\n echo $e->getMessage();\n echo '<a href=\"index.php\" role=\"button\" class=\"btn btn-primary btn-lg\">Home</a>';\n exit(0);\n }\n }\n\n\n }",
"public function save_donation();",
"public function record_comment(){\n\t\t\t\n\t\t}",
"public function save($userId,$notes=null)\n\t{ \n $newILOIds = Content::getILOIds($this->content);\n $oldILOIds = array();\n\n # Update existing discussion\n if(!empty($this->id))\n {\n $query = sprintf(\"SELECT content FROM discussion WHERE id='%s'\",pg_escape_string($this->id));\n $result = $GLOBALS['transaction']->query($query);\n $oldILOIds = Content::getILOIds($result[0]['content']);\n $query = sprintf(\"UPDATE discussion SET element_id = '%s', element_type = '%s', content = '%s' WHERE id='%s'\", \n pg_escape_string($this->elementId),\n pg_escape_string($this->elementType),\n pg_escape_string($this->content),\n pg_escape_string($this->id));\n }\n # New discussion\n else\n {\n $query = sprintf(\"INSERT INTO discussion (element_id, element_type, content) VALUES ('%s','%s','%s')\",\n pg_escape_string($this->elementId),\n pg_escape_string($this->elementType),\n pg_escape_string($this->content));\n }\n\n # Run query\n $GLOBALS['transaction']->query($query,\"Query \".$query.\" failed in Discussion::save()\");\n\n $this->id = parent::URIToId($this->path,\"discussion\");\n $revisionRow = new RevisionRow(\"discussion_history\",\"discussion\");\n $revisionRow->loadFromData(null,$this->id,$this->name,$this->content,$userId,null);\n $revisionRow->save();\n \n require_once(\"classes/resources/Lesson.php\");\n Content::checkILOsExist($this->ilos,$newILOIds);\n $this->saveIlos($userId,$newILOIds,$oldILOIds);\n $this->saveCitations();\n\n return true;\n\t}",
"public function save(KnsprNote $note);",
"public function save_donation() {\r\n\t\t/**\r\n\t\t * Do something here, or save it elsewhere?\r\n\t\t */\r\n\t}",
"function submitNote() {\n $stmt = $GLOBALS['con']->prepare(\"INSERT INTO customerNotes (customer_id, note) VALUES (?, ?)\");\n $stmt->bind_param(\"ss\", $uid, $note);\n \n $note = validateInput('notepad', 'post');\n $uid = validateInput('uid', 'post');\n\n $stmt->execute();\n $stmt->close(); \n }",
"function save_me($creation, $dwl_number, $dwl_last) {\n\n}",
"function editPatientNotesInDatabase($fileNumber, $name, $phoneNo, $dateOfBirth, $firebaseId, $progressNotes)\n{\n $result = ['result' => false, 'message' => 'Unable to edit patient notes !'];\n\n $isPatientDataValid = isPatientDataValid($fileNumber, $name, $phoneNo, $dateOfBirth);\n if (!$isPatientDataValid['result']) {\n $result['message'] = $isPatientDataValid['message'];\n return $result;\n }\n if (!$firebaseId) {\n $result['message'] = 'Please Select Patient Again';\n return $result;\n }\n\n $data = [];\n $patient = getAppointments(['param' => 'FirebaseId', 'operator' => '==', 'value' => $firebaseId], true);\n if (count($patient) > 0) {\n $data = $patient; // old data\n }\n $data['FirebaseId'] = $firebaseId;\n $data['FileNumber'] = $fileNumber;\n $data['PatientName'] = $name;\n $data['PatientNo'] = $phoneNo;\n $data['DOB'] = $dateOfBirth;\n\n $data['ProgressNotes'] = $progressNotes;\n $appObject = getAppointmentObject($data);\n $appObject = setAppointmentId($appObject);\n $patientSaved = saveRecord(APPOINTMENTS_COLLECTION, $appObject, false);\n\n if ($patientSaved) {\n $result['message'] = \"Patient Notes Saved Successfully\";\n $result['result'] = true;\n return $result;\n }\n return $result;\n}",
"public function setNotes($value) {\n\t\tif ($value == NULL) {\n\t\t\t$this->_notes = \"\";\n\t\t} else {\n\t\t\t$this->_notes = $value;\n\t\t}\n\t}",
"public function addnotesAction() {\n\t\t$this->_helper->viewRenderer->setNoRender();\n\t\t$this->_helper->layout()->disableLayout();\n\t\t$id = $this->_getParam('taid');\n\t\t$taFinder = new TeachingActivities();\n\t\t$ta = $taFinder->getTa($id);\n\t\t$notes = stripslashes(strip_tags($this->_getParam('value')));\n\t\t$ta->notes = preg_replace('/[\\r\\n]+/', ' ', $notes);\n\t\t$ta->save();\n\t\techo $ta->notes;\n\t}",
"function edit_notes()\n {\n $query = $this->pdo->prepare('UPDATE note SET description=:description, updated_at=NOW() WHERE id=:id');\n $query->execute(array( ':description' => $_POST['edit-note-text'] ,':id' => $_POST['edit-note-id']));\n \n }",
"public function noteAdd(){\n $user = $this->_ap_right_check();\n if(!$user){\n return;\n } \n $this->Notes->add($user);\n }",
"public function noteAdd(){\n $user = $this->_ap_right_check();\n if(!$user){\n return;\n }\n $this->Notes->add($user);\n }",
"private function saveRecord(): void\r\n {\r\n $this->order->add_meta_data('_moloni_sent', $this->document_id);\r\n $this->order->save();\r\n }",
"public function setNotes($value)\n {\n $this->setItemValue('notes', (string)$value);\n }",
"function warquest_home_comment_save_do() {\r\n\r\n\t/* input */\r\n\tglobal $player;\r\n\tglobal $uid;\r\n\tglobal $other;\r\n\tglobal $comment;\r\n\r\n\t/* output */\r\n\tglobal $output;\r\n\r\n\tif (strlen($comment)>0) {\r\n\t\r\n\t\tif ($uid==0) {\r\n\t\t\twarquest_db_comment_insert(0, 0, $player->pid, $other->pid, $comment);\r\n\t\t} else {\t\t\r\n\t\t\twarquest_db_comment_update($uid, $comment);\r\n\t\t}\r\n\t\t\r\n\t\tif (isset($other->pid)) {\r\n\t\t\r\n\t\t\t$other->comment_notification++;\r\n\t\t\twarquest_comment_mail($other->pid, $comment, $player->name);\r\n\t\t\t$message = t('ALLIANCE_COMMENT_PLAYER', player_format($other->pid, $other->name, $other->country));\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\r\n\t\t\t$message = t('ALLIANCE_COMMENT_ALL');\r\n\t\t\twarquest_info(\"Post message: \".$comment);\t\t\r\n\t\t}\t\t\r\n\r\n\t\t/* Clear input parameters */\r\n\t\t$uid = 0;\r\n\t\t\r\n\t\t$output->popup .= warquest_box_icon(\"info\", $message);\r\n\t}\r\n}",
"function saveText($userID, $note){\n\t\t\n\t\t//call function in dbDials.php\n\t\treturn newAnnotation($userID, $note);\n\t}",
"public function writeNotes()\n {\n if (is_null($this->notes)) {\n throw new Exception('$notes is null');\n }\n\n $fh = fopen($this->pageNotesPath(), 'w');\n fwrite($fh, implode(\"\\n\", $this->notes));\n fclose($fh);\n }",
"function insertNote($prj_id, $customer_id, $note)\n {\n $stmt = \"INSERT INTO\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"customer_note\n (\n cno_prj_id,\n cno_customer_id,\n cno_created_date,\n cno_updated_date,\n cno_note\n ) VALUES (\n \" . Misc::escapeInteger($prj_id) . \",\n \" . Misc::escapeInteger($customer_id) . \",\n '\" . Date_Helper::getCurrentDateGMT() . \"',\n '\" . Date_Helper::getCurrentDateGMT() . \"',\n '\" . Misc::escapeString($note) . \"'\n )\";\n $res = DB_Helper::getInstance()->query($stmt);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return -1;\n } else {\n return 1;\n }\n }",
"public function save()\n {\n\n $url = parse_url($this->params->url);\n $path = $url['path'];\n $note = new Note(array('url' => $path));\n $note->load();\n\n // Get the new note config\n\n $config = json_decode($this->params->config);\n\n // Can we read or edit it?\n\n $can_read = $this->can_read($note);\n $can_edit = $can_read ? $this->can_edit($note) : FALSE;\n\n // Edit the note (if allowed)\n\n $old_notes = $note->notes;\n if ($config->notes)\n {\n $note->notes = json_encode($config->notes);\n $note->words = Note::words($config->notes);\n }\n if ($config->photo) $note->photo = $config->photo;\n if ($config->paper) $note->paper = $config->paper;\n if ($config->readers) $note->readers = $config->readers;\n if ($config->editors) $note->editors = $config->editors;\n if ($can_edit) $note->save();\n $this->render->data = array(\n 'now' => time(),\n 'diff' => $can_read ? $this->diff($old_notes, $note->notes) : NULL,\n 'paper' => $can_read ? $note->paper : 'secret',\n 'photo' => $note->photo,\n 'readers' => $note->readers,\n 'editors' => $note->editors,\n 'is_owner' => $this->is_owner,\n 'can_read' => $can_read,\n 'can_edit' => $can_edit,\n 'notelist' => $this->recent(),\n );\n\n // Log the info\n\n $action = $can_edit ? 'saved' : 'viewed';\n Log::info($this->host_ip . \" $action a note at $path\");\n }",
"public function setPersonNotes($value)\n {\n $this->setProperty(\"PersonNotes\", $value, true);\n }",
"public function save()\n {\n \tif($this->announcement_id == null)\n \t{\n \t\t$this->db->insert(\"Announcements\", array(\n \t\t\t\t\"title\" => $this->title,\n \t\t\t\t\"content\" => $this->content,\n \t\t\t\"posted_by\" => $this->posted_by\n \t\t));\n \t\t$this->announcement_id = $this->db->insert_id();\n \t}\t\n \telse\n \t{\n \t\t$update_data = array(\n \t\t\t\"title\" => $this->title,\n\t\t\t\t \"content\" => $this->content,\n \t\t\t\"posted_by\" => $this->posted_by\n \t);\n \t\t$this->db->where(\"announcement_id\", $this->announcement_id);\n \t\t$this->db->update(\"Announcements\", $update_data);\n \t}\n }",
"function getPatientNote($appointmentRecord)\n{\n // only show dentist note, viewing details like crown and carries requires clicking edit\n // then viewing notes edit page with all data filled in\n if (!isset($appointmentRecord['ProgressNotes'])) {\n return null;\n }\n $progressNotes = $appointmentRecord['ProgressNotes'];\n if (!is_array($progressNotes)) {\n return null;\n }\n\n $date = getDefaultDate();\n if (isset($appointmentRecord['AppointmentDate'])) {\n if (dateIsCorrupted($appointmentRecord['AppointmentDate'])) {\n $appointmentRecord['AppointmentDate'] = $date; // set to default\n } else { // otherwise\n $date = $appointmentRecord['AppointmentDate'];\n }\n }\n // set supported date format for date input(yyyy-mm-dd)\n $appointmentRecord['AppointmentDate'] = getNiceDate($date, 'Y-m-d');\n\n // set value for date column to format Dec 31, 2021\n $date = getNiceDate($date);\n $appointmentRecord['Date'] = $date;\n $appointmentRecord['ProgressNotes'] = $progressNotes;\n $appointmentRecord['Note'] = isset($progressNotes['Note']) ? $progressNotes['Note'] : 'edit to add notes';\n return $appointmentRecord;\n /* use commented array if keys in appointment record are not similar to keys required\n by calling method\n * [\n 'PatientName' => $appointmentRecord['PatientName'],\n 'DentistName' => $appointmentRecord['DentistName'],\n 'PatientNo' => $appointmentRecord['PatientNo'],\n 'FileNumber' => $appointmentRecord['FileNumber'],\n 'DOB' => $appointmentRecord['DOB'],\n 'Date' => $date,\n 'Note' => $progressNotes['Note'],\n 'AppointmentDate' => $appointmentRecord['AppointmentDate'],\n 'FirebaseId' => $appointmentRecord['FirebaseId'],\n 'ProgressNotes' => $progressNotes,\n ]*/\n}",
"public function updateBackupNote()\n {\n $encrypt = $this->services['encrypt'];\n $file_name = $encrypt->decode($this->getPost('backup'));\n $backup_type = stripslashes_deep($this->getPost('backup_type'));\n $note_text = stripslashes_deep($this->getPost('note_text')); \n if($note_text && $file_name)\n {\n $path = rtrim($this->settings['working_directory'], DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.$backup_type;\n $this->services['backup']->getDetails()->addDetails($file_name, $path, array('note' => $note_text));\n echo json_encode(array('success'));\n }\n exit;\n }",
"function saveStickyNote($menu, $description, $popup)\n{\n include_once \"libs/paloSantoACL.class.php\";\n $arrResult['status'] = FALSE;\n $arrResult['msg'] = _tr(\"Please your session id does not exist. Refresh the browser and try again.\");\n if($menu != \"\"){\n $user = isset($_SESSION['elastix_user'])?$_SESSION['elastix_user']:\"\";\n global $arrConf;\n $pdbACL = new paloDB(\"sqlite3:///$arrConf[elastix_dbdir]/acl.db\");\n $pACL = new paloACL($pdbACL);\n $id_resource = $pACL->getResourceId($menu);\n $uid = $pACL->getIdUser($user);\n $date_edit = date(\"Y-m-d h:i:s\");\n if($uid!==FALSE){\n $exist = false;\n $query = \"SELECT * FROM sticky_note WHERE id_user = ? AND id_resource = ?\";\n $arr_result1 = $pdbACL->getFirstRowQuery($query, TRUE, array($uid, $id_resource));\n if($arr_result1 !== FALSE && count($arr_result1) > 0)\n $exist = true;\n\n if($exist){\n $pdbACL->beginTransaction();\n $query = \"UPDATE sticky_note SET description = ?, date_edit = ?, auto_popup = ? WHERE id_user = ? AND id_resource = ?\";\n $r = $pdbACL->genQuery($query, array($description, $date_edit, $popup, $uid, $id_resource));\n if(!$r){\n $pdbACL->rollBack();\n $arrResult['status'] = FALSE;\n $arrResult['msg'] = _tr(\"Request cannot be completed. Please try again or contact with your elastix administrator and notify the next error: \").$pdbACL->errMsg;\n return $arrResult;\n }else{\n $pdbACL->commit();\n $arrResult['status'] = TRUE;\n $arrResult['msg'] = \"\";\n return $arrResult;\n }\n }else{\n $pdbACL->beginTransaction();\n $query = \"INSERT INTO sticky_note(id_user, id_resource, date_edit, description, auto_popup) VALUES(?, ?, ?, ?, ?)\";\n $r = $pdbACL->genQuery($query, array($uid, $id_resource, $date_edit, $description, $popup));\n if(!$r){\n $pdbACL->rollBack();\n $arrResult['status'] = FALSE;\n $arrResult['msg'] = _tr(\"Request cannot be completed. Please try again or contact with your elastix administrator and notify the next error: \").$pdbACL->errMsg;\n return $arrResult;\n }else{\n $pdbACL->commit();\n $arrResult['status'] = TRUE;\n $arrResult['msg'] = \"\";\n return $arrResult;\n }\n }\n }\n }\n return $arrResult;\n}",
"protected function _Store_Note() {\n\t\tglobal $wpdb; \n // Submission table name (including wp prefix)\n $entry_notes_table = $this->Get_Notes_Table(); \n // Retrieve the storage data\n $store_note = $this->store_note;\n // If there are no store fields, return out\n if (!$store_note || !is_array($store_note)) { return array(); }\n // Check for an existing record\n $existing = $wpdb->get_row($wpdb->prepare(\"SELECT uuid FROM $entry_notes_table WHERE form_uuid = %s AND entry_uuid = %s AND uuid = %s\", $store_note['form_uuid'], $store_note['uuid'], $store_note['uuid']));\n // If a record was returned\n if ($existing) { die('existing');\n // Attempt to store the entry data\n $result = $wpdb->update($entry_notes_table, $store_note, array('uuid' => $existing->uuid));\n } // Otherwise attempt to insert a new record \n else { $result = $wpdb->insert($entry_notes_table, $store_note); }\n // If the insert failed\n if ($result === false) { die('Note value failed to insert'); }\n // Store the result id\n $this->store_note['id'] = $wpdb->insert_id; \n // Return the inserted id\n return $this->store_note;\n }",
"static function add_notes(): void {\r\n\t\tself::add_acf_inner_field(self::divisions, self::notes, [\r\n\t\t\t'label' => 'Notes',\r\n\t\t\t'type' => 'text',\r\n\t\t\t'instructions' => 'Any notes pertinent to the division.',\r\n\t\t\t'required' => 0,\r\n\t\t\t'conditional_logic' => 0,\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '40',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t]\r\n\t\t]);\r\n\t}",
"public function add_note($data){\n $this->db->insert('notes', $data);\n \t return $idOfInsertedData = $this->db->insert_id();\n }",
"public function save()\n\t {\n\t\tif (isset($this->_advert->date) === true && isset($this->_advert->phone) === true)\n\t\t {\n\t\t\t$bigfile = new BigFile(\"base-\" . $this->_advert->phone, 10);\n\t\t\t$bigfile->addrecord($this->_advert->date);\n\t\t } //end if\n\n\t }",
"function save_comment($comment_id)\n {\n }",
"public function store()\n\t{\n\t\t$post = array(\n\t\t\t'user_id'=>Input::get('user_id'),\n\t\t\t'type'=>Input::get('type'),\n\t\t\t'note'=>Input::get('note'),\n\t\t\t'info'=>Input::get('info')\n\t\t);\n\t\t\n\t\tNotes::create($post);\n\t\treturn Redirect::route('admin.notes.index');\n\t\t\n\t\t\n\t}",
"public function store(Request $request)\n {\n $notes=new Notes();\n $user_id=Auth::user()->id;\n $notes->subject=$request->subject;\n $notes->topic=$request->topic;\n if($request->hasfile('notes'))\n {\n $file = $request->file('notes');\n $extension = $file->getClientOriginalExtension(); // getting image extension\n $filename =time().'.'.$extension;\n $file->move('notes', $filename);\n }\n\n $notes->notes_file=$filename;\n $notes->description=$request->desc;\n $notes->user_id=$user_id;\n $notes->branch=$request->branch;\n $notes->date = Carbon::now()->format('Y-m-d');\n $notes->save();\n return redirect(\"subnotes/$notes->subject\");\n\n }",
"protected function saveDeckNoteReturn()\n {\n $request = $this->request();\n $player = $this->getCurrentPlayer();\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_note');\n\n $this->assertParamsExist(['content']);\n\n $this->service()->deck()->saveNote($deck, $request['content']);\n\n $this->result()\n ->setCurrent('Decks_edit')\n ->setInfo('Deck note saved');\n }",
"public function add($name,$notes,$group_id) {\t\tif($name == 'fuck') $name = 'ASDFASDF';\n\n\t\t$this->create();\n\t\t$this->save(array(\n\t\t\t'group_id' => $group_id,\n\t\t\t'name' => $name,\n\t\t\t'notes' => $notes\n\t\t));\n\t}",
"public function save()\n {\n $now = new DateTime();\n $this->timestamp = $now->getTimestamp();\n self::setClassAndTable();\n parent::saveModel();\n\n $this->id = parent::getLastID();\n\n // Send notification to watchers\n $post = Post::find([\"id\" => $this->post_id]);\n $owner = $post->user();\n $watchers = $post->watchers();\n foreach ($watchers as $user) {\n $notif = new Notification();\n $notif->user_id_from = $owner->id;\n $notif->user_id_to = $user->id;\n $notif->type = Notification::WATCHLIST_UPDATE;\n $notif->link = \"/posts/view.php?post_id=$post->id\";\n $notif->save();\n }\n }",
"public function addNote($project_id, $student_id, $notes_title, $notes_content, $db)\r\n {\r\n $sql= \"INSERT INTO notes (project_id, student_id, notes_title, notes_content)\r\n VALUES (:project_id, :student_id, :notes_title, :notes_content)\";\r\n\r\n $pst = $db->prepare($sql);\r\n\r\n $pst->bindParam(':project_id', $project_id);\r\n $pst->bindParam(':student_id', $student_id);\r\n $pst->bindParam(':notes_title', $notes_title);\r\n $pst->bindParam(':notes_content', $notes_content);\r\n\r\n $count = $pst->execute();\r\n return $count;\r\n }",
"public function save()\n {\n parent::save();\n\n $oRemark = oxNew(\"oxremark\");\n\n // try to load if exists\n $oRemark->load(oxRegistry::getConfig()->getRequestParameter(\"rem_oxid\"));\n\n $oRemark->oxremark__oxtext = new oxField(oxRegistry::getConfig()->getRequestParameter(\"remarktext\"));\n $oRemark->oxremark__oxheader = new oxField(oxRegistry::getConfig()->getRequestParameter(\"remarkheader\"));\n $oRemark->oxremark__oxparentid = new oxField($this->getEditObjectId());\n $oRemark->oxremark__oxtype = new oxField(\"r\");\n $oRemark->save();\n }",
"public function leaveNotes()\n {\n $this->validate(['notes' => 'required']);\n\n $this->order->update(['notes' => $this->notes]);\n\n $this->notify([\n 'title' => __('Notes added'),\n 'message' => __('Your note has been added and will be emailed to the user on their order.'),\n ]);\n }",
"public function getResponseNotes();",
"public function process() {\r\n $notes = $this->getProperty('content','');\r\n if (empty($notes)) return $this->failure($this->modx->lexicon('admintools_err_empty_file'));\r\n $path = $this->modx->getOption('admintools_core_path', NULL, $this->modx->getOption('core_path') . 'components/admintools/').\"elements/tmp/\";\r\n $file = $path.'notes.txt';\r\n if (!file_exists($file)) {\r\n return $this->failure($this->modx->lexicon('admintools_err_file_nf'));\r\n }\r\n $notes = unserialize($notes);\r\n if (is_array($notes) && !empty($notes)) {\r\n foreach ($notes as $note) {\r\n $obj = $this->modx->newObject('adminNotes');\r\n $note['createdby'] = $this->modx->user->id;\r\n $note['createdon'] = time();\r\n $obj->fromArray($note);\r\n $obj->save();\r\n }\r\n }\r\n\r\n return $this->success();\r\n }",
"function AddNote($note){\r\n $statement = new InsertStatement(\"job_note\");\r\n $statement->addParameter(\"job_id\", $note->getJobId());\r\n $statement->addParameter(\"note_date\", $note->getNoteDate());\r\n $statement->addParameter(\"note_name\", $note->getNoteName());\r\n $statement->addParameter(\"note\", $note->getNote());\r\n $statement->executeStatement();\r\n }",
"function process_course_note() {\n\tif ( ! empty( $_POST[ 'submission' ] ) ) {\n\t\twp_send_json_error( 'Honeypot Check Failed' );\n\t}\n\tif ( ! check_ajax_referer( 'nt-course-note-nonce', 'security' ) ) {\n\t\twp_send_json_error( 'Security Check failed' );\n\t}\n\t$course_title = nt_generate_course_title($_POST[ 'data' ][ 'currentPostType' ] ,$_POST[ 'data' ][ 'currentLessonId' ]);\n\t$notes_data = array(\n\t\t'post_title' => $course_title.' - '.\n\t\t\t/*sanitize_text_field( $_POST[ 'data' ][ 'userId' ] ),\n\t\t\tsanitize_text_field( $_POST[ 'data' ][ 'currentLessonId' ] ),*/\n\n\t\t\tsanitize_text_field( $_POST[ 'data' ][ 'title' ] ),\n\t\t'post_status' => 'draft',\n\t\t'post_type' => 'coursenote',\n\t\t'post_content' => wp_kses_post( $_POST[ 'data' ][ 'body' ] )\n\t);\n\n\n\n//If note id already exists update exisiting note else insert new note\n$note_Id_update = get_post_id_by_meta_key_and_value('nt-note-current-lessson-id', $_POST[ 'data' ][ 'currentLessonId' ]);\n$post_author = get_post_field( 'post_author', $note_Id_update );\n\n\tif($note_Id_update && ($post_author == $_POST[ 'data' ][ 'userId' ])){\n\n\t\t$post_id = wp_update_post( array(\n\t\t\t'ID' => $note_Id_update,\n\t\t\t'post_content' => wp_kses_post( $_POST[ 'data' ][ 'body' ] )\n\t\t), true );\n\n\t\twp_send_json_success( $post_id );\n\t} else {\n\t\t$post_id = wp_insert_post( $notes_data, true );\n\t\tif ( $post_id ) {\n\n\t\t\tupdate_post_meta( $post_id, 'nt-note-user-id', $_POST[ 'data' ][ 'userId' ] );\n\t\t\tupdate_post_meta( $post_id, 'nt-note-current-lessson-id', $_POST[ 'data' ][ 'currentLessonId' ] );\n\n\t\t}\n\t\twp_send_json_success( $post_id );\n\t}\n\n}",
"public function saveDisputeContents($order,$timestamp,$message,$autor){\n dibi::insert('disputes', array('order' => $order, 'message' => $message,\n 'timestamp' => $timestamp, 'autor' => $autor))->execute();\n }",
"public function comedit()\n {\n $commentId = Input::get('pk');\n //get the new marks\n $comment = Input::get('value');\n //get the Student Data Row to be updated with new marks\n $commentData = Comments::whereId($commentId)->first();\n $commentData->content = $comment;\n\n $commentData->save();\n\n\n\n }",
"function insertNote(){\n\t\t$this->db->insert('form_notes', $_POST);\n\t\treturn $this->db->insert_id();\n\t}",
"public\tfunction\tsave()\n\t\t{\n\t\t}",
"public function log_activity($fkey,$note,$ref='inventory',$title) {\n\t\t$note_date = date(\"Ymd\");\n\t\t$user_id = $_SESSION['username'];\n\n\t\t$sql = \"INSERT INTO `notes` \n\t\t(`note_date`,`table_ref`,`fkey`,`user_id`,`title`,`note`)\n\t\tVALUES\n\t\t('$note_date','$ref','$fkey','$user_id','$title','$note')\n\t\t\";\n\t\t$result = $this->new_mysql($sql);\n\t}",
"public \tfunction save_callog($callerName, $phone, $date, $time, $address, $county, $landMark, $case_cat, $call_cat, $shift, $supervisor, $caseDescription, $recordedBy){\n\t\t$sql = \"INSERT INTO call_log(callerName, phone, _date, _time, address, county, landMark, case_cat, call_cat, shift, supervisor, caseDescription, recordBy) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?)\";\n\t\t$stmt = $this->connection()->prepare($sql);\n\t\t$stmt->execute([$callerName, $phone, $date, $time, $address, $county, $landMark, $case_cat, $call_cat, $shift, $supervisor, $caseDescription, $recordedBy]);\n\t\treturn $stmt;\n}",
"function create_note($eParent, $noteRec, $level) {\n\t\t$note = get_gedcom_value(\"NOTE\", $level, $noteRec);\n\t\t$note .= get_cont($level+1, $noteRec, false);\n//\t\t$num = 1;\n//\t\twhile (($cont = get_gedcom_value(\"NOTE:CONT\", $level, $noteRec, $num)) != null) {\n//\t\t\t$note .= $cont;\n//\t\t\t$num++;\n//\t\t}\n\t\t$egNote = $this->dom->createElement(\"note\");\n\t\t$etgNote = $this->dom->createTextNode(htmlentities($note,ENT_COMPAT,'UTF-8'));\n\t\t$etgNote = $egNote->appendChild($etgNote);\n\t\t$egNote = $eParent->appendChild($egNote);\n\t}",
"function saveSQL($data,$filename,$remark)\r\n {\r\n $handle = fopen($filename,\"a\");\r\n fwrite($handle,\"-- --\".date(\"D M j G:i:s\").\" $remark\\n \".$data.\"\\n\");\r\n fclose($handle);\r\n }",
"function add($note) {\r\n $CI = &get_instance();\r\n //check access rights (!)\r\n $userlogin = getUserLogin();\r\n $user = $CI->user_db->getByID($userlogin->userID());\r\n $publication = $CI->publication_db->getByID($note->pub_id);\r\n if ( ($publication == null) \r\n ||\r\n (!$userlogin->hasRights('note_edit'))\r\n || \r\n (!$CI->accesslevels_lib->canEditObject($publication))\r\n ) \r\n {\r\n\t appendErrorMessage(__('Add note').': '.__('insufficient rights').'.<br/>');\r\n\t return;\r\n } \r\n //add new note\r\n $CI->db->insert(\"notes\", array('text' => $note->text,\r\n 'pub_id' => $note->pub_id,\r\n 'user_id' => $userlogin->userId()));\r\n $new_id = $CI->db->insert_id();\r\n $note->note_id = $new_id;\r\n $CI->accesslevels_lib->initNoteAccessLevels($note); \r\n //set crossref ids\r\n $xref_ids = getCrossrefIDsForText($note->text);\r\n foreach ($xref_ids as $xref_id) {\r\n $CI->db->insert(\"notecrossrefid\", array('xref_id'=>$xref_id, 'note_id'=>$note->note_id));\r\n }\r\n \r\n return $new_id;\r\n }",
"public function store()\n\t{\n\t\t$input = Input::all();\n\t\t$this->commentary->commentary = $input['commentary'];\n\t\t$this->commentary->mid = $input['mid'];\n\t\t$this->commentary->time = $input['time'];\n\t\tif($this->commentary->save()){\n\t\t\t\\Session::flash('notice','Successfully added');\n\t\t\treturn redirect()->back();\n\t\t}\n\t}",
"function addNote($userID, $memberID, $note) {\r\n $sql = $this->db->prepare(\"INSERT INTO NOTES (about, leftBy, note) VALUES (:about, :leftBy, :note)\");\r\n $result = $sql->execute(array(\r\n \"about\" => $memberID,\r\n \"leftBy\" => $userID,\r\n \"note\" => $note\r\n ));\r\n if ($result)\r\n return true;\r\n else\r\n return false;\r\n }",
"function do_store_post_reply($post_id) {\r\n // echo '<pre>'; print_r($_POST); die();\r\n foreach(array(\"description\",\"replied_by\") as $i)\r\n\t\t\t$$i=$this->input->post($i);\r\n $replied_on = time();$status=1;\r\n $this->db->query(\"insert into m_stream_post_reply(description,post_id,replied_by,replied_on,status) values(?,?,?,?,?)\",array($this->prep($description),$post_id,$replied_by,$replied_on,$status));\r\n }",
"public function getCustomerNoteNotify();",
"function update_Note($NoteID, $Title, $Note, $Private) {\r\n// the database to new details in arguments\r\n\r\n $conn = db_connect();\r\n\r\n $query = \"update NOTES\r\n set Title= '\".$Title.\"'\r\n NOTES = '\".$Note.\"',\r\n Private = '\".$Private.\"'\r\n where NoteID = '\".$NoteID.\"'\";\r\n\r\n $result = @$conn->query($query);\r\n if (!$result) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}",
"public function store(Request $request)\n {\n $note = new Note();\n\n $note->titulo = $request->titulo;\n $note->descripcion = $request->descripcion;\n $note->favorito = $request->favorito;\n $note->save();\n print(\"Nota creada\");\n }",
"public function getNotes();",
"public function store()\n\t{\t\n\t\t\n\t\t# instantiate\t\n\t\t$note = new Note();\n\t\t\n\t\t$note = $note->postNote(['content'=>Input::get('content'), 'title' => Input::get('title'), 'project_id'=>Input::get('id'), 'project_title'=> Input::get('project_title'),'user_id'=> Auth::id()]);\n\t\t\n\t\t# method returns success or error\n\t\tif($note == 'error')\n\t\t{\n\t\t\t\t\n\n\t\t\t# PK\n\t\t\treturn Redirect::to('projects/'. Input::get('id'))->withErrors('Error saving note. Please try again')->withInput();\t\t\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t#Flash message\n\t\t\tSession::flash('flash_message_success', 'Note created!');\n\t\t\t\n\t\t\treturn Redirect::to('projects/'. Input::get('id'));\n\t\t\t\n\t\t}\n\t}",
"function setNoteText(){\n $html = \"\";\n \n $this->aFields[\"note\"]->editable = true;\n $this->aFields[\"note\"]->value = $html;\n }",
"function savecomments(){\n\n//database connection begins\nrequire('database/connx.php');\n\n// Connect to MySQL\n$db = & new MySQL($host,$dbUser,$dbPass,$dbName);\n\n//storing values in DB for search functionality\n\n//instantiating variables begin\n$this->comment_author = safeAddSlashes($_POST['comment_author']);\n$this->pubDate = date(\"M j, Y, g:i a\");\n$this->comment = safeAddSlashes($_POST['comment']);\n$this->lead_comment_author = safeAddSlashes($_POST['lead_comment_author']);\n$this->msg_type = $_POST['msg_type'];\nif(isset($_POST['vid'])){$this->presentation_url = safeAddSlashes($_POST['vid']);}else{$this->presentation_url = safeAddSlashes($_GET['vid']);}\n$sql=\"INSERT comments SET\nstr_presentation_url='$this->presentation_url',\nstr_name='$this->comment_author',\nstr_lead_name='$this->lead_comment_author',\ntime_pubDate='$this->pubDate',\nstr_comment='$this->comment',\nstr_msg_type='$this->msg_type'\";\n//echo \"<p>\" . $sql . \"</p>\";\n$result=$db->query($sql);\n\n }",
"function save() {\n\t\t// If every question is answered, save to the db. Otherwise, to session.\n\t\tif($this->isComplete()) {\n\t\t\t$this->saveToRecord();\n\t\t} else {\n\t\t\t$this->saveToSession();\n\t\t}\n\t}",
"public function addNote($note)\n {\n }",
"public function Add_Note($data) {\n // Populate the entry data\n $this->store_note = array(\n 'uuid' => isset($data['uuid']) ? $data['uuid'] : uniqid(),\n 'entry_uuid' => $data['entry_uuid'],\n 'form_uuid' => $data['form_uuid'],\n 'note_data' => $data['note_data'],\n 'time_created' => isset($data['time_created']) ? $data['time_created'] : time(),\n 'time_modified' => isset($data['time_modified']) ? $data['time_modified'] : time(),\n 'date_created' => isset($data['date_created']) ? $data['date_created'] : date(\"Y-m-d H:i:s\"),\n 'date_modifed' => isset($data['date_modifed']) ? $data['date_modifed'] : date(\"Y-m-d H:i:s\"),\n );\n // Return for chaining\n return $this;\n }",
"public function setNote($text){\r\n $this->note = $text;\r\n }",
"public function recordJournalingStart();",
"public function getNote();",
"function add_note($text, $user_id){\n $link = connect();\n\n // 2. Prepare the statement using mysqli\n // to take care of any potential SQL injections.\n $stmt = mysqli_prepare($link, \"\n INSERT INTO tbl_notes\n (text, tbl_users_id)\n VALUES\n (?, ?)\n \");\n\n // 3. Bind the parameters so we don't have to do the work ourselves.\n // the sequence means: string string double integer double\n mysqli_stmt_bind_param($stmt, 'si', $text, $user_id);\n\n // 4. Execute the statement.\n mysqli_stmt_execute($stmt);\n\n // 5. Disconnect from the database.\n disconnect($link);\n\n // 6. If the query worked, we should have a new primary key ID.\n return mysqli_stmt_insert_id($stmt);\n }",
"function DoctorAppointment_meta_save($post_id){\n $is_auto_save = wp_is_post_autosave( $post_id );\n $is_revision = wp_is_post_revision( $post_id );\n $is_valid_nonce = (isset($_POST['DoctorAppointment_nonce']) && \n wp_verify_nonce( $_POST['DoctorAppointment_nonce'], basename(__FILE__)))? 'true' : 'false';\n \n // return if ina auto svae , revision of non valid nouncer\n if($is_auto_save || $is_revision || !$is_valid_nonce){\n return ;\n }\n \n // update DoctorAppointment_id\n if(isset($_POST[\"DoctorAppointment_id\"])){\n update_post_meta( $post_id, \"DoctorAppointment_id\",sanitize_text_field( $_POST[\"DoctorAppointment_id\"]) );\n\n }\n\n // update DoctorAppointment_name\n if(isset($_POST[\"DoctorAppointment_name\"])){\n update_post_meta( $post_id, \"DoctorAppointment_name\",sanitize_text_field( $_POST[\"DoctorAppointment_name\"]) );\n \n }\n\n // update DoctorAppointment_email\n if(isset($_POST[\"DoctorAppointment_email\"])){\n update_post_meta( $post_id, \"DoctorAppointment_email\",sanitize_email( $_POST[\"DoctorAppointment_email\"]) );\n \n }\n\n // update DoctorAppointment_mobile\n if(isset($_POST[\"DoctorAppointment_mobile\"])){\n update_post_meta( $post_id, \"DoctorAppointment_mobile\",sanitize_text_field( $_POST[\"DoctorAppointment_mobile\"]) );\n }\n\n\n // update DoctorAppointment_message\n if(isset($_POST[\"DoctorAppointment_message\"])){\n update_post_meta( $post_id, \"DoctorAppointment_message\", sanitize_text_field($_POST[\"DoctorAppointment_message\"]));\n }\n\n// still have to write code fo\n \n \n \n \n \n\n}",
"function create_post()\n {\n //Create the post with information submitted\n if(isset($_POST['note-text']) && !($_POST['note-text'] == \"\"))\n {\n $query = $this->pdo->prepare('INSERT INTO note (title, description, created_at, updated_at) VALUES(:title,:description, NOW(), NOW())');\n $query->execute(array(\n ':title' => $_POST['note-title'],\n ':description' => $_POST['note-text']\n ));\n }\n }",
"protected function afterSave()\n\t{\n\t\tparent::afterSave();\n\t\tif(!$this->status == 1){\n\t\t$title = $this->howtoTitle($this->id);\n\t\t$tags = $this->tagLinks();\n\t\t$title = CHtml::link('Created '.$title , array('/howto/' . $this->id . '/' . $title ) );\n\t\t$shortText = substr($this->content,0,160);\n\t\t$content = $shortText.\"...<br/>Tags:\";\n\t\tforeach($tags as $tag){\n\t\t\t$content .=\" \".$tag.\",\";\n\t\t}\n\t\tAction::newAction($content,$title);\n\t\t}\n\t\t\n\t}",
"function add_note($module_key) {\r\n\r\n\tglobal $CONN, $CONFIG;\r\n\t$body = $_POST['body'];\r\n\t$sql = \"INSERT INTO {$CONFIG['DB_PREFIX']}notes(module_key,note) values ('$module_key','$body')\";\r\n\t\r\n\tif ($CONN->Execute($sql) === false) {\r\n\t\r\n\t\t$message = 'There was an error adding your note: '.$CONN->ErrorMsg().' <br />';\r\n\r\n\t\treturn $message;\r\n\t\t\r\n\t} else {\t \r\n\t\r\n\t\t\treturn true; \r\n\t}\r\n\t\r\n\r\n}",
"public function store(Requests\\NotesRequest $request)\n {\n if($request->input('type') == 'lead'){\n $lead = $this->leadsRepositoryEloquent->findWhere([\"id\" => $request->input('type_id')])->first();\n $request->merge(['branch_id' => $lead->branch_id]);\n }elseif($request->input('type') == 'opportunity'){\n $lead = $this->opportunityRepositoryEloquent->findWhere([\"id\" => $request->input('type_id')])->first();\n $request->merge(['branch_id' => $lead->branch_id]);\n }elseif($request->input('type') == 'account'){\n $lead = $this->accountsRepositoryEloquent->findWhere([\"id\" => $request->input('type_id')])->first();\n $request->merge(['branch_id' => $lead->branch_id]);\n }elseif($request->input('type') == 'contact'){\n $lead = $this->contactRepositoryEloquent->findWhere([\"id\" => $request->input('type_id')])->first();\n $request->merge(['branch_id' => $lead->branch_id]);\n }elseif($request->input('type') == 'activity'){\n $lead = $this->activityRepositoryEloquent->findWhere([\"id\" => $request->input('type_id')])->first();\n $request->merge(['branch_id' => $lead->branch_id]);\n }\n\n\n $note = $this->repository->store($request);\n\n return response()->json((new NotesTransformer())->transform($note));\n }",
"public function save()\n {\n if($this->id != -1)\n {\n $this->update_subject();\n }\n else\n {\n $this->insert_subject();\n }\n }",
"function footnote_open() {\n\n // move current content to store and record footnote\n $this->store = $this->doc;\n $this->doc = '';\n }",
"function authorNotes($id)\n{\n global $app;\n\n // parameter checking\n if (!is_numeric($id)) {\n $app->getLog()->warn('authorNotes: invalid author id ' . $id);\n $app->halt(400, \"Bad parameter\");\n }\n\n $author = $app->calibre->author($id);\n if (is_null($author)) {\n $app->getLog()->debug('authorNotes: author id not found ' . $id);\n $app->notFound();\n }\n $note = $app->bbs->authorNote($id);\n if (!is_null($note)) {\n $author->notes_source = $note->ntext;\n } else {\n $author->notes_source = null;\n }\n if (!empty($author->notes_source)) {\n $markdownParser = new MarkdownExtraParser();\n $author->notes = $markdownParser->transformMarkdown($author->notes_source);\n } else {\n $author->notes = null;\n }\n $app->render('author_notes.html', [\n 'page' => mkPage(getMessageString('author_notes'), 3, 2),\n 'url' => 'authors/' . $id,\n 'author' => $author,\n 'isadmin' => is_admin()]);\n}",
"function update_Notei($NoteID, $Title, $Category, $Note, $Private) {\r\n// the database to new details in arguments\r\n\r\n $conn = db_connect();\r\n\r\n $query = \"update NOTESI\r\n set Title= '\".$Title.\"',\r\n Category = '\".$Category.\"',\r\n NOTES = '\".$Note.\"',\r\n Private = '\".$Private.\"'\r\n where NoteID = '\".$NoteID.\"'\";\r\n\r\n $result = @$conn->query($query);\r\n if (!$result) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}",
"public function appendNoteToFile(Note $note, string $filename){\n }",
"function save(){\r\n\t\tglobal $DB;\r\n\t\tglobal $_USER;\r\n\t\t$now = time();\r\n\r\n\t\tif($this->id > 0){\r\n\t\t\t$sql = \"UPDATE personalization_orders SET\r\n\t\t\t\t\tstatus = {$this->status},\r\n\t\t\t\t\ttitle = '{$this->title}', \r\n\t\t\t\t\tcomment = '{$this->comment}',\r\n\t\t\t\t\torderdate = {$this->orderdate}, \r\n\t\t\t\t\tamount = {$this->amount}, \r\n\t\t\t\t\tcontact_person_id = {$this->contactPersonID}, \r\n\t\t\t\t\tdeliveryaddress_id = {$this->deliveryAddressID}\r\n\t\t\t\t\tWHERE id = {$this->id}\";\r\n\t\t\t$ret = $DB->no_result($sql);\r\n\t\t} else {\r\n\t\t\t$sql = \"INSERT INTO personalization_orders\r\n\t\t\t\t\t( status, comment, crtdate, crtuser, amount, \r\n\t\t\t\t\t customerid, persoid, title, contact_person_id,\r\n\t\t\t\t\t deliveryaddress_id )\r\n\t\t\t\t\tVALUES\r\n\t\t\t\t\t({$this->status}, '{$this->comment}', {$now}, {$_USER->getId()}, {$this->amount}, \r\n\t\t\t\t\t{$this->customerID}, {$this->persoID}, '{$this->title}', {$this->contactPersonID}, \r\n\t\t\t\t\t{$this->deliveryAddressID})\";\r\n\t\t\t$res = $DB->no_result($sql);\r\n\r\n\t\t\tif($res){\r\n\t\t\t\t$sql = \"SELECT max(id) id FROM personalization_orders WHERE persoid = {$this->persoID} AND customerid = {$this->customerID} \";\r\n\t\t\t\t$thisid = $DB->select($sql);\r\n\t\t\t\t$this->id = $thisid[0][\"id\"];\r\n\t\t\t\t$ret = true;\r\n\t\t\t} else {\r\n\t\t\t\t$ret = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($ret){\r\n\t\t\tCachehandler::toCache(Cachehandler::genKeyword($this), $this);\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"static private function add_note($id, $note) {\r\n\r\n if(!apply_filters('gravityforms_constant_contact_add_notes_to_entries', true) || !class_exists('RGFormsModel')) { return; }\r\n\r\n RGFormsModel::add_note($id, 0, __('Gravity Forms Constant Contact Add-on'), $note);\r\n }",
"function heartbeat_autosave($response, $data)\n {\n }",
"public function insertNote($arr){\n\t\t$insNote = $this->userClsObj->insertNote($arr);\n\t}",
"public static function possibly_add_note() {\n\t\t/**\n\t\t * Filter to allow for disabling sales record milestones.\n\t\t *\n\t\t * @since 3.7.0\n\t\t *\n\t\t * @param boolean default true\n\t\t */\n\t\t$sales_record_notes_enabled = apply_filters( 'woocommerce_admin_sales_record_milestone_enabled', true );\n\n\t\tif ( ! $sales_record_notes_enabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$yesterday = gmdate( 'Y-m-d', current_time( 'timestamp', 0 ) - DAY_IN_SECONDS );\n\t\t$total = self::sum_sales_for_date( $yesterday );\n\n\t\t// No sales yesterday? Bail.\n\t\tif ( 0 >= $total ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$record_date = get_option( self::RECORD_DATE_OPTION_KEY, '' );\n\t\t$record_amt = floatval( get_option( self::RECORD_AMOUNT_OPTION_KEY, 0 ) );\n\n\t\t// No previous entry? Just enter what we have and return without generating a note.\n\t\tif ( empty( $record_date ) ) {\n\t\t\tupdate_option( self::RECORD_DATE_OPTION_KEY, $yesterday );\n\t\t\tupdate_option( self::RECORD_AMOUNT_OPTION_KEY, $total );\n\t\t\t\treturn;\n\t\t}\n\n\t\t// Otherwise, if yesterdays total bested the record, update AND generate a note.\n\t\tif ( $total > $record_amt ) {\n\t\t\tupdate_option( self::RECORD_DATE_OPTION_KEY, $yesterday );\n\t\t\tupdate_option( self::RECORD_AMOUNT_OPTION_KEY, $total );\n\n\t\t\t$formatted_yesterday = gmdate( 'F jS', strtotime( $yesterday ) );\n\t\t\t$formatted_total = html_entity_decode( wp_strip_all_tags( wc_price( $total ) ) );\n\t\t\t$formatted_record_date = gmdate( 'F jS', strtotime( $record_date ) );\n\t\t\t$formatted_record_amt = html_entity_decode( wp_strip_all_tags( wc_price( $record_amt ) ) );\n\n\t\t\t$content = sprintf(\n\t\t\t\t/* translators: 1 and 4: Date (e.g. October 16th), 2 and 3: Amount (e.g. $160.00) */\n\t\t\t\t__( 'Woohoo, %1$s was your record day for sales! Net Sales was %2$s beating the previous record of %3$s set on %4$s.', 'woocommerce' ),\n\t\t\t\t$formatted_yesterday,\n\t\t\t\t$formatted_total,\n\t\t\t\t$formatted_record_amt,\n\t\t\t\t$formatted_record_date\n\t\t\t);\n\n\t\t\t$content_data = (object) array(\n\t\t\t\t'old_record_date' => $record_date,\n\t\t\t\t'old_record_amt' => $record_amt,\n\t\t\t\t'new_record_date' => $yesterday,\n\t\t\t\t'new_record_amt' => $total,\n\t\t\t);\n\n\t\t\t// We only want one sales record note at any time in the inbox, so we delete any other first.\n\t\t\tNotes::delete_notes_with_name( self::NOTE_NAME );\n\n\t\t\t$report_url = '?page=wc-admin&path=/analytics/revenue&period=custom&compare=previous_year&after=' . $yesterday . '&before=' . $yesterday;\n\n\t\t\t// And now, create our new note.\n\t\t\t$note = new Note();\n\t\t\t$note->set_title( __( 'New sales record!', 'woocommerce' ) );\n\t\t\t$note->set_content( $content );\n\t\t\t$note->set_content_data( $content_data );\n\t\t\t$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );\n\t\t\t$note->set_name( self::NOTE_NAME );\n\t\t\t$note->set_source( 'woocommerce-admin' );\n\t\t\t$note->add_action( 'view-report', __( 'View report', 'woocommerce' ), $report_url );\n\t\t\t$note->save();\n\t\t}\n\t}",
"public function store(NotesRequest $request)\n {\n //cual muestra todos los datos que llegan a través de las peticiones\n //helper dd() muestra el contenido de una variable y detiene la \n //ejecución del sistema\n //request()->all() veo todo lo que me llega del formulario\n //request()->NombreDelCampo para un campo en especifico\n //dd(request()->all());\n\n //vamos a guardar de 2 formas\n //esta es la primera\n /*$note = new Note; //instanciamos el modelo Note\n $note->title = request()->title;\n $note->body = request()->body;\n $note->important = is_null(request()->important) ? 0 : 1;\n $note->save();*/\n\n //Y esta la segunda\n //para validar uasaremos el metodo validate\n /*$data=request()->validate([\n 'title' => 'required',\n 'body' => 'required|min:5',\n 'important' => 'required',\n ]);\n Note::create($data);\n */\n //Note::create($request->all());//otra forma de guardar\n Note::create(request()->all());\n return redirect('/notes');\n //return back();//nos retornaria a la ruta anterior.\n\n\n }",
"function postMark($name, $userNo)\n{\n $is_deleted = (string)'N';\n $no = (int)0;\n $is_registered = date(\"Y-m-d H:i:s\");\n\n $pdo = pdoSqlConnect();\n $query = \"INSERT INTO bookmark (no, title, is_deleted, registered_at, user_no) VALUES (?,?,?,?,?);\";\n\n $st = $pdo->prepare($query);\n $st->execute([$no, $name, $is_deleted, $is_registered, $userNo]);\n\n $st = null;\n $pdo = null;\n}",
"private function saveData($data)\n {\n $newDate = date('Y-m-d H:i:s');\n $data['commentDate'] = $newDate;\n // --- saving part ---\n $comments = new commentModel();\n $commentID = $comments->insert($data);\n // --- routing after storage ---\n $url = '/comments/show/id/' . $data['topicID'];\n $this->_redirect($url);\n }"
] | [
"0.6832219",
"0.66910785",
"0.6565755",
"0.65537083",
"0.6546315",
"0.6523854",
"0.6512472",
"0.6482425",
"0.64304507",
"0.6393778",
"0.6366294",
"0.63618046",
"0.63521624",
"0.62920403",
"0.6285621",
"0.6284805",
"0.62808144",
"0.6277109",
"0.62585473",
"0.6236018",
"0.6161992",
"0.6153336",
"0.6147762",
"0.61337066",
"0.6132662",
"0.6087212",
"0.60736907",
"0.6035104",
"0.6032211",
"0.60236883",
"0.601406",
"0.60107803",
"0.5981535",
"0.59773123",
"0.59565276",
"0.59134185",
"0.5872801",
"0.5870642",
"0.5852466",
"0.5833139",
"0.58329797",
"0.5824033",
"0.5806195",
"0.58042365",
"0.5786063",
"0.5782047",
"0.578184",
"0.57814306",
"0.574641",
"0.5741959",
"0.57383895",
"0.5726534",
"0.56980664",
"0.56955934",
"0.5677856",
"0.56765044",
"0.5670958",
"0.56709033",
"0.5668667",
"0.5659128",
"0.5657095",
"0.56558174",
"0.56531996",
"0.56517833",
"0.56433696",
"0.56329703",
"0.56145334",
"0.5610771",
"0.5593625",
"0.5580894",
"0.55769116",
"0.55669445",
"0.5565052",
"0.5564438",
"0.5560327",
"0.55588484",
"0.5557296",
"0.5554392",
"0.5552403",
"0.55504024",
"0.5542657",
"0.5539436",
"0.5531716",
"0.5530829",
"0.5527934",
"0.5514802",
"0.55087507",
"0.55027854",
"0.5500712",
"0.54963493",
"0.5462519",
"0.5458827",
"0.54512364",
"0.5449525",
"0.54431695",
"0.54417443",
"0.5439869",
"0.54331166",
"0.54299206",
"0.5429586"
] | 0.6392725 | 10 |
/ Description Function is to start Archieving of meetings Author Dave Brown Created 26 December 2014 | public function start_archieve ()
{
if (post_data('appointment_id') == NULL)
{
return;
}
$archieve_name = post_data('appointment_id') . '-' . date('d_M_Y');
$archive_result = $this->opentok->startArchive(post_data('tokbox_session_key'), $archieve_name);
$table_data = array(
'archieve_id' => $archive_result->id,
'name' => $archive_result->name,
'appointment_id' => post_data('appointment_id'),
'duration' => $archive_result->duration,
'size' => $archive_result->size,
'status' => $archive_result->status
);
$this->appointment_model->save_archieve($table_data);
exit(json_encode($table_data));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function appointments()\n\t{\n\t\tif (!is_cli())\n\t\t{\n\t\t\techo \"This script can only be accessed via the command line\" . PHP_EOL;\n\t\t\treturn;\n\t\t}\n\n\t\t$participations = $this->participationModel->get_confirmed_participations();\n\t\tforeach ($participations as $participation)\n\t\t{\n\t\t\t$appointment = strtotime($participation->appointment); \n\t\t\tif ($appointment > strtotime('tomorrow') && $appointment <= strtotime('tomorrow + 1 day')) \n\t\t\t{\t\t\t\t\t\n\t\t\t\treset_language(L::DUTCH);\n\t\t\t\t\n\t\t\t\t$participant = $this->participationModel->get_participant_by_participation($participation->id);\n\t\t\t\t$experiment = $this->participationModel->get_experiment_by_participation($participation->id);\n\t\t\t\t$message = email_replace('mail/reminder', $participant, $participation, $experiment);\n\t\t\n\t\t\t\t$this->email->clear();\n\t\t\t\t$this->email->from(FROM_EMAIL, FROM_EMAIL_NAME);\n\t\t\t\t$this->email->to(in_development() ? TO_EMAIL_DEV_MODE : $participant->email);\n\t\t\t\t$this->email->subject('Babylab Utrecht: Herinnering deelname');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t\t\t// DEBUG: $this->email->print_debugger();\n\t\t\t}\n\t\t}\n\t}",
"public function run()\n {\n $meeting = new Meeting();\n $meeting->name = \"Møde 1\";\n $meeting->description = \"Beskrivelse\";\n $meeting->location = \"Kontor 1\";\n $meeting->host = \"Jens Ringgaard\";\n $meeting->start = now();\n $meeting->end = now()->addHours(4);\n $meeting->save();\n\n\n $meeting = new Meeting();\n $meeting->name = \"Møde 2\";\n $meeting->description = \"Beskrivelse\";\n $meeting->location = \"Kontor 1\";\n $meeting->host = \"Jens Ringgaard\";\n $meeting->start = now();\n $meeting->end = now()->addHours(2);\n $meeting->save();\n\n $meeting = new Meeting();\n $meeting->name = \"Møde 3\";\n $meeting->description = \"Beskrivelse\";\n $meeting->location = \"Kontor 1\";\n $meeting->host = \"Jens Ringgaard\";\n $meeting->start = now();\n $meeting->end = now()->addHours(3);\n $meeting->save();\n }",
"public function actionStart($at=false,$in=false)\n {\n // Start the competition $in number of seconds from now\n }",
"protected function enjoyVacation()\n {\n echo \"Coding, eating, sleeping\";\n // TODO: Implement enjoyVacation() method.\n }",
"public function StartActivity(){\n if($this->state == ActivityState::PLANNED) {\n $this->state = ActivityState::ONGOING;\n $this->start = $this->dateDuJour();\n $this->end = null;\n }\n elseif($this->state != ActivityState::ONGOING) throw new BadActivityStateError($this, ActivityState::ONGOING);\n }",
"public function start() {\n\t\t$this->saveToken();\n\n\t\t// Save credential if upload file exists\n\t\t$this->saveCredential();\n\n\t\t// CRUD\n\t\t$this->CRUDOperation();\n\n\t\treturn $this->meet;\n\t}",
"function bookking_print_recent_activity($course, $isteacher, $timestart) {\n\n return false;\n}",
"public function startNewGame() {\n\t \t//Set all queued used to playing\n\t \t//Build new map scaled on number of playing users\n\t \t//place users on map\n\t \t//start game\n\t \t//send out alert that game has started\n\t }",
"public function register_start()\n {\n\n echo \"Started a New Action \";\n $project = readline(\"On what project are you working on? \");\n $this->project = $project;\n date_default_timezone_set('Europe/Berlin');\n //Array that keeps the localtime \n $arrayt = localtime();\n //calculates seconds rn for further use\n $timeRN = $arrayt[0] + ($arrayt[1] * 60) + ($arrayt[2] * 60 * 60); //in seconds\n\n $dateRN = date('Y-m-d');\n if (file_exists($this->save)) {\n $json_already = file_get_contents($this->save);\n }\n $json = json_decode($json_already);\n\n $array[] = array(\n\n 'Time' => $dateRN,\n 'Starttime' => $timeRN,\n 'Endtime' => \"\",\n 'Project' => $this->project,\n 'Worked' => \"\"\n\n );\n\n $json[] = $array;\n $json_decoded = json_encode($json);\n\n file_put_contents($this->save, $json_decoded);\n }",
"public function attend() {\n\n $attr = array(\n 'events' => $this->db->query(\"SELECT id, title\n FROM events\n WHERE DATE_FORMAT(event_date, '%Y-%m') = DATE_FORMAT(NOW(), '%Y-%m')\n ORDER BY event_date DESC\")->result(),\n 'department' => $this->db->query(\"SELECT CONCAT(IF(is_pt = 1, CONCAT('PT. ', REPLACE(name, 'PT. ', '')), REPLACE(name, 'PT. ', '')), ' (', team, ')') AS 'name',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t CONCAT('t', ansena_team.id) AS 'id'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t FROM ansena_team \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t LEFT JOIN ansena_department ON ansena_department.id = ansena_team.dept_id \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t UNION ALL \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t SELECT IF(is_pt = 1, CONCAT('PT. ', REPLACE(name, 'PT. ', '')), REPLACE(name, 'PT. ', '')) AS 'name',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t CONCAT('d', ansena_department.id) AS 'id'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t FROM ansena_department \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t LEFT OUTER JOIN ansena_team ON ansena_team.dept_id = ansena_department.id \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t WHERE ansena_team.id IS NULL\")->result()\n \n );\n \n $this->layout_lib->template_with_custom_navbar('analisa/navbar-sub-attend', 'analisa/attend', $attr);\n \n }",
"public function startAction() {\n session_unset();\n\n \t$br = new bookingRecord();\n \t$br->save();\n\n $this->View('booking_start');\n }",
"public function run()\n {\n //\n\n // $aysems = [];\n // for($i=2010; $i <= 2016; $i++) { \n // $aysems[] = $i*10 + 1;\n // $aysems[] = $i*10 + 2;\n // $aysems[] = $i*10 + 3;\n // }\n \n // foreach ($aysems as $key => $sem) {\n // $sem = [ 'aysem' => $sem, 'short_name' => Aysem::shortName($sem) , 'full_name' => Aysem::fullName($sem) ];\n // Aysem::create( $sem);\n // }\n\n $sem = 20171;\n $sem = [ 'aysem' => $sem, 'short_name' => Aysem::shortName($sem) , 'full_name' => Aysem::fullName($sem) ];\n Aysem::create( $sem);\n\n }",
"public static function soon()\n\t{\n\t\t$reservations = \\Model_Lessontime::find(\"all\", [\n\t\t\t\"where\" => [\n\t\t\t\t[\"deleted_at\", 0],\n\t\t\t\t[\"status\", 1],\n\t\t\t\t[\"freetime_at\", \"<=\", time() + 600],\n\t\t\t\t[\"freetime_at\", \">=\", time()],\n\t\t\t]\n\t\t]);\n\n\t\tforeach($reservations as $reservation){\n\n\t\t\t// for teacher\n\t\t\t$url = \"http://game-bootcamp.com/teachers/top\";\n\n\t\t\t$body = \\View::forge(\"email/teachers/reminder_soon\",[\"url\" => $url]);\n\t\t\t$sendmail = \\Email::forge(\"JIS\");\n\t\t\t$sendmail->from(\\Config::get(\"statics.info_email\"),\\Config::get(\"statics.info_name\"));\n\t\t\t$sendmail->to($reservation->teacher->email);\n\t\t\t$sendmail->subject(\"Your lesson will start.\");\n\t\t\t$sendmail->html_body(htmlspecialchars_decode($body));\n\n\t\t\t$sendmail->send();\n\n\t\t\t// for student\n\t\t\t$url = \"http://game-bootcamp.com/students/top\";\n\n\t\t\t$body = \\View::forge(\"email/students/reminder_soon\",[\"url\" => $url]);\n\t\t\t$sendmail = \\Email::forge(\"JIS\");\n\t\t\t$sendmail->from(\\Config::get(\"statics.info_email\"),\\Config::get(\"statics.info_name\"));\n\t\t\t$sendmail->to($reservation->student->email);\n\t\t\t$sendmail->subject(\"Your lesson will start.\");\n\t\t\t$sendmail->html_body(htmlspecialchars_decode($body));\n\n\t\t\t$sendmail->send();\n\t\t}\n\t}",
"public function start_harvest(){\n $this->checkinit();\n $this->harvest_laststart = $this->dt();\n $this->save_flags();\n }",
"public function CheckActiveMeeting()\n\t{\n\t\t//get current login user session\n\t\t$user = $this->Session->read('UserData.userName');\n\t\t$userCourse = $this->Session->read('UserData.usersCourses');\n\t\t$user_course_section = $userCourse[0];\n\n\t\t//get Course and section name\n\t\t$course_info = $this->getCourseNameOfUser($user_course_section);\n\t\t$course_name = $course_info->course_name;\n\t\t$course_section = $course_info->section_name;\n\t\t//get user session\n\t\t$currenttime = time();\n\t\t$userJoinTime = $currenttime;\n\t\t$extra_time = Configure::read('extra_meetingtime');//done in bootstrap\n\t\t$data = $this->request->data;\n\t\t$group_name = $data['roomname'];\n\t\t$requests = $this->MeetingInfo->find('first',array(\n\t\t\t\t'conditions'=>array('MeetingInfo.chat_meeting_name'=>$group_name)\n\t\t));\n\t\t$meeting_date = $requests['MeetingInfo']['chat_meeting_startdate'];\n\t\t$meeting_active = $requests['MeetingInfo']['is_active'];\n\t\t$meeting_start_date = $meeting_date;\n\t\t$meeting_end_date = $meeting_start_date+$extra_time;\n\t\tif((($userJoinTime <= $meeting_end_date) && ($userJoinTime >= $meeting_start_date)) || $meeting_active)\n\t\t\techo 1;\n\t\telse\n\t\t\techo 0;\n\t\texit;\n\t}",
"function start() {\n\t\tif ($this->Time->hasAny(\"Time.user_id = '\" . $this->userid . \"' AND Time.stop = '0000-00-00 00:00:00'\")) {\n\t\t\t$this->flash('Du arbeitest doch schon', '/times/index');\n\t\t\texit();\n\t\t}\n\n\t\t$this->request->data['Time']['user_id'] = $this->userid;\n\t\t$this->request->data['Time']['start'] = date('Y-m-d H:i:s');\n\t\t$this->request->data['Time']['break'] = 0;\n\n\t\tif ($this->Time->save($this->request->data)) {\n\t\t\t$this->Session->setFlash('Started, Wohoo!', 'message_ok');\n\t\t\t$this->redirect('/times/index');\n\t\t} else {\n\t\t\t$this->Session->setFlash('Please correct errors below.', 'message_error');\n\t\t\t$this->set('users', $this->Time->User->find('list'));\n\t\t\t$this->set('customers', $this->Time->Customer->find('list'));\n\t\t\t$this->redirect('/times/index');\n\t\t}\n\t}",
"public function run()\n {\n \t$goals=[\n \t \t['My knee hurts','I want a stronger knee', '1'],\n \t \t['I am out of work and can\\'t get a job', 'I seek abundance', '1'],\n \t \t['I am having problems with my wife', 'I want a healthy relationship with my wife', '2'],\n ];\n\n \t $count = count($goals);\n\n\t foreach ($goals as $key => $goalData) {\n\t $goal = new Goal();\n\n\t $goal->created_at = Carbon\\Carbon::now()->subDays($count)->toDateTimeString();\n\t $goal->updated_at = Carbon\\Carbon::now()->subDays($count)->toDateTimeString();\n\t $goal->reason = $goalData[0];\n\t $goal->goal = $goalData[1];\n\t $goal->user_id =$goalData[2];\n\n\t $goal->save();\n\t $count--;\n //\n }\n }",
"function start_new_day( $socket, $data ) {\r\n\tif( $socket->process == true ) {\r\n\t\tglobal $player_array;\r\n\t\tforeach( $player_array as $player ) {\r\n\t\t\t$player->start_exp_today = $player->exp_today = 0;\r\n\t\t}\r\n\t\t$socket->write('day-ok');\r\n\t}\r\n}",
"public function start()\n {\n $model = $this->getModel();\n $model->started_at = date('Y-m-d H:i:s');\n $model->save(false);}",
"public function run()\n {\n\t\t// Exercise segment\n\t\t$exercise = ExerciseFactory::create(\n\t\t\t1,\n\t\t\t'Ghoul Problem at Avans College',\n\t\t\t'Speak to the leader of the settlement.',\n\t\t\t'application/resources/assets/images/Icons/Settlement.png',\n\t\t\t'Preston, go fix your own shit. Im done with those quests',\n\t\t\t1,\n\t\t\t1\n\t\t);\n\n\t\t$exercise->save();\n }",
"function Start(){\r\n\t\t\tglobal $email;\r\n\t\t\tglobal $errorCount;\r\n\t\t\t\r\n\t\t\t\t\t\t\tif (filter_var($email, FILTER_VALIDATE_EMAIL)){\r\n\t\t\t\t\t\t\t\t\tglobal $emailCheck;\r\n\t\t\t\t\t\t\t\t\t$emailCheck = true;\r\n\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\tif (empty($email)){\r\n\t\t\t\t\t\t\t\tdisplayNameRequired(\"E-mail\");\r\n\t\t\t\t\t\t\t\t++$errorCount;\r\n\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\telse if (!empty($email) && (!filter_var($email, FILTER_VALIDATE_EMAIL))){\r\n\t\t\t\t\t\t\t\tdisplayNameRequired(\"E-mail\");\r\n\t\t\t\t\t\t\t\t++$errorCount;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\r\n\t\tif(isset($_POST['Submit'])){\r\n\t\t\t//RedirectUser(); <--- Slight bug with this function, will work on it\r\n\t\t\tSubmitContent();\r\n\t\t\tBeginNewEntry();\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}",
"public function run()\n {\n\n \tMeetingType::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // -- Generate 3 Meeting Types\n $types = array(\"Thoroughbred\",\"Greyhound\",\"Harness\");\n\n foreach ($types as $type) {\n MeetingType::create([\n 'name' => $type\n ]);\n }\n\n }",
"public function createAppointmentStartTime()\n {\n $dateTime = strtotime(\"+\" . $this->getStartTimeslot()->getWeight() * 900 . \" seconds\", $this->getAppointmentDate()->format('U'));\n $currentDateTime = new \\DateTime();\n $currentDateTime->setTimestamp($dateTime);\n $this->setHiddenAppointmentStartTime($currentDateTime);\n return;\n }",
"public function announce();",
"public function run()\n {\n $course = Course::find(1);\n $deadline = new Deadline;\n $deadline->course = $course->id;\n $deadline->name = \"Final Upload\";\n $deadline->filetypes = \"pdf, zip\";\n $date = new DateTime();\n $date->add(new DateInterval('P30D'));\n $deadline->date = $date;\n $deadline->save();\n $deadline = new Deadline;\n $deadline->course = $course->id;\n $deadline->name = \"Interim Report\";\n $deadline->filetypes = \"pdf, zip\";\n $date = new DateTime();\n $date->add(new DateInterval('P4D'));\n $deadline->date = $date;\n $deadline->save();\n\n }",
"public function userMeetings()\n\t{\n\t\t//get user session\n\t\t$currenttime = time();\n\t\t$extra_time = Configure::read('extra_meetingtime'); //done in bootstrap\n\t\t$user = $this->Session->read('UserData.userName');\n\t\t$userCourse = $this->Session->read('UserData.usersCourses');\n\t\t$user_course_section = $userCourse[0];\n\n\t\t//get Course and section name\n\t\t$course_info = $this->getCourseNameOfUser($user_course_section);\n\t\t$course_name = $course_info->course_name;\n\t\t$course_section = $course_info->section_name;\n\t\t\n\t\t//get allsection setting sections for same course\n\t\t$sections_list = $this->__allSections();\n\t\t$options['conditions'][] = array(\n\t\t\t\t'MeetingInfo.chat_from_course'=>$course_name,\n\t\t\t\t'MeetingInfo.chat_from_section'=>$sections_list,\n\t\t\t\t'OR'=>array('MeetingInfo.is_active' => '1', 'MeetingInfo.chat_meeting_startdate >='=> $currenttime-$extra_time)\n\t\t);\t\t\n\t\t$options['joins'][] = array(\n\t\t\t\t'table' => 'chat_meeting_users',\n\t\t\t\t'alias' => 'Meetingusers',\n\t\t\t\t'type' => 'INNER',\n\t\t\t\t'conditions'=> array('Meetingusers.chat_meeting_name = MeetingInfo.chat_meeting_name',\n\t\t\t\t\t\t'Meetingusers.to_user' => $user,\n\t\t\t\t\t\t'Meetingusers.is_accept !=' => 2)\n\t\t);\n\t\t$options['fields'] = array( 'MeetingInfo.*', 'Meetingusers.id', 'Meetingusers.is_accept' );\n\t\t$options['order'] = array('MeetingInfo.chat_meeting_startdate ASC');\n\t\t$meeting_list = $this->MeetingInfo->find('all', $options);\n\t\t$join_group_img= $this->webroot.\"img/join.png\";\n\t\t$accept_imgsrc= $this->webroot.\"img/accept.png\";\n\t\t$reject_imgsrc= $this->webroot.\"img/reject.png\";\n\t\t$detail_imgsrc= $this->webroot.\"img/meeting_detail.png\";\n\t\t$msgstr = '';\n\t\tif (count($meeting_list))\n\t\t foreach ($meeting_list as $mettings) {\n\t\t \t$meetinguser_id = $mettings['Meetingusers']['id'];\n\t\t \t$meeting_tilte = $mettings['MeetingInfo']['chat_meeting_title'];\n\t\t \t$meeting_name = $mettings['MeetingInfo']['chat_meeting_name'];\n\t\t \t$meeting_date = $mettings['MeetingInfo']['chat_meeting_startdate'];\n\t\t \t$meeting_active = $mettings['MeetingInfo']['is_active'];\n\t\t \t$is_accept = \t$mettings['Meetingusers']['is_accept'];\n\t\t \t@$meetingDetails = $this->__mettingDetail($meeting_name);\n\t\t \t$meetingUserNames = implode(', ', $meetingDetails['users']);\n\t\t\t $msgstr .= \"<li id='meeting_\".$meetinguser_id.\"'><span class='meeting_title'>\".ucfirst($meeting_tilte).\"</span>\";\n\t\t\t //if meeting is not accepted or/denied then showing the buttons for action.\n// \t\t\t if(!$is_accept)\n// \t\t\t \t$msgstr .= \"<span class='prq_icon_meeting' id='meetingaction_\".$meetinguser_id.\"'><input type='image' src='\".$accept_imgsrc.\"' title='accept invitation' onClick=acceptMeetingInvitaion('$meetinguser_id','$meeting_name') />\n// \t\t\t \t <input type='image' src='\".$reject_imgsrc.\"' title='reject invitation' onClick=rejectMeetingInvitaion('$meetinguser_id') /></span>\n// \t\t\t \t\";\n\t\t\t //showing the join meeting from the start date time of the meeting date till 30 minuteslater.\n\t\t\t if (($meeting_date <= $currenttime || $meeting_active) && $is_accept == 1) {\n\t\t\t \t$msgstr .= \"<span class='meeting-detail' id='meeting_detail_\".$meetinguser_id.\"'>\n\t\t\t \t <span class='meeting-date' style='display:none;'> Meeting @ \".date('m/d/Y h:i A', $meetingDetails['date'][0]).\"</span>\n\t\t\t\t <input type='image' class='detail-image' id='detail_meeting_\".$meetinguser_id.\"' onclick=detailMeeting('\".$meetinguser_id.\"') src='\".$detail_imgsrc.\"' title='meeting detail' alt='Detail'/></span>\n\t\t\t \t<span class='join_meeting_area'><input type='image' title='start meeting' id='joinmetting_\".$meeting_name.\"' onclick=joinmeeting('\".$meetinguser_id.\"','\".$meeting_name.\"') src='\".$join_group_img.\"' /></span>\";\n\t\t\t \tif(!$is_accept)\n\t\t\t \t\t$msgstr .= \"<span class='prq_icon_meeting' id='meetingaction_\".$meetinguser_id.\"'><input type='image' src='\".$accept_imgsrc.\"' title='accept invitation' onClick=acceptMeetingInvitaion('$meetinguser_id','$meeting_name') />\n\t\t\t \t\t <input type='image' src='\".$reject_imgsrc.\"' title='reject invitation' onClick=rejectMeetingInvitaion('$meetinguser_id') /></span>\n\t\t\t \t\t\";\n\t\t\t\t$msgstr .= \"<div class='meeting-detail-area' id='below_meeting_detail_\".$meetinguser_id.\"'>\n\t\t\t\t <span class='meeting-users'><b>Participants:</b> $meetingUserNames</span>\n\t\t\t \t</div>\n\t\t\t \t</li>\";\n\t\t\t } else {\n\t\t\t \t$msgstr .= \" <span class='meeting-detail' id='meeting_detail_\".$meetinguser_id.\"'>\n\t\t\t \t<span class='meeting-date'> Meeting @ \".date('m/d/Y h:i A', $meetingDetails['date'][0]).\"</span>\n\t\t\t \t<input type='image' class='detail-image' id='detail_meeting_\".$meetinguser_id.\"' onclick=detailMeeting('\".$meetinguser_id.\"') src='\".$detail_imgsrc.\"' title='meeting detail' alt='Detail'/></span>\";\n\t\t\t \tif(!$is_accept)\n\t\t\t \t\t$msgstr .= \"<span class='prq_icon_meeting' id='meetingaction_\".$meetinguser_id.\"'><input type='image' src='\".$accept_imgsrc.\"' title='accept invitation' onClick=acceptMeetingInvitaion('$meetinguser_id','$meeting_name') />\n\t\t\t \t\t <input type='image' src='\".$reject_imgsrc.\"' title='reject invitation' onClick=rejectMeetingInvitaion('$meetinguser_id') /></span>\n\t\t\t \t\t\";\n\t\t\t \t$msgstr .= \"<div class='meeting-detail-area' id='below_meeting_detail_\".$meetinguser_id.\"'>\n\t\t\t \t<span class='meeting-users'>Participants: $meetingUserNames</span>\n\t\t\t \t</div>\n\t\t\t \t</li>\";\n\t\t\t }\n\t\t }\n\t\t \n\t\t //get current login user\n\t\t //updating the mark read for meeting users as read \n\t\t $user = $this->Session->read('UserData.userName');\n\t\t $this->MeetingUser->updateAll(\n\t\t \t\tarray('MeetingUser.is_read' => 1),\n\t\t \t\tarray('MeetingUser.to_user' => $user)\n\t\t );\n\t\t \n\t\t if ($msgstr == \"\") {\n\t\t \techo \"<span class='noresultfound'>No result found</span>\";\n\t\t \texit;\n\t\t }\n\t\t echo $msgstr;\n\t\t exit;\n\t}",
"public function indexAction()\n {\n\t\t$this->verifySessionRights();\n\t\t$em = $this->getDoctrine()->getManager();\n\t\t$employee=$this->getConnectedEmployee();\n\t\t$this->setActivity($employee->getName().\" \".$employee->getFirstname().\"'s Agenda is consulted by this user\");\n\t\t$aTimes = $this->getAgendaTime();\n\t\t$aDates = $this->getDatesOfWeek();\t\n\t\t$aDkey = array_keys($aDates);\n\t\t$aAgenda = $this->generateAgenda($employee,$aTimes,$aDates);\n\t\t$aFormatdate = $this->formatDate($aDates);\n//print_r($aAgenda);\n/*\necho $aAgenda[4]['endpm'];\necho \"<br>\".$this->getCreatingTsHour();\nif(isset($aAgenda[4]['endpm']) and $this->getCreatingTsHour()>0 and $this->getCreatingTsHour()<$aAgenda[4]['endpm']) \n\techo \"yes\";\nelse \n\techo \"No\";\nexit(0);\n*/\n \treturn $this->render('BoHomeBundle:Agenda:index.html.twig', array(\n \t\t'employee' => $employee,\n\t\t\t'agenda'=>$aAgenda,\n\t\t\t'datekeys'=>$aDkey,\n\t\t\t'dates'=>$aDates,\n\t\t\t'cth'=>$this->getCreatingTsHour(),//cth is the time when the teacher can do the timesheet \n\t\t\t'higham'=>$this->getHighEndAm($aAgenda),\n\t\t\t'formatdates'=>$aFormatdate,\n\t\t\t'ttkeys'=>array_keys($aTimes),\n\t\t\t'today'=> new \\DateTime(date(\"d-m-Y\")),\n\t\t\t'times'=>$aTimes,\n\t\t\t'pm'=>\"tabeau-bord\",\n\t\t\t'sm'=>\"agenda\",\n \t));\n }",
"public function run()\n {\n $startingDate = Carbon::parse('First Monday of January 1990');\n $now = Carbon::now();\n\n // Create 5 initial titles.\n for ($this->titleCount; $this->titleCount <= 5; $this->titleCount++) {\n factory(Title::class)->create([\n 'name' => 'Title '.$this->titleCount,\n 'slug' => 'title'.$this->titleCount,\n 'introduced_at' => $startingDate->hour(mt_rand(9, 18)),\n ]);\n }\n\n // Create 1 title every 8 years.\n while ($startingDate->addYears(8)->lte($now)) {\n for ($x = 1; $x <= 1; $x++) {\n factory(Title::class)->create([\n 'name' => 'Title '.$this->titleCount,\n 'slug' => 'title'.$this->titleCount,\n 'introduced_at' => $startingDate->hour(mt_rand(9, 18)),\n ]);\n $this->titleCount++;\n }\n }\n }",
"public function start() {\n // Init stuff\n $this->combatantAID = $this->combatantA->id;\n $this->combatantBID = $this->combatantB->id;\n\n // Decide between pve and pvp\n if(get_class($this->combatantB) == \"Monster\") {\n $this->combatantB->call(\"getReadyForBattle\");\n $this->type = \"monster\";\n } else {\n $this->type = \"pvp\";\n }\n \n $this->state = \"ongoing\";\n $this->winnerType = 'undecided';\n \n $this->battleeffects = new BattleeffectList();\n \n \n if($this->type == \"pvp\") {\n // @todo Should players have first round battle messages?\n } else {\n $battleMsg = new Battlemessage(\n $this->combatantB->call(\"createFirstRoundCombatMessage\")\n );\n $this->log($this->combatantB, $battleMsg);\n }\n\n // Insert new DB record\n $this->insert();\n \n // Set ongoingBattleID for combattants\n $this->combatantA->ongoingBattleID = $this->id;\n if($this->type == \"pvp\") {\n $this->combatantB->ongoingBattleID = $this->id;\n // $this->combatantB->save();\n }\n \n $this->saveObjectState();\n }",
"public function run()\n {\n Role::create([\"name\" => \"admin\"]);\n Role::create([\"name\" => \"gebruiker\"]);\n\n $user = User::create([\n \"name\" => \"Kees van Opdorp\",\n \"email\" => \"keesjrvanopdorp@live.nl\",\n 'email_verified_at' => now(),\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password\n 'remember_token' => Str::random(10),\n ]);\n $nonAdmin = User::create([\n \"name\" => \"Kees van Opdorp\",\n \"email\" => \"keesjrvanopdorp@gmail.com\",\n 'email_verified_at' => now(),\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password\n 'remember_token' => Str::random(10),\n ]);\n\n $user->assignRole('admin');\n $nonAdmin->assignRole(\"gebruiker\");\n\n Appointment::create([\"date\" => Carbon::now(), \"user_id\" => 2, \"uuid\" => Str::uuid(), \"reason\" => \"test\", \"description\" => \"test\"]);\n }",
"public function run()\n {\n $about = [\n \"Housing Support Inc. was incorporated in 1990 as a vehicle to purchase a shelter for women and their children located in Amesbury Ma. In 1994, the bylaws were changed to broaden the scope of the agency and to add community leaders to the board.\",\n\n \"Since then the corporation has developed an additional eight properties in the communities of Haverhill, Lawrence, and Amesbury, which offer sober housing, supportive housing to homeless and/or disabled individuals and veterans. The projects were successfully completed despite challenges presented by difficult areas for the development and complex methods of competitive financing and public grant awards.\",\n\n \"These projects testify to a strong record by HSI in its ability to acquire property and develop it into affordable housing through public grants, public equity financing, market financing, and private donations. HSI has worked with The MA Land Bank, Community Economic Development and Assistance Corporation, Federal HOME Loan Bank, DHCD, DPH, DMH, DSS, MA Housing Finance Agency, Municipal Community Development Offices, MA Housing, North Shore HOME Consortium, Department of Housing and Urban Development and numerous local and regional housing authorities.\",\n\n \"HSI has received national recognition for its work when the “Elms” was selected by the Fannie Mae Foundation to receive one of only eighteen awards given nationwide for Excellence.\",\n\n \"Financial Partners include the Department of Housing and Urban Development, DHCD, Newburyport Bank, Pentucket Bank, CEDAC, Mass Housing, Mass Development North Shore HOME Consortium, and the Federal HOME Loan Bank.\"\n ];\n\n $a = New About();\n $a->firstp = $about[0];\n $a->secondp = $about[1];\n $a->thirdp = $about[2];\n $a->fourthp = $about[3];\n $a->fifthp = $about[4];\n $a->save();\n }",
"public function run()\n\t{\n\t\t$this->command->info(\"This is it. Starting admissions seeding...\");\n\n\t\t$admissions = [];\n\n\t\t$faker = Faker::create('en_PH');\n\t\t\n\t\t$stns = [\n\t\t\t'MEDICAL1', \n\t\t\t'MEDICAL2', \n\t\t\t'SURGICAL',\n\t\t\t'MEDSURGI',\n\t\t\t'PEDIA',\n\t\t\t'OB-MATER'\n\t\t];\n\n\t\t$rmrks = ['ADMITTED', 'DISCHARGED'];\n\n\t\t$pat_ids = [];\n\n\t\t$current_rooms = [];\n\n\t\t$p_count = DB::table('hpt_pat')->count();\n\n\t\tfor ($i = 0; $i < $this->seeder_count; $i++) { \n\t\t\t$no = $i + 1;\n\t\t\t$this->command->info(\"PATIENT # \" . $no . \":\");\n\n\t\t\t$admissions[$i]['adm_stn'] = $stns[mt_rand(0, count($stns) - 1)];\n\t\t\t$this->command->info(\"Station: \" . $admissions[$i]['adm_stn']);\n\n\t\t\tif (count($current_rooms) > 75) {\n\t\t\t\t$status = \"DISCHARGED\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$status = $rmrks[mt_rand(0, 1)];\t\t\t\t\n\t\t\t}\n\t\t\t$this->command->info(\"Status: \" . $status);\n\n\t\t\t//assign patient id\n\t\t\t//try to evaluate uniqueness of id\n\t\t\t$id;\n\t\t\tdo {\n\t\t\t\t$id = mt_rand(1,$p_count);\n\t\t\t} while (in_array($id, $pat_ids));\n\n\t\t\t$admissions[$i]['adm_patient'] = $id;\n\t\t\tarray_push($pat_ids, $id);\n\t\t\t$this->command->info(\"Patient ID: \" . $id);\n\n\n \t\t\tif ($status == \"ADMITTED\") {\n\t\t\t\t$admissions[$i]['adm_datestart'] = $faker->dateTimeBetween('-3 days', 'now');\n\n\t\t\t\t$is_there_an_end = $faker->boolean;\n\t \t\t\tif($is_there_an_end == true)\n\t \t\t\t\t$admissions[$i]['adm_dateend'] = $faker->dateTimeBetween('+20 days', '+25 days');\n\t \t\t\telse\n\t \t\t\t\t$admissions[$i]['adm_dateend'] = null;\n\n \t\t\t\t// assign a room\n \t\t\t\t// make sure it's available\n \t\t\t\t$rm_start;\n \t\t\t\t$rm_end;\n\n\t\t\t\tif ($admissions[$i]['adm_stn'] === \"MEDICAL1\") {\n\t\t\t\t\t$rm_start = 201;\n\t\t\t\t\t$rm_end = 210;\n\t\t\t\t}\n\t\t\t\telseif ($admissions[$i]['adm_stn'] === \"MEDICAL2\") {\n\t\t\t\t\t$rm_start = 211;\n\t\t\t\t\t$rm_end = 230;\t\t\t\n\t\t\t\t}\n\t\t\t\telseif ($admissions[$i]['adm_stn'] === \"SURGICAL\") {\n\t\t\t\t\t$rm_start = 301;\n\t\t\t\t\t$rm_end = 305;\t\t\n\t\t\t\t}\n\t\t\t\telseif ($admissions[$i]['adm_stn'] === \"MEDSURGI\") {\n\t\t\t\t\t$rm_start = 306;\n\t\t\t\t\t$rm_end = 320;\n\n\t\t\t\t}\n\t\t\t\telseif ($admissions[$i]['adm_stn'] === \"PEDIA\") {\n\t\t\t\t\t$rm_start = 320;\n\t\t\t\t\t$rm_end = 330;\n\t\t\t\t}\n\t\t\t\telseif ($admissions[$i]['adm_stn'] === \"OB-MATER\") {\n\t\t\t\t\t$rm_start = 401;\n\t\t\t\t\t$rm_end = 415;\n\t\t\t\t}\n\n\t\t\t\t$rand_room = $this->set_admitted_room($current_rooms, $rm_start, $rm_end);\n\t\t\t\tif ($rand_room != -1) {\n\t\t\t\t\t$admissions[$i]['adm_room'] = $rand_room;\n\t\t\t\t\tarray_push($current_rooms, $rand_room);\n\t\t\t\t\t$this->command->info(\"Current room: \" . $rand_room);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$status = \"DISCHARGED\";\n\t\t\t\t}\t\t\t\t\n \t\t\t}\n \t\t\telseif ($status == \"DISCHARGED\")\n \t\t\t{\n\t\t\t\t$admissions[$i]['adm_datestart'] = $faker->dateTimeBetween('-35 days', '-30 days');\n\t\t\t\t$admissions[$i]['adm_dateend'] = $faker->dateTimeBetween('-29 days', '-7 days');\n\n\t\t\t\t$room;\n\t\t\t\t//assign a room based on station\n\t\t\t\tif ($admissions[$i]['adm_stn'] == \"MEDICAL1\")\n\t\t\t\t{\n\t\t\t\t\t$room = mt_rand(201,210);\n\t\t\t\t}\n\t\t\t\telseif ($admissions[$i]['adm_stn'] == \"MEDICAL2\") {\n\t\t\t\t\t$room = mt_rand(211,230);\t\t\t\t\n\t\t\t\t}\n\t\t\t\telseif ($admissions[$i]['adm_stn'] == 'SURGICAL') {\n\t\t\t\t\t$room = mt_rand(301,305);\t\t\t\t\n\t\t\t\t}\n\t\t\t\telseif ($admissions[$i]['adm_stn'] == 'MEDSURGI') {\n\t\t\t\t\t$room = mt_rand(306,320);\t\t\t\t\n\t\t\t\t}\n\t\t\t\telseif ($admissions[$i]['adm_stn'] == 'PEDIA') {\n\t\t\t\t\t$room = mt_rand(320,330);\t\t\t\t\n\t\t\t\t}\n\t\t\t\telseif ($admissions[$i]['adm_stn'] == 'OB-MATER') {\n\t\t\t\t\t$room = mt_rand(401,415);\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t$admissions[$i]['adm_room'] = $room;\n\t\t\t\t$this->command->info(\"Previous room: \" . $room);\n \t\t\t}\n\n \t\t\t$admissions[$i]['adm_remark'] = $status;\n\n\t\t\t$this->command->info(\"----------------------------------------\");\n\t\t}\n\n\t\tDB::table('hpt_adm')->insert($admissions);\n\t}",
"public function run()\n {\n $teams = [\n ['name' => 'staff', 'slug' => 'staff'],\n //\n ];\n // First developer\n $user = collect(Spark::$developers)->flatMap(function ($email) {\n return \\App\\User::where('email', $email)->get();\n })->first();\n\n foreach ($teams as $team) {\n if (Spark::team()->all()->isEmpty()) {\n Spark::interact(CreateTeam::class, [\n $user,\n $team\n ]);\n }\n }\n }",
"function generateAttendance($args, $request) {\r\n\t\t$meetingId = isset($args[0]) ? $args[0]: 0;\r\n\t\t$this->validate($meetingId, MINUTES_STATUS_ATTENDANCE);\r\n\t\t$this->setupTemplate(true, $meetingId);\r\n\t\t$meeting =& $this->meeting;\r\n\r\n\t\t$journal =& Request::getJournal();\r\n\t\timport('classes.meeting.form.AttendanceForm');\r\n\t\t$attendanceForm = new AttendanceForm($meetingId, $journal->getId());\r\n\t\t$submitted = Request::getUserVar(\"submitAttendance\") != null ? true : false;\r\n\r\n\t\tif($submitted) {\r\n\t\t\t$attendanceForm->readInputData();\r\n\t\t\tif($attendanceForm->validate()) {\r\n\t\t\t\t$attendanceForm->execute();\r\n\t\t\t\t$attendanceForm->savePdf();\r\n\t\t\t\tRequest::redirect(null, null, 'manageMinutes', $meetingId);\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif ($attendanceForm->isLocaleResubmit()) {\r\n\t\t\t\t\t$attendanceForm->readInputData();\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$attendanceForm->initData();\r\n\t\t\t\t}\r\n\t\t\t\t$attendanceForm->display();\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$attendanceForm->display();\r\n\t\t}\r\n\t}",
"function tickets_autoriser(){}",
"public function run()\n {\n // http://www.telegraph.co.uk/history/britain-at-war/9813502/The-20-greatest-battles-in-British-history.html\n $exercises = [\n '14 June 1645' => 'Naseby (First English Civil War)',\n '13 August 1704' => 'Blenheim (War of the Spanish Succession)',\n '16 April 1746' => 'Culloden (Jacobite Rebellion of 1745)',\n '23 June 1757' => 'Plassey (Seven Years War)',\n '13 September 1759' => 'Quebec (Seven Years War)',\n '19 April 1775' => 'Lexington (American War of Independence)',\n '22 July 1812' => 'Salamanca (Peninsular War)',\n '18 June 1815' => 'Waterloo (Napoleonic Wars)',\n '28 January 1846' => 'Aliwal (First Sikh War)',\n '25 October 1854' => 'Balaklava (Crimean War)',\n '22-23 January 1879' => 'Rorke’s Drift (Zulu War)',\n '25 April 1915 – 9 January 1916' => 'Gallipoli (World War One)',\n '1 July – 18 November 1916' => 'Somme (World War One)',\n '19 September – 31 October 1918' => 'Megiddo (World War One)',\n '23 October – 4 November 1942' => 'El Alamein (World War Two)',\n '6 June – 25 August 1944' => 'D-Day and the Battle for Normandy (World War Two)',\n '8 March – 3 July 1944' => 'Imphal/Kohima (World War Two)',\n '22-25 April 1951' => 'Imjin River (Korean War)',\n '28-29 May 1982' => 'Goose Green (Falklands War)',\n '17 July -12 September 2006' => 'Musa Qala (War in Afghanistan)',\n ];\n $this->lesson('History: The greatest battles in British history', $exercises, $bidirectional = true);\n\n // http://speakspeak.com/resources/vocabulary-elementary-pre-intermediate/70-common-irregular-verbs\n $exercises = [\n 'become' => 'became, become',\n 'begin' => 'began, begun',\n 'break' => 'broke, broken',\n 'bring' => 'brought, brought',\n 'build' => 'built, built',\n 'buy' => 'bought, bought',\n 'catch' => 'caught, caught',\n 'choose' => 'chose, chosen',\n 'come' => 'came, come',\n 'cost' => 'cost, cost',\n 'cut' => 'cut, cut',\n 'do' => 'did, done',\n 'draw' => 'drew, drawn',\n 'drink' => 'drank, drunk',\n 'drive' => 'drove, driven',\n 'eat' => 'ate, eaten',\n 'fall' => 'fell, fallen',\n 'feed' => 'fed, fed',\n 'feel' => 'felt, felt',\n 'fight' => 'fought, fought',\n 'find' => 'found, found',\n 'fly' => 'flew, flown',\n 'forget' => 'forgot, forgotten',\n 'forgive' => 'forgave, forgiven',\n 'get' => 'got, got',\n 'give' => 'gave, given',\n 'go' => 'went, gone',\n 'grow' => 'grew, grown',\n ];\n $this->lesson('English: Common irregular verbs 1 (a-g)', $exercises, $bidirectional = true);\n\n // http://speakspeak.com/resources/vocabulary-elementary-pre-intermediate/70-common-irregular-verbs\n $exercises = [\n 'have' => 'had, had',\n 'hear' => 'heard, heard',\n 'hide' => 'hid, hidden',\n 'hit' => 'hit, hit',\n 'hold' => 'held, held',\n 'know' => 'knew, known',\n 'learn' => 'learned, learnt/learned',\n 'leave' => 'left, left',\n 'lend' => 'lent, lent',\n 'lose' => 'lost, lost',\n 'make' => 'made, made',\n 'mean' => 'meant, meant',\n 'meet' => 'met, met',\n 'pay' => 'paid, paid',\n 'put' => 'put, put',\n 'read' => 'read, read',\n 'ride' => 'rode, ridden',\n 'rise' => 'rose, risen',\n 'run' => 'ran, run',\n 'say' => 'said, said',\n 'see' => 'saw, seen',\n 'sell' => 'sold, sold',\n 'send' => 'sent, sent',\n 'set' => 'set, set',\n 'show' => 'showed, shown',\n 'sing' => 'sang, sung',\n 'sit' => 'sat, sat',\n 'sleep' => 'slept, slept',\n 'speak' => 'spoke, spoken',\n 'spend' => 'spent, spent',\n 'stand' => 'stood, stood',\n 'steal' => 'stole, stolen',\n 'swim' => 'swam, swum',\n 'take' => 'took, taken',\n 'teach' => 'taught, taught',\n 'tell' => 'told, told',\n 'think' => 'thought, thought',\n 'throw' => 'threw, thrown',\n 'understand' => 'understood, understood',\n 'wear' => 'wore, worn',\n 'win' => 'won, won',\n 'write' => 'wrote, written',\n ];\n $this->lesson('English: Common irregular verbs 2 (h-z)', $exercises, $bidirectional = true);\n\n $user = User::factory()->create(\n [\n 'email' => 'admin@example.com',\n 'password' => '$2y$12$/WfobkrcnlmQRIAAWcyw5OU6c9cj13SxGJNYtLSiTVhn8c0jQr1Au',\n // password: admin@example.com\n 'api_token' => 'admin-example-com-api-token',\n ]\n );\n\n // private lessons\n $lesson = Lesson::factory()->create(\n [\n 'name' => 'Private lesson with no exercises',\n 'visibility' => 'private',\n 'owner_id' => $user->id,\n ]\n );\n $lesson->subscribe($user);\n\n $lesson = Lesson::factory()->create(\n [\n 'name' => 'Private lesson with one exercise',\n 'visibility' => 'private',\n 'owner_id' => $user->id,\n ]\n );\n $lesson->subscribe($user);\n Exercise::factory()->create(\n [\n 'lesson_id' => $lesson->id,\n ]\n );\n event(new ExerciseCreated($lesson, $lesson->owner));\n\n $lesson = Lesson::factory()->create(\n [\n 'name' => 'Private lesson with two exercises',\n 'visibility' => 'private',\n 'owner_id' => $user->id,\n ]\n );\n $lesson->subscribe($user);\n Exercise::factory()\n ->count(2)\n ->create(\n [\n 'lesson_id' => $lesson->id,\n ]\n );\n event(new ExerciseCreated($lesson, $lesson->owner));\n\n $lesson = Lesson::factory()->create(\n [\n 'name' => 'Private lesson with three exercises',\n 'visibility' => 'private',\n 'owner_id' => $user->id,\n ]\n );\n $lesson->subscribe($user);\n Exercise::factory()\n ->count(3)\n ->create(\n [\n 'lesson_id' => $lesson->id,\n ]\n );\n event(new ExerciseCreated($lesson, $lesson->owner));\n\n // owned lessons\n $ownedMathLesson1 = Lesson::factory()->create(\n [\n 'name' => 'Math: multiplication table 1-100',\n 'owner_id' => $user->id,\n ]\n );\n $ownedMathLesson1->subscribe($user);\n for ($i = 1; $i <= 10; $i++) {\n for ($j = 1; $j <= 10; $j++) {\n Exercise::factory()->create(\n [\n 'lesson_id' => $ownedMathLesson1->id,\n 'question' => $i . ' x ' . $j,\n 'answer' => $i * $j,\n ]\n );\n }\n }\n event(new ExerciseCreated($ownedMathLesson1, $lesson->owner));\n\n $ownedMathLesson2 = Lesson::factory()->create(\n [\n 'name' => 'Math: multiplication table 100-400',\n 'owner_id' => $user->id,\n ]\n );\n $ownedMathLesson2->subscribe($user);\n for ($i = 10; $i <= 20; $i++) {\n for ($j = 10; $j <= 20; $j++) {\n Exercise::factory()->create(\n [\n 'lesson_id' => $ownedMathLesson2->id,\n 'question' => $i . ' x ' . $j,\n 'answer' => $i * $j,\n ]\n );\n }\n }\n event(new ExerciseCreated($ownedMathLesson2, $ownedMathLesson2->owner));\n\n // owned aggregate lesson\n /** @var Lesson $lesson */\n $lesson = Lesson::factory()->create(\n [\n 'name' => 'All my math lessons aggregated',\n 'owner_id' => $user->id,\n ]\n );\n $lesson->subscribe($user);\n $lesson->childLessons()->attach($ownedMathLesson1);\n $lesson->childLessons()->attach($ownedMathLesson2);\n event(new LessonAggregatesUpdated($lesson, $ownedMathLesson2->owner));\n\n // subscribed lesson\n $lesson = Lesson::factory()->create(\n [\n 'name' => 'Math: multiplication table 400-900',\n ]\n );\n $lesson->subscribe($lesson->owner);\n for ($i = 20; $i <= 30; $i++) {\n for ($j = 20; $j <= 30; $j++) {\n Exercise::factory()->create(\n [\n 'lesson_id' => $lesson->id,\n 'question' => $i . ' x ' . $j,\n 'answer' => $i * $j,\n ]\n );\n event(new ExerciseCreated($lesson, $lesson->owner));\n }\n }\n $lesson->subscribe($user);\n\n // other lessons\n $lesson = Lesson::factory()->create(\n [\n 'name' => 'Math: adding integer numbers',\n ]\n );\n for ($i = 1; $i <= 100; $i++) {\n $a = rand(100, 10000);\n $b = rand(100, 10000);\n Exercise::factory()->create(\n [\n 'lesson_id' => $lesson->id,\n 'question' => $a . ' + ' . $b,\n 'answer' => $a + $b,\n ]\n );\n event(new ExerciseCreated($lesson, $lesson->owner));\n }\n $lesson->subscribe($lesson->owner);\n\n $lesson = Lesson::factory()->create(\n [\n 'name' => 'Math: subtracting integer numbers',\n ]\n );\n for ($i = 1; $i <= 100; $i++) {\n $a = rand(100, 10000);\n $b = rand(100, 10000);\n Exercise::factory()->create(\n [\n 'lesson_id' => $lesson->id,\n 'question' => $a . ' - ' . $b,\n 'answer' => $a - $b,\n ]\n );\n }\n event(new ExerciseCreated($lesson, $lesson->owner));\n $lesson->subscribe($lesson->owner);\n\n $lesson = Lesson::factory()->create(\n [\n 'name' => 'Private lesson of another user',\n 'visibility' => 'private',\n ]\n );\n for ($i = 1; $i <= 5; $i++) {\n $a = rand(10, 100);\n $b = rand(10, 100);\n Exercise::factory()->create(\n [\n 'lesson_id' => $lesson->id,\n 'question' => $a . ' - ' . $b,\n 'answer' => $a - $b,\n ]\n );\n }\n event(new ExerciseCreated($lesson, $lesson->owner));\n $lesson->subscribe($lesson->owner);\n\n $lesson = Lesson::factory()->create(\n [\n 'name' => 'Just one exercise lesson',\n 'visibility' => 'public',\n ]\n );\n Exercise::factory()->create(\n [\n 'lesson_id' => $lesson->id,\n 'question' => $a . ' - ' . $b,\n 'answer' => $a - $b,\n ]\n );\n event(new ExerciseCreated($lesson, $lesson->owner));\n $lesson->subscribe($lesson->owner);\n }",
"function randomstrayquotes_print_recent_activity($course, $viewfullnames, $timestart) {\n return false;\n}",
"public function run()\n {\n\t\t$now = date('Y-m-d H:i:s');\n\n DB::table('events')->insert([\n \t\t\t'name' => \"Paolo's Birthday\",\n 'description' => \"It's a special day because today was the day I was born! Come join my party with Jollibee!\",\n \t\t\t'start_date' => $now,\n 'end_date' => date('Y-m-d H:i:s', strtotime('+3 hour'))\n \t\t\t]);\n\n DB::table('events')->insert([\n 'name' => \"Victor's Birthday\",\n 'description' => \"Lorem ipsum dolor iset; the quick brown fox jumps over the lazy dog.\",\n 'start_date' => $now,\n 'end_date' => date('Y-m-d H:i:s', strtotime('+4 hour'))\n ]);\n\n DB::table('events')->insert([\n 'name' => \"Swimming-palooza\",\n 'description' => \"Have fun swimming! Earn more points!\",\n 'start_date' => Carbon::now()->addDays(-5),\n 'end_date' => Carbon::now()->addDays(+12)\n ]);\n }",
"function start($gameId){\n \n}",
"public function run()\n {\n TypeOfAppointment::truncate();\n\n TypeOfAppointment::create([\n 'appointment_name' => \"First Visit(New)\"\n ]);\n\n TypeOfAppointment::create([\n 'appointment_name' => \"Pending Doc collection for backoffice\"\n ]);\n\n TypeOfAppointment::create([\n 'appointment_name' => \"Bank visit to drop Application\"\n ]);\n\n TypeOfAppointment::create([\n 'appointment_name' => \"Pending Doc collection for Bank\"\n ]);\n\n TypeOfAppointment::create([\n 'appointment_name' => \"Disbursement Doc Collection\"\n ]);\n\n TypeOfAppointment::create([\n 'appointment_name' => \"Pending Disbursement Doc Collection\"\n ]);\n\n TypeOfAppointment::create([\n 'appointment_name' => \"Submitting Demand letter to bank\"\n ]);\n }",
"public function startAssistant()\n {\n\n $employees = $this->admin->employees;\n\n $this->data['can_add_employee'] = 1;\n if ($this->admin->tariffJournal->type === 'free' && count($employees) >= 2){\n $this->data['can_add_employee'] = 0;\n }\n\n $this->data['employees'] = $employees;\n\n $employee = Employee::where('user_id', $this->admin->user_id)->first();\n\n if($employee) {\n\n $this->data['is_employee'] = EmployeeService::where('employee_id', $employee->id)->count() ? true : false;\n\n } else {\n\n $this->data['is_employee'] = false;\n\n }\n\n return view('admin.start_assistant', $this->data);\n }",
"function bigbluebuttonbn_print_recent_activity($course, $isteacher, $timestart) {\n return false; // True if anything was printed, otherwise false\n}",
"public function startBattle()\n {\n echo \"Starting battle.. <br />\";\n echo \"Type of this battle is: <i>\" . $this->_type . \"</i>.<br />\";\n echo \"\\t\\t<i>\" . $this->getTypeDescription() . \"</i><br/>\";\n \n $round = 0;\n while(!$this->battleFinished())\n {\n // prints information about current round:\n echo \"<br /><br />ROUND \" . $round++ . \" Attacker: <i>\";\n echo $this->getAttacker()->getName();\n echo \"</i>\\tDefender: <i>\";\n echo $this->getDefender()->getName() . \"</i>\";\n $this->status();\n \n $this->getAttacker()->fight($this, $this->getDefender());\n \n $this->changeTurn(); \n }\n \n // battle is over, print status and declare winner (if there is any) \n $this->status(); \n echo \"<br/><br/>The winner is: <b>\";\n echo $this->getWinner() . \"</b>!\" . PHP_EOL;\n }",
"public function activityActor();",
"function runningPlay() {\n\t\t// request information about the new challenge ...\n\t\t// ... and callback to function newChallenge() ...\n//\t\t$this->addCall('GetCurrentChallengeInfo', array(), '', 'newChallenge');\n\t}",
"private function __makeMeetingActive($group_name)\n\t{\n\t\t//get current login user session\n\t\t$user = $this->Session->read('UserData.userName');\n\t\t$userCourse = $this->Session->read('UserData.usersCourses');\n\t\t$user_course_section = $userCourse[0];\n\t\t\n\t\t//get Course and section name\n\t\t$course_info = $this->getCourseNameOfUser($user_course_section);\n\t\t$course_name = $course_info->course_name;\n\t\t$course_section = $course_info->section_name;\n\t\t$this->MeetingInfo->updateAll(\n\t\t\t\tarray('MeetingInfo.is_active' => 1),\n\t\t\t\tarray('MeetingInfo.chat_meeting_name' => $group_name)\n\t\t);\n\t\treturn true;\n\t}",
"public function run()\n {\n\n DB::table('activities')->insert([\n [\n 'task_id' => 1,\n 'room_id' => 1,\n 'day' => 1,\n 'week' => 1,\n 'year' => 2018,\n 'started_at' => '08:00:00',\n 'ended_at' => '10:00:00'\n ],\n [\n 'task_id' => 2,\n 'room_id' => 2,\n 'day' => 1,\n 'week' => 1,\n 'year' => 2018,\n 'started_at' => '10:00:00',\n 'ended_at' => '12:00:00'\n ],\n [\n 'task_id' => 3,\n 'room_id' => 3,\n 'day' => 1,\n 'week' => 1,\n 'year' => 2018,\n 'started_at' => '14:00:00',\n 'ended_at' => '16:00:00'\n ]\n ]);\n }",
"public function run()\n {\n $carbon = Carbon::now('America/Lima');\n\n $year = $carbon->year;\n\n $start = clone $carbon;\n $start->firstOfYear();\n\n $end = clone $carbon;\n $end->lastOfYear();\n\n $prev_start = clone $start;\n $prev_start->subYear();\n\n $prev_end = clone $end;\n $prev_end->subYear();\n\n // A past school year\n SchoolYear::create([\n 'name' => ($year-1) . '-II',\n 'start' => $prev_start,\n 'end' => $prev_end,\n 'course_handbook_id' => 1 // malla curricular\n ]);\n\n // Current school year\n SchoolYear::create([\n 'name' => $year . '-I',\n 'start' => $start,\n 'end' => $end,\n 'course_handbook_id' => 1 // malla curricular\n ]);\n }",
"abstract public function start();",
"abstract public function start();",
"public function run()\n {\n \\App\\Models\\Assignment::create([\n\t 'name' => 'Program 1',\n\t 'description' => 'Hello World',\n 'due' => '2016-10-23',\n\t ]);\n\n \\App\\Models\\Assignment::create([\n\t 'name' => 'Program 2',\n\t 'description' => 'Variables',\n 'due' => '2016-11-23',\n\t ]);\n }",
"public function run()\n {\n //\n $faker = Faker\\Factory::create();\n factory(App\\Src\\Appointment\\Appointment::class,25)->make()->each(function($appointment) use ($faker) {\n $company = App\\Src\\Company\\Company::orderByRaw(\"RAND()\")->first();\n\n $service = $company->services->random();\n// $service = App\\Src\\Service\\Service::orderByRaw(\"RAND()\")->first();\n $employee = App\\Src\\Employee\\Employee::orderByRaw(\"RAND()\")->first();\n $timing = App\\Src\\Timing\\Timing::orderByRaw(\"RAND()\")->first();\n// $user = App\\Src\\User\\User::orderByRaw(\"RAND()\")->first();\n $user = App\\Src\\User\\User::find(1);\n $date = $faker->dateTimeBetween('-1 month','+1 year');\n $appointment->company_id = $company->id;\n $appointment->service_id = $service->id;\n $appointment->employee_id = $employee->id;\n $appointment->timing_id = $timing->id;\n $appointment->user_id = $user->id;\n $appointment->date = $date;\n $appointment->save();\n });\n }",
"public function run()\n {\n //1 IT\n DB::table('objectives')->insert([\n 'body'=> \"We Identify and Meet Community Needs\",\n 'goal_id' => 1\n ]);\n\n //2 IT\n DB::table('objectives')->insert([\n 'body'=>\"We Reduce barriers to accessing library services\",\n 'goal_id' => 1\n ]);\n\n //3 IT\n DB::table('objectives')->insert([\n 'body'=>\"Expedite our booking process\",\n 'goal_id' => 2\n ]);\n\n //4 IT\n DB::table('objectives')->insert([\n 'body'=>\"EPL has defined and created a digital public space in collaboration with community and partners\",\n 'goal_id' => 3\n ]);\n\n //5 IT\n DB::table('objectives')->insert([\n 'body'=>\"Act as a catalyst for learning, discovery and creating\",\n 'goal_id' => 3\n ]);\n\n //6 IT\n DB::table('objectives')->insert([\n 'body'=>\"EPL is a staff of learners confident in their abilities to assist customers\",\n 'goal_id' => 3\n ]);\n\n //7 IT\n DB::table('objectives')->insert([\n 'body'=>\"We have transformed our approach to service delivery and use of physical space\",\n 'goal_id' => 4\n ]);\n\n //8 Events team\n DB::table('objectives')->insert([\n 'body'=> \"Together with our community we provide successful, meaningful services that are highly rated and heavily used.\",\n 'goal_id' => 1\n ]);\n\n //9 Events team\n DB::table('objectives')->insert([\n 'body'=>\"Online services are highly used and valued\",\n 'goal_id' => 2\n ]);\n\n //10 Events team\n DB::table('objectives')->insert([\n 'body'=>\"Edmontonians view EPL as integral to their lifelong formal and informal learning\",\n 'goal_id' => 3\n ]);\n\n //11 Events team\n DB::table('objectives')->insert([\n 'body'=>\"There are established partnerships to support programs and services\",\n 'goal_id' => 4\n ]);\n\n //12 Events team\n DB::table('objectives')->insert([\n 'body'=>\"We have a vibrant fund development with increase donor diversity, and increased value of donations and sponsorships.\",\n 'goal_id' => 4\n ]);\n\n //13 Events team\n DB::table('objectives')->insert([\n 'body'=>\"Create a framework to intice high end speakers to come to EPL at no or reduced cost.\",\n 'goal_id' => 5\n ]);\n }",
"function questionnaire_print_recent_activity($course, $isteacher, $timestart) {\n global $CFG;\n require_once($CFG->dirroot . '/mod/questionnaire/locallib.php');\n return false; // True if anything was printed, otherwise false.\n}",
"public function run()\n {\n\n DB::table('appointments')->insert([\n [\n 'title' => 'Mogelijk gebroken been',\n 'date' => '2017-06-07',\n 'location' => 'LUMC Leiden',\n 'description' => 'Patiënt is van de trap af gevallen en vermoedt dat hij een gebroken been heeft. Hij heeft pijn aan zijn onderbeen\n en de pijn straalt door het hele been naar boven. Grote kans op een botbreuk.',\n 'patient_id' => 1,\n 'docter_id' => 1,\n ]\n ]);\n factory(App\\Appointment::class, 1000)->create();\n\n }",
"public function start() {\n $this->setup();\n $this->fight();\n }",
"public function run()\n {\n $faker = Faker::create();\n\n foreach (range(1, 92) as $index) {\n\t $data = new Eptparticipant;\n $data->id_user = $faker->unique()->numberBetween($min = 7, $max = 98);\n\t $data->id_major = $faker->numberBetween($min = 1, $max = 102);\n\t $data->idnumber_eptparticipant = $this->random10();\n\t $data->gender = $faker->randomElement($array = array ('Male','Female'));\n\t $data->place_of_birth = $faker->city;\n $data->date_of_birth = $faker->date($format = 'Y-m-d', $max = 'now');\n\t $data->address = $faker->streetAddress;\n\t $data->handphone_number = $faker->tollFreePhoneNumber;\n $data->created_at = Carbon::now();\n $data->updated_at = Carbon::now();\n $data->save();\n }\n }",
"public function start($start);",
"public function youCanStartLectures()\n {\n // Arrange...\n $this->login();\n $lecture = factory(Lecture::class)->make();\n\n // Act...\n $this->json('post', 'lectures', $lecture->toArray());\n\n // Assert...\n $this->seeStatusCode(Response::HTTP_CREATED);\n $this->seeSuccessStructure([\n 'accessCode',\n 'endedAt',\n 'id',\n 'startedAt',\n 'subjectId'\n ])->seeInDatabase('lectures', [\n 'id' => $this->getSuccessData('id')\n ]);\n }",
"public function bookingCreate($empID, $dt, $custEmail = '', $typeId='')\n {\n require_once('models/Customer.class.php');\n require_once('models/Calendar.class.php');\n require_once('models/CanWork.class.php');\n require_once('models/AppType.class.php');\n require_once('views/BookingView.class.php');\n\n $site = new SiteContainer($this->db);\n $bkv = new BookingView();\n $cal = new Calendar($this->db);\n $cust = null; // Needed in order to not print a customer dropdown if logged in as customer\n \n // If no email supplied, we are booking for the current customer\n if ($this->custLoggedIn() && empty($custEmail))\n {\n $custEmail = $_SESSION['email'];\n } else if ($this->ownerLoggedIn() && empty($custEmail))\n {\n $errors= \"Please provide a valid email address to create this appointment\";\n $this->bookingConfirm($empID, $dt, $typeId, $errors);\n return;\n } else if ($this->ownerLoggedIn()) // email not empty\n {\n try{\n $cust = new Customer($custEmail, $this->db);\n } catch(Exception $e){\n // Was unable to find customer with this email\n $errors = \"Email must be of an existing valid customer\";\n // Re=present the booking confirmation\n $this->bookingConfirm($empID, $dt, $typeId, $errors);\n return;\n }\n }\n \n // Grab the canwork from the databse\n $cw = new CanWork($empID, $dt, $this->db); // Still not a booking!!\n $appType = new AppType($typeId, $this->db);\n \n // Grab the employee from the database\n if (! ($empdata = $this->fetchEmployeeFromDb($empID)) )\n throw new Exception(\"Employee $empID could not be found for booking at time: \".$dt->format('Y-m-d H:i:s'));\n\n // check that it hasnt already been taken\n try {\n $b_meta = $cal->bookingCheckAndReturnMeta($empID, $dt, $appType);\n } catch (Exception $e) {\n $site->printHeader();\n $site->printNav($_SESSION['type']);\n $bkv->printError($e->getMessage());\n $site->printFooter();\n $this->writeLog(\"Creation of booking failed: \" . $e->getMessage());\n return; // Its not possible to create this booking\n }\n \n // Here we want to insert the booking\n $sql = \"INSERT INTO Bookings (empID, email, datetime, startTime, endTime, appType) VALUES (?,?,?,?,?,?);\";\n $stmt = $this->db->prepare($sql);\n\n // Insert our given username into the statement safely\n $stmt->bind_param('sssssi',\n $empID,\n $custEmail,\n $b_meta['dateTime'],\n $b_meta['startTime'],\n $b_meta['endTime'],\n $b_meta['typeid']\n );\n \n \n $site->printHeader();\n $site->printNav($_SESSION['type']);\n \n if( $stmt->execute() ) // Our appointment was successfully booked, now it is a booking\n {\n $bk = new Booking($empID, $cw->get_dateTime(), $this->db);\n $this->writeLog(\"Booking for a \" . $bk->get_type() . \" successfully created at \" . $dt->format('Y-m-d H:i:s')\n . \" with employee \" . $empdata->fullName\n . \" for customer with email \" . $custEmail);\n $bkv->printSuccess($bk, $empdata, $cust);\n } else\n {\n $this->writeLog(\"Creation of a booking failed: \" . $stmt->error);\n $bkv->printError($stmt->error);\n }\n\n $site->printFooter(); \n \n }",
"public function executeBookAppointment(sfWebRequest $request) {\n }",
"public function Talk();",
"public function run()\n {\n $sherlock = array(\n 'A Study in Pink',\n 'The Blind Banker',\n 'The Great Game',\n 'A Scandal in Belgravia',\n 'The Hounds of Baskerville',\n 'The Reichenbach Fall',\n 'The Empty Hearse',\n 'The Sign of Three',\n 'His Last Vow',\n 'The Six Thatchers',\n 'The Lying Detective',\n 'The Final Problem',\n );\n\n for($i=0;$i<count($sherlock);$i++){\n $ep = new Episode();\n $ep->movie_id = 1;\n $ep->episode = $i+1;\n $ep->title = $sherlock[$i];\n $ep->save();\n }\n\n\n $kimetsu = array('Cruelty',\n 'Trainer Sakonji Urokodaki', \n 'Sabito and Makomo', \n 'Final Selection', \n 'My Own Steel', \n 'Swordsman Accompanying a Demon', \n 'Muzan Kibutsuji', \n 'The Smell of Enchanting Blood', \n 'Temari Demon and Arrow Demon', \n 'Together Forever', \n 'Tsuzumi Mansion',\n 'The Boar Bares Its Fangs, Zenitsu Sleeps',\n 'Something More Important Than Life',\n 'The House with the Wisteria Family Crest',\n 'Mount Natagumo',\n 'Letting Someone Else Go First',\n 'You Must Master a Single Thing',\n 'A Forged Bond', \n 'Hinokami',\n 'Pretend Family',\n 'Against Corps Rules',\n 'Master of the Mansion',\n 'Hashira Meeting',\n 'Rehabilitation Training',\n 'Tsuguko, Kanao Tsuyuri',\n 'New Mission');\n \n for($i=0;$i<count($kimetsu);$i++){\n $ep = new Episode();\n $ep->movie_id = 9;\n $ep->episode = $i+1;\n $ep->title = $kimetsu[$i];\n $ep->save();\n }\n }",
"public function run()\n {\n CourseSkill::create(['name' => 'Beginner',]);\n CourseSkill::create(['name' => 'InterMediate',]);\n CourseSkill::create(['name' => 'Advanced',]);\n }",
"abstract function start();",
"public function run()\n {\n $instructors = [\n [\n \"name\" => \"Muhammad Kuswari\",\n \"job\" => \"Mahasiswa\",\n \"expertise\" => \"Fullstack Developer\",\n \"email\" => \"muhammadkuswari@mail.com\",\n \"about\" => \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam eleifend nunc eu turpis pharetra, ut tristique sapien.\"\n ],\n [\n \"name\" => \"Ricky Anwar\",\n \"job\" => \"Frontend Developer\",\n \"expertise\" => \"Frontend Developer Expert\",\n \"email\" => \"rickyanwar@mail.com\",\n \"about\" => \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam eleifend nunc eu turpis pharetra, ut tristique sapien.\",\n ]\n ];\n\n foreach ($instructors as $instructor) {\n Instructor::create($instructor);\n }\n }",
"public function start($name);",
"function submitted_events_create_walk($submission, $level) {\n\t// create event title\n\t// Note walk title might be empty\n\t$title = $submission->starttime;\n\tif (strlen ( $title ) > 0) {\n\t\t$title .= ' ';\n\t}\n\t$title .= $level;\n\tif (strlen ( $submission->title ) > 0) {\n\t\t$title .= ': ' . $submission->title;\n\t}\n\t$title .= ' (' . submitted_events_group ( $submission, $level ) . ')';\n\t\n\t$content = '';\n\tif (strlen ( $submission->length ) > 0) {\n\t\t$content = '<p>' . $submission->length . '</p>';\n\t}\n\t\n\tif (strlen ( $submission->description ) > 0) {\n\t\t$content .= '<p>' . $submission->description . '</p>';\n\t}\n\t\n\t$content .= '<p>' . submitted_events_packed_lunch ( $submission ) . submitted_events_postwalk ( $submission ) . '</p>';\n\t\n\tif (strlen ( $submission->coleader ) > 0) {\n\t\t$content .= '<p>Walk Leaders: ' . submitted_events_strip_surname ( $submission->name ); \n\t\t$content .= ' (' . trim ( $submission->phone ) . ') and ';\n\t\t$content .= submitted_events_strip_surname ( $submission->coleader );\n\t\t$content .= ' (' . trim ( $submission->coleaderphone ) . ')</p>';\n\t} else {\n\t\t$content .= '<p>Walk Leader: ' . submitted_events_strip_surname ( $submission->name ) . ' (' . trim ( $submission->phone ) . ')</p>';\n\t}\n\t\n\t$content .= \"<p>Meet: \" . $submission->starttime . \" at \";\n\t\n\t// if meeting point is not a normal one, then only the alt meeting point is to be used\n\tif (submitted_events_starts_with ( $submission->meetpt, '--' ) || submitted_events_starts_with ( $submission->meetpt, 'Other' )) {\n\t\tif (strlen ( $submission->altmeetpt ) > 0) {\n\t\t\t$content .= $submission->altmeetpt;\n\t\t}\n\t\t$content .= submitted_events_process_mapurl ( $submission, $content );\n\t\t$content .= '</p>';\n\t} else {\n\t\t$content .= $submission->meetpt . '</p>';\n\t\t$content .= submitted_events_car_share_organiser($submission);\n\t\t\n\t\tif (strlen ( $submission->altmeetpt ) > 0) {\n\t\t\t// append details for alternative meeting point\n\t\t\t$content .= '<p>Alternatively meet at ' . $submission->altmeetpttime . ' at ' . $submission->altmeetpt;\n\t\t\t\n\t\t\tif (submitted_events_starts_with ( $submission->altmeetcontactleader, 'Yes')) {\n\t\t\t\t$content .= '<br>Please contact the walk leader if you will be meeting them there.';\n\t\t\t}\n\t\t\t$content .= submitted_events_process_mapurl ( $submission );\n\t\t\t$content .= '</p>';\n\t\t}\n\t}\n\t\n\tsubmitted_events_insert_post ( $submission, $title, $content );\n}",
"public function run()\n {\n $this->createSection('complete room', 1);\n $this->createSection('complete room', 2);\n $this->createSection('complete room', 3);\n $this->createSection('double table',2);\n $this->createSection('single table',2);\n $this->createSection('single table',2);\n $this->createSection('single long table',2);\n $this->createSection('single high table',2);\n $this->createSection('virtual reality',3 );\n $this->createSection('double long table',3);\n }",
"public function schedule()\n\t{\n\t\tif (! $this->is_leader) {\n\t\t\t$this->redirect('admin/error/deny');\n\t\t}\n\n\t\t$pageno = I('get.p', 1, 'intval');\n $pagesize = C('pagesize');\n $limit = $pageno . ',' . $pagesize;\n\n\t\t$uid \t = $this->uid;\n\t\t$username = $this->username;\n\t\t$time = time();\n\n\t\t$where = array();\n\t\t$where = array(\n\t\t\t'leader_uid' => array('EQ', $uid),\n\t\t\t's_time'\t => array('ELT', $time),\n\t\t\t'status' => array('NEQ', 3)\n\t\t);\n\n\t\t$projectModel = M('project');\n\t\t$projectArr = $projectModel\n\t\t\t->where($where)\n\t\t\t->order('status asc, s_time desc, id asc')\n\t\t\t->page($limit)\n\t\t\t->select();\n\n\t\t$total = $projectModel->where($where)->count();\n $Page = new \\Think\\Page($total, $pagesize);\n $Page->setConfig('prev', '«上一页');\n $Page->setConfig('next', '下一页»');\n $show = $Page->show();\n\n $startable_num = get_startable_projects_num($uid);\n $finished_num = get_markable_projects_num($uid);\n\n $this->assign('data', $projectArr);\n $this->assign('show', $show);\n $this->assign('pagenum', $Page->totalPages);\n $this->assign('index', $Page->firstRow+1);\n $this->assign('startable_num', $startable_num);\n $this->assign('finished_num', $finished_num);\n $this->assign('uid',\t $this->uid);\n $this->assign('truename', $this->truename);\n\t\t$this->display();\n\t}",
"function etherpadlite_print_recent_activity($course, $isteacher, $timestart) {\n return false; // True if anything was printed, otherwise false.\n}",
"public function acceptInvitation()\n\t{\n\t\t$id = $this->request->data['id'];\n\t\t$room_name = $this->request->data['roomName'];\n\t\t$invite['MeetingUser']['id'] = $id;\n\t\t//set status 1 as accepted\n\t\t$invite['MeetingUser']['is_accept'] = 1;\n\t\t$invite['MeetingUser']['is_read'] = 1;\n\t\t$invite['MeetingUser']['is_attend'] = 0;\n\t\t//set notification\n\t\t$oldCount1 = $this->Session->read('oldMeetingCount');\n\t\tif ($oldCount1>0) {\n\t\t\t$newCount1 = $oldCount1-1;\n\t\t\t$this->Session->write('oldMeetingCount',$newCount1);\n\t\t}\n\t\tif($this->MeetingUser->save($invite))\n\t\t\techo \"1\";\n\t\telse\n\t\t\techo \"0\";\n\t\texit;\n\t}",
"public function run()\n {\n $param = [\n 'owner' => 1,\n 'due_date' => '2020-11-01',\n 'title' => 'My first schedule',\n 'description' => 'My first task',\n ];\n $task = new Schedule();\n $task->fill($param)->save();\n\n $param = [\n 'owner' => 1,\n 'due_date' => '2020-11-10',\n 'title' => 'Do something',\n 'description' => '- something to progress',\n ];\n $task = new Schedule();\n $task->fill($param)->save();\n\n $param = [\n 'owner' => 2,\n 'due_date' => '2020-11-10',\n 'title' => 'Anoter user tasks',\n 'description' => 'This is anoter tasks',\n ];\n $task = new Schedule();\n $task->fill($param)->save();\n }",
"public function approveInvitation() {\n $this->autoRender = false;\n $communityId = $this->request->data['communityId'];\n $community = $this->Community->findById($communityId);\n if (!empty($community)) {\n $userId = $this->Auth->user('id');\n $this->CommunityMember->approve($communityId, $userId);\n\t\t\t//Community follow data\n\t\t\t$followCommunityData = array(\n\t\t\t\t'type' => FollowingPage::COMMUNITY_TYPE,\n\t\t\t\t'page_id' => $communityId,\n\t\t\t\t'user_id' => $userId,\n\t\t\t\t'notification' => FollowingPage::NOTIFICATION_ON\n\t\t\t);\n\t\t\t$this->FollowingPage->followPage($followCommunityData);\n\t\t\t\n $this->Session->setFlash(__('You are now a member of this community.'), 'success');\n } else {\n $this->Session->setFlash(__($this->invalidMessage), 'error');\n }\n }",
"public function run()\n {\n $faker = Faker::create('App\\Attend');\n\n for($i = 1; $i <= 20; $i ++){\n \tDB::table('attends')->insert([\n \t\t'user_id' => $faker->numberBetween($min = 1, $max = 20),\n \t\t'meet_id' => $faker->numberBetween($min = 1, $max = 25),\n \t\t'attending' => $faker->numberBetween($min = 0, $max = 1),\n \t\t'deleted' => 0,\n \t\t'updated_at' => \\Carbon\\Carbon::now(),\n \t\t'created_at' => \\Carbon\\Carbon::now(),\n \t\t]);\n }\n\n }",
"public function startWorking(){\r\n }",
"function annotation_print_recent_activity($course, $viewfullnames, $timestart) {\n return false;\n}",
"public function run()\n {\n $weekdays = [\n 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday',\n ];\n\n //seeding for channel 1\n\n $programmes[] = [\n 'Monday' => [\n [\n 'id' => '539b9fb2-00a3-320f-abcb-48be7ae6c633',\n 'name' => 'Lost in Space',\n 'start_time' => '12:10',\n 'end_time' => '14:10',\n\n ],\n\n [\n 'id' => 'ff32b3d3-c74e-3b91-b037-89af0095bd20',\n 'name' => 'Money Heist',\n 'start_time' => '14:15',\n 'end_time' => '17:15',\n\n ],\n ],\n\n 'Tuesday' => [\n [\n 'id' => 'fe9d1679-c391-355a-acc0-6873c3dc4fd5',\n 'name' => 'Lost in Time',\n 'start_time' => '12:10',\n 'end_time' => '14:10',\n\n ],\n\n [\n 'id' => '8e9290e0-7069-3e90-a0fb-dbf68c596a40',\n 'name' => 'Bank Heist',\n 'start_time' => '14:15',\n 'end_time' => '17:15',\n\n ],\n ],\n\n 'Wednesday' => [\n [\n 'id' => 'b94e9d00-4b7d-338f-8025-34144dcb31a3',\n 'name' => 'Launch Time Talkshow',\n 'start_time' => '12:10',\n 'end_time' => '14:10',\n\n ],\n\n [\n 'id' => '1a896cf7-9471-38e3-b07d-5f312e5fbc3a',\n 'name' => 'Evening Time TalkShow',\n 'start_time' => '14:15',\n 'end_time' => '17:15',\n\n ],\n ],\n\n 'Thursday' => [\n [\n 'id' => '83bec398-1ddb-3ea6-973b-e0fec9c5c45e',\n 'name' => 'Lost in warmhole',\n 'start_time' => '12:10',\n 'end_time' => '14:10',\n\n ],\n\n [\n 'id' => '6eaae8ce-ea3d-3870-ac46-8c263e440d18',\n 'name' => 'New Generation',\n 'start_time' => '14:15',\n 'end_time' => '17:15',\n\n ],\n ],\n\n 'Friday' => [\n [\n 'id' => 'cca48f07-5973-32af-ae2e-1c96dc979a14',\n 'name' => 'Its Friday',\n 'start_time' => '12:10',\n 'end_time' => '14:10',\n\n ],\n\n [\n 'id' => '4edfbb49-f061-36e1-9845-9af350290059',\n 'name' => 'preparing Weekend show',\n 'start_time' => '14:15',\n 'end_time' => '17:15',\n\n ],\n ],\n\n 'Saturday' => [\n [\n 'id' => '705d1169-2cc5-3b96-92f8-3d9a339b29b7',\n 'name' => 'weekend show',\n 'start_time' => '12:10',\n 'end_time' => '14:10',\n\n ],\n\n [\n 'id' => 'b0414f97-6a0d-39ae-af1b-608bf928439e',\n 'name' => 'saturday show',\n 'start_time' => '14:15',\n 'end_time' => '17:15',\n\n ],\n ],\n\n 'Sunday' => [\n [\n 'id' => '35659515-c0a5-3729-abd4-94e0955a7dcb',\n 'name' => 'Sunday show',\n 'start_time' => '12:10',\n 'end_time' => '14:10',\n\n ],\n\n [\n 'id' => '634ef745-c87d-3538-9ace-d6b940b8f4ae',\n 'name' => 'Sunday afternoon show',\n 'start_time' => '14:15',\n 'end_time' => '17:15',\n\n ],\n ],\n\n ];\n\n $programmes[] = [\n 'Monday' => [\n [\n 'id' => '24765d20-0374-3b08-bb02-5bd8ea020336',\n 'name' => 'Mandalorian',\n 'start_time' => '10:00',\n 'end_time' => '12:00',\n\n ],\n\n [\n 'id' => '85cf96bc-5e8b-3af3-a26b-bde1f0d1f232',\n 'name' => 'Start wars - Clone wars',\n 'start_time' => '13:15',\n 'end_time' => '14:15',\n\n ],\n ],\n\n 'Tuesday' => [\n [\n 'id' => 'd5d7e782-278f-367c-b7c3-151538ffdb0c',\n 'name' => 'Legendary skywalker',\n 'start_time' => '11:00',\n 'end_time' => '12:00',\n\n ],\n\n [\n 'id' => 'b350e69d-febe-311a-8d12-337ed8597adc',\n 'name' => 'Ashoka Story',\n 'start_time' => '14:15',\n 'end_time' => '17:15',\n\n ],\n ],\n\n 'Wednesday' => [\n [\n 'id' => '579b36a9-7a67-3023-b9c7-ab29173d1e17',\n 'name' => 'Yoda Show',\n 'start_time' => '12:10',\n 'end_time' => '14:10',\n\n ],\n\n [\n 'id' => 'd65ba306-7c19-370d-9caf-213fb0a02204',\n 'name' => 'Baby Yoda show',\n 'start_time' => '14:15',\n 'end_time' => '17:15',\n\n ],\n ],\n\n 'Thursday' => [\n [\n 'id' => '04ba67bc-49e4-3d97-abcb-28d4be1ff86f',\n 'name' => 'Obi-Wan Kenobi',\n 'start_time' => '12:10',\n 'end_time' => '14:10',\n\n ],\n\n [\n 'id' => 'b573ae3a-e733-3f17-95d5-43db076e3cf6',\n 'name' => 'Jurassic Park',\n 'start_time' => '14:15',\n 'end_time' => '17:15',\n\n ],\n ],\n\n 'Friday' => [\n [\n 'id' => 'd812b000-25a0-35a8-8216-3e7941684a11',\n 'name' => 'Starwars - Friday Show',\n 'start_time' => '12:10',\n 'end_time' => '14:10',\n\n ],\n\n [\n 'id' => '287ee550-233c-3eb0-9946-88ff90db08be',\n 'name' => 'Starwars - Friday evening show',\n 'start_time' => '14:15',\n 'end_time' => '17:15',\n\n ],\n ],\n\n 'Saturday' => [\n [\n 'id' => 'eded4fc9-9b8b-3136-a1a2-621f607711b9',\n 'name' => 'Iron Man',\n 'start_time' => '12:10',\n 'end_time' => '14:10',\n ],\n\n [\n 'id' => 'ba3bb644-8750-3908-a502-c6f75ed0a999',\n 'name' => 'Spiderman',\n 'start_time' => '14:15',\n 'end_time' => '17:15',\n\n ],\n ],\n\n 'Sunday' => [\n [\n 'id' => '5d31467d-6953-3e7f-986f-eb34f4ad5968',\n 'name' => 'Thanos show',\n 'start_time' => '12:10',\n 'end_time' => '14:10',\n 'duration' => '7200',\n ],\n\n [\n 'id' => 'a9dbf1ac-bdd8-3bcb-8f69-bd15b9203e4c',\n 'name' => 'DR. Strange show',\n 'start_time' => '14:15',\n 'end_time' => '17:15',\n ],\n ],\n\n ];\n\n $index = 0;\n $channels = Channel::select('*')->get();\n foreach ($channels as $key => $channel) {\n foreach ($weekdays as $weekday) {\n foreach ($programmes[$key][$weekday] as $programme) {\n Programme::factory()->create([\n 'id' => $programme['id'],\n 'channel_id' => $channel->id,\n 'name' => $programme['name'],\n 'day_on_streaming' => $weekday,\n 'start_time' => $programme['start_time'],\n 'end_time' => $programme['end_time'],\n 'sequence' => $index,\n ]);\n\n $index++;\n }\n }\n }\n\n }",
"public function emp_start()\n\t{//\t\t\tredirect('/');\n\t\t$data = array();\n\t\t$data['title'] = 'Employee Start';\n\t\t//$data['head_css'] = array(config_item('css_url') . 'jquery.ui.dialog.css');\n\t\t\n\t\t$this->load->library('javascript');\n\t\t$this->load->model('client_model');\n\t\t\n\t\t$client_id = $this->session->userdata('CLIENT_ID');\n\t\t$client_job_id = $this->session->userdata('CLIENT_JOB_ID');\n\t\t\n\t\tif (!$client_id && !$client_job_id)\n\t\t{\n\t\t\t//echo '<h1>failed, no client!</h1>';\n\t\t\tredirect('/');\n\t\t}\n\t\t$client = $this->client_model->get_by_id($client_id, $client_job_id);\n\t\t//dumpr($client);\n\t\n\t\tif ($client->first_name == \"\" || $client->surname == \"\")\n\t\t{\n\t\t\techo '<h1>failed, Client non-exist!</h1>';\n\t\t\t//redirect('/');\n\t\t}\n\t\t$data['first_name'] = $client->first_name;\n\t\t$data['surname'] = $client->surname;\n\t\t\n\t\t\n\t\t// assign those session variable to one variable.\n\t\t///////////////////////////////////////////////////////////////////////////////////////////\n\t\t\t//$this->load->helper('t');\n\t\t\t//$text = 'I am a student.';\n\t\t\t//$toLang = 'ch'; //or any other language - http://code.google.com/apis/language/translate/v2/using_rest.html#language-params\n\t\t\t//echo t($text, $toLang);\n\t\t///////////////////////////////////////////////////////////////////////////////////////////\n\t\t\n\t\t//$data['lang'] = $this->session->userdata('language');\n\t\t\n\t\t$data['welcome'] = 'Welcome';\n\t\t///////////////////////////////////////////////////////////////////////////////////////////\n\t\t$this->refresh_data('employee/emp_start', $data);\n\t\t//$this->load->view('employee/emp_start', $data);\n\t}",
"public function run(){\n\t\t$professional = Professional::find(8);\n\n\t\t$platformsArr = array(1, 2, 3, 4);\n\t\t$creativeFieldsArr = array(3);\n\t\t$clientFocusesArr = array(1, 2, 3);\n\t\t$specializationsArr = array(1, 2, 6, 8, 12, 14);\n\n\t\t$professional -> platforms() -> attach($platformsArr);\n\t\t$professional -> creativeFields() -> attach($creativeFieldsArr);\n\t\t$professional -> clientFocuses() -> attach($clientFocusesArr);\n\t\t$professional -> specializations() -> attach($specializationsArr);\n\t}",
"public function run()\n {\n _Log::system(_Log::$INFO, 'seeding educations');\n $ed1 = new Education(['name'=>'TK']);$ed1->save();\n $ed2 = new Education(['name'=>'SD']);$ed2->save();\n $ed3 = new Education(['name'=>'SMP']);$ed3->save();\n $ed4 = new Education(['name'=>'SMU']);$ed4->save();\n $ed5 = new Education(['name'=>'Diploma']);$ed5->save();\n $ed6 = new Education(['name'=>'Sarjana']);$ed6->save();\n $ed7 = new Education(['name'=>'Magister']);$ed7->save();\n $ed8 = new Education(['name'=>'Doktor']);$ed8->save();\n $ed9 = new Education(['name'=>'Tidak Ada']);$ed9->save();\n _Log::system(_Log::$SUCCESS, 'seeding educations success');\n }",
"function cicleinscription_print_recent_activity($course, $viewfullnames, $timestart) {\n return false; // True if anything was printed, otherwise false\n}",
"public function run()\n {\n foreach ([1994, 1995] as $year) {\n for ($m = 1; $m <= 12; $m++) {\n for ($d = 1; $d <= 28; $d++) {\n $this->calendarDb->createCalendar(\n factory(User::class)->create(),\n $year,\n $m,\n $d\n );\n }\n }\n }\n }",
"function beginRace($race) {\n\t\t// request information about the new challenge ...\n\t\t// ... and callback to function newChallenge() ...\n\n\t\t$this->console_text('Begin Race');\n\n\t\tif (!$race)\n\t\t\t{\n//\t\t\t$this->addCall('GetCurrentChallengeInfo', array(), '', 'newChallenge');\n\t\t\t$this->client->query('GetCurrentChallengeInfo');\n\t\t\t$challenge = $this->client->GetResponse();\n\t\t\t$this->newChallenge($challenge);\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\t$this->newChallenge($race[0]);\n\t\t\t}\n\t}",
"function contactmod_print_recent_activity($course, $viewfullnames, $timestart) {\n return false; // True if anything was printed, otherwise false\n}",
"public function proceededAt()\n {\n }",
"function startSurvey($respondent = null) {\n $this->autoRender = false; // turn off autoRender because we need total control over what view to render here\n $this->__clearEditSession(CLEAR_SURVEY); // clear any previous session variables\n $this->Session->write('Survey.type', 'user'); // write the survey type to the session\n $this->redirect(array('action' => 'runSurvey', 'respondentGUID' => $respondent)); // send to the main survey routine\n }",
"public function run()\n {\n //\n $artisan = [\n \"A.C Repairer\",\n \"Artists\",\n \"Barber\",\n \"Basket Weaver\",\n \"Borehole Expert\",\n \"Bricklayer\",\n \"Cameraman/Videographer\",\n \"Car hire Service\",\n \"Car wash\",\n \"Carpenter\",\n \"Caterer/Chef\",\n \"Cleaning Services\",\n \"Dish Installer\",\n \"DJ/Sound Experts\",\n \"Dry Cleaner\",\n \"Electricians\",\n \"Fumigators\",\n \"Gardeners\",\n \"Gas Refills\",\n \"Generator Repairers\",\n \"Hair Dresser\",\n \"Makeup Artist\",\n \"Mechanics\",\n \"Painters\",\n \"Panel Beaters\",\n \"Phone Repairers\",\n \"Printer\",\n \"Plumber\",\n \"Rental Service\",\n \"Spare part Dealers\",\n \"Shoemaker (Cobbler)\",\n \"Tailor\",\n \"Technician\",\n \"Vulcanizer\",\n \"Watch Repairer\",\n \"Welder\",\n \"Battery Charger\",\n \"Bicycle Repairer\",\n \"CCTV Installer\",\n \"Fitness Instructor\",\n \"Key Cutters\",\n \"Sign Writer\",\n \"Towing Truck\"\n ];\n\n $professional = [\n \"Accountants\",\n \"Financial analyst\",\n \"Auditors\",\n \"Financial and Investment Advisers\",\n \"Optometrist\",\n \"Dentist\",\n \"Lawyer\",\n \"Dermatologist\",\n \"Radiologist\",\n \"Pharmacists\",\n \"Physiotherapists\",\n \"Nutritionists\",\n \"Veterinarians\",\n \"Systems administrators\",\n \"Database designers\",\n \"Applications programmers\",\n \"Software developers\",\n \"Digital marketers\",\n \"Systems analysts\",\n \"Web and multimedia developers\",\n \"Authors\",\n \"Journalists\",\n \"Engineers\",\n \"Mathematicians\",\n \"Actuaries\",\n \"Statisticians\",\n \"Architects\",\n ];\n\n\n foreach ($artisan as $item) {\n $work = new \\App\\Work();\n $work->name = $item;\n $work->category = \"Artisan\";\n $work->image = \"/img/artisan.png\";\n $work->amount = 180;\n $work->save();\n }\n\n foreach ($professional as $item) {\n $work = new \\App\\Work();\n $work->name = $item;\n $work->category = \"Profesional\";\n $work->image = \"/img/professional.png\";\n $work->amount = 1000;\n $work->save();\n }\n }",
"public function run()\n {\n PageContent::factory()->aboutUs()->state([\n 'content' => 'D\\'more Event Planner is an Event Planning Software is cutting-edge tool which will allow the client all the resources and visual aids for their event planning. They will be able to play with decoration themes, listen to theme music, design invitations, thank-you cards, and RSVP cards, use the interactive planning calendar, and much more. This software will bring your event into the millennium with cutting edge technology that is designed to save time and money.'\n ])->create();\n PageContent::factory()->aboutUs()->state([\n 'content' => 'We also provide a Step-by-Step Guide in preparation to your event which include a calendar to map out the event, a step-by-step guide on what is needed for and how to put together a successful, worry-free event, resource information, popular refreshments with recipes, games, and tips to put their event in the record books. The events available include birthdays for all ages, meetings, retreats, parties, vacations, and special occasion celebrations such as graduations, holidays, showers, weddings, and receptions.'\n ])->create();\n }",
"public function send_meeting()\n {\n // save meeting\n if($this->user['is_matched'] > 0) {\n $update['data']['from'] = $this->session->userdata('user_id');\n $update['data']['to'] = $this->user['is_matched'];\n $update['data']['meeting_subject'] = $this->input->post('meeting_subject');\n $update['data']['meeting_desc'] = $this->input->post('meeting_desc');\n $update['data']['month'] = $this->input->post('month');\n $update['data']['day'] = $this->input->post('day');\n $update['data']['year'] = $this->input->post('year');\n $update['data']['start_ampm'] = $this->input->post('start_ampm');\n $update['data']['end_ampm'] = $this->input->post('end_ampm');\n $update['data']['stamp'] = date(\"Y-m-d H:i:s\");\n $update['data']['start_time'] = $this->input->post('start_time');\n $update['data']['end_time'] = $this->input->post('end_time');\n\n $update['table'] = 'meetings';\n $update['data']['ical'] = encrypt_url($this->Application_model->insert($update));\n\n // send emails to each party\n\n $match = $this->Application_model->get(array('table'=>'users','id'=>$this->user['is_matched']));\n $update['data']['who'][] = $match['first_name'] . \" \" . $match['last_name'];\n $update['data']['who'][] = $this->user['first_name'] . \" \" . $this->user['last_name'];\n\n //convert date and time to nice format\n $nice_date = date('D M d, Y',strtotime($this->input->post('day').\"-\".$this->input->post('month').\"-\".$this->input->post('year')));\n $update['data']['nice_date'] = $nice_date;\n\n // to requesting user\n $data = array();\n $data['user'] = $this->user['first_name'] . \" \" . $this->user['last_name'];\n $data['message'] = $update['data'];\n $message = $this->load->view('/dash/email/meeting', $data, true);\n $this->email->clear();\n $this->email->from($this->config->item('admin_email', 'ion_auth'), $this->config->item('site_title', 'ion_auth'));\n $this->email->to($this->user['email']);\n\n $full_subject = \"Invitation: \" . $nice_date . \" \" . $this->input->post('start_time') . \"\" . $this->input->post('start_ampm') . \" - \" . $this->input->post('end_time') . \"\" . $this->input->post('end_ampm') . \" (\" . $this->user['first_name'] . \" \" . $this->user['last_name'] . \")\";\n\n $this->email->subject($full_subject);\n $this->email->message($message);\n\n $result = $this->email->send(); // @todo handle false send result\n\n\n // to invitee\n $data = array();\n $data['user'] = $match['first_name'] . \" \" . $match['last_name'];\n $data['message'] = $update['data'];\n $message = $this->load->view('/dash/email/meeting', $data, true);\n $this->email->clear();\n $this->email->from($this->config->item('admin_email', 'ion_auth'), $this->config->item('site_title', 'ion_auth'));\n $this->email->to($match['email']);\n\n $full_subject = \"Invitation: \" . $nice_date . \" \" . $this->input->post('start_time') . \"\" . $this->input->post('start_ampm') . \" - \" . $this->input->post('end_time') . \"\" . $this->input->post('end_ampm') . \" (\" . $match['first_name'] . \" \" . $match['last_name'] . \")\";\n\n $this->email->subject($full_subject);\n $this->email->message($message);\n\n $result = $this->email->send(); // @todo handle false send result\n\n\n $this->session->set_flashdata(\n 'message',\n '<div class=\"alert alert-success\">Meeting Request Sent.</div>'\n );\n\n redirect('/dashboard/match','refresh');\n }else{\n\n redirect('/dashboard','refresh');\n\n }\n\n }",
"public function actionAuth(){\n$client = $this->getClient();;\n$service = new Google_Service_Calendar($client);\n\n// Print the next 10 events on the user's calendar.\n$calendarId = 'primary';\n$optParams = array(\n 'maxResults' => 10,\n 'orderBy' => 'startTime',\n 'singleEvents' => true,\n 'timeMin' => date('c'),\n);\n$results = $service->events->listEvents($calendarId, $optParams);\n$events = $results->getItems();\n\nif (empty($events)) {\n print \"No upcoming events found.\\n\";\n} else {\n print \"Upcoming events:\\n\";\n foreach ($events as $event) {\n $start = $event->start->dateTime;\n if (empty($start)) {\n $start = $event->start->date;\n }\n printf(\"%s (%s)\\n\", $event->getSummary(), $start);\n }\n }\n}",
"public function run()\n {\n $education = new Education();\n $education->university_name = 'Zagazig University';\n $education->faculty_name = 'Faulty Of Computer and Information';\n $education->start_date = '1220501051';\n $education->end_date = '1372910651';\n $education->description = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Inventore adipisci excepturi dolorum. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Inventore adipisci excepturi dolorum.';\n $education->save();\n\n $education = new Education();\n $education->university_name = 'Berlitz English';\n $education->faculty_name = 'English Course And Certification';\n $education->start_date = '1446350651';\n $education->end_date = '1454299451';\n $education->description = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Inventore adipisci excepturi dolorum. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Inventore adipisci excepturi dolorum.';\n $education->save();\n }",
"public function run()\n\t{\n\t\tDB::table('careers')->delete();\n\t\tPage::create(array(\n\t 'jobtitle' => 'New Job Title',\n 'status' => 'Job Status',\n 'date' => 'Job Date',\n 'responsibilities' => 'Job Responsibilities', \n 'requirements' => 'Job requirements',\n 'footertext' => 'footer text',\n\t ));\n\t\t\n\t}",
"function AnnouncementSend()\n{\n\tglobal $topic, $board, $context, $settings;\n\n\tcheckSession();\n\n\t// !!! Might need an interface?\n\t$chunkSize = empty($settings['mail_queue']) ? 50 : 500;\n\n\t$context['start'] = empty($_REQUEST['start']) ? 0 : (int) $_REQUEST['start'];\n\t$groups = getAnnounceGroups();\n\n\tif (isset($_POST['membergroups']))\n\t\t$_POST['who'] = explode(',', $_POST['membergroups']);\n\n\t// Check whether at least one membergroup was selected.\n\tif (empty($_POST['who']))\n\t\tfatal_lang_error('no_membergroup_selected');\n\n\t// Make sure all membergroups are integers and can access the board of the announcement.\n\tforeach ($_POST['who'] as $id => $mg)\n\t\t$_POST['who'][$id] = in_array((int) $mg, $groups) ? (int) $mg : 0;\n\n\t// Get the topic subject and censor it.\n\t$request = wesql::query('\n\t\tSELECT m.id_msg, m.subject, m.body, m.id_member\n\t\tFROM {db_prefix}topics AS t\n\t\t\tINNER JOIN {db_prefix}messages AS m ON (m.id_msg = t.id_first_msg)\n\t\tWHERE t.id_topic = {int:current_topic}',\n\t\tarray(\n\t\t\t'current_topic' => $topic,\n\t\t)\n\t);\n\tlist ($id_msg, $context['topic_subject'], $message, $owner) = wesql::fetch_row($request);\n\twesql::free_result($request);\n\n\tcensorText($context['topic_subject']);\n\tcensorText($message);\n\n\t$message = trim(un_htmlspecialchars(strip_tags(strtr(parse_bbc($message, 'post', array('smileys' => false, 'cache' => $id_msg, 'user' => $owner)), array('<br>' => \"\\n\", '</div>' => \"\\n\", '</li>' => \"\\n\", '[' => '[', ']' => ']')))));\n\n\t// We need this in order to be able send emails.\n\tloadSource('Subs-Post');\n\n\t// Select the email addresses for this batch.\n\t$request = wesql::query('\n\t\tSELECT mem.id_member, mem.email_address, mem.lngfile\n\t\tFROM {db_prefix}members AS mem\n\t\tWHERE mem.id_member != {int:current_member}' . (!empty($settings['allow_disableAnnounce']) ? '\n\t\t\tAND mem.notify_announcements = {int:notify_announcements}' : '') . '\n\t\t\tAND mem.is_activated = {int:is_activated}\n\t\t\tAND (mem.id_group IN ({array_int:group_list}) OR mem.id_post_group IN ({array_int:group_list}) OR FIND_IN_SET({raw:additional_group_list}, mem.additional_groups) != 0)\n\t\t\tAND mem.id_member > {int:start}\n\t\tORDER BY mem.id_member\n\t\tLIMIT ' . $chunkSize,\n\t\tarray(\n\t\t\t'current_member' => MID,\n\t\t\t'group_list' => $_POST['who'],\n\t\t\t'notify_announcements' => 1,\n\t\t\t'is_activated' => 1,\n\t\t\t'start' => $context['start'],\n\t\t\t'additional_group_list' => implode(', mem.additional_groups) != 0 OR FIND_IN_SET(', $_POST['who']),\n\t\t)\n\t);\n\n\t// All members have received a mail. Go to the next screen.\n\tif (wesql::num_rows($request) == 0)\n\t{\n\t\tif (!empty($_REQUEST['move']) && allowedTo('move_any'))\n\t\t\tredirectexit('action=movetopic;topic=' . $topic . '.0' . (empty($_REQUEST['goback']) ? '' : ';goback'));\n\t\telseif (!empty($_REQUEST['goback']))\n\t\t\tredirectexit('topic=' . $topic . '.new#new', we::is('ie'));\n\t\telse\n\t\t\tredirectexit('board=' . $board . '.0');\n\t}\n\n\t// Loop through all members that'll receive an announcement in this batch.\n\twhile ($row = wesql::fetch_assoc($request))\n\t{\n\t\t$cur_language = empty($row['lngfile']) || empty($settings['userLanguage']) ? $settings['language'] : $row['lngfile'];\n\n\t\t// If the language wasn't defined yet, load it and compose a notification message.\n\t\tif (!isset($announcements[$cur_language]))\n\t\t{\n\t\t\t$replacements = array(\n\t\t\t\t'TOPICSUBJECT' => $context['topic_subject'],\n\t\t\t\t'MESSAGE' => $message,\n\t\t\t\t'TOPICLINK' => SCRIPT . '?topic=' . $topic . '.0',\n\t\t\t);\n\n\t\t\t$emaildata = loadEmailTemplate('new_announcement', $replacements, $cur_language);\n\n\t\t\t$announcements[$cur_language] = array(\n\t\t\t\t'subject' => $emaildata['subject'],\n\t\t\t\t'body' => $emaildata['body'],\n\t\t\t\t'recipients' => array(),\n\t\t\t);\n\t\t}\n\n\t\t$announcements[$cur_language]['recipients'][$row['id_member']] = $row['email_address'];\n\t\t$context['start'] = $row['id_member'];\n\t}\n\twesql::free_result($request);\n\n\t// For each language send a different mail - low priority...\n\tforeach ($announcements as $lang => $mail)\n\t\tsendmail($mail['recipients'], $mail['subject'], $mail['body'], null, null, false, 5);\n\n\t$context['percentage_done'] = round(100 * $context['start'] / $settings['latestMember'], 1);\n\n\t$context['move'] = empty($_REQUEST['move']) ? 0 : 1;\n\t$context['go_back'] = empty($_REQUEST['goback']) ? 0 : 1;\n\t$context['membergroups'] = implode(',', $_POST['who']);\n\twetem::load('announcement_send');\n\n\t// Go back to the correct language for the user ;).\n\tif (!empty($settings['userLanguage']))\n\t\tloadLanguage('Post');\n}",
"public function run()\n {\n Mission::create([\n 'mission' => 'To provide a friendly, warm, and\n conductive Residential Home Care to render a quality of service,\n to provide a place of improvement, enhancement and enrichment of learning to the poor,\n indigent and disadvantaged children that serves as a valuable tool for improved and successful life.'\n ]);\n\n Mission::create([\n 'mission' => 'The charism and spirituality of the Franciscan Sisters of the Sacred Hearts\n and the ideals and principles of Fr. Simpliciano of the Nativity provide enlightenment to develop\n the talents and potentials of the children and the young girls.'\n ]);\n\n Mission::create([\n 'mission' => 'For the children and young girls who are served in the institution to regain their\n hope and self-worth by recognizing their capacities in molding themselves to attain their fulfillment in life.'\n ]);\n\n Mission::create([\n 'mission' => 'Strengthening linkages with other and NGO\\'s, GO\\'s and other stakeholders for effective and\n efficient delivery of the programs and services.'\n ]);\n }",
"function tquiz_print_recent_activity($course, $viewfullnames, $timestart) {\n return false; // True if anything was printed, otherwise false\n}",
"public function run()\n {\n $client = new Client();\n $res = $client->request('GET', 'https://api.vatusa.net/v2/facility/'.Config::get('vatusa.facility'));\n $result = json_decode($res->getBody())->role;\n foreach($result as $r) {\n if($r->role == 'ATM') {\n $atm = $r->cid;\n }\n }\n if(isset($atm) == false) {\n foreach($result as $r) {\n if($r->role == 'DATM') {\n $atm = $r->cid;\n }\n }\n if(isset($atm) == false) {\n foreach($result as $r) {\n if($r->role == 'TA') {\n $atm = $r->cid;\n }\n }\n if(isset($atm) == false) {\n foreach($result as $r) {\n if($r->role == 'WM') {\n $atm = $r->cid;\n }\n }\n }\n }\n }\n\n DB::table('announcement')->insert([\n 'id' => 1,\n 'body' => null,\n 'staff_member' => $atm,\n\t\t\t 'created_at' => Carbon::now(),\n\t\t\t 'updated_at' => Carbon::now()\n ]);\n }",
"function bmlt_convert_one_meeting ( $in_original_data, ///< The original file data for the meeting.\n $in_one_meeting, ///< The meeting, in the source format. An associative array.\n $in_count ///< The index of this meeting.\n )\n {\n global $region_bias, $gOutput_level;\n $ret = null;\n\n\n if ( $gOutput_level != 'MINIMAL' )\n {\n echo ( \"<tr><td style=\\\"color:white;background-color:black;font-weight:bold;padding-left:1em\\\" colspan=\\\"3\\\">Starting Conversion of Meeting #$in_count</td></tr>\" );\n }\n else\n {\n echo ( \"<tr><td style=\\\"border-top:2px solid black\\\" colspan=\\\"3\\\"></td></tr>\" );\n }\n \n // We cycle through all the meeting data, and extract that which can be mapped to BMLT context.\n \n if ( isset ( $in_one_meeting ) && is_array ( $in_one_meeting ) && count ( $in_one_meeting ) )\n {\n $in_one_meeting = bmlt_clean_one_meeting ( $in_one_meeting );\n \n if ( $in_one_meeting )\n {\n if ( !$in_one_meeting['published'] )\n {\n echo ( \"<tr><td colspan=\\\"3\\\" style=\\\"font-style:italic;font-size:medium;color:blue;background-color:orange\\\">This meeting is institutional, so it will be unpublished.</td></tr>\\n\" );\n }\n \n $ret = $in_one_meeting;\n // See if we need to geocode.\n if ( !isset ( $ret['longitude'] ) || !isset ( $ret['latitude'] ) || !floatval ( $ret['longitude'] ) || !floatval ( $ret['latitude'] ) )\n {\n $address_string = bmlt_build_address ( $ret );\n \n if ( $address_string )\n {\n if ( $gOutput_level != 'MINIMAL' )\n {\n echo ( \"<tr><td colspan=\\\"3\\\"\" );\n if ( !$in_one_meeting['published'] )\n {\n echo ( \"style=\\\"font-style:italic;font-size:medium;color:blue;background-color:orange\\\"\" );\n }\n echo ( \">This meeting does not have a long/lat, so we are geocoding '$address_string'.</td></tr>\\n\" );\n }\n \n $region_bias = function_exists ( 'bmlt_get_region_bias' ) ? bmlt_get_region_bias() : NULL;\n \n $geocoded_result = bmlt_geocode ( $address_string, ($in_one_meeting['published'] != 0) );\n \n if ( $geocoded_result )\n {\n $ret['longitude'] = floatval ( $geocoded_result['result']['longitude'] );\n $ret['latitude'] = floatval ( $geocoded_result['result']['latitude'] );\n \n if ( isset ( $geocoded_result['result']['partial_geocode'] ) )\n {\n $ret['published'] = 0;\n echo ( \"<tr><td colspan=\\\"3\\\" style=\\\"color:blue;font-size:large;font-weight:bold;background-color:orange\\\">GEOCODE AMBIGUOUS FOR MEETING $in_count!</td></tr>\\n\" );\n echo ( \"<tr><td colspan=\\\"3\\\" style=\\\"font-style:italic;font-size:medium;color:blue;background-color:orange\\\">Meeting $in_count will be unpublished. You should edit this meeting, verify that the address information is correct, and possibly correct the longitude and latitude.</td></tr>\\n\" );\n }\n elseif ( $gOutput_level == 'PROLIX' )\n {\n echo ( \"<tr><td colspan=\\\"3\\\" style=\\\"font-style:italic;font-size:medium\\\">New Long/Lat: \".$ret['longitude'].\", \".$ret['latitude'].\"</td></tr>\\n\" );\n }\n \n if ( array_key_exists ( 'location_postal_code_1', $geocoded_result['result']) )\n {\n $ret['location_postal_code_1'] = $geocoded_result['result']['location_postal_code_1'];\n }\n \n if ( array_key_exists ( 'location_neighborhood', $geocoded_result['result'] ) )\n {\n $ret['location_neighborhood'] = $geocoded_result['result']['location_neighborhood'];\n }\n \n if ( array_key_exists ( 'location_sub_province', $geocoded_result['result'] ) )\n {\n $ret['location_sub_province'] = $geocoded_result['result']['location_sub_province'];\n }\n \n if ( array_key_exists ( 'location_province', $geocoded_result['result'] ) )\n {\n $ret['location_province'] = $geocoded_result['result']['location_province'];\n }\n \n if ( array_key_exists ( 'location_nation', $geocoded_result['result'] ) )\n {\n $ret['location_nation'] = $geocoded_result['result']['location_nation'];\n }\n \n usleep ( 500000 ); // This prevents Google from summarily ejecting us as abusers.\n }\n else\n {\n $ret['published'] = 0;\n echo ( \"<tr><td colspan=\\\"3\\\" style=\\\"color:blue;font-size:large;font-weight:bold;background-color:orange\\\">GEOCODE FAILURE FOR MEETING $in_count! BAD ADDRESS: '$address_string'</td></tr>\\n\" );\n echo ( \"<tr><td colspan=\\\"3\\\" style=\\\"font-style:italic;font-size:medium;color:blue;background-color:orange\\\">Meeting $in_count will be unpublished. You should edit this meeting, correct the address information, and set the longitude and latitude.</td></tr>\\n\" );\n }\n }\n else\n {\n $ret['published'] = 0;\n echo ( \"<tr><td colspan=\\\"3\\\" style=\\\"color:blue;font-size:large;font-weight:bold;background-color:orange\\\">GEOCODE FAILURE FOR MEETING $in_count! CAN'T CREATE ADDRESS!</td></tr>\\n\" );\n echo ( \"<tr><td colspan=\\\"3\\\" style=\\\"font-style:italic;font-size:medium;color:blue;background-color:orange\\\">Meeting $in_count will be unpublished. You should edit this meeting, add the address information, and set the longitude and latitude.</td></tr>\\n\" );\n }\n }\n elseif ( ($gOutput_level == 'PROLIX') || ($gOutput_level == 'VERBOSE') )\n {\n echo ( \"<tr><td colspan=\\\"3\\\">This already has a long/lat. No need to geocode</td></tr>\\n\" );\n }\n \n $background = '';\n \n if ( !$ret['published'] )\n {\n $background = \";background-color:orange\";\n }\n \n if ( $gOutput_level != 'MINIMAL' )\n {\n echo ( '<tr>' );\n echo ( \"<td style=\\\"width:34%;border-bottom:2px solid black;font-weight:bold;font-size:large$background\\\">\" );\n echo ( 'Read From File' );\n echo ( '</td>' );\n echo ( \"<td style=\\\"width:33%;border-bottom:2px solid black;font-weight:bold;font-size:large$background\\\">\" );\n if ( ($gOutput_level == 'PROLIX') || ($gOutput_level == 'VERBOSE') )\n {\n echo ( 'Converted' );\n }\n echo ( '</td>' );\n echo ( \"<td style=\\\"width:34%;border-bottom:2px solid black;font-weight:bold;font-size:large$background\\\">\" );\n echo ( 'Stored in Database' );\n echo ( '</td>' );\n echo ( \"</tr>\\n\" );\n echo ( '<tr>' );\n echo ( \"<td style=\\\"vertical-align:top$background\\\">\" );\n echo ( '<pre>'.htmlspecialchars ( print_r ( $in_original_data, true ) ).'</pre>' );\n echo ( '</td>' );\n echo ( \"<td style=\\\"vertical-align:top$background\\\">\" );\n if ( ($gOutput_level == 'PROLIX') || ($gOutput_level == 'VERBOSE') )\n {\n echo ( '<pre>'.htmlspecialchars ( print_r ( $in_one_meeting, true ) ).'</pre>' );\n }\n echo ( '</td>' );\n echo ( \"<td style=\\\"vertical-align:top$background\\\">\" );\n echo ( '<pre>'.htmlspecialchars ( print_r ( $ret, true ) ).'</pre>' );\n echo ( '</td>' );\n echo ( \"</tr>\\n\" );\n }\n }\n elseif ( $gOutput_level != 'MINIMAL' )\n {\n echo ( \"<tr><td colspan=\\\"3\\\" style=\\\"background-color:red;color:white;padding-left:1em\\\">This meeting is deleted or too corrupted to convert.</td></tr>\\n\" );\n }\n }\n \n return $ret;\n }",
"function _pre()\n\t{\n\t\t$this->takeawayId = $this->takeawaymodel->addTakeaway('testtakeaway', 'testtake', 'test', 'te573t', '555', 'test', 1, 30, 1, 54, -40, 1);\n\t}",
"public function start() {\n\n // TODO: Maybe sometimes\n\n }"
] | [
"0.608004",
"0.5928961",
"0.58814436",
"0.577686",
"0.5730626",
"0.55491185",
"0.5534528",
"0.54851675",
"0.54759026",
"0.54627967",
"0.5457128",
"0.5439203",
"0.53891003",
"0.53824955",
"0.53507733",
"0.53419375",
"0.52636975",
"0.5241427",
"0.5236216",
"0.5233998",
"0.5211003",
"0.5202958",
"0.5183025",
"0.5182313",
"0.5170207",
"0.5167696",
"0.5159623",
"0.5155163",
"0.51549476",
"0.5149925",
"0.5139414",
"0.51364917",
"0.5133349",
"0.5119879",
"0.5112198",
"0.51096934",
"0.510966",
"0.5103398",
"0.51028275",
"0.5102767",
"0.5088499",
"0.50836354",
"0.5077914",
"0.507188",
"0.5055048",
"0.50460833",
"0.5039778",
"0.50384957",
"0.50365865",
"0.50365865",
"0.503267",
"0.502988",
"0.50274855",
"0.5027319",
"0.5023701",
"0.50206727",
"0.5019611",
"0.5018353",
"0.50101745",
"0.50082594",
"0.50040257",
"0.5003863",
"0.50009686",
"0.49985194",
"0.49985126",
"0.49973264",
"0.49914864",
"0.49830937",
"0.4978847",
"0.49716777",
"0.49690455",
"0.4968724",
"0.49593523",
"0.4955423",
"0.4951648",
"0.49474627",
"0.49474445",
"0.49470285",
"0.49464712",
"0.4944594",
"0.49437696",
"0.49368852",
"0.49315062",
"0.49261734",
"0.4924303",
"0.49234548",
"0.49217078",
"0.49147195",
"0.491398",
"0.49111912",
"0.49102557",
"0.49075666",
"0.49042127",
"0.4902181",
"0.49018997",
"0.4901827",
"0.49002302",
"0.48975024",
"0.48949963",
"0.4892905"
] | 0.49018216 | 96 |
/ Description Function is to stop Archieving of meetings when archieving is complete it automatically gets saved to Amazon S3 bucket. Author Dave Brown Created 26 December 2014 | public function stop_archieve ()
{
if (post_data('appointment_id') == NULL || post_data('archieve_id') == NULL)
{
return;
}
$archive_result = $this->opentok->stopArchive(post_data('archieve_id'));
$table_data = array(
'archieve_id' => $archive_result->id,
'duration' => $archive_result->duration,
'size' => $archive_result->size,
'status' => $archive_result->status
);
$this->appointment_model->save_archieve($table_data, 'update', array(
'archieve_id' => $table_data['archieve_id'],
'appointment_id' => post_data('appointment_id'),
));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function abortPendingUploads()\n{\n $count=0;\n $bucket=bucket();\n $res=s3(\"listMultipartUploads\",[\"Bucket\"=>bucket()]);\n if (is_array($res[\"Uploads\"]))\n foreach ($res[\"Uploads\"] as $item)\n {\n\n $r=s3(\"abortMultipartUpload\",[\n \"Bucket\"=>$bucket,\n \"Key\"=>$item[\"Key\"],\n \"UploadId\"=>$item[\"UploadId\"],\n ]);\n $count++;\n }\n return $count;\n}",
"public function purgeAction()\n\t{\n\t\t$this->instanceBucket();\n\n\t\tif ($this->bucket instanceof \\CCloudStorageBucket)\n\t\t{\n\t\t\t$dirFiles = $this->bucket->ListFiles($this->generateUploadDir(), true);\n\n\t\t\t$now = new \\DateTime('now');\n\t\t\tforeach ($dirFiles['file'] as $fileName)\n\t\t\t{\n\t\t\t\tif (preg_match('/^([^_]+)_([0-9]{8})_([^_]+)_.+$/i', $fileName, $parts))\n\t\t\t\t{\n\t\t\t\t\t//$type = $parts[1];\n\t\t\t\t\t//$hash = $parts[3];\n\t\t\t\t\t$date = \\DateTime::createFromFormat('Ymd', $parts[2]);\n\t\t\t\t\t$interval = $now->diff($date);\n\t\t\t\t\tif ($interval->d > self::EXPIRE_DAYS)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->bucket->DeleteFile($this->generateUploadDir(). $fileName);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $this->finishAction();\n\t}",
"function wp_schedule_delete_old_privacy_export_files()\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 $streamTbl = Engine_Api::_()->getDbTable('stream', 'activity');\n $streamTbl->delete('(`object_id` = '.$this->getIdentity().' AND `object_type` = \"ynjobposting_job\")');\n $activityTbl = Engine_Api::_()->getDbTable('actions', 'activity');\n $activityTbl->delete('(`object_id` = '.$this->getIdentity().' AND `object_type` = \"ynjobposting_job\")');\n $attachmentTbl = Engine_Api::_()->getDbTable('attachments', 'activity');\n $attachmentTbl->delete('(`id` = '.$this -> getIdentity().' AND `type` = \"ynjobposting_job\")');\n $this->changeStatus('deleted');\n $this->feature(0, false);\n }",
"public function terminate()\n {\n $this->endedAt = new DateTime();\n }",
"public function __destruct()\n {\n parent::__destruct();\n sleep(3);\n\n if ($this->deleteOnExit) {\n $remaining_tries = 60;\n while ($remaining_tries > 0\n && !@unlink($this->fileDir . $this->videoFiles['webm'])\n && !@unlink($this->fileDir . $this->videoFiles['mp4'])\n && !@unlink($this->fileDir . $this->videoFiles['ogg'])) {\n sleep(2);\n --$remaining_tries;\n }\n } else {\n $this->_saveZoetropeModelToFile();\n }\n }",
"protected function tearDown()\n {\n if (empty($this->bucket)) {\n return;\n }\n foreach ($this->bucket->getObjects() as $object) {\n $object->delete();\n }\n $this->bucket->delete();\n if (in_array('pear-service-amazon-s3', stream_get_wrappers())) {\n stream_wrapper_unregister('pear-service-amazon-s3');\n }\n }",
"public function close_job()\n {\n $this->load->model('Service_job');\n $jobs = $this->Service_job->pickup_expired();\n if(empty($jobs)){\n echo \"no jobs to expire today.\";\n exit; \n }\n foreach($jobs as $data){\n $result[] = $data['job_id'];\n }\n $rows = $this->Service_job->expire($result);\n\n //this function is for reporting.\n if(count($result) == $rows){\n //success\n }else{\n //false\n }\n }",
"protected function _fcpoAmazonLogout() {\n $this->_oFcpoHelper->fcpoDeleteSessionVariable('sAmazonLoginAccessToken');\n $this->_oFcpoHelper->fcpoDeleteSessionVariable('fcpoAmazonWorkorderId');\n $this->_oFcpoHelper->fcpoDeleteSessionVariable('fcpoAmazonReferenceId');\n $this->_fcpoDeleteCurrentUser();\n }",
"protected function onAfterDelete()\n {\n $s3 = $this->getS3Client();\n\n $cmd = $s3->getCommand('DeleteObject', [\n 'Bucket' => $this->Bucket,\n 'Key' => $this->Key\n ]);\n\n $s3->execute($cmd);\n\n return parent::onAfterDelete();\n }",
"public function __destruct ()\n {\n //if no records to push to audit, then leave dont call the dynamo push job\n if ( !sizeof($this->records) ) return;\n\n //get the table onto which audit logs are to be pushed to\n $table = LaravelUtility::getProperty('dynamo.audit.table', 'dz_audit_logs');\n DynamoManager::pushMultipleToDynamo($table, $this->records);\n }",
"function stopDownloadToPool()\n\t{\n\t\tinclude(\"/m23/inc/i18n/\".$GLOBALS[\"m23_language\"].\"/m23base.php\");\n\t\t$this->addInfoMessage($I18N_downloadAborted);\n\n\t\tSERVER_deleteFile($this->getPoolDir().'/lock');\n\n\t\tSERVER_killBackgroundJob('downloadPoolPackages');\n\t}",
"public function testDesiredRemovesJobs()\n {\n $page = $this->objFromFixture(SiteTree::class, 'futureEmbargoExpiry');\n\n $page = $this->finishWorkflow($page);\n\n $this->assertNotEquals(0, $page->PublishJobID);\n $this->assertNotEquals(0, $page->UnPublishJobID);\n\n $page->DesiredPublishDate = '2020-02-01 00:00:00';\n $page->DesiredUnPublishDate = '2020-02-01 02:00:00';\n\n $page->write();\n\n $this->assertEquals(0, $page->PublishJobID);\n $this->assertEquals(0, $page->UnPublishJobID);\n }",
"function schedule_backup_course_delete_old_files($preferences,$starttime=0) {\n\n global $CFG;\n\n $status = true;\n\n //Calculate the directory to check\n $dirtocheck = \"\";\n //if $preferences->backup_destination isn't empty, then check that directory\n if (!empty($preferences->backup_destination)) {\n $dirtocheck = $preferences->backup_destination;\n //else calculate standard backup directory location\n } else {\n $dirtocheck = $CFG->dataroot.\"/\".$preferences->backup_course.\"/backupdata\";\n }\n schedule_backup_log($starttime,$preferences->backup_course,\" checking $dirtocheck\");\n if ($CFG->debug > 7) {\n mtrace(\" Keeping backup files in $dirtocheck\");\n }\n\n //Get all the files in $dirtocheck\n $files = get_directory_list($dirtocheck,\"\",false);\n //Get all matching files ($preferences->keep_name) from $files\n $matchingfiles = array();\n foreach ($files as $file) {\n if (substr($file, 0, strlen($preferences->keep_name)) == $preferences->keep_name) {\n $modifieddate = filemtime($dirtocheck.\"/\".$file);\n $matchingfiles[$modifieddate] = $file;\n }\n }\n //Sort by key (modified date) to get the oldest first (instead of doing that by name\n //because it could give us problems in some languages with different format names).\n ksort($matchingfiles);\n\n //Count matching files\n $countmatching = count($matchingfiles);\n schedule_backup_log($starttime,$preferences->backup_course,\" found $countmatching backup files\");\n mtrace(\" found $countmatching backup files\");\n if ($preferences->backup_keep < $countmatching) {\n schedule_backup_log($starttime,$preferences->backup_course,\" keep limit ($preferences->backup_keep) reached. Deleting old files\");\n mtrace(\" keep limit ($preferences->backup_keep) reached. Deleting old files\");\n $filestodelete = $countmatching - $preferences->backup_keep;\n $filesdeleted = 0;\n foreach ($matchingfiles as $matchfile) {\n if ($filesdeleted < $filestodelete) {\n schedule_backup_log($starttime,$preferences->backup_course,\" $matchfile deleted\");\n mtrace(\" $matchfile deleted\");\n $filetodelete = $dirtocheck.\"/\".$matchfile;\n unlink($filetodelete);\n $filesdeleted++;\n }\n }\n }\n return $status;\n}",
"private function postStopAutopilot() {\r\n $this->clientOwnsProject();\r\n\r\n $this->db->where(\"landingpage_collectionid\", $this->project)\r\n ->set('autopilot', 0)\r\n ->update('landingpage_collection');\r\n\r\n $this->optimisation->updateslots(OPT_SLOTS_EQUIDIST, $this->project);\r\n $this->optimisation->flushCollectionCache($this->project);\r\n return $this->successResponse(201);\r\n }",
"function doStopTourAction() {\n//\t\t$request = DevblocksPlatform::getHttpRequest();\n\n\t\t$worker = CerberusApplication::getActiveWorker();\n\t\tDAO_WorkerPref::set($worker->id, 'assist_mode', 0);\n\t\t\n//\t\tDevblocksPlatform::redirect(new DevblocksHttpResponse($request->path, $request->query));\n\t}",
"function send_to_bucket($attachment, $filename) {\n $aws_key = get_option('aws_key');\n $aws_secret = get_option('secret_key');\n $aws_can_id = get_option('can_id');\n $aws_can_name = get_option('can_name');\n $host = get_option('bucket_host');\n // require the amazon sdk for php library\n require_once 'aws-sdk-for-php-master/sdk.class.php';\n // Instantiate the S3 class and point it at the desired host\n $Connection = new AmazonS3(array(\n 'key' => $aws_key,\n 'secret' => $aws_secret,\n 'canonical_id' => $aws_can_id,\n 'canonical_name' => $aws_can_name,\n ));\n $Connection->set_hostname($host);\n $Connection->allow_hostname_override(false);\n $Connection->enable_path_style(true);\n $bucketname = get_option('bucket_name');\n\n $Connection->create_object($bucketname, $filename, array('fileUpload' => \"$attachment\", 'contentType' => 'text/plain', 'https' => true, ));\n $Connection->set_object_acl($bucketname, $filename , AmazonS3::ACL_PUBLIC);\n $opt['https'] = true; \n\n /*\n This is the return URL if needed\n $plans_url = $Connection->get_object_url($bucketname , $filename, 0, $opt);\n */\n}",
"protected function cleanupOldCompleted(): void\n {\n // successful jobs and failed jobs are deleted after different periods of time\n $this->deleteAsyncJobByThreshold('aj.error IS NULL', $this->cleanupThreshold);\n $this->deleteAsyncJobByThreshold('aj.error IS NOT NULL', $this->cleanupFailedThreshold);\n }",
"public function removeUnfinishedGalleys() {\n\t\tif (!$this->galleysToUpdate or !count($this->galleysToUpdate)) {\n\t\t\treturn;\n\t\t}\n\t\t$galleyDao =& \\DAORegistry::getDAO('ArticleGalleyDAO');\n\t\tforeach ($this->galleysToUpdate as $galleyItem) {\n\t\t\tif (isset($galleyItem->dirty) and ($galleyItem->dirty === true)) {\n\t\t\t\t$id = $galleyItem->newGalley->getId();\n\t\t\t\t$galleyDao->deleteGalley($galleyItem->newGalley);\n\t\t\t\t$galleyItem->dirty = false;\n\t\t\t\t$this->log->warning('file could not be finished, temporary galley is removed: ' . $id);\n\t\t\t}\n\t\t}\n\t}",
"public function destroy(ShareOfAssortment $shareOfAssortment)\n {\n //\n }",
"protected function finish() {}",
"function stop ()\n{\n file_put_contents(config::CLIENT_BASE_DIR . '/act', 'idle');\n die();\n}",
"public function delete()\n {\n\n $file_name = public_path() . \"/jobs/\" . md5($this->user->uid) . \"/\" . md5($this->uid) . '.zip';\n \\Illuminate\\Support\\Facades\\Log::debug($file_name);\n if(file_exists($file_name))\n unlink($file_name);\n return parent::delete(); // TODO: Change the autogenerated stub\n }",
"public function end() {\n $this->memcache->delete(PREFIX_SESSION.$this->sessionID);\n $targets = $this->getTargets();\n foreach ($targets as $share) {\n if ($share->exists()) {\n switch ($share->getType()) {\n case SHARE_TYPE_ALONE:\n $share->end();\n break;\n case SHARE_TYPE_GROUP:\n $share->clean();\n break;\n }\n }\n }\n }",
"protected function stopTask() {}",
"function Delete() {\n\t\t\t/* delete this s3object */\n\t\t\tif ($this->__delete($this->__bucket, $this->__name) == 204) return TRUE;\n\t\t\telse return FALSE;\n\t\t}",
"public function finish() {}",
"public function finish() {}",
"public function finish() {}",
"public function finish() {}",
"public function finish() {}",
"public function finish() {}",
"public function finish() {}",
"public function finish() {}",
"protected function thenExistingDocumentWasArchived()\n {\n }",
"public function keep(){\r\n $this->isDestroyed = true;\r\n }",
"public function cleanScheduleAction(){\n \t$actual = new Frogg_Time_Time();\n \t$cleaning_day = $actual->subtract(3*24*60*60);\n \t$cleaning_stamp = $cleaning_day->getUnixTstamp();\n \t$sql = new Frogg_Db_Sql('DELETE FROM `scheduled` WHERE `timestamp` < '.$cleaning_stamp);\n \tdie;\n }",
"public function actionStop($at=false,$in=false)\n {\n // Stop the competition $in number of seconds from now\n }",
"public function stop()\n {\n // Update worker state and set it as finished\n $this->update(['resume_token' => 0, 'has_finished' => true]);\n }",
"public function cancel()\n {\n $this->confirmationArchived = false;\n }",
"public function destroy(IntakeCourse $intakeCourse)\n {\n //\n }",
"public function tracker_abort(){\n\t\t$this->env_set('tracker:event', false);\n\t\t}",
"protected function schedule_temp_backup_cleanup()\n {\n }",
"public function destroy(Attendace $attendace)\n {\n //\n }",
"public function finish()\n\t{\n\t\t\n\t}",
"public function queue_cleanup_personal_data() {\n\t\tself::$background_process->schedule_ended_subscription_anonymization();\n\t}",
"function tripal_jobs_cancel ($job_id){\n $sql = \"select * from {tripal_jobs} where job_id = %d\";\n $job = db_fetch_object(db_query($sql,$job_id));\n\n // set the end time for this job\n if($job->start_time == 0){\n $record = new stdClass();\n $record->job_id = $job->job_id;\n\t $record->end_time = time();\n\t $record->status = 'Cancelled';\n\t $record->progress = '0';\n\t drupal_write_record('tripal_jobs',$record,'job_id');\n drupal_set_message(\"Job #$job_id cancelled\");\n } else {\n drupal_set_message(\"Job #$job_id cannot be cancelled. It is in progress or has finished.\");\n }\n drupal_goto(\"admin/tripal/tripal_jobs\");\n}",
"public function stop()\n {\n $model = $this->getModel();\n $model->last_run = $model->started_at;\n $model->next_run = $this->getNextRunDate();\n $model->started_at = null;\n $model->save(false);\n }",
"function run_leaving_activity_pre()\n\t\t{\n\t\t\t//actually we never send emails when cancelling\n\t\t\treturn true;\n\t\t}",
"public function unsetEndedAt(): void\n {\n $this->endedAt = [];\n }",
"public function finish() {\r\n\t}",
"function stopWatchingIssue( $sessionID, $issueID ) {\r\n\t\t$user = $_SESSION['userid'];\r\n\t\t$query=\"delete from issuewatch where userid='$user' and issueid='$issueID'\";\r\n\t\tmysql_query($query);\r\n\t}",
"private function deleteDailyBackups()\n {\n try {\n $date = strtotime('-2 months');\n\n // leave first day of the month\n if ((int) date('j', $date) !== 1) {\n $this->filesystem->deleteDir(date(\"Y/m/d\", $date));\n }\n } catch (\\Exception $e) {\n $this->event->fire('MonasheeBackupError', 'Error trying to delete directory on AWS S3');\n }\n }",
"public function destroy(Apartments $apartment)\n {\n //\n }",
"public function finish(): void\n {\n }",
"public function ended();",
"public function cancelDownload() {\n $this->callMethod('cancelDownload');\n }",
"function abort() {\n $this->aborted = TRUE;\n }",
"private function respawn()\n {\n // create new event at the end of the queue\n Mage::getModel('marketingsoftware/queue')\n ->setObject($this->currentStatus)\n ->setAction('file_sync')\n ->save();\n }",
"public function actionDeleteEntryAttachement()\n {\n\n }",
"public function destroy(attendence $attendence)\n\t{\n\t\t//\n\t}",
"function stopWatchingStudent( $sessionID, $studentID ) {\r\n\t\t$user = $_SESSION['userid'];\r\n\t\t$query=\"delete from studentwatch where userid='$user' and studentid='$studentID'\";\r\n\t\tmysql_query($query);\r\n\t}",
"public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }",
"public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }",
"public function cancelDownload() {\n $this->callMethod( 'cancelDownload' );\n }",
"function __destruct()\n {\n if (!$this->should_schedule()) {\n return;\n }\n $this->schedule();\n }",
"public static function deleteEmployeeAllUpcomingShiftsWithAttendance($employee_id){\n date_default_timezone_set('Europe/Prague');\n DB::table('table_employee_shifts')\n ->select('table_employee_shifts.employee_id','table_employee_shifts.shift_id')\n ->join('table_shifts','table_employee_shifts.shift_id','=','table_shifts.shift_id')\n ->where(['table_employee_shifts.employee_id' => $employee_id])\n ->where('table_shifts.shift_start', '>=', Carbon::now())\n ->delete();\n\n DB::table('table_attendances')\n ->select('table_attendances.employee_id','table_attendances.shift_id')\n ->join('table_shifts','table_attendances.shift_id','=','table_shifts.shift_id')\n ->where(['table_attendances.employee_id' => $employee_id])\n ->where('table_shifts.shift_start', '>=', Carbon::now())\n ->delete();\n }",
"public function deleteExpired() {\n\n\t\t\t// Retrieve cache\n\t\t\t$filename = $this->_getFileName();\n\t\t\t$cachedData = $this->_loadCache($filename);\n\n\t\t\t// Filter out and remove all expired objects\n\t\t\tif (is_array($cachedData)) {\n\t\t\t\t$counter = 0;\n\t\t\t\tforeach ($cachedData as $key => $value) {\n\t\t\t\t\t$age = time() - $value['time'];\n\t\t\t\t\tif ($age > $this->_duration) {\n\t\t\t\t\t\tunset($cachedData[$key]);\n\t\t\t\t\t\t$counter++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($counter > 0) {\n\t\t\t\t\t$cachedData = json_encode($cacheData);\n\t\t\t\t\tif (true !== file_put_contents($filename, $cacheData)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t\treturn $counter;\n\t\t\t}\n\t\t}",
"function vitero_delete_instance($id) {\n global $DB;\n\n if (!$vitero = $DB->get_record('vitero', array('id' => $id))) {\n return false;\n }\n\n // Update calendar event.\n $param = array('courseid' => $vitero->course, 'instance' => $vitero->id,\n 'groupid' => 0, 'modulename' => 'vitero');\n $eventid = $DB->get_field('event', 'id', $param);\n\n if (!empty($eventid)) {\n $event = calendar_event::load($eventid);\n $event->delete();\n }\n\n $DB->delete_records('vitero', array('id' => $vitero->id));\n\n // Delete meeting, if no other activity links to this.\n $allmeetings = $DB->count_records('vitero', array('meetingid' => $vitero->meetingid));\n\n if (!$allmeetings) {\n if (!vitero_delete_meeting($vitero)) {\n return false;\n }\n // Delete team.\n vitero_delete_team($vitero->teamid);\n }\n return true;\n}",
"public function destroy(AirlineRate $airlineRate)\n {\n //\n }",
"function s3DeleteFile($filename, $bucketName = null)\n{\n try {\n //get Bucket name\n global $appConfig;\n\n if ($bucketName == null) {\n $bucketName = $appConfig['s3']['bucketName'];\n }\n\n $s3 = \\Illuminate\\Support\\Facades\\App::make('aws')->get('s3');\n if ($s3->deleteMatchingObjects($bucketName, $filename)) {\n return true;\n } else {\n return false;\n }\n } catch (\\Exception $e) {\n return false;\n }\n}",
"public function deactivate() {\t\t\n $dir_path = get_home_path() . '/' . $this->attempts_dir;\n\n $dir = opendir($dir_path);\n\n while (false !== ($file = readdir($dir))) {\n if (($file != '.') && ($file != '..')) {\n unlink($dir_path . '/' . $file);\n }\n }\n rmdir($dir_path);\n closedir($dir);\n\n\n foreach ($this->protected_files as $sfile) {\n $arr = file(get_home_path() . '/' . $sfile);\n unset($arr[1]);\n $arr = array_values($arr);\n file_put_contents(get_home_path() . '/' . $sfile, implode($arr));\n }\n\n wp_clear_scheduled_hook('hackattempts_cleanup');\n wp_clear_scheduled_hook('hackattempts_email');\n\t}",
"function remove($aws_data_object) {\n\t\t}",
"public function CleanUpAction() {\n if ($this->isPost()) {\n $cnt = 0;\n foreach (esf_Auctions::$Auctions as $item => $auction) {\n if ($auction['ended']) {\n esf_Auctions::Delete($item, FALSE);\n $cnt = $cnt+1;\n }\n }\n Messages::Success(\n ( $cnt\n ? Translation::get('Auction.DeletedEnded', $cnt)\n : Translation::get('Auction.NoDeletedEnded') )\n );\n // redirect in case of inline editing\n $this->Request('ajax') && $this->redirect('auction');\n }\n $this->forward();\n }",
"public function markForDeletion(): void\n {\n $this->oldFileName = $this->fileName;\n $this->fileName = null;\n }",
"function html_export_output_format_prepare_amazon_s3($export_options, &$context) {\n\n libraries_load('awssdk');\n\n static $buckets_exist;\n\n $s3 = new AmazonS3();\n\n $bucket_list = $export_options['amazon_s3_bucket'];\n\n // On the first run...\n if (!isset($context['sandbox']['progress'])) {\n\n //Some initialization...\n //Check the/each bucket exists, and create it if it doesn't\n if (!isset($buckets_exist)) {\n\n foreach ($bucket_list as $key => $bucket_info) {\n\n //Create the bucket on s3 if it doesn't exist\n if (!($s3->if_bucket_exists($bucket_info['bucket_name']))) {\n $create_bucket_response = $s3->create_bucket($bucket_info['bucket_name'],\n (isset($bucket_info['bucket_region']) ? $bucket_info['bucket_region'] : AmazonS3::REGION_US_E1)\n );\n // Todo - perhaps add more options for the bucket - e.g. public, private, used for static hosting etc.\n\n // Provided response was positive, wait until it exists before doing anything\n if ($create_bucket_response->isOK()) {\n while (!($s3->if_bucket_exists($bucket_info['bucket_name']))) {\n // Not yet? Sleep for 1 second, then check again\n sleep(1);\n // Todo - it shouldn't be possible for OK and not to exist. But if it does happen, then this is an endless loop.\n }\n\n }\n else {\n $buckets_exist = null;\n throw new Exception(t(\"The bucket named %name can't be created. Bucket names must be globally unique. Maybe this already exists.\", array('name' => $bucket_info['bucket_name'])));\n }\n }\n }\n\n $buckets_exist = TRUE;\n }\n //Now construct the list of all files that might be uploaded\n //Export everything that's there.\n\n //Init the file list\n $file_list = array();\n $file_type_map = array();\n foreach ($bucket_list as $key => $bucket_info) {\n $file_list[$key] = array();\n\n // At the same time as initialising, create a list of filters mapped to bucket, which we need in order to assign files to buckets\n if (isset($bucket_list[$key]['file_patterns']) && $bucket_list[$key]['file_patterns'] != '' ) {\n // Get rid of spaces, * and to be left with file types separated by commas.\n $file_patterns = str_replace(' ', '', $bucket_list[$key]['file_patterns']);\n $file_patterns = str_replace('*', '', $file_patterns);\n $file_types = explode(',', $file_patterns);\n $file_type_list = array_flip($file_types);\n foreach ($file_type_list as $list_key => $list_data) {\n $file_type_list[$list_key] = $key;\n }\n $file_type_map = array_merge($file_type_map, $file_type_list);\n }\n }\n\n // Roll through the directory assigning each file to an S3 bucket.\n $count = 0;\n foreach (@file_scan_directory($export_options['export_path'], '/.*/', array('recurse' => TRUE)) as $fullfilepath => $file) {\n // Usually there won't be any file_map.\n if (empty($file_type_map)) {\n // Then everything belongs in default.\n $file_list['default'][] = $file;\n }\n else {\n // Otherwise...Grab the file ending if one exists\n $ending = strrchr($fullfilepath,'.');\n // And assign to a bucket using the map\n if (($ending !== FALSE) && isset($file_type_map[$ending])) {\n $file_list[$file_type_map[$ending]][] = $file;\n\n // But also, if the option is set, store it in default bucket too. This is useful when S3 is used and cloudfront, but there are changes.\n // This way a direct viewing of an html page in the S3 bucket is guaranteed to look right.\n if (isset($export_options['amazon_all_files_in_default']) && $export_options['amazon_all_files_in_default']) {\n $file_list['default'][] = $file;\n }\n }\n else {\n $file_list['default'][] = $file;\n }\n }\n $count++;\n }\n\n // Prepare the tracking for this stage of the batch\n $context['results']['output_prep'] = array();\n $prep_data = &$context['results']['output_prep'];\n $prep_data['file_list'] = $file_list;\n $prep_data['current_bucket'] = 'default';\n $prep_data['current_file_item'] = 0;\n $prep_data['max_bucket_size'] = array();\n foreach ($bucket_list as $bucket_key => $bucket_data) {\n $prep_data['max_bucket_size'][$bucket_key] = count($file_list[$bucket_key]);\n }\n\n $context['sandbox']['progress'] = 0;\n $context['sandbox']['max'] = $count;\n }\n\n // We only need to do more processing if we need to check the MD5s.\n if ( !isset($export_options['amazon_export_changes']) ||\n ( isset($export_options['amazon_export_changes']) && !$export_options['amazon_export_changes']))\n {\n $context['finished'] = 1;\n }\n else {\n $prep_data = &$context['results']['output_prep'];\n $current_bucket = &$prep_data['current_bucket'];\n $current_file_item = &$prep_data['current_file_item'];\n\n $delete_path = $export_options['export_path'].'/';\n\n // process limit amount of records\n $count = 0;\n $bucket_max = $prep_data['file_list']['max_bucket_size'][$current_bucket];\n while ($count < HTML_EXPORT_PROCESS_LIMIT\n && $context['sandbox']['progress'] < $context['sandbox']['max']\n ) {\n\n //$context['message'] = t('Now processing file %path', array('%path' => 'temp place holder'));\n $context['message'] = t('Now comparing file %number with the Amazon S3 version', array('%number' => ($context['sandbox']['progress'] + 1) ));\n\n //Do something\n //Todo if we aren't going to upload all, then prune those where the MD5 matches\n //Create a batch of things to check and check, removing from $export_list those that match\n\n //What's the MD5 that S3 has?\n $s3_name = str_replace($delete_path, '', $prep_data['file_list'][$current_bucket][$current_file_item]->uri);\n $s3_file_info = $s3->get_object_metadata($bucket_list[$current_bucket]['bucket_name'], $s3_name);\n\n // If the file exists, then it has metadata, and if the metadata indicates the local file is the same, then there's no need to upload.\n if ($s3_file_info) {\n //Remove the \" the tag sometimes contains at the same time\n $etag_digest = str_replace('\"', '', $s3_file_info['ETag']);\n\n // Get the local file digest\n $file_digest = md5_file($prep_data['file_list'][$current_bucket][$current_file_item]->uri);\n // Todo - would it be useful to store the MD5, then reuse with upload?\n\n if (strcmp($etag_digest, $file_digest) == 0) {\n //They are the same. No need to upload... delete from the list\n unset($prep_data['file_list'][$current_bucket][$current_file_item]);\n }\n }\n\n // Update our progress information.\n $context['sandbox']['progress']++;\n $count++;\n $current_file_item++;\n\n // If it's the end of this bucket, flip to the next\n if ($current_file_item == $bucket_max) {\n $current_bucket = _html_export_get_next_bucket($current_bucket, $prep_data['file_list']);\n\n if ($current_bucket !== FALSE) {\n $current_file_item = 0;\n $bucket_max = $prep_data['file_list']['max_bucket_size'][$current_bucket];;\n }\n else {\n // No more buckets - we must be at the end.\n\n //Sanity check\n if ($context['sandbox']['progress'] != $context['sandbox']['max']) {\n throw new Exception(t(\"Problem: Reached the end of the bucket list, but there should still be files to process.\"));\n }\n }\n }\n }\n\n // Inform the batch engine that we are not finished,\n // and provide an estimation of the completion level we reached.\n if ($context['sandbox']['progress'] != $context['sandbox']['max']) {\n $context['finished'] = $context['sandbox']['progress'] / $context['sandbox']['max'];\n }\n else {\n $context['finished'] = 1;\n\n // Todo - this might be a good place to reorder the uploads. We'd like .html files last. And it would be really nice to\n // size balance the list so that batches happen at about the same speed. But we don't know about batches yet.\n }\n }\n}",
"function delete_dir($keyname,$path){\n\n $s3 = new S3Client([\n 'version' => $this->settings['s3_bucket']['bucket_version'],\n 'region' => $this->settings['s3_bucket']['bucket_region'],\n 'credentials' => [\n 'key' => $this->settings['s3_bucket']['access_key'],\n 'secret' => $this->settings['s3_bucket']['secret_key'],\n ]\n ]);\n\n $results = $s3->listObjectsV2([\n 'Bucket' => $this->settings['s3_bucket']['bucket_name'],\n 'Prefix' => $path . '/' . $keyname\n ]);\n\n if (isset($results['Contents'])) {\n foreach ($results['Contents'] as $result) {\n $s3->deleteObject([\n 'Bucket' => $this->settings['s3_bucket']['bucket_name'],\n 'Key' => $result['Key']\n ]);\n }\n }\n\n }",
"function endQuiz()\n{\n\t$_SESSION['completed_at'] = time();\n\t\n\theader(\"Location: result.php\");\n\tdie();\n}",
"public function resubmitOrdersToAmazon()\n {\n $stores = $this->storeManager->getStores();\n $enabledStores = [];\n\n foreach ($stores as $store) {\n if ($store->isActive() && $this->helper->isEnabled($store->getId())) {\n $enabledStores[] = $store->getId();\n }\n }\n\n if ($enabledStores) {\n $ordersToProcess = $this->orderCollectionFactory\n ->create()\n ->addFieldToSelect('*')\n ->addFieldToFilter(\n 'store_id',\n [\n 'in' => [$enabledStores],\n ]\n )\n ->addFieldToFilter(\n 'state',\n [\n 'in' => [\n \\Magento\\Sales\\Model\\Order::STATE_NEW,\n \\Magento\\Sales\\Model\\Order::STATE_PROCESSING,\n ],\n ]\n )\n ->addFieldToFilter('fulfilled_by_amazon', true)\n ->addFieldToFilter(\n 'amazon_order_status',\n [\n 'in' => [\n $this->helper::ORDER_STATUS_NEW,\n $this->helper::ORDER_STATUS_ATTEMPTED,\n ],\n ]\n )\n ->setPageSize(self::NUM_ORDERS_TO_RESUBMIT)\n ->setCurPage(1);\n\n if ($ordersToProcess->count()) {\n foreach ($ordersToProcess as $order) {\n $this->helper->logOrder('Retrying submission of order #' . $order->getIncrementId());\n $currentAttempt = $order->getAmazonSubmissionCount() + 1;\n /**\n * @var \\FBAOutboundServiceMWS_Model_CreateFulfillmentOrderResponse $result\n */\n $result = $this->outbound->createFulfillmentOrder($order);\n $responseMetadata = $result->getResponseMetadata();\n\n if (!empty($result) && !empty($responseMetadata)) {\n $order->setAmazonOrderStatus($this->helper::ORDER_STATUS_RECEIVED);\n } elseif ($currentAttempt >= self::NUM_ORDER_RESUMIT_RETRYS) {\n $order->setAmazonOrderStatus($this->helper::ORDER_STATUS_FAIL);\n $this->helper->logOrder(\n 'Giving up on order #' . $order->getIncrementId() . \"after $currentAttempt tries.\"\n );\n } else {\n $order->setAmazonSubmissionCount($currentAttempt);\n }\n\n $order->save();\n }\n }\n }\n }",
"public function finishJob()\r\n {\r\n $this->done = true;\r\n }",
"public function cancel_experience_booking_payment()\n\t{\t\n\t\tif ($this->checkLogin('A') == ''){\n\t\t\tredirect('admin');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\n\t\t\t$this->data['heading'] = 'Experience Cancellation Payments';\n\t\t\t\n\t\t\t$condition = array('cancelled','Yes');\n\t\t\t$CustomerDetails = $this->review_model->get_all_experienced_cancelled_users();\t\t\n\t\t\t\n\t\t\tforeach($CustomerDetails->result() as $customer)\n\t\t\t{\n\t\t\t\t$customer_id = $customer->id;\n\t\t\t\t$cancel[] = $this->review_model->get_all_experience_commission_tracking($customer_id);\n\t\t\t\t$this->data['paypalData'][$HostEmail] = $customer->paypal_email;\t\t\t\t\n\t\t\t}\n\n\t\t\t$this->data['trackingDetails'] = $cancel;\n\t\t\t$this->load->view('admin/dispute/display_experience_cancel_payment_lists',$this->data);\n\t\t}\n\t}",
"public function cancel();",
"private function leaveMeeting(\\App\\Meeting $meeting)\n {\n $user = Auth::user();\n //if user is attending meeting, delete meeting and attendances\n if($meeting->users->contains($user)){\n foreach($meeting->attendances as $attendance){\n $attendance->forceDelete();\n }\n $meeting->forceDelete();\n }\n }",
"public function test_delete() {\n global $DB;\n\n self::setAdminUser();\n $this->resetAfterTest(true);\n\n // Save new outage.\n $now = time();\n $outage = new outage([\n 'autostart' => false,\n 'warntime' => $now - 60,\n 'starttime' => 60,\n 'stoptime' => 120,\n 'title' => 'Title',\n 'description' => 'Description',\n ]);\n $outage->id = outagedb::save($outage);\n self::$outage = $outage;\n\n outagedb::delete(self::$outage->id);\n\n // Should not exist.\n $event = $DB->get_record_select(\n 'event',\n \"(eventtype = 'auth_outage' AND instance = :idoutage) OR (id = :idevent)\",\n ['idoutage' => self::$outage->id, 'idevent' => self::$event->id],\n 'id',\n IGNORE_MISSING\n );\n self::assertFalse($event);\n }",
"public function cleanup(){\n\t\t$accountBookings = Billing_Controller_AccountBooking::getInstance()->getByBookingId($this->getId());\n\t\t\n\t\tforeach($accountBookings as $accountBooking){\n\t\t\tBilling_Controller_AccountBooking::getInstance()->delete(array($accountBooking->getId()));\n\t\t}\n\t}",
"public function save() {\n $filename = self::getFilename($this->eventKey);\n \n \t$fh = fopen(\"$filename.tmp\", \"w\");\n \tfwrite($fh, \"<\" . \"?\\n\");\n \tfwrite($fh, \"\\$attendees['\" . $this->eventKey . \"'] = array(\\n\");\n \t\n \tforeach ($this->members as $memberKey => $attendee) {\n \t\tif (empty($memberKey)) {\n \t\t\tcontinue;\n \t\t}\n \t\t$comma = true;\n \t\tfwrite($fh, \" '$memberKey' => array(\\n\");\n \t\t\n \t\tforeach ($attendee as $k => $v) {\n \t\t if (!in_array($k, array('eventKey', 'memberKey'))) {\n fwrite($fh, \" '$k' => '$v',\\n\");\n }\n }\n fwrite($fh, \" ),\\n\");\n \t}\n \tfwrite($fh, \")\\n?\" . \">\\n\");\n \tfclose($fh);\n \trename(\"$filename.tmp\", $filename);\n }",
"public function cancelUpload() {\n $this->callMethod( 'cancelUpload' );\n }",
"public function cancelUpload() {\n $this->callMethod( 'cancelUpload' );\n }",
"public function cancelUpload() {\n $this->callMethod( 'cancelUpload' );\n }",
"public function destroy(WaitingPeople $bekleyen)\n {\n //\n }",
"public function stop() {}",
"public function deleteEmployeeNow() {\n\n $employeeModel = $GLOBALS[\"employeeModel\"];\n if (isset($_REQUEST['employeeID'])) {\n //collect value of input field.\n $employeeID = $_REQUEST['employeeID'];\n //Delete photo \n $included_employee = $employeeModel->getOneByEmployeeID($employeeID);\n if ($included_employee[\"Employee_Photo\"] == 1) {\n $file = \"../fellesFiler/bilder/employees/\" . $included_employee[\"Phone_Number\"] . \".jpg\";\n unlink($file);\n }\n $employeeModel->deleteEmployee($employeeID);\n }\n $this->showEmployees();\n }",
"public function __destruct()\n {\n foreach (glob(\"$this->save_path/sess_*\") as $filename) {\n if (filemtime($filename) + 3600 < time()) {\n @unlink($filename);\n }\n }\n }",
"protected function sweep()\n\t{\n\t\tforeach ($this->flashRecord as $key => $record) {\n\t\t\tif ($record['is'] == 'old') {\n\t\t\t\t/* remove old */\n\t\t\t\tunset($this->flashRecord[$key]);\n\t\t\t} elseif ($record['is'] == 'new' && !isset($record['until'])) {\n\t\t\t\t/* tag new as old unless it has until */\n\t\t\t\t$this->flashRecord[$key]['is'] = 'old';\n\t\t\t} elseif (isset($record['until']) && $record['until'] < time()) {\n\t\t\t\t/* remove until */\n\t\t\t\tunset($this->flashRecord[$key]);\n\t\t\t}\n\t\t}\n\n\t\t$this->save();\n\t}",
"public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}",
"public function testNewlyEndedBookingsAreNotDeleted(): void\n {\n Booking::factory()->create([\n 'start_time' => now()->subMonths(2),\n 'end_time' => now()->subMonths(1),\n ]);\n\n $this->artisan('model:prune');\n\n $this->assertCount(1, Booking::all());\n }",
"public function friendly_stop() {\n global $OUTPUT;\n\n $riskyediting = ($this->surveypro->riskyeditdeadline > time());\n $utilitylayoutman = new utility_layout($this->cm, $this->surveypro);\n $hassubmissions = $utilitylayoutman->has_submissions();\n\n if ($hassubmissions && (!$riskyediting)) {\n echo $OUTPUT->notification(get_string('applyusertemplatedenied01', 'mod_surveypro'), 'notifyproblem');\n $url = new \\moodle_url('/mod/surveypro/view_submissions.php', ['s' => $this->surveypro->id]);\n echo $OUTPUT->continue_button($url);\n echo $OUTPUT->footer();\n die();\n }\n\n if ($this->surveypro->template && (!$riskyediting)) { // This survey comes from a master template so it is multilang.\n echo $OUTPUT->notification(get_string('applyusertemplatedenied02', 'mod_surveypro'), 'notifyproblem');\n $url = new \\moodle_url('/mod/surveypro/view_userform.php', ['s' => $this->surveypro->id]);\n echo $OUTPUT->continue_button($url);\n echo $OUTPUT->footer();\n die();\n }\n }",
"public function undoFinalAdmit()\n {\n if (!is_null($this->acceptOffer) and !is_null($this->declineOffer)) {\n throw new \\Jazzee\\Exception('Cannot undo admit for an applicant with a offer response.');\n }\n $this->finalAdmit = null;\n $this->decisionViewed = null;\n $this->decisionLetter = null;\n }",
"public function unmarkAllExecutions() {}"
] | [
"0.5396022",
"0.5219538",
"0.5170568",
"0.51640004",
"0.51192296",
"0.50228024",
"0.50194967",
"0.5000335",
"0.49724886",
"0.4971473",
"0.49270517",
"0.49088454",
"0.48916653",
"0.4882957",
"0.48375836",
"0.48372152",
"0.4822057",
"0.48088437",
"0.478271",
"0.4780172",
"0.4777925",
"0.4769121",
"0.4757388",
"0.47506016",
"0.4734833",
"0.47160846",
"0.46981266",
"0.46801832",
"0.46797654",
"0.4679365",
"0.4679365",
"0.4679365",
"0.4679365",
"0.4679365",
"0.46792284",
"0.46667776",
"0.46592045",
"0.46399516",
"0.4639795",
"0.46245614",
"0.46182862",
"0.4614964",
"0.46088773",
"0.45820892",
"0.45748916",
"0.455479",
"0.45542067",
"0.4552988",
"0.45475602",
"0.45450264",
"0.4539886",
"0.4537742",
"0.45311648",
"0.4528814",
"0.45223397",
"0.45084113",
"0.44987458",
"0.4497042",
"0.4492025",
"0.4489718",
"0.44892254",
"0.44889283",
"0.44818604",
"0.4479905",
"0.4479905",
"0.4479905",
"0.44680452",
"0.44668734",
"0.44661814",
"0.44578794",
"0.44563204",
"0.44515616",
"0.44487357",
"0.44437665",
"0.44415632",
"0.4439924",
"0.44313285",
"0.4430447",
"0.44200185",
"0.44193554",
"0.44175646",
"0.44135937",
"0.44122574",
"0.4409984",
"0.44023347",
"0.44007596",
"0.439793",
"0.43943852",
"0.43943852",
"0.43943852",
"0.43903375",
"0.43885753",
"0.43818206",
"0.4381376",
"0.43772936",
"0.43707004",
"0.43676117",
"0.4367154",
"0.43658265",
"0.43656656"
] | 0.5959735 | 0 |
/ Description Function is fetch icd list from api Author Dave Brown Created 13 February 2015 | public function get_icd_list ()
{
$listicdcodes_arr = array();
if (get_data('term') == NULL)
{
return;
}
/*Fetching Patient details from third party database via curl request*/
$listicdcodes = post_curl_request(THIRD_PARTY_API_URL, json_encode(array(
'action' => 'listicdcodes',
'lookfor' => get_data('term'),
)));
$listicdcodes = !empty($listicdcodes) ? json_decode($listicdcodes) : array();
/*Converting to autocomplete understandable format*/
if (!empty($listicdcodes))
{
foreach ($listicdcodes as $val)
{
$listicdcodes_arr[] = array('id' => current($val)->ICDCode, 'value' => current($val)->ICDTitle);
}
}
exit(json_encode($listicdcodes_arr));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function apiList();",
"public function fetchList();",
"function get_districts($id)\n{\n $url = set_url('disctricts');\n $url .= '?city_id=' . $id;\n $token = $_SESSION['token'];\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer ' . $token,]);\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = curl_exec($cURLConnection);\n curl_close($cURLConnection);\n print_r($apiResponse);\n exit;\n}",
"public function get_all_items_by_api()\n {\n\n $data = array('token' =>'ayaolwan');//'type' => 'fees_category');\n $data_string = json_encode($data);\n $curl = curl_init(base_url() . 'webServices/Itemapi');\n\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"GET\");\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($data_string))\n );\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data_string);\n\n $result = json_decode(curl_exec($curl), true);\n curl_close($curl);\n\n if ($result['status'])\n {\n echo json_encode($result['itemsList']);\n }\n\n\n }",
"function get_categories($id)\n{\n $url = set_url('categories');\n $url .= '/' . $id;\n $token = $_SESSION['token'];\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer ' . $token,]);\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = curl_exec($cURLConnection);\n curl_close($cURLConnection);\n print_r($apiResponse);\n exit;\n}",
"function getAllModelByID($id, $limit){\n $data = http_build_query([\n 'mark_id' => $id,\n 'limit' => $limit,\n ]);//build query\n $ch = curl_init();//init Curl\n curl_setopt_array($ch, [\n CURLOPT_URL => 'https://apistaging.el-market.org/v1/osago/lists/models/?' . $data,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => [\n 'Accept: application/json',\n 'Authorization: Token Test2019',\n ],\n ]);\n $res=json_decode(curl_exec($ch),true);\n curl_close($ch);\n if (curl_errno($ch)) { echo 'Error:' . curl_error($ch);}\n return $res['results'];\n}",
"public function fetchCategory(){\n \t$ch = curl_init();\n //getting specific orders after $time\n $encode = $this->urlPath.\"/rest/V1/categories\";\n\t\t\n curl_setopt($ch, CURLOPT_URL, $encode);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n $headers = array();\n $headers[] = 'Authorization: Bearer '.$this->apiKey;\n $headers[] = 'Content-Type: application/json';\n //$headers[] = 'Accept: application/json';\n\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n $result = curl_exec($ch);\n\n curl_close ($ch);\n\n\n\n\n return $result;\n\t\t\t \n }",
"function list(){\n $res = $res = $this->client->request('GET',$this->path,[]);\n $this->checkResponse($res,array(200));\n return $res;\n }",
"function getAllMarks($limit){\n $data = http_build_query([\n 'limit' => $limit,\n ]);//build query\n $ch = curl_init();//init Curl\n curl_setopt_array($ch, [\n CURLOPT_URL => 'https://apistaging.el-market.org/v1/osago/lists/marks/?' . $data,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => [\n 'Accept: application/json',\n 'Authorization: Token Test2019'\n ]\n ]);\n $res=json_decode(curl_exec($ch),true);\n curl_close($ch);\n if (curl_errno($ch)) { echo 'Error:' . curl_error($ch);}\n return $res['results'];\n}",
"public function getAllClinicInfo(){\n $stmt = $this->adapter->conn->prepare(\"SELECT * FROM CLINIC\"); \n $result = null;\n try{\n $result = $this->adapter->executeFetchPrepared($stmt);\n }catch(PDOException $e){\n return null;\n }\n \n return $result;\n }",
"function admin_list_clinics($id=NULL)\r\n {\r\n $data['offline_mode']\t\t=\t$this->config->item('offline_mode');\r\n $data['debug_mode']\t\t =\t$this->config->item('debug_mode');\r\n $data['country']\t\t =\t$this->config->item('app_country');\r\n\t\t$data['user_rights'] = $this->mthirra->get_user_rights($_SESSION['username']);\r\n $data['breadcrumbs'] = breadcrumbs('ehr_admin/admin_mgt','Admin'); \r\n $data['sort_order'] \t = $this->uri->segment(3);\r\n\t\t$data['title'] = \"T H I R R A - List of Clinics\";\r\n $data['now_id'] = time();\r\n $data['now_date'] = date(\"Y-m-d\",$data['now_id']);\r\n $data['now_time'] = date(\"H:i\",$data['now_id']);\r\n\t\t$data['clinics_list'] = $this->mthirra->get_clinics_list($data['country'],$data['sort_order']);\r\n\t\t$this->load->vars($data);\r\n\t\tif ($_SESSION['thirra_mode'] == \"ehr_mobile\"){\r\n $new_header = \"ehr/header_xhtml-mobile10\";\r\n $new_banner = \"ehr/banner_ehr_wap\";\r\n $new_sidebar= \"ehr/sidebar_ehr_admin_wap\";\r\n //$new_body = \"ehr/ehr_admin_list_clinics_wap\";\r\n $new_body = \"ehr/ehr_admin_list_clinics_html\";\r\n $new_footer = \"ehr/footer_emr_wap\";\r\n\t\t} else {\r\n //$new_header = \"ehr/header_xhtml1-strict\";\r\n $new_header = \"ehr/header_xhtml1-transitional\";\r\n $new_banner = \"ehr/banner_ehr_html\";\r\n $new_sidebar= \"ehr/sidebar_emr_admin_html\";\r\n $new_body = \"ehr/ehr_admin_list_clinics_html\";\r\n $new_footer = \"ehr/footer_emr_html\";\r\n\t\t}\r\n if($data['user_rights']['section_admin'] < 100){\r\n $new_body = \"ehr/ehr_access_denied_html\";\r\n }\r\n\t\t$this->load->view($new_header);\t\t\t\r\n\t\t$this->load->view($new_banner);\t\t\t\r\n\t\t$this->load->view($new_sidebar);\t\t\t\r\n\t\t$this->load->view($new_body);\t\t\t\r\n\t\t$this->load->view($new_footer);\t\t\r\n\t\t\r\n }",
"function display_cars()\n{\n //displays posted cars\n $url = set_url('advert');\n $url .= '?limit=10&page=1';\n $token = $_SESSION['token'];\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer ' . $token,]);\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = json_decode(curl_exec($cURLConnection));\n curl_close($cURLConnection);\n print_r($apiResponse);\n exit;\n}",
"public function listsIndicationsget()\r\n {\r\n $response = Indication::all();\r\n return response()->json($response,200);\r\n }",
"private function _get_info() {\n\n\t\t/* Grab the basic information from the catalog and return it */\n\t\t$sql = \"SELECT * FROM `access_list` WHERE `id`='\" . Dba::escape($this->id) . \"'\";\n\t\t$db_results = Dba::query($sql);\n\n\t\t$results = Dba::fetch_assoc($db_results);\n\n\t\treturn $results;\n\n\t}",
"function list_get($id) {\n\n //$id = $this->get('id');\n\n if (!$id) {\n\n $this->response(\"No item ID specified!\", 400);\n\n exit;\n }\n\n $list = $this->List_model->getListById($id);\n\n if ($list) {\n\n //$list = $this->appendItems($list);\n //Put owner's name instead of user ID\n //$list['owner'] = $this->User_model->getName($list['owner'])['name'];\n unset($list['owner']);\n\n $this->response($list, 200);\n\n exit;\n } else {\n\n $this->response(\"Invalid ID\", 404);\n\n exit;\n }\n }",
"public function public_ids_get()\n {\n $from = \"0\";\n $size = \"10\";\n $lastModified = NULL;\n \n $temp = $this->input->get('from', TRUE);\n if(!is_null($temp) & is_numeric($temp))\n $from = $temp;\n \n $temp = $this->input->get('size', TRUE);\n if(!is_null($temp) & is_numeric($temp))\n $size = $temp;\n \n $temp = $this->input->get('lastModified', TRUE);\n if(!is_null($temp) & is_numeric($temp))\n $lastModified = intval($temp);\n \n $cutil = new CILServiceUtil();\n $result = $cutil->getAllPublicIds($from, $size,$lastModified);\n $this->response($result);\n \n }",
"function item_list_data($invoice_id = 0) {\n\n $list_data = $this->Sales_InvoicesItems_model->get_details(array(\"fid_invoices\" => $invoice_id))->result();\n $result = array();\n foreach ($list_data as $data) {\n $result[] = $this->_make_item_row($data);\n }\n echo json_encode(array(\"data\" => $result));\n // $this->output->enable_profiler(TRUE);\n // print_r($list_data);\n\n }",
"function get_cities()\n{\n $url = set_url('cities');\n $token = $_SESSION['token'];\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer ' . $token,]);\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = curl_exec($cURLConnection);\n curl_close($cURLConnection);\n print_r($apiResponse);\n exit;\n}",
"public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }",
"public function Company_Info_List(){\n /*\n $user = session('USER_ID'); // 获取已登录用户\n */\n // $user = 'c4b19072a79e4a6e81f06761f1e6bd2b';\n // $where = array('USER_ID' => $user);\n // if(!empty($keywords)){\n // $where['COMPANY_NAME'] = array('like',\"%$keywords%\");\n // }\n // if (!empty($start_date)) {\n // $where['CREATE_TIME'] = array('gt',$start_date);\n // }\n // if (!empty($end_date)) {\n // $where['CREATE_TIME'] = array('lt',$end_date);\n // }\n // $count = M('a_sys_user_attr_company_info')\n // -> where($where)\n // -> count();\n\n // $Page = new \\Think\\Page($count, $pagenum);// 实例化分页类 传入总记录数和每页显示的记录数($pagenum)\n\n // $show = $Page->show();// 分页显示输出\n\n // $list = M('a_sys_user_attr_company_info as info') // 查询公司信息表\n \t\t// -> field('COMPANYINFO_ID,COMPANY_NAME,CERT,COMPANY_AUTHENTICATION,SERVICE_LEVEL,COMPANY_NUM') // 需求字段\n \t\t// -> join('a_service_level as level on info.SERVICE_ID = level.SERVICE_ID') // 两表联查\n // ->limit($Page->firstRow.','.$Page->listRows) // 分页查询\n \t\t// -> where($where) \t\t// 查询条件\n \t\t// -> select();\n\n // // var_dump($list);die;\n \n // $this -> assign('show' , $show);\n // $this -> assign('list' , $list);\n $this -> display('list');\n }",
"public function listing();",
"abstract public function getList();",
"function cariICD()\n\t{\n\t\tif ($this->input->get() != NULL) {\n\t\t\t$dataForm = $this->input->get();\n\t\t\t$dataReturn = $this->Kesehatan_M->orLike('icd10',array('Diagnosa'=>$dataForm['term']['term'],'Diskripsi'=>$dataForm['term']['term']))->result();\n\t\t\t$data = array();\n\t\t\tforeach ($dataReturn as $key => $value) {\n\t\t\t\t$data[$key]['id'] = $value->Kode_ICD. \" / \".$value->Diskripsi;\n\t\t\t\t$data[$key]['text'] = $value->Kode_ICD.\" / \".$value->Diskripsi;\n\t\t\t}\n\t\t\techo json_encode($data);\n\t\t}else{\n\t\t\tredirect(base_url());\n\t\t}\n\t}",
"public function getList();",
"public function getList();",
"function FetchIT()\n {\n $sql=\"SELECT * FROM INVT_T_INSP_HEAD\";\n return $this->db->query($sql, $return_object = TRUE)->result_array(); \n }",
"public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }",
"protected abstract function fetchLists();",
"function getList($issue_id)\n {\n $issue_id = Misc::escapeInteger($issue_id);\n $usr_id = Auth::getUserID();\n $prj_id = Issue::getProjectID($issue_id);\n\n $stmt = \"SELECT\n iat_id,\n iat_usr_id,\n usr_full_name,\n iat_created_date,\n iat_description,\n iat_unknown_user,\n iat_status\n FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"issue_attachment,\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"user\n WHERE\n iat_iss_id=$issue_id AND\n iat_usr_id=usr_id\";\n if (User::getRoleByUser($usr_id, $prj_id) <= User::getRoleID('Customer')) {\n $stmt .= \" AND iat_status='public' \";\n }\n $stmt .= \"\n ORDER BY\n iat_created_date ASC\";\n $res = DB_Helper::getInstance()->getAll($stmt, DB_FETCHMODE_ASSOC);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return \"\";\n }\n\n foreach ($res as &$row) {\n $row[\"iat_description\"] = Link_Filter::processText(Issue::getProjectID($issue_id), nl2br(htmlspecialchars($row[\"iat_description\"])));\n $row[\"files\"] = self::getFileList($row[\"iat_id\"]);\n $row[\"iat_created_date\"] = Date_Helper::getFormattedDate($row[\"iat_created_date\"]);\n\n // if there is an unknown user, user that instead of the user_full_name\n if (!empty($row[\"iat_unknown_user\"])) {\n $row[\"usr_full_name\"] = $row[\"iat_unknown_user\"];\n }\n }\n return $res;\n }",
"public function list_get()\n\t{\n\t\ttry{\n\n\t\t\t$this->checkCanCandidateId();\n\t\t\t$filters = array(\n\t\t\t\t\"{$this->_candidateIdFkKey}\" =>$this->getCanCandidateId()\n\t\t\t);\n\t\t\t$list = $this->_model->getBy($filters);\n\t\t\t$this->response($list);\n\t\t}catch( Exception $e ){\n\t\t\t$message = $e->getMessage();\n\t\t\t$code = $e->getCode();\n\t\t\t$this->error_response($message,$code);\n\t\t}\n\n\t}",
"public function list_get(){\n $data['list'] = $this->group->list();\n $this->response($data);\n }",
"public function getIdList() {\n migrate_instrument_start(\"Retrieve $this->listUrl\");\n if (empty($this->httpOptions)) {\n $json = file_get_contents($this->listUrl);\n }\n else {\n $response = drupal_http_request($this->listUrl, $this->httpOptions);\n $json = $response->data;\n }\n migrate_instrument_stop(\"Retrieve $this->listUrl\");\n if ($json) {\n $data = drupal_json_decode($json);\n if ($data) {\n return $this->getIDsFromJSON($data);\n }\n }\n Migration::displayMessage(t('Loading of !listurl failed:',\n array('!listurl' => $this->listUrl)));\n return NULL;\n }",
"private function requestAnimeList () {\n\t\t$curl = curl_init ();\n\t\t\n\t\tcurl_setopt ($curl, CURLOPT_URL, $this->api_url);\n\t\tcurl_setopt ($curl, CURLOPT_RETURNTRANSFER, true);\n\t\t\n\t\t$response = curl_exec ($curl);\n\t\t\n\t\tcurl_close($curl);\n\t\t\n\t\treturn ($response);\n\t}",
"public function HCInstituteListData()\n {\n\t\t$sql=\"SELECT \n\t\t\t\tHID.INSTITUTE_NAME INSTITUTE_NAME,\n\t\t\t\tHID.RANKING RANKING,\n\t\t\t\tHIAD.ADDRESS_LINE1 ADDRESS_LINE1,\n\t\t\t\tHIAD.ADDRESS_LINE2 ADDRESS_LINE2,\n\t\t\t\tHIAD.PIN_CODE PIN_CODE,\n\t\t\t\tHCM.CITY_NAME CITY_NAME\n\t\t\t\tFROM \n\t\t\t\tTEST.INSTITUTE_DTL HID\n\t\t\t\tLEFT JOIN TEST.INSTITUTE_ADDRESS_DTL HIAD\n\t\t\t\tON HIAD.INSTITUTE_DTL__ID = HID.ID\n\t\t\t\tLEFT JOIN TEST.CITY_MST HCM\n\t\t\t\tON HCM.ID=HIAD.CITY_MST__ID\n\t\t\t\";\n\t\t$this->vResult = mysqli_query($this->vDbConn,$sql);\n\n\t\twhile($this->vRow = mysqli_fetch_assoc($this->vResult)){\n\t\t\t$this->vCHCInstituteListStructObj->vInstituteList[]\t=\t$this->vRow;\t\t\n\t\t}\n\t\t\n\t\t\n\n return ;\n }",
"public function get_all ();",
"public function loadList() {\n\t\t/*Query database for names and id*/\n\t\t$CI =& get_instance(); \n\t\t$query = $CI->db->query(\"SELECT Firstname, Lastname, employeeID, Username, Password, Instructor, Lifeguard, Headguard, Supervisor FROM `Employees` \");\n\t\t$list = $query->result_array();\t\t//TODO: Add Extra Sequerity here..\t\t\t\t\n\t\techo json_encode($list );\t\t\n\t}",
"function getAllCustomers() {\n\t// Get cURL resource\n\t$curl = curl_init();\n\t// Set some options - we are passing in a useragent too here\n\tcurl_setopt_array($curl, array(\n\t CURLOPT_RETURNTRANSFER => 1,\n\t CURLOPT_URL => 'https://hackathon-be.mybluemix.net/customers',\n\t CURLOPT_USERAGENT => 'BankBase BOC Hackathon Request'\n\t));\n\t// Send the request & save response to $resp\n\t$resp = curl_exec($curl);\n\t// Close request to clear up some resources\n\tcurl_close($curl);\n\n\t$resp_decode = json_decode($resp);\n\techo \"<pre>\";\n\tprint_r($resp_decode);\n\techo \"</pre>\";\n}",
"public function Enumerate()\r\n {\r\n $query = \"select a.*, b.name as subsector, c.name as sector from actividad_comercial a \r\n inner join subsector b on a.subsector_id = b.id \r\n inner join sector c on b.sector_id = c.id order by a.name asc, b.name asc, c.name asc $sql_add\";\r\n $this->Util()->DB()->setQuery($query);\r\n $result = $this->Util()->DB()->GetResult();\r\n $data[\"items\"] = $result;\r\n // $data[\"pages\"] = $pages;\r\n return $data;\r\n }",
"public function index()\n {\n //\n $estadociviles = DB::table('estado_civil')->select('id_estado_civil', 'estado_civil_descripcion')->orderBy('id_estado_civil')->get(); \n return response()->json($estadociviles);\n }",
"public static function fetch_all_in_a_list()\n\t{\n\t return Company::orderBy( 'name' )->lists( 'name' , 'id' );\n\n\t}",
"public function alldiseaseinfo()\r\r\n {\r\r\n return response()->json(\r\r\n Disease::wheredmuse(0)->select('id','diseasename')->get()\r\r\n );\r\r\n }",
"public function cardList()\n {\n // $pageIndex = 0;\n // $pageSize = 20;\n $pageIndex = I('get.pageIndex');\n $pageSize = I('get.pageSize');\n $where = I('get.where');\n $orderBy = I('get.orderBy');\n\n $where = htmlspecialchars_decode($where);\n\n $data = array(\n \"userAccount\" => self::USERACCOUNT,\n \"pageIndex\" => $pageIndex,\n \"pageSize\" => $pageSize,\n \"where\" => $where,\n \"orderBy\" => $orderBy,\n );\n $response_data = $this->client->CallHttpPost(\"Get_MembersPagedV2\", $data);\n $this->ajaxReturn($response_data);\n }",
"public function obat_get()\n\t{\n\t\t$data = $this->Obat->getAllObat();\n\t\tif ($data) {\n\t\t\t$this->response($data,200);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response([\n\t\t\t\t'error'=>false,\n\t\t\t\t'message'=>'Obat kosong'\n\t\t\t],200);\n\t\t}\n\t}",
"public function loadFilesILC()\r\n {\r\n $id = Input::get('ID');\r\n $iid =Input::get('IID');\r\n $project = Project::find($id);\r\n $files=[];\r\n if($project!=null)\r\n {\r\n $internalFiles = $project->filesByType(array('ilc','ilcVendors'));\r\n foreach($internalFiles as $file)\r\n {\r\n $created = date('m-d-Y',strtotime(str_replace('-','/',$file->created_at)));\r\n $files[]=['id'=>$file->id,'name'=>$file->fileName,'url'=>$file->url,'created'=>$created,'ilcVendors'=>$file->ilcVendors];\r\n }\r\n }\r\n $ilcV =IlcVendors::where('ilc_id',$iid)->first();\r\n if($ilcV == null)\r\n $existIlcV =0;\r\n else\r\n $existIlcV =1;\r\n return json_encode(array($files,$existIlcV));\r\n }",
"function ciniki_artcatalog_categoryList($ciniki) {\n // \n // Find all the required and optional arguments\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n \n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'artcatalog', 'private', 'checkAccess');\n $rc = ciniki_artcatalog_checkAccess($ciniki, $args['tnid'], 'ciniki.artcatalog.categoryList'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // Load the status maps for the text description of each status\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'artcatalog', 'private', 'maps');\n $rc = ciniki_artcatalog_maps($ciniki);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $maps = $rc['maps'];\n\n //\n // Get the settings for the artcatalog\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbDetailsQueryDash'); \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryTree');\n $rc = ciniki_core_dbDetailsQueryDash($ciniki, 'ciniki_web_settings', \n 'tnid', $args['tnid'], 'ciniki.web', 'settings', 'page-gallery-artcatalog');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['settings']) ) {\n $settings = $rc['settings'];\n } else {\n $settings = array();\n }\n\n if( isset($settings['page-gallery-artcatalog-split']) \n && $settings['page-gallery-artcatalog-split'] == 'yes' \n ) {\n $strsql = \"SELECT DISTINCT type, type AS name, category \"\n . \"FROM ciniki_artcatalog \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"ORDER BY type, category COLLATE latin1_general_cs, category \"\n . \"\";\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.artcatalog', array(\n array('container'=>'types', 'fname'=>'type', 'name'=>'type',\n 'fields'=>array('number'=>'type', 'name'),\n 'maps'=>array('name'=>$maps['item']['type'])),\n// 'maps'=>array('name'=>array('1'=>'Paintings', '2'=>'Photographs', '3'=>'Jewelry', '4'=>'Sculptures', '5'=>'Fibre Arts', '6'=>'Crafts', '8'=>'Pottery'))),\n array('container'=>'categories', 'fname'=>'category', 'name'=>'category',\n 'fields'=>array('type', 'name'=>'category')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['types']) ) {\n return array('stat'=>'ok', 'types'=>array());\n }\n return array('stat'=>'ok', 'types'=>$rc['types']);\n } else {\n $strsql = \"SELECT DISTINCT '0' AS type, category \"\n . \"FROM ciniki_artcatalog \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"ORDER BY category COLLATE latin1_general_cs, category \"\n . \"\";\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.artcatalog', array(\n array('container'=>'categories', 'fname'=>'category', 'name'=>'category',\n 'fields'=>array('type', 'name'=>'category')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['categories']) ) {\n return array('stat'=>'ok', 'categories'=>array());\n }\n return array('stat'=>'ok', 'categories'=>$rc['categories']);\n }\n}",
"function list_enrollments ( $CourseID ){\n\tglobal $access_token, $canvas_base_url;\n\t\n\t//get it ready for later\n\t$enrolled=array();\n\t\n\t$url=$canvas_base_url.\"/api/v1/courses/\".$CourseID.\"/enrollments?per_page=100&access_token=\".$access_token;\n\t\n\t// Get cURL resource\n\t$curl = curl_init();\n\t// Set some options - we are passing in a useragent too here\n\tcurl_setopt_array($curl, array(\n\t CURLOPT_RETURNTRANSFER => 1,\n\t CURLOPT_CUSTOMREQUEST => 'GET',\n\t CURLOPT_URL => $url,\n\t CURLOPT_USERAGENT => 'Matt Loves cURLing Things'\n\t));\n\t// Send the request & save response to $resp\n\t$resp = json_decode(curl_exec($curl));\n\t\n\t//print_r($resp);\n\t\n\t// Close request to clear up some resources\n\tcurl_close($curl);\n\n\t$counter=0;\n\tforeach ($resp as $enrollment) {\n\t\tif ($enrollment->type==\"StudentEnrollment\" && $enrollment->user->name != \"Test Student\") {\n\t\t\t$enrolled[$enrollment->user->sis_user_id]=array('name'=>$enrollment->user->name,'id'=>$enrollment->user->sis_user_id,'participations'=>0);\n\t\t}\n\t\t$counter++;\n\t}\t\n\treturn $enrolled;\n}",
"public function listdataCSAction() {\n $this->view->dataList = $this->adm_listdata_serv->getDataList('CURRENT SYSTEM');\n }",
"public function getList()\n {\n }",
"function cpatient_detail_list() {\n\t\tglobal $conn;\n\n\t\t// Initialize table object\n\t\t$GLOBALS[\"patient_detail\"] = new cpatient_detail();\n\n\t\t// Intialize page id (for backward compatibility)\n\t\tif (!defined(\"EW_PAGE_ID\"))\n\t\t\tdefine(\"EW_PAGE_ID\", 'list', TRUE);\n\n\t\t// Initialize table name (for backward compatibility)\n\t\tif (!defined(\"EW_TABLE_NAME\"))\n\t\t\tdefine(\"EW_TABLE_NAME\", 'patient_detail', TRUE);\n\n\t\t// Open connection to the database\n\t\t$conn = ew_Connect();\n\n\t\t// Initialize list options\n\t\t$this->ListOptions = new cListOptions();\n\t}",
"public function GetClinics(){\n\t\t $input_data \t\t= \t$this->GetDecryptedData(Input::get()['request']);\n\t\t $rules = array(\n\t\t\t 'user_id' \t=> 'required',\n\t\t\t //'device_id' => 'required',\n\t\t\t 'platform_type'=> 'required',\n\t\t\t 'latitude' \t=> 'required',\n\t\t\t 'longitude' \t=> 'required',\n\t\t\t 'type' \t\t=> 'required',\n\t\t\t 'type_value' => 'required',\n\t\t );\n\t\t $validator = Validator::make($input_data,$rules);\n\t\t if ($validator->fails()){\n\t\t\t $messages = $validator->messages();\n\t\t\t return $this->encrypt(json_encode(array('status' => 'error', 'message' => $validator->errors()->all())));\n\t\t }else{\n\t\t\t \n\t\t\t$config_date \t\t= Config::get('date_format.date');\n\t\t\t$config_month \t\t= Config::get('date_format.month');\n\t\t\t$config_year \t\t= Config::get('date_format.year');\n\t\t\t$config_separator \t= Config::get('date_format.separator');\n\t\t\t\t\t\t\n\t\t\t \n\t\t\t/* $input_data['user_id'] = '38';\n\t\t\t $input_data['type'] = 'day';\n\t\t\t $input_data['type_value'] = '20-09-2017'; */\n\t\t\t\t$user_id \t\t= \t$input_data['user_id'];\n\t\t\t\t$user\t\t\t=\tUser_model::GetUserById($user_id);\n\t\t\t\tif(!empty($user)){\n\t\t\t\t/* $user_device_id = $input_data['device_id'];\n\t\t\t\t\tif(isset($user_device_id) && $user_device_id != null){\n\t\t\t\t\t\t$update_device_id\t\t= $this->UpdateDeviceId($user_device_id,$user_id);\n\t\t\t\t\t} */\n\t\t\t\t$all_clinics \t= \tarray();\n\t\t\t\tif(isset($input_data['type']) && $input_data['type'] == 'upcoming' && $input_data['type_value'] == 'upcoming'){\n\t\t\t\t\t$distance \t= $this->GetAdminSettingsValue('max_distance');\n\t\t\t\t\t$sqlQuery = \"SELECT *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t( 6371 * acos( cos( radians(\".$user['latitude'].\") ) * cos( radians( `latitude` ) ) * cos( radians( `longitude` ) - radians(\".$user['longitude'].\") ) + sin( radians(\".$user['latitude'].\") ) * sin( radians( `latitude` ) ) ) ) AS distance\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM clinics WHERE `date` >= curdate() AND\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\tFIND_IN_SET(\".$input_data['user_id'].\", `provider_id`) OR ( 6371 * acos( cos( radians(\".$user['latitude'].\") ) * cos( radians( `latitude` ) ) * cos( radians( `longitude` ) - radians(\".$user['longitude'].\") ) + sin( radians(\".$user['latitude'].\") ) * sin( radians( `latitude` ) ) ) ) <= $distance )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY distance ASC\";\n\t\t\t\t\t$clinics_s = DB::select(DB::raw($sqlQuery));\n\t\t\t\t\t$clinics = (array) $clinics_s;\n\t\t\t\t\tif(!empty($clinics)){\n\t\t\t\t\t\tforeach($clinics as $clinic){\n\t\t\t\t\t\t\t$clinic = (array)$clinic;\n\t\t\t\t\t\t\t$clinic_time_gmt \t\t= $clinic['date'].' '.$clinic['time'];\n\t\t\t\t\t\t\t$current_time_gmt \t\t= date('Y-m-d H:i:s');\n\t\t\t\t\t\t\t$clinic_created_gmt \t= $clinic['created_at'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$time = new DateTime($clinic['date'].' '.$clinic['time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t$user_time_zone \t = User_model::select('timezone')->where('id',$input_data['user_id'])->get();\n\t\t\t\t\t\t\t$user_time_zone_value = $user_time_zone[0]['timezone'];\n\t\t\t\t\t\t\t$time->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t$clinic_date_time \t = $time->format('Y-m-d H:i');\n\t\t\t\t\t\t\t$clinic_time\t\t\t\t\t=\t$clinic_date_time;\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$current = new DateTime(date('Y-m-d h:i:s'));\n\t\t\t\t\t\t\t$current->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t$current_timestamp \t\t\t\t= strtotime($current->format('Y-m-d H:i'));\n\t\t\t\t\t\t\t$current_time = \t$current->format('Y-m-d H:i:s');\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$clinic_creation = new DateTime($clinic['created_at'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t$clinic_creation->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t$clinic_created = \t$clinic_creation->format('Y-m-d H:i:s');\n\n\t\t\t\t\t\t\t$preferred_wait_hour \t= \t$this->GetAdminSettingsValue('default_time_stay_in_feeds');\n\t\t\t\t\t\t\tif($clinic['default_unfilled_time'] != null){\n\t\t\t\t\t\t\t\t$wait_time\t\t\t\t\t=\t'+'.$clinic['default_unfilled_time'].' hour';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t$wait_time\t\t\t\t\t=\t'+'.$preferred_wait_hour.'hour';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$clinic_creation_time_with_wait_time\t=\tdate('Y-m-d H:i:s',strtotime($wait_time,strtotime($clinic_created_gmt)));\n\t\t\t\t\t\t\tif(strtotime($current_time_gmt) < strtotime($clinic_time_gmt)){\n\t\t\t\t\t\t\t// checking clinic already accepted by someone or not.\n\t\t\t\t\t\t\t\t$count \t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t->where('status',1)->count();\n\t\t\t\t\t\t\tif($count<$clinic['personnel']){\n\t\t\t\t\t\t\t\t//checking clinic accepted or rejected by this user.\n\t\t\t\t\t\t\t\t$check_decline_status \t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('provider_id',$input_data['user_id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('status',0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->count();\n\t\t\t\t\t\t\t\t$check_accept_status \t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('provider_id',$input_data['user_id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('status',1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->count();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($check_decline_status==0 && $check_accept_status == 0){\n\t\t\t\t\t\t\t\t\t$clinic['clinic_name']\t=\t$clinic['name'];\n\t\t\t\t\t\t\t\t\t// clinic time according to user time zone starts //\n\t\t\t\t\t\t\t\t\t$Preptime \t\t= new DateTime($clinic['prep_time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t\t\t$Preptime->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t\t\t$prep_time \t\t= $Preptime->format('H:i');\n\n\t\t\t\t\t\t\t\t\t$EndTime = new DateTime($clinic['end_time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t\t\t$EndTime->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t\t\t$clinic_end_time \t\t= $EndTime->format('H:i');\n\n\t\t\t\t\t\t\t\t\t$clinic['date']\t\t\t\t\t=\tdate('d-m-Y', strtotime($clinic_date_time));\n\t\t\t\t\t\t\t\t\t\tif($user['time_format'] == 24){\n\t\t\t\t\t\t\t\t\t\t\t$format = 'H:i';\n\t\t\t\t\t\t\t\t\t\t}elseif($user['time_format'] == 12){\n\t\t\t\t\t\t\t\t\t\t\t$format = 'h:i a';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$clinic['time']\t\t\t\t\t=\tdate($format, strtotime($clinic_date_time));\n\t\t\t\t\t\t\t\t\t\t$clinic['prep_time']\t\t=\tdate($format, strtotime($prep_time));\n\t\t\t\t\t\t\t\t\t\t$clinic['end_time']\t\t\t=\tdate($format, strtotime($clinic_end_time));\n\t\t\t\t\t\t\t\t\t// clinic time according to user time zone ends //\n\t\t\t\t\t\t\t\t\t$clinic['estimated_duration']\t=\tnumber_format((($clinic['estimated_duration'])/60),2).' hour';\n\t\t\t\t\t\t\t\t\tif($current_time_gmt>$clinic_creation_time_with_wait_time){\n\t\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t\t= 'Unfilled';\n\t\t\t\t\t\t\t\t\t\t$clinic['status_name'] \t\t\t= 'Unfilled clinic';\n\t\t\t\t\t\t\t\t\t}elseif($current_time_gmt < $clinic_time_gmt){\n\t\t\t\t\t\t\t\t\t\tif(in_array($input_data['user_id'],explode(',',$clinic['provider_id']))){\n\t\t\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t= \t'preferd';\n\t\t\t\t\t\t\t\t\t\t\t$clinic['status_name']\t\t= \t'Preferred available Clinics';\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t= \t'available_clinics';\n\t\t\t\t\t\t\t\t\t\t\t$clinic['status_name']\t\t= \t'Available clinics';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$clinic['date'] \t= date($config_month.$config_separator.$config_date.$config_separator.$config_year, strtotime($clinic['date']));\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif(strtotime($clinic_time_gmt)> strtotime($current_time_gmt)){\n\t\t\t\t\t\t\t\t\t\t// if($clinic['primary_provider'] == $input_data['user_id'] || $clinic['medtech_provider'] == $input_data['user_id'] || $clinic['other_provider'] == $input_data['user_id']){\n\t\t\t\t\t\t\t\t\t\t\t$all_clinics[$clinic['date']][] = $clinic;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t// if(strtotime($current_time)>strtotime($clinic_creation_time_with_wait_time)){\n\t\t\t\t\t\t\t\t\t\t// \t$all_clinics[$clinic['date']][] = $clinic;\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}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t }else if(isset($input_data['type']) && $input_data['type'] == 'month'){\n\t\t\t\t\t\t$month_number \t= \tdate('m', strtotime($input_data['type_value']));\n\t\t\t\t\t\t$month_name \t\t= \tdate('F', strtotime($input_data['type_value']));\n\t\t\t\t\t\t$year \t\t\t\t\t= \tdate('Y', strtotime($input_data['type_value']));\n\n\t\t\t\t\t\t$distance \t= $this->GetAdminSettingsValue('max_distance');\n\t\t\t\t\t\t$sqlQuery = \"SELECT *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t( 6371 * acos( cos( radians(\".$user['latitude'].\") ) * cos( radians( `latitude` ) ) * cos( radians( `longitude` ) - radians(\".$user['longitude'].\") ) + sin( radians(\".$user['latitude'].\") ) * sin( radians( `latitude` ) ) ) ) AS distance\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM clinics WHERE Year(`date`)=\".$year.\" AND Month(`date`)=\".$month_number.\" AND `date` >= curdate() AND\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\tFIND_IN_SET(\".$input_data['user_id'].\", `provider_id`) OR ( 6371 * acos( cos( radians(\".$user['latitude'].\") ) * cos( radians( `latitude` ) ) * cos( radians( `longitude` ) - radians(\".$user['longitude'].\") ) + sin( radians(\".$user['latitude'].\") ) * sin( radians( `latitude` ) ) ) ) <= $distance )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY distance ASC\";\n\t\t\t\t\t\t$clinics_s = DB::select(DB::raw($sqlQuery));\n\t\t\t\t\t\t$clinics = (array) $clinics_s;\n\t\t\t\tif(!empty($clinics)){\n\t\t\t\t\tforeach($clinics as $clinic){\n\t\t\t\t\t\t\t$clinic = (array)$clinic;\n\t\t\t\t\t\t\t$clinic_time_gmt \t\t= $clinic['date'].' '.$clinic['time'];\n\t\t\t\t\t\t\t$current_time_gmt \t\t= date('Y-m-d H:i:s');\n\t\t\t\t\t\t\t$clinic_created_gmt \t= $clinic['created_at'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$time = new DateTime($clinic['date'].' '.$clinic['time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t$user_time_zone \t\t\t= User_model::select('timezone')->where('id',$input_data['user_id'])->get();\n\t\t\t\t\t\t\t$user_time_zone_value = $user_time_zone[0]['timezone'];\n\t\t\t\t\t\t\t$time->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t$clinic_date_time \t\t= $time->format('Y-m-d H:i:s');\n\t\t\t\t\t\t\t$clinic_time\t\t\t\t\t=\t$clinic_date_time;\n\n\t\t\t\t\t\t\t$current = new DateTime(date('Y-m-d h:i:s'));\n\t\t\t\t\t\t\t$current->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t$current_timestamp \t\t\t\t= strtotime($current->format('Y-m-d H:i'));\n\t\t\t\t\t\t\t$current_time = \t$current->format('Y-m-d H:i:s');\n\n\t\t\t\t\t\t\t$clinic_creation = new DateTime($clinic['created_at'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t$clinic_creation->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t$clinic_created = \t$clinic_creation->format('Y-m-d H:i:s');\n\n\t\t\t\t\t\t\t$preferred_wait_hour \t= \t$this->GetAdminSettingsValue('default_time_stay_in_feeds');\n\t\t\t\t\t\t\tif($clinic['default_unfilled_time'] != null){\n\t\t\t\t\t\t\t\t\t$wait_time\t\t\t\t=\t'+'.$clinic['default_unfilled_time'].' hour';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t$wait_time\t\t\t\t=\t'+'.$preferred_wait_hour.'hour';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$clinic_creation_time_with_wait_time\t=\tdate('Y-m-d H:i:s',strtotime($wait_time,strtotime($clinic_created_gmt)));\n\t\t\t\t\t\tif(strtotime($current_time_gmt) < strtotime($clinic_time_gmt)){\n\t\t\t\t\t\t\t$count \t\t\t\t\t\t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('status',1)->count();\n\t\t\t\t\t\tif($count<$clinic['personnel']){\n\t\t\t\t\t\t\t//checking clinic accepted or rejected by this user.\n\t\t\t\t\t\t\t\t$check_decline_status \t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('provider_id',$input_data['user_id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('status',0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->count();\n\t\t\t\t\t\t\t\t$check_accept_status \t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('provider_id',$input_data['user_id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('status',1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->count();\n\t\t\t\t\t\t\t\tif($check_decline_status==0 && $check_accept_status == 0){\n\n\t\t\t\t\t\t\t\t$clinic['clinic_name']\t=\t$clinic['name'];\n\t\t\t\t\t\t\t\t// clinic time according to user time zone starts //\n\t\t\t\t\t\t\t\t$Preptime = new DateTime($clinic['prep_time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t\t$Preptime->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t\t$prep_time \t\t= $Preptime->format('H:i');\n\n\t\t\t\t\t\t\t\t$EndTime = new DateTime($clinic['end_time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t\t$EndTime->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t\t$clinic_end_time \t\t= $EndTime->format('H:i');\n\n\t\t\t\t\t\t\t\t$clinic['date']\t\t=\tdate('d-m-Y', strtotime($clinic_date_time));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($user['time_format'] == 24){\n\t\t\t\t\t\t\t\t\t$format = 'H:i';\n\t\t\t\t\t\t\t\t}elseif($user['time_format'] == 12){\n\t\t\t\t\t\t\t\t\t$format = 'h:i a';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$clinic['time']\t\t\t\t\t=\tdate($format, strtotime($clinic_date_time));\n\t\t\t\t\t\t\t\t$clinic['prep_time']\t\t=\tdate($format, strtotime($prep_time));\n\t\t\t\t\t\t\t\t$clinic['end_time']\t\t\t=\tdate($format, strtotime($clinic_end_time));\n\t\t\t\t\t\t\t\t// clinic time according to user time zone ends //\n\t\t\t\t\t\t\t\t$clinic['estimated_duration']\t=\tnumber_format((($clinic['estimated_duration'])/60),2).' hour';\n\t\t\t\t\t\t\t\tif($current_time_gmt>$clinic_creation_time_with_wait_time){\n\t\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t\t= 'Unfilled';\n\t\t\t\t\t\t\t\t\t\t$clinic['status_name'] \t= 'Unfilled clinic';\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tif(in_array($input_data['user_id'],explode(',',$clinic['provider_id']))){\n\t\t\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t= \t'preferd';\n\t\t\t\t\t\t\t\t\t\t\t$clinic['status_name']\t\t= \t'Preferred available Clinics';\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t= \t'available_clinics';\n\t\t\t\t\t\t\t\t\t\t$clinic['status_name']\t\t= \t'Available clinics';\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(strtotime($clinic_time_gmt)> strtotime($current_time_gmt)){\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$all_clinics[] = $clinic;\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\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else if(isset($input_data['type']) && $input_data['type'] == 'day'){\n\t\t\t\t\t//$input_data['type_value'] = '25-09-2017';\n\t\t\t\t\t$user_time_zone \t\t\t= User_model::select('timezone')->where('id',$input_data['user_id'])->get();\n\t\t\t\t\t$user_time_zone_value \t\t= $user_time_zone[0]['timezone'];\n\n\t\t\t\t\t$start_time \t\t\t\t=\t$input_data['type_value'].\" 12:00 AM\";\n\t\t\t\t\t$end_time \t\t\t\t\t=\t$input_data['type_value'].\" 11:59 PM\";\n\t\t\t\t\t\n\t\t\t\t\t$user_time_zone \t\t=\tnew DateTimeZone($user_time_zone_value);\n\t\t\t\t\t$end_search_date \t= new DateTime($end_time, $user_time_zone);\n\t\t\t\t\t$start_search_date = new DateTime($start_time, $user_time_zone);\n\n\t\t\t\t\t$start_search_date->setTimezone(new DateTimeZone('GMT'));\n\t\t\t\t\t$start_searchFinalDate = $start_search_date->format('Y-m-d H:i');\n\n\t\t\t\t\t$end_search_date = new DateTime($end_time, $user_time_zone);\n\n\t\t\t\t\t$end_search_date->setTimezone(new DateTimeZone('GMT'));\n\t\t\t\t\t$end_searchFinalDate = $end_search_date->format('Y-m-d H:i');\n\n\t\t\t\t\t\n\t\t\t\t\t$date \t\t\t= \tdate('Y-m-d', strtotime($input_data['type_value']));\n\t\t\t\t\t$month_name\t=\tstrtolower(date(\"F\", strtotime($date)));\n\t\t\t\t\t$search \t\t= \t$input_data['type_value'];\n\n\t\t\t\t\t$distance \t= $this->GetAdminSettingsValue('max_distance');\n\t\t\t\t\t$sqlQuery = \"SELECT *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t( 6371 * acos( cos( radians(\".$user['latitude'].\") ) * cos( radians( `latitude` ) ) * cos( radians( `longitude` ) - radians(\".$user['longitude'].\") ) + sin( radians(\".$user['latitude'].\") ) * sin( radians( `latitude` ) ) ) ) AS distance\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM clinics WHERE (STR_TO_DATE(CONCAT(`date`, ' ' ,`time`), '%Y-%m-%d %H:%i') BETWEEN STR_TO_DATE('\".$start_searchFinalDate.\"', '%Y-%m-%d %H:%i') AND STR_TO_DATE('\".$end_searchFinalDate.\"', '%Y-%m-%d %H:%i')) AND (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFIND_IN_SET(\".$input_data['user_id'].\", `provider_id`) OR ( 6371 * acos( cos( radians(\".$user['latitude'].\") ) * cos( radians( `latitude` ) ) * cos( radians( `longitude` ) - radians(\".$user['longitude'].\") ) + sin( radians(\".$user['latitude'].\") ) * sin( radians( `latitude` ) ) ) ) <= $distance )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY distance ASC\";\n\t\t\t\t\t$clinics_s = DB::select(DB::raw($sqlQuery));\n\t\t\t\t\t$clinics = (array) $clinics_s;\n\t\t\t\t\t\tif(!empty($clinics)){\n\t\t\t\t\t\t\tforeach($clinics as $clinic){\n\t\t\t\t\t\t\t\t$clinic = (array)$clinic;\n\t\t\t\t\t\t\t\t$clinic_time_gmt \t\t= $clinic['date'].' '.$clinic['time'];\n\t\t\t\t\t\t\t\t$current_time_gmt \t\t= date('Y-m-d H:i:s');\n\t\t\t\t\t\t\t\t$clinic_created_gmt \t= $clinic['created_at'];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$time = new DateTime($clinic['date'].' '.$clinic['time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t\t$user_time_zone \t\t\t= User_model::select('timezone')->where('id',$input_data['user_id'])->get();\n\t\t\t\t\t\t\t\t$user_time_zone_value = $user_time_zone[0]['timezone'];\n\t\t\t\t\t\t\t\t$time->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t\t$clinic_date_time \t\t= $time->format('Y-m-d H:i:s');\n\t\t\t\t\t\t\t\t$clinic_time\t\t\t\t\t=\t$clinic_date_time;\n\n\t\t\t\t\t\t\t\t$current = new DateTime(date('Y-m-d h:i:s'));\n\t\t\t\t\t\t\t\t$current->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t\t$current_timestamp \t\t\t\t= strtotime($current->format('Y-m-d H:i'));\n\t\t\t\t\t\t\t\t$current_time = \t$current->format('Y-m-d H:i:s');\n\n\t\t\t\t\t\t\t\t$clinic_creation = new DateTime($clinic['created_at'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t\t$clinic_creation->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t\t$clinic_created = \t$clinic_creation->format('Y-m-d H:i:s');\n\n\t\t\t\t\t\t\t\t$preferred_wait_hour \t= \t$this->GetAdminSettingsValue('default_time_stay_in_feeds');\n\t\t\t\t\t\t\t\tif($clinic['default_unfilled_time'] != null){\n\t\t\t\t\t\t\t\t\t\t$wait_time\t\t\t\t\t=\t'+'.$clinic['default_unfilled_time'].' hour';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t$wait_time\t\t\t\t\t=\t'+'.$preferred_wait_hour.'hour';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$clinic_creation_time_with_wait_time\t=\tdate('Y-m-d H:i:s',strtotime($wait_time,strtotime($clinic_created_gmt)));\n\t\t\t\t\t\t\tif(strtotime($current_time_gmt) < strtotime($clinic_time_gmt)){\n\t\t\t\t\t\t\t\t// checking clinic already accepted by someone or not.\n\t\t\t\t\t\t\t\t$count \t\t\t\t\t\t\t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('status',1)->count();\n\t\t\t\t\t\t\tif($count<$clinic['personnel']){\n\t\t\t\t\t\t\t\t//checking clinic accepted or rejected by this user.\n\t\t\t\t\t\t\t\t$check_decline_status \t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('provider_id',$input_data['user_id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('status',0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->count();\n\t\t\t\t\t\t\t\t$check_accept_status \t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('provider_id',$input_data['user_id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('status',1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->count();\n\t\t\t\t\t\t\t\tif($check_decline_status==0 && $check_accept_status == 0){\n\n\t\t\t\t\t\t\t\t\t\t$clinic['clinic_name']\t=\t$clinic['name'];\n\t\t\t\t\t\t\t\t\t\t// clinic time according to user time zone starts //\n\t\t\t\t\t\t\t\t\t\t$Preptime = new DateTime($clinic['prep_time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t\t\t\t$Preptime->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t\t\t\t$prep_time \t\t= $Preptime->format('H:i');\n\n\t\t\t\t\t\t\t\t\t\t$EndTime = new DateTime($clinic['end_time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t\t\t\t$EndTime->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t\t\t\t$clinic_end_time \t\t= $EndTime->format('H:i');\n\n\t\t\t\t\t\t\t\t\t\t//$clinic['date']\t\t=\tdate('d-m-Y', strtotime($clinic_date_time));\n\t\t\t\t\t\t\t\t\t\t$clinic['date'] \t= date($config_month.$config_separator.$config_date.$config_separator.$config_year, strtotime($clinic_date_time));\n\t\t\t\t\t\t\t\t\t\t\tif($user['time_format'] == 24){\n\t\t\t\t\t\t\t\t\t\t\t\t$format = 'H:i';\n\t\t\t\t\t\t\t\t\t\t\t}elseif($user['time_format'] == 12){\n\t\t\t\t\t\t\t\t\t\t\t\t$format = 'h:i a';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$clinic['time']\t\t\t\t\t=\tdate($format, strtotime($clinic_date_time));\n\t\t\t\t\t\t\t\t\t\t\t$clinic['prep_time']\t\t=\tdate($format, strtotime($prep_time));\n\t\t\t\t\t\t\t\t\t\t\t$clinic['end_time']\t\t\t=\tdate($format, strtotime($clinic_end_time));\n\t\t\t\t\t\t\t\t\t\t// clinic time according to user time zone ends //\n\t\t\t\t\t\t\t\t\t\t$clinic['estimated_duration']\t=\tnumber_format((($clinic['estimated_duration'])/60),2).' hour';\n\t\t\t\t\t\t\t\t\t\tif($current_time_gmt>$clinic_creation_time_with_wait_time){\n\t\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t\t= 'Unfilled';\n\t\t\t\t\t\t\t\t\t\t$clinic['status_name'] \t\t\t= 'Unfilled clinic';\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\tif(in_array($input_data['user_id'],explode(',',$clinic['provider_id']))){\n\t\t\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t= \t'preferd';\n\t\t\t\t\t\t\t\t\t\t\t$clinic['status_name']\t\t= \t'Preferred available Clinics';\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\t$clinic['type'] \t\t\t= \t'available_clinics';\n\t\t\t\t\t\t\t\t\t\t\t\t$clinic['status_name']\t\t= \t'Available clinics';\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\tif(strtotime($clinic_time_gmt)> strtotime($current_time_gmt)){\n\t\t\t\t\t\t\t\t\t\t\t$all_clinics[] = $clinic;\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\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t }else if(isset($input_data['type']) && $input_data['type'] == 'week'){\n\t\t\t\t\t$day_range \t\t\t= \texplode(',',$input_data['type_value']);\n\t\t\t\t\t$start_date\t\t\t=\tdate('Y-m-d', strtotime($day_range[0]));\n\t\t\t\t\t$end_date\t\t\t=\tdate('Y-m-d', strtotime($day_range[1]));\n\n\t\t\t\t\t$distance \t= $this->GetAdminSettingsValue('max_distance');\n\t\t\t\t\t$sqlQuery = \"SELECT *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t( 6371 * acos( cos( radians(\".$user['latitude'].\") ) * cos( radians( `latitude` ) ) * cos( radians( `longitude` ) - radians(\".$user['longitude'].\") ) + sin( radians(\".$user['latitude'].\") ) * sin( radians( `latitude` ) ) ) ) AS distance\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM clinics WHERE (date BETWEEN '\".$start_date.\"' AND '\".$end_date.\"') AND\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\tFIND_IN_SET(\".$input_data['user_id'].\", `provider_id`) OR ( 6371 * acos( cos( radians(\".$user['latitude'].\") ) * cos( radians( `latitude` ) ) * cos( radians( `longitude` ) - radians(\".$user['longitude'].\") ) + sin( radians(\".$user['latitude'].\") ) * sin( radians( `latitude` ) ) ) ) <= $distance )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY distance ASC\";\n\t\t\t\t\t$clinics_s = DB::select(DB::raw($sqlQuery));\n\t\t\t\t\t$clinics = (array) $clinics_s;\n\t\t\t\t\tif(!empty($clinics)){\n\t\t\t\t\tforeach($clinics as $clinic){\n\t\t\t\t\t\t\t$clinic = (array)$clinic;\n\t\t\t\t\t\t\t$clinic_time_gmt \t\t= $clinic['date'].' '.$clinic['time'];\n\t\t\t\t\t\t\t$current_time_gmt \t\t= date('Y-m-d H:i:s');\n\t\t\t\t\t\t\t$clinic_created_gmt \t= $clinic['created_at'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$time = new DateTime($clinic['date'].' '.$clinic['time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t$user_time_zone \t\t\t= User_model::select('timezone')->where('id',$input_data['user_id'])->get();\n\t\t\t\t\t\t\t$user_time_zone_value = $user_time_zone[0]['timezone'];\n\t\t\t\t\t\t\t$time->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t$clinic_date_time \t\t= $time->format('Y-m-d H:i:s');\n\t\t\t\t\t\t\t$clinic_time\t\t\t\t\t=\t$clinic_date_time;\n\n\t\t\t\t\t\t\t$current = new DateTime(date('Y-m-d h:i:s'));\n\t\t\t\t\t\t\t$current->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t$current_timestamp \t\t\t\t= strtotime($current->format('Y-m-d H:i'));\n\t\t\t\t\t\t\t$current_time = \t$current->format('Y-m-d H:i:s');\n\n\t\t\t\t\t\t\t$clinic_creation = new DateTime($clinic['created_at'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t$clinic_creation->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t$clinic_created = \t$clinic_creation->format('Y-m-d H:i:s');\n\n\t\t\t\t\t\t\t\t$preferred_wait_hour \t= \t$this->GetAdminSettingsValue('default_time_stay_in_feeds');\n\t\t\t\t\t\t\t\tif($clinic['default_unfilled_time'] != null){\n\t\t\t\t\t\t\t\t\t\t$wait_time\t\t\t\t\t=\t'+'.$clinic['default_unfilled_time'].' hour';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t$wait_time\t\t\t\t\t=\t'+'.$preferred_wait_hour.'hour';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$clinic_creation_time_with_wait_time\t=\tdate('Y-m-d H:i:s',strtotime($wait_time,strtotime($clinic_created)));\n\t\t\t\t\t\tif(strtotime($current_time_gmt) < strtotime($clinic_time_gmt)){\n\t\t\t\t\t\t// checking clinic already accepted by someone or not.\n\t\t\t\t\t\t\t\t$count \t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t->where('status',1)->count();\n\t\t\t\t\t\tif($count<$clinic['personnel']){\n\t\t\t\t\t\t\t//checking clinic accepted or rejected by this user.\n\t\t\t\t\t\t\t\t$check_decline_status \t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('provider_id',$input_data['user_id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('status',0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->count();\n\t\t\t\t\t\t\t\t$check_accept_status \t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('provider_id',$input_data['user_id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('status',1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->count();\n\t\t\t\t\t\t\t\tif($check_decline_status==0 && $check_accept_status == 0){\n\t\t\t\t\t\t\t\t\t$clinic['date']\t\t\t\t\t=\tdate('d-m-Y', strtotime($clinic_date_time));\n\t\t\t\t\t\t\t\t\t// clinic time according to user time zone starts //\n\t\t\t\t\t\t\t\t\t$Preptime = new DateTime($clinic['prep_time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t\t\t$Preptime->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t\t\t$prep_time \t\t= $Preptime->format('H:i');\n\n\t\t\t\t\t\t\t\t\t$EndTime = new DateTime($clinic['end_time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t\t\t$EndTime->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t\t\t$clinic_end_time \t\t= $EndTime->format('H:i');\n\n\t\t\t\t\t\t\t\t\t\tif($user['time_format'] == 24){\n\t\t\t\t\t\t\t\t\t\t\t$format = 'H:i';\n\t\t\t\t\t\t\t\t\t\t}elseif($user['time_format'] == 12){\n\t\t\t\t\t\t\t\t\t\t\t$format = 'h:i a';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$clinic['time']\t\t\t\t\t=\tdate($format, strtotime($clinic_date_time));\n\t\t\t\t\t\t\t\t\t\t$clinic['prep_time']\t\t=\tdate($format, strtotime($prep_time));\n\t\t\t\t\t\t\t\t\t\t$clinic['end_time']\t\t\t=\tdate($format, strtotime($clinic_end_time));\n\t\t\t\t\t\t\t\t$preferred_wait_hour \t\t= \t$this->GetAdminSettingsValue('preferred_wait_time');\n\t\t\t\t\t\t\t\tif($clinic['default_unfilled_time'] != null){\n\t\t\t\t\t\t\t\t\t$time_addition\t\t\t\t=\t'+'.$clinic['default_unfilled_time'].' hour';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t$time_addition\t\t\t\t=\t'+'.$preferred_wait_hour.' hour';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$clinic_time\t\t\t\t\t=\tdate('Y-m-d H:i:s',strtotime($clinic['date'].' '.$clinic['time']));\n\t\t\t\t\t\t\t\t// adding wait time or default unfilled time to clinic creation date.\n\t\t\t\t\t\t\t\t$clinic_creation_time_with_addition\t\t=\tdate('Y-m-d H:i:s',strtotime($time_addition,strtotime($clinic_created_gmt)));\n\n\t\t\t\t\t\t\t\t$clinic['clinic_name']\t\t\t\t=\t$clinic['name'];\n\t\t\t\t\t\t\t\t// clinic time according to user time zone ends //\n\t\t\t\t\t\t\t\t$clinic['start_year']\t\t\t\t\t=\tdate('Y', strtotime($clinic['date']));\n\t\t\t\t\t\t\t\t$clinic['start_month']\t\t\t\t=\tdate('m', strtotime($clinic['date']));\n\t\t\t\t\t\t\t\t$clinic['start_day']\t\t\t\t\t=\tdate('d', strtotime($clinic['date']));\n\t\t\t\t\t\t\t\t$clinic['end_year']\t\t\t\t\t\t=\tdate('Y', strtotime($clinic['date']));\n\t\t\t\t\t\t\t\t$clinic['end_month']\t\t\t\t\t=\tdate('m', strtotime($clinic['date']));\n\t\t\t\t\t\t\t\t$clinic['end_day']\t\t\t\t\t\t=\tdate('d', strtotime($clinic['date']));\n\t\t\t\t\t\t\t\t$clinic['start_hour']\t\t\t\t\t=\tdate('H', strtotime($clinic['time']));\n\t\t\t\t\t\t\t\t$clinic['start_minute']\t\t\t\t=\tdate('i', strtotime($clinic['time']));\n\t\t\t\t\t\t\t\t$clinic['start_meridiem']\t\t\t=\tdate('A', strtotime($clinic['time']));\n\t\t\t\t\t\t\t\t//get clinic end time from addition clinic duration into clinic time.\n\t\t\t\t\t\t\t\t$time_addition\t\t\t\t\t\t\t\t=\t'+'.$clinic['estimated_duration'].' minutes';\n\n\t\t\t\t\t\t\t\t$clinic_end_timestamp \t\t\t\t= \tstrtotime($time_addition, strtotime($clinic['time']));\n\t\t\t\t\t\t\t\t$clinic['end_hour']\t\t\t\t\t\t=\tdate('H', $clinic_end_timestamp);\n\t\t\t\t\t\t\t\t$clinic['end_minute']\t\t\t\t\t=\tdate('i', $clinic_end_timestamp);\n\t\t\t\t\t\t\t\t$clinic['end_meridiem']\t\t\t\t=\tdate('A', $clinic_end_timestamp);\n\t\t\t\t\t\t\t\t$clinic['duration']\t\t\t\t\t\t=\tnumber_format((($clinic['estimated_duration'])/60),2).' hour';\n\t\t\t\t\t\t\t\t$clinic['estimated_duration']\t=\tnumber_format((($clinic['estimated_duration'])/60),2).' hour';\n\t\t\t\t\t\t\t\t$clinic['mileage_required']\t\t=\t'';\n\t\t\t\t\t\t\t\t$clinic['drive_time_required']=\t'';\n\t\t\t\t\t\t\t\t$clinic['mileage_status']\t\t\t=\t'';\n\t\t\t\t\t\t\t\t$clinic['drive_time_status']\t=\t'';\n\t\t\t\t\t\t\t\t$date \t\t\t\t\t\t\t\t\t\t\t\t= \t$clinic['date'];\n\t\t\t\t\t\t\t\t$time \t\t\t\t\t\t\t\t\t\t\t\t= \t$clinic['time'];\n\t\t\t\t\t\t\t\t$full_date \t\t\t\t\t\t\t\t\t\t= \t$time.' '.$date;\n\t\t\t\t\t\t\t\tif($current_time_gmt>$clinic_creation_time_with_addition){\n\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t\t= 'Unfilled';\n\t\t\t\t\t\t\t\t\t$clinic['status_name'] \t= 'Unfilled clinic';\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tif(in_array($input_data['user_id'],explode(',',$clinic['provider_id']))){\n\t\t\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t= \t'preferd';\n\t\t\t\t\t\t\t\t\t\t\t$clinic['status_name']\t\t= \t'Preferred available Clinics';\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t= \t'available_clinics';\n\t\t\t\t\t\t\t\t\t\t$clinic['status_name']\t\t= \t'Available clinics';\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(strtotime($clinic_time_gmt)> strtotime($current_time_gmt)){\n\t\t\t\t\t\t\t\t\t\t$clinic['date'] \t= date($config_month.$config_separator.$config_date.$config_separator.$config_year, strtotime($clinic['date']));\n\t\t\t\t\t\t\t\t\t\t$all_clinics[] = $clinic;\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\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t }else{\n\t\t\t\t\t$distance \t= $this->GetAdminSettingsValue('max_distance');\n\t\t\t\t\t$sqlQuery = \"SELECT\t*,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t( 6371 * acos( cos( radians(\".$user['latitude'].\") ) * cos( radians( `latitude` ) ) * cos( radians( `longitude` ) - radians(\".$user['longitude'].\") ) + sin( radians(\".$user['latitude'].\") ) * sin( radians( `latitude` ) ) ) ) AS distance\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM clinics WHERE `date` >= curdate() AND\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\tFIND_IN_SET(\".$input_data['user_id'].\", `provider_id`) OR ( 6371 * acos( cos( radians(\".$user['latitude'].\") ) * cos( radians( `latitude` ) ) * cos( radians( `longitude` ) - radians(\".$user['longitude'].\") ) + sin( radians(\".$user['latitude'].\") ) * sin( radians( `latitude` ) ) ) ) <= $distance )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY distance ASC\";\n\t\t\t\t\t$clinics_s = DB::select(DB::raw($sqlQuery));\n\t\t\t\t\t$clinics = (array) $clinics_s;\n\t\t\t\tif(!empty($clinics)){\n\t\t\t\t\tforeach($clinics as $clinic){\n\t\t\t\t\t\t$clinic = (array)$clinic;\n\t\t\t\t\t\t$clinic_time_gmt \t\t= $clinic['date'].' '.$clinic['time'];\n\t\t\t\t\t\t$current_time_gmt \t\t= date('Y-m-d H:i:s');\n\t\t\t\t\t\t$clinic_created_gmt \t= $clinic['created_at'];\n\t\t\t\t\t\t\n\t\t\t\t\t\t$time = new DateTime($clinic['date'].' '.$clinic['time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t$user_time_zone \t\t\t= User_model::select('timezone')->where('id',$input_data['user_id'])->get();\n\t\t\t\t\t\t$user_time_zone_value = $user_time_zone[0]['timezone'];\n\t\t\t\t\t\t$time->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t$clinic_date_time \t\t= $time->format('Y-m-d H:i:s');\n\t\t\t\t\t\t$clinic_time\t\t\t\t\t=\t$clinic_date_time;\n\n\t\t\t\t\t\t$current = new DateTime(date('Y-m-d h:i:s'));\n\t\t\t\t\t\t$current->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t$current_timestamp \t\t\t\t= strtotime($current->format('Y-m-d H:i'));\n\t\t\t\t\t\t$current_time = \t$current->format('Y-m-d H:i:s');\n\n\t\t\t\t\t\t$clinic_creation = new DateTime($clinic['created_at'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t$clinic_creation->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t$clinic_created = \t$clinic_creation->format('Y-m-d H:i:s');\n\n\t\t\t\t\t\t\t\t$preferred_wait_hour \t= \t$this->GetAdminSettingsValue('default_time_stay_in_feeds');\n\t\t\t\t\t\t\t\tif($clinic['default_unfilled_time'] != null){\n\t\t\t\t\t\t\t\t\t\t$wait_time\t\t\t\t\t=\t'+'.$clinic['default_unfilled_time'].' hour';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t$wait_time\t\t\t\t\t=\t'+'.$preferred_wait_hour.'hour';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$clinic_creation_time_with_wait_time\t=\tdate('Y-m-d H:i:s',strtotime($wait_time,strtotime($clinic_created)));\n\t\t\t\t\t\tif(strtotime($current_time_gmt) < strtotime($clinic_time_gmt)){\n\t\t\t\t\t\t// checking clinic already accepted by someone or not.\n\t\t\t\t\t\t\t\t$count \t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t->where('status',1)->count();\n\t\t\t\t\t\tif($count<$clinic['personnel']){\n\t\t\t\t\t\t\t//checking clinic accepted or rejected by this user.\n\t\t\t\t\t\t\t\t$check_decline_status \t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('provider_id',$input_data['user_id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('status',0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->count();\n\t\t\t\t\t\t\t\t$check_accept_status \t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('provider_id',$input_data['user_id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('status',1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->count();\n\t\t\t\t\t\t\t\tif($check_decline_status==0 && $check_accept_status == 0){\n\t\t\t\t\t\t\t\t\t// clinic time according to user time zone starts //\n\t\t\t\t\t\t\t\t\t$Preptime = new DateTime($clinic['prep_time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t\t\t$Preptime->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t\t\t$prep_time \t\t= $Preptime->format('H:i');\n\n\t\t\t\t\t\t\t\t\t$EndTime = new DateTime($clinic['end_time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t\t\t$EndTime->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t\t\t$clinic_end_time \t\t= $EndTime->format('H:i');\n\n\t\t\t\t\t\t\t\t\t$clinic['date']\t\t\t\t\t=\tdate('d-m-Y', strtotime($clinic_date_time));\n\t\t\t\t\t\t\t\t\t\tif($user['time_format'] == 24){\n\t\t\t\t\t\t\t\t\t\t\t$format = 'H:i';\n\t\t\t\t\t\t\t\t\t\t}elseif($user['time_format'] == 12){\n\t\t\t\t\t\t\t\t\t\t\t$format = 'h:i a';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$clinic['time']\t\t\t\t\t=\tdate($format, strtotime($clinic_date_time));\n\t\t\t\t\t\t\t\t\t\t$clinic['prep_time']\t\t=\tdate($format, strtotime($prep_time));\n\t\t\t\t\t\t\t\t\t\t$clinic['end_time']\t\t\t=\tdate($format, strtotime($clinic_end_time));\n\t\t\t\t\t\t\t\t\t// clinic time according to user time zone ends //\n\t\t\t\t\t\t\t\t$preferred_wait_hour \t\t\t= \t$this->GetAdminSettingsValue('preferred_wait_time');\n\t\t\t\t\t\t\t\tif($clinic['default_unfilled_time'] != null){\n\t\t\t\t\t\t\t\t\t$time_addition\t\t\t\t\t=\t'+'.$clinic['default_unfilled_time'].' hour';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t$time_addition\t\t\t\t=\t'+'.$preferred_wait_hour.' hour';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$clinic_time\t\t\t\t\t\t=\tdate('Y-m-d H:i:s',strtotime($clinic['date'].' '.$clinic['time']));\n\t\t\t\t\t\t\t\t// adding wait time or default unfilled time to clinic creation date.\n\t\t\t\t\t\t\t\t$clinic_creation_time_with_addition\t\t=\tdate('Y-m-d H:i:s',strtotime($time_addition,strtotime($clinic_created_gmt)));\n\n\t\t\t\t\t\t\t\t$clinic['clinic_name']\t\t\t=\t$clinic['name'];\n\n\t\t\t\t\t\t\t\t$clinic['estimated_duration']\t=\tnumber_format((($clinic['estimated_duration'])/60),2).' hour';\n\t\t\t\t\t\t\t\tif($current_time_gmt>$clinic_creation_time_with_addition){\n\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t\t= 'Unfilled';\n\t\t\t\t\t\t\t\t\t$clinic['status_name'] \t= 'Unfilled clinic';\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tif(in_array($input_data['user_id'],explode(',',$clinic['provider_id']))){\n\t\t\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t= \t'preferd';\n\t\t\t\t\t\t\t\t\t\t\t$clinic['status_name']\t\t= \t'Preferred available Clinics';\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t= \t'available_clinics';\n\t\t\t\t\t\t\t\t\t\t$clinic['status_name']\t\t= \t'Available clinics';\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(strtotime($clinic_time_gmt)> strtotime($current_time_gmt)){\n\t\t\t\t\t\t\t\t\t\t\t$clinic['date'] \t= date($config_month.$config_separator.$config_date.$config_separator.$config_year, strtotime($clinic['date']));\n\t\t\t\t\t\t\t\t\t\t\t$all_clinics[$clinic['date']][] = $clinic;\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\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t\t$userimg = WEBSITE_UPLOADS_URL.'users/'.$user['image'];\n\t\t\t\tif(isset($user['image']) && $user['image'] != '' ){\n\t\t\t\t\t$user_image = $userimg;\n\t\t\t\t}else{\n\t\t\t\t\t$user_image = WEBSITE_UPLOADS_URL.'users/man.png';\n\t\t\t\t}\n\t\t\tif(!empty($all_clinics)){\n\t\t\t\treturn $this->encrypt(json_encode(array('status'=>'success','message'=>'ok.','clinics'=>$all_clinics,'image'=>$user_image)));\n\t\t\t}else{\n\t\t\t\treturn $this->encrypt(json_encode(array('status'=>'error','message'=>'No records found in your location.')));\n\t\t\t}\n\t\t}else{\n\t\t\treturn $this->encrypt(json_encode(array('status'=>'deleted','message'=>'User is deleted.')));\n\t\t}\n\t\t}\n\t}",
"public function allrecord_get() { \n $result = $this->Api_model->selectData('info', 'id, name, email');\n if($result == null)\n $this->set_response(array('response_code'=>400,'response_message'=>'No Data Found','response_data'=>array()), REST_Controller::HTTP_OK);\n else\n $this->set_response(array('response_code'=>200,'response_message'=>'Success','response_data'=>$result), REST_Controller::HTTP_OK);\n }",
"public function actionLists()\n {\n\n $headers = apache_request_headers();\n $User = CustomerApiKey::model()->findUserByPublicKey($headers['X_MW_PUBLIC_KEY']);\n\n $this->user_id = $User->customer_id;\n\n if($User->private!=$headers['X_MW_PRIVATE_KEY'])\n {\n return $this->renderJson(array(\n 'status' => 'error',\n 'error' => Yii::t('api','A private API Key is required.')\n ),400);\n }\n\n if(empty($User->public))\n {\n return $this->renderJson(array(\n 'status' => 'error',\n 'error' => Yii::t('api','A public API Key is required.')\n ),400);\n }\n $lists = array(\"lists\" => Lists::model()->getCustomerListsZapier($this->user_id));\n\n Logger::addProgress('(Zapier) ActionLists '.print_r($lists,true),'(Zapier) ActionLists');\n\n return $this->renderJson($lists,200);\n\n }",
"public function getEntriesList(){\n return $this->_get(2);\n }",
"function get_isi_rawat_list(){\r\n\t\t$dapaket_dpaket = isset($_POST['dapaket_dpaket']) ? $_POST['dapaket_dpaket'] : 0;\r\n\t\t$dapaket_jpaket = isset($_POST['dapaket_jpaket']) ? $_POST['dapaket_jpaket'] : 0;\r\n\t\t$dapaket_paket = isset($_POST['dapaket_paket']) ? $_POST['dapaket_paket'] : 0;\r\n\t\t$start = (integer) (isset($_POST['start']) ? $_POST['start'] : $_GET['start']);\r\n\t\t$end = (integer) (isset($_POST['limit']) ? $_POST['limit'] : $_GET['limit']);\r\n\t\t$result = $this->m_master_ambil_paket->get_isi_rawat_list($dapaket_dpaket,$dapaket_jpaket,$dapaket_paket,$start,$end);\r\n\t\techo $result;\r\n\t}",
"function fsf_port_getImageCategories($fsf_port_image_id)\n { \n // Initialize Variables\n $fsf_port_getImageCategories_output = \"\";\n\n global $fsfcms_api_url; \n\n $fsf_api_file = \"fsf.port.getImageCategories.php\";\n $fsf_api_options = \"\";\n\n if($fsf_port_image_id !=\"\")\n {\n $fsf_api_options = \"?image_id=\" . $fsf_port_image_id;\n } else {\n $fsf_api_options = \"\";\n }\n\n $fsf_port_getImageCategories_json = fsf_preacher_curl($fsfcms_api_url, $fsf_api_file, $fsf_api_options);\n $fsf_port_getImageCategories_categories = json_decode($fsf_port_getImageCategories_json, true);\n $fsf_port_getImageCategories_output = array();\n \n // Process the categories \n if($fsf_port_getImageCategories_categories['0'] == \"FSFPGIC-None-Found\")\n {\n $fsf_port_getImageCategories_output = \"No categories were found for this image.\";\n } else { \n $fsf_port_getImageCategories_multiple = \"NO\";\n if (count($fsf_port_getImageCategories_categories) > 1)\n {\n $fsf_port_getImageCategories_multiple = \"YES\"; \n }\n $fsf_port_getImageCategories_output['multipleCategories'] = $fsf_port_getImageCategories_multiple;\n foreach($fsf_port_getImageCategories_categories as $fsf_port_getImageCategories_category)\n { \n $fsf_port_getImageCategories_links .= \"<a href=\\\"/categories/\" . strtolower($fsf_port_getImageCategories_category['categorySlug']) . \"\\\">\" . ucwords($fsf_port_getImageCategories_category['categoryName']) . \"</a>, \";\n } \n $fsf_port_getImageCategories_links = rtrim($fsf_port_getImageCategories_links,\", \"); \n $fsf_port_getImageCategories_output['categoriesWithLinks'] = $fsf_port_getImageCategories_links;\n } \n return $fsf_port_getImageCategories_output;\n }",
"public function find_officer()\n { \n $query = get_post('q');\n $where = 'deletedAt IS NULL' .\n 'AND (MabuhayID LIKE \"' . $query . '%\" OR CONCAT(FirstName, \" \", LastName) LIKE \"' . $query . '%\")' .\n 'AND AccountTypeID IN(2,3)';\n $users = $this->mgovdb->getRecords('UserAccountInformation', $where);\n $items = array();\n foreach ($users as $user) {\n $items[] = array(\n 'id' => $user['id'],\n 'firstname' => $user['FirstName'],\n 'lastname' => $user['LastName'],\n 'fullname' => $user['FirstName'] . ' ' . $user['LastName'],\n 'mabuhayID' => $user['MabuhayID'],\n 'email' => $user['EmailAddress'],\n 'contact' => $user['ContactNumber'],\n 'gender' => lookup('gender', $user['GenderID']),\n 'address' => array_values(array_reverse(lookup_address($user))),\n 'photo' => photo_filename($user['Photo']),\n 'actype' => lookup('account_type', $user['AccountTypeID']),\n 'aclevel' => lookup_db('UserAccountLevel', 'LevelName', $user['AccountLevelID'])\n );\n }\n response_json($items);\n }",
"public function GetDoctorList(){\n if($this->get_request_method()!= \"POST\"){\n $this->response('',406);\n }\n $format = $_POST['format'];\n $db_access = $this->dbConnect();\n $conn = $this->db;\n $res = new getService();\n $res->get_doctor_list($conn);\n }",
"function get_all_internships_detail($start, $end) {\n $conn = db_connect();\n\n $sql = \"SELECT * FROM internship_detail where InternshipId between $start and $end\";\n $result = mysqli_query($conn, $sql);\n while ($row = $result->fetch_assoc()) { \n $output[] = $row;\n }\n\n //clean-up result set and connection\n mysqli_free_result($result);\n mysqli_close($conn);\n return $output;\n}",
"function get_city($query,$type)\r\n{\r\nrequire_once 'REST_Ongkir.php';\r\n \r\n $rest = new REST_Ongkir(array(\r\n 'server' =&gt; 'http://api.ongkir.info/'\r\n ));\r\n \r\n//ganti API-Key dibawah ini sesuai dengan API Key yang anda peroleh setalah mendaftar di ongkir.info\r\n $result = $rest-&gt;post('city/list', array(\r\n 'query' =&gt; $query,\r\n 'type' =&gt; $type,\r\n 'courier' =&gt; 'jne',\r\n 'API-Key' =&gt; 'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456' ), 'JSON');\r\n \r\n try\r\n {\r\n $status = $result['status'];\r\n \r\n // Handling the data\r\n if ($status-&gt;code == 0)\r\n {\r\n return $cities = $result['cities'];\r\n //print_r($cities);\r\n //foreach ($cities-&gt;item as $item)\r\n //{\r\n //echo 'Kota: ' . $item . '&lt;br /&gt;';\r\n // }\r\n }\r\n else\r\n {\r\n echo 'Tidak ditemukan kota yang diawali &quot;band&quot;';\r\n }\r\n \r\n }\r\n catch (Exception $e)\r\n {\r\n echo 'Processing error.';\r\n }\r\n}",
"function FetchIndividualContent($i, $sid)\r\n{ \r\n\tglobal $connect;\r\n\t$crud = new Crud($connect);\r\n\r\n\tswitch ($i) {\r\n\r\n\t\t//fetch specific user's details for everybody - Used\r\n\t\tcase 2:\r\n\r\n\t\t\t$data = $crud->select(\"users\",\"*\",\" ID = '$sid' \");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\r\n\t\t//fetch specific event for editing - Used\r\n\t\tcase 3:\r\n\r\n\t\t\t$data = $crud->select(\"event\",\"*\",\" ID = '$sid' \");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\r\n\t\t//fetch specific from blog - Used\r\n\t\tcase 4:\r\n\r\n\t\t\t$data = $crud->select(\"broadcast\",\"*\",\" ID = '$sid' \");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\r\n\t\t//fetch specific user's details for everybody - Used\r\n\t\tcase 6:\r\n\r\n\t\t\t$data = $crud->select(\"admin\",\"*\",\" UID = '$sid' \");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\r\n\t\t\t//count all specific comment in blog - used\r\n\t\tcase 7:\r\n\t\t\t$data = $crud->select(\"blog_com\",\r\n\t\t\t\t\t\t\t\t\"COUNT(ComID) as Total \",\r\n\t\t\t\t\t\t\t\t\"BlogID = '$sid' \",\r\n\t\t\t\t\t\t\t\t\"\");\r\n\t\t\treturn $data[0][\"Total\"];\r\n\t\t\tbreak;\r\n\r\n\t\t//fetch specific guests message - Used\r\n\t\tcase 8:\r\n\r\n\t\t\t$data = $crud->select(\"guest\",\"*\",\" ID = '$sid' \");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\t\t\t\t\t\r\n\r\n\t\t//fetch specific music for editing - Used\r\n\t\tcase 16:\r\n\r\n\t\t\t$data = $crud->select(\"advert\",\"*\",\" ID = '$sid' \");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\r\n\t\t//fetch specific guests message - Used\r\n\t\tcase 17:\r\n\r\n\t\t\t$data = $crud->select(\"audit_log\",\"*\",\" UserID = '$sid' \");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\r\n\t\t//fetch all rows where UserID = 0, same with all with IPAddress\r\n\t\tcase 18:\r\n\r\n\t\t\t$data = $crud->select(\"audit_log\",\"*\",\" UserID = 0 \");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\r\n\t\t//fetch all rows where UserID = 0, same with all with IPAddress\r\n\t\tcase 19:\r\n\r\n\t\t\t$data = $crud->select(\"profile\",\"*\",\" UID = '$sid' \");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\r\n\t\t//fetch all jobs from job where ID = $sid\r\n\t\tcase 20:\r\n\r\n\t\t\t$data = $crud->select(\"job\",\"*\",\" ID = '$sid' \");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\r\n\r\n\r\n\t\tdefault:\r\n\t\t\t# code...\r\n\t\t\tbreak;\r\n\t}\r\n}",
"public function get_list_get()\n\t{ \n\t\tif($_SERVER['REQUEST_METHOD'] == \"GET\"){\n \t// Get data\n\t\t\tif(isset($_GET)){\n\t\t\t\t$permission=false;\n\t\t\t\t$token= isset($_GET['token']) ?($_GET['token']) : \"\";\n\t\t\t\t$permission=$this->matchAppToken($token);\n\t\t\t\tif($permission==true){\n\t\t\t\t\t$language= isset($_GET['language']) ?($_GET['language']) : \"en\";\t\n\t\t\t\t\t$response=$this->advance_notification_model->get_in_app_data($language);\t\n\t\t\t\t\tif($response){\n\t\t\t\t\t\t$json = array(\"status\" => 1, \"message\" => \"Ok\", \"data\"=> $response);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$json = array(\"status\" => 0, \"message\" => \"Somthing went wrong. Please try again later\");\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$json = array(\"status\" => 0, \"message\" => \"Token has been not matched\");\n\t\t\t\t}\t\n\t\t\t}else{\n\t\t\t\t$json = array(\"status\" => 0, \"message\" => \"Request has been uncompleted\");\n\t\t\t}\n\t\t}else{\n\t\t\t$json = array(\"status\" => 0, \"message\" => \"Request method not accepted\");\n\t\t}\n\t\t$this->response($json, REST_Controller::HTTP_OK);\n\t}",
"public static function getArticles()\n {\n // $url = \"https://n161.tech/api/dummyapi/post?page=1&limit=100\";\n // $curl = curl_init();\n // curl_setopt($curl, CURLOPT_URL, $url);\n // curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n // curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);\n // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n // $response = curl_exec($curl);\n // $array_data = json_decode($response, true);\n // curl_close($curl);\n // return $array_data;\n return Article::orderBy('updated_at', 'desc')->paginate(5);\n }",
"function item_listing()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $ret = array(\n 'content' => '',\n 'status' => 'fail'\n );\n if (!empty($_POST)) {\n $id = $_POST['id'];\n $searchData = $_POST['searchData'];\n $searchData['kind'] = 1;\n $searchData['login_user'] = $this->login_id;\n\n switch ($id) {\n case 1:\n $header = array(\"序号\", \"账号\", \"姓名\", \"角色\", \"新增时间\", \"操作\");\n $cols = 6;\n\n $contentList = $this->user_model->getItems($searchData);\n $footer = (count($contentList) == 0 || !isset($contentList)) ? $footer = \"没有数据.\" : '';\n break;\n }\n\n // end get\n $ret['header'] = $this->output_header($header);\n $ret['content'] = $this->output_content($contentList, $id);\n $ret['footer'] = $this->output_footer($footer, $cols);\n $ret['status'] = 'success';\n }\n echo json_encode($ret);\n }\n }",
"public function index()\n {\n $icg = $this->icg->all();\n return response()->json([\n 'data' =>$icg\n ],201);\n }",
"function info_list(){\r\n\t\t\r\n\t\t$query = isset($_POST['query']) ? $_POST['query'] : \"\";\r\n\t\t$start = (integer) (isset($_POST['start']) ? $_POST['start'] : $_GET['start']);\r\n\t\t$end = (integer) (isset($_POST['limit']) ? $_POST['limit'] : $_GET['limit']);\r\n\r\n\t\t$result=$this->m_info->info_list($query,$start,$end);\r\n\t\techo $result;\r\n\t}",
"public function getList()\n {\n\n $apikey = $this->params()->fromHeader('apikey', null);\n\n $query = SampleQuery::create();\n $aaa = $query->find()->toArray();\n\n\n// $apikey->getFieldValue();\n\n return new JsonModel(\n $aaa\n );\n }",
"function cwrc_get_authorities_list($setup_data, $query) {\n $collection = $setup_data['collection'];\n $query_string = 'collection:\"' . $collection . '\"';\n // $records = emic_process_query($query_string);\n $terms = explode(' ', $query);\n $terms = array_filter($terms);\n $solr = variable_get('islandora_solr_search_block_url', 'http://localhost:8080/solr');\n\n $url = \"http://$solr/select?indent=on&version=2.2&q=$query_string&fq=&start=0&rows=1000&qt=standard&wt=json&explainOther=&hl.fl=\";\n $results = json_decode(file_get_contents($url), TRUE);\n $docs = $results['response']['docs'];\n foreach ($docs as $doc) {\n $pid = $doc['PID'];\n $contents = array();\n foreach ($doc['emic.searchname'] as $sample) {\n $identifier = null;\n if (!empty($sample) & !$identifier) {\n $identifier = $sample;\n }\n }\n //$identifier = implode('', $doc['emic.searchname']);\n $contents['identifier'] = $identifier;\n $contents['Object'] = \"<a href='/fedora/repository/$pid' target='_blank'>$pid</a>\";\n $contents['Note'] = $doc['dc.description'][0];\n $records[$doc['PID']] = $contents;\n }\n\n while (count($terms) > 0) {\n $term = array_shift($terms) . \"*\";\n $query_string = 'collection:\"' . $collection . '\" AND emic.searchname:' . strtolower($term);\n\n $new_records = emic_process_query($query_string);\n if (is_array($new_records) && is_array($records)) {\n $records = array_intersect_key($records, $new_records);\n }\n }\n if (is_array($records)) {\n return array_values($records);\n }\n}",
"function getBasesList(){\r\n \t$resourceUrl = \"/bases?Take=All\";\r\n\t\t$this->get($resourceUrl);\r\n\t\t// Check reponse 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 Bases Failed.\r\n\t\t\t\t\tStatus: %d\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$this->status_code,\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\treturn false;\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n }",
"public function getList()\n\t{\n\t\treturn $this->crud->orderby('id DESC')\n\t\t\t\t\t->read(10)\n\t\t;\t\n\t}",
"public function list()\n\t{\n\t\treturn $this->curl('/ovo/list', Constant::HTTP_POST);\n\t}",
"public function infoCategory($category_id){\n\n \t$ch = curl_init();\n //getting specific orders after $time\n $encode = $this->urlPath.\"/rest/V1/categories/\" . $category_id;\n\t\t\n curl_setopt($ch, CURLOPT_URL, $encode);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n $headers = array();\n $headers[] = 'Authorization: Bearer '.$this->apiKey;\n $headers[] = 'Content-Type: application/json';\n //$headers[] = 'Accept: application/json';\n\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n $result = curl_exec($ch);\n\n curl_close ($ch);\n\n\n\n\n return $result;\n\t\t\t \n }",
"function get_provinsi(){\n\t\t$curl = curl_init();\n\n\t\tcurl_setopt_array($curl, array(\n\t\t\tCURLOPT_URL => \"http://api.rajaongkir.com/starter/province?id=12\",\n\t\t\tCURLOPT_RETURNTRANSFER => true,\n\t\t\tCURLOPT_ENCODING => \"\",\n\t\t\tCURLOPT_MAXREDIRS => 10,\n\t\t\tCURLOPT_TIMEOUT => 30,\n\t\t\tCURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n\t\t\tCURLOPT_CUSTOMREQUEST => \"GET\",\n\t\t\tCURLOPT_HTTPHEADER => array(\n\t\t\t\t\"key: 8f22875183c8c65879ef1ed0615d3371\"\n\t\t\t\t),\n\t\t\t));\n\n\t\t$response = curl_exec($curl);\n\t\t$err = curl_error($curl);\n\n\t\tcurl_close($curl);\n\n\t\tif ($err) {\n\t\t\techo \"cURL Error #:\" . $err;\n\t\t} else {\n\t\t\techo $response;\n\t\t}\n\t}",
"function item_listing()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $ret = array(\n 'content' => '',\n 'status' => 'fail'\n );\n if (!empty($_POST)) {\n $id = $_POST['id'];\n $searchData = $_POST['searchData'];\n // get top list data in homepage\n switch ($id) {\n case 1:\n\n $header = array(\"优惠券编号\", \"优惠券金额\", \"所属终端便利店账号\", \"终端便利店\", \"状态\", \"赠送时间\", \"使用时间\");\n $cols = 7;\n\n $contentList = $this->coupon_model->getItems($searchData);\n $footer = (count($contentList) == 0 || !isset($contentList)) ? $footer = \"没有优惠券.\" : '';\n break; // get top1\n }\n\n // end get\n $ret['header'] = $this->output_header($header);\n $ret['content'] = $this->output_content($contentList, $id);\n $ret['footer'] = $this->output_footer($footer, $cols);\n $ret['status'] = 'success';\n }\n echo json_encode($ret);\n }\n }",
"public function index()\n {\n //check if cache is set or not ($key,$seperator,$current_page,$no_pagination_var,$before_page,$isPagination)\n //CacheExpiration::checkCache('parties',false,0,0,0,false);\n\n // Get parties\n $parties = Cache::rememberForever('parties', function() {\n return Party::orderBy('fullname_el', 'asc')->get();\n });\n \n return $this->apiHelper::returnResource('Party', $parties);\n }",
"function getItems();",
"function getItems();",
"public function getListCategoriesNews() {\n header('Access-Control-Allow-Origin: *');\n header(\"Access-Control-Allow-Credentials: true\");\n header('Content-Type: application/json; charset=utf-8');\n header(\"Access-Control-Allow-Methods: POST, GET, OPTIONS\");\n header('Access-Control-Allow-Headers \"Origin, X-Requested-With, Content-Type, Accept');\n $cat_level = $this->category_model->fetch(\"*\", \"parent_id = 0 AND cat_status = 1 AND cate_type = 2\", \"cat_service, cat_order, cat_id\", \"ASC\");\n\n echo json_encode($cat_level);\n die();\n }",
"public function apiFetch( $limit, $offset );",
"public function what_ever_you_want()\n {\n $sql = \"Make a custom sql query for grabbing your data\";\n return static::custom_list($sql);\n }",
"protected function index()\n {\n \\Additional_Log::debug('【DAILY STORE LIST API】:START');\n\n // 引数取得\n $params = $this->setParams();\n $pattern = $this->params['pattern'];\n $user = \\Model_User::find($this->user_id);\n\n if($user->authority >= USER_AUTHORITY_COMPANY){\n $params['company_id'] = $user->company_id;\n }\n\n if($user->authority >= USER_AUTHORITY_BRAND){\n $params['brand_ids'] = [$user->brand_id];\n }\n\n if($user->authority >= USER_AUTHORITY_SECTION){\n $params['section_id'] = $user->section_id;\n }\n\n if($user->authority >= USER_AUTHORITY_STORE){\n $params['store_ids'] = [$user->store_id];\n }\n // 操作権限チェック\n $user->authority($params);\n\n // クーポン情報取得\n $conditions = \\Model_Daily_Store_Info::makeConditions($params);\n\n $order_condition = array('date' => 'desc');\n\n $results = \\Model_Daily_Store_Info::find('all', array(\n 'where' => $conditions,\n 'order_by' => $order_condition,\n ));\n\n $response = [];\n foreach ($results as $dailystore) {\n $rec = $dailystore->toArray($pattern);\n unset($rec['company']);\n unset($rec['brand']);\n unset($rec['store']);\n\n if (PATTERN_ONLY_KEY < $pattern) {\n $rec['company_name'] = isset($dailystore->company) ? $dailystore->company->company_name : null;\n $rec['brand_name'] = isset($dailystore->brand) ? $dailystore->brand->brand_name : null;\n $rec['store_name'] = isset($dailystore->store) ? $dailystore->store->store_name : null;\n }\n $response[] = $rec;\n }\n\n\n $this->response_fields['daily_store_info'] = $response;\n\n \\Additional_Log::debug('【DAILY STORE API】:END');\n }",
"public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }",
"public function listsGenericget()\r\n {\r\n $response = Generic::all();\r\n return response()->json($response,200);\r\n }",
"public function _get_data($p_catd_list_id = null, $p_obj_id = null, $p_condition = \"\", $p_filter = null, $p_status = null)\n {\n $l_sql = \"SELECT isys_catg_drive_list.*, isys_obj.*, isys_stor_raid_level.*, isys_filesystem_type.*, isys_memory_unit.*, isys_catd_drive_type.* \" .\n \"isys_catg_stor_list.*, isys_catg_raid_list.*, isys_catg_ldevclient_list.*, \".\n \"FROM isys_catg_drive_list \" .\n \"LEFT OUTER JOIN isys_obj ON isys_catg_drive_list__isys_obj__id = isys_obj__id \" .\n \"LEFT OUTER JOIN isys_stor_raid_level ON isys_stor_raid_level__id = isys_catg_drive_list__isys_stor_raid_level__id \" .\n \"LEFT JOIN isys_filesystem_type ON isys_filesystem_type__id = isys_catg_drive_list__isys_filesystem_type__id \" .\n \"LEFT JOIN isys_memory_unit ON isys_memory_unit__id = isys_catg_drive_list__isys_memory_unit__id \" .\n\n \"LEFT JOIN isys_catd_drive_type ON isys_catd_drive_type__id = isys_catg_drive_list__isys_catd_drive_type__id \" .\n \"LEFT JOIN isys_catg_stor_list ON isys_catg_stor_list__id = isys_catg_drive_list__isys_catg_stor_list__id \" .\n \"LEFT JOIN isys_catg_raid_list ON isys_catg_raid_list__id = isys_catg_drive_list__isys_catg_raid_list__id \" .\n \"LEFT JOIN isys_catg_ldevclient_list ON isys_catg_ldevclient_list__id = isys_catg_drive_list__isys_catg_ldevclient_list__id \" .\n 'WHERE TRUE ' . $p_condition . $this->prepare_filter(\n $p_filter\n ) . ' ';\n\n if ($p_catd_list_id !== null)\n {\n $l_sql .= \" AND isys_catg_drive_list__id = \" . $this->convert_sql_id($p_catd_list_id);\n } // if\n\n if ($p_obj_id !== null)\n {\n $l_sql .= $this->get_object_condition($p_obj_id);\n } // if\n\n if ($p_status !== null)\n {\n $l_sql .= \" AND isys_catg_drive_list__status = \" . $this->convert_sql_id($p_status);\n } // if\n\n return $this->retrieve($l_sql . ';');\n }",
"public function lists(): InstantMessageResponse;",
"function consultarCitas($idEspecie) { // consulta la lista de citas bibliográficas por $idEspecie\n\t// se busca en la tabla principal referencias\n\t$listaCitas = \"\";\n\t$query = \"SELECT citas_bibliograficas \n\t\t\t\t\t FROM especies \n\t\t\t\t\t WHERE id= $idEspecie\"; \n\t$res = ejecutarQuerySQL($query);\t\n\t$total = getNumFilas($res);\n\t\t\n\tif ($total == 0)\n\t $citas = \"No hay referencias registradas para esta especie.\";\n\telse {\t\t\t\t\n\t\t\t$actual = getFila($res);\n\t\t\t$listaCitas = $actual['citas_bibliograficas'];\n\t}\t\t\n\treturn $listaCitas;\n}",
"public function getCategories(){\n\t\t// preapres the request\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: ' . TOKEN));\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/category/\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t// send the request\n\t\t$output = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\n\t\t// decode the answer into a php object\n\t\t$categories = json_decode($output, true);\n\n\t\treturn $categories;\n\t}",
"public function getSimpleList($ids=''){\n\n\n }",
"public function getDataList(){\n return $this->_get(1);\n }",
"public function sendGetAll()\n {\n\n $ch = curl_init(\"http://localhost/apirest/inmuebles\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n $response = curl_exec($ch);\n curl_close($ch);\n\n if(!$response) \n {\n return false;\n }\n else\n {\n return $response;\n }\n\n }",
"public function dayList()\n\t{\n\t\techo json_encode($this->sched_day->fetchData());\n\t}",
"public function getIC($id, $tablename){\n if($tablename == \"users\"){\n $queryString = \"matric_no\";\n }\n else if($tablename == \"staff\"){\n $queryString = \"staff_id\";\n }\n $con = new data();\n $sql = \"SELECT ic FROM \" .$tablename. \" WHERE \" .$queryString. \"= '$id'\";\n $statement = $con->query($sql);\n if($statement){\n if($rs = $statement->fetch()){\n $ic = $rs['ic'];\n }\n }\n return $ic;\n }",
"public function fetchLiveContacts($dt, $lid)\n\t\t\t{\n\t\t\t\t$uri = \"https://livecontacts.services.live.com/@C@$lid/REST/LiveContacts/contacts\";\n\t\t\t\t// Add the token to the header\n\t\t\t\t$headers = array\n\t\t\t\t(\n\t\t\t\t\"Authorization: DelegatedToken dt=\\\"$dt\\\"\"\n\t\t\t\t//\"Authorization: DelegationToken dt=\\\"$dt\\\"\"\n\t\t\t\t);\n\n\t\t\t\t// I use cURL (www.php.net/curl) to get the information\n\t\t\t\t// Let's set up the request\n\t\t\t\t$curl = curl_init();\n\t\t\t\tcurl_setopt($curl, CURLOPT_URL, $uri);\n\t\t\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\t\t\t\tcurl_setopt($curl, CURLOPT_TIMEOUT, 60);\n\t\t\t\t#\tcurl_setopt($curl, CURLOPT_HEADER, true);\n\t\t\t\tcurl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n\t\t\t\tcurl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\t\t\tcurl_setopt($curl, CURLOPT_USERAGENT, \"Uzdc - Product - Live API Integration\");\n\n\t\t\t\t// Ready? Set? GO!\n\t\t\t\t$data = curl_exec($curl);\n\n\t\t\t\t// Get the info and close the connection\n\t\t\t\t$curlinfo = curl_getinfo($curl);\n\t\t\t\tcurl_close($curl);\n\t\t\t\t// Have any errors occured? If so, print them.\n\t\t\t\tif($curlinfo[\"http_code\"] == \"401\")\n\t\t\t\t\t{\n\t\t\t\t\t\techo \"<h2>The remote server refused the DT. Is it correct?</h2>\";\n\t\t\t\t\t\techo \"<h3>Sometimes this error may occur. If you're sure everything is correct, try again.</h3>\";\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\tif($curlinfo[\"http_code\"] == \"403\")\n\t\t\t\t\t{\n\t\t\t\t\t\techo \"<h2>The remote server refused to give you this information. Are you sure you have selected the mode belonging to the requested offer (i.e. Contacts for Contacts.View)</h2>\";\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\tif($curlinfo[\"http_code\"] == \"404\")\n\t\t\t\t\t{\n\t\t\t\t\t\techo \"<h2>Woops... looks like you're trying to request something that isn't there. Are you sure the CID and LID are ok?</h2>\";\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t// If the code reaches this point, everything went well.\n\t\t\t\treturn $data;\n\t\t\t}",
"public function client_list()\n {\n return ClientList::latest()->paginate(10);\n }",
"function get_internship_detail($id) {\n $conn = db_connect();\n $sql = \"SELECT DISTINCT *\n FROM internship_detail\n WHERE InternshipId = $id\n LIMIT 1;\";\n $result = mysqli_query($conn, $sql);\n while ($row = $result->fetch_assoc()) {\n $output[] = $row;\n }\n //clean-up result set and connection\n mysqli_free_result($result);\n mysqli_close($conn);\n\n return $output;\n}",
"public function getResources($icid) {\n $result = $this->connector->run(\"MATCH (:Identity {id: '{$icid}'})-[:RRELATION]->(r:Resource)\n return r.id as id, r.title as title, r.href as href order by r.title\");\n $resources = [];\n\n foreach ($result->getRecords() as $record) {\n $id = $record->get('id');\n $title = $record->get('title');\n $href = $record->get('href');\n $resources[] = [\"id\" => $id, \"title\" => $title, \"href\" => $href];\n }\n return $resources;\n }",
"public function index()\n {\n return CompanyResource::collection(Company::orderBy('id','desc')->paginate(10));\n }",
"function fetchList($limit, $offset);",
"function fsf_port_getImageCategoriesNoLinks($fsf_port_image_id)\n { \n // Initialize Variables\n $fsf_port_getImageCategoriesNoLinks_output = \"\";\n\n global $fsfcms_api_url; \n\n $fsf_api_file = \"fsf.port.getImageCategories.php\";\n $fsf_api_options = \"\";\n\n if($fsf_port_image_id !=\"\")\n {\n $fsf_api_options = \"?image_id=\" . $fsf_port_image_id;\n } else {\n $fsf_api_options = \"\";\n }\n\n $fsf_port_getImageCategoriesNoLinks_json = fsf_preacher_curl($fsfcms_api_url, $fsf_api_file, $fsf_api_options);\n $fsf_port_getImageCategoriesNoLinks_categories = json_decode($fsf_port_getImageCategoriesNoLinks_json, true);\n return $fsf_port_getImageCategoriesNoLinks_categories;\n }",
"function listarCitasDisponibles()\n\t\t{\n\t\t\t$dia = $this->uri->segment(3);\n\t\t\t$mes = $this->uri->segment(4);\n\t\t\t$year = $this->uri->segment(5);\n\t\t\t$diaDeLaSemana = date('N',mktime(0, 0, 0, $mes, $dia, $year));\n\t\t\t\n\t\t\t//Obetenemos los arrays de horarios del dia de la semana concreto\n\t\t\t$diasSemana = $this->PacienteModel->getCalendario();\n\t\t\tforeach ($diasSemana as $value) {\n\t\t\t\tif($diaDeLaSemana == $value->Dia)\n\t\t\t\t{\n\t\t\t\t\t$horaInicio = explode(':', $value->HoraInicio);\n\t\t\t\t\t$horaFin = explode(':', $value->HoraFin);\n\t\t\t\t\t$duracionCita[] = $value->DuracionCita;\n\t\t\t\t\t$unixInicio[] = mktime($horaInicio[0], $horaInicio[1], 0, $mes, $dia, $year);\n\t\t\t\t\t$unixFin[] = mktime($horaFin[0], $horaFin[1], 0, $mes, $dia, $year);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Comprobamos las citas planificadas para el dia concreto\n\t\t\t$data = $this->PacienteModel->getCitasDisponibles($dia, $mes, $year);\n\t\t\tforeach ($data as $value) {\n\t\t\t\t$aux = explode(\" \", $value->FechaIni);\n\t\t\t\t$aux = $aux[1];\n\t\t\t\t$aux = explode(\":\", $aux);\n\t\t\t\t$hora[] = $aux[0];\n\t\t\t\t$min[] = $aux[1];\n\t\t\t}\n\t\t\t\n\t\t\t//Si no hay ninguna cita se ponen los arrays fuera de rango\n\t\t\tif(!isset($hora) && !isset($min))\n\t\t\t{\n\t\t\t\t$hora[0] = -1;\n\t\t\t\t$min[0] = -1;\n\t\t\t}\n\n\t\t\t//Visualizamos las citas disponibles\n\t\t\techo '<ul class=\"list-group\">';\n\t\t\techo '<li class=\"list-group-item\">'.date('d-m-Y',mktime(0, 0, 0, $mes, $dia, $year)).'</li>';\n\t\t\tfor($j = 0; $j < sizeof($unixInicio); $j++)\n\t\t\t\tfor($i = $unixInicio[$j]; $i < $unixFin[$j]; $i += 60*$duracionCita[$j] )\n\t\t\t\t{\n\t\t\t\t\tif ( (in_array(date('H',$i), $hora) && in_array(date('i',$i), $min) )\n\t\t\t\t\t\t|| time()>$i )\n\t\t\t\t\t\techo '<li class=\"list-group-item\">'.date('H:i',$i).'</li>';\n\t\t\t\t\telse \n\t\t\t\t\t\techo '<li class=\"list-group-item active\">\n\t\t\t\t\t\t\t<a style=\"color: black;\" onclick=\"crearCita(\\''.$this->session->userdata('id').'\\',\n\t\t\t\t\t\t\t\\''.date('Y-m-d H:i:s',$i).'\\',\n\t\t\t\t\t\t\t\\''.date('Y-m-d H:i:s',$i + 60 * $duracionCita[$j]).'\\'\n\t\t\t\t\t\t\t)\">'.date('H:i',$i).'</a></li>';\n\t\t\t\t}\n\t\t\techo '</ul>';\n\t\t}",
"public function list();"
] | [
"0.65940005",
"0.64212835",
"0.63953865",
"0.63163364",
"0.5975971",
"0.5954507",
"0.59537786",
"0.59518224",
"0.5885682",
"0.5865774",
"0.58424383",
"0.57952327",
"0.57815063",
"0.57774264",
"0.57744956",
"0.57541424",
"0.57401234",
"0.57002795",
"0.5680309",
"0.56777096",
"0.5671012",
"0.5660841",
"0.5659096",
"0.5654576",
"0.5654576",
"0.5648201",
"0.5639684",
"0.56326497",
"0.56276554",
"0.5618978",
"0.561498",
"0.5610236",
"0.56023467",
"0.5593019",
"0.55865794",
"0.557156",
"0.55651146",
"0.55557233",
"0.55427676",
"0.5542462",
"0.55414414",
"0.55394316",
"0.55383545",
"0.5538161",
"0.55346715",
"0.5527323",
"0.5527309",
"0.5524134",
"0.5523751",
"0.5520866",
"0.5515541",
"0.55115527",
"0.5508776",
"0.54858917",
"0.5483768",
"0.5470544",
"0.5464045",
"0.54622006",
"0.5460835",
"0.5447104",
"0.54466325",
"0.5444527",
"0.5442805",
"0.5436654",
"0.54284024",
"0.54267883",
"0.5426473",
"0.5420253",
"0.5418448",
"0.54173815",
"0.5412641",
"0.5412406",
"0.5410474",
"0.5409764",
"0.5408642",
"0.5408642",
"0.54035336",
"0.5402861",
"0.5393643",
"0.53908044",
"0.53905594",
"0.53864866",
"0.53859365",
"0.5385229",
"0.5382563",
"0.5382459",
"0.53779423",
"0.5377706",
"0.5373795",
"0.5372329",
"0.53713024",
"0.536365",
"0.53606355",
"0.53603554",
"0.53534424",
"0.53533244",
"0.5350311",
"0.5347649",
"0.53401554",
"0.5339247"
] | 0.747298 | 0 |
/ Description Function is fetch icd list from api Author Dave Brown Created 5 March 2015 | public function get_outcome_list ($outcome_type)
{
$list_outcome_arr = array();
/*Fetching Patient details from third party database via curl request*/
$listouctcome_codes = post_curl_request(THIRD_PARTY_API_URL, json_encode(array(
'action' => 'getoutcomes',
'outcomemaincode' => $outcome_type,
)));
$listouctcome_codes = !empty($listouctcome_codes) ? json_decode($listouctcome_codes) : array();
/*Converting to autocomplete understandable format*/
if (!empty($listouctcome_codes))
{
foreach ($listouctcome_codes as $val)
{
$list_outcome_arr[] = array(
'idoutcomedefinitions' => current($val)->idoutcomedefinitions,
'outcomemaincode' => current($val)->outcomemaincode,
'outcome' => current($val)->outcome,
'outcomestate' => current($val)->outcomestate,
);
}
}
exit(json_encode($list_outcome_arr));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_icd_list ()\n {\n $listicdcodes_arr = array();\n\n if (get_data('term') == NULL)\n {\n return;\n }\n /*Fetching Patient details from third party database via curl request*/\n $listicdcodes = post_curl_request(THIRD_PARTY_API_URL, json_encode(array(\n 'action' => 'listicdcodes',\n 'lookfor' => get_data('term'),\n )));\n\n $listicdcodes = !empty($listicdcodes) ? json_decode($listicdcodes) : array();\n\n /*Converting to autocomplete understandable format*/\n if (!empty($listicdcodes))\n {\n foreach ($listicdcodes as $val)\n {\n $listicdcodes_arr[] = array('id' => current($val)->ICDCode, 'value' => current($val)->ICDTitle);\n }\n }\n exit(json_encode($listicdcodes_arr));\n }",
"public function apiList();",
"public function fetchList();",
"function get_districts($id)\n{\n $url = set_url('disctricts');\n $url .= '?city_id=' . $id;\n $token = $_SESSION['token'];\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer ' . $token,]);\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = curl_exec($cURLConnection);\n curl_close($cURLConnection);\n print_r($apiResponse);\n exit;\n}",
"public function get_all_items_by_api()\n {\n\n $data = array('token' =>'ayaolwan');//'type' => 'fees_category');\n $data_string = json_encode($data);\n $curl = curl_init(base_url() . 'webServices/Itemapi');\n\n curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"GET\");\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($data_string))\n );\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data_string);\n\n $result = json_decode(curl_exec($curl), true);\n curl_close($curl);\n\n if ($result['status'])\n {\n echo json_encode($result['itemsList']);\n }\n\n\n }",
"function getAllModelByID($id, $limit){\n $data = http_build_query([\n 'mark_id' => $id,\n 'limit' => $limit,\n ]);//build query\n $ch = curl_init();//init Curl\n curl_setopt_array($ch, [\n CURLOPT_URL => 'https://apistaging.el-market.org/v1/osago/lists/models/?' . $data,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => [\n 'Accept: application/json',\n 'Authorization: Token Test2019',\n ],\n ]);\n $res=json_decode(curl_exec($ch),true);\n curl_close($ch);\n if (curl_errno($ch)) { echo 'Error:' . curl_error($ch);}\n return $res['results'];\n}",
"function get_categories($id)\n{\n $url = set_url('categories');\n $url .= '/' . $id;\n $token = $_SESSION['token'];\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer ' . $token,]);\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = curl_exec($cURLConnection);\n curl_close($cURLConnection);\n print_r($apiResponse);\n exit;\n}",
"public function fetchCategory(){\n \t$ch = curl_init();\n //getting specific orders after $time\n $encode = $this->urlPath.\"/rest/V1/categories\";\n\t\t\n curl_setopt($ch, CURLOPT_URL, $encode);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n $headers = array();\n $headers[] = 'Authorization: Bearer '.$this->apiKey;\n $headers[] = 'Content-Type: application/json';\n //$headers[] = 'Accept: application/json';\n\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n $result = curl_exec($ch);\n\n curl_close ($ch);\n\n\n\n\n return $result;\n\t\t\t \n }",
"function list(){\n $res = $res = $this->client->request('GET',$this->path,[]);\n $this->checkResponse($res,array(200));\n return $res;\n }",
"function getAllMarks($limit){\n $data = http_build_query([\n 'limit' => $limit,\n ]);//build query\n $ch = curl_init();//init Curl\n curl_setopt_array($ch, [\n CURLOPT_URL => 'https://apistaging.el-market.org/v1/osago/lists/marks/?' . $data,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => [\n 'Accept: application/json',\n 'Authorization: Token Test2019'\n ]\n ]);\n $res=json_decode(curl_exec($ch),true);\n curl_close($ch);\n if (curl_errno($ch)) { echo 'Error:' . curl_error($ch);}\n return $res['results'];\n}",
"function list_get($id) {\n\n //$id = $this->get('id');\n\n if (!$id) {\n\n $this->response(\"No item ID specified!\", 400);\n\n exit;\n }\n\n $list = $this->List_model->getListById($id);\n\n if ($list) {\n\n //$list = $this->appendItems($list);\n //Put owner's name instead of user ID\n //$list['owner'] = $this->User_model->getName($list['owner'])['name'];\n unset($list['owner']);\n\n $this->response($list, 200);\n\n exit;\n } else {\n\n $this->response(\"Invalid ID\", 404);\n\n exit;\n }\n }",
"function display_cars()\n{\n //displays posted cars\n $url = set_url('advert');\n $url .= '?limit=10&page=1';\n $token = $_SESSION['token'];\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer ' . $token,]);\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = json_decode(curl_exec($cURLConnection));\n curl_close($cURLConnection);\n print_r($apiResponse);\n exit;\n}",
"private function _get_info() {\n\n\t\t/* Grab the basic information from the catalog and return it */\n\t\t$sql = \"SELECT * FROM `access_list` WHERE `id`='\" . Dba::escape($this->id) . \"'\";\n\t\t$db_results = Dba::query($sql);\n\n\t\t$results = Dba::fetch_assoc($db_results);\n\n\t\treturn $results;\n\n\t}",
"public function public_ids_get()\n {\n $from = \"0\";\n $size = \"10\";\n $lastModified = NULL;\n \n $temp = $this->input->get('from', TRUE);\n if(!is_null($temp) & is_numeric($temp))\n $from = $temp;\n \n $temp = $this->input->get('size', TRUE);\n if(!is_null($temp) & is_numeric($temp))\n $size = $temp;\n \n $temp = $this->input->get('lastModified', TRUE);\n if(!is_null($temp) & is_numeric($temp))\n $lastModified = intval($temp);\n \n $cutil = new CILServiceUtil();\n $result = $cutil->getAllPublicIds($from, $size,$lastModified);\n $this->response($result);\n \n }",
"function admin_list_clinics($id=NULL)\r\n {\r\n $data['offline_mode']\t\t=\t$this->config->item('offline_mode');\r\n $data['debug_mode']\t\t =\t$this->config->item('debug_mode');\r\n $data['country']\t\t =\t$this->config->item('app_country');\r\n\t\t$data['user_rights'] = $this->mthirra->get_user_rights($_SESSION['username']);\r\n $data['breadcrumbs'] = breadcrumbs('ehr_admin/admin_mgt','Admin'); \r\n $data['sort_order'] \t = $this->uri->segment(3);\r\n\t\t$data['title'] = \"T H I R R A - List of Clinics\";\r\n $data['now_id'] = time();\r\n $data['now_date'] = date(\"Y-m-d\",$data['now_id']);\r\n $data['now_time'] = date(\"H:i\",$data['now_id']);\r\n\t\t$data['clinics_list'] = $this->mthirra->get_clinics_list($data['country'],$data['sort_order']);\r\n\t\t$this->load->vars($data);\r\n\t\tif ($_SESSION['thirra_mode'] == \"ehr_mobile\"){\r\n $new_header = \"ehr/header_xhtml-mobile10\";\r\n $new_banner = \"ehr/banner_ehr_wap\";\r\n $new_sidebar= \"ehr/sidebar_ehr_admin_wap\";\r\n //$new_body = \"ehr/ehr_admin_list_clinics_wap\";\r\n $new_body = \"ehr/ehr_admin_list_clinics_html\";\r\n $new_footer = \"ehr/footer_emr_wap\";\r\n\t\t} else {\r\n //$new_header = \"ehr/header_xhtml1-strict\";\r\n $new_header = \"ehr/header_xhtml1-transitional\";\r\n $new_banner = \"ehr/banner_ehr_html\";\r\n $new_sidebar= \"ehr/sidebar_emr_admin_html\";\r\n $new_body = \"ehr/ehr_admin_list_clinics_html\";\r\n $new_footer = \"ehr/footer_emr_html\";\r\n\t\t}\r\n if($data['user_rights']['section_admin'] < 100){\r\n $new_body = \"ehr/ehr_access_denied_html\";\r\n }\r\n\t\t$this->load->view($new_header);\t\t\t\r\n\t\t$this->load->view($new_banner);\t\t\t\r\n\t\t$this->load->view($new_sidebar);\t\t\t\r\n\t\t$this->load->view($new_body);\t\t\t\r\n\t\t$this->load->view($new_footer);\t\t\r\n\t\t\r\n }",
"public function getAllClinicInfo(){\n $stmt = $this->adapter->conn->prepare(\"SELECT * FROM CLINIC\"); \n $result = null;\n try{\n $result = $this->adapter->executeFetchPrepared($stmt);\n }catch(PDOException $e){\n return null;\n }\n \n return $result;\n }",
"public function listing();",
"public function listsIndicationsget()\r\n {\r\n $response = Indication::all();\r\n return response()->json($response,200);\r\n }",
"public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }",
"function item_list_data($invoice_id = 0) {\n\n $list_data = $this->Sales_InvoicesItems_model->get_details(array(\"fid_invoices\" => $invoice_id))->result();\n $result = array();\n foreach ($list_data as $data) {\n $result[] = $this->_make_item_row($data);\n }\n echo json_encode(array(\"data\" => $result));\n // $this->output->enable_profiler(TRUE);\n // print_r($list_data);\n\n }",
"public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }",
"function get_cities()\n{\n $url = set_url('cities');\n $token = $_SESSION['token'];\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer ' . $token,]);\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = curl_exec($cURLConnection);\n curl_close($cURLConnection);\n print_r($apiResponse);\n exit;\n}",
"public function Company_Info_List(){\n /*\n $user = session('USER_ID'); // 获取已登录用户\n */\n // $user = 'c4b19072a79e4a6e81f06761f1e6bd2b';\n // $where = array('USER_ID' => $user);\n // if(!empty($keywords)){\n // $where['COMPANY_NAME'] = array('like',\"%$keywords%\");\n // }\n // if (!empty($start_date)) {\n // $where['CREATE_TIME'] = array('gt',$start_date);\n // }\n // if (!empty($end_date)) {\n // $where['CREATE_TIME'] = array('lt',$end_date);\n // }\n // $count = M('a_sys_user_attr_company_info')\n // -> where($where)\n // -> count();\n\n // $Page = new \\Think\\Page($count, $pagenum);// 实例化分页类 传入总记录数和每页显示的记录数($pagenum)\n\n // $show = $Page->show();// 分页显示输出\n\n // $list = M('a_sys_user_attr_company_info as info') // 查询公司信息表\n \t\t// -> field('COMPANYINFO_ID,COMPANY_NAME,CERT,COMPANY_AUTHENTICATION,SERVICE_LEVEL,COMPANY_NUM') // 需求字段\n \t\t// -> join('a_service_level as level on info.SERVICE_ID = level.SERVICE_ID') // 两表联查\n // ->limit($Page->firstRow.','.$Page->listRows) // 分页查询\n \t\t// -> where($where) \t\t// 查询条件\n \t\t// -> select();\n\n // // var_dump($list);die;\n \n // $this -> assign('show' , $show);\n // $this -> assign('list' , $list);\n $this -> display('list');\n }",
"public function getList();",
"public function getList();",
"protected abstract function fetchLists();",
"abstract public function getList();",
"function getList($issue_id)\n {\n $issue_id = Misc::escapeInteger($issue_id);\n $usr_id = Auth::getUserID();\n $prj_id = Issue::getProjectID($issue_id);\n\n $stmt = \"SELECT\n iat_id,\n iat_usr_id,\n usr_full_name,\n iat_created_date,\n iat_description,\n iat_unknown_user,\n iat_status\n FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"issue_attachment,\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"user\n WHERE\n iat_iss_id=$issue_id AND\n iat_usr_id=usr_id\";\n if (User::getRoleByUser($usr_id, $prj_id) <= User::getRoleID('Customer')) {\n $stmt .= \" AND iat_status='public' \";\n }\n $stmt .= \"\n ORDER BY\n iat_created_date ASC\";\n $res = DB_Helper::getInstance()->getAll($stmt, DB_FETCHMODE_ASSOC);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return \"\";\n }\n\n foreach ($res as &$row) {\n $row[\"iat_description\"] = Link_Filter::processText(Issue::getProjectID($issue_id), nl2br(htmlspecialchars($row[\"iat_description\"])));\n $row[\"files\"] = self::getFileList($row[\"iat_id\"]);\n $row[\"iat_created_date\"] = Date_Helper::getFormattedDate($row[\"iat_created_date\"]);\n\n // if there is an unknown user, user that instead of the user_full_name\n if (!empty($row[\"iat_unknown_user\"])) {\n $row[\"usr_full_name\"] = $row[\"iat_unknown_user\"];\n }\n }\n return $res;\n }",
"public function list_get(){\n $data['list'] = $this->group->list();\n $this->response($data);\n }",
"public function get_all ();",
"function FetchIT()\n {\n $sql=\"SELECT * FROM INVT_T_INSP_HEAD\";\n return $this->db->query($sql, $return_object = TRUE)->result_array(); \n }",
"public static function fetch_all_in_a_list()\n\t{\n\t return Company::orderBy( 'name' )->lists( 'name' , 'id' );\n\n\t}",
"public function list_get()\n\t{\n\t\ttry{\n\n\t\t\t$this->checkCanCandidateId();\n\t\t\t$filters = array(\n\t\t\t\t\"{$this->_candidateIdFkKey}\" =>$this->getCanCandidateId()\n\t\t\t);\n\t\t\t$list = $this->_model->getBy($filters);\n\t\t\t$this->response($list);\n\t\t}catch( Exception $e ){\n\t\t\t$message = $e->getMessage();\n\t\t\t$code = $e->getCode();\n\t\t\t$this->error_response($message,$code);\n\t\t}\n\n\t}",
"public function loadList() {\n\t\t/*Query database for names and id*/\n\t\t$CI =& get_instance(); \n\t\t$query = $CI->db->query(\"SELECT Firstname, Lastname, employeeID, Username, Password, Instructor, Lifeguard, Headguard, Supervisor FROM `Employees` \");\n\t\t$list = $query->result_array();\t\t//TODO: Add Extra Sequerity here..\t\t\t\t\n\t\techo json_encode($list );\t\t\n\t}",
"function getAllCustomers() {\n\t// Get cURL resource\n\t$curl = curl_init();\n\t// Set some options - we are passing in a useragent too here\n\tcurl_setopt_array($curl, array(\n\t CURLOPT_RETURNTRANSFER => 1,\n\t CURLOPT_URL => 'https://hackathon-be.mybluemix.net/customers',\n\t CURLOPT_USERAGENT => 'BankBase BOC Hackathon Request'\n\t));\n\t// Send the request & save response to $resp\n\t$resp = curl_exec($curl);\n\t// Close request to clear up some resources\n\tcurl_close($curl);\n\n\t$resp_decode = json_decode($resp);\n\techo \"<pre>\";\n\tprint_r($resp_decode);\n\techo \"</pre>\";\n}",
"public function cardList()\n {\n // $pageIndex = 0;\n // $pageSize = 20;\n $pageIndex = I('get.pageIndex');\n $pageSize = I('get.pageSize');\n $where = I('get.where');\n $orderBy = I('get.orderBy');\n\n $where = htmlspecialchars_decode($where);\n\n $data = array(\n \"userAccount\" => self::USERACCOUNT,\n \"pageIndex\" => $pageIndex,\n \"pageSize\" => $pageSize,\n \"where\" => $where,\n \"orderBy\" => $orderBy,\n );\n $response_data = $this->client->CallHttpPost(\"Get_MembersPagedV2\", $data);\n $this->ajaxReturn($response_data);\n }",
"public function getIdList() {\n migrate_instrument_start(\"Retrieve $this->listUrl\");\n if (empty($this->httpOptions)) {\n $json = file_get_contents($this->listUrl);\n }\n else {\n $response = drupal_http_request($this->listUrl, $this->httpOptions);\n $json = $response->data;\n }\n migrate_instrument_stop(\"Retrieve $this->listUrl\");\n if ($json) {\n $data = drupal_json_decode($json);\n if ($data) {\n return $this->getIDsFromJSON($data);\n }\n }\n Migration::displayMessage(t('Loading of !listurl failed:',\n array('!listurl' => $this->listUrl)));\n return NULL;\n }",
"public function alldiseaseinfo()\r\r\n {\r\r\n return response()->json(\r\r\n Disease::wheredmuse(0)->select('id','diseasename')->get()\r\r\n );\r\r\n }",
"public function index()\n {\n //\n $estadociviles = DB::table('estado_civil')->select('id_estado_civil', 'estado_civil_descripcion')->orderBy('id_estado_civil')->get(); \n return response()->json($estadociviles);\n }",
"public function actionLists()\n {\n\n $headers = apache_request_headers();\n $User = CustomerApiKey::model()->findUserByPublicKey($headers['X_MW_PUBLIC_KEY']);\n\n $this->user_id = $User->customer_id;\n\n if($User->private!=$headers['X_MW_PRIVATE_KEY'])\n {\n return $this->renderJson(array(\n 'status' => 'error',\n 'error' => Yii::t('api','A private API Key is required.')\n ),400);\n }\n\n if(empty($User->public))\n {\n return $this->renderJson(array(\n 'status' => 'error',\n 'error' => Yii::t('api','A public API Key is required.')\n ),400);\n }\n $lists = array(\"lists\" => Lists::model()->getCustomerListsZapier($this->user_id));\n\n Logger::addProgress('(Zapier) ActionLists '.print_r($lists,true),'(Zapier) ActionLists');\n\n return $this->renderJson($lists,200);\n\n }",
"public static function getArticles()\n {\n // $url = \"https://n161.tech/api/dummyapi/post?page=1&limit=100\";\n // $curl = curl_init();\n // curl_setopt($curl, CURLOPT_URL, $url);\n // curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n // curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);\n // curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n // $response = curl_exec($curl);\n // $array_data = json_decode($response, true);\n // curl_close($curl);\n // return $array_data;\n return Article::orderBy('updated_at', 'desc')->paginate(5);\n }",
"public function getList()\n {\n }",
"function FetchIndividualContent($i, $sid)\r\n{ \r\n\tglobal $connect;\r\n\t$crud = new Crud($connect);\r\n\r\n\tswitch ($i) {\r\n\r\n\t\t//fetch specific user's details for everybody - Used\r\n\t\tcase 2:\r\n\r\n\t\t\t$data = $crud->select(\"users\",\"*\",\" ID = '$sid' \");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\r\n\t\t//fetch specific event for editing - Used\r\n\t\tcase 3:\r\n\r\n\t\t\t$data = $crud->select(\"event\",\"*\",\" ID = '$sid' \");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\r\n\t\t//fetch specific from blog - Used\r\n\t\tcase 4:\r\n\r\n\t\t\t$data = $crud->select(\"broadcast\",\"*\",\" ID = '$sid' \");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\r\n\t\t//fetch specific user's details for everybody - Used\r\n\t\tcase 6:\r\n\r\n\t\t\t$data = $crud->select(\"admin\",\"*\",\" UID = '$sid' \");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\r\n\t\t\t//count all specific comment in blog - used\r\n\t\tcase 7:\r\n\t\t\t$data = $crud->select(\"blog_com\",\r\n\t\t\t\t\t\t\t\t\"COUNT(ComID) as Total \",\r\n\t\t\t\t\t\t\t\t\"BlogID = '$sid' \",\r\n\t\t\t\t\t\t\t\t\"\");\r\n\t\t\treturn $data[0][\"Total\"];\r\n\t\t\tbreak;\r\n\r\n\t\t//fetch specific guests message - Used\r\n\t\tcase 8:\r\n\r\n\t\t\t$data = $crud->select(\"guest\",\"*\",\" ID = '$sid' \");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\t\t\t\t\t\r\n\r\n\t\t//fetch specific music for editing - Used\r\n\t\tcase 16:\r\n\r\n\t\t\t$data = $crud->select(\"advert\",\"*\",\" ID = '$sid' \");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\r\n\t\t//fetch specific guests message - Used\r\n\t\tcase 17:\r\n\r\n\t\t\t$data = $crud->select(\"audit_log\",\"*\",\" UserID = '$sid' \");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\r\n\t\t//fetch all rows where UserID = 0, same with all with IPAddress\r\n\t\tcase 18:\r\n\r\n\t\t\t$data = $crud->select(\"audit_log\",\"*\",\" UserID = 0 \");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\r\n\t\t//fetch all rows where UserID = 0, same with all with IPAddress\r\n\t\tcase 19:\r\n\r\n\t\t\t$data = $crud->select(\"profile\",\"*\",\" UID = '$sid' \");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\r\n\t\t//fetch all jobs from job where ID = $sid\r\n\t\tcase 20:\r\n\r\n\t\t\t$data = $crud->select(\"job\",\"*\",\" ID = '$sid' \");\r\n\t\t\treturn $data;\r\n\t\t\tbreak;\r\n\r\n\r\n\r\n\t\tdefault:\r\n\t\t\t# code...\r\n\t\t\tbreak;\r\n\t}\r\n}",
"public function find_officer()\n { \n $query = get_post('q');\n $where = 'deletedAt IS NULL' .\n 'AND (MabuhayID LIKE \"' . $query . '%\" OR CONCAT(FirstName, \" \", LastName) LIKE \"' . $query . '%\")' .\n 'AND AccountTypeID IN(2,3)';\n $users = $this->mgovdb->getRecords('UserAccountInformation', $where);\n $items = array();\n foreach ($users as $user) {\n $items[] = array(\n 'id' => $user['id'],\n 'firstname' => $user['FirstName'],\n 'lastname' => $user['LastName'],\n 'fullname' => $user['FirstName'] . ' ' . $user['LastName'],\n 'mabuhayID' => $user['MabuhayID'],\n 'email' => $user['EmailAddress'],\n 'contact' => $user['ContactNumber'],\n 'gender' => lookup('gender', $user['GenderID']),\n 'address' => array_values(array_reverse(lookup_address($user))),\n 'photo' => photo_filename($user['Photo']),\n 'actype' => lookup('account_type', $user['AccountTypeID']),\n 'aclevel' => lookup_db('UserAccountLevel', 'LevelName', $user['AccountLevelID'])\n );\n }\n response_json($items);\n }",
"function cwrc_get_authorities_list($setup_data, $query) {\n $collection = $setup_data['collection'];\n $query_string = 'collection:\"' . $collection . '\"';\n // $records = emic_process_query($query_string);\n $terms = explode(' ', $query);\n $terms = array_filter($terms);\n $solr = variable_get('islandora_solr_search_block_url', 'http://localhost:8080/solr');\n\n $url = \"http://$solr/select?indent=on&version=2.2&q=$query_string&fq=&start=0&rows=1000&qt=standard&wt=json&explainOther=&hl.fl=\";\n $results = json_decode(file_get_contents($url), TRUE);\n $docs = $results['response']['docs'];\n foreach ($docs as $doc) {\n $pid = $doc['PID'];\n $contents = array();\n foreach ($doc['emic.searchname'] as $sample) {\n $identifier = null;\n if (!empty($sample) & !$identifier) {\n $identifier = $sample;\n }\n }\n //$identifier = implode('', $doc['emic.searchname']);\n $contents['identifier'] = $identifier;\n $contents['Object'] = \"<a href='/fedora/repository/$pid' target='_blank'>$pid</a>\";\n $contents['Note'] = $doc['dc.description'][0];\n $records[$doc['PID']] = $contents;\n }\n\n while (count($terms) > 0) {\n $term = array_shift($terms) . \"*\";\n $query_string = 'collection:\"' . $collection . '\" AND emic.searchname:' . strtolower($term);\n\n $new_records = emic_process_query($query_string);\n if (is_array($new_records) && is_array($records)) {\n $records = array_intersect_key($records, $new_records);\n }\n }\n if (is_array($records)) {\n return array_values($records);\n }\n}",
"public function obat_get()\n\t{\n\t\t$data = $this->Obat->getAllObat();\n\t\tif ($data) {\n\t\t\t$this->response($data,200);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->response([\n\t\t\t\t'error'=>false,\n\t\t\t\t'message'=>'Obat kosong'\n\t\t\t],200);\n\t\t}\n\t}",
"function cariICD()\n\t{\n\t\tif ($this->input->get() != NULL) {\n\t\t\t$dataForm = $this->input->get();\n\t\t\t$dataReturn = $this->Kesehatan_M->orLike('icd10',array('Diagnosa'=>$dataForm['term']['term'],'Diskripsi'=>$dataForm['term']['term']))->result();\n\t\t\t$data = array();\n\t\t\tforeach ($dataReturn as $key => $value) {\n\t\t\t\t$data[$key]['id'] = $value->Kode_ICD. \" / \".$value->Diskripsi;\n\t\t\t\t$data[$key]['text'] = $value->Kode_ICD.\" / \".$value->Diskripsi;\n\t\t\t}\n\t\t\techo json_encode($data);\n\t\t}else{\n\t\t\tredirect(base_url());\n\t\t}\n\t}",
"private function requestAnimeList () {\n\t\t$curl = curl_init ();\n\t\t\n\t\tcurl_setopt ($curl, CURLOPT_URL, $this->api_url);\n\t\tcurl_setopt ($curl, CURLOPT_RETURNTRANSFER, true);\n\t\t\n\t\t$response = curl_exec ($curl);\n\t\t\n\t\tcurl_close($curl);\n\t\t\n\t\treturn ($response);\n\t}",
"public function allrecord_get() { \n $result = $this->Api_model->selectData('info', 'id, name, email');\n if($result == null)\n $this->set_response(array('response_code'=>400,'response_message'=>'No Data Found','response_data'=>array()), REST_Controller::HTTP_OK);\n else\n $this->set_response(array('response_code'=>200,'response_message'=>'Success','response_data'=>$result), REST_Controller::HTTP_OK);\n }",
"function cpatient_detail_list() {\n\t\tglobal $conn;\n\n\t\t// Initialize table object\n\t\t$GLOBALS[\"patient_detail\"] = new cpatient_detail();\n\n\t\t// Intialize page id (for backward compatibility)\n\t\tif (!defined(\"EW_PAGE_ID\"))\n\t\t\tdefine(\"EW_PAGE_ID\", 'list', TRUE);\n\n\t\t// Initialize table name (for backward compatibility)\n\t\tif (!defined(\"EW_TABLE_NAME\"))\n\t\t\tdefine(\"EW_TABLE_NAME\", 'patient_detail', TRUE);\n\n\t\t// Open connection to the database\n\t\t$conn = ew_Connect();\n\n\t\t// Initialize list options\n\t\t$this->ListOptions = new cListOptions();\n\t}",
"public function getList()\n\t{\n\t\treturn $this->crud->orderby('id DESC')\n\t\t\t\t\t->read(10)\n\t\t;\t\n\t}",
"public function Enumerate()\r\n {\r\n $query = \"select a.*, b.name as subsector, c.name as sector from actividad_comercial a \r\n inner join subsector b on a.subsector_id = b.id \r\n inner join sector c on b.sector_id = c.id order by a.name asc, b.name asc, c.name asc $sql_add\";\r\n $this->Util()->DB()->setQuery($query);\r\n $result = $this->Util()->DB()->GetResult();\r\n $data[\"items\"] = $result;\r\n // $data[\"pages\"] = $pages;\r\n return $data;\r\n }",
"public function getEntriesList(){\n return $this->_get(2);\n }",
"public function HCInstituteListData()\n {\n\t\t$sql=\"SELECT \n\t\t\t\tHID.INSTITUTE_NAME INSTITUTE_NAME,\n\t\t\t\tHID.RANKING RANKING,\n\t\t\t\tHIAD.ADDRESS_LINE1 ADDRESS_LINE1,\n\t\t\t\tHIAD.ADDRESS_LINE2 ADDRESS_LINE2,\n\t\t\t\tHIAD.PIN_CODE PIN_CODE,\n\t\t\t\tHCM.CITY_NAME CITY_NAME\n\t\t\t\tFROM \n\t\t\t\tTEST.INSTITUTE_DTL HID\n\t\t\t\tLEFT JOIN TEST.INSTITUTE_ADDRESS_DTL HIAD\n\t\t\t\tON HIAD.INSTITUTE_DTL__ID = HID.ID\n\t\t\t\tLEFT JOIN TEST.CITY_MST HCM\n\t\t\t\tON HCM.ID=HIAD.CITY_MST__ID\n\t\t\t\";\n\t\t$this->vResult = mysqli_query($this->vDbConn,$sql);\n\n\t\twhile($this->vRow = mysqli_fetch_assoc($this->vResult)){\n\t\t\t$this->vCHCInstituteListStructObj->vInstituteList[]\t=\t$this->vRow;\t\t\n\t\t}\n\t\t\n\t\t\n\n return ;\n }",
"function ciniki_artcatalog_categoryList($ciniki) {\n // \n // Find all the required and optional arguments\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n )); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n $args = $rc['args'];\n \n // \n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n // \n ciniki_core_loadMethod($ciniki, 'ciniki', 'artcatalog', 'private', 'checkAccess');\n $rc = ciniki_artcatalog_checkAccess($ciniki, $args['tnid'], 'ciniki.artcatalog.categoryList'); \n if( $rc['stat'] != 'ok' ) { \n return $rc;\n } \n\n //\n // Load the status maps for the text description of each status\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'artcatalog', 'private', 'maps');\n $rc = ciniki_artcatalog_maps($ciniki);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $maps = $rc['maps'];\n\n //\n // Get the settings for the artcatalog\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbQuote');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbDetailsQueryDash'); \n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryTree');\n $rc = ciniki_core_dbDetailsQueryDash($ciniki, 'ciniki_web_settings', \n 'tnid', $args['tnid'], 'ciniki.web', 'settings', 'page-gallery-artcatalog');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['settings']) ) {\n $settings = $rc['settings'];\n } else {\n $settings = array();\n }\n\n if( isset($settings['page-gallery-artcatalog-split']) \n && $settings['page-gallery-artcatalog-split'] == 'yes' \n ) {\n $strsql = \"SELECT DISTINCT type, type AS name, category \"\n . \"FROM ciniki_artcatalog \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"ORDER BY type, category COLLATE latin1_general_cs, category \"\n . \"\";\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.artcatalog', array(\n array('container'=>'types', 'fname'=>'type', 'name'=>'type',\n 'fields'=>array('number'=>'type', 'name'),\n 'maps'=>array('name'=>$maps['item']['type'])),\n// 'maps'=>array('name'=>array('1'=>'Paintings', '2'=>'Photographs', '3'=>'Jewelry', '4'=>'Sculptures', '5'=>'Fibre Arts', '6'=>'Crafts', '8'=>'Pottery'))),\n array('container'=>'categories', 'fname'=>'category', 'name'=>'category',\n 'fields'=>array('type', 'name'=>'category')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['types']) ) {\n return array('stat'=>'ok', 'types'=>array());\n }\n return array('stat'=>'ok', 'types'=>$rc['types']);\n } else {\n $strsql = \"SELECT DISTINCT '0' AS type, category \"\n . \"FROM ciniki_artcatalog \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"ORDER BY category COLLATE latin1_general_cs, category \"\n . \"\";\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.artcatalog', array(\n array('container'=>'categories', 'fname'=>'category', 'name'=>'category',\n 'fields'=>array('type', 'name'=>'category')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['categories']) ) {\n return array('stat'=>'ok', 'categories'=>array());\n }\n return array('stat'=>'ok', 'categories'=>$rc['categories']);\n }\n}",
"function item_listing()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $ret = array(\n 'content' => '',\n 'status' => 'fail'\n );\n if (!empty($_POST)) {\n $id = $_POST['id'];\n $searchData = $_POST['searchData'];\n $searchData['kind'] = 1;\n $searchData['login_user'] = $this->login_id;\n\n switch ($id) {\n case 1:\n $header = array(\"序号\", \"账号\", \"姓名\", \"角色\", \"新增时间\", \"操作\");\n $cols = 6;\n\n $contentList = $this->user_model->getItems($searchData);\n $footer = (count($contentList) == 0 || !isset($contentList)) ? $footer = \"没有数据.\" : '';\n break;\n }\n\n // end get\n $ret['header'] = $this->output_header($header);\n $ret['content'] = $this->output_content($contentList, $id);\n $ret['footer'] = $this->output_footer($footer, $cols);\n $ret['status'] = 'success';\n }\n echo json_encode($ret);\n }\n }",
"function list_enrollments ( $CourseID ){\n\tglobal $access_token, $canvas_base_url;\n\t\n\t//get it ready for later\n\t$enrolled=array();\n\t\n\t$url=$canvas_base_url.\"/api/v1/courses/\".$CourseID.\"/enrollments?per_page=100&access_token=\".$access_token;\n\t\n\t// Get cURL resource\n\t$curl = curl_init();\n\t// Set some options - we are passing in a useragent too here\n\tcurl_setopt_array($curl, array(\n\t CURLOPT_RETURNTRANSFER => 1,\n\t CURLOPT_CUSTOMREQUEST => 'GET',\n\t CURLOPT_URL => $url,\n\t CURLOPT_USERAGENT => 'Matt Loves cURLing Things'\n\t));\n\t// Send the request & save response to $resp\n\t$resp = json_decode(curl_exec($curl));\n\t\n\t//print_r($resp);\n\t\n\t// Close request to clear up some resources\n\tcurl_close($curl);\n\n\t$counter=0;\n\tforeach ($resp as $enrollment) {\n\t\tif ($enrollment->type==\"StudentEnrollment\" && $enrollment->user->name != \"Test Student\") {\n\t\t\t$enrolled[$enrollment->user->sis_user_id]=array('name'=>$enrollment->user->name,'id'=>$enrollment->user->sis_user_id,'participations'=>0);\n\t\t}\n\t\t$counter++;\n\t}\t\n\treturn $enrolled;\n}",
"public function listdataCSAction() {\n $this->view->dataList = $this->adm_listdata_serv->getDataList('CURRENT SYSTEM');\n }",
"public function getList()\n {\n\n $apikey = $this->params()->fromHeader('apikey', null);\n\n $query = SampleQuery::create();\n $aaa = $query->find()->toArray();\n\n\n// $apikey->getFieldValue();\n\n return new JsonModel(\n $aaa\n );\n }",
"public function loadFilesILC()\r\n {\r\n $id = Input::get('ID');\r\n $iid =Input::get('IID');\r\n $project = Project::find($id);\r\n $files=[];\r\n if($project!=null)\r\n {\r\n $internalFiles = $project->filesByType(array('ilc','ilcVendors'));\r\n foreach($internalFiles as $file)\r\n {\r\n $created = date('m-d-Y',strtotime(str_replace('-','/',$file->created_at)));\r\n $files[]=['id'=>$file->id,'name'=>$file->fileName,'url'=>$file->url,'created'=>$created,'ilcVendors'=>$file->ilcVendors];\r\n }\r\n }\r\n $ilcV =IlcVendors::where('ilc_id',$iid)->first();\r\n if($ilcV == null)\r\n $existIlcV =0;\r\n else\r\n $existIlcV =1;\r\n return json_encode(array($files,$existIlcV));\r\n }",
"function getItems();",
"function getItems();",
"public function index()\n {\n //check if cache is set or not ($key,$seperator,$current_page,$no_pagination_var,$before_page,$isPagination)\n //CacheExpiration::checkCache('parties',false,0,0,0,false);\n\n // Get parties\n $parties = Cache::rememberForever('parties', function() {\n return Party::orderBy('fullname_el', 'asc')->get();\n });\n \n return $this->apiHelper::returnResource('Party', $parties);\n }",
"public function what_ever_you_want()\n {\n $sql = \"Make a custom sql query for grabbing your data\";\n return static::custom_list($sql);\n }",
"public function GetDoctorList(){\n if($this->get_request_method()!= \"POST\"){\n $this->response('',406);\n }\n $format = $_POST['format'];\n $db_access = $this->dbConnect();\n $conn = $this->db;\n $res = new getService();\n $res->get_doctor_list($conn);\n }",
"public function apiFetch( $limit, $offset );",
"public function GetClinics(){\n\t\t $input_data \t\t= \t$this->GetDecryptedData(Input::get()['request']);\n\t\t $rules = array(\n\t\t\t 'user_id' \t=> 'required',\n\t\t\t //'device_id' => 'required',\n\t\t\t 'platform_type'=> 'required',\n\t\t\t 'latitude' \t=> 'required',\n\t\t\t 'longitude' \t=> 'required',\n\t\t\t 'type' \t\t=> 'required',\n\t\t\t 'type_value' => 'required',\n\t\t );\n\t\t $validator = Validator::make($input_data,$rules);\n\t\t if ($validator->fails()){\n\t\t\t $messages = $validator->messages();\n\t\t\t return $this->encrypt(json_encode(array('status' => 'error', 'message' => $validator->errors()->all())));\n\t\t }else{\n\t\t\t \n\t\t\t$config_date \t\t= Config::get('date_format.date');\n\t\t\t$config_month \t\t= Config::get('date_format.month');\n\t\t\t$config_year \t\t= Config::get('date_format.year');\n\t\t\t$config_separator \t= Config::get('date_format.separator');\n\t\t\t\t\t\t\n\t\t\t \n\t\t\t/* $input_data['user_id'] = '38';\n\t\t\t $input_data['type'] = 'day';\n\t\t\t $input_data['type_value'] = '20-09-2017'; */\n\t\t\t\t$user_id \t\t= \t$input_data['user_id'];\n\t\t\t\t$user\t\t\t=\tUser_model::GetUserById($user_id);\n\t\t\t\tif(!empty($user)){\n\t\t\t\t/* $user_device_id = $input_data['device_id'];\n\t\t\t\t\tif(isset($user_device_id) && $user_device_id != null){\n\t\t\t\t\t\t$update_device_id\t\t= $this->UpdateDeviceId($user_device_id,$user_id);\n\t\t\t\t\t} */\n\t\t\t\t$all_clinics \t= \tarray();\n\t\t\t\tif(isset($input_data['type']) && $input_data['type'] == 'upcoming' && $input_data['type_value'] == 'upcoming'){\n\t\t\t\t\t$distance \t= $this->GetAdminSettingsValue('max_distance');\n\t\t\t\t\t$sqlQuery = \"SELECT *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t( 6371 * acos( cos( radians(\".$user['latitude'].\") ) * cos( radians( `latitude` ) ) * cos( radians( `longitude` ) - radians(\".$user['longitude'].\") ) + sin( radians(\".$user['latitude'].\") ) * sin( radians( `latitude` ) ) ) ) AS distance\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM clinics WHERE `date` >= curdate() AND\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\tFIND_IN_SET(\".$input_data['user_id'].\", `provider_id`) OR ( 6371 * acos( cos( radians(\".$user['latitude'].\") ) * cos( radians( `latitude` ) ) * cos( radians( `longitude` ) - radians(\".$user['longitude'].\") ) + sin( radians(\".$user['latitude'].\") ) * sin( radians( `latitude` ) ) ) ) <= $distance )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY distance ASC\";\n\t\t\t\t\t$clinics_s = DB::select(DB::raw($sqlQuery));\n\t\t\t\t\t$clinics = (array) $clinics_s;\n\t\t\t\t\tif(!empty($clinics)){\n\t\t\t\t\t\tforeach($clinics as $clinic){\n\t\t\t\t\t\t\t$clinic = (array)$clinic;\n\t\t\t\t\t\t\t$clinic_time_gmt \t\t= $clinic['date'].' '.$clinic['time'];\n\t\t\t\t\t\t\t$current_time_gmt \t\t= date('Y-m-d H:i:s');\n\t\t\t\t\t\t\t$clinic_created_gmt \t= $clinic['created_at'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$time = new DateTime($clinic['date'].' '.$clinic['time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t$user_time_zone \t = User_model::select('timezone')->where('id',$input_data['user_id'])->get();\n\t\t\t\t\t\t\t$user_time_zone_value = $user_time_zone[0]['timezone'];\n\t\t\t\t\t\t\t$time->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t$clinic_date_time \t = $time->format('Y-m-d H:i');\n\t\t\t\t\t\t\t$clinic_time\t\t\t\t\t=\t$clinic_date_time;\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$current = new DateTime(date('Y-m-d h:i:s'));\n\t\t\t\t\t\t\t$current->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t$current_timestamp \t\t\t\t= strtotime($current->format('Y-m-d H:i'));\n\t\t\t\t\t\t\t$current_time = \t$current->format('Y-m-d H:i:s');\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t$clinic_creation = new DateTime($clinic['created_at'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t$clinic_creation->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t$clinic_created = \t$clinic_creation->format('Y-m-d H:i:s');\n\n\t\t\t\t\t\t\t$preferred_wait_hour \t= \t$this->GetAdminSettingsValue('default_time_stay_in_feeds');\n\t\t\t\t\t\t\tif($clinic['default_unfilled_time'] != null){\n\t\t\t\t\t\t\t\t$wait_time\t\t\t\t\t=\t'+'.$clinic['default_unfilled_time'].' hour';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t$wait_time\t\t\t\t\t=\t'+'.$preferred_wait_hour.'hour';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$clinic_creation_time_with_wait_time\t=\tdate('Y-m-d H:i:s',strtotime($wait_time,strtotime($clinic_created_gmt)));\n\t\t\t\t\t\t\tif(strtotime($current_time_gmt) < strtotime($clinic_time_gmt)){\n\t\t\t\t\t\t\t// checking clinic already accepted by someone or not.\n\t\t\t\t\t\t\t\t$count \t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t->where('status',1)->count();\n\t\t\t\t\t\t\tif($count<$clinic['personnel']){\n\t\t\t\t\t\t\t\t//checking clinic accepted or rejected by this user.\n\t\t\t\t\t\t\t\t$check_decline_status \t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('provider_id',$input_data['user_id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('status',0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->count();\n\t\t\t\t\t\t\t\t$check_accept_status \t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('provider_id',$input_data['user_id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('status',1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->count();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($check_decline_status==0 && $check_accept_status == 0){\n\t\t\t\t\t\t\t\t\t$clinic['clinic_name']\t=\t$clinic['name'];\n\t\t\t\t\t\t\t\t\t// clinic time according to user time zone starts //\n\t\t\t\t\t\t\t\t\t$Preptime \t\t= new DateTime($clinic['prep_time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t\t\t$Preptime->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t\t\t$prep_time \t\t= $Preptime->format('H:i');\n\n\t\t\t\t\t\t\t\t\t$EndTime = new DateTime($clinic['end_time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t\t\t$EndTime->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t\t\t$clinic_end_time \t\t= $EndTime->format('H:i');\n\n\t\t\t\t\t\t\t\t\t$clinic['date']\t\t\t\t\t=\tdate('d-m-Y', strtotime($clinic_date_time));\n\t\t\t\t\t\t\t\t\t\tif($user['time_format'] == 24){\n\t\t\t\t\t\t\t\t\t\t\t$format = 'H:i';\n\t\t\t\t\t\t\t\t\t\t}elseif($user['time_format'] == 12){\n\t\t\t\t\t\t\t\t\t\t\t$format = 'h:i a';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$clinic['time']\t\t\t\t\t=\tdate($format, strtotime($clinic_date_time));\n\t\t\t\t\t\t\t\t\t\t$clinic['prep_time']\t\t=\tdate($format, strtotime($prep_time));\n\t\t\t\t\t\t\t\t\t\t$clinic['end_time']\t\t\t=\tdate($format, strtotime($clinic_end_time));\n\t\t\t\t\t\t\t\t\t// clinic time according to user time zone ends //\n\t\t\t\t\t\t\t\t\t$clinic['estimated_duration']\t=\tnumber_format((($clinic['estimated_duration'])/60),2).' hour';\n\t\t\t\t\t\t\t\t\tif($current_time_gmt>$clinic_creation_time_with_wait_time){\n\t\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t\t= 'Unfilled';\n\t\t\t\t\t\t\t\t\t\t$clinic['status_name'] \t\t\t= 'Unfilled clinic';\n\t\t\t\t\t\t\t\t\t}elseif($current_time_gmt < $clinic_time_gmt){\n\t\t\t\t\t\t\t\t\t\tif(in_array($input_data['user_id'],explode(',',$clinic['provider_id']))){\n\t\t\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t= \t'preferd';\n\t\t\t\t\t\t\t\t\t\t\t$clinic['status_name']\t\t= \t'Preferred available Clinics';\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t= \t'available_clinics';\n\t\t\t\t\t\t\t\t\t\t\t$clinic['status_name']\t\t= \t'Available clinics';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$clinic['date'] \t= date($config_month.$config_separator.$config_date.$config_separator.$config_year, strtotime($clinic['date']));\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif(strtotime($clinic_time_gmt)> strtotime($current_time_gmt)){\n\t\t\t\t\t\t\t\t\t\t// if($clinic['primary_provider'] == $input_data['user_id'] || $clinic['medtech_provider'] == $input_data['user_id'] || $clinic['other_provider'] == $input_data['user_id']){\n\t\t\t\t\t\t\t\t\t\t\t$all_clinics[$clinic['date']][] = $clinic;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t// if(strtotime($current_time)>strtotime($clinic_creation_time_with_wait_time)){\n\t\t\t\t\t\t\t\t\t\t// \t$all_clinics[$clinic['date']][] = $clinic;\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}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t }else if(isset($input_data['type']) && $input_data['type'] == 'month'){\n\t\t\t\t\t\t$month_number \t= \tdate('m', strtotime($input_data['type_value']));\n\t\t\t\t\t\t$month_name \t\t= \tdate('F', strtotime($input_data['type_value']));\n\t\t\t\t\t\t$year \t\t\t\t\t= \tdate('Y', strtotime($input_data['type_value']));\n\n\t\t\t\t\t\t$distance \t= $this->GetAdminSettingsValue('max_distance');\n\t\t\t\t\t\t$sqlQuery = \"SELECT *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t( 6371 * acos( cos( radians(\".$user['latitude'].\") ) * cos( radians( `latitude` ) ) * cos( radians( `longitude` ) - radians(\".$user['longitude'].\") ) + sin( radians(\".$user['latitude'].\") ) * sin( radians( `latitude` ) ) ) ) AS distance\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM clinics WHERE Year(`date`)=\".$year.\" AND Month(`date`)=\".$month_number.\" AND `date` >= curdate() AND\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\tFIND_IN_SET(\".$input_data['user_id'].\", `provider_id`) OR ( 6371 * acos( cos( radians(\".$user['latitude'].\") ) * cos( radians( `latitude` ) ) * cos( radians( `longitude` ) - radians(\".$user['longitude'].\") ) + sin( radians(\".$user['latitude'].\") ) * sin( radians( `latitude` ) ) ) ) <= $distance )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY distance ASC\";\n\t\t\t\t\t\t$clinics_s = DB::select(DB::raw($sqlQuery));\n\t\t\t\t\t\t$clinics = (array) $clinics_s;\n\t\t\t\tif(!empty($clinics)){\n\t\t\t\t\tforeach($clinics as $clinic){\n\t\t\t\t\t\t\t$clinic = (array)$clinic;\n\t\t\t\t\t\t\t$clinic_time_gmt \t\t= $clinic['date'].' '.$clinic['time'];\n\t\t\t\t\t\t\t$current_time_gmt \t\t= date('Y-m-d H:i:s');\n\t\t\t\t\t\t\t$clinic_created_gmt \t= $clinic['created_at'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$time = new DateTime($clinic['date'].' '.$clinic['time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t$user_time_zone \t\t\t= User_model::select('timezone')->where('id',$input_data['user_id'])->get();\n\t\t\t\t\t\t\t$user_time_zone_value = $user_time_zone[0]['timezone'];\n\t\t\t\t\t\t\t$time->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t$clinic_date_time \t\t= $time->format('Y-m-d H:i:s');\n\t\t\t\t\t\t\t$clinic_time\t\t\t\t\t=\t$clinic_date_time;\n\n\t\t\t\t\t\t\t$current = new DateTime(date('Y-m-d h:i:s'));\n\t\t\t\t\t\t\t$current->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t$current_timestamp \t\t\t\t= strtotime($current->format('Y-m-d H:i'));\n\t\t\t\t\t\t\t$current_time = \t$current->format('Y-m-d H:i:s');\n\n\t\t\t\t\t\t\t$clinic_creation = new DateTime($clinic['created_at'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t$clinic_creation->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t$clinic_created = \t$clinic_creation->format('Y-m-d H:i:s');\n\n\t\t\t\t\t\t\t$preferred_wait_hour \t= \t$this->GetAdminSettingsValue('default_time_stay_in_feeds');\n\t\t\t\t\t\t\tif($clinic['default_unfilled_time'] != null){\n\t\t\t\t\t\t\t\t\t$wait_time\t\t\t\t=\t'+'.$clinic['default_unfilled_time'].' hour';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t$wait_time\t\t\t\t=\t'+'.$preferred_wait_hour.'hour';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$clinic_creation_time_with_wait_time\t=\tdate('Y-m-d H:i:s',strtotime($wait_time,strtotime($clinic_created_gmt)));\n\t\t\t\t\t\tif(strtotime($current_time_gmt) < strtotime($clinic_time_gmt)){\n\t\t\t\t\t\t\t$count \t\t\t\t\t\t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('status',1)->count();\n\t\t\t\t\t\tif($count<$clinic['personnel']){\n\t\t\t\t\t\t\t//checking clinic accepted or rejected by this user.\n\t\t\t\t\t\t\t\t$check_decline_status \t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('provider_id',$input_data['user_id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('status',0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->count();\n\t\t\t\t\t\t\t\t$check_accept_status \t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('provider_id',$input_data['user_id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('status',1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->count();\n\t\t\t\t\t\t\t\tif($check_decline_status==0 && $check_accept_status == 0){\n\n\t\t\t\t\t\t\t\t$clinic['clinic_name']\t=\t$clinic['name'];\n\t\t\t\t\t\t\t\t// clinic time according to user time zone starts //\n\t\t\t\t\t\t\t\t$Preptime = new DateTime($clinic['prep_time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t\t$Preptime->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t\t$prep_time \t\t= $Preptime->format('H:i');\n\n\t\t\t\t\t\t\t\t$EndTime = new DateTime($clinic['end_time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t\t$EndTime->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t\t$clinic_end_time \t\t= $EndTime->format('H:i');\n\n\t\t\t\t\t\t\t\t$clinic['date']\t\t=\tdate('d-m-Y', strtotime($clinic_date_time));\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif($user['time_format'] == 24){\n\t\t\t\t\t\t\t\t\t$format = 'H:i';\n\t\t\t\t\t\t\t\t}elseif($user['time_format'] == 12){\n\t\t\t\t\t\t\t\t\t$format = 'h:i a';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$clinic['time']\t\t\t\t\t=\tdate($format, strtotime($clinic_date_time));\n\t\t\t\t\t\t\t\t$clinic['prep_time']\t\t=\tdate($format, strtotime($prep_time));\n\t\t\t\t\t\t\t\t$clinic['end_time']\t\t\t=\tdate($format, strtotime($clinic_end_time));\n\t\t\t\t\t\t\t\t// clinic time according to user time zone ends //\n\t\t\t\t\t\t\t\t$clinic['estimated_duration']\t=\tnumber_format((($clinic['estimated_duration'])/60),2).' hour';\n\t\t\t\t\t\t\t\tif($current_time_gmt>$clinic_creation_time_with_wait_time){\n\t\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t\t= 'Unfilled';\n\t\t\t\t\t\t\t\t\t\t$clinic['status_name'] \t= 'Unfilled clinic';\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tif(in_array($input_data['user_id'],explode(',',$clinic['provider_id']))){\n\t\t\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t= \t'preferd';\n\t\t\t\t\t\t\t\t\t\t\t$clinic['status_name']\t\t= \t'Preferred available Clinics';\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t= \t'available_clinics';\n\t\t\t\t\t\t\t\t\t\t$clinic['status_name']\t\t= \t'Available clinics';\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(strtotime($clinic_time_gmt)> strtotime($current_time_gmt)){\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$all_clinics[] = $clinic;\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\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else if(isset($input_data['type']) && $input_data['type'] == 'day'){\n\t\t\t\t\t//$input_data['type_value'] = '25-09-2017';\n\t\t\t\t\t$user_time_zone \t\t\t= User_model::select('timezone')->where('id',$input_data['user_id'])->get();\n\t\t\t\t\t$user_time_zone_value \t\t= $user_time_zone[0]['timezone'];\n\n\t\t\t\t\t$start_time \t\t\t\t=\t$input_data['type_value'].\" 12:00 AM\";\n\t\t\t\t\t$end_time \t\t\t\t\t=\t$input_data['type_value'].\" 11:59 PM\";\n\t\t\t\t\t\n\t\t\t\t\t$user_time_zone \t\t=\tnew DateTimeZone($user_time_zone_value);\n\t\t\t\t\t$end_search_date \t= new DateTime($end_time, $user_time_zone);\n\t\t\t\t\t$start_search_date = new DateTime($start_time, $user_time_zone);\n\n\t\t\t\t\t$start_search_date->setTimezone(new DateTimeZone('GMT'));\n\t\t\t\t\t$start_searchFinalDate = $start_search_date->format('Y-m-d H:i');\n\n\t\t\t\t\t$end_search_date = new DateTime($end_time, $user_time_zone);\n\n\t\t\t\t\t$end_search_date->setTimezone(new DateTimeZone('GMT'));\n\t\t\t\t\t$end_searchFinalDate = $end_search_date->format('Y-m-d H:i');\n\n\t\t\t\t\t\n\t\t\t\t\t$date \t\t\t= \tdate('Y-m-d', strtotime($input_data['type_value']));\n\t\t\t\t\t$month_name\t=\tstrtolower(date(\"F\", strtotime($date)));\n\t\t\t\t\t$search \t\t= \t$input_data['type_value'];\n\n\t\t\t\t\t$distance \t= $this->GetAdminSettingsValue('max_distance');\n\t\t\t\t\t$sqlQuery = \"SELECT *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t( 6371 * acos( cos( radians(\".$user['latitude'].\") ) * cos( radians( `latitude` ) ) * cos( radians( `longitude` ) - radians(\".$user['longitude'].\") ) + sin( radians(\".$user['latitude'].\") ) * sin( radians( `latitude` ) ) ) ) AS distance\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM clinics WHERE (STR_TO_DATE(CONCAT(`date`, ' ' ,`time`), '%Y-%m-%d %H:%i') BETWEEN STR_TO_DATE('\".$start_searchFinalDate.\"', '%Y-%m-%d %H:%i') AND STR_TO_DATE('\".$end_searchFinalDate.\"', '%Y-%m-%d %H:%i')) AND (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFIND_IN_SET(\".$input_data['user_id'].\", `provider_id`) OR ( 6371 * acos( cos( radians(\".$user['latitude'].\") ) * cos( radians( `latitude` ) ) * cos( radians( `longitude` ) - radians(\".$user['longitude'].\") ) + sin( radians(\".$user['latitude'].\") ) * sin( radians( `latitude` ) ) ) ) <= $distance )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY distance ASC\";\n\t\t\t\t\t$clinics_s = DB::select(DB::raw($sqlQuery));\n\t\t\t\t\t$clinics = (array) $clinics_s;\n\t\t\t\t\t\tif(!empty($clinics)){\n\t\t\t\t\t\t\tforeach($clinics as $clinic){\n\t\t\t\t\t\t\t\t$clinic = (array)$clinic;\n\t\t\t\t\t\t\t\t$clinic_time_gmt \t\t= $clinic['date'].' '.$clinic['time'];\n\t\t\t\t\t\t\t\t$current_time_gmt \t\t= date('Y-m-d H:i:s');\n\t\t\t\t\t\t\t\t$clinic_created_gmt \t= $clinic['created_at'];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$time = new DateTime($clinic['date'].' '.$clinic['time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t\t$user_time_zone \t\t\t= User_model::select('timezone')->where('id',$input_data['user_id'])->get();\n\t\t\t\t\t\t\t\t$user_time_zone_value = $user_time_zone[0]['timezone'];\n\t\t\t\t\t\t\t\t$time->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t\t$clinic_date_time \t\t= $time->format('Y-m-d H:i:s');\n\t\t\t\t\t\t\t\t$clinic_time\t\t\t\t\t=\t$clinic_date_time;\n\n\t\t\t\t\t\t\t\t$current = new DateTime(date('Y-m-d h:i:s'));\n\t\t\t\t\t\t\t\t$current->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t\t$current_timestamp \t\t\t\t= strtotime($current->format('Y-m-d H:i'));\n\t\t\t\t\t\t\t\t$current_time = \t$current->format('Y-m-d H:i:s');\n\n\t\t\t\t\t\t\t\t$clinic_creation = new DateTime($clinic['created_at'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t\t$clinic_creation->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t\t$clinic_created = \t$clinic_creation->format('Y-m-d H:i:s');\n\n\t\t\t\t\t\t\t\t$preferred_wait_hour \t= \t$this->GetAdminSettingsValue('default_time_stay_in_feeds');\n\t\t\t\t\t\t\t\tif($clinic['default_unfilled_time'] != null){\n\t\t\t\t\t\t\t\t\t\t$wait_time\t\t\t\t\t=\t'+'.$clinic['default_unfilled_time'].' hour';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t$wait_time\t\t\t\t\t=\t'+'.$preferred_wait_hour.'hour';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$clinic_creation_time_with_wait_time\t=\tdate('Y-m-d H:i:s',strtotime($wait_time,strtotime($clinic_created_gmt)));\n\t\t\t\t\t\t\tif(strtotime($current_time_gmt) < strtotime($clinic_time_gmt)){\n\t\t\t\t\t\t\t\t// checking clinic already accepted by someone or not.\n\t\t\t\t\t\t\t\t$count \t\t\t\t\t\t\t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('status',1)->count();\n\t\t\t\t\t\t\tif($count<$clinic['personnel']){\n\t\t\t\t\t\t\t\t//checking clinic accepted or rejected by this user.\n\t\t\t\t\t\t\t\t$check_decline_status \t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('provider_id',$input_data['user_id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('status',0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->count();\n\t\t\t\t\t\t\t\t$check_accept_status \t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('provider_id',$input_data['user_id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('status',1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->count();\n\t\t\t\t\t\t\t\tif($check_decline_status==0 && $check_accept_status == 0){\n\n\t\t\t\t\t\t\t\t\t\t$clinic['clinic_name']\t=\t$clinic['name'];\n\t\t\t\t\t\t\t\t\t\t// clinic time according to user time zone starts //\n\t\t\t\t\t\t\t\t\t\t$Preptime = new DateTime($clinic['prep_time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t\t\t\t$Preptime->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t\t\t\t$prep_time \t\t= $Preptime->format('H:i');\n\n\t\t\t\t\t\t\t\t\t\t$EndTime = new DateTime($clinic['end_time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t\t\t\t$EndTime->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t\t\t\t$clinic_end_time \t\t= $EndTime->format('H:i');\n\n\t\t\t\t\t\t\t\t\t\t//$clinic['date']\t\t=\tdate('d-m-Y', strtotime($clinic_date_time));\n\t\t\t\t\t\t\t\t\t\t$clinic['date'] \t= date($config_month.$config_separator.$config_date.$config_separator.$config_year, strtotime($clinic_date_time));\n\t\t\t\t\t\t\t\t\t\t\tif($user['time_format'] == 24){\n\t\t\t\t\t\t\t\t\t\t\t\t$format = 'H:i';\n\t\t\t\t\t\t\t\t\t\t\t}elseif($user['time_format'] == 12){\n\t\t\t\t\t\t\t\t\t\t\t\t$format = 'h:i a';\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t$clinic['time']\t\t\t\t\t=\tdate($format, strtotime($clinic_date_time));\n\t\t\t\t\t\t\t\t\t\t\t$clinic['prep_time']\t\t=\tdate($format, strtotime($prep_time));\n\t\t\t\t\t\t\t\t\t\t\t$clinic['end_time']\t\t\t=\tdate($format, strtotime($clinic_end_time));\n\t\t\t\t\t\t\t\t\t\t// clinic time according to user time zone ends //\n\t\t\t\t\t\t\t\t\t\t$clinic['estimated_duration']\t=\tnumber_format((($clinic['estimated_duration'])/60),2).' hour';\n\t\t\t\t\t\t\t\t\t\tif($current_time_gmt>$clinic_creation_time_with_wait_time){\n\t\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t\t= 'Unfilled';\n\t\t\t\t\t\t\t\t\t\t$clinic['status_name'] \t\t\t= 'Unfilled clinic';\n\t\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t\tif(in_array($input_data['user_id'],explode(',',$clinic['provider_id']))){\n\t\t\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t= \t'preferd';\n\t\t\t\t\t\t\t\t\t\t\t$clinic['status_name']\t\t= \t'Preferred available Clinics';\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\t$clinic['type'] \t\t\t= \t'available_clinics';\n\t\t\t\t\t\t\t\t\t\t\t\t$clinic['status_name']\t\t= \t'Available clinics';\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\tif(strtotime($clinic_time_gmt)> strtotime($current_time_gmt)){\n\t\t\t\t\t\t\t\t\t\t\t$all_clinics[] = $clinic;\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\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t }else if(isset($input_data['type']) && $input_data['type'] == 'week'){\n\t\t\t\t\t$day_range \t\t\t= \texplode(',',$input_data['type_value']);\n\t\t\t\t\t$start_date\t\t\t=\tdate('Y-m-d', strtotime($day_range[0]));\n\t\t\t\t\t$end_date\t\t\t=\tdate('Y-m-d', strtotime($day_range[1]));\n\n\t\t\t\t\t$distance \t= $this->GetAdminSettingsValue('max_distance');\n\t\t\t\t\t$sqlQuery = \"SELECT *,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t( 6371 * acos( cos( radians(\".$user['latitude'].\") ) * cos( radians( `latitude` ) ) * cos( radians( `longitude` ) - radians(\".$user['longitude'].\") ) + sin( radians(\".$user['latitude'].\") ) * sin( radians( `latitude` ) ) ) ) AS distance\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM clinics WHERE (date BETWEEN '\".$start_date.\"' AND '\".$end_date.\"') AND\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\tFIND_IN_SET(\".$input_data['user_id'].\", `provider_id`) OR ( 6371 * acos( cos( radians(\".$user['latitude'].\") ) * cos( radians( `latitude` ) ) * cos( radians( `longitude` ) - radians(\".$user['longitude'].\") ) + sin( radians(\".$user['latitude'].\") ) * sin( radians( `latitude` ) ) ) ) <= $distance )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY distance ASC\";\n\t\t\t\t\t$clinics_s = DB::select(DB::raw($sqlQuery));\n\t\t\t\t\t$clinics = (array) $clinics_s;\n\t\t\t\t\tif(!empty($clinics)){\n\t\t\t\t\tforeach($clinics as $clinic){\n\t\t\t\t\t\t\t$clinic = (array)$clinic;\n\t\t\t\t\t\t\t$clinic_time_gmt \t\t= $clinic['date'].' '.$clinic['time'];\n\t\t\t\t\t\t\t$current_time_gmt \t\t= date('Y-m-d H:i:s');\n\t\t\t\t\t\t\t$clinic_created_gmt \t= $clinic['created_at'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$time = new DateTime($clinic['date'].' '.$clinic['time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t$user_time_zone \t\t\t= User_model::select('timezone')->where('id',$input_data['user_id'])->get();\n\t\t\t\t\t\t\t$user_time_zone_value = $user_time_zone[0]['timezone'];\n\t\t\t\t\t\t\t$time->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t$clinic_date_time \t\t= $time->format('Y-m-d H:i:s');\n\t\t\t\t\t\t\t$clinic_time\t\t\t\t\t=\t$clinic_date_time;\n\n\t\t\t\t\t\t\t$current = new DateTime(date('Y-m-d h:i:s'));\n\t\t\t\t\t\t\t$current->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t$current_timestamp \t\t\t\t= strtotime($current->format('Y-m-d H:i'));\n\t\t\t\t\t\t\t$current_time = \t$current->format('Y-m-d H:i:s');\n\n\t\t\t\t\t\t\t$clinic_creation = new DateTime($clinic['created_at'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t$clinic_creation->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t$clinic_created = \t$clinic_creation->format('Y-m-d H:i:s');\n\n\t\t\t\t\t\t\t\t$preferred_wait_hour \t= \t$this->GetAdminSettingsValue('default_time_stay_in_feeds');\n\t\t\t\t\t\t\t\tif($clinic['default_unfilled_time'] != null){\n\t\t\t\t\t\t\t\t\t\t$wait_time\t\t\t\t\t=\t'+'.$clinic['default_unfilled_time'].' hour';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t$wait_time\t\t\t\t\t=\t'+'.$preferred_wait_hour.'hour';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$clinic_creation_time_with_wait_time\t=\tdate('Y-m-d H:i:s',strtotime($wait_time,strtotime($clinic_created)));\n\t\t\t\t\t\tif(strtotime($current_time_gmt) < strtotime($clinic_time_gmt)){\n\t\t\t\t\t\t// checking clinic already accepted by someone or not.\n\t\t\t\t\t\t\t\t$count \t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t->where('status',1)->count();\n\t\t\t\t\t\tif($count<$clinic['personnel']){\n\t\t\t\t\t\t\t//checking clinic accepted or rejected by this user.\n\t\t\t\t\t\t\t\t$check_decline_status \t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('provider_id',$input_data['user_id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('status',0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->count();\n\t\t\t\t\t\t\t\t$check_accept_status \t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('provider_id',$input_data['user_id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('status',1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->count();\n\t\t\t\t\t\t\t\tif($check_decline_status==0 && $check_accept_status == 0){\n\t\t\t\t\t\t\t\t\t$clinic['date']\t\t\t\t\t=\tdate('d-m-Y', strtotime($clinic_date_time));\n\t\t\t\t\t\t\t\t\t// clinic time according to user time zone starts //\n\t\t\t\t\t\t\t\t\t$Preptime = new DateTime($clinic['prep_time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t\t\t$Preptime->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t\t\t$prep_time \t\t= $Preptime->format('H:i');\n\n\t\t\t\t\t\t\t\t\t$EndTime = new DateTime($clinic['end_time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t\t\t$EndTime->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t\t\t$clinic_end_time \t\t= $EndTime->format('H:i');\n\n\t\t\t\t\t\t\t\t\t\tif($user['time_format'] == 24){\n\t\t\t\t\t\t\t\t\t\t\t$format = 'H:i';\n\t\t\t\t\t\t\t\t\t\t}elseif($user['time_format'] == 12){\n\t\t\t\t\t\t\t\t\t\t\t$format = 'h:i a';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$clinic['time']\t\t\t\t\t=\tdate($format, strtotime($clinic_date_time));\n\t\t\t\t\t\t\t\t\t\t$clinic['prep_time']\t\t=\tdate($format, strtotime($prep_time));\n\t\t\t\t\t\t\t\t\t\t$clinic['end_time']\t\t\t=\tdate($format, strtotime($clinic_end_time));\n\t\t\t\t\t\t\t\t$preferred_wait_hour \t\t= \t$this->GetAdminSettingsValue('preferred_wait_time');\n\t\t\t\t\t\t\t\tif($clinic['default_unfilled_time'] != null){\n\t\t\t\t\t\t\t\t\t$time_addition\t\t\t\t=\t'+'.$clinic['default_unfilled_time'].' hour';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t$time_addition\t\t\t\t=\t'+'.$preferred_wait_hour.' hour';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$clinic_time\t\t\t\t\t=\tdate('Y-m-d H:i:s',strtotime($clinic['date'].' '.$clinic['time']));\n\t\t\t\t\t\t\t\t// adding wait time or default unfilled time to clinic creation date.\n\t\t\t\t\t\t\t\t$clinic_creation_time_with_addition\t\t=\tdate('Y-m-d H:i:s',strtotime($time_addition,strtotime($clinic_created_gmt)));\n\n\t\t\t\t\t\t\t\t$clinic['clinic_name']\t\t\t\t=\t$clinic['name'];\n\t\t\t\t\t\t\t\t// clinic time according to user time zone ends //\n\t\t\t\t\t\t\t\t$clinic['start_year']\t\t\t\t\t=\tdate('Y', strtotime($clinic['date']));\n\t\t\t\t\t\t\t\t$clinic['start_month']\t\t\t\t=\tdate('m', strtotime($clinic['date']));\n\t\t\t\t\t\t\t\t$clinic['start_day']\t\t\t\t\t=\tdate('d', strtotime($clinic['date']));\n\t\t\t\t\t\t\t\t$clinic['end_year']\t\t\t\t\t\t=\tdate('Y', strtotime($clinic['date']));\n\t\t\t\t\t\t\t\t$clinic['end_month']\t\t\t\t\t=\tdate('m', strtotime($clinic['date']));\n\t\t\t\t\t\t\t\t$clinic['end_day']\t\t\t\t\t\t=\tdate('d', strtotime($clinic['date']));\n\t\t\t\t\t\t\t\t$clinic['start_hour']\t\t\t\t\t=\tdate('H', strtotime($clinic['time']));\n\t\t\t\t\t\t\t\t$clinic['start_minute']\t\t\t\t=\tdate('i', strtotime($clinic['time']));\n\t\t\t\t\t\t\t\t$clinic['start_meridiem']\t\t\t=\tdate('A', strtotime($clinic['time']));\n\t\t\t\t\t\t\t\t//get clinic end time from addition clinic duration into clinic time.\n\t\t\t\t\t\t\t\t$time_addition\t\t\t\t\t\t\t\t=\t'+'.$clinic['estimated_duration'].' minutes';\n\n\t\t\t\t\t\t\t\t$clinic_end_timestamp \t\t\t\t= \tstrtotime($time_addition, strtotime($clinic['time']));\n\t\t\t\t\t\t\t\t$clinic['end_hour']\t\t\t\t\t\t=\tdate('H', $clinic_end_timestamp);\n\t\t\t\t\t\t\t\t$clinic['end_minute']\t\t\t\t\t=\tdate('i', $clinic_end_timestamp);\n\t\t\t\t\t\t\t\t$clinic['end_meridiem']\t\t\t\t=\tdate('A', $clinic_end_timestamp);\n\t\t\t\t\t\t\t\t$clinic['duration']\t\t\t\t\t\t=\tnumber_format((($clinic['estimated_duration'])/60),2).' hour';\n\t\t\t\t\t\t\t\t$clinic['estimated_duration']\t=\tnumber_format((($clinic['estimated_duration'])/60),2).' hour';\n\t\t\t\t\t\t\t\t$clinic['mileage_required']\t\t=\t'';\n\t\t\t\t\t\t\t\t$clinic['drive_time_required']=\t'';\n\t\t\t\t\t\t\t\t$clinic['mileage_status']\t\t\t=\t'';\n\t\t\t\t\t\t\t\t$clinic['drive_time_status']\t=\t'';\n\t\t\t\t\t\t\t\t$date \t\t\t\t\t\t\t\t\t\t\t\t= \t$clinic['date'];\n\t\t\t\t\t\t\t\t$time \t\t\t\t\t\t\t\t\t\t\t\t= \t$clinic['time'];\n\t\t\t\t\t\t\t\t$full_date \t\t\t\t\t\t\t\t\t\t= \t$time.' '.$date;\n\t\t\t\t\t\t\t\tif($current_time_gmt>$clinic_creation_time_with_addition){\n\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t\t= 'Unfilled';\n\t\t\t\t\t\t\t\t\t$clinic['status_name'] \t= 'Unfilled clinic';\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tif(in_array($input_data['user_id'],explode(',',$clinic['provider_id']))){\n\t\t\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t= \t'preferd';\n\t\t\t\t\t\t\t\t\t\t\t$clinic['status_name']\t\t= \t'Preferred available Clinics';\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t= \t'available_clinics';\n\t\t\t\t\t\t\t\t\t\t$clinic['status_name']\t\t= \t'Available clinics';\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(strtotime($clinic_time_gmt)> strtotime($current_time_gmt)){\n\t\t\t\t\t\t\t\t\t\t$clinic['date'] \t= date($config_month.$config_separator.$config_date.$config_separator.$config_year, strtotime($clinic['date']));\n\t\t\t\t\t\t\t\t\t\t$all_clinics[] = $clinic;\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\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t }else{\n\t\t\t\t\t$distance \t= $this->GetAdminSettingsValue('max_distance');\n\t\t\t\t\t$sqlQuery = \"SELECT\t*,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t( 6371 * acos( cos( radians(\".$user['latitude'].\") ) * cos( radians( `latitude` ) ) * cos( radians( `longitude` ) - radians(\".$user['longitude'].\") ) + sin( radians(\".$user['latitude'].\") ) * sin( radians( `latitude` ) ) ) ) AS distance\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM clinics WHERE `date` >= curdate() AND\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\tFIND_IN_SET(\".$input_data['user_id'].\", `provider_id`) OR ( 6371 * acos( cos( radians(\".$user['latitude'].\") ) * cos( radians( `latitude` ) ) * cos( radians( `longitude` ) - radians(\".$user['longitude'].\") ) + sin( radians(\".$user['latitude'].\") ) * sin( radians( `latitude` ) ) ) ) <= $distance )\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY distance ASC\";\n\t\t\t\t\t$clinics_s = DB::select(DB::raw($sqlQuery));\n\t\t\t\t\t$clinics = (array) $clinics_s;\n\t\t\t\tif(!empty($clinics)){\n\t\t\t\t\tforeach($clinics as $clinic){\n\t\t\t\t\t\t$clinic = (array)$clinic;\n\t\t\t\t\t\t$clinic_time_gmt \t\t= $clinic['date'].' '.$clinic['time'];\n\t\t\t\t\t\t$current_time_gmt \t\t= date('Y-m-d H:i:s');\n\t\t\t\t\t\t$clinic_created_gmt \t= $clinic['created_at'];\n\t\t\t\t\t\t\n\t\t\t\t\t\t$time = new DateTime($clinic['date'].' '.$clinic['time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t$user_time_zone \t\t\t= User_model::select('timezone')->where('id',$input_data['user_id'])->get();\n\t\t\t\t\t\t$user_time_zone_value = $user_time_zone[0]['timezone'];\n\t\t\t\t\t\t$time->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t$clinic_date_time \t\t= $time->format('Y-m-d H:i:s');\n\t\t\t\t\t\t$clinic_time\t\t\t\t\t=\t$clinic_date_time;\n\n\t\t\t\t\t\t$current = new DateTime(date('Y-m-d h:i:s'));\n\t\t\t\t\t\t$current->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t$current_timestamp \t\t\t\t= strtotime($current->format('Y-m-d H:i'));\n\t\t\t\t\t\t$current_time = \t$current->format('Y-m-d H:i:s');\n\n\t\t\t\t\t\t$clinic_creation = new DateTime($clinic['created_at'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t$clinic_creation->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t$clinic_created = \t$clinic_creation->format('Y-m-d H:i:s');\n\n\t\t\t\t\t\t\t\t$preferred_wait_hour \t= \t$this->GetAdminSettingsValue('default_time_stay_in_feeds');\n\t\t\t\t\t\t\t\tif($clinic['default_unfilled_time'] != null){\n\t\t\t\t\t\t\t\t\t\t$wait_time\t\t\t\t\t=\t'+'.$clinic['default_unfilled_time'].' hour';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t$wait_time\t\t\t\t\t=\t'+'.$preferred_wait_hour.'hour';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$clinic_creation_time_with_wait_time\t=\tdate('Y-m-d H:i:s',strtotime($wait_time,strtotime($clinic_created)));\n\t\t\t\t\t\tif(strtotime($current_time_gmt) < strtotime($clinic_time_gmt)){\n\t\t\t\t\t\t// checking clinic already accepted by someone or not.\n\t\t\t\t\t\t\t\t$count \t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t->where('status',1)->count();\n\t\t\t\t\t\tif($count<$clinic['personnel']){\n\t\t\t\t\t\t\t//checking clinic accepted or rejected by this user.\n\t\t\t\t\t\t\t\t$check_decline_status \t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('provider_id',$input_data['user_id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('status',0)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->count();\n\t\t\t\t\t\t\t\t$check_accept_status \t= \tClinicStatusModel::\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere('clinic_id',$clinic['id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('provider_id',$input_data['user_id'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->where('status',1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->count();\n\t\t\t\t\t\t\t\tif($check_decline_status==0 && $check_accept_status == 0){\n\t\t\t\t\t\t\t\t\t// clinic time according to user time zone starts //\n\t\t\t\t\t\t\t\t\t$Preptime = new DateTime($clinic['prep_time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t\t\t$Preptime->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t\t\t$prep_time \t\t= $Preptime->format('H:i');\n\n\t\t\t\t\t\t\t\t\t$EndTime = new DateTime($clinic['end_time'], new DateTimeZone('GMT'));\n\t\t\t\t\t\t\t\t\t$EndTime->setTimezone(new DateTimeZone($user_time_zone_value));\n\t\t\t\t\t\t\t\t\t$clinic_end_time \t\t= $EndTime->format('H:i');\n\n\t\t\t\t\t\t\t\t\t$clinic['date']\t\t\t\t\t=\tdate('d-m-Y', strtotime($clinic_date_time));\n\t\t\t\t\t\t\t\t\t\tif($user['time_format'] == 24){\n\t\t\t\t\t\t\t\t\t\t\t$format = 'H:i';\n\t\t\t\t\t\t\t\t\t\t}elseif($user['time_format'] == 12){\n\t\t\t\t\t\t\t\t\t\t\t$format = 'h:i a';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$clinic['time']\t\t\t\t\t=\tdate($format, strtotime($clinic_date_time));\n\t\t\t\t\t\t\t\t\t\t$clinic['prep_time']\t\t=\tdate($format, strtotime($prep_time));\n\t\t\t\t\t\t\t\t\t\t$clinic['end_time']\t\t\t=\tdate($format, strtotime($clinic_end_time));\n\t\t\t\t\t\t\t\t\t// clinic time according to user time zone ends //\n\t\t\t\t\t\t\t\t$preferred_wait_hour \t\t\t= \t$this->GetAdminSettingsValue('preferred_wait_time');\n\t\t\t\t\t\t\t\tif($clinic['default_unfilled_time'] != null){\n\t\t\t\t\t\t\t\t\t$time_addition\t\t\t\t\t=\t'+'.$clinic['default_unfilled_time'].' hour';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t$time_addition\t\t\t\t=\t'+'.$preferred_wait_hour.' hour';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$clinic_time\t\t\t\t\t\t=\tdate('Y-m-d H:i:s',strtotime($clinic['date'].' '.$clinic['time']));\n\t\t\t\t\t\t\t\t// adding wait time or default unfilled time to clinic creation date.\n\t\t\t\t\t\t\t\t$clinic_creation_time_with_addition\t\t=\tdate('Y-m-d H:i:s',strtotime($time_addition,strtotime($clinic_created_gmt)));\n\n\t\t\t\t\t\t\t\t$clinic['clinic_name']\t\t\t=\t$clinic['name'];\n\n\t\t\t\t\t\t\t\t$clinic['estimated_duration']\t=\tnumber_format((($clinic['estimated_duration'])/60),2).' hour';\n\t\t\t\t\t\t\t\tif($current_time_gmt>$clinic_creation_time_with_addition){\n\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t\t= 'Unfilled';\n\t\t\t\t\t\t\t\t\t$clinic['status_name'] \t= 'Unfilled clinic';\n\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\tif(in_array($input_data['user_id'],explode(',',$clinic['provider_id']))){\n\t\t\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t= \t'preferd';\n\t\t\t\t\t\t\t\t\t\t\t$clinic['status_name']\t\t= \t'Preferred available Clinics';\n\t\t\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t\t\t$clinic['type'] \t\t\t= \t'available_clinics';\n\t\t\t\t\t\t\t\t\t\t$clinic['status_name']\t\t= \t'Available clinics';\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(strtotime($clinic_time_gmt)> strtotime($current_time_gmt)){\n\t\t\t\t\t\t\t\t\t\t\t$clinic['date'] \t= date($config_month.$config_separator.$config_date.$config_separator.$config_year, strtotime($clinic['date']));\n\t\t\t\t\t\t\t\t\t\t\t$all_clinics[$clinic['date']][] = $clinic;\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\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t\t$userimg = WEBSITE_UPLOADS_URL.'users/'.$user['image'];\n\t\t\t\tif(isset($user['image']) && $user['image'] != '' ){\n\t\t\t\t\t$user_image = $userimg;\n\t\t\t\t}else{\n\t\t\t\t\t$user_image = WEBSITE_UPLOADS_URL.'users/man.png';\n\t\t\t\t}\n\t\t\tif(!empty($all_clinics)){\n\t\t\t\treturn $this->encrypt(json_encode(array('status'=>'success','message'=>'ok.','clinics'=>$all_clinics,'image'=>$user_image)));\n\t\t\t}else{\n\t\t\t\treturn $this->encrypt(json_encode(array('status'=>'error','message'=>'No records found in your location.')));\n\t\t\t}\n\t\t}else{\n\t\t\treturn $this->encrypt(json_encode(array('status'=>'deleted','message'=>'User is deleted.')));\n\t\t}\n\t\t}\n\t}",
"public function list()\n\t{\n\t\treturn $this->curl('/ovo/list', Constant::HTTP_POST);\n\t}",
"function get_all_internships_detail($start, $end) {\n $conn = db_connect();\n\n $sql = \"SELECT * FROM internship_detail where InternshipId between $start and $end\";\n $result = mysqli_query($conn, $sql);\n while ($row = $result->fetch_assoc()) { \n $output[] = $row;\n }\n\n //clean-up result set and connection\n mysqli_free_result($result);\n mysqli_close($conn);\n return $output;\n}",
"public function index()\n {\n return CompanyResource::collection(Company::orderBy('id','desc')->paginate(10));\n }",
"public function client_list()\n {\n return ClientList::latest()->paginate(10);\n }",
"function get_isi_rawat_list(){\r\n\t\t$dapaket_dpaket = isset($_POST['dapaket_dpaket']) ? $_POST['dapaket_dpaket'] : 0;\r\n\t\t$dapaket_jpaket = isset($_POST['dapaket_jpaket']) ? $_POST['dapaket_jpaket'] : 0;\r\n\t\t$dapaket_paket = isset($_POST['dapaket_paket']) ? $_POST['dapaket_paket'] : 0;\r\n\t\t$start = (integer) (isset($_POST['start']) ? $_POST['start'] : $_GET['start']);\r\n\t\t$end = (integer) (isset($_POST['limit']) ? $_POST['limit'] : $_GET['limit']);\r\n\t\t$result = $this->m_master_ambil_paket->get_isi_rawat_list($dapaket_dpaket,$dapaket_jpaket,$dapaket_paket,$start,$end);\r\n\t\techo $result;\r\n\t}",
"function info_list(){\r\n\t\t\r\n\t\t$query = isset($_POST['query']) ? $_POST['query'] : \"\";\r\n\t\t$start = (integer) (isset($_POST['start']) ? $_POST['start'] : $_GET['start']);\r\n\t\t$end = (integer) (isset($_POST['limit']) ? $_POST['limit'] : $_GET['limit']);\r\n\r\n\t\t$result=$this->m_info->info_list($query,$start,$end);\r\n\t\techo $result;\r\n\t}",
"public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }",
"function item_listing()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $ret = array(\n 'content' => '',\n 'status' => 'fail'\n );\n if (!empty($_POST)) {\n $id = $_POST['id'];\n $searchData = $_POST['searchData'];\n // get top list data in homepage\n switch ($id) {\n case 1:\n\n $header = array(\"优惠券编号\", \"优惠券金额\", \"所属终端便利店账号\", \"终端便利店\", \"状态\", \"赠送时间\", \"使用时间\");\n $cols = 7;\n\n $contentList = $this->coupon_model->getItems($searchData);\n $footer = (count($contentList) == 0 || !isset($contentList)) ? $footer = \"没有优惠券.\" : '';\n break; // get top1\n }\n\n // end get\n $ret['header'] = $this->output_header($header);\n $ret['content'] = $this->output_content($contentList, $id);\n $ret['footer'] = $this->output_footer($footer, $cols);\n $ret['status'] = 'success';\n }\n echo json_encode($ret);\n }\n }",
"public function fetchLocalAuthorities(){\n $sql = \"select * from local_authorities\";\n $rows = $this->executeGenericDQLQuery($sql);\n $localAuthorities = array();\n for($i=0 ; $i<sizeof($rows);$i++)\n {\n $localAuthorities[$i]['id'] = $rows[$i]['id'];\n $localAuthorities[$i]['designation'] = $rows[$i]['designation'];\n $localAuthorities[$i]['name'] = $rows[$i]['name'];\n $localAuthorities[$i]['contact'] = $rows[$i]['contact_no'];\n // $localAuthorities[$i]['CityName'] = $rows[$i]['CityName'];\n \n }\n $this->response($this->json($localAuthorities), 200);\n }",
"function get_city($query,$type)\r\n{\r\nrequire_once 'REST_Ongkir.php';\r\n \r\n $rest = new REST_Ongkir(array(\r\n 'server' =&gt; 'http://api.ongkir.info/'\r\n ));\r\n \r\n//ganti API-Key dibawah ini sesuai dengan API Key yang anda peroleh setalah mendaftar di ongkir.info\r\n $result = $rest-&gt;post('city/list', array(\r\n 'query' =&gt; $query,\r\n 'type' =&gt; $type,\r\n 'courier' =&gt; 'jne',\r\n 'API-Key' =&gt; 'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456' ), 'JSON');\r\n \r\n try\r\n {\r\n $status = $result['status'];\r\n \r\n // Handling the data\r\n if ($status-&gt;code == 0)\r\n {\r\n return $cities = $result['cities'];\r\n //print_r($cities);\r\n //foreach ($cities-&gt;item as $item)\r\n //{\r\n //echo 'Kota: ' . $item . '&lt;br /&gt;';\r\n // }\r\n }\r\n else\r\n {\r\n echo 'Tidak ditemukan kota yang diawali &quot;band&quot;';\r\n }\r\n \r\n }\r\n catch (Exception $e)\r\n {\r\n echo 'Processing error.';\r\n }\r\n}",
"function fetchList($limit, $offset);",
"public function getSimpleList($ids=''){\n\n\n }",
"public static function getArticlesList($kind) { // программа вывода списка статей\n\n\n\n $db = Db::getConnection(); // соединение с БД\n $ArticleList = array();\n\n\n\n// include the pagination class\n\n // $db->query(\"SET CHARACTER SET utf8\");\n\n\n\n if($kind=='app') {\n $result = $db->query('SELECT articles.id, user_id, name, text, status, email FROM articles, users WHERE user_id=users.id ORDER BY id ASC ');\n }\n if($kind=='oran'){\n $result = $db->query('SELECT articles.id, user_id, name, text, status, email FROM articles, users WHERE user_id=users.id ORDER BY articles.user_id ASC ');\n }\n if($kind=='pine') {\n $result = $db->query('SELECT articles.id, user_id, name, text, status, users.email FROM articles, users WHERE user_id=users.id ORDER BY articles.name ASC ');\n\n // $result = $db->query( 'SELECT * FROM articles, AS a LEFT JOIN users AS m ON a.user_id=m.id ORDERED BY `a.name`');\n }\n\n\n $i = 0;\n while($row = $result->fetch()) {\n if($row['name']=='admin') continue;\n $ArticleList[$i]['id'] = $row['id'];\n $ArticleList[$i]['user_id'] = $row['email'];\n $ArticleList[$i]['name'] = $row['name'];\n $ArticleList[$i]['text'] = $row['text'];\n $ArticleList[$i]['status'] = $row['status'];\n $i++;\n }\n\n\n return $ArticleList;\n\n }",
"public function listsGenericget()\r\n {\r\n $response = Generic::all();\r\n return response()->json($response,200);\r\n }",
"public function index()\n {\n return ClientResource::collection(Client::orderBy('id', 'DESC')->paginate());\n }",
"public function index()\n {\n $icg = $this->icg->all();\n return response()->json([\n 'data' =>$icg\n ],201);\n }",
"public function lists(): InstantMessageResponse;",
"protected function index()\n {\n \\Additional_Log::debug('【DAILY STORE LIST API】:START');\n\n // 引数取得\n $params = $this->setParams();\n $pattern = $this->params['pattern'];\n $user = \\Model_User::find($this->user_id);\n\n if($user->authority >= USER_AUTHORITY_COMPANY){\n $params['company_id'] = $user->company_id;\n }\n\n if($user->authority >= USER_AUTHORITY_BRAND){\n $params['brand_ids'] = [$user->brand_id];\n }\n\n if($user->authority >= USER_AUTHORITY_SECTION){\n $params['section_id'] = $user->section_id;\n }\n\n if($user->authority >= USER_AUTHORITY_STORE){\n $params['store_ids'] = [$user->store_id];\n }\n // 操作権限チェック\n $user->authority($params);\n\n // クーポン情報取得\n $conditions = \\Model_Daily_Store_Info::makeConditions($params);\n\n $order_condition = array('date' => 'desc');\n\n $results = \\Model_Daily_Store_Info::find('all', array(\n 'where' => $conditions,\n 'order_by' => $order_condition,\n ));\n\n $response = [];\n foreach ($results as $dailystore) {\n $rec = $dailystore->toArray($pattern);\n unset($rec['company']);\n unset($rec['brand']);\n unset($rec['store']);\n\n if (PATTERN_ONLY_KEY < $pattern) {\n $rec['company_name'] = isset($dailystore->company) ? $dailystore->company->company_name : null;\n $rec['brand_name'] = isset($dailystore->brand) ? $dailystore->brand->brand_name : null;\n $rec['store_name'] = isset($dailystore->store) ? $dailystore->store->store_name : null;\n }\n $response[] = $rec;\n }\n\n\n $this->response_fields['daily_store_info'] = $response;\n\n \\Additional_Log::debug('【DAILY STORE API】:END');\n }",
"function fsf_port_getImageCategories($fsf_port_image_id)\n { \n // Initialize Variables\n $fsf_port_getImageCategories_output = \"\";\n\n global $fsfcms_api_url; \n\n $fsf_api_file = \"fsf.port.getImageCategories.php\";\n $fsf_api_options = \"\";\n\n if($fsf_port_image_id !=\"\")\n {\n $fsf_api_options = \"?image_id=\" . $fsf_port_image_id;\n } else {\n $fsf_api_options = \"\";\n }\n\n $fsf_port_getImageCategories_json = fsf_preacher_curl($fsfcms_api_url, $fsf_api_file, $fsf_api_options);\n $fsf_port_getImageCategories_categories = json_decode($fsf_port_getImageCategories_json, true);\n $fsf_port_getImageCategories_output = array();\n \n // Process the categories \n if($fsf_port_getImageCategories_categories['0'] == \"FSFPGIC-None-Found\")\n {\n $fsf_port_getImageCategories_output = \"No categories were found for this image.\";\n } else { \n $fsf_port_getImageCategories_multiple = \"NO\";\n if (count($fsf_port_getImageCategories_categories) > 1)\n {\n $fsf_port_getImageCategories_multiple = \"YES\"; \n }\n $fsf_port_getImageCategories_output['multipleCategories'] = $fsf_port_getImageCategories_multiple;\n foreach($fsf_port_getImageCategories_categories as $fsf_port_getImageCategories_category)\n { \n $fsf_port_getImageCategories_links .= \"<a href=\\\"/categories/\" . strtolower($fsf_port_getImageCategories_category['categorySlug']) . \"\\\">\" . ucwords($fsf_port_getImageCategories_category['categoryName']) . \"</a>, \";\n } \n $fsf_port_getImageCategories_links = rtrim($fsf_port_getImageCategories_links,\", \"); \n $fsf_port_getImageCategories_output['categoriesWithLinks'] = $fsf_port_getImageCategories_links;\n } \n return $fsf_port_getImageCategories_output;\n }",
"public function infoCategory($category_id){\n\n \t$ch = curl_init();\n //getting specific orders after $time\n $encode = $this->urlPath.\"/rest/V1/categories/\" . $category_id;\n\t\t\n curl_setopt($ch, CURLOPT_URL, $encode);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n $headers = array();\n $headers[] = 'Authorization: Bearer '.$this->apiKey;\n $headers[] = 'Content-Type: application/json';\n //$headers[] = 'Accept: application/json';\n\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n $result = curl_exec($ch);\n\n curl_close ($ch);\n\n\n\n\n return $result;\n\t\t\t \n }",
"public function getListCategoriesNews() {\n header('Access-Control-Allow-Origin: *');\n header(\"Access-Control-Allow-Credentials: true\");\n header('Content-Type: application/json; charset=utf-8');\n header(\"Access-Control-Allow-Methods: POST, GET, OPTIONS\");\n header('Access-Control-Allow-Headers \"Origin, X-Requested-With, Content-Type, Accept');\n $cat_level = $this->category_model->fetch(\"*\", \"parent_id = 0 AND cat_status = 1 AND cate_type = 2\", \"cat_service, cat_order, cat_id\", \"ASC\");\n\n echo json_encode($cat_level);\n die();\n }",
"function table_comics(){\n\n\t\t$bdd=connexion_BD('projetLion');\n\n\t\t$reponse = $bdd->query(\"SELECT id,titre,collection,cover,description FROM `marvel_now`\");\n\t\twhile ($donnees = $reponse->fetch())\n\t\t{\n\n\t\t\t$table_comics[] = $donnees;\n\t\t}\n\t\t$reponse = $bdd->query(\"SELECT id,titre,collection,cover,description FROM `dc_comics`\");\n\t\twhile ($donnees = $reponse->fetch())\n\t\t{\n\n\t\t\t$table_comics[] = $donnees;\n\t\t}\n\n\n\t\t$reponse->closeCursor();\n\n\t\treturn $table_comics;\n\t}",
"public function get_list_get()\n\t{ \n\t\tif($_SERVER['REQUEST_METHOD'] == \"GET\"){\n \t// Get data\n\t\t\tif(isset($_GET)){\n\t\t\t\t$permission=false;\n\t\t\t\t$token= isset($_GET['token']) ?($_GET['token']) : \"\";\n\t\t\t\t$permission=$this->matchAppToken($token);\n\t\t\t\tif($permission==true){\n\t\t\t\t\t$language= isset($_GET['language']) ?($_GET['language']) : \"en\";\t\n\t\t\t\t\t$response=$this->advance_notification_model->get_in_app_data($language);\t\n\t\t\t\t\tif($response){\n\t\t\t\t\t\t$json = array(\"status\" => 1, \"message\" => \"Ok\", \"data\"=> $response);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$json = array(\"status\" => 0, \"message\" => \"Somthing went wrong. Please try again later\");\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$json = array(\"status\" => 0, \"message\" => \"Token has been not matched\");\n\t\t\t\t}\t\n\t\t\t}else{\n\t\t\t\t$json = array(\"status\" => 0, \"message\" => \"Request has been uncompleted\");\n\t\t\t}\n\t\t}else{\n\t\t\t$json = array(\"status\" => 0, \"message\" => \"Request method not accepted\");\n\t\t}\n\t\t$this->response($json, REST_Controller::HTTP_OK);\n\t}",
"public function _get_data($p_catd_list_id = null, $p_obj_id = null, $p_condition = \"\", $p_filter = null, $p_status = null)\n {\n $l_sql = \"SELECT isys_catg_drive_list.*, isys_obj.*, isys_stor_raid_level.*, isys_filesystem_type.*, isys_memory_unit.*, isys_catd_drive_type.* \" .\n \"isys_catg_stor_list.*, isys_catg_raid_list.*, isys_catg_ldevclient_list.*, \".\n \"FROM isys_catg_drive_list \" .\n \"LEFT OUTER JOIN isys_obj ON isys_catg_drive_list__isys_obj__id = isys_obj__id \" .\n \"LEFT OUTER JOIN isys_stor_raid_level ON isys_stor_raid_level__id = isys_catg_drive_list__isys_stor_raid_level__id \" .\n \"LEFT JOIN isys_filesystem_type ON isys_filesystem_type__id = isys_catg_drive_list__isys_filesystem_type__id \" .\n \"LEFT JOIN isys_memory_unit ON isys_memory_unit__id = isys_catg_drive_list__isys_memory_unit__id \" .\n\n \"LEFT JOIN isys_catd_drive_type ON isys_catd_drive_type__id = isys_catg_drive_list__isys_catd_drive_type__id \" .\n \"LEFT JOIN isys_catg_stor_list ON isys_catg_stor_list__id = isys_catg_drive_list__isys_catg_stor_list__id \" .\n \"LEFT JOIN isys_catg_raid_list ON isys_catg_raid_list__id = isys_catg_drive_list__isys_catg_raid_list__id \" .\n \"LEFT JOIN isys_catg_ldevclient_list ON isys_catg_ldevclient_list__id = isys_catg_drive_list__isys_catg_ldevclient_list__id \" .\n 'WHERE TRUE ' . $p_condition . $this->prepare_filter(\n $p_filter\n ) . ' ';\n\n if ($p_catd_list_id !== null)\n {\n $l_sql .= \" AND isys_catg_drive_list__id = \" . $this->convert_sql_id($p_catd_list_id);\n } // if\n\n if ($p_obj_id !== null)\n {\n $l_sql .= $this->get_object_condition($p_obj_id);\n } // if\n\n if ($p_status !== null)\n {\n $l_sql .= \" AND isys_catg_drive_list__status = \" . $this->convert_sql_id($p_status);\n } // if\n\n return $this->retrieve($l_sql . ';');\n }",
"public function get_list($params = [])\n {\n // Validate params\n $v = $this->validator($params);\n $v->set_rules('public_date', '掲載開始日', 'datetime_format');\n $v->set_rules('status', 'ステータス', 'required|valid_status_for_list|check_permission_status');\n $v->set_rules('public_status', '公開ステータス', 'required|valid_public_status|check_permission_public_status');\n $v->set_rules('limit', '取得件数', 'integer');\n $v->set_rules('offset', '取得開始', 'integer');\n\n if (FALSE === $v->run()) {\n // Return errors\n return $v->error_json();\n }\n\n // Set default for params\n if(!isset($params['sort_by']) || !in_array($params['sort_by'], ['id', 'title', 'started_at'])) {\n $params['sort_by'] = 'id';\n }\n\n // Set default for param sort position\n if(!isset($params['sort_position']) || !in_array($params['sort_position'], ['asc', 'desc'])) {\n $params['sort_position'] = 'desc';\n }\n\n // Set default offset, limit\n $this->_set_default($params);\n\n // Load model\n $this->load->model('news_model');\n\n // Build default query\n $this->news_model\n ->calc_found_rows()\n ->select('news.id, news.title, news.status, news.started_at, news.ended_at, news.created_at')\n ->order_by('news.'.$params['sort_by'], $params['sort_position'])\n ->limit($params['limit'])\n ->offset($params['offset']);\n\n // Filter by public date\n if( FALSE === empty($params['public_date']) && isset($params['public_date'])) {\n $this->news_model\n ->where('started_at <=', $params['public_date'])\n ->where('ended_at >=', $params['public_date'])\n ->where(['status'=>'public']);\n }\n\n // Filter by public status\n switch($params['public_status']) {\n case 'before_published':\n $this->news_model->where('started_at >=', business_date('Y-m-d H:i:s'));\n break;\n\n case 'available':\n $this->news_model->with_available();\n break;\n\n case 'expired':\n $this->news_model->where('ended_at <=', business_date('Y-m-d H:i:s'));\n break;\n\n case 'all':\n default:\n // No process code\n break;\n }\n\n // Filter by news status\n switch($params['status']) {\n case 'public':\n $this->news_model->with_public();\n break;\n\n case 'private':\n $this->news_model->with_private();\n break;\n\n case 'all':\n default:\n // No process code\n break;\n }\n\n // Return\n return $this->true_json([\n 'items' => $this->build_responses($this->news_model->all(),['public_status']),\n 'total' => (int) $this->news_model->found_rows()\n ]);\n }",
"function getBasesList(){\r\n \t$resourceUrl = \"/bases?Take=All\";\r\n\t\t$this->get($resourceUrl);\r\n\t\t// Check reponse 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 Bases Failed.\r\n\t\t\t\t\tStatus: %d\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$this->status_code,\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\treturn false;\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n }",
"public function index()\n {\n return response(Internship::paginate(10));\n }",
"public function list();",
"public function list();",
"public function list();",
"public function getCategories(){\n\t\t// preapres the request\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: ' . TOKEN));\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/category/\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t// send the request\n\t\t$output = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\n\t\t// decode the answer into a php object\n\t\t$categories = json_decode($output, true);\n\n\t\treturn $categories;\n\t}",
"function consultarCitas($idEspecie) { // consulta la lista de citas bibliográficas por $idEspecie\n\t// se busca en la tabla principal referencias\n\t$listaCitas = \"\";\n\t$query = \"SELECT citas_bibliograficas \n\t\t\t\t\t FROM especies \n\t\t\t\t\t WHERE id= $idEspecie\"; \n\t$res = ejecutarQuerySQL($query);\t\n\t$total = getNumFilas($res);\n\t\t\n\tif ($total == 0)\n\t $citas = \"No hay referencias registradas para esta especie.\";\n\telse {\t\t\t\t\n\t\t\t$actual = getFila($res);\n\t\t\t$listaCitas = $actual['citas_bibliograficas'];\n\t}\t\t\n\treturn $listaCitas;\n}",
"public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }",
"function listCategories(){\n\n\t\tglobal $conn;\n\n\t\t$query = \"SELECT id, name FROM Category\";\n\n\t\t$result = $conn->query($query);\n\n\t\treturn fetch_all($result);\n\n\t}"
] | [
"0.73719007",
"0.65760905",
"0.6469991",
"0.63762975",
"0.6276141",
"0.60002965",
"0.5978289",
"0.5959516",
"0.59532946",
"0.5922763",
"0.58598894",
"0.58037204",
"0.57913357",
"0.5782771",
"0.57759047",
"0.5771661",
"0.5736852",
"0.5723346",
"0.5710462",
"0.57065684",
"0.5699378",
"0.5687026",
"0.56847376",
"0.56711507",
"0.56711507",
"0.567058",
"0.5658557",
"0.5649795",
"0.5648563",
"0.5618572",
"0.5602633",
"0.5597151",
"0.55968106",
"0.5585689",
"0.55628127",
"0.55547404",
"0.55542314",
"0.5548858",
"0.55477476",
"0.55394423",
"0.5539373",
"0.5531326",
"0.5529693",
"0.5529257",
"0.55276465",
"0.55275756",
"0.5525802",
"0.5520999",
"0.55164516",
"0.5507958",
"0.5506667",
"0.5505606",
"0.5505203",
"0.5499508",
"0.5496948",
"0.5496521",
"0.54905415",
"0.54859895",
"0.5471865",
"0.5471667",
"0.54710716",
"0.54710716",
"0.5465579",
"0.5456755",
"0.54556936",
"0.54480016",
"0.5430975",
"0.5426566",
"0.54263055",
"0.54232955",
"0.5423109",
"0.54186445",
"0.54181165",
"0.5418105",
"0.54134923",
"0.54103214",
"0.5409351",
"0.5404939",
"0.54037964",
"0.5402564",
"0.5401444",
"0.5399646",
"0.5396352",
"0.5395782",
"0.5393237",
"0.5393203",
"0.5388078",
"0.5386798",
"0.5372674",
"0.53724074",
"0.5372223",
"0.53719014",
"0.5370918",
"0.5370102",
"0.5369918",
"0.5369918",
"0.5369918",
"0.53654695",
"0.5362864",
"0.5362641",
"0.53586304"
] | 0.0 | -1 |
/ Description Function is to save notes while the doctor's call is going on Author Dave Brown Created 05 March 2015 | public function save_appointment_outcomes ()
{
if (post_data('appointment_id') == NULL)
{
return;
}
$table_data = array();
$app_return_response = $app_status = array();
$table_data['id'] = post_data('id') != NULL ? post_data('id') : 0;
$table_data['appointment_id'] = post_data('appointment_id');
/*--------------------Updating third party's API----------------------------------------*/
/*Updating Refferal conclusion*/
if (post_data('patient_reference') != NULL)
{
$table_data['outcome_description']['patient_reference'] = post_data('patient_reference') != NULL ? post_data('patient_reference') : NULL;
$app_return_response['referal_response'] = post_curl_request(THIRD_PARTY_API_URL, json_encode(array(
"action" => "postoutcome",
"patientid" => post_data('patient_id'),
"appointmentid" => post_data('appointment_id'),
"outcomemaincode" => post_data('patient_reference'),
)));
}
/*Updating appointment conclusion*/
if (post_data('appointment_conclusion') != NULL)
{
$table_data['outcome_description']['appointment_conclusion'] = post_data('appointment_conclusion') != NULL ? post_data('appointment_conclusion') : NULL;
$app_return_response['outcome_response'] = post_curl_request(THIRD_PARTY_API_URL, json_encode(array(
"action" => "postoutcome",
"patientid" => post_data('patient_id'),
"appointmentid" => post_data('appointment_id'),
"outcomemaincode" => post_data('appointment_conclusion'),
)));
}
/*-------------------------Updating third party's Database Ends-------------------------*/
if (!empty($app_return_response))
{
foreach ($app_return_response as $key => $val)
{
if (!empty($val) && json_decode($val) && !empty(json_decode($val)->Status) && json_decode($val)->Status == 1)
{
$app_status[$key] = TRUE;
}
else
{
$app_status[$key] = FALSE;
}
}
}
$table_data['outcome_description'] = !empty($table_data['outcome_description']) ? json_encode($table_data['outcome_description']) : NULL;
$presc_id = $this->appointment_model->save_prescription($table_data);
exit(json_encode(array(
'presc_id' => $presc_id,
'app_status' => $app_status,
)));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addPatientNotesToDatabase($fileNumber, $name, $phoneNo, $dateOfBirth, $progressNotes, $dentist)\n{\n $result = ['result' => false, 'message' => 'Unable to save patient Notes !'];\n $isPatientDataValid = isPatientDataValid($fileNumber, $name, $phoneNo, $dateOfBirth);\n if (!$isPatientDataValid['result']) {\n $result['message'] = $isPatientDataValid['message'];\n return $result;\n }\n $data = [\n 'FileNumber' => $fileNumber,\n 'PatientName' => $name,\n 'PatientNo' => $phoneNo,\n 'DOB' => $dateOfBirth,\n 'DentistName' => $dentist,\n ];\n $data['AppointmentDate'] = getDefaultDate();\n $data['AppointmentTime'] = getDefaultDate(null, true);\n $isDentistAvailable = isDentistAvailable($data['DentistName'], $data['AppointmentTime']);\n if (!$isDentistAvailable['result']) {\n $result['message'] = $isDentistAvailable['message'];\n return $result;\n }\n $data['ProgressNotes'] = $progressNotes;\n $appObject = getAppointmentObject($data);\n $appObject = setAppointmentId($appObject);\n $patientSaved = saveRecord(APPOINTMENTS_COLLECTION, $appObject, true);\n\n if ($patientSaved) {\n $result['message'] = \"Patient Notes Saved Successfully\";\n $result['result'] = true;\n return $result;\n }\n return $result;\n}",
"function __updateNotes()\n {\n\n //profiling\n $this->data['controller_profiling'][] = __function__;\n\n //prevent direct access\n if (!isset($_POST['posted'])) {\n //redirect to 'view' url instead\n $this_url = uri_string();\n $redirect = str_replace('update', 'view', $this_url);\n redirect($redirect);\n }\n\n //save sql here\n $result = $this->mynotes_model->updateNote($this->project_id, $this->data['vars']['my_id'], $this->input->post('mynotes_text'));\n $this->data['debug'][] = $this->mynotes_model->debug_data;\n\n //check\n if ($result) {\n $this->notices('success', $this->data['lang']['lang_request_has_been_completed'], 'noty'); //noty or html\n } else {\n $this->notices('error', $this->data['lang']['lang_request_could_not_be_completed'], 'noty'); //noty or html\n }\n\n //get the note\n $this->__viewNotes();\n\n }",
"function save_note_to_disk ($note_id, $content) {\n \n if (!file_exists ('notes')) {\n # MAKE DIRECTORY\n mkdir ('notes');\n }\n \n $filename = \"notes/{$note_id}.txt\";\n \n if (!$handler = fopen ($filename, 'w+')) {\n return FALSE;\n }\n \n fwrite ($handler, $content);\n \n fclose ($handler);\n \n return TRUE;\n \n }",
"function createNote();",
"function __editNotes()\n {\n\n //profiling\n $this->data['controller_profiling'][] = __function__;\n\n //get the note\n $this->__viewNotes();\n\n //visibility\n $this->data['visible']['wi_my_note_edit'] = 1;\n $this->data['visible']['wi_my_note_view'] = 0;\n\n }",
"public function actionSaveNotes()\r\n\t{\n\t\tif(isset($_POST['note']) && isset($_POST['id'])) {\n\t\t\t$employee_id = $_POST['id'];\n\t\t\t$model = $this->loadModel($employee_id, Yii::app()->user->id);\r\n\t\t\t$model->note = $_POST['note'];\n\t\t\t//var_dump($model);die;\r\n\t\t\t$model->save();\r\n\t\t\techo nl2br($model->note);\r\n\t\t}\r\n\t}",
"public function saveNotes(){\n\t \t$note = $this->input->post('notes');\n\t \t$barcode = $this->input->post('child_barcode');\n\n\t \t$update_note = $this->db->query(\"UPDATE LZ_DEKIT_US_DT SET PIC_NOTES = '$note' WHERE BARCODE_PRV_NO = $barcode\");\n\n\t \tif($update_note){\n\t \t\treturn 1;\n\t \t}else{\n\t \t\treturn 0;\n\t \t}\n\n\t }",
"function cust_note_insert(){\r\n\t}",
"public function add_note()\n {\n\n $cols = \"`desc`\";\n\n $value =\n \" '\" . $this->obj->all_data->notes->get_desc() . \"' \";\n\n\n $insert = $this->obj->insert(\"notes\", $cols, $value);\n return $insert;\n }",
"public function saveNote(array $note);",
"function saveSampleNotes() {\n\t \n\t \n\t \n\t $data = $this->input->post();\n\t \t \t \n\t if ($this->products_model->saveSampleNotes($data)) {\n\t \n\t \tdie(nl2br($data['notes']));\t \t \n\t \t \t \n\t } else {\n\t\t \n\t\t die(\"ERROR\");\n\t\t \n\t }\n\t \t \n\t \n\t \n }",
"public function saveSellerNotes($id, $notes){\n dibi::update('orders', array('seller_notes' => $notes))\n ->where('order_id = %i', $id)->execute();\n }",
"function addNote()\n {\n $replace = array();\n\n //current logged in user details\n $userInfo = $this->userInfo();\n\n $patientId = $this->value('patient_id');\n\n $msg = \"\";\n\n //save button clicked!\n if(\"Save\" == $this->value('submitted'))\n {\n $newNote = $this->value('note');\n\n if(strlen(trim($newNote)) == 0)\n {\n $msg = '<div style=\"padding-left:5px;color:red;\">Please enter a note for this patient.</div>';\n }\n else\n {\n $insertArr = array(\n 'patient_id' => $patientId,\n 'provider_id' => $userInfo['user_id'],\n 'note' => $this->encrypt_data($this->value('note')),\n 'created' => date('Y-m-d H:i:s', time())\n );\n\n $result = $this->insert('notepad', $insertArr);\n\n /* if(!$result)\n {\n $msg = '<div style=\"padding-left:5px;\">Failed adding a note.</div>';\n } */\n }\n $privateKey = $this->config['private_key'];\n\n // patient details\n $query = \"SELECT \n AES_DECRYPT(UNHEX(name_first),'{$privateKey}') as name_first,\n AES_DECRYPT(UNHEX(name_last),'{$privateKey}') as name_last \n FROM \n user WHERE user_id = \" . $patientId;\n $result = $this->execute_query($query);\n\n $row = $this->fetch_array($result);\n\n $replace = $this->notesList($patientId);\n $patientName = $row['name_first'] . \" \" . $row['name_last'];\n $replace['patient_id'] = $patientId;\n $replace['patientName'] = $patientName;\n $replace['statusMessage'] = $msg;\n }\n else\n {\n $replace = $this->notesList($patientId);\n }\n\n $replace['patient_id'] = $patientId;\n\n $this->output = $this->build_template($this->get_template(\"addNote\"), $replace);\n }",
"public function record_comment(){\n\t\t\t\n\t\t}",
"public function save_appointment_notes ()\n {\n if (post_data('appointment_id') == NULL)\n {\n return;\n }\n $table_data = array();\n $presc_status = FALSE;\n $app_response = $app_return_response = $app_status = array();\n\n $table_data['id'] = post_data('id') != NULL ? post_data('id') : 0;\n $table_data['appointment_id'] = post_data('appointment_id');\n $table_data['history'] = post_data('history') != NULL ? post_data('history') : NULL;\n $table_data['examination'] = post_data('examination') != NULL ? post_data('examination') : NULL;\n $table_data['diagnosis'] = post_data('diagnosis') != NULL ? post_data('diagnosis') : NULL;\n $table_data['management'] = post_data('management') != NULL ? post_data('management') : NULL;\n $table_data['medicine_prescription'] = post_data('prescription') != NULL ? json_encode(post_data('prescription')) : NULL;\n $table_data['icd_description'] = post_data('icd_list') != NULL ? json_encode(post_data('icd_list')) : NULL;\n $table_data['repeat_prescription'] = post_data('repeat_prescription') != NULL ? post_data('repeat_prescription') : 0;\n\t\t\n /*--------------------Updating third party's API----------------------------------------*/\n if (post_data('create_prescription') == TRUE)\n {\n $prescription = make_prescription_format(post_data('prescription'));\n\n /*Creating Prescription at Third Party's database*/\n $app_response = post_curl_request(THIRD_PARTY_API_URL, json_encode(array(\n \"action\" => \"postcreateprescription\",\n \"patientid\" => post_data('patient_id'),\n \"appointmentid\" => post_data('appointment_id'),\n \"doctorid\" => session_data('app_user_id'),\n \"endorsements\" => count(post_data('prescription')),\n \"patientname\" => post_data('PatientForename') . ' ' . post_data('PatientSurname'),\n \"deliveryaddress\" => post_data('PatientAddress1') . ' ' .\n post_data('PatientAddress2') . ' ' . post_data('PatientAddress3') . ' ' .\n post_data('PatientAddress3') . '' . post_data('PatientAddress4') . ' ' .\n post_data('PatientAddress5'),\n \"DOB\" => post_data('PatientDOB'),\n \"Age\" => post_data('PatientDOB') != NULL ? date('Y') - date('Y', uk_date_to_stamp(post_data('PatientDOB'))) : NULL,\n \"telephone\" => post_data('PatientMobile'),\n \"deliverynote\" => \"New Prescription\",\n \"repeatprescription\" => post_data('repeat_prescription'),\n \"endorsement\" => $prescription\n )));\n\n /* Updating Icd at Third Party's database */\n if (post_data('icd_list') != NULL)\n {\n $app_return_response['icd_response'] = post_curl_request(THIRD_PARTY_API_URL, json_encode(array(\n \"action\" => \"postICDtopatient\",\n \"patientid\" => post_data('patient_id'),\n \"appointmentid\" => post_data('appointment_id'),\n \"icdcodeselected\" => post_data('icd_list')['key'],\n \"icdtitleselected\" => post_data('icd_list')['value'],\n )));\n }\n\n /*Creating patient notes at Third Party's database*/\n $app_return_response['patient_notes_response'] = post_curl_request(THIRD_PARTY_API_URL, json_encode(array(\n \"action\" => \"postpatientnotes\",\n \"patientid\" => post_data('patient_id'),\n \"appointmentid\" => post_data('appointment_id'),\n \"doctorid\" => session_data('app_user_id'),\n \"history\" => post_data('history'),\n \"examination\" => post_data('examination'),\n \"diagnosis\" => post_data('diagnosis'),\n \"management\" => post_data('management'),\n )));\n \n if (!empty($app_response) && json_decode($app_response))\n {\n $presc_status = TRUE;\n $table_data['app_id'] = json_decode($app_response);\n\n /* Signing Prescription and updating Third Party's database*/\n $app_return_response['sign_response'] = post_curl_request(THIRD_PARTY_API_URL, json_encode(array(\n \"action\" => \"prescriptionsign\",\n \"prescriptionid\" => $table_data['app_id'],\n \"doctorid\" => session_data('app_user_id')\n )));\n\n }\n\t\t\t/*-------------------------Updating third party's Database Ends-------------------------*/\n if (!empty($app_return_response))\n {\n\t\t\t\tforeach ($app_return_response as $key => $val)\n\t\t\t\t{\n\t\t\t\t\tif (!empty($val) && json_decode($val) && !empty(json_decode($val)->Status) && json_decode($val)->Status == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$app_status[$key] = TRUE;\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$app_status[$key] = FALSE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n \n }\n \n $presc_id = $this->appointment_model->save_prescription($table_data);\n \n exit(json_encode(array(\n 'presc_id' => $presc_id,\n 'presc_status' => $presc_status,\n 'app_status' => $app_status,\n )));\n }",
"public function save(KnsprNote $note);",
"public function save($userId,$notes=null)\n\t{ \n $newILOIds = Content::getILOIds($this->content);\n $oldILOIds = array();\n\n # Update existing discussion\n if(!empty($this->id))\n {\n $query = sprintf(\"SELECT content FROM discussion WHERE id='%s'\",pg_escape_string($this->id));\n $result = $GLOBALS['transaction']->query($query);\n $oldILOIds = Content::getILOIds($result[0]['content']);\n $query = sprintf(\"UPDATE discussion SET element_id = '%s', element_type = '%s', content = '%s' WHERE id='%s'\", \n pg_escape_string($this->elementId),\n pg_escape_string($this->elementType),\n pg_escape_string($this->content),\n pg_escape_string($this->id));\n }\n # New discussion\n else\n {\n $query = sprintf(\"INSERT INTO discussion (element_id, element_type, content) VALUES ('%s','%s','%s')\",\n pg_escape_string($this->elementId),\n pg_escape_string($this->elementType),\n pg_escape_string($this->content));\n }\n\n # Run query\n $GLOBALS['transaction']->query($query,\"Query \".$query.\" failed in Discussion::save()\");\n\n $this->id = parent::URIToId($this->path,\"discussion\");\n $revisionRow = new RevisionRow(\"discussion_history\",\"discussion\");\n $revisionRow->loadFromData(null,$this->id,$this->name,$this->content,$userId,null);\n $revisionRow->save();\n \n require_once(\"classes/resources/Lesson.php\");\n Content::checkILOsExist($this->ilos,$newILOIds);\n $this->saveIlos($userId,$newILOIds,$oldILOIds);\n $this->saveCitations();\n\n return true;\n\t}",
"public function SaveNote($note)\n {\n $dataArray = $this->getAllNotes();\n\n if (array_key_exists($note->getNoteID(), $dataArray)) {\n try {\n $dbh = new \\PDO('sqlite:' . $this->fileName);\n $dbh->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n $sql = \"UPDATE note SET subjectLine='\" . $note->getSubjectLine() . \"', authorName='\" . $note->getAuthorName() . \"', date='\" . $note->getDate() . \"', noteBody='\" . $note->getNoteBody() . \"', numOfChar=\" . $note->getNumOfChar() . \" WHERE id=\" . $note->getNoteID();\n // $sql = \"UPDATE note SET subjectLine= :subjectLine, authorName= :authorName , date= :date, noteBody= :noteBody, numOfChar= :numOfChar WHERE id= :id\";\n\n\n // Prepare statement\n $stmt = $dbh->prepare($sql);\n/*\n $stmt->bindParam(':subjectLine',$note->getSubjectLine() , PDO::PARAM_STR, 12);\n $stmt->bindParam(':authorName', $note->getAuthorName() , PDO::PARAM_STR, 12);\n $stmt->bindParam(':noteBody', $note->getNoteBody() , PDO::PARAM_STR, 12);\n $stmt->bindParam(':date', $note->getDate() , PDO::PARAM_STR, 12);\n $stmt->bindParam(':numOfChar', $note->getNumOfChar(), PDO::PARAM_INT);\n $stmt->bindParam(':id', $note->getNoteID(), PDO::PARAM_INT);\n*/\n // execute the query\n $stmt->execute();\n\n // echo a message to say the UPDATE succeeded\n echo $stmt->rowCount() . \" records UPDATED successfully\";\n } catch (PDOException $e) {\n echo $sql . \"<br>\" . $e->getMessage();\n }\n\n $conn = null;\n\n } else {\n //echo \"No note key found\";\n try {\n $dbh = new \\PDO('sqlite:' . $this->fileName);\n $dbh->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n\n\n $dbh->exec(\"INSERT INTO note (subjectLine,noteBody,authorName,date,numOfChar) VALUES ('\" . $note->getSubjectLine() . \"','\" . $note->getNoteBody() . \"','\" . $note->getAuthorName() . \"','\" . $note->getDate() . \"',\" . $note->getNumOfChar() . \")\");\n\n\n $dbh = null;\n } catch (PDOException $e) {\n echo $e->getMessage();\n echo '<a href=\"index.php\" role=\"button\" class=\"btn btn-primary btn-lg\">Home</a>';\n exit(0);\n }\n }\n\n\n }",
"public function save_donation();",
"public function save_donation() {\r\n\t\t/**\r\n\t\t * Do something here, or save it elsewhere?\r\n\t\t */\r\n\t}",
"function submitNote() {\n $stmt = $GLOBALS['con']->prepare(\"INSERT INTO customerNotes (customer_id, note) VALUES (?, ?)\");\n $stmt->bind_param(\"ss\", $uid, $note);\n \n $note = validateInput('notepad', 'post');\n $uid = validateInput('uid', 'post');\n\n $stmt->execute();\n $stmt->close(); \n }",
"function save_me($creation, $dwl_number, $dwl_last) {\n\n}",
"public function setNotes($value) {\n\t\tif ($value == NULL) {\n\t\t\t$this->_notes = \"\";\n\t\t} else {\n\t\t\t$this->_notes = $value;\n\t\t}\n\t}",
"public function addnotesAction() {\n\t\t$this->_helper->viewRenderer->setNoRender();\n\t\t$this->_helper->layout()->disableLayout();\n\t\t$id = $this->_getParam('taid');\n\t\t$taFinder = new TeachingActivities();\n\t\t$ta = $taFinder->getTa($id);\n\t\t$notes = stripslashes(strip_tags($this->_getParam('value')));\n\t\t$ta->notes = preg_replace('/[\\r\\n]+/', ' ', $notes);\n\t\t$ta->save();\n\t\techo $ta->notes;\n\t}",
"function editPatientNotesInDatabase($fileNumber, $name, $phoneNo, $dateOfBirth, $firebaseId, $progressNotes)\n{\n $result = ['result' => false, 'message' => 'Unable to edit patient notes !'];\n\n $isPatientDataValid = isPatientDataValid($fileNumber, $name, $phoneNo, $dateOfBirth);\n if (!$isPatientDataValid['result']) {\n $result['message'] = $isPatientDataValid['message'];\n return $result;\n }\n if (!$firebaseId) {\n $result['message'] = 'Please Select Patient Again';\n return $result;\n }\n\n $data = [];\n $patient = getAppointments(['param' => 'FirebaseId', 'operator' => '==', 'value' => $firebaseId], true);\n if (count($patient) > 0) {\n $data = $patient; // old data\n }\n $data['FirebaseId'] = $firebaseId;\n $data['FileNumber'] = $fileNumber;\n $data['PatientName'] = $name;\n $data['PatientNo'] = $phoneNo;\n $data['DOB'] = $dateOfBirth;\n\n $data['ProgressNotes'] = $progressNotes;\n $appObject = getAppointmentObject($data);\n $appObject = setAppointmentId($appObject);\n $patientSaved = saveRecord(APPOINTMENTS_COLLECTION, $appObject, false);\n\n if ($patientSaved) {\n $result['message'] = \"Patient Notes Saved Successfully\";\n $result['result'] = true;\n return $result;\n }\n return $result;\n}",
"function edit_notes()\n {\n $query = $this->pdo->prepare('UPDATE note SET description=:description, updated_at=NOW() WHERE id=:id');\n $query->execute(array( ':description' => $_POST['edit-note-text'] ,':id' => $_POST['edit-note-id']));\n \n }",
"public function writeNotes()\n {\n if (is_null($this->notes)) {\n throw new Exception('$notes is null');\n }\n\n $fh = fopen($this->pageNotesPath(), 'w');\n fwrite($fh, implode(\"\\n\", $this->notes));\n fclose($fh);\n }",
"private function saveRecord(): void\r\n {\r\n $this->order->add_meta_data('_moloni_sent', $this->document_id);\r\n $this->order->save();\r\n }",
"function warquest_home_comment_save_do() {\r\n\r\n\t/* input */\r\n\tglobal $player;\r\n\tglobal $uid;\r\n\tglobal $other;\r\n\tglobal $comment;\r\n\r\n\t/* output */\r\n\tglobal $output;\r\n\r\n\tif (strlen($comment)>0) {\r\n\t\r\n\t\tif ($uid==0) {\r\n\t\t\twarquest_db_comment_insert(0, 0, $player->pid, $other->pid, $comment);\r\n\t\t} else {\t\t\r\n\t\t\twarquest_db_comment_update($uid, $comment);\r\n\t\t}\r\n\t\t\r\n\t\tif (isset($other->pid)) {\r\n\t\t\r\n\t\t\t$other->comment_notification++;\r\n\t\t\twarquest_comment_mail($other->pid, $comment, $player->name);\r\n\t\t\t$message = t('ALLIANCE_COMMENT_PLAYER', player_format($other->pid, $other->name, $other->country));\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\r\n\t\t\t$message = t('ALLIANCE_COMMENT_ALL');\r\n\t\t\twarquest_info(\"Post message: \".$comment);\t\t\r\n\t\t}\t\t\r\n\r\n\t\t/* Clear input parameters */\r\n\t\t$uid = 0;\r\n\t\t\r\n\t\t$output->popup .= warquest_box_icon(\"info\", $message);\r\n\t}\r\n}",
"public function noteAdd(){\n $user = $this->_ap_right_check();\n if(!$user){\n return;\n } \n $this->Notes->add($user);\n }",
"public function save()\n {\n\n $url = parse_url($this->params->url);\n $path = $url['path'];\n $note = new Note(array('url' => $path));\n $note->load();\n\n // Get the new note config\n\n $config = json_decode($this->params->config);\n\n // Can we read or edit it?\n\n $can_read = $this->can_read($note);\n $can_edit = $can_read ? $this->can_edit($note) : FALSE;\n\n // Edit the note (if allowed)\n\n $old_notes = $note->notes;\n if ($config->notes)\n {\n $note->notes = json_encode($config->notes);\n $note->words = Note::words($config->notes);\n }\n if ($config->photo) $note->photo = $config->photo;\n if ($config->paper) $note->paper = $config->paper;\n if ($config->readers) $note->readers = $config->readers;\n if ($config->editors) $note->editors = $config->editors;\n if ($can_edit) $note->save();\n $this->render->data = array(\n 'now' => time(),\n 'diff' => $can_read ? $this->diff($old_notes, $note->notes) : NULL,\n 'paper' => $can_read ? $note->paper : 'secret',\n 'photo' => $note->photo,\n 'readers' => $note->readers,\n 'editors' => $note->editors,\n 'is_owner' => $this->is_owner,\n 'can_read' => $can_read,\n 'can_edit' => $can_edit,\n 'notelist' => $this->recent(),\n );\n\n // Log the info\n\n $action = $can_edit ? 'saved' : 'viewed';\n Log::info($this->host_ip . \" $action a note at $path\");\n }",
"public function noteAdd(){\n $user = $this->_ap_right_check();\n if(!$user){\n return;\n }\n $this->Notes->add($user);\n }",
"public function setNotes($value)\n {\n $this->setItemValue('notes', (string)$value);\n }",
"function saveText($userID, $note){\n\t\t\n\t\t//call function in dbDials.php\n\t\treturn newAnnotation($userID, $note);\n\t}",
"public function save()\n {\n \tif($this->announcement_id == null)\n \t{\n \t\t$this->db->insert(\"Announcements\", array(\n \t\t\t\t\"title\" => $this->title,\n \t\t\t\t\"content\" => $this->content,\n \t\t\t\"posted_by\" => $this->posted_by\n \t\t));\n \t\t$this->announcement_id = $this->db->insert_id();\n \t}\t\n \telse\n \t{\n \t\t$update_data = array(\n \t\t\t\"title\" => $this->title,\n\t\t\t\t \"content\" => $this->content,\n \t\t\t\"posted_by\" => $this->posted_by\n \t);\n \t\t$this->db->where(\"announcement_id\", $this->announcement_id);\n \t\t$this->db->update(\"Announcements\", $update_data);\n \t}\n }",
"public function setPersonNotes($value)\n {\n $this->setProperty(\"PersonNotes\", $value, true);\n }",
"function insertNote($prj_id, $customer_id, $note)\n {\n $stmt = \"INSERT INTO\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"customer_note\n (\n cno_prj_id,\n cno_customer_id,\n cno_created_date,\n cno_updated_date,\n cno_note\n ) VALUES (\n \" . Misc::escapeInteger($prj_id) . \",\n \" . Misc::escapeInteger($customer_id) . \",\n '\" . Date_Helper::getCurrentDateGMT() . \"',\n '\" . Date_Helper::getCurrentDateGMT() . \"',\n '\" . Misc::escapeString($note) . \"'\n )\";\n $res = DB_Helper::getInstance()->query($stmt);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return -1;\n } else {\n return 1;\n }\n }",
"function saveStickyNote($menu, $description, $popup)\n{\n include_once \"libs/paloSantoACL.class.php\";\n $arrResult['status'] = FALSE;\n $arrResult['msg'] = _tr(\"Please your session id does not exist. Refresh the browser and try again.\");\n if($menu != \"\"){\n $user = isset($_SESSION['elastix_user'])?$_SESSION['elastix_user']:\"\";\n global $arrConf;\n $pdbACL = new paloDB(\"sqlite3:///$arrConf[elastix_dbdir]/acl.db\");\n $pACL = new paloACL($pdbACL);\n $id_resource = $pACL->getResourceId($menu);\n $uid = $pACL->getIdUser($user);\n $date_edit = date(\"Y-m-d h:i:s\");\n if($uid!==FALSE){\n $exist = false;\n $query = \"SELECT * FROM sticky_note WHERE id_user = ? AND id_resource = ?\";\n $arr_result1 = $pdbACL->getFirstRowQuery($query, TRUE, array($uid, $id_resource));\n if($arr_result1 !== FALSE && count($arr_result1) > 0)\n $exist = true;\n\n if($exist){\n $pdbACL->beginTransaction();\n $query = \"UPDATE sticky_note SET description = ?, date_edit = ?, auto_popup = ? WHERE id_user = ? AND id_resource = ?\";\n $r = $pdbACL->genQuery($query, array($description, $date_edit, $popup, $uid, $id_resource));\n if(!$r){\n $pdbACL->rollBack();\n $arrResult['status'] = FALSE;\n $arrResult['msg'] = _tr(\"Request cannot be completed. Please try again or contact with your elastix administrator and notify the next error: \").$pdbACL->errMsg;\n return $arrResult;\n }else{\n $pdbACL->commit();\n $arrResult['status'] = TRUE;\n $arrResult['msg'] = \"\";\n return $arrResult;\n }\n }else{\n $pdbACL->beginTransaction();\n $query = \"INSERT INTO sticky_note(id_user, id_resource, date_edit, description, auto_popup) VALUES(?, ?, ?, ?, ?)\";\n $r = $pdbACL->genQuery($query, array($uid, $id_resource, $date_edit, $description, $popup));\n if(!$r){\n $pdbACL->rollBack();\n $arrResult['status'] = FALSE;\n $arrResult['msg'] = _tr(\"Request cannot be completed. Please try again or contact with your elastix administrator and notify the next error: \").$pdbACL->errMsg;\n return $arrResult;\n }else{\n $pdbACL->commit();\n $arrResult['status'] = TRUE;\n $arrResult['msg'] = \"\";\n return $arrResult;\n }\n }\n }\n }\n return $arrResult;\n}",
"public function updateBackupNote()\n {\n $encrypt = $this->services['encrypt'];\n $file_name = $encrypt->decode($this->getPost('backup'));\n $backup_type = stripslashes_deep($this->getPost('backup_type'));\n $note_text = stripslashes_deep($this->getPost('note_text')); \n if($note_text && $file_name)\n {\n $path = rtrim($this->settings['working_directory'], DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.$backup_type;\n $this->services['backup']->getDetails()->addDetails($file_name, $path, array('note' => $note_text));\n echo json_encode(array('success'));\n }\n exit;\n }",
"protected function _Store_Note() {\n\t\tglobal $wpdb; \n // Submission table name (including wp prefix)\n $entry_notes_table = $this->Get_Notes_Table(); \n // Retrieve the storage data\n $store_note = $this->store_note;\n // If there are no store fields, return out\n if (!$store_note || !is_array($store_note)) { return array(); }\n // Check for an existing record\n $existing = $wpdb->get_row($wpdb->prepare(\"SELECT uuid FROM $entry_notes_table WHERE form_uuid = %s AND entry_uuid = %s AND uuid = %s\", $store_note['form_uuid'], $store_note['uuid'], $store_note['uuid']));\n // If a record was returned\n if ($existing) { die('existing');\n // Attempt to store the entry data\n $result = $wpdb->update($entry_notes_table, $store_note, array('uuid' => $existing->uuid));\n } // Otherwise attempt to insert a new record \n else { $result = $wpdb->insert($entry_notes_table, $store_note); }\n // If the insert failed\n if ($result === false) { die('Note value failed to insert'); }\n // Store the result id\n $this->store_note['id'] = $wpdb->insert_id; \n // Return the inserted id\n return $this->store_note;\n }",
"static function add_notes(): void {\r\n\t\tself::add_acf_inner_field(self::divisions, self::notes, [\r\n\t\t\t'label' => 'Notes',\r\n\t\t\t'type' => 'text',\r\n\t\t\t'instructions' => 'Any notes pertinent to the division.',\r\n\t\t\t'required' => 0,\r\n\t\t\t'conditional_logic' => 0,\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '40',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t]\r\n\t\t]);\r\n\t}",
"protected function saveDeckNoteReturn()\n {\n $request = $this->request();\n $player = $this->getCurrentPlayer();\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_note');\n\n $this->assertParamsExist(['content']);\n\n $this->service()->deck()->saveNote($deck, $request['content']);\n\n $this->result()\n ->setCurrent('Decks_edit')\n ->setInfo('Deck note saved');\n }",
"public function save()\n {\n parent::save();\n\n $oRemark = oxNew(\"oxremark\");\n\n // try to load if exists\n $oRemark->load(oxRegistry::getConfig()->getRequestParameter(\"rem_oxid\"));\n\n $oRemark->oxremark__oxtext = new oxField(oxRegistry::getConfig()->getRequestParameter(\"remarktext\"));\n $oRemark->oxremark__oxheader = new oxField(oxRegistry::getConfig()->getRequestParameter(\"remarkheader\"));\n $oRemark->oxremark__oxparentid = new oxField($this->getEditObjectId());\n $oRemark->oxremark__oxtype = new oxField(\"r\");\n $oRemark->save();\n }",
"public function save()\n\t {\n\t\tif (isset($this->_advert->date) === true && isset($this->_advert->phone) === true)\n\t\t {\n\t\t\t$bigfile = new BigFile(\"base-\" . $this->_advert->phone, 10);\n\t\t\t$bigfile->addrecord($this->_advert->date);\n\t\t } //end if\n\n\t }",
"function getPatientNote($appointmentRecord)\n{\n // only show dentist note, viewing details like crown and carries requires clicking edit\n // then viewing notes edit page with all data filled in\n if (!isset($appointmentRecord['ProgressNotes'])) {\n return null;\n }\n $progressNotes = $appointmentRecord['ProgressNotes'];\n if (!is_array($progressNotes)) {\n return null;\n }\n\n $date = getDefaultDate();\n if (isset($appointmentRecord['AppointmentDate'])) {\n if (dateIsCorrupted($appointmentRecord['AppointmentDate'])) {\n $appointmentRecord['AppointmentDate'] = $date; // set to default\n } else { // otherwise\n $date = $appointmentRecord['AppointmentDate'];\n }\n }\n // set supported date format for date input(yyyy-mm-dd)\n $appointmentRecord['AppointmentDate'] = getNiceDate($date, 'Y-m-d');\n\n // set value for date column to format Dec 31, 2021\n $date = getNiceDate($date);\n $appointmentRecord['Date'] = $date;\n $appointmentRecord['ProgressNotes'] = $progressNotes;\n $appointmentRecord['Note'] = isset($progressNotes['Note']) ? $progressNotes['Note'] : 'edit to add notes';\n return $appointmentRecord;\n /* use commented array if keys in appointment record are not similar to keys required\n by calling method\n * [\n 'PatientName' => $appointmentRecord['PatientName'],\n 'DentistName' => $appointmentRecord['DentistName'],\n 'PatientNo' => $appointmentRecord['PatientNo'],\n 'FileNumber' => $appointmentRecord['FileNumber'],\n 'DOB' => $appointmentRecord['DOB'],\n 'Date' => $date,\n 'Note' => $progressNotes['Note'],\n 'AppointmentDate' => $appointmentRecord['AppointmentDate'],\n 'FirebaseId' => $appointmentRecord['FirebaseId'],\n 'ProgressNotes' => $progressNotes,\n ]*/\n}",
"public function store()\n\t{\n\t\t$post = array(\n\t\t\t'user_id'=>Input::get('user_id'),\n\t\t\t'type'=>Input::get('type'),\n\t\t\t'note'=>Input::get('note'),\n\t\t\t'info'=>Input::get('info')\n\t\t);\n\t\t\n\t\tNotes::create($post);\n\t\treturn Redirect::route('admin.notes.index');\n\t\t\n\t\t\n\t}",
"function save_comment($comment_id)\n {\n }",
"public function store(Request $request)\n {\n $notes=new Notes();\n $user_id=Auth::user()->id;\n $notes->subject=$request->subject;\n $notes->topic=$request->topic;\n if($request->hasfile('notes'))\n {\n $file = $request->file('notes');\n $extension = $file->getClientOriginalExtension(); // getting image extension\n $filename =time().'.'.$extension;\n $file->move('notes', $filename);\n }\n\n $notes->notes_file=$filename;\n $notes->description=$request->desc;\n $notes->user_id=$user_id;\n $notes->branch=$request->branch;\n $notes->date = Carbon::now()->format('Y-m-d');\n $notes->save();\n return redirect(\"subnotes/$notes->subject\");\n\n }",
"public function add_note($data){\n $this->db->insert('notes', $data);\n \t return $idOfInsertedData = $this->db->insert_id();\n }",
"public function add($name,$notes,$group_id) {\t\tif($name == 'fuck') $name = 'ASDFASDF';\n\n\t\t$this->create();\n\t\t$this->save(array(\n\t\t\t'group_id' => $group_id,\n\t\t\t'name' => $name,\n\t\t\t'notes' => $notes\n\t\t));\n\t}",
"public\tfunction\tsave()\n\t\t{\n\t\t}",
"public function save()\n {\n $now = new DateTime();\n $this->timestamp = $now->getTimestamp();\n self::setClassAndTable();\n parent::saveModel();\n\n $this->id = parent::getLastID();\n\n // Send notification to watchers\n $post = Post::find([\"id\" => $this->post_id]);\n $owner = $post->user();\n $watchers = $post->watchers();\n foreach ($watchers as $user) {\n $notif = new Notification();\n $notif->user_id_from = $owner->id;\n $notif->user_id_to = $user->id;\n $notif->type = Notification::WATCHLIST_UPDATE;\n $notif->link = \"/posts/view.php?post_id=$post->id\";\n $notif->save();\n }\n }",
"public function comedit()\n {\n $commentId = Input::get('pk');\n //get the new marks\n $comment = Input::get('value');\n //get the Student Data Row to be updated with new marks\n $commentData = Comments::whereId($commentId)->first();\n $commentData->content = $comment;\n\n $commentData->save();\n\n\n\n }",
"function saveSQL($data,$filename,$remark)\r\n {\r\n $handle = fopen($filename,\"a\");\r\n fwrite($handle,\"-- --\".date(\"D M j G:i:s\").\" $remark\\n \".$data.\"\\n\");\r\n fclose($handle);\r\n }",
"public function addNote($project_id, $student_id, $notes_title, $notes_content, $db)\r\n {\r\n $sql= \"INSERT INTO notes (project_id, student_id, notes_title, notes_content)\r\n VALUES (:project_id, :student_id, :notes_title, :notes_content)\";\r\n\r\n $pst = $db->prepare($sql);\r\n\r\n $pst->bindParam(':project_id', $project_id);\r\n $pst->bindParam(':student_id', $student_id);\r\n $pst->bindParam(':notes_title', $notes_title);\r\n $pst->bindParam(':notes_content', $notes_content);\r\n\r\n $count = $pst->execute();\r\n return $count;\r\n }",
"public function saveDisputeContents($order,$timestamp,$message,$autor){\n dibi::insert('disputes', array('order' => $order, 'message' => $message,\n 'timestamp' => $timestamp, 'autor' => $autor))->execute();\n }",
"public function process() {\r\n $notes = $this->getProperty('content','');\r\n if (empty($notes)) return $this->failure($this->modx->lexicon('admintools_err_empty_file'));\r\n $path = $this->modx->getOption('admintools_core_path', NULL, $this->modx->getOption('core_path') . 'components/admintools/').\"elements/tmp/\";\r\n $file = $path.'notes.txt';\r\n if (!file_exists($file)) {\r\n return $this->failure($this->modx->lexicon('admintools_err_file_nf'));\r\n }\r\n $notes = unserialize($notes);\r\n if (is_array($notes) && !empty($notes)) {\r\n foreach ($notes as $note) {\r\n $obj = $this->modx->newObject('adminNotes');\r\n $note['createdby'] = $this->modx->user->id;\r\n $note['createdon'] = time();\r\n $obj->fromArray($note);\r\n $obj->save();\r\n }\r\n }\r\n\r\n return $this->success();\r\n }",
"public function store()\n\t{\n\t\t$input = Input::all();\n\t\t$this->commentary->commentary = $input['commentary'];\n\t\t$this->commentary->mid = $input['mid'];\n\t\t$this->commentary->time = $input['time'];\n\t\tif($this->commentary->save()){\n\t\t\t\\Session::flash('notice','Successfully added');\n\t\t\treturn redirect()->back();\n\t\t}\n\t}",
"public function getResponseNotes();",
"public \tfunction save_callog($callerName, $phone, $date, $time, $address, $county, $landMark, $case_cat, $call_cat, $shift, $supervisor, $caseDescription, $recordedBy){\n\t\t$sql = \"INSERT INTO call_log(callerName, phone, _date, _time, address, county, landMark, case_cat, call_cat, shift, supervisor, caseDescription, recordBy) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?)\";\n\t\t$stmt = $this->connection()->prepare($sql);\n\t\t$stmt->execute([$callerName, $phone, $date, $time, $address, $county, $landMark, $case_cat, $call_cat, $shift, $supervisor, $caseDescription, $recordedBy]);\n\t\treturn $stmt;\n}",
"public function leaveNotes()\n {\n $this->validate(['notes' => 'required']);\n\n $this->order->update(['notes' => $this->notes]);\n\n $this->notify([\n 'title' => __('Notes added'),\n 'message' => __('Your note has been added and will be emailed to the user on their order.'),\n ]);\n }",
"function create_note($eParent, $noteRec, $level) {\n\t\t$note = get_gedcom_value(\"NOTE\", $level, $noteRec);\n\t\t$note .= get_cont($level+1, $noteRec, false);\n//\t\t$num = 1;\n//\t\twhile (($cont = get_gedcom_value(\"NOTE:CONT\", $level, $noteRec, $num)) != null) {\n//\t\t\t$note .= $cont;\n//\t\t\t$num++;\n//\t\t}\n\t\t$egNote = $this->dom->createElement(\"note\");\n\t\t$etgNote = $this->dom->createTextNode(htmlentities($note,ENT_COMPAT,'UTF-8'));\n\t\t$etgNote = $egNote->appendChild($etgNote);\n\t\t$egNote = $eParent->appendChild($egNote);\n\t}",
"function save() {\n\t\t// If every question is answered, save to the db. Otherwise, to session.\n\t\tif($this->isComplete()) {\n\t\t\t$this->saveToRecord();\n\t\t} else {\n\t\t\t$this->saveToSession();\n\t\t}\n\t}",
"function AddNote($note){\r\n $statement = new InsertStatement(\"job_note\");\r\n $statement->addParameter(\"job_id\", $note->getJobId());\r\n $statement->addParameter(\"note_date\", $note->getNoteDate());\r\n $statement->addParameter(\"note_name\", $note->getNoteName());\r\n $statement->addParameter(\"note\", $note->getNote());\r\n $statement->executeStatement();\r\n }",
"function process_course_note() {\n\tif ( ! empty( $_POST[ 'submission' ] ) ) {\n\t\twp_send_json_error( 'Honeypot Check Failed' );\n\t}\n\tif ( ! check_ajax_referer( 'nt-course-note-nonce', 'security' ) ) {\n\t\twp_send_json_error( 'Security Check failed' );\n\t}\n\t$course_title = nt_generate_course_title($_POST[ 'data' ][ 'currentPostType' ] ,$_POST[ 'data' ][ 'currentLessonId' ]);\n\t$notes_data = array(\n\t\t'post_title' => $course_title.' - '.\n\t\t\t/*sanitize_text_field( $_POST[ 'data' ][ 'userId' ] ),\n\t\t\tsanitize_text_field( $_POST[ 'data' ][ 'currentLessonId' ] ),*/\n\n\t\t\tsanitize_text_field( $_POST[ 'data' ][ 'title' ] ),\n\t\t'post_status' => 'draft',\n\t\t'post_type' => 'coursenote',\n\t\t'post_content' => wp_kses_post( $_POST[ 'data' ][ 'body' ] )\n\t);\n\n\n\n//If note id already exists update exisiting note else insert new note\n$note_Id_update = get_post_id_by_meta_key_and_value('nt-note-current-lessson-id', $_POST[ 'data' ][ 'currentLessonId' ]);\n$post_author = get_post_field( 'post_author', $note_Id_update );\n\n\tif($note_Id_update && ($post_author == $_POST[ 'data' ][ 'userId' ])){\n\n\t\t$post_id = wp_update_post( array(\n\t\t\t'ID' => $note_Id_update,\n\t\t\t'post_content' => wp_kses_post( $_POST[ 'data' ][ 'body' ] )\n\t\t), true );\n\n\t\twp_send_json_success( $post_id );\n\t} else {\n\t\t$post_id = wp_insert_post( $notes_data, true );\n\t\tif ( $post_id ) {\n\n\t\t\tupdate_post_meta( $post_id, 'nt-note-user-id', $_POST[ 'data' ][ 'userId' ] );\n\t\t\tupdate_post_meta( $post_id, 'nt-note-current-lessson-id', $_POST[ 'data' ][ 'currentLessonId' ] );\n\n\t\t}\n\t\twp_send_json_success( $post_id );\n\t}\n\n}",
"function insertNote(){\n\t\t$this->db->insert('form_notes', $_POST);\n\t\treturn $this->db->insert_id();\n\t}",
"public function log_activity($fkey,$note,$ref='inventory',$title) {\n\t\t$note_date = date(\"Ymd\");\n\t\t$user_id = $_SESSION['username'];\n\n\t\t$sql = \"INSERT INTO `notes` \n\t\t(`note_date`,`table_ref`,`fkey`,`user_id`,`title`,`note`)\n\t\tVALUES\n\t\t('$note_date','$ref','$fkey','$user_id','$title','$note')\n\t\t\";\n\t\t$result = $this->new_mysql($sql);\n\t}",
"public function store()\n\t{\t\n\t\t\n\t\t# instantiate\t\n\t\t$note = new Note();\n\t\t\n\t\t$note = $note->postNote(['content'=>Input::get('content'), 'title' => Input::get('title'), 'project_id'=>Input::get('id'), 'project_title'=> Input::get('project_title'),'user_id'=> Auth::id()]);\n\t\t\n\t\t# method returns success or error\n\t\tif($note == 'error')\n\t\t{\n\t\t\t\t\n\n\t\t\t# PK\n\t\t\treturn Redirect::to('projects/'. Input::get('id'))->withErrors('Error saving note. Please try again')->withInput();\t\t\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t#Flash message\n\t\t\tSession::flash('flash_message_success', 'Note created!');\n\t\t\t\n\t\t\treturn Redirect::to('projects/'. Input::get('id'));\n\t\t\t\n\t\t}\n\t}",
"public function store(Request $request)\n {\n $note = new Note();\n\n $note->titulo = $request->titulo;\n $note->descripcion = $request->descripcion;\n $note->favorito = $request->favorito;\n $note->save();\n print(\"Nota creada\");\n }",
"function do_store_post_reply($post_id) {\r\n // echo '<pre>'; print_r($_POST); die();\r\n foreach(array(\"description\",\"replied_by\") as $i)\r\n\t\t\t$$i=$this->input->post($i);\r\n $replied_on = time();$status=1;\r\n $this->db->query(\"insert into m_stream_post_reply(description,post_id,replied_by,replied_on,status) values(?,?,?,?,?)\",array($this->prep($description),$post_id,$replied_by,$replied_on,$status));\r\n }",
"function addNote($userID, $memberID, $note) {\r\n $sql = $this->db->prepare(\"INSERT INTO NOTES (about, leftBy, note) VALUES (:about, :leftBy, :note)\");\r\n $result = $sql->execute(array(\r\n \"about\" => $memberID,\r\n \"leftBy\" => $userID,\r\n \"note\" => $note\r\n ));\r\n if ($result)\r\n return true;\r\n else\r\n return false;\r\n }",
"public function getNotes();",
"function add($note) {\r\n $CI = &get_instance();\r\n //check access rights (!)\r\n $userlogin = getUserLogin();\r\n $user = $CI->user_db->getByID($userlogin->userID());\r\n $publication = $CI->publication_db->getByID($note->pub_id);\r\n if ( ($publication == null) \r\n ||\r\n (!$userlogin->hasRights('note_edit'))\r\n || \r\n (!$CI->accesslevels_lib->canEditObject($publication))\r\n ) \r\n {\r\n\t appendErrorMessage(__('Add note').': '.__('insufficient rights').'.<br/>');\r\n\t return;\r\n } \r\n //add new note\r\n $CI->db->insert(\"notes\", array('text' => $note->text,\r\n 'pub_id' => $note->pub_id,\r\n 'user_id' => $userlogin->userId()));\r\n $new_id = $CI->db->insert_id();\r\n $note->note_id = $new_id;\r\n $CI->accesslevels_lib->initNoteAccessLevels($note); \r\n //set crossref ids\r\n $xref_ids = getCrossrefIDsForText($note->text);\r\n foreach ($xref_ids as $xref_id) {\r\n $CI->db->insert(\"notecrossrefid\", array('xref_id'=>$xref_id, 'note_id'=>$note->note_id));\r\n }\r\n \r\n return $new_id;\r\n }",
"function savecomments(){\n\n//database connection begins\nrequire('database/connx.php');\n\n// Connect to MySQL\n$db = & new MySQL($host,$dbUser,$dbPass,$dbName);\n\n//storing values in DB for search functionality\n\n//instantiating variables begin\n$this->comment_author = safeAddSlashes($_POST['comment_author']);\n$this->pubDate = date(\"M j, Y, g:i a\");\n$this->comment = safeAddSlashes($_POST['comment']);\n$this->lead_comment_author = safeAddSlashes($_POST['lead_comment_author']);\n$this->msg_type = $_POST['msg_type'];\nif(isset($_POST['vid'])){$this->presentation_url = safeAddSlashes($_POST['vid']);}else{$this->presentation_url = safeAddSlashes($_GET['vid']);}\n$sql=\"INSERT comments SET\nstr_presentation_url='$this->presentation_url',\nstr_name='$this->comment_author',\nstr_lead_name='$this->lead_comment_author',\ntime_pubDate='$this->pubDate',\nstr_comment='$this->comment',\nstr_msg_type='$this->msg_type'\";\n//echo \"<p>\" . $sql . \"</p>\";\n$result=$db->query($sql);\n\n }",
"public function getNote();",
"public function setNote($text){\r\n $this->note = $text;\r\n }",
"function setNoteText(){\n $html = \"\";\n \n $this->aFields[\"note\"]->editable = true;\n $this->aFields[\"note\"]->value = $html;\n }",
"protected function afterSave()\n\t{\n\t\tparent::afterSave();\n\t\tif(!$this->status == 1){\n\t\t$title = $this->howtoTitle($this->id);\n\t\t$tags = $this->tagLinks();\n\t\t$title = CHtml::link('Created '.$title , array('/howto/' . $this->id . '/' . $title ) );\n\t\t$shortText = substr($this->content,0,160);\n\t\t$content = $shortText.\"...<br/>Tags:\";\n\t\tforeach($tags as $tag){\n\t\t\t$content .=\" \".$tag.\",\";\n\t\t}\n\t\tAction::newAction($content,$title);\n\t\t}\n\t\t\n\t}",
"public function addNote($note)\n {\n }",
"function footnote_open() {\n\n // move current content to store and record footnote\n $this->store = $this->doc;\n $this->doc = '';\n }",
"public function getCustomerNoteNotify();",
"public function recordJournalingStart();",
"public function Add_Note($data) {\n // Populate the entry data\n $this->store_note = array(\n 'uuid' => isset($data['uuid']) ? $data['uuid'] : uniqid(),\n 'entry_uuid' => $data['entry_uuid'],\n 'form_uuid' => $data['form_uuid'],\n 'note_data' => $data['note_data'],\n 'time_created' => isset($data['time_created']) ? $data['time_created'] : time(),\n 'time_modified' => isset($data['time_modified']) ? $data['time_modified'] : time(),\n 'date_created' => isset($data['date_created']) ? $data['date_created'] : date(\"Y-m-d H:i:s\"),\n 'date_modifed' => isset($data['date_modifed']) ? $data['date_modifed'] : date(\"Y-m-d H:i:s\"),\n );\n // Return for chaining\n return $this;\n }",
"public function save()\n {\n if($this->id != -1)\n {\n $this->update_subject();\n }\n else\n {\n $this->insert_subject();\n }\n }",
"function update_Note($NoteID, $Title, $Note, $Private) {\r\n// the database to new details in arguments\r\n\r\n $conn = db_connect();\r\n\r\n $query = \"update NOTES\r\n set Title= '\".$Title.\"'\r\n NOTES = '\".$Note.\"',\r\n Private = '\".$Private.\"'\r\n where NoteID = '\".$NoteID.\"'\";\r\n\r\n $result = @$conn->query($query);\r\n if (!$result) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}",
"function create_post()\n {\n //Create the post with information submitted\n if(isset($_POST['note-text']) && !($_POST['note-text'] == \"\"))\n {\n $query = $this->pdo->prepare('INSERT INTO note (title, description, created_at, updated_at) VALUES(:title,:description, NOW(), NOW())');\n $query->execute(array(\n ':title' => $_POST['note-title'],\n ':description' => $_POST['note-text']\n ));\n }\n }",
"public function store(Requests\\NotesRequest $request)\n {\n if($request->input('type') == 'lead'){\n $lead = $this->leadsRepositoryEloquent->findWhere([\"id\" => $request->input('type_id')])->first();\n $request->merge(['branch_id' => $lead->branch_id]);\n }elseif($request->input('type') == 'opportunity'){\n $lead = $this->opportunityRepositoryEloquent->findWhere([\"id\" => $request->input('type_id')])->first();\n $request->merge(['branch_id' => $lead->branch_id]);\n }elseif($request->input('type') == 'account'){\n $lead = $this->accountsRepositoryEloquent->findWhere([\"id\" => $request->input('type_id')])->first();\n $request->merge(['branch_id' => $lead->branch_id]);\n }elseif($request->input('type') == 'contact'){\n $lead = $this->contactRepositoryEloquent->findWhere([\"id\" => $request->input('type_id')])->first();\n $request->merge(['branch_id' => $lead->branch_id]);\n }elseif($request->input('type') == 'activity'){\n $lead = $this->activityRepositoryEloquent->findWhere([\"id\" => $request->input('type_id')])->first();\n $request->merge(['branch_id' => $lead->branch_id]);\n }\n\n\n $note = $this->repository->store($request);\n\n return response()->json((new NotesTransformer())->transform($note));\n }",
"function DoctorAppointment_meta_save($post_id){\n $is_auto_save = wp_is_post_autosave( $post_id );\n $is_revision = wp_is_post_revision( $post_id );\n $is_valid_nonce = (isset($_POST['DoctorAppointment_nonce']) && \n wp_verify_nonce( $_POST['DoctorAppointment_nonce'], basename(__FILE__)))? 'true' : 'false';\n \n // return if ina auto svae , revision of non valid nouncer\n if($is_auto_save || $is_revision || !$is_valid_nonce){\n return ;\n }\n \n // update DoctorAppointment_id\n if(isset($_POST[\"DoctorAppointment_id\"])){\n update_post_meta( $post_id, \"DoctorAppointment_id\",sanitize_text_field( $_POST[\"DoctorAppointment_id\"]) );\n\n }\n\n // update DoctorAppointment_name\n if(isset($_POST[\"DoctorAppointment_name\"])){\n update_post_meta( $post_id, \"DoctorAppointment_name\",sanitize_text_field( $_POST[\"DoctorAppointment_name\"]) );\n \n }\n\n // update DoctorAppointment_email\n if(isset($_POST[\"DoctorAppointment_email\"])){\n update_post_meta( $post_id, \"DoctorAppointment_email\",sanitize_email( $_POST[\"DoctorAppointment_email\"]) );\n \n }\n\n // update DoctorAppointment_mobile\n if(isset($_POST[\"DoctorAppointment_mobile\"])){\n update_post_meta( $post_id, \"DoctorAppointment_mobile\",sanitize_text_field( $_POST[\"DoctorAppointment_mobile\"]) );\n }\n\n\n // update DoctorAppointment_message\n if(isset($_POST[\"DoctorAppointment_message\"])){\n update_post_meta( $post_id, \"DoctorAppointment_message\", sanitize_text_field($_POST[\"DoctorAppointment_message\"]));\n }\n\n// still have to write code fo\n \n \n \n \n \n\n}",
"function save();",
"function save();",
"public function saveDetails() \n {\n // Save the author list.\n $this->authorList->setValue('bookId', $this->bookId);\n $this->authorList->save();\n \n // Save the booklanguage list.\n $this->bookLanguageList->setValue('bookId', $this->bookId);\n $this->bookLanguageList->save();\n }",
"public function insertNote($arr){\n\t\t$insNote = $this->userClsObj->insertNote($arr);\n\t}",
"function add_note($module_key) {\r\n\r\n\tglobal $CONN, $CONFIG;\r\n\t$body = $_POST['body'];\r\n\t$sql = \"INSERT INTO {$CONFIG['DB_PREFIX']}notes(module_key,note) values ('$module_key','$body')\";\r\n\t\r\n\tif ($CONN->Execute($sql) === false) {\r\n\t\r\n\t\t$message = 'There was an error adding your note: '.$CONN->ErrorMsg().' <br />';\r\n\r\n\t\treturn $message;\r\n\t\t\r\n\t} else {\t \r\n\t\r\n\t\t\treturn true; \r\n\t}\r\n\t\r\n\r\n}",
"function add_note($text, $user_id){\n $link = connect();\n\n // 2. Prepare the statement using mysqli\n // to take care of any potential SQL injections.\n $stmt = mysqli_prepare($link, \"\n INSERT INTO tbl_notes\n (text, tbl_users_id)\n VALUES\n (?, ?)\n \");\n\n // 3. Bind the parameters so we don't have to do the work ourselves.\n // the sequence means: string string double integer double\n mysqli_stmt_bind_param($stmt, 'si', $text, $user_id);\n\n // 4. Execute the statement.\n mysqli_stmt_execute($stmt);\n\n // 5. Disconnect from the database.\n disconnect($link);\n\n // 6. If the query worked, we should have a new primary key ID.\n return mysqli_stmt_insert_id($stmt);\n }",
"private function saveData($data)\n {\n $newDate = date('Y-m-d H:i:s');\n $data['commentDate'] = $newDate;\n // --- saving part ---\n $comments = new commentModel();\n $commentID = $comments->insert($data);\n // --- routing after storage ---\n $url = '/comments/show/id/' . $data['topicID'];\n $this->_redirect($url);\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 }",
"private function saveParagraphs()\n\t{\n\t\t$arrayDescription = array();\n\t\t\n\t\tif (isset ($_REQUEST['paragraph1']))\n\t\t\t$arrayDescription[\"paragraph\"][1] = getArrayParameter($_REQUEST, \t'paragraph1');\n\t\tif (isset ($_REQUEST['paragraph2']))\n\t\t\t$arrayDescription[\"paragraph\"][2] = getArrayParameter($_REQUEST, \t'paragraph2');\n\t\tif (isset ($_REQUEST['paragraph3']))\n\t\t\t$arrayDescription[\"paragraph\"][3] = getArrayParameter($_REQUEST, \t'paragraph3');\n\t\tif (isset ($_REQUEST['paragraph4']))\n\t\t\t$arrayDescription[\"paragraph\"][4] = getArrayParameter($_REQUEST, \t'paragraph4');\n\t\tif (isset ($_REQUEST['paragraph5']))\n\t\t\t$arrayDescription[\"paragraph\"][5] = getArrayParameter($_REQUEST, \t'paragraph5');\n\t\t\t\n\t\t$this->context->updateDescription($arrayDescription);\t\t\n\t}",
"function heartbeat_autosave($response, $data)\n {\n }",
"function authorNotes($id)\n{\n global $app;\n\n // parameter checking\n if (!is_numeric($id)) {\n $app->getLog()->warn('authorNotes: invalid author id ' . $id);\n $app->halt(400, \"Bad parameter\");\n }\n\n $author = $app->calibre->author($id);\n if (is_null($author)) {\n $app->getLog()->debug('authorNotes: author id not found ' . $id);\n $app->notFound();\n }\n $note = $app->bbs->authorNote($id);\n if (!is_null($note)) {\n $author->notes_source = $note->ntext;\n } else {\n $author->notes_source = null;\n }\n if (!empty($author->notes_source)) {\n $markdownParser = new MarkdownExtraParser();\n $author->notes = $markdownParser->transformMarkdown($author->notes_source);\n } else {\n $author->notes = null;\n }\n $app->render('author_notes.html', [\n 'page' => mkPage(getMessageString('author_notes'), 3, 2),\n 'url' => 'authors/' . $id,\n 'author' => $author,\n 'isadmin' => is_admin()]);\n}",
"function save(){\r\n\t\tglobal $DB;\r\n\t\tglobal $_USER;\r\n\t\t$now = time();\r\n\r\n\t\tif($this->id > 0){\r\n\t\t\t$sql = \"UPDATE personalization_orders SET\r\n\t\t\t\t\tstatus = {$this->status},\r\n\t\t\t\t\ttitle = '{$this->title}', \r\n\t\t\t\t\tcomment = '{$this->comment}',\r\n\t\t\t\t\torderdate = {$this->orderdate}, \r\n\t\t\t\t\tamount = {$this->amount}, \r\n\t\t\t\t\tcontact_person_id = {$this->contactPersonID}, \r\n\t\t\t\t\tdeliveryaddress_id = {$this->deliveryAddressID}\r\n\t\t\t\t\tWHERE id = {$this->id}\";\r\n\t\t\t$ret = $DB->no_result($sql);\r\n\t\t} else {\r\n\t\t\t$sql = \"INSERT INTO personalization_orders\r\n\t\t\t\t\t( status, comment, crtdate, crtuser, amount, \r\n\t\t\t\t\t customerid, persoid, title, contact_person_id,\r\n\t\t\t\t\t deliveryaddress_id )\r\n\t\t\t\t\tVALUES\r\n\t\t\t\t\t({$this->status}, '{$this->comment}', {$now}, {$_USER->getId()}, {$this->amount}, \r\n\t\t\t\t\t{$this->customerID}, {$this->persoID}, '{$this->title}', {$this->contactPersonID}, \r\n\t\t\t\t\t{$this->deliveryAddressID})\";\r\n\t\t\t$res = $DB->no_result($sql);\r\n\r\n\t\t\tif($res){\r\n\t\t\t\t$sql = \"SELECT max(id) id FROM personalization_orders WHERE persoid = {$this->persoID} AND customerid = {$this->customerID} \";\r\n\t\t\t\t$thisid = $DB->select($sql);\r\n\t\t\t\t$this->id = $thisid[0][\"id\"];\r\n\t\t\t\t$ret = true;\r\n\t\t\t} else {\r\n\t\t\t\t$ret = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($ret){\r\n\t\t\tCachehandler::toCache(Cachehandler::genKeyword($this), $this);\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public function store(NotesRequest $request)\n {\n //cual muestra todos los datos que llegan a través de las peticiones\n //helper dd() muestra el contenido de una variable y detiene la \n //ejecución del sistema\n //request()->all() veo todo lo que me llega del formulario\n //request()->NombreDelCampo para un campo en especifico\n //dd(request()->all());\n\n //vamos a guardar de 2 formas\n //esta es la primera\n /*$note = new Note; //instanciamos el modelo Note\n $note->title = request()->title;\n $note->body = request()->body;\n $note->important = is_null(request()->important) ? 0 : 1;\n $note->save();*/\n\n //Y esta la segunda\n //para validar uasaremos el metodo validate\n /*$data=request()->validate([\n 'title' => 'required',\n 'body' => 'required|min:5',\n 'important' => 'required',\n ]);\n Note::create($data);\n */\n //Note::create($request->all());//otra forma de guardar\n Note::create(request()->all());\n return redirect('/notes');\n //return back();//nos retornaria a la ruta anterior.\n\n\n }"
] | [
"0.6761122",
"0.66712093",
"0.6563187",
"0.6552568",
"0.65447944",
"0.65286636",
"0.65069413",
"0.64214104",
"0.6409996",
"0.6400592",
"0.63641244",
"0.63465947",
"0.6317856",
"0.63142097",
"0.63116586",
"0.6304352",
"0.62978274",
"0.6251984",
"0.62433934",
"0.622184",
"0.615995",
"0.61422426",
"0.61402833",
"0.6111722",
"0.60971946",
"0.6084116",
"0.6069027",
"0.6058121",
"0.60484576",
"0.60344243",
"0.60301656",
"0.602127",
"0.60141224",
"0.6003398",
"0.5905096",
"0.5903549",
"0.59011394",
"0.5868177",
"0.5851313",
"0.58420485",
"0.5840003",
"0.58330685",
"0.58291125",
"0.5812004",
"0.5808497",
"0.580413",
"0.58017606",
"0.5798966",
"0.57967037",
"0.57503855",
"0.5735338",
"0.57284904",
"0.57090676",
"0.56991327",
"0.5695108",
"0.56772184",
"0.5674139",
"0.56736",
"0.5672447",
"0.5662806",
"0.5653771",
"0.5639969",
"0.5636717",
"0.5635782",
"0.56310505",
"0.56286645",
"0.5614464",
"0.5612659",
"0.56008214",
"0.55947775",
"0.55880547",
"0.5586888",
"0.5585742",
"0.5583477",
"0.558062",
"0.5576989",
"0.55636966",
"0.5558428",
"0.5543014",
"0.5535657",
"0.55349696",
"0.5532481",
"0.552756",
"0.5520812",
"0.5520315",
"0.5513492",
"0.5500557",
"0.5499747",
"0.5485296",
"0.5485296",
"0.5477251",
"0.54710877",
"0.5470965",
"0.5469116",
"0.54545325",
"0.5453835",
"0.54519266",
"0.544338",
"0.5440469",
"0.5436377",
"0.5435154"
] | 0.0 | -1 |
Permission / protected $viewPermission = "Deliveryorder.View"; protected $addPermission = "Deliveryorder.Add"; protected $managePermission = "Deliveryorder.Manage"; protected $deletePermission = "Deliveryorder.Delete"; | public function __construct()
{
parent::__construct();
$this->load->library(array('Mpdf','upload','Image_lib'));
$this->load->model(array('Deliveryorder_2/Deliveryorder_model',
'Deliveryorder_2/Detaildeliveryorder_model',
'Salesorder/Salesorder_model',
'Salesorder/Detailsalesorder_model',
'Pendingso/Pendingso_model',
'Pendingso/Detailpendingso_model',
'Customer/Customer_model',
'Aktifitas/aktifitas_model'
));
$this->template->title('Delivery Order');
$this->template->page_icon('fa fa-table');
date_default_timezone_set("Asia/Bangkok");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static function getPermission()\n {\n return [self::BULLETIN => 'article_createBulletin'];\n }",
"public function permissions();",
"public function permissions();",
"public function permissions();",
"public function permissions();",
"public function permissions();",
"abstract public function permission(): string;",
"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 permission(): string;",
"function routePermission(){\n\t\n\t$routePermission =[\n\n\t\t'admin_owner_auth_check' =>\t\n\t\t\t\n\t\t\t[\n\t\t\t\t//jobs permission\n\t\t\t\t// 'jobs/create'=>['add_job'],\t\t\t\t\t\n\t\t\t\t// 'jobs/store'=>['add_job'],\n\t\t\t\t'jobs/{reference_id}/{step?}'=>['edit_job'], \n\t\t\t\t'jobs/update'=>['edit_job'],\n\n\t\t\t\t//listing permission\n\t\t\t\t// 'listing/create'=>['add_listing'],\t\t\t\t\t\n\t\t\t\t'listing/{reference}/edit/{step?}'=>['edit_listing'], \n\t\t\t\t\n\n\n\t\t\t\t//admin jobs permission\n\t\t\t\t'admin-dashboard/moderation/listing-approval'=>['listing_approval'],\n\t\t\t\t'admin-dashboard/moderation/manage-listings'=>['listing_approval'],\n\t\t\t\t'admin-dashboard/moderation/manage-enquiries'=>['listing_approval'],\n\t\t\t\t\n\n\n \t\t\t\t'admin-dashboard/jobs/manage-jobs'=>['manage_job_status'],\n \t\t\t\t// 'admin-dashboard/jobs/manage-jobs'=>['manage_job_status','manage_job_view'],\n\t\t\t \t'admin-dashboard/jobs/get-jobs'=>['manage_job_status','manage_job_view'],\n\t\t\t \t'admin-dashboard/jobs/update-job-status'=>['manage_job_status'],\n\t\t\t \t'admin-dashboard/jobs/bulk-update-job-status'=>['manage_job_status'],\n\t\t\t \t'admin-dashboard/config/categories'=>['manage_job_status'],\n\t\t\t\t'admin-dashboard/config/locations'=>['manage_job_status'],\n\t\t\t\t'admin-dashboard/users/internal-users'=>['manage_job_status'],\n\t\t\t\t'admin-dashboard/users/registered-users'=>['manage_job_status'],\n\t\t\t\t'admin-dashboard/users/export'=>['manage_job_status'],\n\t\t\t\t'admin-dashboard/email-notification'=>['manage_job_status'],\n\t\t\t\t'admin-dashboard/internal-email'=>['manage_job_status'],\n\n\t\t\t \t//ui element\n\t\t\t\t'submit_review_element_cls'=>['submit_for_review_job','submit_for_review_listing'],\n\t\t\t\t'edit_permission_element_cls'=>['edit_job','edit_listing'],\n\t\t\t\t'change_status_element_cls'=>['job_status'],\n\t\t\t\t'view_profile_element_cls' => ['listing_approval'],\n\t\t\t],\n\n\t\t'normal_user_check' =>\n\t\t\t[\t\t\t\t\t\t\n\t\t\t\t'delete_element_cls'=>['delete_job_contact'],\t\t\t\t\t\n\t\t\t\t'status_element_cls'=>['change_job_status'],\n\t\t\t\t'edit_element_cls'=>['edit_listing'],\t\n\t\t\t],\n\n\t\t// 'public_access' =>\n\t\t// \t[\t\n\t\t// \t\t//jobs permission\n\t\t// \t\t'jobs/{job}'=>['read_job'],\n\t\t// \t]\n\t\t\t\t\t\t\t\t\t\t\n\t];\n\n\n\treturn $routePermission;\n}",
"function getAllAccess() {\n return ['download', 'remoteAccess', 'remoteService', 'enclave','notAvailable'];\n}",
"function egsr_group_admin_cap(){\n return Array ( \n 'add_users' => true,\n 'create_users' => true,\n 'delete_users' => true,\n 'delete_others_pages' => true,\n 'delete_others_posts' => true,\n 'delete_pages' => true,\n 'delete_posts' => true,\n 'delete_private_pages' => true,\n 'delete_private_posts' => true,\n 'delete_published_pages' => true,\n 'delete_published_posts' => true,\n 'edit_others_pages' => true,\n 'edit_others_posts' => true,\n 'edit_pages' => true,\n 'edit_posts' => true,\n 'edit_private_pages' => true,\n 'edit_private_posts' => true,\n 'edit_published_pages' => true,\n 'edit_published_posts' => true,\n 'edit_users' => true,\n 'list_users' => true,\n 'manage_categories' => true,\n 'manage_links' => true,\n 'moderate_comments' => true,\n 'publish_pages' => true,\n 'publish_posts' => true,\n 'read' => true,\n 'read_private_pages' => true,\n 'read_private_posts' => true,\n 'unfiltered_html' => true,\n 'upload_files' => true,\n );\n}",
"function get_required_permission()\n {\n return str_replace(array(' ', \"\\n\", \"\\t\"), '_', $this->object->name);\n }",
"function SettingsController_DefineAdminPermissions_Handler(&$Sender) {\n if (isset($Sender->RequiredAdminPermissions)) {\n $Sender->RequiredAdminPermissions[] = 'Vanilla.Settings.Manage';\n $Sender->RequiredAdminPermissions[] = 'Vanilla.Categories.Manage';\n $Sender->RequiredAdminPermissions[] = 'Vanilla.Spam.Manage';\n }\n }",
"public function setPrivilages()\n {\n // $this->acl->allow('guest',null, array('view', 'index'));\n // $this->acl->allow('editor',array('view','edit'));\n // $this->acl->allow('admin');\n \n // Setting privilages for actions as per particular controller\n // $this->acl->allow('<role>','<controller>', <array of controller actions>);\n // You can also fetch it from DB.\n \n// // $this->acl->deny('guest','news', 'index');\n// $this->acl->allow('guest','news', array( 'demo1', 'view', 'index'));\n// $this->acl->allow('guest','job-board', array('index'));\n//\n// $this->acl->allow('editor','news', array( 'edit', 'view', 'index')); \n// $this->acl->allow('editor','job-board', array('edit', 'index'));\n//\n// $this->acl->allow('admin');\n //$this->acl->allow('guest');\n //Guest ACL\n $this->acl->deny('guest',array('user','shop','admin'));\n $this->acl->allow('guest','index');\n \n //User ACL\n $this->acl->deny('user',array('shop','admin'));\n $this->acl->allow('user','user');\n $this->acl->allow('user','index',array('logout','notfound'));\n \n \n // Shop ACL\n $this->acl->deny('shop',array('user','admin'));\n $this->acl->allow('shop',array('index','shop'));\n \n //Admin ACL\n //$this->acl->deny('admin',array('user','shop'));\n //$this->acl->allow('admin',array('index','admin'));\n $this->acl->allow('admin');\n // Note that the actions which are not mentioned above i.e. inside array of\n // controller-action - becomes access-denied automatically\n // as in above example, news controller also have one more action demo2,\n // but demo2 is not mentioned in above allow actions, so \n // when guest tries to access the action - demo2, it would not show the \n // content of demo2, rather It would show content of error/index.phtml\n }",
"public function permission($permission);",
"public function getAccessAllowableValues()\n {\n return [\n self::ACCESS_MAILBOX,\nself::ACCESS_ACCOUNT,\nself::ACCESS_PUB,\nself::ACCESS_OFFICIAL,\nself::ACCESS_SHARED, ];\n }",
"public function permissions()\n {\n return [\n 'add parcels', 'edit parcels', 'delete parcels', 'send parcels', 'pick parcels'\n ];\n }",
"public function providePermissions()\n {\n return [\n 'REFUND_PAYMENTS' => [\n 'name' => _t('SilverStripe\\Omnipay\\Model\\Payment.PERMISSION_REFUND_PAYMENTS', 'Refund payments'),\n 'help' => _t(\n 'SilverStripe\\Omnipay\\Model\\Payment.PERMISSION_REFUND_PAYMENTS_HELP',\n 'Allow refunding of captured payments'\n ),\n 'category' => _t('SilverStripe\\Omnipay\\Model\\Payment.PAYMENT_PERMISSIONS', 'Payment actions'),\n 'sort' => 200\n ],\n 'CAPTURE_PAYMENTS' => [\n 'name' => _t('SilverStripe\\Omnipay\\Model\\Payment.PERMISSION_CAPTURE_PAYMENTS', 'Capture payments'),\n 'help' => _t(\n 'SilverStripe\\Omnipay\\Model\\Payment.PERMISSION_CAPTURE_PAYMENTS_HELP',\n 'Allow capturing of authorized payments'\n ),\n 'category' => _t('SilverStripe\\Omnipay\\Model\\Payment.PAYMENT_PERMISSIONS', 'Payment actions'),\n 'sort' => 200\n ],\n 'VOID_PAYMENTS' => [\n 'name' => _t('SilverStripe\\Omnipay\\Model\\Payment.PERMISSION_VOID_PAYMENTS', 'Void payments'),\n 'help' => _t(\n 'SilverStripe\\Omnipay\\Model\\Payment.PERMISSION_VOID_PAYMENTS_HELP',\n 'Allow voiding of authorized payments'\n ),\n 'category' => _t('SilverStripe\\Omnipay\\Model\\Payment.PAYMENT_PERMISSIONS', 'Payment actions'),\n 'sort' => 200\n ]\n ];\n }",
"public function run()\n {\n $permission = [\n // WEBSITE\n [\n 'name' => 'admin_website_view',\n 'display_name' => 'Website View',\n 'description' => 'Website View'\n ],\n [\n 'name' => 'admin_website_update',\n 'display_name' => 'Website Update',\n 'description' => 'Website Update'\n ],\n // EMAIL\n [\n 'name' => 'admin_email_view',\n 'display_name' => 'Email View',\n 'description' => 'Email View'\n ],\n [\n 'name' => 'admin_email_update',\n 'display_name' => 'Email Update',\n 'description' => 'Email Update'\n ],\n [\n 'name' => 'admin_email_delete',\n 'display_name' => 'Email Delete',\n 'description' => 'Email Delete'\n ],\n [\n 'name' => 'admin_email_create',\n 'display_name' => 'Email Create',\n 'description' => 'Email Create'\n ],\n [\n 'name' => 'admin_email_send',\n 'display_name' => 'Email Send',\n 'description' => 'Email Send'\n ],\n // GROUP EMAIL\n [\n 'name' => 'admin_group_email_view',\n 'display_name' => 'Email Group View',\n 'description' => 'Email Group View'\n ],\n [\n 'name' => 'admin_group_email_update',\n 'display_name' => 'Email Group Update',\n 'description' => 'Email Group Update'\n ],\n [\n 'name' => 'admin_group_email_delete',\n 'display_name' => 'Email Group Delete',\n 'description' => 'Email Group Delete'\n ],\n [\n 'name' => 'admin_group_email_create',\n 'display_name' => 'Email Group Create',\n 'description' => 'Email Group Create'\n ],\n\n // ADVERTS\n [\n 'name' => 'admin_advert_view',\n 'display_name' => 'Advert View',\n 'description' => 'Advert View'\n ],\n [\n 'name' => 'admin_advert_update',\n 'display_name' => 'Advert Update',\n 'description' => 'Advert Update'\n ],\n [\n 'name' => 'admin_advert_delete',\n 'display_name' => 'Advert Delete',\n 'description' => 'Advert Delete'\n ],\n [\n 'name' => 'admin_advert_create',\n 'display_name' => 'Advert Create',\n 'description' => 'Advert Create'\n ],\n\n // Client\n [\n 'name' => 'admin_client_view',\n 'display_name' => 'Client View',\n 'description' => 'Client View'\n ],\n [\n 'name' => 'admin_client_update',\n 'display_name' => 'Client Update',\n 'description' => 'Client Update'\n ],\n [\n 'name' => 'admin_client_delete',\n 'display_name' => 'Client Delete',\n 'description' => 'Client Delete'\n ],\n [\n 'name' => 'admin_client_create',\n 'display_name' => 'Client Create',\n 'description' => 'Client Create'\n ],\n\n // USER\n [\n 'name' => 'admin_user_view',\n 'display_name' => 'User View',\n 'description' => 'User View'\n ],\n [\n 'name' => 'admin_user_update',\n 'display_name' => 'User Update',\n 'description' => 'User Update'\n ],\n [\n 'name' => 'admin_user_delete',\n 'display_name' => 'User Delete',\n 'description' => 'User Delete'\n ],\n [\n 'name' => 'admin_user_create',\n 'display_name' => 'User Create',\n 'description' => 'User Create'\n ],\n [\n 'name' => 'admin_user_view_log',\n 'display_name' => 'User View Log',\n 'description' => 'User View Log'\n ],\n\n // CUSTOMER\n [\n 'name' => 'admin_customer_view',\n 'display_name' => 'Customer View',\n 'description' => 'Customer View'\n ],\n [\n 'name' => 'admin_customer_update',\n 'display_name' => 'Customer Update',\n 'description' => 'Customer Update'\n ],\n [\n 'name' => 'admin_customer_delete',\n 'display_name' => 'Customer Delete',\n 'description' => 'Customer Delete'\n ],\n [\n 'name' => 'admin_customer_create',\n 'display_name' => 'Customer Create',\n 'description' => 'Customer Create'\n ],\n\n // BOOKING\n [\n 'name' => 'admin_booking_view',\n 'display_name' => 'Booking View',\n 'description' => 'Booking View'\n ],\n [\n 'name' => 'admin_booking_update',\n 'display_name' => 'Booking Update',\n 'description' => 'Booking Update'\n ],\n [\n 'name' => 'admin_booking_delete',\n 'display_name' => 'Booking Delete',\n 'description' => 'Booking Delete'\n ],\n [\n 'name' => 'admin_booking_create',\n 'display_name' => 'Booking Create',\n 'description' => 'Booking Create'\n ],\n\n // SCHOOL\n [\n 'name' => 'admin_school_view',\n 'display_name' => 'School View',\n 'description' => 'School View'\n ],\n [\n 'name' => 'admin_school_update',\n 'display_name' => 'School Update',\n 'description' => 'School Update'\n ],\n [\n 'name' => 'admin_school_delete',\n 'display_name' => 'School Delete',\n 'description' => 'School Delete'\n ],\n [\n 'name' => 'admin_school_create',\n 'display_name' => 'School Create',\n 'description' => 'School Create'\n ],\n // SCHOOL LEVEL\n [\n 'name' => 'admin_school_level_view',\n 'display_name' => 'School Level View',\n 'description' => 'School Level View'\n ],\n [\n 'name' => 'admin_school_level_update',\n 'display_name' => 'School Level Update',\n 'description' => 'School Level Update'\n ],\n [\n 'name' => 'admin_school_level_delete',\n 'display_name' => 'School Level Delete',\n 'description' => 'School Level Delete'\n ],\n [\n 'name' => 'admin_school_level_create',\n 'display_name' => 'School Level Create',\n 'description' => 'School Level Create'\n ],\n\n // SCHOOL TYPE\n [\n 'name' => 'admin_school_type_view',\n 'display_name' => 'School Type View',\n 'description' => 'School Type View'\n ],\n [\n 'name' => 'admin_school_type_update',\n 'display_name' => 'School Type Update',\n 'description' => 'School Type Update'\n ],\n [\n 'name' => 'admin_school_type_delete',\n 'display_name' => 'School Type Delete',\n 'description' => 'School Type Delete'\n ],\n [\n 'name' => 'admin_school_type_create',\n 'display_name' => 'School Type Create',\n 'description' => 'School Type Create'\n ],\n // SCHOOL CLASS\n [\n 'name' => 'admin_school_class_view',\n 'display_name' => 'School Class View',\n 'description' => 'School Class View'\n ],\n [\n 'name' => 'admin_school_class_update',\n 'display_name' => 'School Class Update',\n 'description' => 'School Class Update'\n ],\n [\n 'name' => 'admin_school_class_delete',\n 'display_name' => 'School Class Delete',\n 'description' => 'School Class Delete'\n ],\n [\n 'name' => 'admin_school_class_create',\n 'display_name' => 'School Class Create',\n 'description' => 'School Class Create'\n ],\n // SCHOOL LANGUAGE\n [\n 'name' => 'admin_school_language_view',\n 'display_name' => 'School Language View',\n 'description' => 'School Language View'\n ],\n [\n 'name' => 'admin_school_language_update',\n 'display_name' => 'School Language Update',\n 'description' => 'School Language Update'\n ],\n [\n 'name' => 'admin_school_language_delete',\n 'display_name' => 'School Language Delete',\n 'description' => 'School Language Delete'\n ],\n [\n 'name' => 'admin_school_language_create',\n 'display_name' => 'School Language Create',\n 'description' => 'School Language Create'\n ],\n // SCHOOL EVENT\n [\n 'name' => 'admin_school_event_view',\n 'display_name' => 'School Event View',\n 'description' => 'School Event View'\n ],\n [\n 'name' => 'admin_school_event_update',\n 'display_name' => 'School Event Update',\n 'description' => 'School Event Update'\n ],\n [\n 'name' => 'admin_school_event_delete',\n 'display_name' => 'School Event Delete',\n 'description' => 'School Event Delete'\n ],\n [\n 'name' => 'admin_school_event_create',\n 'display_name' => 'School Event Create',\n 'description' => 'School Event Create'\n ],\n // SCHOOL CATEGORY\n [\n 'name' => 'admin_school_category_view',\n 'display_name' => 'School Category View',\n 'description' => 'School Category View'\n ],\n [\n 'name' => 'admin_school_category_update',\n 'display_name' => 'School Category Update',\n 'description' => 'School Category Update'\n ],\n [\n 'name' => 'admin_school_category_delete',\n 'display_name' => 'School Category Delete',\n 'description' => 'School Category Delete'\n ],\n [\n 'name' => 'admin_school_category_create',\n 'display_name' => 'School Category Create',\n 'description' => 'School Category Create'\n ],\n // SEARCH\n [\n 'name' => 'admin_search_view',\n 'display_name' => 'Search View',\n 'description' => 'Search View'\n ],\n [\n 'name' => 'admin_search_update',\n 'display_name' => 'Search Update',\n 'description' => 'Search Update'\n ],\n [\n 'name' => 'admin_search_delete',\n 'display_name' => 'Search Delete',\n 'description' => 'Search Delete'\n ],\n [\n 'name' => 'admin_search_create',\n 'display_name' => 'Search Create',\n 'description' => 'Search Create'\n ],\n // LOCATION\n [\n 'name' => 'admin_location_view',\n 'display_name' => 'Location View',\n 'description' => 'Location View'\n ],\n [\n 'name' => 'admin_location_update',\n 'display_name' => 'Location Update',\n 'description' => 'Location Update'\n ],\n [\n 'name' => 'admin_location_delete',\n 'display_name' => 'Location Delete',\n 'description' => 'Location Delete'\n ],\n [\n 'name' => 'admin_location_create',\n 'display_name' => 'Location Create',\n 'description' => 'Location Create'\n ],\n // ROLE\n [\n 'name' => 'admin_role_view',\n 'display_name' => 'Role View',\n 'description' => 'Role View'\n ],\n [\n 'name' => 'admin_role_update',\n 'display_name' => 'Role Update',\n 'description' => 'Role Update'\n ],\n [\n 'name' => 'admin_role_delete',\n 'display_name' => 'Role Delete',\n 'description' => 'Role Delete'\n ],\n [\n 'name' => 'admin_role_create',\n 'display_name' => 'Role Create',\n 'description' => 'Role Create'\n ],\n // NEWS\n [\n 'name' => 'admin_news_view',\n 'display_name' => 'News View',\n 'description' => 'News View'\n ],\n [\n 'name' => 'admin_news_update',\n 'display_name' => 'News Update',\n 'description' => 'News Update'\n ],\n [\n 'name' => 'admin_news_delete',\n 'display_name' => 'News Delete',\n 'description' => 'News Delete'\n ],\n [\n 'name' => 'admin_news_create',\n 'display_name' => 'News Create',\n 'description' => 'News Create'\n ],\n // LOCALIZATION\n [\n 'name' => 'admin_localization_view',\n 'display_name' => 'Localization View',\n 'description' => 'Localization View'\n ],\n [\n 'name' => 'admin_localization_update',\n 'display_name' => 'Localization Update',\n 'description' => 'Localization Update'\n ],\n [\n 'name' => 'admin_localization_delete',\n 'display_name' => 'Localization Delete',\n 'description' => 'Localization Delete'\n ],\n [\n 'name' => 'admin_localization_create',\n 'display_name' => 'Localization Create',\n 'description' => 'Localization Create'\n ],\n // STATICS\n [\n 'name' => 'admin_statics_view',\n 'display_name' => 'Statics View',\n 'description' => 'Statics View'\n ],\n [\n 'name' => 'admin_statics_update',\n 'display_name' => 'Statics Update',\n 'description' => 'Statics Update'\n ],\n [\n 'name' => 'admin_statics_delete',\n 'display_name' => 'Statics Delete',\n 'description' => 'Statics Delete'\n ],\n [\n 'name' => 'admin_statics_create',\n 'display_name' => 'Statics Create',\n 'description' => 'Statics Create'\n ],\n // MENU\n [\n 'name' => 'admin_menu_view',\n 'display_name' => 'Menu View',\n 'description' => 'Menu View'\n ],\n [\n 'name' => 'admin_menu_update',\n 'display_name' => 'Menu Update',\n 'description' => 'Menu Update'\n ],\n [\n 'name' => 'admin_menu_delete',\n 'display_name' => 'Menu Delete',\n 'description' => 'Menu Delete'\n ],\n [\n 'name' => 'admin_menu_create',\n 'display_name' => 'Menu Create',\n 'description' => 'Menu Create'\n ]\n ];\n DB::table('permissions')->insert($permission);\n }",
"public function accesspermissionAction()\r\n {\r\n \r\n $this->sessionAuth->menu_permission('Set_Access_Permission');\r\n $ob_User\t= new User();\r\n $this->view->keyy=$key= trim($this->_request->getParam('user_key',''));\r\n $user_id=0;\r\n if($key)\r\n {\r\n $user_detail=$ob_User->get_transfer_detail_from_key($key);\r\n $user_id=$user_detail['user_id'];\r\n $role_id=$user_detail['account_id'];\r\n }\r\n $this->view->user_id=$user_id;\r\n if($user_id)\r\n {\r\n $ob_Permission\t= new Permission();\r\n $menu_table=$ob_Permission->get_menus();\r\n $this->view->role_permission_table=$ob_Permission->get_role_permission($role_id);\r\n $this->view->user_permission_table=$ob_Permission->get_user_permission($user_id);\r\n $temp_menu_arr=array();\r\n foreach($menu_table as $k=>$v)\r\n {\r\n if(!$v['p_menu_id'])\r\n {\r\n $temp_menu_arr[$v['menu_id']]['menu_name']=$v['menu_name'];\r\n }\r\n else\r\n {\r\n $temp_menu_arr[$v['p_menu_id']]['sub_menues'][$v['menu_id']]=$v['menu_name'];\r\n }\r\n\r\n }\r\n $this->view->menu_table=$temp_menu_arr;\r\n }\r\n else\r\n {\r\n $this->sessionAuth->menu_permission('nope');\r\n }\r\n $layout = $this->_helper->layout();\r\n $layout->setLayout('frontend/onecolumn');\r\n }",
"public function & GetPermissions ();",
"public function setPermissions()\n\t{\n\t\treturn [\n\t\t\t'product.create',\n\t\t 'issue.create',\n\t\t 'issue.edit'\n\t\t];\n\t}",
"public function accessRules(){// правила доступа к ресурсам контроллера\n $f=array();\n if(!Yii::app()->user->getState('sup')){\n $f=$this->ActionsForUser(__CLASS__);\n }\n return array(\n array('allow', // список разрешений\n 'actions'=>$f,\n 'users'=>array(Yii::app()->user->id),\n ),\n array('deny', // список запрещений\n 'users'=>array('*','$'),\n ),\n );\n }",
"private function setGroup() {\n if (Request::has(\"include-group-read\") && Request::input(\"include-group-read\") === \"true\") { $permissionRead = 4; } else { $permissionRead = 0; }\n if (Request::has(\"include-group-write\") && Request::input(\"include-group-write\") === \"true\") { $permissionWrite = 2; } else { $permissionWrite = 0; }\n if (Request::has(\"include-group-execute\") && Request::input(\"include-group-execute\") === \"true\") { $permissionExecute = 1; } else { $permissionExecute = 0; }\n return $permissionRead + $permissionWrite + $permissionExecute;\n }",
"private function metodo_privado() {\n }",
"function virustotalscan_admin_permissions(&$admin_permissions)\r\n{\r\n \tglobal $lang;\r\n // se incarca fisierul de limba\r\n \t$lang->load(\"virustotalscan\", false, true);\r\n // se seteaza textul permisiunii\r\n\t$admin_permissions['virustotalscan'] = $lang->virustotalscan_canmanage;\r\n}",
"public function providePermissions() {\n return array(\n 'CMS_ACCESS_KapostBridgeLogViewer'=>array(\n 'name'=>_t(\n 'CMSMain.ACCESS',\n \"Access to '{title}' section\",\n \"Item in permission selection identifying the admin section. Example: Access to 'Files & Images'\",\n array('title'=>_t('KapostBridgeLogViewer.MENUTITLE', 'Kapost Bridge Logs'))\n ),\n 'category'=>_t('Permission.CMS_ACCESS_CATEGORY', 'CMS Access')\n )\n );\n }",
"public function relatorio4(){\n $this->isAdmin();\n }",
"public function getAdminPermissions(): array;",
"public function accesspermission1Action()\r\n {\r\n Zend_Loader::loadClass('Permission');\r\n $this->sessionAuth->menu_permission('Set_Access_Permission');\r\n $ob_User\t= new User();\r\n $key= trim($this->_request->getParam('user_key',''));\r\n $user_id=0;\r\n if($key)\r\n {\r\n $user_detail=$ob_User->get_transfer_detail_from_key($key);\r\n $user_id=$user_detail['user_id'];\r\n $role_id=$user_detail['account_id'];\r\n }\r\n $this->view->user_id=$user_id;\r\n if($user_id)\r\n {\r\n $ob_Permission\t= new Permission();\r\n $menu_table=$ob_Permission->get_menus();\r\n $this->view->role_permission_table=$ob_Permission->get_role_permission($role_id);\r\n $this->view->user_permission_table=$ob_Permission->get_user_permission($user_id);\r\n $temp_menu_arr=array();\r\n foreach($menu_table as $k=>$v)\r\n {\r\n if(!$v['p_menu_id'])\r\n {\r\n $temp_menu_arr[$v['menu_id']]['menu_name']=$v['menu_name'];\r\n }\r\n else\r\n {\r\n $temp_menu_arr[$v['p_menu_id']]['sub_menues'][$v['menu_id']]=$v['menu_name'];\r\n }\r\n\r\n }\r\n //print \"<pre>\"; print_r($this->view->user_permission_table); print \"</pre>\";\r\n //print \"<pre>\"; print_r($temp_menu_arr); print \"</pre>\";\r\n $this->view->menu_table=$temp_menu_arr;\r\n\r\n //exit;\r\n /*$this->view->user_detail=$ob_User->getUserDetails($user_id);\r\n $ob_Credit\t= new Credit();\r\n $user_current_balance=$ob_Credit->get_current_balance($user_id);\r\n $this->view->user_expiary_date=$user_current_balance[$user_id]['expiary_date'];\r\n\r\n $subusers=$ob_User->get_sub_user_ids($user_id,0,0);\r\n $this->view->subusers_count=($subusers)?count(explode(',',$subusers)):0;*/\r\n }\r\n else\r\n {\r\n $this->sessionAuth->menu_permission('nope');\r\n }\r\n\r\n\r\n /*\r\n $ob_User\t= new User();\r\n $this->view->user_rows=$ob_User->get_user_list_rows(0,$quick_search,$arr_limit,$arr_order);\r\n $row_count=$ob_User->get_user_list_rows_count(0,$quick_search);\r\n $arr_rows=array('user_id','account_name','phone','email','nric');\r\n $this->view->page_sorting_images=$this->sessionAuth->get_sorting_html($arr_rows,$arr_order);\r\n\r\n $this->view->page_peginetion=$this->sessionAuth->get_peginetion($row_count,$page,$num_row);*/\r\n//print \"<pre>\"; print_r($aaaaaaa); print \"</pre>\"; exit;\r\n $layout = $this->_helper->layout();\r\n $layout->setLayout('frontend/onecolumn');\r\n }",
"public function run()\n {\n $i = 0;\n\n $permissionArray[$i]['name'] = 'dashboard';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'location';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'location_create';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'location_edit';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'location_delete';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'area';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'area_create';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'area_edit';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'area_delete';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'category';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'category_create';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'category_edit';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'category_delete';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'products';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'products_create';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'products_edit';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'products_delete';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'products_show';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'request-products';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'request-products_create';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'request-products_edit';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'request-products_delete';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'request-products_show';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'shop';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'shop_create';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'shop_edit';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'shop_delete';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'shop_show';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'orders';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'orders_create';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'orders_edit';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'orders_delete';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'orders_show';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'rating';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'order-notification';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'transaction';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'collection';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'collection_create';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'collection_delete';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'request-withdraw';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'request-withdraw_create';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'request-withdraw_edit';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'request-withdraw_delete';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'withdraw';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'withdraw_create';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'withdraw_delete';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'administrators';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'administrators_create';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'administrators_edit';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'administrators_delete';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'administrators_show';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'customers';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'customers_create';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'customers_edit';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'customers_delete';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'customers_show';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'delivery-boys';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'delivery-boys_create';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'delivery-boys_edit';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'delivery-boys_delete';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'delivery-boys_show';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'role';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'role_create';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'role_edit';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'role_delete';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'role_show';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'shop-owner-sales-report';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'admin-commission-report';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'credit-balance-report';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'cash-on-delivery-order-balance-report';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'banner';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'banner_create';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'banner_edit';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'banner_delete';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'page';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'page_create';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'page_edit';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'page_delete';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'updates';\n $permissionArray[$i]['guard_name'] = 'web';\n\n $i++;\n $permissionArray[$i]['name'] = 'setting';\n $permissionArray[$i]['guard_name'] = 'web';\n\n Permission::insert($permissionArray);\n }",
"public static function getAccessValues(): array {\n return array(\n self::ACCESS_ADMIN => 'admin',\n self::ACCESS_SELLER => 'seller',\n self::ACCESS_BUYER => 'buyer',\n self::ACCESS_GUEST => 'guest',\n );\n }",
"function permissions_get ()\n{\n\tstatic $perms = array (\n\t\t\t\"read\"\t\t=> 0x0001,\n\t\t\t\"create\"\t=> 0x0002,\n\t\t\t\"change\"\t=> 0x0004,\n\t\t\t\"delete\"\t=> 0x0008,\n\t\t\t\"password\"\t=> 0x0040,\n\t\t\t\"admin\"\t\t=> 0x8000,\t// admin\n\t\t\t);\n\treturn $perms;\n}",
"public function run()\n {\n $permissions = [\n \t['name' => 'view_area'], \t\t['name' => 'create_area'],\n \t['name' => 'edit_area'], \t\t['name' => 'delete_area'],\n \t['name' => 'view_branch'], \t\t['name' => 'create_branch'],\n \t['name' => 'edit_branch'], \t\t['name' => 'delete_branch'],\n \t['name' => 'view_category'], \t['name' => 'create_category'],\n \t['name' => 'edit_category'], \t['name' => 'delete_category'],\n \t['name' => 'view_sub-category'],['name' => 'create_sub-category'],\n \t['name' => 'edit_sub-category'],['name' => 'delete_sub-category'],\n \t['name' => 'view_company'], \t['name' => 'create_company'],\n \t['name' => 'edit_company'], \t['name' => 'delete_company'],\n \t['name' => 'view_farmer'], \t\t['name' => 'create_farmer'],\n\t\t\t['name' => 'edit_farmer'], \t\t['name' => 'delete_farmer'],\n\t\t\t['name' => 'view_user'], \t\t['name' => 'create_user'],\n\t\t\t['name' => 'edit_user'], \t\t['name' => 'delete_user'],\n\t\t\t['name' => 'view_product'], \t['name' => 'create_product'],\n\t\t\t['name' => 'edit_product'], \t['name' => 'delete_product'],\n\t\t\t['name' => 'view_product-price'], \t['name' => 'create_product-price'],\n\t\t\t['name' => 'edit_product-price'], \t['name' => 'delete_product-price'],\n\t\t\t['name' => 'view_unit'], \t\t['name' => 'create_unit'],\n\t\t\t['name' => 'edit_unit'], \t\t['name' => 'delete_unit'],\n\t\t\t['name' => 'view_unit-convert'],['name' => 'create_unit-convert'],\n \t['name' => 'edit_unit-convert'],['name' => 'delete_unit-convert'],\n ['name' => 'view_customer'], ['name' => 'create_customer'],\n ['name' => 'edit_customer'], ['name' => 'delete_customer'], ['name' => 'view_sale'], ['name' => 'create_sale'],\n ['name' => 'edit_sale'], ['name' => 'delete_sale'],\n ['name' => 'view_purchase'], ['name' => 'create_purchase'],\n ['name' => 'edit_purchase'], ['name' => 'delete_purchase'],\n ];\n\n foreach ($permissions as $permission) {\n\t\t Permission::create($permission);\n\t\t }\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 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 getPermissionOptions()\n {\n return [\n 'read' => 'View changes of all content',\n ];\n }",
"function call_logs_permissions()\n{\n $capabilities = [];\n\n $capabilities['capabilities'] = [\n 'view' => _l('permission_view') . '(' . _l('permission_global') . ')',\n 'create' => _l('permission_create'),\n 'edit' => _l('permission_edit'),\n 'delete' => _l('permission_delete'),\n ];\n\n register_staff_capabilities('call_logs', $capabilities, _l('call_logs'));\n}",
"public function providePermissions()\n {\n $category = EcommerceConfig::get(EcommerceRole::class, 'permission_category');\n $perms[EcommerceConfig::get(EcommerceRole::class, 'customer_permission_code')] = [\n 'name' => _t(\n 'EcommerceRole.CUSTOMER_PERMISSION_ANME',\n 'Customers'\n ),\n 'category' => $category,\n 'help' => _t(\n 'EcommerceRole.CUSTOMERS_HELP',\n 'Customer Permissions (usually very little)'\n ),\n 'sort' => 98,\n ];\n $perms[EcommerceConfig::get(EcommerceRole::class, 'admin_permission_code')] = [\n 'name' => EcommerceConfig::get(EcommerceRole::class, 'admin_role_title'),\n 'category' => $category,\n 'help' => _t(\n 'EcommerceRole.ADMINISTRATORS_HELP',\n 'Store Manager - can edit everything to do with the e-commerce application.'\n ),\n 'sort' => 99,\n ];\n $perms[EcommerceConfig::get(EcommerceRole::class, 'assistant_permission_code')] = [\n 'name' => EcommerceConfig::get(EcommerceRole::class, 'assistant_role_title'),\n 'category' => $category,\n 'help' => _t(\n 'EcommerceRole.STORE_ASSISTANTS_HELP',\n 'Store Assistant - can only view sales details and makes notes about orders'\n ),\n 'sort' => 100,\n ];\n $perms[EcommerceConfig::get(EcommerceRole::class, 'process_orders_permission_code')] = [\n 'name' => _t(\n 'EcommerceRole.PROCESS_ORDERS_PERMISSION_NAME',\n 'Can process orders'\n ),\n 'category' => $category,\n 'help' => _t(\n 'EcommerceRole.PROCESS_ORDERS_PERMISSION_HELP',\n 'Can the user progress orders through the order steps (e.g. dispatch orders)'\n ),\n 'sort' => 101,\n ];\n\n return $perms;\n }",
"public function access();",
"abstract public function getPermissions();",
"function _hippel_discussions_user_default_permissions() {\n $permissions = array();\n\n // Exported permission: create discuss content\n $permissions[] = array(\n 'name' => 'create discuss content',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: create reply content\n $permissions[] = array(\n 'name' => 'create reply content',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: edit own discuss content\n $permissions[] = array(\n 'name' => 'edit own discuss content',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: edit own reply content\n $permissions[] = array(\n 'name' => 'edit own reply content',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: use PHP for title patterns\n $permissions[] = array(\n 'name' => 'use PHP for title patterns',\n 'roles' => array(),\n );\n\n // Exported permission: use vote up/down\n $permissions[] = array(\n 'name' => 'use vote up/down',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: use vote up/down on nodes\n $permissions[] = array(\n 'name' => 'use vote up/down on nodes',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n // Exported permission: view vote up/down count on nodes\n $permissions[] = array(\n 'name' => 'view vote up/down count on nodes',\n 'roles' => array(\n '0' => 'authenticated user',\n ),\n );\n\n return $permissions;\n}",
"protected function fixPermission() {}",
"public function accessRules()\n{\nreturn array(\narray('allow', // allow admin user to perform 'admin' and 'delete' actions\n'actions'=>array(''),\n'roles'=>array('ADM'),\n),\narray('deny', // deny all users\n'roles'=>array('CUS','MKT','OPR','FIC','CRW','NAU'),\n'users'=>array('*'),\n),\n);\n}",
"public function testPermissionSet()\n {\n }",
"public function getAllowedMethods()\n {\n \n \n \n return array( \n 'homedelivery' => $this->getConfigData('homedelivery'),\n \n 'matkahuolto' => $this->getConfigData('matkahuolto'),\n 'smartpost' => $this->getConfigData('smartpost'),\n \n \n \n 'chooseapostoffice' => $this->getConfigData('chooseapostoffice'), \n 'default' => $this->getConfigData('closestpostoffice'),\n \n );\n \n }",
"function product_line_roles_fun() {\r\n return array(\r\n 'Ventilation' => 'permissiondata',\r\n 'Compression' => 'permissiondata',\r\n 'Infrastructure' => 'permissiondata',\r\n 'Stapling' => 'vlex_permissiondata',\r\n 'Patient Monitoring' => 'vlex_permissiondata',\r\n 'Ablation' => 'vlex_permissiondata',\r\n 'Vessel Sealing' => 'vlex_permissiondata',\r\n );\r\n}",
"private function setUser() {\n if (Request::has(\"include-user-read\") && Request::input(\"include-user-read\") === \"true\") { $permissionRead = 4; } else { $permissionRead = 0; }\n if (Request::has(\"include-user-write\") && Request::input(\"include-user-write\") === \"true\") { $permissionWrite = 2; } else { $permissionWrite = 0; }\n if (Request::has(\"include-user-execute\") && Request::input(\"include-user-execute\") === \"true\") { $permissionExecute = 1; } else { $permissionExecute = 0; }\n return $permissionRead + $permissionWrite + $permissionExecute;\n }",
"function forum_group_permissions( $perms ){\n\t$perms[ 'forum' ] = 'Can Post to Forum';\n\t$perms[ 'forum_moderate' ] = 'Can Moderate Forum';\n\treturn $perms;\n}",
"public function accessRules() {\n return array(\n array('allow',\n 'actions' => array(\n 'index',\n 'dadcDelivery',\n ),\n 'roles' => array('admin', 'super_admin',)\n ),\n array('deny',\n 'users' => array('*')\n )\n );\n }",
"public function getPermissions() {}",
"public function getPermissions() {}",
"private function setOther() {\n if (Request::has(\"include-other-read\") && Request::input(\"include-other-read\") === \"true\") { $permissionRead = 4; } else { $permissionRead = 0; }\n if (Request::has(\"include-other-write\") && Request::input(\"include-other-write\") === \"true\") { $permissionWrite = 2; } else { $permissionWrite = 0; }\n if (Request::has(\"include-other-execute\") && Request::input(\"include-other-execute\") === \"true\") { $permissionExecute = 1; } else { $permissionExecute = 0; }\n return $permissionRead + $permissionWrite + $permissionExecute;\n }",
"public function securityAction()\n {\n\n }",
"public function accessRules()\n {\n return array(\n array('allow',\n 'actions'=>array('audit','edit','delete','save','finish','orderGoodsDelete','validateAjax'),\n 'expression'=>array('OrderController','allowReadWrite'),\n ),\n array('allow',\n 'actions'=>array('index','view'),\n 'expression'=>array('OrderController','allowReadOnly'),\n ),\n array('allow',\n 'actions'=>array('activity','new','save','audit','delete','orderGoodsDelete','validateAjax'),\n 'expression'=>array('OrderController','addReadWrite'),\n ),\n/* array('allow',\n 'actions'=>array('index','view'),\n 'expression'=>array('OrderController','addReadOnly'),\n ),*/\n array('deny', // deny all users\n 'users'=>array('*'),\n ),\n );\n }",
"public static function permissions(): array\n {\n return [];\n }",
"function role_permission() {\n\t\tif(!has_permission(2)) {\n\t\t\tset_warning_message('Sory you\\'re not allowed to access this page.');\n\t\t\tredirect('admin');\n\t\t\texit;\n\t\t}\n\t\t\n\t\t$this->output_head['function'] = __FUNCTION__;\n\n\t\t$this->output_head['style_extras'] = array(assets_url() . '/plugins/datatables/dataTables.bootstrap.css');\n\t\t$this->output_head['js_extras'] = array(assets_url() . '/plugins/datatables/jquery.dataTables.min.js',\n\t\t\t\t\t\t\t\t\t\t\t\tassets_url() . '/plugins/datatables/dataTables.bootstrap.min.js');\n\t\t$this->output_head['js_function'] = array();\n\t\t$this->load->model('user_model');\n\t\t\n\t\t$this->load->view('global/header', $this->output_head);\n\t\t\n\t\t$this->output_data['title'] = 'Role & Permission Manager';\n\t\t$this->load->view('role_permission', $this->output_data);\n\t\t$this->load->view('global/footer');\n\t}",
"static function access () {\n onapp_debug(__CLASS__.' :: '.__FUNCTION__);\n $return = onapp_has_permission( array( 'roles' ) );\n onapp_debug( 'return => '.$return );\n return $return;\n }",
"public function acl()\n {\n return array(\n 'view' => array('index', 'view', 'get', 'indexAction', 'viewAction', 'getMethod'),\n 'edit' => array('new', 'edit', 'editlist', 'delete', 'post', 'put', 'newAction', 'editAction', 'editlistAction', 'deleteAction', 'postMethod', 'putMethod', 'deleteMethod')\n );\n }",
"public function permissioned() {\r\n $url = Url::fromUri('internal:/examples/menu-example/permissioned/controlled');\r\n $link = Link::fromTextAndUrl($this->t('examples/menu-example/permissioned/controlled'), $url)->toString();\r\n return [\r\n '#markup' => $this->t('A menu item that requires the \"access protected menu example\" permission is at @link', ['@link' => $link]),\r\n ];\r\n }",
"public function registerPermissions()\n {\n // Remove this line and uncomment block to activate\n return [\n 'IgniterLabs.Shipday.ManageSettings' => [\n 'description' => 'lang:igniterlabs.shipday::default.help_permission',\n 'group' => 'module',\n ],\n ];\n }",
"public function testAllPermissions()\n {\n }",
"private function acl()\n {\n\n $this->acl = [\n '1' =>\n [\n 'admin', 'users', 'providers', 'category', 'farmIndex', 'products', 'questions', 'clients', 'category',\n 'bills', 'orders', 'reports', 'subcategoriesQuery','featuresQuery', 'showUser', 'validateProvider', 'newProduct',\n\n 'agentsGet', 'editProduct', 'deleteProduct', 'updateProduct','newUserAdmin','user',\n 'budgetShow', 'indexProfile', 'userUpdate', 'productAgentPreview', 'productDetailPreview','validateProduct',\n 'payPlan', 'searchUser', 'category', 'products', 'products', 'adminEditProduct', 'farmCategories.create', 'farms.create',\n 'viewProduct'\n\n ],\n '2' =>\n [\n 'admin', 'users', 'providers', 'category', 'farmIndex', 'clients', 'bills',\n 'orders', 'subcategoriesQuery','featuresQuery','agentsGet','newUserAdmin','user', 'indexProfile',\n 'userUpdate', 'payPlan','searchUser',\n 'viewProduct'\n ],\n '3' =>\n [\n 'admin', 'products', 'questions', 'orders', 'registerProvider', 'isValidateProviders', 'questions',\n 'subcategoriesQuery','featuresQuery', 'newProduct', 'insertProvider', 'questionDetail', 'questionNew',\n 'editProduct', 'deleteProduct', 'updateProduct', 'indexProfile','orderShowProvider','updateStateOrder',\n 'productDetailPreview','payPlan', 'productDetailPreview','pay','historyPay', 'inactivePlan', 'callProducts',\n 'newProductProvider', 'updateProductProvider', 'providerUpdate', 'viewProduct','updateStateOrderProvider'\n ],\n\n '4' =>\n [\n 'admin', 'bills', 'orders', 'reports', 'questions', 'questionDetail', 'questionNew',\n 'clientInformationIndex', 'clientInformationStore', 'indexProfile', 'userUpdate','budgetShow','downloadBudget',\n 'orderShow', 'payPlan'\n\n ],\n '5' =>\n [\n 'admin', 'providers', 'clients', 'reports', 'showUser', 'validateProvider', 'indexProfile', 'userUpdate',\n 'productAgentPreview', 'productDetailPreview' , 'validateProduct', 'NotifyIsActive','NotifyAll', 'payPlan',\n 'viewProduct'\n ],\n '6' =>\n [\n 'admin', 'reports', 'indexProfile', 'userUpdate', 'payPlan'\n ],\n ];\n }",
"protected function getProtected(){\n return \"I am a protected function\";\n }",
"function egsr_author_cap(){\n return Array ( \n 'delete_posts' => true,\n 'delete_published_posts' => true,\n 'edit_posts' => true,\n 'edit_published_posts' => true,\n 'publish_posts' => true,\n 'read' => true,\n 'upload_files' => true,\n );\n}",
"function _getCommands()\n\t{\n\t\t$commands = array();\n\t\t$commands[] = array( 'permission' => 'read', 'cmd' => 'view', 'lang_var' => 'show', 'default' => true );\n//\t\t$commands[] = array('permission' => 'read', 'cmd' => 'render', 'lang_var' => 'show', 'default' => true);\n//\t\t$commands[] = array('permission' => 'write', 'cmd' => 'enableAdministrationPanel', 'lang_var' => 'edit_content');\n//\t\t$commands[] = array( 'permission' => 'write', 'cmd' => 'edit', 'lang_var' => 'settings' );\n\n\t\treturn $commands;\n\t}",
"public function permissionedControlled() {\r\n return [\r\n '#markup' => $this->t('This menu entry will not show and the page will not be accessible without the \"access protected menu example\" permission to current user.'),\r\n ];\r\n }",
"public function accessRules() {\n\n // en este array colocar solo los action de consulta\n return array(\n array('allow',\n 'actions' => array('index', 'EstadisticoDirectoresDiario','ReporteDetalladoDirectoresDiario'),\n 'pbac' => array( 'write','admin'),\n ),\n array('allow',\n 'actions' => array('index', 'EstadisticoDirectoresDiario','ReporteDetalladoDirectoresDiario'),\n 'pbac' => array('read'),\n ),\n // este array siempre va asì para delimitar el acceso a todos los usuarios que no tienen permisologia de read o write sobre el modulo\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }",
"function index()\n\t{\n\t\techo \"Welcome to Permission modify\";\n\t}",
"public function accessRules()\n\t{\n\t\treturn array( \t\t\t \n\t\t\tarray('allow',\n\t\t\t\t'actions'=>array('delete', 'update', 'createTask'),\n\t\t\t\t'users'=>array('@'),\t\t\t\t\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n {\n $acl = $this->acl;\n\n return [\n ['allow', // allow all users to perform 'index' and 'view' actions\n 'actions' => ['index', 'view'],\n 'users' => ['@'],\n ],\n ['allow', // allow authenticated user to perform 'create' and 'update' actions\n 'actions' => ['create', 'getLoadingAddressList'],\n 'expression' => function() use ($acl) {\n return $acl->canCreateOrder();\n },\n ],\n ['allow', // allow to perform 'accomplish' action\n 'actions' => ['update'],\n 'expression' => function() use ($acl) {\n return $acl->canUpdateOrder();\n },\n ],\n ['allow', // allow to perform 'accomplish' action\n 'actions' => ['withdraw'],\n 'expression' => function() use ($acl) {\n return $acl->canWithdrawOrder();\n },\n ],\n ['allow', // allow to perform 'accomplish' action\n 'actions' => ['restore'],\n 'expression' => function() use ($acl) {\n return $acl->canRestoreOrder();\n },\n ],\n ['allow', // allow to perform 'accomplish' action\n 'actions' => ['accomplish'],\n 'expression' => function() use ($acl) {\n return $acl->canAccomplishOrder();\n },\n ],\n ['allow', // allow to perform 'accomplish' action\n 'actions' => ['reopen'],\n 'expression' => function() use ($acl) {\n return $acl->canReopenOrder();\n },\n ],\n ['allow', // allow to perform 'loadCargo' action\n 'actions' => ['loadCargo'],\n 'expression' => function() use ($acl) {\n return $acl->canAccessLoadCargo();\n },\n ],\n ['allow', // allow to perform 'delete' action\n 'actions' => ['delete', 'softDelete'],\n 'expression' => function() use ($acl) {\n return $acl->canDeleteOrder();\n },\n ],\n ['allow', // allow admin user to perform 'admin' action\n 'actions' => ['admin'],\n 'expression' => function() use ($acl) {\n return $acl->getUser()->isAdmin();\n },\n ],\n ['deny', // deny all users\n 'users' => ['*'],\n ],\n ];\n }",
"public function accessRules()\n\t{\n\t\treturn array(\n//\t\t\tarray('allow', allow admin user to perform 'admin' and 'delete' actions\n//\t\t\t\t'actions'=>array('admin','delete','upload'),\n//\t\t\t\t'users'=>array('admin'),\n//\t\t\t),\n// array('allow',\n// 'actions'=>array('download'),\n// 'users'=>'@',\n// ),\n//\t\t\tarray('deny', deny all users\n//\t\t\t\t'users'=>array('*'),\n//\t\t\t),\n\t\t);\n\t}",
"static function getPermissionNames() {\n return static::getPermissions()->keys();\n }",
"public function accessRules() {\n return array(\n array('allow', // permite a todos los usuarios ejecutar las acciones\n 'actions' => array('index', 'view'),\n 'users' => array('*'),\n ),\n array('allow', // permite a los usuarios logueados ejecutar las acciones \n 'actions' => array('create','save', 'update', 'Documento', 'BuscaDataIndex', 'BuscarPersonas', 'GenerarXml', 'EnviarDocumento',\n 'EnviarCorreccion','EnviarAnular','EnviarCorreo','Updatemail','Savemail','XmlAutorizado'),\n 'users' => array('@'),\n ),\n array('allow', // permite que únicamente el usuario admin ejecute las , \n 'actions' => array('admin', 'delete'),\n 'users' => array('admin'),\n ),\n array('deny', // niega cualquier otra acción para cualquier usuario\n 'users' => array('*'),\n ),\n );\n }",
"public function run()\n {\n $permission = [\n // [\n // 'name' => 'user-list',\n // 'display_name' => 'List Users',\n // 'category' => 'user',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'user-create',\n // 'display_name' => 'Create Users',\n // 'category' => 'user',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'user-edit',\n // 'display_name' => 'Edit Users',\n // 'category' => 'user',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'user-delete',\n // 'display_name' => 'Delete Users',\n // 'category' => 'user',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'role-list',\n // 'display_name' => 'List roles',\n // 'category' => 'role',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'role-create',\n // 'display_name' => 'Create roles',\n // 'category' => 'role',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'role-edit',\n // 'display_name' => 'Edit roles',\n // 'category' => 'role',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'role-delete',\n // 'display_name' => 'Delete roles',\n // 'category' => 'role',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'question-category-list',\n // 'display_name' => 'List Question Categories',\n // 'category' => 'question-category',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'question-category-create',\n // 'display_name' => 'Create Question Category',\n // 'category' => 'question-category',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'question-category-edit',\n // 'display_name' => 'Edit Question Category',\n // 'category' => 'question-category',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'question-category-delete',\n // 'display_name' => 'Delete Question Category',\n // 'category' => 'question-category',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'question-list',\n // 'display_name' => 'List Questions',\n // 'category' => 'question',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'question-create',\n // 'display_name' => 'Create Question',\n // 'category' => 'question',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'question-edit',\n // 'display_name' => 'Edit Question',\n // 'category' => 'question',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'question-delete',\n // 'display_name' => 'Delete Question',\n // 'category' => 'question',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'exam-list',\n // 'display_name' => 'List Exams',\n // 'category' => 'exam',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'exam-create',\n // 'display_name' => 'Create Exam',\n // 'category' => 'exam',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'exam-edit',\n // 'display_name' => 'Edit Exam',\n // 'category' => 'exam',\n // 'guard_name' => 'admin',\n // ],\n // [\n // 'name' => 'exam-delete',\n // 'display_name' => 'Delete Exam',\n // 'category' => 'exam',\n // 'guard_name' => 'admin',\n // ],\n [\n 'name' => 'group-list',\n 'display_name' => 'List Groups',\n 'category' => 'group',\n 'guard_name' => 'admin',\n ],\n [\n 'name' => 'group-create',\n 'display_name' => 'Create Group',\n 'category' => 'group',\n 'guard_name' => 'admin',\n ],\n [\n 'name' => 'group-edit',\n 'display_name' => 'Edit Group',\n 'category' => 'group',\n 'guard_name' => 'admin',\n ],\n [\n 'name' => 'group-delete',\n 'display_name' => 'Delete Group',\n 'category' => 'group',\n 'guard_name' => 'admin',\n ],\n [\n 'name' => 'team-list',\n 'display_name' => 'List Teams',\n 'category' => 'team',\n 'guard_name' => 'admin',\n ],\n [\n 'name' => 'team-create',\n 'display_name' => 'Create Team',\n 'category' => 'team',\n 'guard_name' => 'admin',\n ],\n [\n 'name' => 'team-edit',\n 'display_name' => 'Edit Team',\n 'category' => 'team',\n 'guard_name' => 'admin',\n ],\n [\n 'name' => 'team-delete',\n 'display_name' => 'Delete Team',\n 'category' => 'team',\n 'guard_name' => 'admin',\n ],\n ];\n\n foreach ($permission as $key => $value) {\n Permission::create($value);\n }\n }",
"public function accessRules()\r\n\t{\r\n\t\t $funcionesAxu = new funcionesAux();\r\n $funcionesAxu->obtenerActionsPermitidas(Yii::app()->user->getState(\"Menu\"), Yii::app()->controller->id);\r\n \r\n $arr =$funcionesAxu->actiones; // give all access to admin\r\n if(count($arr)!=0){\r\n return array( \r\n array('allow', // allow authenticated user to perform 'create' and 'update' actions\r\n 'actions'=>$arr, \r\n 'users'=>array('@'),\r\n ),\r\n array('deny', // deny all users\r\n 'users'=>array('*'),\r\n 'deniedCallback' => function() { \r\n Yii::app()->user->setFlash('error', \"Usted no tiene permiso para relizar la acción solicitada. Inicie sesión con el usuario correspondiente \"); \r\n // Yii::app()->controller->redirect(array ('/site/index'));\r\n Yii::app()->controller->redirect(Yii::app()->request->urlReferrer); \r\n }\r\n ),\r\n );\r\n }else{\r\n return array(\r\n array('deny', // deny all users\r\n 'users'=>array('*'),\r\n 'deniedCallback' => function() { \r\n Yii::app()->user->setFlash('error', \"Usted no tiene permiso para relizar la acción solicitada. Inicie sesión con el usuario correspondiente \"); \r\n // Yii::app()->controller->redirect(array ('/site/index'));\r\n Yii::app()->controller->redirect(Yii::app()->request->urlReferrer); \r\n }\r\n ),\r\n );\r\n }\r\n \r\n\t}",
"function egsr_group_editor_cap(){\n return Array ( \n 'delete_others_pages' => true,\n 'delete_others_posts' => true,\n 'delete_pages' => true,\n 'delete_posts' => true,\n 'delete_private_pages' => true,\n 'delete_private_posts' => true,\n 'delete_published_pages' => true,\n 'delete_published_posts' => true,\n 'edit_others_pages' => true,\n 'edit_others_posts' => true,\n 'edit_pages' => true,\n 'edit_posts' => true,\n 'edit_private_pages' => true,\n 'edit_private_posts' => true,\n 'edit_published_pages' => true,\n 'edit_published_posts' => true,\n 'manage_categories' => true,\n 'manage_links' => true,\n 'moderate_comments' => true,\n 'publish_pages' => true,\n 'publish_posts' => true,\n 'read' => true,\n 'read_private_pages' => true,\n 'read_private_posts' => true,\n 'unfiltered_html' => true,\n 'upload_files' => true,\n );\n}",
"protected function setupPermissionFields()\n {\n $tab = 'Permission';\n\n// $form->appendField(new Field\\Checkbox(\\Bs\\Db\\Permission::MANAGE_STAFF))->setLabel('Manage Staff')->setTabGroup($tab)\n// ->setNotes('Add/Edit Staff user accounts');\n// $form->appendField(new Field\\Checkbox(\\Bs\\Db\\Permission::MANAGE_STUDENT))->setLabel('Manage Students')->setTabGroup($tab)\n// ->setNotes('Add/Edit Student user accounts');\n// $form->appendField(new Field\\Checkbox(\\Bs\\Db\\Permission::MANAGE_SUBJECT))->setLabel('Manage Subjects')->setTabGroup($tab)\n// ->setNotes('Add/Edit subject and student enrollments');\n }",
"function get_permission_list() {\n\t\treturn $this->db->get('system_security.security_permission');\n\t\t\n\t}",
"public function getPermission()\n {\n return $this->permission ?: 'everyone';\n }",
"function control_access($sKey, $id){ \r\n\t$permiso=false;\r\n\t$permisosAdmin=$_SESSION[\"R0l3sp3rM1s0s\"];\r\n\tif($permisosAdmin[$sKey][$id]==\"SI\"){\r\n\t\t$permiso=true;\r\n\t}\r\n\treturn $permiso;\r\n}",
"protected function buildSetterPermission() {\n }",
"static function access(){\n return onapp_has_permission(array('hypervisors', 'hypervisors.read'));\n }",
"public function accessRules() {\n // en este array colocar solo los action de consulta\n return array(\n array('allow',\n 'actions' => array(),\n 'pbac' => array('write', 'admin'),\n ),\n array('allow',\n 'actions' => array(),\n 'pbac' => array('read'),\n ),\n // este array siempre va asì para delimitar el acceso a todos los usuarios que no tienen permisologia de read o write sobre el modulo\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }",
"private function loadPermissions(): void\n {\n $permissions = Cache::get($this->cacheKey());\n\n $this->isPayor = $permissions['isPayor'];\n $this->isAgencyBankAccountSetup = $permissions['isAgencyBankAccountSetup'];\n $this->canViewDocumentation = $permissions['canViewDocumentation'];\n }",
"function set_is_admin ($permission)\r\n {\r\n $_SESSION[\"is_admin\"] = $permission;\r\n }",
"public function GetAdmin ();",
"public function accessRuless()\n\t{\n\t\treturn array(\n\t\t\tarray('allow', // allow authenticated user to perform 'create' and 'update' actions\n\t\t\t\t'actions'=>array('saveNotes','loadNotes'),\n\t\t\t\t'users'=>array('@'),\n\t\t\t),\n\t\t\tarray('allow', // allow admin user to perform 'admin' and 'delete' actions\n\t\t\t\t'actions'=>array('saveNotes','loadNotes'),\n\t\t\t\t'users'=>array('admin', 'CoryComan'),\n\t\t\t),\n\t\t\tarray('deny', // deny all users\n\t\t\t\t'users'=>array('*'),\n\t\t\t),\n\t\t);\n\t}",
"public function accessRules()\n {\n return array(\n array('allow',\n 'actions'=>array('form','save'),\n 'expression'=>array('OrderAccController','allowReadOnly'),\n ),\n array('deny', // deny all users\n 'users'=>array('*'),\n ),\n );\n }",
"public function accessRules()\n {\n return array(\n array('allow',\n 'actions'=>array('index','view'),\n 'users'=>array(\"@\")\n ),\n array('allow',\n 'actions'=>array('delall','add','edit'),\n 'users'=>User::model()->getManage(4)\n ),\n array('deny',\n 'users'=>array('*'),\n ),\n );\n }",
"public function getPermission(){\n\t\tif (Yii::$app->getUserOpt->Modul_akses('11')){\n\t\t\treturn Yii::$app->getUserOpt->Modul_akses('11');\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function authorize()\n {\n // return true;\n return access()->allow('store-monthly-meter-unit');\n }",
"function customcert_get_view_actions() {\n return array('view', 'view all', 'view report');\n}",
"function customcert_get_view_actions() {\n return array('view', 'view all', 'view report');\n}",
"protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('sales/order');\n }",
"function set_can_create_list ($permission)\r\n {\r\n $_SESSION[\"can_create_list\"] = $permission;\r\n }",
"function commerce_store_admin_order_view_access($order) {\n $access = commerce_order_admin_order_view_access($order);\n return $access || user_access('view any commerce_order entity in own store') && commerce_order_access('view', $order);\n}",
"public function accessRules()\n {\n return array(\n array('allow',\n 'actions'=>array('edit','draft','save','down','fileupload','fileRemove'),\n 'expression'=>array('SignContractController','allowReadWrite'),\n ),\n array('allow',\n 'actions'=>array('delete'),\n 'expression'=>array('SignContractController','allowDelete'),\n ),\n array('allow',\n 'actions'=>array('index','view','fileDownload'),\n 'expression'=>array('SignContractController','allowReadOnly'),\n ),\n array('deny', // deny all users\n 'users'=>array('*'),\n ),\n );\n }",
"function rights($name, $read, $write, $del, $delo, $mod, $modo, $mlevel) {\n\t$this->modulename = $name;\n\tif($read==1) $this->read = true; else $this->read = false;\n\tif($write==1) $this->write = true; else $this->write = false;\n\tif($del==1) $this->delete = true; else $this->delete = false;\n\tif($delo==1) $this->delete_others = true; else $this->delete_others = false;\n\tif($mod==1) $this->modify = true; else $this->modify = false;\n\tif($modo==1) $this->modify_others = true; else $this->modify_others = false;\n\t$this->module_level = $mlevel;\n }",
"public function run()\n {\n $permission = [\n \t[\n \t\t'name' => 'create-role',\n \t\t'display_name' => 'create data role',\n \t\t'description' => 'tambah data Role'\n \t],\n \t[\n \t\t'name' => 'edit-role',\n \t\t'display_name' => 'edit data Role',\n \t\t'description' => 'ubah New Role'\n \t],\n \t[\n \t\t'name' => 'delete-role',\n \t\t'display_name' => 'delete data Role',\n \t\t'description' => 'hapus Role'\n \t],\n [\n 'name' => 'create-user',\n 'display_name' => 'create data user',\n 'description' => 'tambah data user'\n ],\n [\n 'name' => 'edit-user',\n 'display_name' => 'edit data user',\n 'description' => 'ubah New user'\n ],\n [\n 'name' => 'delete-user',\n 'display_name' => 'delete data user',\n 'description' => 'hapus user'\n ],\n [\n 'name' => 'create-bidang',\n 'display_name' => 'create data bidang',\n 'description' => 'tambah data bidang'\n ],\n [\n 'name' => 'edit-bidang',\n 'display_name' => 'edit data bidang',\n 'description' => 'ubah New bidang'\n ],\n [\n 'name' => 'delete-bidang',\n 'display_name' => 'delete data bidang',\n 'description' => 'hapus bidang'\n ],\n [\n 'name' => 'create-pkl',\n 'display_name' => 'create data pkl',\n 'description' => 'tambah data pkl'\n ],\n [\n 'name' => 'edit-pkl',\n 'display_name' => 'edit data pkl',\n 'description' => 'ubah New pkl'\n ],\n [\n 'name' => 'delete-pkl',\n 'display_name' => 'delete data pkl',\n 'description' => 'hapus pkl'\n ],\n [\n 'name' => 'create-perusahaan',\n 'display_name' => 'create data perusahaan',\n 'description' => 'tambah data perusahaan'\n ],\n [\n 'name' => 'edit-perusahaan',\n 'display_name' => 'edit data perusahaan',\n 'description' => 'ubah New perusahaan'\n ],\n [\n 'name' => 'delete-perusahaan',\n 'display_name' => 'delete data perusahaan',\n 'description' => 'hapus perusahaan'\n ],\n [\n 'name' => 'create-bidangpkl',\n 'display_name' => 'create data bidangpkl',\n 'description' => 'tambah data bidangpkl'\n ],\n [\n 'name' => 'edit-bidangpkl',\n 'display_name' => 'edit data bidangpkl',\n 'description' => 'ubah New bidangpkl'\n ],\n [\n 'name' => 'delete-bidangpkl',\n 'display_name' => 'delete data bidangpkl',\n 'description' => 'hapus bidangpkl'\n ],\n [\n 'name' => 'create-dosen',\n 'display_name' => 'create data dosen',\n 'description' => 'tambah data dosen'\n ],\n [\n 'name' => 'edit-dosen',\n 'display_name' => 'edit data dosen',\n 'description' => 'ubah New Role'\n ],\n [\n 'name' => 'delete-dosen',\n 'display_name' => 'delete data dosen',\n 'description' => 'hapus dosen'\n ],\n [\n 'name' => 'create-pembimbing',\n 'display_name' => 'create data pembimbing',\n 'description' => 'tambah data pembimbing'\n ],\n [\n 'name' => 'edit-pembimbing',\n 'display_name' => 'edit data pembimbing',\n 'description' => 'ubah New pembimbing'\n ],\n [\n 'name' => 'delete-pembimbing',\n 'display_name' => 'delete data pembimbing',\n 'description' => 'hapus pembimbing'\n ],\n [\n 'name' => 'create-prodi',\n 'display_name' => 'create data prodi',\n 'description' => 'tambah data prodi'\n ],\n [\n 'name' => 'edit-prodi',\n 'display_name' => 'edit data prodi',\n 'description' => 'ubah New prodi'\n ],\n [\n 'name' => 'delete-prodi',\n 'display_name' => 'delete data prodi',\n 'description' => 'hapus prodi'\n ],\n [\n 'name' => 'edit-field-mhs',\n 'display_name' => 'edit field oleh mhs',\n 'description' => 'field yang dapat di akses mhs'\n ],\n [\n 'name' => 'edit-field-kaprodi',\n 'display_name' => 'edit field oleh kaprodi',\n 'description' => 'field yang dapat di akses kaprodi'\n ],\n [\n 'name' => 'download-pembimbing',\n 'display_name' => 'download data pembimbing',\n 'description' => 'download pembimbing'\n ],\n [\n 'name' => 'download-pkl',\n 'display_name' => 'download data pkl',\n 'description' => 'download pkl'\n ],\n [\n 'name' => 'show-data',\n 'display_name' => 'show data oleh user',\n 'description' => 'melihat data sesuai role'\n ],\n [\n 'name' => 'edit-data',\n 'display_name' => 'edit data oleh user',\n 'description' => 'ubah data sesuai role'\n ],\n ];\n\n foreach ($permission as $key => $value) {\n \tPermission::create($value);\n }\n \n }"
] | [
"0.69463325",
"0.6606265",
"0.6606265",
"0.6606265",
"0.6606265",
"0.6606265",
"0.64119",
"0.6280392",
"0.6255322",
"0.6225074",
"0.62204087",
"0.6210183",
"0.6135507",
"0.61038214",
"0.6012502",
"0.6003809",
"0.60029465",
"0.5969113",
"0.59356177",
"0.5932442",
"0.59308326",
"0.58585966",
"0.58368033",
"0.58179235",
"0.58174545",
"0.5811587",
"0.58051276",
"0.5777466",
"0.5769869",
"0.5738164",
"0.57291484",
"0.57118183",
"0.5706195",
"0.5700796",
"0.5698841",
"0.56973207",
"0.56930494",
"0.5683533",
"0.5670591",
"0.5669538",
"0.5669179",
"0.566656",
"0.5658801",
"0.5651598",
"0.5645406",
"0.5626832",
"0.56179625",
"0.5611801",
"0.5610205",
"0.5603065",
"0.55991",
"0.55973357",
"0.55973357",
"0.55959016",
"0.55940086",
"0.55905217",
"0.5582505",
"0.5581408",
"0.55793995",
"0.5578736",
"0.557782",
"0.5574026",
"0.55643994",
"0.55574274",
"0.55472505",
"0.5538288",
"0.55381906",
"0.5527248",
"0.55220616",
"0.5519054",
"0.5515692",
"0.5507439",
"0.55048674",
"0.5504305",
"0.55037063",
"0.55035293",
"0.5501663",
"0.5489436",
"0.5487143",
"0.5482771",
"0.54810715",
"0.5474584",
"0.5473811",
"0.5473744",
"0.54735065",
"0.5465243",
"0.54619277",
"0.54600614",
"0.54541093",
"0.5449192",
"0.5439624",
"0.5433826",
"0.54266125",
"0.54261434",
"0.54261434",
"0.5414993",
"0.5410789",
"0.5410266",
"0.54096806",
"0.54088753",
"0.54077566"
] | 0.0 | -1 |
Create New Delivery Order | public function create()
{
//$this->auth->restrict($this->addPermission);
/*
$session = $this->session->userdata('app_session');
$nodo = $this->Deliveryorder_model->generate_nodo($session['kdcab']);
$marketing = $this->Deliveryorder_model->pilih_marketing()->result();
$getitemdo = $this->Detaildeliveryorder_model->find_all_by(array('no_do'=>$nodo));
$this->template->set('marketing',$marketing);
$this->template->set('detaildo',$getitemdo);
*/
$customer = $this->Customer_model->find_all_by(array('deleted'=>0));
$this->template->set('customer',$customer);
if($this->uri->segment(3) == ""){
$data = $this->Salesorder_model->get_salesorder_open();
//$data = $this->Salesorder_model->order_by('no_so','ASC')->find_all_by(array('total !='=>0));
}else{
$data = $this->Salesorder_model->get_salesorder_open("AND id_customer ='".$this->uri->segment(3)."' ");
}
$this->template->set('results', $data);
$this->template->title('Input Delivery Order');
$this->template->render('list_so');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create(Order $order)\n {\n //\n }",
"public function creating(Order $Order)\n {\n //code...\n }",
"public function create()\n\t{\n\t\t$this->auth->restrict('Purchase_Order.Orders.Create');\n\n\t\tif (isset($_POST['save']))\n\t\t{\n\t\t\tif ($insert_id = $this->save_purchase_order())\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\tlog_activity($this->current_user->id, lang('purchase_order_act_create_record') .': '. $insert_id .' : '. $this->input->ip_address(), 'purchase_order');\n\n\t\t\t\tTemplate::set_message(lang('purchase_order_create_success'), 'success');\n\t\t\t\tredirect(SITE_AREA .'/orders/purchase_order');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('purchase_order_create_failure') . $this->purchase_order_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\tAssets::add_module_js('purchase_order', 'purchase_order.js');\n\n\t\tTemplate::set('toolbar_title', lang('purchase_order_create') . ' Purchase Order');\n\t\tTemplate::render();\n\t}",
"public function createorderAction()\n {\n\t\ttry{\n\t\t\t// Write your code here\n\t\t\t$sm = $this->getServiceLocator();\n\t\t\t$identity = $sm->get('AuthService')->getIdentity();\n\t\t\t\n\t\t\t$request = $this->getRequest();\n\t\t\tif($request->isPost()){\n\t\t\t\t$posts = $request->getPost()->toArray();\n\t\t\t\t$objOrderTable = $sm->get('Order\\Model\\OrderTable');\n\t\t\t\t\n\t\t\t\t$posts['order_attachment'] = $posts['multipleimagesHidden'];\n\t\t\t\tunset($posts['multipleimagesHidden']);\n\t\t\t\t\n\t\t\t\t/*foreach($posts as $key => $value){\n\t\t\t\t\tif(empty($value))\n\t\t\t\t\t\tunset($posts[$key]);\n\t\t\t\t}*/\n\t\t\t\t\n\t\t\t\tlist($d, $m, $y) = explode('/', $posts['exp_delivery_date']);\n\t\t\t\t$posts['exp_delivery_date'] = \"$y-$m-$d\";\n\t\t\t\t\n\t\t\t\tif(empty($posts['id'])){\n\t\t\t\t\t$posts['created_date'] = date('Y-m-d H:i:s');\n\t\t\t\t\t$posts['created_by'] = $identity['user_id'];\n\t\t\t\t}else{\n\t\t\t\t\t$posts['updated_date'] = date('Y-m-d H:i:s');\n\t\t\t\t\t$posts['updated_by'] = $identity['user_id'];\n\t\t\t\t}\n\t\t\t\tunset($posts['opp_name']);\n\t\t\t\t\n\t\t\t\techo $objOrderTable->createOrder($posts);\n\t\t\t}\n\t\t\texit;\n\t\t}catch(Exception $e){\n\t\t\t\\De\\Log::logApplicationInfo ( \"Caught Exception: \" . $e->getMessage () . ' -- File: ' . __FILE__ . ' Line: ' . __LINE__ );\n\t\t}\n }",
"public static function createOrder ()\n\t{\n $user=Auth::user();// here to get the user info and store it in the $user variable\n $order=$user->orders()->create([\n 'total'=>Cart::total(),\n 'delivered' =>0\n\n ]);\n // the delivered column will get by default the value zero which means that this order\n // is not delivered yet \n\n $cartItems=cart::content();\n //seek for intels about attach function \n\n foreach($cartItems as $cartItem)\n $order->orderItems()->attach($cartItem->id,[\n 'qty'=>$cartItem->qty ,\n 'total' => $cartItem->qty*$cartItem->price \n ]);\n\n\t}",
"public function createOrderAction()\n {\n $data = $this->Request()->getParams();\n $data = $data['data'];\n\n $orderNumber = $this->getOrderNumber();\n\n /** @var \\Shopware_Components_CreateBackendOrder $createBackendOrder */\n $createBackendOrder = Shopware()->CreateBackendOrder();\n $hasMailError = false;\n\n try {\n /** @var Shopware\\Models\\Order\\Order $orderModel */\n $orderModel = $createBackendOrder->createOrder($data, $orderNumber);\n\n if (!$orderModel instanceof \\Shopware\\Models\\Order\\Order) {\n $this->view->assign($orderModel);\n\n return false;\n }\n } catch (\\Exception $e) {\n $this->view->assign(\n [\n 'success' => false,\n 'message' => $e->getMessage()\n ]\n );\n\n return;\n }\n\n try {\n //sends and prepares the order confirmation mail\n $this->sendOrderConfirmationMail($orderModel);\n } catch (\\Exception $e) {\n $hasMailError = $e->getMessage();\n }\n\n if ($hasMailError) {\n $this->view->assign(\n [\n 'success' => true,\n 'orderId' => $orderModel->getId(),\n 'mail' => $hasMailError,\n 'ordernumber' => $orderModel->getNumber()\n ]\n );\n\n return;\n }\n\n $this->view->assign(\n [\n 'success' => true,\n 'orderId' => $orderModel->getId(),\n 'ordernumber' => $orderModel->getNumber()\n ]\n );\n }",
"public function order_create()\n {\n $this->_checkPartner();\n \n $mod_c = $this->_getConfig();\n if(isset($mod_c['orders_limit']) && $mod_c['orders_limit']) {\n $sql = \"SELECT COUNT(id) FROM client_order WHERE client_id = :cid AND DATE_FORMAT(created_at, '%Y-%m-%d') = :date GROUP BY client_id\";\n $count = R::getCell($sql, array('cid'=>$this->client->id, ':date'=>date('Y-m-d')));\n if($count >= $mod_c['orders_limit']) {\n throw new Box_Exception('Daily orders limit reached. Order today :today out of :limit', array(':today'=>$count, ':limit'=>$mod_c['orders_limit']), 8804);\n }\n }\n \n $partner = $this->service->getPartner($this->client);\n $price = $this->service->getPartnerPrice($this->client);\n \n if(isset($mod_c['check_balance']) && $mod_c['check_balance']) {\n $client = $this->getApiAdmin()->client_get(array('id'=>$this->client->id));\n if($client['balance'] < $price) {\n throw new Box_Exception('Not enough money in balance to create order. You must have at least $:price in your balance', array(':price'=>$price), 8808);\n }\n }\n \n if(!isset($mod_c['lid'])) {\n throw new Box_Exception('Partners program is temporary disabled.',null, 8806);\n }\n \n if($partner->product_id) {\n $product_id = $partner->product_id;\n } else {\n $product_id = $mod_c['lid'];\n }\n \n $odata = array(\n 'client_id' => $this->client->id,\n 'product_id' => $product_id,\n 'price' => $price,\n 'quantity' => 1,\n 'period' => '1M',\n 'activate' => true,\n 'invoice_option' => 'no-invoice',\n 'config' => array(\n 'partner_id' => $this->client->id,\n ),\n );\n \n $order_id = $this->getApiAdmin()->order_create($odata);\n \n $odata = array(\n 'id' => $order_id,\n 'invoice_option'=> 'issue-invoice',\n 'expires_at' => date('Y-m-d', strtotime('+14 days')),\n );\n $this->getApiAdmin()->order_update($odata);\n \n $this->service->addOrderForPartner($this->client, $order_id);\n \n $this->getApiAdmin()->hook_call(array('event'=>'onAfterPartnerOrderCreate', 'params'=>array('client_id'=>$this->client->id, 'order_id'=>$order_id)));\n \n $this->_log('Partner created new order #%s', $order_id);\n return $order_id;\n }",
"public function create_order( $args = array() )\n {\n return $this->_request('createorder', $args);\n }",
"protected function createOrder(){\n $order = Auth::user()->orders()->create(['status' => 'aguardando']);\n\n return $order;\n }",
"public function createOrder($order)\n {\n $this->notificationRepository->create(['type' => 'order', 'order_id' => $order->id]);\n \n event(new CreateOrderNotification);\n }",
"public function create() : Orders;",
"public function create()\n\t{\n\t\t$order = new Order;\n\n\t\t// Set the 'default' order status\n\t\t//$orderStatus = OrderStatus::find(Config::get('Orders::defaultStatus'));\n\n\t\t//$orderStatus->order()->associate($order);\n\n\n\n\t\t// Save the order\n\t\t$order->save();\n\n\t\t// Return the response, with the order, as JSON\n\t\treturn Response::json($order);\n\t}",
"public function createPayment()\n\t{\n\n\t}",
"public function actionCreate()\n {\n $model = new Delivery();\n\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n $model->save();\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function created(Order $order)\n {\n // get the service points cost\n// $serviceCost = $order->service->on_sale ? $order->service->sale_points : $order->service->points;\n // check if the current balance > service points cost\n// $userBalance = $order->client->balance->points;\n// if ($userBalance > $serviceCost && ($userBalance - $serviceCost > 0)) {\n $client = $order->client()->first();\n// $finalBalance = $userBalance - $serviceCost;\n// $client->balance()->first()->update(['points' => $finalBalance]);\n $order->update(['is_paid' => true]);\n // automatically create a job once order is paid\n $order->job()->create();\n $settings = Setting::first();\n return Mail::to($client->email)->cc($settings->info_email)->cc($settings->sales_email)->send(new OrderComplete($order, $client));\n\n// } else {\n// $order->update(['is_paid' => false, 'active' => false]);\n// }\n }",
"public function creating(Order $order)\n\t{\n\t\t$user = auth()->user();\n\n\t\t// auto set status = pending\n\t\tif (is_null($order->status)) {\n\t\t\t$order->status = Order::STATUS_PENDING;\n\t\t}\n\n\t\t// auto set user_id\n\t\tif (!empty($user)) {\n\n\t\t\t// set user_id as author\n\t\t\tif (empty($order->user_id)) {\n\t\t\t\t$order->user_id = $user->id;\n\t\t\t}\n\n\t\t\t// set company_id\n\t\t\tif (\n\t\t\t\tempty($order->company_id) &&\n\t\t\t\t!is_null($user->getCurrentCompanyId())\n\t\t\t) {\n\t\t\t\t$order->company_id = $user->getCurrentCompanyId();\n\t\t\t}\n\t\t}\n\t}",
"public function createExpressCheckoutOrder($tid){}",
"public function createAction() {\n $customer = Mage::getSingleton('customer/customer')->load(Mage::getStoreConfig('testorders/general/customerid'));\n /*empty object for sourceOrder is fine*/\n $sourceOrder = new Varien_Object();\n $sku = $this->getRequest()->getParam('sku');\n\n $messages = array();\n $model = Mage::getModel(\"testorders/simulator\");\n $model->setOrderInfo($sourceOrder, $customer, $sku);\n $order = $model->create();\n\n if ($order && $order->getIncrementId()) {\n echo \"Order #{$order->getIncrementId()} has been created from SKU : {$sku}\";\n }\n else {\n echo \"Test Order creation failed. Please check the module config and make sure selected shipping method and payment method are configured properly\";\n }\n\n exit;\n }",
"public function creating(Order $order): void\n\t{\n\t\tif (auth()->check()) {\n\t\t\t$order->client_id = auth()->id();\n\t\t}\n\t\t// If a booster has been selected for the order, set its status to progress, otherwise pending\n\t\t(bool) $order->booster_id ? $order->status = 'progress' : 'pending';\n\t}",
"public function create()\n\t{\n\t\tif (!in_array('createOrder', $this->permission)) {\n\t\t\tredirect('dashboard', 'refresh');\n\t\t}\n\n\t\t$this->data['page_title'] = 'Add Purchase Order';\n\n\t\t$this->form_validation->set_rules('product[]', 'Product name', 'trim|required');\n\n\n\t\tif ($this->form_validation->run() == TRUE) {\n\n\t\t\t$purchase_id = $this->model_purchase->create();\n\n\t\t\tif ($purchase_id) {\n\t\t\t\t$this->session->set_flashdata('success', 'Successfully created');\n\t\t\t\tredirect('purchase/', 'refresh');\n\t\t\t} else {\n\t\t\t\t$this->session->set_flashdata('errors', 'Error occurred!!');\n\t\t\t\tredirect('purchase/create/', 'refresh');\n\t\t\t}\n\t\t} else {\n\t\t\t// false case\n\t\t\t$company = $this->model_company->getCompanyData(1);\n\t\t\t$this->data['company_data'] = $company;\n\t\t\t// $this->data['is_vat_enabled'] = ($company['vat_charge_value'] > 0) ? true : false;\n\t\t\t// $this->data['is_service_enabled'] = ($company['service_charge_value'] > 0) ? true : false;\n\n\n\n\t\t\t$this->data['products'] = $this->model_products->getActiveProductData();\n\t\t\t$this->data['tax_data'] = $this->model_tax->getActiveTax();\n\n\t\t\t$this->data['party_data'] = $this->model_party->getActiveParty();\n\t\t\t$this->data['getlastpurchaseid'] = $this->model_purchase->getLastPurchaseID();\n\n\t\t\t$this->render_template('purchase/create', $this->data);\n\t\t}\n\t}",
"public function createAction(){\n if(!$this->request->isPost()){\n return $this->forward(\"orders/index\");\n }\n\n $form = new OrdersForm();\n $order = new Orders();\n $product = Products::findFirst($form->get('product_id'));\n\n $order->currency = $product->currency;\n $order->price = $product->price;\n\n $data = $this->request->getPost();\n if(!$form->isValid($data, $order)){\n echo '<pre>';\n print_r($form->getMessages());\n echo '</pre>';\n foreach($form->getMessages() as $message){\n $this->flash->error($message);\n }\n\n return $this->forward('orders/new');\n }\n\n $date = new DateTime();\n $order->date = $date->format('Y-m-d H:i:s');\n $order->paid = 0;\n $order->hash = Phalcon\\Text::random(Phalcon\\Text::RANDOM_ALNUM, 32);\n\n if($order->save() == false){\n foreach($order->getMessages() as $message){\n $this->flash->error($message);\n }\n\n return $this->forward('orders/new');\n }\n\n $form->clear();\n\n $this->flash->success(\"Zamówienie zostało przyjęte, teraz możesz je opłacić w PayPal.\");\n\n return $this->response->redirect(\"orders/payment/\" . $order->hash);\n }",
"public function created(Order $order)\n {\n //\n }",
"public function createorder()\n\n {\n $data = request()->validate([\n 'user_id' => ['required'],\n \"restaurant_id\" => ['required'],\n 'restaurant_service_id' => [],\n 'menu_id' => [],\n 'quantity' => [],\n 'table_id' => [],\n 'notes' => [],\n\n\n ]);\n\n\n\n $restaurant = RestaurantProfile::where('id', '=', $data['restaurant_id'])->get();\n\n $order = Order::create([\n 'restaurant_service_id' => $data['restaurant_service_id'],\n 'user_id' => $data['user_id'],\n 'restaurant_profile_id' => $data['restaurant_id'],\n 'menu_id' => $data['menu_id'],\n 'quantity' => $data['quantity'],\n 'table_id' => $data['table_id'] ?? null,\n 'notes' => $data['notes'] ?? null,\n 'status' => 1\n\n ]);\n if ($data['restaurant_service_id'] == 2) {\n\n $order_details = OrderDetail::create([\n 'note' => $data['note'],\n 'estate' => $data['estate'] ?? 'estate',\n 'full_name' => $data['full_name'] ?? 'full_name',\n 'email' => $data['email'] ?? 'email',\n 'note' => $data['note'] ?? 'note',\n 'phone' => $data['phone'] ?? 'phone',\n 'house' => $data['house'] ?? 'house',\n 'house_no' => $data['house_no'] ?? 'house_no',\n 'city' => $data['city'] ?? 'city',\n 'delivery_day' => $data['delivery_schedule_time'] ?? 'delivery_day',\n 'delivery_time' => $data['delivery_schedule_day'] ?? 'delivery_time',\n 'order_id' => $order->id\n ]);\n }\n\n return $this->jsonResponse(false, 'order created successfully', 'order', $order);\n }",
"public function create()\n\t{\n\t\treturn View::make('orderdeliveries.create');\n\t}",
"public function testCreateOrder() {\n $order_item = $this->createEntity('commerce_order_item', [\n 'type' => 'default',\n 'unit_price' => [\n 'number' => '999',\n 'currency_code' => 'USD',\n ],\n ]);\n $order = $this->createEntity('commerce_order', [\n 'type' => 'default',\n 'mail' => $this->loggedInUser->getEmail(),\n 'order_items' => [$order_item],\n 'uid' => $this->loggedInUser,\n 'store_id' => $this->store,\n ]);\n\n $order_exists = (bool) Order::load($order->id());\n $this->assertNotEmpty($order_exists, 'The new order has been created in the database.');\n }",
"public function store(CreateDeliveryRequest $request)\n {\n $input = $request->all();\n\n if(count($request->item_name) > 0)\n {\n foreach($request->item_name as $item=>$v){\n $data2 = array(\n 'ref_no' => $input['ref_no'],\n 'product_id' => $request->item_id[$item],\n 'quantity' => $request->item_qty[$item],\n 'unit_type' => $request->item_unit[$item],\n 'buying_price' => $request->item_prc[$item],\n 'total_cost' => $request->item_ttl_prc[$item]\n );\n DeliveryDetails::insert($data2);\n }\n }\n\n $delivery = $this->deliveryRepository->create($input);\n\n Flash::success('Delivery saved successfully.');\n\n return redirect(route('deliveries.index'));\n }",
"public function create()\n\t{\n\t\treturn view('admin.sale-order.create');\n\t}",
"public function create()\n {\n $supplyorder = new Supplyorder;\n $supplyorder->supplier_id =1;\n $supplyorder->status_id =1;\n $supplyorder->save();\n Activity::log('Created supply order #' . $supplyorder->id . '.');\n return Redirect::action('SupplyOrderController@show', $supplyorder->id);\n }",
"public function actionCreate()\n {\n /** @var Order $model */\n $model = new Order;\n // Load saved draft\n $draftModel = $model->getDraftOrderByUser($this->acl->getUser());\n if ($draftModel) {\n $model = $draftModel;\n }\n\n $event = new OrderCreatedEvent($model, $this);\n $model->onOrderCreated = [$event, 'sendNotification'];\n\n // Get current model scenario\n $scenario = $model->getScenario();\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Order'])) {\n $model->setAttributes($_POST['Order']);\n $model->setAttribute('creator_id', Yii::app()->user->getId());\n $model->orderItems = $_POST['OrderItems'];\n\n if ($model->isDraft()) {\n $redirect = ['index'];\n $scenario = 'saveDraft';\n $model->setScenario($scenario);\n // Order is not created until it is actually posted\n // It is posted when status changed from \"Draft\"\n $model->setAttribute('created', null);\n } else {\n $model->setAttribute('created', date('Y-m-d'));\n $redirect = ['view', 'id' => $model->id];\n }\n\n // Same scenario should apply to related models\n if ($model->saveWithRelated(['orderItems' => ['scenario' => $scenario]])) {\n $this->redirect($redirect);\n }\n }\n\n $this->render('create', [\n 'model' => $model,\n ]);\n }",
"function createOrder() {\n\t$postData = new Order;\n\n\treturn $postData->getOrderJson();\n}",
"public function created(Order $Order)\n {\n //code...\n }",
"public function createOrder(Request $request)\n {\n\n $order = Order::create([\n 'room_id' => $request['roomId'],\n 'user_id' => $request['userId'],\n 'guests' => $request['guests'],\n 'check_in' => $request['checkIn'],\n 'check_out' => $request['checkOut'],\n 'total_days' => $request['totalDays'],\n 'message' => $request['message'],\n 'status' => $request['status'],\n ]);\n\n return response()->json([\n \"message\" => \"pesananmu masuk kedalam proses\",\n \"data\" => $order\n ]);\n }",
"function create(Request $request) {\n // create order\n $data = [\n 'client_name' => $request->client_name,\n 'date' => $request->order_date,\n ];\n $order = $this->orders->create($data);\n\n // add products to order\n $num_products = $this->products->numProducts();\n for($i = 1; $i < $num_products + 1; $i++) {\n $key = 'product-' . $i;\n if($request[$key] != null) {\n $this->orders->addProduct($order->id, $i, $request[$key]);\n } \n }\n Redirect::to('encomendas');\n }",
"public function create()\n {\n \n return view('order.create');\n }",
"public function store(Request $request)\n {\n\n $deliver_date = $request->deliver_date;\n $initial_payment = $request->initial_payment;\n $quantity = $request->quantity;\n $status = 1;\n $product_id= $request->product_id;\n $client_id= $request->client_id;\n $user = Auth::user();\n\n Order::create([\n 'deliver_date' =>$deliver_date,\n 'initial_payment' =>$initial_payment,\n 'quantity' =>$quantity,\n 'status' =>$status,\n 'product_id' =>$product_id,\n 'client_id' =>$client_id,\n 'user_id' => $user->id,\n\n\n\n ])->save();\n\n Alert::success('Pedido Agregado');\n\n return redirect()->to('orders');\n }",
"public function actionCreate($id = null)\n {\n $deliveryPostData = Yii::$app->request->post('Delivery');\n\n if (isset($deliveryPostData['id']) && $deliveryPostData['id']>0) {\n $model = $this->findModel($deliveryPostData['id']);\n } else {\n $model = new Delivery();\n }\n \n if ($id) {\n if (\n Order::findOne(['id' => $id])->status === Order::STATUS_INACTIVE ||\n Order::findOne(['id' => $id])->status === Order::STATUS_DELETED) {\n throw new ForbiddenHttpException('Нельзя создавать отгрузки на некативные или удаленные заказы');\n }\n } else {\n $firstOrder = Order::getFirst();\n\n if (!$firstOrder) {\n $message = \"Извините, нет подходящих заказов\";\n Yii::$app->session->setFlash('error', $message);\n return $this->redirect(['index']);\n }\n $id = $firstOrder->id;\n }\n $model->order = $id;\n\n $model->load(Yii::$app->request->post());\n\n $postQuantityArray = Yii::$app->request->post('quantity');\n\n if (is_array($postQuantityArray)) {\n $model->save();\n foreach ($postQuantityArray as $productId => $quantity) {\n $deliveryToProduct = DeliveryToProduct::find()->where(['delivery' => $model->id, 'product' => $productId])->one();\n if (!$deliveryToProduct) {\n $deliveryToProduct = new DeliveryToProduct();\n $deliveryToProduct->delivery = $model->id;\n $deliveryToProduct->product = $productId;\n }\n $deliveryToProduct->quantity = $quantity;\n $deliveryToProduct->save();\n }\n }\n\n if (Yii::$app->request->post('save') === 'Y' && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n \n if (Yii::$app->request->post('add') === 'Y' && Yii::$app->request->post('addProduct')) {\n $model->save();\n $deliveryToProduct = DeliveryToProduct::find()->where(['delivery' => $model->id, 'product' => Yii::$app->request->post('addProduct')])->one();\n if (!$deliveryToProduct) {\n $quantity = $model->getOrderOne()->getOrderToProducts()->where(['product' => Yii::$app->request->post('addProduct')])->exists()? \n $model->getOrderOne()->getOrderToProducts()->where(['product' => Yii::$app->request->post('addProduct')])->one()->quantity: 0;\n \n $deliveryToProduct = new DeliveryToProduct();\n $deliveryToProduct->product = Yii::$app->request->post('addProduct');\n $deliveryToProduct->delivery = $model->id;\n $deliveryToProduct->quantity = $quantity;\n $deliveryToProduct->save();\n }\n }\n\n $deliveryToProducts = $model->getDeliveryToProductsAll($id);\n\n if (Yii::$app->request->post('remove')) {\n foreach ($deliveryToProducts as $index => $deliveryToProduct) {\n if ($deliveryToProduct->product == Yii::$app->request->post('remove')) {\n unset($deliveryToProducts[$index]);\n }\n }\n }\n\n $dataProvider = new ArrayDataProvider([\n 'allModels' => $deliveryToProducts,\n 'sort' => false,\n 'pagination' => [\n 'pageSize' => 30,\n ],\n ]);\n\n return $this->render('create', [\n 'model' => $model,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function created(Order $order)\n\t{\n\t\t//\n\t}",
"public function created(Order $order)\n\t{\n\t\t//\n\t}",
"public function create()\n {\n\n return view('vendor.voyager.order.create');\n\n //\n }",
"public function create( &$order ) {\n\t\t/**\n\t\t * Filter the generated order ID.\n\t\t *\n\t\t * @param string $order_key The uniquely-generated ID for this order.\n\t\t */\n\t\t$order_key = apply_filters( 'woocommerce_generate_order_key', uniqid( 'order_' ) );\n\n\t\t$order->set_order_key( 'wc_' . $order_key );\n\t\t$this->creating = true;\n\n\t\tparent::create( $order );\n\t}",
"public function createpoAction() {\n $filter = $this->getRequest()->getParam('top_filter');\n $helperClass = Mage::helper('inventorysupplyneeds');\n if ($helperClass->getDraftPO()->getId()) {\n Mage::getSingleton('vendorsinventory/session')->addNotice(\n $helperClass->__('There was an existed draft purchase order. Please process it before creating new one'));\n return $this->_redirect('*/*/index', array('top_filter' => $filter));\n }\n $helperClass->setTopFilter($filter);\n $data = $helperClass->prepareDataForDraftPO();\n try {\n if (!isset($data['product_data']) || !count($data['product_data'])) {\n throw new Exception($helperClass->__('There is no product needed to purchase.'));\n }\n //var_dump($data); die();\n $model = Mage::getModel('inventorypurchasing/purchaseorder_draftpo')\n ->addData($data);\n $model->setCreatedAt(now())\n ->setCreatedBy($this->_getUser()->getVendorId());\n $model->setType(Magestore_Inventorypurchasing_Model_Purchaseorder_Draftpo::SUPPLYNEED_TYPE);\n $model->create();\n Mage::getSingleton('vendorsinventory/session')\n ->addSuccess($helperClass->__('The supply needs have been saved successfully as draft purchase order(s).'));\n return $this->_redirect('*/inventory_draftpo/view', array('id' => $model->getId()));\n } catch (Exception $ex) {\n Mage::getSingleton('vendorsinventory/session')\n ->addError($helperClass->__('There is error while creating new draft purchase order.'));\n Mage::getSingleton('vendors/session')->addError($ex->getMessage());\n return $this->_redirect('*/*/index', array('top_filter' => $filter));\n }\n }",
"public function createDeliveryMethod(Request $request)\n {\n $request->validate([\n 'name' => 'required|string|max:255',\n 'price' => 'required|numeric',\n 'description' => 'string|max:255'\n ], [], [\n 'name' => 'název',\n 'price' => 'cena',\n 'description' => 'popisek'\n ]);\n $delivery_method = new DeliveryMethod;\n $delivery_method->fill($request->all());\n $delivery_method->save();\n session()->flash('success_message', 'Nový způsob dopravy byl úspěšně přidán.');\n return redirect(route('admin.delivery_and_payment_methods'));\n }",
"public function newOrder($post)\n {\n $this->id_customer=Yii::$app->getUser()->id;\n $this->date_create=date(\"Y-m-d H:i:s\");\n $this->date_deadline=date(\"Y-m-d H:i\",strtotime($this->date_deadline));\n $this->show_pre_source=0;\n if($this->special==1){\n $this->id_status=2;\n $this->id_performer=$this->idSpecialUser;\n\n\n }else{\n $this->id_status=1;\n }\n\n if($this->validate()){\n $order=new Order;\n $order->setAttributes($this->attributes);\n $order->info_text=nl2br($this->info_text);\n if($order->validate()) {\n $order->save();\n if($order->id_status==2){\n $modelPerformerOrder= new PerformerOrder;\n $modelPerformerOrder->applyAutoCreateOrder($order->id,$order);\n $order->choisePerformer($order->id_performer); //уведомление внутри функции отправится\n }\n\n\n $modelNotification= new Notification;\n $modelNotification->autoComplete(0,$order->id_customer,1,json_encode([\"id_order\"=>$order->id]));\n \n\n return $order;\n }\n else {\n Yii::trace($order->getErrors());\n }\n }\n Yii::trace($this->getErrors());\n return false;\n\n\n }",
"public function actionCreateshipment()\n\t{\n\t\tif($_POST && isset($_POST['id']))\n\t\t{\n\t\t\t$shop=isset($_POST['shopName'])?$_POST['shopName']:\"NA\";\n\t\t\t$path='shipment/'.$shop.'/'.Data::getKey($_POST['id']).'.log';\n\t\t\ttry\n\t\t\t{\t\n\t\t\t\t//create shipment data\n\t\t\t Data::createLog(\"order shipment in walmart\".PHP_EOL.json_encode($_POST),$path);\n\t\t\t\t$objController=Yii::$app->createController('walmart/walmartorderdetail');\n\t\t\t\t$objController[0]->actionCurlprocessfororder();\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\tData::createLog(\"order shipment error \".json_decode($_POST),$path,'a',true);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tData::createLog(\"order shipment error wrong post\");\n\t\t}\n\t}",
"public function actionCreate()\n {\n $model = new YxOrder();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n\t{\n\t\t$model=new Order;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Order']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Order'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function create()\n {\n return view('order-create');\n }",
"public function create()\n {\n return view('order.create');\n }",
"public function create()\n {\n return view('order.create');\n }",
"public function create()\n {\n return view('order.create');\n }",
"public function testCreate()\n {\n VCR::insertCassette('orders/create.yml');\n\n $order = Order::create(Fixture::basicOrder());\n\n $this->assertInstanceOf('\\EasyPost\\Order', $order);\n $this->assertStringMatchesFormat('order_%s', $order->id);\n $this->assertNotNull($order->rates);\n }",
"public function create()\n\t{\n\t\treturn View::make('orderdeliverypackages.create');\n\t}",
"public function create()\n {\n return view('admin.create_order');\n }",
"public function create()\n {\n return view('crud.order.create');\n }",
"public function store(CreateOrderRequest $request)\n {\n $input = $request->all();\n\n // dd($input);\n\n $order = $this->orderRepository->create($input);\n\n Flash::success('Order saved successfully.');\n\n return redirect(route('admin.products.orders.index'));\n }",
"public function create()\n {\n return view('admin.order.create');\n }",
"private function createOrder()\n {\n $order = $this->getMock(\\OxidEsales\\Eshop\\Application\\Model\\Order::class, array('validateDeliveryAddress', '_sendOrderByEmail'));\n // sending order by email is always successful for tests\n $order->expects($this->any())->method('_sendOrderByEmail')->will($this->returnValue(1));\n //mocked to circumvent delivery address change md5 check from requestParameter\n $order->expects($this->any())->method('validateDeliveryAddress')->will($this->returnValue(0));\n\n $this->testOrderId = substr_replace( oxRegistry::getUtilsObject()->generateUId(), '_', 0, 1 );\n $order->setId($this->testOrderId);\n\n return $order;\n }",
"public function create()\n {\n $order = new Order();\n $order->setAccountId($this->accountId);\n $order->setLanguage($this->language);\n\n return $order;\n }",
"public function create()\n {\n return view('po.form', [\n 'po' => new PurchaseOrder(),\n 'action' => route('po.store'),\n 'method' => 'POST',\n 'title' => 'Create'\n ]);\n }",
"public function create()\n {\n $orders = Order::all();\n $products = Product::all();\n $deliveries = Delivery::all();\n return view('orderdetails.create',compact('orders','products','deliveries'));\n }",
"public function createOrder($accessToken){\n $url = \"https://api.sandbox.paypal.com/v2/checkout/orders\";\n \n /* Call Headers */\n $paymentHeaders = array(\"Content-Type: application/json\", \"Authorization: Bearer \".$accessToken);\n \n\t/* Generates Random Invoice Number */\n\t$randNo= (string)rand(10000,20000);\n \n /* Fill payload with transaction info */\n\n\t\t\t$postfields = '{}';\n $postfieldsArr = json_decode($postfields, true);\n $postfieldsArr['intent'] = \"CAPTURE\";\n \t$postfieldsArr['application_context']['shipping_preference'] = \"SET_PROVIDED_ADDRESS\";\n \t$postfieldsArr['application_context']['user_action'] = \"PAY_NOW\";\n \t\n \t$postfieldsArr['purchase_units'][0]['description'] = \"PayPalPizza\";\n \t$postfieldsArr['purchase_units'][0]['invoice_id'] = \"INV-PayPalPizza-\" . $randNo;\n \t$postfieldsArr['purchase_units'][0]['amount']['currency_code'] = $_POST['currency'];\n \t$postfieldsArr['purchase_units'][0]['amount']['value'] = $_POST['total_amt'];\n \t$postfieldsArr['purchase_units'][0]['amount']['breakdown']['item_total']['currency_code'] = $_POST['currency'];\n \t$postfieldsArr['purchase_units'][0]['amount']['breakdown']['item_total']['value'] = $_POST['total_amt'];\n\t\t\t$postfieldsArr['purchase_units'][0]['shipping']['address']['recipient_name']= $_POST['shipping_recipient_name'];\n\t\t\t$postfieldsArr['purchase_units'][0]['shipping']['address']['phone']= $_POST['shipping_phone'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['address_line_1']= $_POST['shipping_line1'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['address_line_2']= $_POST['shipping_line2'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['admin_area_2']= $_POST['shipping_city'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['admin_area_1']= $_POST['shipping_state'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['postal_code']= $_POST['shipping_postal_code'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['country_code']= $_POST['shipping_country_code'];\n \n for($a = 0; $a < $_POST['itemnum']; $a++){\n $postfieldsArr['purchase_units'][0]['items'][$a]['name'] = $_POST[('itemname'. $a )];\n $postfieldsArr['purchase_units'][0]['items'][$a]['description'] = $_POST[('itemname'. $a)]; \n $postfieldsArr['purchase_units'][0]['items'][$a]['sku'] = $_POST[('itemsku'. $a)]; \n $postfieldsArr['purchase_units'][0]['items'][$a]['unit_amount']['currency_code'] = $_POST['currency']; \n $postfieldsArr['purchase_units'][0]['items'][$a]['unit_amount']['value'] = $_POST[('itemprice'. $a)];\n $postfieldsArr['purchase_units'][0]['items'][$a]['quantity'] = $_POST[('itemamount'. $a)];\n $postfieldsArr['purchase_units'][0]['items'][$a]['category'] = \"PHYSICAL_GOODS\";\n }\n \n $postfields = json_encode($postfieldsArr);\n \n/* Call Orders API */\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $paymentHeaders);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_POST, true);\n $run = curl_exec($ch);\n curl_close($ch);\n/* Call Orders API */\n\n echo $run;\n }",
"public function create()\n {\n if (Gate::allows('create-order')) {\n return view('orders.create', [\n 'order' => null\n ]);\n }\n else {\n abort(403);\n }\n }",
"public function create()\n\t{\n $this->load->model('ordersmodel');\n $data['json']=$this->ordersmodel->insertorders();\n\t\t$this->load->view('json',$data);\n\t}",
"public function createOrder($orderID) { global $db;\n \n // Insert Order\n $insert = $db->query(\"INSERT INTO `orders` (order_id, email_address, order_date, dispatch_date, delivery_address_id, delivery_id) \n VALUES(:order_id, :email_address, :order_date, :dispatch_date, :delivery_address_id, :delivery_id)\",\n array(\n 'order_id' => $orderID,\n 'email_address' => $_SESSION['user']['email_address'],\n 'order_date' => date(\"YmdHis\"),\n 'dispatch_date' => \"\",\n 'delivery_address_id' => $_SESSION['address']['id'],\n 'delivery_id' => $_SESSION['checkout']['delivery']['id']\n ));\n // Insert Order Totals\n $insert = $db->query(\"INSERT INTO `order_totals` (order_id, order_discount, order_delivery, order_vat, order_gross) \n VALUES(:order_id, :order_discount, :order_delivery, :order_vat, :order_gross)\",\n array(\n 'order_id' => $orderID,\n 'order_discount' => $_SESSION['checkout']['totals']['savings_total'],\n 'order_delivery' => $_SESSION['checkout']['totals']['delivery'],\n 'order_vat' => $_SESSION['checkout']['totals']['order_vat'],\n 'order_gross' => $_SESSION['checkout']['totals']['gross_total'],\n ));\n \n // Insert Order Items\n foreach($_SESSION['checkout']['items'] as $key => $item) {\n $insert = $db->query(\"INSERT INTO `order_items` (order_id, prod_code, price, qty) \n VALUES(:order_id, :prod_code, :price, :qty)\",\n array(\n 'order_id' => $orderID,\n 'prod_code' => $item['prod_code'],\n 'price' => $item['sale_total'] != 0.00 ? $item['sale_total'] : $item['price_total'],\n 'qty' => $item['qty']\n ));\n }\n \n return $orderID;\n }",
"public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Orderdelivery::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tOrderdelivery::create($data);\n\n\t\treturn Redirect::route('orderdeliveries.index');\n\t}",
"public function store(OrderCreateRequest $request)\n {\n return $this->repository->storeOrder($request);\n }",
"public function create(Request $request)\n {\n $user = $request->id;\n $restaurant = $request->restaurant;\n $date = $request->date;\n\n $cart = Cart::where('user_id', '=', $user)->first();\n\n $cart_items = CartItem::with('menu_item')->where('cart_id', '=', $cart->id)->get();\n\n $price_array = array();\n\n // get the menu item price from cart item\n foreach ($cart_items as $cart_item) {\n $price_array[] = ($cart_item->menu_item->price);\n }\n\n // create new order\n $new_order = new Order([\n 'user_id' => $user,\n 'restaurant_id' => $restaurant,\n 'total_amount' => array_sum($price_array),\n 'delivery_time' => $date,\n 'accepted' => 0,\n 'status' => 0\n ]);\n $new_order->save();\n\n foreach ($cart_items as $cart_item) {\n //create new order items\n $new_order_items = new OrderItem([\n 'order_id' => $new_order->id,\n 'menu_item_id' => $cart_item->menu_item->id,\n ]);\n $new_order_items->save();\n }\n\n // get full order just placed\n $fullOrder = Order::with('order_item.menu_item', 'restaurant')->find($new_order->id);\n return response()->json($fullOrder);\n }",
"function createOrder($order,$requester,$numberId){\n $sql='';\n //status==0 mean have to cook and else will finish now status will be send\n $finish_time=$order->status==0 ? '\\'0000-00-00 00:00:00\\'' :'now()';\n $sql = 'INSERT INTO `order` (waiter_id,chef_id, number_id, table_id, product_id,bill_detail_id, count, comments, order_time, finish_time, status, price) VALUES ';\n $sql.= '(\\''.$requester.'\\',\\'\\','.$numberId.', '.$order->table_id.', '.$order->product_id.',-1,'.$order->count.',\\''.$order->comments.'\\', now(), '.$finish_time.', \\''.$order->status.'\\', '.$order->price.');';\n //echo $sql;\n if(isset($this->connection)){\n return $this->queryNotAutoClose($sql);\n }else{\n return $this->query($sql);\n }\n }",
"public function makeorder (Request $request) {\n\n $order = new Order;\n $order->pizza_id = $request->pizzaId;\n $order->user_id = Auth::user()->id;\n\n $order->save();\n \n return redirect ('/pizzas');\n }",
"public function createOrder()\n {\n if(!request()->ajax())\n {\n throw new BadRequestHttpException();\n }\n\n $data = request()->all();\n\n $model = new OrderViewModel(request('language'));\n\n $this->orderService->fill($model);\n\n DB::beginTransaction();\n\n if (auth()->check())\n {\n $userId = auth()->id();\n }\n else\n {\n $userId = null;\n }\n \n $this->orderService->createOrder($data, $userId, $model);\n\n $this->orderService->createOrderProducts($model);\n \n try \n {\n \\Mail::to(request('email'))->send(new OrderReport($model, request('name')));\n\n \\Mail::to(config('mail.from.address'))->send(new OrderReportManager($model, request('name')));\n }\n catch (\\Exception $e)\n {\n\n DB::rollBack();\n \n return response()->json([\n 'status' => 'error'\n ]);\n }\n \n $this->cartService->clearCart();\n \n DB::commit();\n \n Session::put('isOrderCreated', true);\n \n return response()->json([\n 'status' => 'success'\n ]);\n }",
"public function postOrderDelivery(OrderDeliveryRequest $request){\n $data = [\n 'ongkir_real'=>$request->input('ongkir_real'),\n 'kurir'=>$request->input('kurir'),\n 'no_resi'=>$request->input('no_resi'),\n 'delivery_date'=>xformatDate($request->input('delivery_date')),\n 'status'=>'on delivery',\n 'modified_by'=>Auth::user()->username\n ];\n $order = Order::where('id',Input::get('order_id'))->update($data);\n //ipansuryadiflash()->success('Success', 'Order delivery success...');\n return redirect()->route('admin.pages.order');\n }",
"public function create(OrderFormRequest $request)\n {\n try {\n $request->validated();\n if (empty($request->status)) {\n $request->status = 2;\n }\n if (empty($request->user_id)) {\n $request->customer = auth()->user()->id;\n }\n $order = Order::where([\n 'user_id' => $request->customer,\n 'room_id' => $request->room,\n 'status' => $request->status\n ])->count();\n if ($order) {\n throw new \\Exception('Такой заказ уже существует');\n }\n $order = new Order();\n $order->fill([\n 'user_id' => $request->customer,\n 'room_id' => $request->room,\n 'status' => $request->status,\n 'note_date' => $this->convertDate($request->note_date, $request->note_time),\n 'days' => $request->days\n ]);\n $order->save();\n if ($order->status == 2) {\n event(new FreeRoom(0, $order->room_id));\n }\n $mail_order = $order->with(['customer', 'room'])->findOrFail($order->id);\n event(new OrderComplete($mail_order));\n event(new WriteAudit((object)[\n 'id' => $order->id,\n 'customer' => $order->user_id,\n 'room' => $order->room_id,\n 'type' => 'room'\n ], 1, 15));\n// Mail::to($mail_order->customer)->send(new OrderShipped(\n// $mail_order\n// ));\n return response()->json([\n 'status' => 'success',\n 'msg' => 'Заказ успешно добавлен'\n ], 200);\n } catch (\\Exception $error) {\n return response()->json([\n 'status' => 'error',\n 'msg' => $error->getMessage()\n ]);\n }\n }",
"public function createOrder($cartData,$token,$isApi,$customerId = NULL);",
"public function create()\n\t{\n return view('orders.create');\n\t}",
"public function create()\n {\n //\n $data = Order::join('order_dist','order.oid','=','order_dist.oid')\n ->join('eval','order.uid','=','eval.uid')\n ->join('cart','cart.sid','=','eval.sid')\n ->join('addr','order_dist.did','=','addr.did')\n ->select('order_dist.odid','order.order','addr.dname','order_dist.uway','order_dist.ostatus','cart.cafee','order_dist.ocoupon','order_dist.endprice','eval.ereply','cart.cafee')\n ->get();\n // dd($data);\n\n return view('admin.order.create',['data'=>$data]);\n\n }",
"public function createAction(){\n $nameArr= [1,2];\n $priceArr=[10,12];\n $qtyArr=[2,1];\n $data = [ [\n 'emailid' => 'issaqsyed918@gmail.com',\n 'status' => 'created'\n ] , 'nameArr' => $nameArr , 'priceArr' => $priceArr ,'qtyArr' => $qtyArr ];\n $client = new Client();\n\n $ServerPort =\"\";\n if($_SERVER['SERVER_PORT']){\n $ServerPort = ':'.$_SERVER['SERVER_PORT'];\n }\n $client->setUri('http://'.$_SERVER['SERVER_NAME'].$ServerPort.'/order-rest');\n\n // $client->setUri('http://localhost:9015/order-rest');\n $client->setOptions(array(\n 'maxredirects' => 5,\n 'timeout' => 30\n ));\n $client->setParameterPost(\n $data\n );\n $client->setMethod( Request::METHOD_POST );\n $response = $client->send();\n if ($response->isSuccess()) {\n $result = json_decode( $response->getContent() , true);\n }\n return $this->redirect()->toRoute('ordermanagement', array('action' => 'index') );\n }",
"static function createOrder(Order $newOrder) : int {\r\n $sqlInsert = \"INSERT INTO Orders (CustomerID, Amt, Dates) \r\n VALUES (:CustomerID, :Amount, :Date) \";\r\n\r\n self::$db->query($sqlInsert);\r\n\r\n self::$db->bind(':CustomerID', $newOrder->getCustomerID());\r\n self::$db->bind(':Amount', $newOrder->getAmount());\r\n self::$db->bind(':Date', $newOrder->getDate());\r\n \r\n\r\n self::$db->execute();\r\n\r\n return self::$db->lastInsertId();\r\n\r\n }",
"public function postOrderMake() {\n\n /*\n Array\n (\n [12_97d170e1550eee4afc0af065b78cda302a97674c] => 5\n [metrics] => Порода:\n Пол:\n Обхват шеи:\n Обхват груди:\n Длина спины:\n Обхват передней лапы:\n От шеи до передней лапы:\n Между передними лапами:\n\n [name] => фывчфы\n [email] => sdfsdf@masd.sd\n [address] => фывфы\n [tel] => фывфы\n [pay_type] => 1\n )\n */\n\n #Helper::ta(Input::all());\n\n /**\n * Получаем корзину\n */\n CatalogCart::getInstance();\n $goods = CatalogCart::get_full();\n #Helper::ta($goods);\n\n /**\n * Формируем массив с продуктами\n */\n $products = [];\n if (count($goods)) {\n foreach ($goods as $good_hash => $good) {\n $products[$good_hash] = [\n 'id' => $good->id,\n 'count' => $good->_amount,\n 'price' => $good->price,\n 'attributes' => (array)$good->_attributes,\n ];\n }\n }\n #Helper::ta($products);\n\n $pay_type = @$this->pay_types[Input::get('pay_type')] ?: NULL;\n\n /**\n * Формируем окончательный массив для создания заказа\n */\n $order_array = [\n 'client_name' => Input::get('name'),\n 'delivery_info' => Input::get('address') . ' ' . Input::get('email') . ' ' . Input::get('tel'),\n 'comment' => $pay_type . \"\\n\\n\" . Input::get('metrics'),\n 'status' => 1, ## Статус заказа, нужно подставлять ID статуса наподобие \"Новый заказ\"\n 'products' => $products,\n ];\n #Helper::tad($order_array);\n\n $order = Catalog::create_order($order_array);\n\n /*\n $json_request = [];\n $json_request['responseText'] = '';\n $json_request['status'] = FALSE;\n\n if (is_object($order) && $order->id)\n $json_request['status'] = TRUE;\n\n\n return Response::json($json_request, 200);\n */\n\n if (is_object($order) && $order->id) {\n\n CatalogCart::clear();\n return Redirect::route('mainpage');\n #return Redirect::route('catalog-order-success');\n\n } else {\n\n return URL::previous();\n }\n }",
"public function store(Request $request){ \n $data = $request->all();\n $user = session('user');\n unset($data['_token']);\n \n $data['buyed'] = (!empty($data['buyed']))?date_format(date_create_from_format(\"d/m/Y\",$data['buyed']),\"Y-m-d\"):NULL;\n $data['id_user'] = $user->id;\n $data['status'] = 'pending';\n $data['n_order'] = (empty($data['n_order']))?NULL:$data['n_order'];\n $data['n_tracking'] = (empty($data['n_tracking']))?NULL:$data['n_tracking'];\n $data['observations'] = (empty($data['observations']))?NULL:$data['observations'];\n \n $order = Order::updateOrCreate($data);\n\n Mail::send('email.newOrder', ['user' => $user, 'order'=>$order], function ($m) use ($user, $order) {\n $m->from('auto@soluciones-integrales.com.ve', 'Soluciones Integrales');\n $m->to($user->email, $user->name)->subject('Orden número '.$order->id);\n $m->bcc('envios@soluciones-integrales.com.ve', 'Soluciones Integrales')->subject('Orden número '.$order->id); \n }); \n \n return redirect('order/index/pending');\n }",
"public function Create() {\n\t\tvalid_only_single_method ( 'POST' );\n\t\trequire_authorization ();\n\n\t\t// Check the Phone number and Telephone number, then call the Notier model\n\t\t$courier_id\t\t\t\t= get_validated_courier_id ();\n\n\t\t$this->load->model ( 'delivery_session_model' );\n\t\t$delivery_session_id = $this->delivery_session_model->Create ( $courier_id );\n\n\n\t\tjson_response ( array ( 'response' => $this->config->item ( 'response_success' ),\n\t\t\t\t'delivery_session_id'\t=> $delivery_session_id ) );\n\t}",
"public function store(Request $request)\n {\n $this->validate($request, [\n 'service' => 'required',\n 'issue' => 'required'\n\n ]);\n\n //create Post\n $orders = new Order;\n $orders->user_id = auth()->user()->id;\n $account = Account::find($request->id);\n $orders->account()->associate($account);\n $orders->issue = $request->input('issue');\n $orders->save();\n\n return redirect ('/orders')->with('success', 'Order Created');\n\n\n }",
"public function create()\n\t{\n\t\treturn View::make('admin.orders.create');\n\t}",
"public function create_purchaseorder($ponbr) {\n\t\t\t$purchaseorder = $this->create_purchaseorderheader($ponbr);\n\t\t\t$purchaseorder['LineItem'] = $this->create_purchaseorderdetails($ponbr);\n\t\t\t$this->response = $this->curl_post($this->endpoints['purchase-order'], $purchaseorder, $json = true);\n\t\t\t$this->response['response']['PurchaseOrderNumber'] = isset($this->response['response']['PurchaseOrderNumber']) ? $this->response['response']['PurchaseOrderNumber'] : $purchaseorder['ID'];\n\t\t\t$this->process_response();\n\t\t\t//$this->response['response']['request'] = $purchaseorder;\n\t\t\treturn $this->response['response'];\n\t\t}",
"public function create()\n {\n $parts = Part::all(); \n return view('purchaseOrders.create', ['parts'=>$parts]); \n }",
"public function create()\n {\n return view('backend.orders.create');\n }",
"public function create(OrderRequest $request)\n {\n\n $order = $this->repository->newInstance([]);\n\n Form::populate($order);\n\n return response()->view('order::admin.order.create', compact('order'));\n\n }",
"public function create() {\n //Si el usuario solicito recordar entonces verifica a cookie\n if (!empty($_COOKIE['tokenCookie'])){\n $user = Account::where('token', $_COOKIE['tokenCookie'])->first();\n if (!empty($user))\n session(['user'=>$user]);\n }\n \n //Si la session esta vacia devuelve la pantalla a login\n if (empty(session('user')))\n return redirect('account/login');\n \n $user = session('user');\n $orders = array();\n $status = \"new\";\n $subtitle = 'Reportar un paquete nuevo';\n $statusName='<p style=\"color: orange; margin:0;\">Reportar un paquete nuevo</p>'; \n \n \n return view('order.create', ['user'=>$user]);\n }",
"public function makeOrderRequest()\n {\n //check if the user is logged and user permission\n if (UserManager::isUserLogged()) {\n if (UserManager::getPermission($_SESSION['email']) == BASE) {\n\n //check post variables\n if (isset($_POST['delivery_date']) && isset($_POST['article_id']) && isset($_POST['article_quantity']) && !empty($_POST['article_id']) && !empty($_POST['article_quantity']) && !empty($_POST['delivery_date'])) {\n\n //test input\n $article_id = Validator::testInput($_POST['article_id']);\n $article_quantity = Validator::testInput($_POST['article_quantity']);\n $delivery_date = Validator::testInput($_POST['delivery_date']);\n $article = ArticleManager::getArticleById($article_id);\n $expire_date = $article['data_scadenza'];\n $available_date = $article['disponibile_il'];\n\n if (Validator::isDeliveryDateValid($delivery_date, $expire_date, $available_date)) {\n\n //create order\n $order = new OrderModel($article_quantity, $article_id, UserManager::getUserByEmail($_SESSION['email'])['id'], $delivery_date);\n\n //try to make the order request\n if (OrderManager::addOrder($order)) {\n MessageManager::setSuccessMsg('Richiesta inviata. Il tuo ordine verrà visionato');\n MessageManager::unsetErrorMsg();\n } else {\n MessageManager::setErrorMsg('Impossibile richiedere questo articolo');\n }\n } else {\n MessageManager::setErrorMsg('La data di consegna non è valida');\n }\n }\n }\n header('Location: ' . URL . 'catalog');\n exit;\n }\n header('Location: ' . URL . 'home');\n }",
"public function create()\n {\n //显示添加页面\n return view('Admin.Order.add');\n }",
"public function store(CreateOrderRequest $request)\n {\n $input = $request->all();\n\n $order = $this->orderRepository->create($input);\n\n Flash::success('Order saved successfully.');\n\n return redirect(route('admin.orders.index'));\n }",
"public function create()\n {\n //\n return view('quanly.orderdetail.create');\n }",
"public function createOrder($order, $comment, $deliveryType, $datetime)\n {\n $data = $this->_prepareCreateOrder($order, $comment, $deliveryType, $datetime);\n\n return $this->apiClient->doCall(\"POST\", \"order/create\", $data);\n }",
"public function create()\n {\n $data = Order::getDataToCreteOrders();\n $data['invoice_comments'] = OfferSettings::whereType(2)->select('data')->first();\n $data['is_offer'] = 0;\n if (@$data) {\n return view('order.form', $data);\n }\n return Redirect::route($this->route)->with($this->warning, __('main.something_went_wrong'));\n }",
"private function create_order_record($id_order) {\n $aux['details'] = $this->m_orders_overview->get_details($id_order);\n\n $record['id_order'] = null; // auto-increment\n $record['id_menu_order'] = $id_order;\n $record['id_table'] = $aux['details'][0]->id_table;\n $record['id_count_ks'] = $aux['details'][0]->id_count_ks;\n $record['date_pay'] = date(\"Y-m-d\");\n\n $record['id_employee'] = $aux['details'][0]->id_employee;\n $record['pay_method'] = 'hotovost';\n $record['sum_price'] = $aux['details'][0]->price;\n $record['is_closed'] = 0;\n\n $this->m_orders_overview->insert_new_order_record($record);\n }",
"public function store(Request $request)\n {\n\n\n// return $request->all();\n $this->validate($request, [\n 'p_id' => 'required|unique:orders',\n 'product_id' => 'required',\n 'email' => 'required|email',\n 'first_name' => 'required',\n ], [\n 'p_id.required' => 'Purchase/Order ID is required',\n 'p_id.unique' => 'Purchase/Order ID is already in the database',\n 'product_id.required' => 'You should select a product'\n ]);\n\n\n $order = new Order();\n $order->p_id = $request->p_id;\n $order->product_id = $request->product_id;\n $prod_order = Order::where('product_id', '=', $request->product_id)->first();\n if (isset($prod_order)) {\n $order->product_name = $prod_order->product_name;\n } else {\n $order->product_name = '';\n }\n $order->email = $request->email;\n $order->first_name = $request->first_name;\n $order->last_name = $request->last_name;\n $order->country = $request->country;\n $order->status = $request->status;\n $order->payment_method = $request->payment_method;\n\n $date1 = new Carbon($request->p_date);\n $order->p_date = $date1->format('m/d/Y h:i:s A');\n\n $order->save();\n Flash::success('Order Created');\n return Redirect::back();\n }",
"function submitOrder() {\n\techo \"Submitting Order </br>\";\n\t$data = createOrder();\n\t$response = postRequest('/api/order', $data);\n\tprintInfo($response);\n}",
"public function store(StoreDeliveryDetailsRequest $request)\n {\n $executives = new DeliveryExecutive;\n $executives->method = $request->method;\n $executives->delivery_date = date(\"Y-m-d\",strtotime(str_replace('/', '-',$request->delivery_date)));\n if($request->method=='others')\n $executives->others = $request->others;\n $executives->distance = $request->distance;\n $executives->delivery_time = date(\"H:i\", strtotime($request->delivery_time));\n $executives->delivery_person = $request->delivery_person;\n $executives->delivery_vehicle_type = $request->delivery_vehicle_type;\n if($request->delivery_vehicle_type=='company')\n $executives->delivery_vehicle_id = $request->delivery_vehicle_id;\n $executives->branch_id = $request->branch_id;\n $executives->delivery_note = $request->delivery_note;\n $executives->save();\n return redirect('executives')->withSuccess('Delivery Details Added Successfully.');\n }",
"public function store(Request $request)\n {\n return Order::create([\"client_id\" => $request->client_id]);\n }",
"public function testCreateOrder()\n {\n $result = OrdersService::create([\n 'title' => 'Test Order',\n 'state' => 'INITIAL',\n 'res_id' => 1,\n 'foods' => [1, 2],\n ]);\n\n $this->assertInstanceOf(Model::class, $result);\n }",
"public function newOrder(NewOrderRequest $newOrderRequest)\n {\n try {\n $origin = $newOrderRequest->get('origin');\n $destination = $newOrderRequest->get('destination');\n $order = $this->orderService->createNewOrder($origin, $destination);\n\n if ($order) {\n $orderResponseData = ['id' => $order->id, 'distance' =>$order->getDistance(), 'status' => $order->status];\n\n return $this->responseHelper->sendSuccess('Success', JsonResponse::HTTP_OK, $orderResponseData);\n } else {\n return $this->responseHelper->sendError($this->orderService->error, $this->orderService->errorCode);\n }\n } catch (\\Exception $e) {\n return $this->responseHelper->sendError($e->getMessage(), JsonResponse::HTTP_INTERNAL_SERVER_ERROR);\n }\n }"
] | [
"0.7704913",
"0.76269436",
"0.75410783",
"0.7401862",
"0.7282798",
"0.72051203",
"0.7120466",
"0.71029276",
"0.7023664",
"0.70201534",
"0.69518113",
"0.69105065",
"0.69090104",
"0.68930614",
"0.6861097",
"0.686106",
"0.68524224",
"0.68503237",
"0.6833346",
"0.6817429",
"0.67498976",
"0.6738769",
"0.67225295",
"0.67149895",
"0.6712308",
"0.668653",
"0.6684483",
"0.66809285",
"0.6669289",
"0.6666045",
"0.66607434",
"0.6652935",
"0.6649723",
"0.6607563",
"0.66051024",
"0.6601029",
"0.65700096",
"0.65700096",
"0.65547615",
"0.6547951",
"0.6545087",
"0.6501422",
"0.6494941",
"0.6486207",
"0.6474373",
"0.64735854",
"0.6465477",
"0.6463914",
"0.6463914",
"0.6463914",
"0.6462878",
"0.6459676",
"0.64453423",
"0.6433748",
"0.6425172",
"0.6421919",
"0.6408517",
"0.64041144",
"0.6397262",
"0.6365264",
"0.6361167",
"0.6359396",
"0.63487655",
"0.6333759",
"0.6326751",
"0.6313503",
"0.631192",
"0.6310189",
"0.6307969",
"0.6304256",
"0.6302433",
"0.6302085",
"0.6302067",
"0.6292729",
"0.62864363",
"0.627647",
"0.6274405",
"0.6269884",
"0.6269465",
"0.6251486",
"0.62473077",
"0.6228493",
"0.6224263",
"0.6220469",
"0.62183523",
"0.62160873",
"0.6209357",
"0.6206299",
"0.619585",
"0.6187919",
"0.6185473",
"0.616764",
"0.61667126",
"0.616522",
"0.616387",
"0.61580294",
"0.61578155",
"0.61512053",
"0.61488146",
"0.6144581"
] | 0.6458365 | 52 |
Create New Delivery Order | public function proses()
{
$getparam = explode(";",$_GET['param']);
$getso = $this->Detailsalesorder_model->get_where_in('no_so',$getparam,'trans_so_header');
$and = " proses_do IS NULL ";
$getitemso = $this->Detailsalesorder_model->get_where_in_and('no_so',$getparam,$and,'trans_so_detail');
$driver = $this->Deliveryorder_model->pilih_driver()->result();
$Arr_Driver = array();
if($driver){
foreach($driver as $keyD=>$valD){
$Kode_Driver = $valD->id_karyawan;
$Name_Driver = $valD->nama_karyawan;
$Arr_Driver[$Kode_Driver] = $Name_Driver;
}
unset($driver);
}
$kendaraan = $this->Deliveryorder_model->pilih_kendaraan()->result();
$Arr_Kendaraan = array();
if($kendaraan){
foreach($kendaraan as $keyK=>$valK){
$Id_kendaraan = $valK->id_kendaraan;
$Nama_kendaraan = $valK->nm_kendaraan;
$Arr_Kendaraan[$Id_kendaraan] = $Nama_kendaraan;
}
unset($kendaraan);
}
$this->template->set('param',$getparam);
$this->template->set('headerso',$getso);
$this->template->set('getitemso',$getitemso);
$this->template->set('arr_driver',$Arr_Driver);
$this->template->set('kendaraan',$Arr_Kendaraan);
$this->template->title('Input Delivery Order');
$this->template->render('deliveryorder_form');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create(Order $order)\n {\n //\n }",
"public function creating(Order $Order)\n {\n //code...\n }",
"public function create()\n\t{\n\t\t$this->auth->restrict('Purchase_Order.Orders.Create');\n\n\t\tif (isset($_POST['save']))\n\t\t{\n\t\t\tif ($insert_id = $this->save_purchase_order())\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\tlog_activity($this->current_user->id, lang('purchase_order_act_create_record') .': '. $insert_id .' : '. $this->input->ip_address(), 'purchase_order');\n\n\t\t\t\tTemplate::set_message(lang('purchase_order_create_success'), 'success');\n\t\t\t\tredirect(SITE_AREA .'/orders/purchase_order');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('purchase_order_create_failure') . $this->purchase_order_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\tAssets::add_module_js('purchase_order', 'purchase_order.js');\n\n\t\tTemplate::set('toolbar_title', lang('purchase_order_create') . ' Purchase Order');\n\t\tTemplate::render();\n\t}",
"public function createorderAction()\n {\n\t\ttry{\n\t\t\t// Write your code here\n\t\t\t$sm = $this->getServiceLocator();\n\t\t\t$identity = $sm->get('AuthService')->getIdentity();\n\t\t\t\n\t\t\t$request = $this->getRequest();\n\t\t\tif($request->isPost()){\n\t\t\t\t$posts = $request->getPost()->toArray();\n\t\t\t\t$objOrderTable = $sm->get('Order\\Model\\OrderTable');\n\t\t\t\t\n\t\t\t\t$posts['order_attachment'] = $posts['multipleimagesHidden'];\n\t\t\t\tunset($posts['multipleimagesHidden']);\n\t\t\t\t\n\t\t\t\t/*foreach($posts as $key => $value){\n\t\t\t\t\tif(empty($value))\n\t\t\t\t\t\tunset($posts[$key]);\n\t\t\t\t}*/\n\t\t\t\t\n\t\t\t\tlist($d, $m, $y) = explode('/', $posts['exp_delivery_date']);\n\t\t\t\t$posts['exp_delivery_date'] = \"$y-$m-$d\";\n\t\t\t\t\n\t\t\t\tif(empty($posts['id'])){\n\t\t\t\t\t$posts['created_date'] = date('Y-m-d H:i:s');\n\t\t\t\t\t$posts['created_by'] = $identity['user_id'];\n\t\t\t\t}else{\n\t\t\t\t\t$posts['updated_date'] = date('Y-m-d H:i:s');\n\t\t\t\t\t$posts['updated_by'] = $identity['user_id'];\n\t\t\t\t}\n\t\t\t\tunset($posts['opp_name']);\n\t\t\t\t\n\t\t\t\techo $objOrderTable->createOrder($posts);\n\t\t\t}\n\t\t\texit;\n\t\t}catch(Exception $e){\n\t\t\t\\De\\Log::logApplicationInfo ( \"Caught Exception: \" . $e->getMessage () . ' -- File: ' . __FILE__ . ' Line: ' . __LINE__ );\n\t\t}\n }",
"public static function createOrder ()\n\t{\n $user=Auth::user();// here to get the user info and store it in the $user variable\n $order=$user->orders()->create([\n 'total'=>Cart::total(),\n 'delivered' =>0\n\n ]);\n // the delivered column will get by default the value zero which means that this order\n // is not delivered yet \n\n $cartItems=cart::content();\n //seek for intels about attach function \n\n foreach($cartItems as $cartItem)\n $order->orderItems()->attach($cartItem->id,[\n 'qty'=>$cartItem->qty ,\n 'total' => $cartItem->qty*$cartItem->price \n ]);\n\n\t}",
"public function createOrderAction()\n {\n $data = $this->Request()->getParams();\n $data = $data['data'];\n\n $orderNumber = $this->getOrderNumber();\n\n /** @var \\Shopware_Components_CreateBackendOrder $createBackendOrder */\n $createBackendOrder = Shopware()->CreateBackendOrder();\n $hasMailError = false;\n\n try {\n /** @var Shopware\\Models\\Order\\Order $orderModel */\n $orderModel = $createBackendOrder->createOrder($data, $orderNumber);\n\n if (!$orderModel instanceof \\Shopware\\Models\\Order\\Order) {\n $this->view->assign($orderModel);\n\n return false;\n }\n } catch (\\Exception $e) {\n $this->view->assign(\n [\n 'success' => false,\n 'message' => $e->getMessage()\n ]\n );\n\n return;\n }\n\n try {\n //sends and prepares the order confirmation mail\n $this->sendOrderConfirmationMail($orderModel);\n } catch (\\Exception $e) {\n $hasMailError = $e->getMessage();\n }\n\n if ($hasMailError) {\n $this->view->assign(\n [\n 'success' => true,\n 'orderId' => $orderModel->getId(),\n 'mail' => $hasMailError,\n 'ordernumber' => $orderModel->getNumber()\n ]\n );\n\n return;\n }\n\n $this->view->assign(\n [\n 'success' => true,\n 'orderId' => $orderModel->getId(),\n 'ordernumber' => $orderModel->getNumber()\n ]\n );\n }",
"public function order_create()\n {\n $this->_checkPartner();\n \n $mod_c = $this->_getConfig();\n if(isset($mod_c['orders_limit']) && $mod_c['orders_limit']) {\n $sql = \"SELECT COUNT(id) FROM client_order WHERE client_id = :cid AND DATE_FORMAT(created_at, '%Y-%m-%d') = :date GROUP BY client_id\";\n $count = R::getCell($sql, array('cid'=>$this->client->id, ':date'=>date('Y-m-d')));\n if($count >= $mod_c['orders_limit']) {\n throw new Box_Exception('Daily orders limit reached. Order today :today out of :limit', array(':today'=>$count, ':limit'=>$mod_c['orders_limit']), 8804);\n }\n }\n \n $partner = $this->service->getPartner($this->client);\n $price = $this->service->getPartnerPrice($this->client);\n \n if(isset($mod_c['check_balance']) && $mod_c['check_balance']) {\n $client = $this->getApiAdmin()->client_get(array('id'=>$this->client->id));\n if($client['balance'] < $price) {\n throw new Box_Exception('Not enough money in balance to create order. You must have at least $:price in your balance', array(':price'=>$price), 8808);\n }\n }\n \n if(!isset($mod_c['lid'])) {\n throw new Box_Exception('Partners program is temporary disabled.',null, 8806);\n }\n \n if($partner->product_id) {\n $product_id = $partner->product_id;\n } else {\n $product_id = $mod_c['lid'];\n }\n \n $odata = array(\n 'client_id' => $this->client->id,\n 'product_id' => $product_id,\n 'price' => $price,\n 'quantity' => 1,\n 'period' => '1M',\n 'activate' => true,\n 'invoice_option' => 'no-invoice',\n 'config' => array(\n 'partner_id' => $this->client->id,\n ),\n );\n \n $order_id = $this->getApiAdmin()->order_create($odata);\n \n $odata = array(\n 'id' => $order_id,\n 'invoice_option'=> 'issue-invoice',\n 'expires_at' => date('Y-m-d', strtotime('+14 days')),\n );\n $this->getApiAdmin()->order_update($odata);\n \n $this->service->addOrderForPartner($this->client, $order_id);\n \n $this->getApiAdmin()->hook_call(array('event'=>'onAfterPartnerOrderCreate', 'params'=>array('client_id'=>$this->client->id, 'order_id'=>$order_id)));\n \n $this->_log('Partner created new order #%s', $order_id);\n return $order_id;\n }",
"public function create_order( $args = array() )\n {\n return $this->_request('createorder', $args);\n }",
"protected function createOrder(){\n $order = Auth::user()->orders()->create(['status' => 'aguardando']);\n\n return $order;\n }",
"public function createOrder($order)\n {\n $this->notificationRepository->create(['type' => 'order', 'order_id' => $order->id]);\n \n event(new CreateOrderNotification);\n }",
"public function create() : Orders;",
"public function create()\n\t{\n\t\t$order = new Order;\n\n\t\t// Set the 'default' order status\n\t\t//$orderStatus = OrderStatus::find(Config::get('Orders::defaultStatus'));\n\n\t\t//$orderStatus->order()->associate($order);\n\n\n\n\t\t// Save the order\n\t\t$order->save();\n\n\t\t// Return the response, with the order, as JSON\n\t\treturn Response::json($order);\n\t}",
"public function createPayment()\n\t{\n\n\t}",
"public function actionCreate()\n {\n $model = new Delivery();\n\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n $model->save();\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function creating(Order $order)\n\t{\n\t\t$user = auth()->user();\n\n\t\t// auto set status = pending\n\t\tif (is_null($order->status)) {\n\t\t\t$order->status = Order::STATUS_PENDING;\n\t\t}\n\n\t\t// auto set user_id\n\t\tif (!empty($user)) {\n\n\t\t\t// set user_id as author\n\t\t\tif (empty($order->user_id)) {\n\t\t\t\t$order->user_id = $user->id;\n\t\t\t}\n\n\t\t\t// set company_id\n\t\t\tif (\n\t\t\t\tempty($order->company_id) &&\n\t\t\t\t!is_null($user->getCurrentCompanyId())\n\t\t\t) {\n\t\t\t\t$order->company_id = $user->getCurrentCompanyId();\n\t\t\t}\n\t\t}\n\t}",
"public function created(Order $order)\n {\n // get the service points cost\n// $serviceCost = $order->service->on_sale ? $order->service->sale_points : $order->service->points;\n // check if the current balance > service points cost\n// $userBalance = $order->client->balance->points;\n// if ($userBalance > $serviceCost && ($userBalance - $serviceCost > 0)) {\n $client = $order->client()->first();\n// $finalBalance = $userBalance - $serviceCost;\n// $client->balance()->first()->update(['points' => $finalBalance]);\n $order->update(['is_paid' => true]);\n // automatically create a job once order is paid\n $order->job()->create();\n $settings = Setting::first();\n return Mail::to($client->email)->cc($settings->info_email)->cc($settings->sales_email)->send(new OrderComplete($order, $client));\n\n// } else {\n// $order->update(['is_paid' => false, 'active' => false]);\n// }\n }",
"public function createExpressCheckoutOrder($tid){}",
"public function createAction() {\n $customer = Mage::getSingleton('customer/customer')->load(Mage::getStoreConfig('testorders/general/customerid'));\n /*empty object for sourceOrder is fine*/\n $sourceOrder = new Varien_Object();\n $sku = $this->getRequest()->getParam('sku');\n\n $messages = array();\n $model = Mage::getModel(\"testorders/simulator\");\n $model->setOrderInfo($sourceOrder, $customer, $sku);\n $order = $model->create();\n\n if ($order && $order->getIncrementId()) {\n echo \"Order #{$order->getIncrementId()} has been created from SKU : {$sku}\";\n }\n else {\n echo \"Test Order creation failed. Please check the module config and make sure selected shipping method and payment method are configured properly\";\n }\n\n exit;\n }",
"public function creating(Order $order): void\n\t{\n\t\tif (auth()->check()) {\n\t\t\t$order->client_id = auth()->id();\n\t\t}\n\t\t// If a booster has been selected for the order, set its status to progress, otherwise pending\n\t\t(bool) $order->booster_id ? $order->status = 'progress' : 'pending';\n\t}",
"public function create()\n\t{\n\t\tif (!in_array('createOrder', $this->permission)) {\n\t\t\tredirect('dashboard', 'refresh');\n\t\t}\n\n\t\t$this->data['page_title'] = 'Add Purchase Order';\n\n\t\t$this->form_validation->set_rules('product[]', 'Product name', 'trim|required');\n\n\n\t\tif ($this->form_validation->run() == TRUE) {\n\n\t\t\t$purchase_id = $this->model_purchase->create();\n\n\t\t\tif ($purchase_id) {\n\t\t\t\t$this->session->set_flashdata('success', 'Successfully created');\n\t\t\t\tredirect('purchase/', 'refresh');\n\t\t\t} else {\n\t\t\t\t$this->session->set_flashdata('errors', 'Error occurred!!');\n\t\t\t\tredirect('purchase/create/', 'refresh');\n\t\t\t}\n\t\t} else {\n\t\t\t// false case\n\t\t\t$company = $this->model_company->getCompanyData(1);\n\t\t\t$this->data['company_data'] = $company;\n\t\t\t// $this->data['is_vat_enabled'] = ($company['vat_charge_value'] > 0) ? true : false;\n\t\t\t// $this->data['is_service_enabled'] = ($company['service_charge_value'] > 0) ? true : false;\n\n\n\n\t\t\t$this->data['products'] = $this->model_products->getActiveProductData();\n\t\t\t$this->data['tax_data'] = $this->model_tax->getActiveTax();\n\n\t\t\t$this->data['party_data'] = $this->model_party->getActiveParty();\n\t\t\t$this->data['getlastpurchaseid'] = $this->model_purchase->getLastPurchaseID();\n\n\t\t\t$this->render_template('purchase/create', $this->data);\n\t\t}\n\t}",
"public function createAction(){\n if(!$this->request->isPost()){\n return $this->forward(\"orders/index\");\n }\n\n $form = new OrdersForm();\n $order = new Orders();\n $product = Products::findFirst($form->get('product_id'));\n\n $order->currency = $product->currency;\n $order->price = $product->price;\n\n $data = $this->request->getPost();\n if(!$form->isValid($data, $order)){\n echo '<pre>';\n print_r($form->getMessages());\n echo '</pre>';\n foreach($form->getMessages() as $message){\n $this->flash->error($message);\n }\n\n return $this->forward('orders/new');\n }\n\n $date = new DateTime();\n $order->date = $date->format('Y-m-d H:i:s');\n $order->paid = 0;\n $order->hash = Phalcon\\Text::random(Phalcon\\Text::RANDOM_ALNUM, 32);\n\n if($order->save() == false){\n foreach($order->getMessages() as $message){\n $this->flash->error($message);\n }\n\n return $this->forward('orders/new');\n }\n\n $form->clear();\n\n $this->flash->success(\"Zamówienie zostało przyjęte, teraz możesz je opłacić w PayPal.\");\n\n return $this->response->redirect(\"orders/payment/\" . $order->hash);\n }",
"public function created(Order $order)\n {\n //\n }",
"public function createorder()\n\n {\n $data = request()->validate([\n 'user_id' => ['required'],\n \"restaurant_id\" => ['required'],\n 'restaurant_service_id' => [],\n 'menu_id' => [],\n 'quantity' => [],\n 'table_id' => [],\n 'notes' => [],\n\n\n ]);\n\n\n\n $restaurant = RestaurantProfile::where('id', '=', $data['restaurant_id'])->get();\n\n $order = Order::create([\n 'restaurant_service_id' => $data['restaurant_service_id'],\n 'user_id' => $data['user_id'],\n 'restaurant_profile_id' => $data['restaurant_id'],\n 'menu_id' => $data['menu_id'],\n 'quantity' => $data['quantity'],\n 'table_id' => $data['table_id'] ?? null,\n 'notes' => $data['notes'] ?? null,\n 'status' => 1\n\n ]);\n if ($data['restaurant_service_id'] == 2) {\n\n $order_details = OrderDetail::create([\n 'note' => $data['note'],\n 'estate' => $data['estate'] ?? 'estate',\n 'full_name' => $data['full_name'] ?? 'full_name',\n 'email' => $data['email'] ?? 'email',\n 'note' => $data['note'] ?? 'note',\n 'phone' => $data['phone'] ?? 'phone',\n 'house' => $data['house'] ?? 'house',\n 'house_no' => $data['house_no'] ?? 'house_no',\n 'city' => $data['city'] ?? 'city',\n 'delivery_day' => $data['delivery_schedule_time'] ?? 'delivery_day',\n 'delivery_time' => $data['delivery_schedule_day'] ?? 'delivery_time',\n 'order_id' => $order->id\n ]);\n }\n\n return $this->jsonResponse(false, 'order created successfully', 'order', $order);\n }",
"public function create()\n\t{\n\t\treturn View::make('orderdeliveries.create');\n\t}",
"public function testCreateOrder() {\n $order_item = $this->createEntity('commerce_order_item', [\n 'type' => 'default',\n 'unit_price' => [\n 'number' => '999',\n 'currency_code' => 'USD',\n ],\n ]);\n $order = $this->createEntity('commerce_order', [\n 'type' => 'default',\n 'mail' => $this->loggedInUser->getEmail(),\n 'order_items' => [$order_item],\n 'uid' => $this->loggedInUser,\n 'store_id' => $this->store,\n ]);\n\n $order_exists = (bool) Order::load($order->id());\n $this->assertNotEmpty($order_exists, 'The new order has been created in the database.');\n }",
"public function store(CreateDeliveryRequest $request)\n {\n $input = $request->all();\n\n if(count($request->item_name) > 0)\n {\n foreach($request->item_name as $item=>$v){\n $data2 = array(\n 'ref_no' => $input['ref_no'],\n 'product_id' => $request->item_id[$item],\n 'quantity' => $request->item_qty[$item],\n 'unit_type' => $request->item_unit[$item],\n 'buying_price' => $request->item_prc[$item],\n 'total_cost' => $request->item_ttl_prc[$item]\n );\n DeliveryDetails::insert($data2);\n }\n }\n\n $delivery = $this->deliveryRepository->create($input);\n\n Flash::success('Delivery saved successfully.');\n\n return redirect(route('deliveries.index'));\n }",
"public function create()\n\t{\n\t\treturn view('admin.sale-order.create');\n\t}",
"public function create()\n {\n $supplyorder = new Supplyorder;\n $supplyorder->supplier_id =1;\n $supplyorder->status_id =1;\n $supplyorder->save();\n Activity::log('Created supply order #' . $supplyorder->id . '.');\n return Redirect::action('SupplyOrderController@show', $supplyorder->id);\n }",
"public function actionCreate()\n {\n /** @var Order $model */\n $model = new Order;\n // Load saved draft\n $draftModel = $model->getDraftOrderByUser($this->acl->getUser());\n if ($draftModel) {\n $model = $draftModel;\n }\n\n $event = new OrderCreatedEvent($model, $this);\n $model->onOrderCreated = [$event, 'sendNotification'];\n\n // Get current model scenario\n $scenario = $model->getScenario();\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Order'])) {\n $model->setAttributes($_POST['Order']);\n $model->setAttribute('creator_id', Yii::app()->user->getId());\n $model->orderItems = $_POST['OrderItems'];\n\n if ($model->isDraft()) {\n $redirect = ['index'];\n $scenario = 'saveDraft';\n $model->setScenario($scenario);\n // Order is not created until it is actually posted\n // It is posted when status changed from \"Draft\"\n $model->setAttribute('created', null);\n } else {\n $model->setAttribute('created', date('Y-m-d'));\n $redirect = ['view', 'id' => $model->id];\n }\n\n // Same scenario should apply to related models\n if ($model->saveWithRelated(['orderItems' => ['scenario' => $scenario]])) {\n $this->redirect($redirect);\n }\n }\n\n $this->render('create', [\n 'model' => $model,\n ]);\n }",
"function createOrder() {\n\t$postData = new Order;\n\n\treturn $postData->getOrderJson();\n}",
"public function created(Order $Order)\n {\n //code...\n }",
"public function createOrder(Request $request)\n {\n\n $order = Order::create([\n 'room_id' => $request['roomId'],\n 'user_id' => $request['userId'],\n 'guests' => $request['guests'],\n 'check_in' => $request['checkIn'],\n 'check_out' => $request['checkOut'],\n 'total_days' => $request['totalDays'],\n 'message' => $request['message'],\n 'status' => $request['status'],\n ]);\n\n return response()->json([\n \"message\" => \"pesananmu masuk kedalam proses\",\n \"data\" => $order\n ]);\n }",
"function create(Request $request) {\n // create order\n $data = [\n 'client_name' => $request->client_name,\n 'date' => $request->order_date,\n ];\n $order = $this->orders->create($data);\n\n // add products to order\n $num_products = $this->products->numProducts();\n for($i = 1; $i < $num_products + 1; $i++) {\n $key = 'product-' . $i;\n if($request[$key] != null) {\n $this->orders->addProduct($order->id, $i, $request[$key]);\n } \n }\n Redirect::to('encomendas');\n }",
"public function create()\n {\n \n return view('order.create');\n }",
"public function store(Request $request)\n {\n\n $deliver_date = $request->deliver_date;\n $initial_payment = $request->initial_payment;\n $quantity = $request->quantity;\n $status = 1;\n $product_id= $request->product_id;\n $client_id= $request->client_id;\n $user = Auth::user();\n\n Order::create([\n 'deliver_date' =>$deliver_date,\n 'initial_payment' =>$initial_payment,\n 'quantity' =>$quantity,\n 'status' =>$status,\n 'product_id' =>$product_id,\n 'client_id' =>$client_id,\n 'user_id' => $user->id,\n\n\n\n ])->save();\n\n Alert::success('Pedido Agregado');\n\n return redirect()->to('orders');\n }",
"public function actionCreate($id = null)\n {\n $deliveryPostData = Yii::$app->request->post('Delivery');\n\n if (isset($deliveryPostData['id']) && $deliveryPostData['id']>0) {\n $model = $this->findModel($deliveryPostData['id']);\n } else {\n $model = new Delivery();\n }\n \n if ($id) {\n if (\n Order::findOne(['id' => $id])->status === Order::STATUS_INACTIVE ||\n Order::findOne(['id' => $id])->status === Order::STATUS_DELETED) {\n throw new ForbiddenHttpException('Нельзя создавать отгрузки на некативные или удаленные заказы');\n }\n } else {\n $firstOrder = Order::getFirst();\n\n if (!$firstOrder) {\n $message = \"Извините, нет подходящих заказов\";\n Yii::$app->session->setFlash('error', $message);\n return $this->redirect(['index']);\n }\n $id = $firstOrder->id;\n }\n $model->order = $id;\n\n $model->load(Yii::$app->request->post());\n\n $postQuantityArray = Yii::$app->request->post('quantity');\n\n if (is_array($postQuantityArray)) {\n $model->save();\n foreach ($postQuantityArray as $productId => $quantity) {\n $deliveryToProduct = DeliveryToProduct::find()->where(['delivery' => $model->id, 'product' => $productId])->one();\n if (!$deliveryToProduct) {\n $deliveryToProduct = new DeliveryToProduct();\n $deliveryToProduct->delivery = $model->id;\n $deliveryToProduct->product = $productId;\n }\n $deliveryToProduct->quantity = $quantity;\n $deliveryToProduct->save();\n }\n }\n\n if (Yii::$app->request->post('save') === 'Y' && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n \n if (Yii::$app->request->post('add') === 'Y' && Yii::$app->request->post('addProduct')) {\n $model->save();\n $deliveryToProduct = DeliveryToProduct::find()->where(['delivery' => $model->id, 'product' => Yii::$app->request->post('addProduct')])->one();\n if (!$deliveryToProduct) {\n $quantity = $model->getOrderOne()->getOrderToProducts()->where(['product' => Yii::$app->request->post('addProduct')])->exists()? \n $model->getOrderOne()->getOrderToProducts()->where(['product' => Yii::$app->request->post('addProduct')])->one()->quantity: 0;\n \n $deliveryToProduct = new DeliveryToProduct();\n $deliveryToProduct->product = Yii::$app->request->post('addProduct');\n $deliveryToProduct->delivery = $model->id;\n $deliveryToProduct->quantity = $quantity;\n $deliveryToProduct->save();\n }\n }\n\n $deliveryToProducts = $model->getDeliveryToProductsAll($id);\n\n if (Yii::$app->request->post('remove')) {\n foreach ($deliveryToProducts as $index => $deliveryToProduct) {\n if ($deliveryToProduct->product == Yii::$app->request->post('remove')) {\n unset($deliveryToProducts[$index]);\n }\n }\n }\n\n $dataProvider = new ArrayDataProvider([\n 'allModels' => $deliveryToProducts,\n 'sort' => false,\n 'pagination' => [\n 'pageSize' => 30,\n ],\n ]);\n\n return $this->render('create', [\n 'model' => $model,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function created(Order $order)\n\t{\n\t\t//\n\t}",
"public function created(Order $order)\n\t{\n\t\t//\n\t}",
"public function create()\n {\n\n return view('vendor.voyager.order.create');\n\n //\n }",
"public function create( &$order ) {\n\t\t/**\n\t\t * Filter the generated order ID.\n\t\t *\n\t\t * @param string $order_key The uniquely-generated ID for this order.\n\t\t */\n\t\t$order_key = apply_filters( 'woocommerce_generate_order_key', uniqid( 'order_' ) );\n\n\t\t$order->set_order_key( 'wc_' . $order_key );\n\t\t$this->creating = true;\n\n\t\tparent::create( $order );\n\t}",
"public function createpoAction() {\n $filter = $this->getRequest()->getParam('top_filter');\n $helperClass = Mage::helper('inventorysupplyneeds');\n if ($helperClass->getDraftPO()->getId()) {\n Mage::getSingleton('vendorsinventory/session')->addNotice(\n $helperClass->__('There was an existed draft purchase order. Please process it before creating new one'));\n return $this->_redirect('*/*/index', array('top_filter' => $filter));\n }\n $helperClass->setTopFilter($filter);\n $data = $helperClass->prepareDataForDraftPO();\n try {\n if (!isset($data['product_data']) || !count($data['product_data'])) {\n throw new Exception($helperClass->__('There is no product needed to purchase.'));\n }\n //var_dump($data); die();\n $model = Mage::getModel('inventorypurchasing/purchaseorder_draftpo')\n ->addData($data);\n $model->setCreatedAt(now())\n ->setCreatedBy($this->_getUser()->getVendorId());\n $model->setType(Magestore_Inventorypurchasing_Model_Purchaseorder_Draftpo::SUPPLYNEED_TYPE);\n $model->create();\n Mage::getSingleton('vendorsinventory/session')\n ->addSuccess($helperClass->__('The supply needs have been saved successfully as draft purchase order(s).'));\n return $this->_redirect('*/inventory_draftpo/view', array('id' => $model->getId()));\n } catch (Exception $ex) {\n Mage::getSingleton('vendorsinventory/session')\n ->addError($helperClass->__('There is error while creating new draft purchase order.'));\n Mage::getSingleton('vendors/session')->addError($ex->getMessage());\n return $this->_redirect('*/*/index', array('top_filter' => $filter));\n }\n }",
"public function createDeliveryMethod(Request $request)\n {\n $request->validate([\n 'name' => 'required|string|max:255',\n 'price' => 'required|numeric',\n 'description' => 'string|max:255'\n ], [], [\n 'name' => 'název',\n 'price' => 'cena',\n 'description' => 'popisek'\n ]);\n $delivery_method = new DeliveryMethod;\n $delivery_method->fill($request->all());\n $delivery_method->save();\n session()->flash('success_message', 'Nový způsob dopravy byl úspěšně přidán.');\n return redirect(route('admin.delivery_and_payment_methods'));\n }",
"public function newOrder($post)\n {\n $this->id_customer=Yii::$app->getUser()->id;\n $this->date_create=date(\"Y-m-d H:i:s\");\n $this->date_deadline=date(\"Y-m-d H:i\",strtotime($this->date_deadline));\n $this->show_pre_source=0;\n if($this->special==1){\n $this->id_status=2;\n $this->id_performer=$this->idSpecialUser;\n\n\n }else{\n $this->id_status=1;\n }\n\n if($this->validate()){\n $order=new Order;\n $order->setAttributes($this->attributes);\n $order->info_text=nl2br($this->info_text);\n if($order->validate()) {\n $order->save();\n if($order->id_status==2){\n $modelPerformerOrder= new PerformerOrder;\n $modelPerformerOrder->applyAutoCreateOrder($order->id,$order);\n $order->choisePerformer($order->id_performer); //уведомление внутри функции отправится\n }\n\n\n $modelNotification= new Notification;\n $modelNotification->autoComplete(0,$order->id_customer,1,json_encode([\"id_order\"=>$order->id]));\n \n\n return $order;\n }\n else {\n Yii::trace($order->getErrors());\n }\n }\n Yii::trace($this->getErrors());\n return false;\n\n\n }",
"public function actionCreateshipment()\n\t{\n\t\tif($_POST && isset($_POST['id']))\n\t\t{\n\t\t\t$shop=isset($_POST['shopName'])?$_POST['shopName']:\"NA\";\n\t\t\t$path='shipment/'.$shop.'/'.Data::getKey($_POST['id']).'.log';\n\t\t\ttry\n\t\t\t{\t\n\t\t\t\t//create shipment data\n\t\t\t Data::createLog(\"order shipment in walmart\".PHP_EOL.json_encode($_POST),$path);\n\t\t\t\t$objController=Yii::$app->createController('walmart/walmartorderdetail');\n\t\t\t\t$objController[0]->actionCurlprocessfororder();\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\tData::createLog(\"order shipment error \".json_decode($_POST),$path,'a',true);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tData::createLog(\"order shipment error wrong post\");\n\t\t}\n\t}",
"public function actionCreate()\n {\n $model = new YxOrder();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n\t{\n\t\t$model=new Order;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Order']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Order'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function create()\n {\n return view('order-create');\n }",
"public function testCreate()\n {\n VCR::insertCassette('orders/create.yml');\n\n $order = Order::create(Fixture::basicOrder());\n\n $this->assertInstanceOf('\\EasyPost\\Order', $order);\n $this->assertStringMatchesFormat('order_%s', $order->id);\n $this->assertNotNull($order->rates);\n }",
"public function create()\n {\n return view('order.create');\n }",
"public function create()\n {\n return view('order.create');\n }",
"public function create()\n {\n return view('order.create');\n }",
"public function create()\n\t{\n\t\treturn View::make('orderdeliverypackages.create');\n\t}",
"public function create()\n {\n //$this->auth->restrict($this->addPermission);\n /*\n $session = $this->session->userdata('app_session');\n $nodo = $this->Deliveryorder_model->generate_nodo($session['kdcab']);\n\n $marketing = $this->Deliveryorder_model->pilih_marketing()->result();\n $getitemdo = $this->Detaildeliveryorder_model->find_all_by(array('no_do'=>$nodo));\n\n $this->template->set('marketing',$marketing);\n $this->template->set('detaildo',$getitemdo);\n */\n $customer = $this->Customer_model->find_all_by(array('deleted'=>0));\n $this->template->set('customer',$customer);\n\n if($this->uri->segment(3) == \"\"){\n\n $data = $this->Salesorder_model->get_salesorder_open();\n //$data = $this->Salesorder_model->order_by('no_so','ASC')->find_all_by(array('total !='=>0));\n }else{\n $data = $this->Salesorder_model->get_salesorder_open(\"AND id_customer ='\".$this->uri->segment(3).\"' \");\n }\n $this->template->set('results', $data);\n\n $this->template->title('Input Delivery Order');\n $this->template->render('list_so');\n }",
"public function create()\n {\n return view('admin.create_order');\n }",
"public function create()\n {\n return view('crud.order.create');\n }",
"public function store(CreateOrderRequest $request)\n {\n $input = $request->all();\n\n // dd($input);\n\n $order = $this->orderRepository->create($input);\n\n Flash::success('Order saved successfully.');\n\n return redirect(route('admin.products.orders.index'));\n }",
"public function create()\n {\n return view('admin.order.create');\n }",
"private function createOrder()\n {\n $order = $this->getMock(\\OxidEsales\\Eshop\\Application\\Model\\Order::class, array('validateDeliveryAddress', '_sendOrderByEmail'));\n // sending order by email is always successful for tests\n $order->expects($this->any())->method('_sendOrderByEmail')->will($this->returnValue(1));\n //mocked to circumvent delivery address change md5 check from requestParameter\n $order->expects($this->any())->method('validateDeliveryAddress')->will($this->returnValue(0));\n\n $this->testOrderId = substr_replace( oxRegistry::getUtilsObject()->generateUId(), '_', 0, 1 );\n $order->setId($this->testOrderId);\n\n return $order;\n }",
"public function create()\n {\n $order = new Order();\n $order->setAccountId($this->accountId);\n $order->setLanguage($this->language);\n\n return $order;\n }",
"public function create()\n {\n return view('po.form', [\n 'po' => new PurchaseOrder(),\n 'action' => route('po.store'),\n 'method' => 'POST',\n 'title' => 'Create'\n ]);\n }",
"public function create()\n {\n $orders = Order::all();\n $products = Product::all();\n $deliveries = Delivery::all();\n return view('orderdetails.create',compact('orders','products','deliveries'));\n }",
"public function createOrder($accessToken){\n $url = \"https://api.sandbox.paypal.com/v2/checkout/orders\";\n \n /* Call Headers */\n $paymentHeaders = array(\"Content-Type: application/json\", \"Authorization: Bearer \".$accessToken);\n \n\t/* Generates Random Invoice Number */\n\t$randNo= (string)rand(10000,20000);\n \n /* Fill payload with transaction info */\n\n\t\t\t$postfields = '{}';\n $postfieldsArr = json_decode($postfields, true);\n $postfieldsArr['intent'] = \"CAPTURE\";\n \t$postfieldsArr['application_context']['shipping_preference'] = \"SET_PROVIDED_ADDRESS\";\n \t$postfieldsArr['application_context']['user_action'] = \"PAY_NOW\";\n \t\n \t$postfieldsArr['purchase_units'][0]['description'] = \"PayPalPizza\";\n \t$postfieldsArr['purchase_units'][0]['invoice_id'] = \"INV-PayPalPizza-\" . $randNo;\n \t$postfieldsArr['purchase_units'][0]['amount']['currency_code'] = $_POST['currency'];\n \t$postfieldsArr['purchase_units'][0]['amount']['value'] = $_POST['total_amt'];\n \t$postfieldsArr['purchase_units'][0]['amount']['breakdown']['item_total']['currency_code'] = $_POST['currency'];\n \t$postfieldsArr['purchase_units'][0]['amount']['breakdown']['item_total']['value'] = $_POST['total_amt'];\n\t\t\t$postfieldsArr['purchase_units'][0]['shipping']['address']['recipient_name']= $_POST['shipping_recipient_name'];\n\t\t\t$postfieldsArr['purchase_units'][0]['shipping']['address']['phone']= $_POST['shipping_phone'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['address_line_1']= $_POST['shipping_line1'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['address_line_2']= $_POST['shipping_line2'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['admin_area_2']= $_POST['shipping_city'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['admin_area_1']= $_POST['shipping_state'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['postal_code']= $_POST['shipping_postal_code'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['country_code']= $_POST['shipping_country_code'];\n \n for($a = 0; $a < $_POST['itemnum']; $a++){\n $postfieldsArr['purchase_units'][0]['items'][$a]['name'] = $_POST[('itemname'. $a )];\n $postfieldsArr['purchase_units'][0]['items'][$a]['description'] = $_POST[('itemname'. $a)]; \n $postfieldsArr['purchase_units'][0]['items'][$a]['sku'] = $_POST[('itemsku'. $a)]; \n $postfieldsArr['purchase_units'][0]['items'][$a]['unit_amount']['currency_code'] = $_POST['currency']; \n $postfieldsArr['purchase_units'][0]['items'][$a]['unit_amount']['value'] = $_POST[('itemprice'. $a)];\n $postfieldsArr['purchase_units'][0]['items'][$a]['quantity'] = $_POST[('itemamount'. $a)];\n $postfieldsArr['purchase_units'][0]['items'][$a]['category'] = \"PHYSICAL_GOODS\";\n }\n \n $postfields = json_encode($postfieldsArr);\n \n/* Call Orders API */\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $paymentHeaders);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_POST, true);\n $run = curl_exec($ch);\n curl_close($ch);\n/* Call Orders API */\n\n echo $run;\n }",
"public function create()\n {\n if (Gate::allows('create-order')) {\n return view('orders.create', [\n 'order' => null\n ]);\n }\n else {\n abort(403);\n }\n }",
"public function create()\n\t{\n $this->load->model('ordersmodel');\n $data['json']=$this->ordersmodel->insertorders();\n\t\t$this->load->view('json',$data);\n\t}",
"public function createOrder($orderID) { global $db;\n \n // Insert Order\n $insert = $db->query(\"INSERT INTO `orders` (order_id, email_address, order_date, dispatch_date, delivery_address_id, delivery_id) \n VALUES(:order_id, :email_address, :order_date, :dispatch_date, :delivery_address_id, :delivery_id)\",\n array(\n 'order_id' => $orderID,\n 'email_address' => $_SESSION['user']['email_address'],\n 'order_date' => date(\"YmdHis\"),\n 'dispatch_date' => \"\",\n 'delivery_address_id' => $_SESSION['address']['id'],\n 'delivery_id' => $_SESSION['checkout']['delivery']['id']\n ));\n // Insert Order Totals\n $insert = $db->query(\"INSERT INTO `order_totals` (order_id, order_discount, order_delivery, order_vat, order_gross) \n VALUES(:order_id, :order_discount, :order_delivery, :order_vat, :order_gross)\",\n array(\n 'order_id' => $orderID,\n 'order_discount' => $_SESSION['checkout']['totals']['savings_total'],\n 'order_delivery' => $_SESSION['checkout']['totals']['delivery'],\n 'order_vat' => $_SESSION['checkout']['totals']['order_vat'],\n 'order_gross' => $_SESSION['checkout']['totals']['gross_total'],\n ));\n \n // Insert Order Items\n foreach($_SESSION['checkout']['items'] as $key => $item) {\n $insert = $db->query(\"INSERT INTO `order_items` (order_id, prod_code, price, qty) \n VALUES(:order_id, :prod_code, :price, :qty)\",\n array(\n 'order_id' => $orderID,\n 'prod_code' => $item['prod_code'],\n 'price' => $item['sale_total'] != 0.00 ? $item['sale_total'] : $item['price_total'],\n 'qty' => $item['qty']\n ));\n }\n \n return $orderID;\n }",
"public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Orderdelivery::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tOrderdelivery::create($data);\n\n\t\treturn Redirect::route('orderdeliveries.index');\n\t}",
"public function store(OrderCreateRequest $request)\n {\n return $this->repository->storeOrder($request);\n }",
"public function create(Request $request)\n {\n $user = $request->id;\n $restaurant = $request->restaurant;\n $date = $request->date;\n\n $cart = Cart::where('user_id', '=', $user)->first();\n\n $cart_items = CartItem::with('menu_item')->where('cart_id', '=', $cart->id)->get();\n\n $price_array = array();\n\n // get the menu item price from cart item\n foreach ($cart_items as $cart_item) {\n $price_array[] = ($cart_item->menu_item->price);\n }\n\n // create new order\n $new_order = new Order([\n 'user_id' => $user,\n 'restaurant_id' => $restaurant,\n 'total_amount' => array_sum($price_array),\n 'delivery_time' => $date,\n 'accepted' => 0,\n 'status' => 0\n ]);\n $new_order->save();\n\n foreach ($cart_items as $cart_item) {\n //create new order items\n $new_order_items = new OrderItem([\n 'order_id' => $new_order->id,\n 'menu_item_id' => $cart_item->menu_item->id,\n ]);\n $new_order_items->save();\n }\n\n // get full order just placed\n $fullOrder = Order::with('order_item.menu_item', 'restaurant')->find($new_order->id);\n return response()->json($fullOrder);\n }",
"function createOrder($order,$requester,$numberId){\n $sql='';\n //status==0 mean have to cook and else will finish now status will be send\n $finish_time=$order->status==0 ? '\\'0000-00-00 00:00:00\\'' :'now()';\n $sql = 'INSERT INTO `order` (waiter_id,chef_id, number_id, table_id, product_id,bill_detail_id, count, comments, order_time, finish_time, status, price) VALUES ';\n $sql.= '(\\''.$requester.'\\',\\'\\','.$numberId.', '.$order->table_id.', '.$order->product_id.',-1,'.$order->count.',\\''.$order->comments.'\\', now(), '.$finish_time.', \\''.$order->status.'\\', '.$order->price.');';\n //echo $sql;\n if(isset($this->connection)){\n return $this->queryNotAutoClose($sql);\n }else{\n return $this->query($sql);\n }\n }",
"public function makeorder (Request $request) {\n\n $order = new Order;\n $order->pizza_id = $request->pizzaId;\n $order->user_id = Auth::user()->id;\n\n $order->save();\n \n return redirect ('/pizzas');\n }",
"public function postOrderDelivery(OrderDeliveryRequest $request){\n $data = [\n 'ongkir_real'=>$request->input('ongkir_real'),\n 'kurir'=>$request->input('kurir'),\n 'no_resi'=>$request->input('no_resi'),\n 'delivery_date'=>xformatDate($request->input('delivery_date')),\n 'status'=>'on delivery',\n 'modified_by'=>Auth::user()->username\n ];\n $order = Order::where('id',Input::get('order_id'))->update($data);\n //ipansuryadiflash()->success('Success', 'Order delivery success...');\n return redirect()->route('admin.pages.order');\n }",
"public function createOrder()\n {\n if(!request()->ajax())\n {\n throw new BadRequestHttpException();\n }\n\n $data = request()->all();\n\n $model = new OrderViewModel(request('language'));\n\n $this->orderService->fill($model);\n\n DB::beginTransaction();\n\n if (auth()->check())\n {\n $userId = auth()->id();\n }\n else\n {\n $userId = null;\n }\n \n $this->orderService->createOrder($data, $userId, $model);\n\n $this->orderService->createOrderProducts($model);\n \n try \n {\n \\Mail::to(request('email'))->send(new OrderReport($model, request('name')));\n\n \\Mail::to(config('mail.from.address'))->send(new OrderReportManager($model, request('name')));\n }\n catch (\\Exception $e)\n {\n\n DB::rollBack();\n \n return response()->json([\n 'status' => 'error'\n ]);\n }\n \n $this->cartService->clearCart();\n \n DB::commit();\n \n Session::put('isOrderCreated', true);\n \n return response()->json([\n 'status' => 'success'\n ]);\n }",
"public function createOrder($cartData,$token,$isApi,$customerId = NULL);",
"public function create(OrderFormRequest $request)\n {\n try {\n $request->validated();\n if (empty($request->status)) {\n $request->status = 2;\n }\n if (empty($request->user_id)) {\n $request->customer = auth()->user()->id;\n }\n $order = Order::where([\n 'user_id' => $request->customer,\n 'room_id' => $request->room,\n 'status' => $request->status\n ])->count();\n if ($order) {\n throw new \\Exception('Такой заказ уже существует');\n }\n $order = new Order();\n $order->fill([\n 'user_id' => $request->customer,\n 'room_id' => $request->room,\n 'status' => $request->status,\n 'note_date' => $this->convertDate($request->note_date, $request->note_time),\n 'days' => $request->days\n ]);\n $order->save();\n if ($order->status == 2) {\n event(new FreeRoom(0, $order->room_id));\n }\n $mail_order = $order->with(['customer', 'room'])->findOrFail($order->id);\n event(new OrderComplete($mail_order));\n event(new WriteAudit((object)[\n 'id' => $order->id,\n 'customer' => $order->user_id,\n 'room' => $order->room_id,\n 'type' => 'room'\n ], 1, 15));\n// Mail::to($mail_order->customer)->send(new OrderShipped(\n// $mail_order\n// ));\n return response()->json([\n 'status' => 'success',\n 'msg' => 'Заказ успешно добавлен'\n ], 200);\n } catch (\\Exception $error) {\n return response()->json([\n 'status' => 'error',\n 'msg' => $error->getMessage()\n ]);\n }\n }",
"public function create()\n\t{\n return view('orders.create');\n\t}",
"public function create()\n {\n //\n $data = Order::join('order_dist','order.oid','=','order_dist.oid')\n ->join('eval','order.uid','=','eval.uid')\n ->join('cart','cart.sid','=','eval.sid')\n ->join('addr','order_dist.did','=','addr.did')\n ->select('order_dist.odid','order.order','addr.dname','order_dist.uway','order_dist.ostatus','cart.cafee','order_dist.ocoupon','order_dist.endprice','eval.ereply','cart.cafee')\n ->get();\n // dd($data);\n\n return view('admin.order.create',['data'=>$data]);\n\n }",
"public function createAction(){\n $nameArr= [1,2];\n $priceArr=[10,12];\n $qtyArr=[2,1];\n $data = [ [\n 'emailid' => 'issaqsyed918@gmail.com',\n 'status' => 'created'\n ] , 'nameArr' => $nameArr , 'priceArr' => $priceArr ,'qtyArr' => $qtyArr ];\n $client = new Client();\n\n $ServerPort =\"\";\n if($_SERVER['SERVER_PORT']){\n $ServerPort = ':'.$_SERVER['SERVER_PORT'];\n }\n $client->setUri('http://'.$_SERVER['SERVER_NAME'].$ServerPort.'/order-rest');\n\n // $client->setUri('http://localhost:9015/order-rest');\n $client->setOptions(array(\n 'maxredirects' => 5,\n 'timeout' => 30\n ));\n $client->setParameterPost(\n $data\n );\n $client->setMethod( Request::METHOD_POST );\n $response = $client->send();\n if ($response->isSuccess()) {\n $result = json_decode( $response->getContent() , true);\n }\n return $this->redirect()->toRoute('ordermanagement', array('action' => 'index') );\n }",
"static function createOrder(Order $newOrder) : int {\r\n $sqlInsert = \"INSERT INTO Orders (CustomerID, Amt, Dates) \r\n VALUES (:CustomerID, :Amount, :Date) \";\r\n\r\n self::$db->query($sqlInsert);\r\n\r\n self::$db->bind(':CustomerID', $newOrder->getCustomerID());\r\n self::$db->bind(':Amount', $newOrder->getAmount());\r\n self::$db->bind(':Date', $newOrder->getDate());\r\n \r\n\r\n self::$db->execute();\r\n\r\n return self::$db->lastInsertId();\r\n\r\n }",
"public function postOrderMake() {\n\n /*\n Array\n (\n [12_97d170e1550eee4afc0af065b78cda302a97674c] => 5\n [metrics] => Порода:\n Пол:\n Обхват шеи:\n Обхват груди:\n Длина спины:\n Обхват передней лапы:\n От шеи до передней лапы:\n Между передними лапами:\n\n [name] => фывчфы\n [email] => sdfsdf@masd.sd\n [address] => фывфы\n [tel] => фывфы\n [pay_type] => 1\n )\n */\n\n #Helper::ta(Input::all());\n\n /**\n * Получаем корзину\n */\n CatalogCart::getInstance();\n $goods = CatalogCart::get_full();\n #Helper::ta($goods);\n\n /**\n * Формируем массив с продуктами\n */\n $products = [];\n if (count($goods)) {\n foreach ($goods as $good_hash => $good) {\n $products[$good_hash] = [\n 'id' => $good->id,\n 'count' => $good->_amount,\n 'price' => $good->price,\n 'attributes' => (array)$good->_attributes,\n ];\n }\n }\n #Helper::ta($products);\n\n $pay_type = @$this->pay_types[Input::get('pay_type')] ?: NULL;\n\n /**\n * Формируем окончательный массив для создания заказа\n */\n $order_array = [\n 'client_name' => Input::get('name'),\n 'delivery_info' => Input::get('address') . ' ' . Input::get('email') . ' ' . Input::get('tel'),\n 'comment' => $pay_type . \"\\n\\n\" . Input::get('metrics'),\n 'status' => 1, ## Статус заказа, нужно подставлять ID статуса наподобие \"Новый заказ\"\n 'products' => $products,\n ];\n #Helper::tad($order_array);\n\n $order = Catalog::create_order($order_array);\n\n /*\n $json_request = [];\n $json_request['responseText'] = '';\n $json_request['status'] = FALSE;\n\n if (is_object($order) && $order->id)\n $json_request['status'] = TRUE;\n\n\n return Response::json($json_request, 200);\n */\n\n if (is_object($order) && $order->id) {\n\n CatalogCart::clear();\n return Redirect::route('mainpage');\n #return Redirect::route('catalog-order-success');\n\n } else {\n\n return URL::previous();\n }\n }",
"public function store(Request $request){ \n $data = $request->all();\n $user = session('user');\n unset($data['_token']);\n \n $data['buyed'] = (!empty($data['buyed']))?date_format(date_create_from_format(\"d/m/Y\",$data['buyed']),\"Y-m-d\"):NULL;\n $data['id_user'] = $user->id;\n $data['status'] = 'pending';\n $data['n_order'] = (empty($data['n_order']))?NULL:$data['n_order'];\n $data['n_tracking'] = (empty($data['n_tracking']))?NULL:$data['n_tracking'];\n $data['observations'] = (empty($data['observations']))?NULL:$data['observations'];\n \n $order = Order::updateOrCreate($data);\n\n Mail::send('email.newOrder', ['user' => $user, 'order'=>$order], function ($m) use ($user, $order) {\n $m->from('auto@soluciones-integrales.com.ve', 'Soluciones Integrales');\n $m->to($user->email, $user->name)->subject('Orden número '.$order->id);\n $m->bcc('envios@soluciones-integrales.com.ve', 'Soluciones Integrales')->subject('Orden número '.$order->id); \n }); \n \n return redirect('order/index/pending');\n }",
"public function Create() {\n\t\tvalid_only_single_method ( 'POST' );\n\t\trequire_authorization ();\n\n\t\t// Check the Phone number and Telephone number, then call the Notier model\n\t\t$courier_id\t\t\t\t= get_validated_courier_id ();\n\n\t\t$this->load->model ( 'delivery_session_model' );\n\t\t$delivery_session_id = $this->delivery_session_model->Create ( $courier_id );\n\n\n\t\tjson_response ( array ( 'response' => $this->config->item ( 'response_success' ),\n\t\t\t\t'delivery_session_id'\t=> $delivery_session_id ) );\n\t}",
"public function store(Request $request)\n {\n $this->validate($request, [\n 'service' => 'required',\n 'issue' => 'required'\n\n ]);\n\n //create Post\n $orders = new Order;\n $orders->user_id = auth()->user()->id;\n $account = Account::find($request->id);\n $orders->account()->associate($account);\n $orders->issue = $request->input('issue');\n $orders->save();\n\n return redirect ('/orders')->with('success', 'Order Created');\n\n\n }",
"public function create()\n\t{\n\t\treturn View::make('admin.orders.create');\n\t}",
"public function create_purchaseorder($ponbr) {\n\t\t\t$purchaseorder = $this->create_purchaseorderheader($ponbr);\n\t\t\t$purchaseorder['LineItem'] = $this->create_purchaseorderdetails($ponbr);\n\t\t\t$this->response = $this->curl_post($this->endpoints['purchase-order'], $purchaseorder, $json = true);\n\t\t\t$this->response['response']['PurchaseOrderNumber'] = isset($this->response['response']['PurchaseOrderNumber']) ? $this->response['response']['PurchaseOrderNumber'] : $purchaseorder['ID'];\n\t\t\t$this->process_response();\n\t\t\t//$this->response['response']['request'] = $purchaseorder;\n\t\t\treturn $this->response['response'];\n\t\t}",
"public function create()\n {\n $parts = Part::all(); \n return view('purchaseOrders.create', ['parts'=>$parts]); \n }",
"public function create()\n {\n return view('backend.orders.create');\n }",
"public function create(OrderRequest $request)\n {\n\n $order = $this->repository->newInstance([]);\n\n Form::populate($order);\n\n return response()->view('order::admin.order.create', compact('order'));\n\n }",
"public function create() {\n //Si el usuario solicito recordar entonces verifica a cookie\n if (!empty($_COOKIE['tokenCookie'])){\n $user = Account::where('token', $_COOKIE['tokenCookie'])->first();\n if (!empty($user))\n session(['user'=>$user]);\n }\n \n //Si la session esta vacia devuelve la pantalla a login\n if (empty(session('user')))\n return redirect('account/login');\n \n $user = session('user');\n $orders = array();\n $status = \"new\";\n $subtitle = 'Reportar un paquete nuevo';\n $statusName='<p style=\"color: orange; margin:0;\">Reportar un paquete nuevo</p>'; \n \n \n return view('order.create', ['user'=>$user]);\n }",
"public function makeOrderRequest()\n {\n //check if the user is logged and user permission\n if (UserManager::isUserLogged()) {\n if (UserManager::getPermission($_SESSION['email']) == BASE) {\n\n //check post variables\n if (isset($_POST['delivery_date']) && isset($_POST['article_id']) && isset($_POST['article_quantity']) && !empty($_POST['article_id']) && !empty($_POST['article_quantity']) && !empty($_POST['delivery_date'])) {\n\n //test input\n $article_id = Validator::testInput($_POST['article_id']);\n $article_quantity = Validator::testInput($_POST['article_quantity']);\n $delivery_date = Validator::testInput($_POST['delivery_date']);\n $article = ArticleManager::getArticleById($article_id);\n $expire_date = $article['data_scadenza'];\n $available_date = $article['disponibile_il'];\n\n if (Validator::isDeliveryDateValid($delivery_date, $expire_date, $available_date)) {\n\n //create order\n $order = new OrderModel($article_quantity, $article_id, UserManager::getUserByEmail($_SESSION['email'])['id'], $delivery_date);\n\n //try to make the order request\n if (OrderManager::addOrder($order)) {\n MessageManager::setSuccessMsg('Richiesta inviata. Il tuo ordine verrà visionato');\n MessageManager::unsetErrorMsg();\n } else {\n MessageManager::setErrorMsg('Impossibile richiedere questo articolo');\n }\n } else {\n MessageManager::setErrorMsg('La data di consegna non è valida');\n }\n }\n }\n header('Location: ' . URL . 'catalog');\n exit;\n }\n header('Location: ' . URL . 'home');\n }",
"public function create()\n {\n //显示添加页面\n return view('Admin.Order.add');\n }",
"public function store(CreateOrderRequest $request)\n {\n $input = $request->all();\n\n $order = $this->orderRepository->create($input);\n\n Flash::success('Order saved successfully.');\n\n return redirect(route('admin.orders.index'));\n }",
"public function create()\n {\n //\n return view('quanly.orderdetail.create');\n }",
"public function createOrder($order, $comment, $deliveryType, $datetime)\n {\n $data = $this->_prepareCreateOrder($order, $comment, $deliveryType, $datetime);\n\n return $this->apiClient->doCall(\"POST\", \"order/create\", $data);\n }",
"public function create()\n {\n $data = Order::getDataToCreteOrders();\n $data['invoice_comments'] = OfferSettings::whereType(2)->select('data')->first();\n $data['is_offer'] = 0;\n if (@$data) {\n return view('order.form', $data);\n }\n return Redirect::route($this->route)->with($this->warning, __('main.something_went_wrong'));\n }",
"private function create_order_record($id_order) {\n $aux['details'] = $this->m_orders_overview->get_details($id_order);\n\n $record['id_order'] = null; // auto-increment\n $record['id_menu_order'] = $id_order;\n $record['id_table'] = $aux['details'][0]->id_table;\n $record['id_count_ks'] = $aux['details'][0]->id_count_ks;\n $record['date_pay'] = date(\"Y-m-d\");\n\n $record['id_employee'] = $aux['details'][0]->id_employee;\n $record['pay_method'] = 'hotovost';\n $record['sum_price'] = $aux['details'][0]->price;\n $record['is_closed'] = 0;\n\n $this->m_orders_overview->insert_new_order_record($record);\n }",
"public function store(Request $request)\n {\n\n\n// return $request->all();\n $this->validate($request, [\n 'p_id' => 'required|unique:orders',\n 'product_id' => 'required',\n 'email' => 'required|email',\n 'first_name' => 'required',\n ], [\n 'p_id.required' => 'Purchase/Order ID is required',\n 'p_id.unique' => 'Purchase/Order ID is already in the database',\n 'product_id.required' => 'You should select a product'\n ]);\n\n\n $order = new Order();\n $order->p_id = $request->p_id;\n $order->product_id = $request->product_id;\n $prod_order = Order::where('product_id', '=', $request->product_id)->first();\n if (isset($prod_order)) {\n $order->product_name = $prod_order->product_name;\n } else {\n $order->product_name = '';\n }\n $order->email = $request->email;\n $order->first_name = $request->first_name;\n $order->last_name = $request->last_name;\n $order->country = $request->country;\n $order->status = $request->status;\n $order->payment_method = $request->payment_method;\n\n $date1 = new Carbon($request->p_date);\n $order->p_date = $date1->format('m/d/Y h:i:s A');\n\n $order->save();\n Flash::success('Order Created');\n return Redirect::back();\n }",
"public function store(StoreDeliveryDetailsRequest $request)\n {\n $executives = new DeliveryExecutive;\n $executives->method = $request->method;\n $executives->delivery_date = date(\"Y-m-d\",strtotime(str_replace('/', '-',$request->delivery_date)));\n if($request->method=='others')\n $executives->others = $request->others;\n $executives->distance = $request->distance;\n $executives->delivery_time = date(\"H:i\", strtotime($request->delivery_time));\n $executives->delivery_person = $request->delivery_person;\n $executives->delivery_vehicle_type = $request->delivery_vehicle_type;\n if($request->delivery_vehicle_type=='company')\n $executives->delivery_vehicle_id = $request->delivery_vehicle_id;\n $executives->branch_id = $request->branch_id;\n $executives->delivery_note = $request->delivery_note;\n $executives->save();\n return redirect('executives')->withSuccess('Delivery Details Added Successfully.');\n }",
"function submitOrder() {\n\techo \"Submitting Order </br>\";\n\t$data = createOrder();\n\t$response = postRequest('/api/order', $data);\n\tprintInfo($response);\n}",
"public function store(Request $request)\n {\n return Order::create([\"client_id\" => $request->client_id]);\n }",
"public function testCreateOrder()\n {\n $result = OrdersService::create([\n 'title' => 'Test Order',\n 'state' => 'INITIAL',\n 'res_id' => 1,\n 'foods' => [1, 2],\n ]);\n\n $this->assertInstanceOf(Model::class, $result);\n }",
"public function newOrder(NewOrderRequest $newOrderRequest)\n {\n try {\n $origin = $newOrderRequest->get('origin');\n $destination = $newOrderRequest->get('destination');\n $order = $this->orderService->createNewOrder($origin, $destination);\n\n if ($order) {\n $orderResponseData = ['id' => $order->id, 'distance' =>$order->getDistance(), 'status' => $order->status];\n\n return $this->responseHelper->sendSuccess('Success', JsonResponse::HTTP_OK, $orderResponseData);\n } else {\n return $this->responseHelper->sendError($this->orderService->error, $this->orderService->errorCode);\n }\n } catch (\\Exception $e) {\n return $this->responseHelper->sendError($e->getMessage(), JsonResponse::HTTP_INTERNAL_SERVER_ERROR);\n }\n }"
] | [
"0.7703821",
"0.7626359",
"0.7538761",
"0.73991853",
"0.72813505",
"0.7203322",
"0.71186084",
"0.7100838",
"0.70221245",
"0.70188093",
"0.6951099",
"0.6908209",
"0.69081455",
"0.6892893",
"0.68606913",
"0.685998",
"0.68514556",
"0.68488896",
"0.68323207",
"0.6815331",
"0.67487097",
"0.67378694",
"0.67209816",
"0.6713116",
"0.67122275",
"0.6686188",
"0.66822237",
"0.66786104",
"0.6667969",
"0.6664494",
"0.6660085",
"0.66505516",
"0.6648054",
"0.6605477",
"0.6603079",
"0.66006327",
"0.6568794",
"0.6568794",
"0.65527564",
"0.6546171",
"0.65430176",
"0.65006",
"0.64932185",
"0.6483296",
"0.6472785",
"0.64719594",
"0.64634377",
"0.6463235",
"0.6461879",
"0.6461879",
"0.6461879",
"0.645748",
"0.6456544",
"0.6443042",
"0.6431842",
"0.64231503",
"0.64198256",
"0.6407893",
"0.64031696",
"0.6395649",
"0.63638115",
"0.6360425",
"0.63582224",
"0.63461024",
"0.6333353",
"0.63260895",
"0.6312416",
"0.6311",
"0.6308277",
"0.6306485",
"0.6302593",
"0.6301526",
"0.6301329",
"0.630004",
"0.62911224",
"0.62844247",
"0.6273736",
"0.6273353",
"0.6268525",
"0.6268085",
"0.6249235",
"0.62463707",
"0.6226627",
"0.6221857",
"0.6218902",
"0.6216574",
"0.62152374",
"0.6207376",
"0.62057817",
"0.6193121",
"0.61858356",
"0.61832726",
"0.61657476",
"0.61650926",
"0.61640733",
"0.61628115",
"0.6157222",
"0.61562604",
"0.6150002",
"0.6148464",
"0.61437154"
] | 0.0 | -1 |
Create New Delivery Order | public function prosesdopending()
{
$getparam = explode(";",$_GET['param']);
$getso = $this->Detailpendingso_model->get_where_in('no_so_pending',$getparam,'trans_so_pending_header');
$getitemso = $this->Detailpendingso_model->get_where_in('no_so_pending',$getparam,'trans_so_pending_detail');
$driver = $this->Deliveryorder_model->pilih_driver()->result();
$Arr_Driver = array();
if($driver){
foreach($driver as $keyD=>$valD){
$Kode_Driver = $valD->id_karyawan;
$Name_Driver = $valD->nama_karyawan;
$Arr_Driver[$Kode_Driver] = $Name_Driver;
}
unset($driver);
}
$kendaraan = $this->Deliveryorder_model->pilih_kendaraan()->result();
$Arr_Kendaraan = array();
if($kendaraan){
foreach($kendaraan as $keyK=>$valK){
$Id_kendaraan = $valK->id_kendaraan;
$Nama_kendaraan = $valK->nm_kendaraan;
$Arr_Kendaraan[$Id_kendaraan] = $Nama_kendaraan;
}
unset($kendaraan);
}
$this->template->set('param',$getparam);
$this->template->set('headerso',$getso);
$this->template->set('getitemso',$getitemso);
$this->template->set('arr_driver',$Arr_Driver);
$this->template->set('kendaraan',$Arr_Kendaraan);
$this->template->title('Input Delivery Order');
$this->template->render('deliveryorder_form_pending');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create(Order $order)\n {\n //\n }",
"public function creating(Order $Order)\n {\n //code...\n }",
"public function create()\n\t{\n\t\t$this->auth->restrict('Purchase_Order.Orders.Create');\n\n\t\tif (isset($_POST['save']))\n\t\t{\n\t\t\tif ($insert_id = $this->save_purchase_order())\n\t\t\t{\n\t\t\t\t// Log the activity\n\t\t\t\tlog_activity($this->current_user->id, lang('purchase_order_act_create_record') .': '. $insert_id .' : '. $this->input->ip_address(), 'purchase_order');\n\n\t\t\t\tTemplate::set_message(lang('purchase_order_create_success'), 'success');\n\t\t\t\tredirect(SITE_AREA .'/orders/purchase_order');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tTemplate::set_message(lang('purchase_order_create_failure') . $this->purchase_order_model->error, 'error');\n\t\t\t}\n\t\t}\n\t\tAssets::add_module_js('purchase_order', 'purchase_order.js');\n\n\t\tTemplate::set('toolbar_title', lang('purchase_order_create') . ' Purchase Order');\n\t\tTemplate::render();\n\t}",
"public function createorderAction()\n {\n\t\ttry{\n\t\t\t// Write your code here\n\t\t\t$sm = $this->getServiceLocator();\n\t\t\t$identity = $sm->get('AuthService')->getIdentity();\n\t\t\t\n\t\t\t$request = $this->getRequest();\n\t\t\tif($request->isPost()){\n\t\t\t\t$posts = $request->getPost()->toArray();\n\t\t\t\t$objOrderTable = $sm->get('Order\\Model\\OrderTable');\n\t\t\t\t\n\t\t\t\t$posts['order_attachment'] = $posts['multipleimagesHidden'];\n\t\t\t\tunset($posts['multipleimagesHidden']);\n\t\t\t\t\n\t\t\t\t/*foreach($posts as $key => $value){\n\t\t\t\t\tif(empty($value))\n\t\t\t\t\t\tunset($posts[$key]);\n\t\t\t\t}*/\n\t\t\t\t\n\t\t\t\tlist($d, $m, $y) = explode('/', $posts['exp_delivery_date']);\n\t\t\t\t$posts['exp_delivery_date'] = \"$y-$m-$d\";\n\t\t\t\t\n\t\t\t\tif(empty($posts['id'])){\n\t\t\t\t\t$posts['created_date'] = date('Y-m-d H:i:s');\n\t\t\t\t\t$posts['created_by'] = $identity['user_id'];\n\t\t\t\t}else{\n\t\t\t\t\t$posts['updated_date'] = date('Y-m-d H:i:s');\n\t\t\t\t\t$posts['updated_by'] = $identity['user_id'];\n\t\t\t\t}\n\t\t\t\tunset($posts['opp_name']);\n\t\t\t\t\n\t\t\t\techo $objOrderTable->createOrder($posts);\n\t\t\t}\n\t\t\texit;\n\t\t}catch(Exception $e){\n\t\t\t\\De\\Log::logApplicationInfo ( \"Caught Exception: \" . $e->getMessage () . ' -- File: ' . __FILE__ . ' Line: ' . __LINE__ );\n\t\t}\n }",
"public static function createOrder ()\n\t{\n $user=Auth::user();// here to get the user info and store it in the $user variable\n $order=$user->orders()->create([\n 'total'=>Cart::total(),\n 'delivered' =>0\n\n ]);\n // the delivered column will get by default the value zero which means that this order\n // is not delivered yet \n\n $cartItems=cart::content();\n //seek for intels about attach function \n\n foreach($cartItems as $cartItem)\n $order->orderItems()->attach($cartItem->id,[\n 'qty'=>$cartItem->qty ,\n 'total' => $cartItem->qty*$cartItem->price \n ]);\n\n\t}",
"public function createOrderAction()\n {\n $data = $this->Request()->getParams();\n $data = $data['data'];\n\n $orderNumber = $this->getOrderNumber();\n\n /** @var \\Shopware_Components_CreateBackendOrder $createBackendOrder */\n $createBackendOrder = Shopware()->CreateBackendOrder();\n $hasMailError = false;\n\n try {\n /** @var Shopware\\Models\\Order\\Order $orderModel */\n $orderModel = $createBackendOrder->createOrder($data, $orderNumber);\n\n if (!$orderModel instanceof \\Shopware\\Models\\Order\\Order) {\n $this->view->assign($orderModel);\n\n return false;\n }\n } catch (\\Exception $e) {\n $this->view->assign(\n [\n 'success' => false,\n 'message' => $e->getMessage()\n ]\n );\n\n return;\n }\n\n try {\n //sends and prepares the order confirmation mail\n $this->sendOrderConfirmationMail($orderModel);\n } catch (\\Exception $e) {\n $hasMailError = $e->getMessage();\n }\n\n if ($hasMailError) {\n $this->view->assign(\n [\n 'success' => true,\n 'orderId' => $orderModel->getId(),\n 'mail' => $hasMailError,\n 'ordernumber' => $orderModel->getNumber()\n ]\n );\n\n return;\n }\n\n $this->view->assign(\n [\n 'success' => true,\n 'orderId' => $orderModel->getId(),\n 'ordernumber' => $orderModel->getNumber()\n ]\n );\n }",
"public function order_create()\n {\n $this->_checkPartner();\n \n $mod_c = $this->_getConfig();\n if(isset($mod_c['orders_limit']) && $mod_c['orders_limit']) {\n $sql = \"SELECT COUNT(id) FROM client_order WHERE client_id = :cid AND DATE_FORMAT(created_at, '%Y-%m-%d') = :date GROUP BY client_id\";\n $count = R::getCell($sql, array('cid'=>$this->client->id, ':date'=>date('Y-m-d')));\n if($count >= $mod_c['orders_limit']) {\n throw new Box_Exception('Daily orders limit reached. Order today :today out of :limit', array(':today'=>$count, ':limit'=>$mod_c['orders_limit']), 8804);\n }\n }\n \n $partner = $this->service->getPartner($this->client);\n $price = $this->service->getPartnerPrice($this->client);\n \n if(isset($mod_c['check_balance']) && $mod_c['check_balance']) {\n $client = $this->getApiAdmin()->client_get(array('id'=>$this->client->id));\n if($client['balance'] < $price) {\n throw new Box_Exception('Not enough money in balance to create order. You must have at least $:price in your balance', array(':price'=>$price), 8808);\n }\n }\n \n if(!isset($mod_c['lid'])) {\n throw new Box_Exception('Partners program is temporary disabled.',null, 8806);\n }\n \n if($partner->product_id) {\n $product_id = $partner->product_id;\n } else {\n $product_id = $mod_c['lid'];\n }\n \n $odata = array(\n 'client_id' => $this->client->id,\n 'product_id' => $product_id,\n 'price' => $price,\n 'quantity' => 1,\n 'period' => '1M',\n 'activate' => true,\n 'invoice_option' => 'no-invoice',\n 'config' => array(\n 'partner_id' => $this->client->id,\n ),\n );\n \n $order_id = $this->getApiAdmin()->order_create($odata);\n \n $odata = array(\n 'id' => $order_id,\n 'invoice_option'=> 'issue-invoice',\n 'expires_at' => date('Y-m-d', strtotime('+14 days')),\n );\n $this->getApiAdmin()->order_update($odata);\n \n $this->service->addOrderForPartner($this->client, $order_id);\n \n $this->getApiAdmin()->hook_call(array('event'=>'onAfterPartnerOrderCreate', 'params'=>array('client_id'=>$this->client->id, 'order_id'=>$order_id)));\n \n $this->_log('Partner created new order #%s', $order_id);\n return $order_id;\n }",
"public function create_order( $args = array() )\n {\n return $this->_request('createorder', $args);\n }",
"protected function createOrder(){\n $order = Auth::user()->orders()->create(['status' => 'aguardando']);\n\n return $order;\n }",
"public function createOrder($order)\n {\n $this->notificationRepository->create(['type' => 'order', 'order_id' => $order->id]);\n \n event(new CreateOrderNotification);\n }",
"public function create() : Orders;",
"public function create()\n\t{\n\t\t$order = new Order;\n\n\t\t// Set the 'default' order status\n\t\t//$orderStatus = OrderStatus::find(Config::get('Orders::defaultStatus'));\n\n\t\t//$orderStatus->order()->associate($order);\n\n\n\n\t\t// Save the order\n\t\t$order->save();\n\n\t\t// Return the response, with the order, as JSON\n\t\treturn Response::json($order);\n\t}",
"public function createPayment()\n\t{\n\n\t}",
"public function actionCreate()\n {\n $model = new Delivery();\n\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n $model->save();\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function creating(Order $order)\n\t{\n\t\t$user = auth()->user();\n\n\t\t// auto set status = pending\n\t\tif (is_null($order->status)) {\n\t\t\t$order->status = Order::STATUS_PENDING;\n\t\t}\n\n\t\t// auto set user_id\n\t\tif (!empty($user)) {\n\n\t\t\t// set user_id as author\n\t\t\tif (empty($order->user_id)) {\n\t\t\t\t$order->user_id = $user->id;\n\t\t\t}\n\n\t\t\t// set company_id\n\t\t\tif (\n\t\t\t\tempty($order->company_id) &&\n\t\t\t\t!is_null($user->getCurrentCompanyId())\n\t\t\t) {\n\t\t\t\t$order->company_id = $user->getCurrentCompanyId();\n\t\t\t}\n\t\t}\n\t}",
"public function created(Order $order)\n {\n // get the service points cost\n// $serviceCost = $order->service->on_sale ? $order->service->sale_points : $order->service->points;\n // check if the current balance > service points cost\n// $userBalance = $order->client->balance->points;\n// if ($userBalance > $serviceCost && ($userBalance - $serviceCost > 0)) {\n $client = $order->client()->first();\n// $finalBalance = $userBalance - $serviceCost;\n// $client->balance()->first()->update(['points' => $finalBalance]);\n $order->update(['is_paid' => true]);\n // automatically create a job once order is paid\n $order->job()->create();\n $settings = Setting::first();\n return Mail::to($client->email)->cc($settings->info_email)->cc($settings->sales_email)->send(new OrderComplete($order, $client));\n\n// } else {\n// $order->update(['is_paid' => false, 'active' => false]);\n// }\n }",
"public function createExpressCheckoutOrder($tid){}",
"public function createAction() {\n $customer = Mage::getSingleton('customer/customer')->load(Mage::getStoreConfig('testorders/general/customerid'));\n /*empty object for sourceOrder is fine*/\n $sourceOrder = new Varien_Object();\n $sku = $this->getRequest()->getParam('sku');\n\n $messages = array();\n $model = Mage::getModel(\"testorders/simulator\");\n $model->setOrderInfo($sourceOrder, $customer, $sku);\n $order = $model->create();\n\n if ($order && $order->getIncrementId()) {\n echo \"Order #{$order->getIncrementId()} has been created from SKU : {$sku}\";\n }\n else {\n echo \"Test Order creation failed. Please check the module config and make sure selected shipping method and payment method are configured properly\";\n }\n\n exit;\n }",
"public function creating(Order $order): void\n\t{\n\t\tif (auth()->check()) {\n\t\t\t$order->client_id = auth()->id();\n\t\t}\n\t\t// If a booster has been selected for the order, set its status to progress, otherwise pending\n\t\t(bool) $order->booster_id ? $order->status = 'progress' : 'pending';\n\t}",
"public function create()\n\t{\n\t\tif (!in_array('createOrder', $this->permission)) {\n\t\t\tredirect('dashboard', 'refresh');\n\t\t}\n\n\t\t$this->data['page_title'] = 'Add Purchase Order';\n\n\t\t$this->form_validation->set_rules('product[]', 'Product name', 'trim|required');\n\n\n\t\tif ($this->form_validation->run() == TRUE) {\n\n\t\t\t$purchase_id = $this->model_purchase->create();\n\n\t\t\tif ($purchase_id) {\n\t\t\t\t$this->session->set_flashdata('success', 'Successfully created');\n\t\t\t\tredirect('purchase/', 'refresh');\n\t\t\t} else {\n\t\t\t\t$this->session->set_flashdata('errors', 'Error occurred!!');\n\t\t\t\tredirect('purchase/create/', 'refresh');\n\t\t\t}\n\t\t} else {\n\t\t\t// false case\n\t\t\t$company = $this->model_company->getCompanyData(1);\n\t\t\t$this->data['company_data'] = $company;\n\t\t\t// $this->data['is_vat_enabled'] = ($company['vat_charge_value'] > 0) ? true : false;\n\t\t\t// $this->data['is_service_enabled'] = ($company['service_charge_value'] > 0) ? true : false;\n\n\n\n\t\t\t$this->data['products'] = $this->model_products->getActiveProductData();\n\t\t\t$this->data['tax_data'] = $this->model_tax->getActiveTax();\n\n\t\t\t$this->data['party_data'] = $this->model_party->getActiveParty();\n\t\t\t$this->data['getlastpurchaseid'] = $this->model_purchase->getLastPurchaseID();\n\n\t\t\t$this->render_template('purchase/create', $this->data);\n\t\t}\n\t}",
"public function createAction(){\n if(!$this->request->isPost()){\n return $this->forward(\"orders/index\");\n }\n\n $form = new OrdersForm();\n $order = new Orders();\n $product = Products::findFirst($form->get('product_id'));\n\n $order->currency = $product->currency;\n $order->price = $product->price;\n\n $data = $this->request->getPost();\n if(!$form->isValid($data, $order)){\n echo '<pre>';\n print_r($form->getMessages());\n echo '</pre>';\n foreach($form->getMessages() as $message){\n $this->flash->error($message);\n }\n\n return $this->forward('orders/new');\n }\n\n $date = new DateTime();\n $order->date = $date->format('Y-m-d H:i:s');\n $order->paid = 0;\n $order->hash = Phalcon\\Text::random(Phalcon\\Text::RANDOM_ALNUM, 32);\n\n if($order->save() == false){\n foreach($order->getMessages() as $message){\n $this->flash->error($message);\n }\n\n return $this->forward('orders/new');\n }\n\n $form->clear();\n\n $this->flash->success(\"Zamówienie zostało przyjęte, teraz możesz je opłacić w PayPal.\");\n\n return $this->response->redirect(\"orders/payment/\" . $order->hash);\n }",
"public function created(Order $order)\n {\n //\n }",
"public function createorder()\n\n {\n $data = request()->validate([\n 'user_id' => ['required'],\n \"restaurant_id\" => ['required'],\n 'restaurant_service_id' => [],\n 'menu_id' => [],\n 'quantity' => [],\n 'table_id' => [],\n 'notes' => [],\n\n\n ]);\n\n\n\n $restaurant = RestaurantProfile::where('id', '=', $data['restaurant_id'])->get();\n\n $order = Order::create([\n 'restaurant_service_id' => $data['restaurant_service_id'],\n 'user_id' => $data['user_id'],\n 'restaurant_profile_id' => $data['restaurant_id'],\n 'menu_id' => $data['menu_id'],\n 'quantity' => $data['quantity'],\n 'table_id' => $data['table_id'] ?? null,\n 'notes' => $data['notes'] ?? null,\n 'status' => 1\n\n ]);\n if ($data['restaurant_service_id'] == 2) {\n\n $order_details = OrderDetail::create([\n 'note' => $data['note'],\n 'estate' => $data['estate'] ?? 'estate',\n 'full_name' => $data['full_name'] ?? 'full_name',\n 'email' => $data['email'] ?? 'email',\n 'note' => $data['note'] ?? 'note',\n 'phone' => $data['phone'] ?? 'phone',\n 'house' => $data['house'] ?? 'house',\n 'house_no' => $data['house_no'] ?? 'house_no',\n 'city' => $data['city'] ?? 'city',\n 'delivery_day' => $data['delivery_schedule_time'] ?? 'delivery_day',\n 'delivery_time' => $data['delivery_schedule_day'] ?? 'delivery_time',\n 'order_id' => $order->id\n ]);\n }\n\n return $this->jsonResponse(false, 'order created successfully', 'order', $order);\n }",
"public function create()\n\t{\n\t\treturn View::make('orderdeliveries.create');\n\t}",
"public function testCreateOrder() {\n $order_item = $this->createEntity('commerce_order_item', [\n 'type' => 'default',\n 'unit_price' => [\n 'number' => '999',\n 'currency_code' => 'USD',\n ],\n ]);\n $order = $this->createEntity('commerce_order', [\n 'type' => 'default',\n 'mail' => $this->loggedInUser->getEmail(),\n 'order_items' => [$order_item],\n 'uid' => $this->loggedInUser,\n 'store_id' => $this->store,\n ]);\n\n $order_exists = (bool) Order::load($order->id());\n $this->assertNotEmpty($order_exists, 'The new order has been created in the database.');\n }",
"public function store(CreateDeliveryRequest $request)\n {\n $input = $request->all();\n\n if(count($request->item_name) > 0)\n {\n foreach($request->item_name as $item=>$v){\n $data2 = array(\n 'ref_no' => $input['ref_no'],\n 'product_id' => $request->item_id[$item],\n 'quantity' => $request->item_qty[$item],\n 'unit_type' => $request->item_unit[$item],\n 'buying_price' => $request->item_prc[$item],\n 'total_cost' => $request->item_ttl_prc[$item]\n );\n DeliveryDetails::insert($data2);\n }\n }\n\n $delivery = $this->deliveryRepository->create($input);\n\n Flash::success('Delivery saved successfully.');\n\n return redirect(route('deliveries.index'));\n }",
"public function create()\n\t{\n\t\treturn view('admin.sale-order.create');\n\t}",
"public function create()\n {\n $supplyorder = new Supplyorder;\n $supplyorder->supplier_id =1;\n $supplyorder->status_id =1;\n $supplyorder->save();\n Activity::log('Created supply order #' . $supplyorder->id . '.');\n return Redirect::action('SupplyOrderController@show', $supplyorder->id);\n }",
"public function actionCreate()\n {\n /** @var Order $model */\n $model = new Order;\n // Load saved draft\n $draftModel = $model->getDraftOrderByUser($this->acl->getUser());\n if ($draftModel) {\n $model = $draftModel;\n }\n\n $event = new OrderCreatedEvent($model, $this);\n $model->onOrderCreated = [$event, 'sendNotification'];\n\n // Get current model scenario\n $scenario = $model->getScenario();\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Order'])) {\n $model->setAttributes($_POST['Order']);\n $model->setAttribute('creator_id', Yii::app()->user->getId());\n $model->orderItems = $_POST['OrderItems'];\n\n if ($model->isDraft()) {\n $redirect = ['index'];\n $scenario = 'saveDraft';\n $model->setScenario($scenario);\n // Order is not created until it is actually posted\n // It is posted when status changed from \"Draft\"\n $model->setAttribute('created', null);\n } else {\n $model->setAttribute('created', date('Y-m-d'));\n $redirect = ['view', 'id' => $model->id];\n }\n\n // Same scenario should apply to related models\n if ($model->saveWithRelated(['orderItems' => ['scenario' => $scenario]])) {\n $this->redirect($redirect);\n }\n }\n\n $this->render('create', [\n 'model' => $model,\n ]);\n }",
"function createOrder() {\n\t$postData = new Order;\n\n\treturn $postData->getOrderJson();\n}",
"public function created(Order $Order)\n {\n //code...\n }",
"public function createOrder(Request $request)\n {\n\n $order = Order::create([\n 'room_id' => $request['roomId'],\n 'user_id' => $request['userId'],\n 'guests' => $request['guests'],\n 'check_in' => $request['checkIn'],\n 'check_out' => $request['checkOut'],\n 'total_days' => $request['totalDays'],\n 'message' => $request['message'],\n 'status' => $request['status'],\n ]);\n\n return response()->json([\n \"message\" => \"pesananmu masuk kedalam proses\",\n \"data\" => $order\n ]);\n }",
"function create(Request $request) {\n // create order\n $data = [\n 'client_name' => $request->client_name,\n 'date' => $request->order_date,\n ];\n $order = $this->orders->create($data);\n\n // add products to order\n $num_products = $this->products->numProducts();\n for($i = 1; $i < $num_products + 1; $i++) {\n $key = 'product-' . $i;\n if($request[$key] != null) {\n $this->orders->addProduct($order->id, $i, $request[$key]);\n } \n }\n Redirect::to('encomendas');\n }",
"public function create()\n {\n \n return view('order.create');\n }",
"public function store(Request $request)\n {\n\n $deliver_date = $request->deliver_date;\n $initial_payment = $request->initial_payment;\n $quantity = $request->quantity;\n $status = 1;\n $product_id= $request->product_id;\n $client_id= $request->client_id;\n $user = Auth::user();\n\n Order::create([\n 'deliver_date' =>$deliver_date,\n 'initial_payment' =>$initial_payment,\n 'quantity' =>$quantity,\n 'status' =>$status,\n 'product_id' =>$product_id,\n 'client_id' =>$client_id,\n 'user_id' => $user->id,\n\n\n\n ])->save();\n\n Alert::success('Pedido Agregado');\n\n return redirect()->to('orders');\n }",
"public function actionCreate($id = null)\n {\n $deliveryPostData = Yii::$app->request->post('Delivery');\n\n if (isset($deliveryPostData['id']) && $deliveryPostData['id']>0) {\n $model = $this->findModel($deliveryPostData['id']);\n } else {\n $model = new Delivery();\n }\n \n if ($id) {\n if (\n Order::findOne(['id' => $id])->status === Order::STATUS_INACTIVE ||\n Order::findOne(['id' => $id])->status === Order::STATUS_DELETED) {\n throw new ForbiddenHttpException('Нельзя создавать отгрузки на некативные или удаленные заказы');\n }\n } else {\n $firstOrder = Order::getFirst();\n\n if (!$firstOrder) {\n $message = \"Извините, нет подходящих заказов\";\n Yii::$app->session->setFlash('error', $message);\n return $this->redirect(['index']);\n }\n $id = $firstOrder->id;\n }\n $model->order = $id;\n\n $model->load(Yii::$app->request->post());\n\n $postQuantityArray = Yii::$app->request->post('quantity');\n\n if (is_array($postQuantityArray)) {\n $model->save();\n foreach ($postQuantityArray as $productId => $quantity) {\n $deliveryToProduct = DeliveryToProduct::find()->where(['delivery' => $model->id, 'product' => $productId])->one();\n if (!$deliveryToProduct) {\n $deliveryToProduct = new DeliveryToProduct();\n $deliveryToProduct->delivery = $model->id;\n $deliveryToProduct->product = $productId;\n }\n $deliveryToProduct->quantity = $quantity;\n $deliveryToProduct->save();\n }\n }\n\n if (Yii::$app->request->post('save') === 'Y' && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n \n if (Yii::$app->request->post('add') === 'Y' && Yii::$app->request->post('addProduct')) {\n $model->save();\n $deliveryToProduct = DeliveryToProduct::find()->where(['delivery' => $model->id, 'product' => Yii::$app->request->post('addProduct')])->one();\n if (!$deliveryToProduct) {\n $quantity = $model->getOrderOne()->getOrderToProducts()->where(['product' => Yii::$app->request->post('addProduct')])->exists()? \n $model->getOrderOne()->getOrderToProducts()->where(['product' => Yii::$app->request->post('addProduct')])->one()->quantity: 0;\n \n $deliveryToProduct = new DeliveryToProduct();\n $deliveryToProduct->product = Yii::$app->request->post('addProduct');\n $deliveryToProduct->delivery = $model->id;\n $deliveryToProduct->quantity = $quantity;\n $deliveryToProduct->save();\n }\n }\n\n $deliveryToProducts = $model->getDeliveryToProductsAll($id);\n\n if (Yii::$app->request->post('remove')) {\n foreach ($deliveryToProducts as $index => $deliveryToProduct) {\n if ($deliveryToProduct->product == Yii::$app->request->post('remove')) {\n unset($deliveryToProducts[$index]);\n }\n }\n }\n\n $dataProvider = new ArrayDataProvider([\n 'allModels' => $deliveryToProducts,\n 'sort' => false,\n 'pagination' => [\n 'pageSize' => 30,\n ],\n ]);\n\n return $this->render('create', [\n 'model' => $model,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function created(Order $order)\n\t{\n\t\t//\n\t}",
"public function created(Order $order)\n\t{\n\t\t//\n\t}",
"public function create()\n {\n\n return view('vendor.voyager.order.create');\n\n //\n }",
"public function create( &$order ) {\n\t\t/**\n\t\t * Filter the generated order ID.\n\t\t *\n\t\t * @param string $order_key The uniquely-generated ID for this order.\n\t\t */\n\t\t$order_key = apply_filters( 'woocommerce_generate_order_key', uniqid( 'order_' ) );\n\n\t\t$order->set_order_key( 'wc_' . $order_key );\n\t\t$this->creating = true;\n\n\t\tparent::create( $order );\n\t}",
"public function createpoAction() {\n $filter = $this->getRequest()->getParam('top_filter');\n $helperClass = Mage::helper('inventorysupplyneeds');\n if ($helperClass->getDraftPO()->getId()) {\n Mage::getSingleton('vendorsinventory/session')->addNotice(\n $helperClass->__('There was an existed draft purchase order. Please process it before creating new one'));\n return $this->_redirect('*/*/index', array('top_filter' => $filter));\n }\n $helperClass->setTopFilter($filter);\n $data = $helperClass->prepareDataForDraftPO();\n try {\n if (!isset($data['product_data']) || !count($data['product_data'])) {\n throw new Exception($helperClass->__('There is no product needed to purchase.'));\n }\n //var_dump($data); die();\n $model = Mage::getModel('inventorypurchasing/purchaseorder_draftpo')\n ->addData($data);\n $model->setCreatedAt(now())\n ->setCreatedBy($this->_getUser()->getVendorId());\n $model->setType(Magestore_Inventorypurchasing_Model_Purchaseorder_Draftpo::SUPPLYNEED_TYPE);\n $model->create();\n Mage::getSingleton('vendorsinventory/session')\n ->addSuccess($helperClass->__('The supply needs have been saved successfully as draft purchase order(s).'));\n return $this->_redirect('*/inventory_draftpo/view', array('id' => $model->getId()));\n } catch (Exception $ex) {\n Mage::getSingleton('vendorsinventory/session')\n ->addError($helperClass->__('There is error while creating new draft purchase order.'));\n Mage::getSingleton('vendors/session')->addError($ex->getMessage());\n return $this->_redirect('*/*/index', array('top_filter' => $filter));\n }\n }",
"public function createDeliveryMethod(Request $request)\n {\n $request->validate([\n 'name' => 'required|string|max:255',\n 'price' => 'required|numeric',\n 'description' => 'string|max:255'\n ], [], [\n 'name' => 'název',\n 'price' => 'cena',\n 'description' => 'popisek'\n ]);\n $delivery_method = new DeliveryMethod;\n $delivery_method->fill($request->all());\n $delivery_method->save();\n session()->flash('success_message', 'Nový způsob dopravy byl úspěšně přidán.');\n return redirect(route('admin.delivery_and_payment_methods'));\n }",
"public function newOrder($post)\n {\n $this->id_customer=Yii::$app->getUser()->id;\n $this->date_create=date(\"Y-m-d H:i:s\");\n $this->date_deadline=date(\"Y-m-d H:i\",strtotime($this->date_deadline));\n $this->show_pre_source=0;\n if($this->special==1){\n $this->id_status=2;\n $this->id_performer=$this->idSpecialUser;\n\n\n }else{\n $this->id_status=1;\n }\n\n if($this->validate()){\n $order=new Order;\n $order->setAttributes($this->attributes);\n $order->info_text=nl2br($this->info_text);\n if($order->validate()) {\n $order->save();\n if($order->id_status==2){\n $modelPerformerOrder= new PerformerOrder;\n $modelPerformerOrder->applyAutoCreateOrder($order->id,$order);\n $order->choisePerformer($order->id_performer); //уведомление внутри функции отправится\n }\n\n\n $modelNotification= new Notification;\n $modelNotification->autoComplete(0,$order->id_customer,1,json_encode([\"id_order\"=>$order->id]));\n \n\n return $order;\n }\n else {\n Yii::trace($order->getErrors());\n }\n }\n Yii::trace($this->getErrors());\n return false;\n\n\n }",
"public function actionCreateshipment()\n\t{\n\t\tif($_POST && isset($_POST['id']))\n\t\t{\n\t\t\t$shop=isset($_POST['shopName'])?$_POST['shopName']:\"NA\";\n\t\t\t$path='shipment/'.$shop.'/'.Data::getKey($_POST['id']).'.log';\n\t\t\ttry\n\t\t\t{\t\n\t\t\t\t//create shipment data\n\t\t\t Data::createLog(\"order shipment in walmart\".PHP_EOL.json_encode($_POST),$path);\n\t\t\t\t$objController=Yii::$app->createController('walmart/walmartorderdetail');\n\t\t\t\t$objController[0]->actionCurlprocessfororder();\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\tData::createLog(\"order shipment error \".json_decode($_POST),$path,'a',true);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tData::createLog(\"order shipment error wrong post\");\n\t\t}\n\t}",
"public function actionCreate()\n {\n $model = new YxOrder();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function actionCreate()\n\t{\n\t\t$model=new Order;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Order']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Order'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function create()\n {\n return view('order-create');\n }",
"public function testCreate()\n {\n VCR::insertCassette('orders/create.yml');\n\n $order = Order::create(Fixture::basicOrder());\n\n $this->assertInstanceOf('\\EasyPost\\Order', $order);\n $this->assertStringMatchesFormat('order_%s', $order->id);\n $this->assertNotNull($order->rates);\n }",
"public function create()\n {\n return view('order.create');\n }",
"public function create()\n {\n return view('order.create');\n }",
"public function create()\n {\n return view('order.create');\n }",
"public function create()\n\t{\n\t\treturn View::make('orderdeliverypackages.create');\n\t}",
"public function create()\n {\n //$this->auth->restrict($this->addPermission);\n /*\n $session = $this->session->userdata('app_session');\n $nodo = $this->Deliveryorder_model->generate_nodo($session['kdcab']);\n\n $marketing = $this->Deliveryorder_model->pilih_marketing()->result();\n $getitemdo = $this->Detaildeliveryorder_model->find_all_by(array('no_do'=>$nodo));\n\n $this->template->set('marketing',$marketing);\n $this->template->set('detaildo',$getitemdo);\n */\n $customer = $this->Customer_model->find_all_by(array('deleted'=>0));\n $this->template->set('customer',$customer);\n\n if($this->uri->segment(3) == \"\"){\n\n $data = $this->Salesorder_model->get_salesorder_open();\n //$data = $this->Salesorder_model->order_by('no_so','ASC')->find_all_by(array('total !='=>0));\n }else{\n $data = $this->Salesorder_model->get_salesorder_open(\"AND id_customer ='\".$this->uri->segment(3).\"' \");\n }\n $this->template->set('results', $data);\n\n $this->template->title('Input Delivery Order');\n $this->template->render('list_so');\n }",
"public function create()\n {\n return view('admin.create_order');\n }",
"public function create()\n {\n return view('crud.order.create');\n }",
"public function store(CreateOrderRequest $request)\n {\n $input = $request->all();\n\n // dd($input);\n\n $order = $this->orderRepository->create($input);\n\n Flash::success('Order saved successfully.');\n\n return redirect(route('admin.products.orders.index'));\n }",
"public function create()\n {\n return view('admin.order.create');\n }",
"private function createOrder()\n {\n $order = $this->getMock(\\OxidEsales\\Eshop\\Application\\Model\\Order::class, array('validateDeliveryAddress', '_sendOrderByEmail'));\n // sending order by email is always successful for tests\n $order->expects($this->any())->method('_sendOrderByEmail')->will($this->returnValue(1));\n //mocked to circumvent delivery address change md5 check from requestParameter\n $order->expects($this->any())->method('validateDeliveryAddress')->will($this->returnValue(0));\n\n $this->testOrderId = substr_replace( oxRegistry::getUtilsObject()->generateUId(), '_', 0, 1 );\n $order->setId($this->testOrderId);\n\n return $order;\n }",
"public function create()\n {\n $order = new Order();\n $order->setAccountId($this->accountId);\n $order->setLanguage($this->language);\n\n return $order;\n }",
"public function create()\n {\n return view('po.form', [\n 'po' => new PurchaseOrder(),\n 'action' => route('po.store'),\n 'method' => 'POST',\n 'title' => 'Create'\n ]);\n }",
"public function create()\n {\n $orders = Order::all();\n $products = Product::all();\n $deliveries = Delivery::all();\n return view('orderdetails.create',compact('orders','products','deliveries'));\n }",
"public function createOrder($accessToken){\n $url = \"https://api.sandbox.paypal.com/v2/checkout/orders\";\n \n /* Call Headers */\n $paymentHeaders = array(\"Content-Type: application/json\", \"Authorization: Bearer \".$accessToken);\n \n\t/* Generates Random Invoice Number */\n\t$randNo= (string)rand(10000,20000);\n \n /* Fill payload with transaction info */\n\n\t\t\t$postfields = '{}';\n $postfieldsArr = json_decode($postfields, true);\n $postfieldsArr['intent'] = \"CAPTURE\";\n \t$postfieldsArr['application_context']['shipping_preference'] = \"SET_PROVIDED_ADDRESS\";\n \t$postfieldsArr['application_context']['user_action'] = \"PAY_NOW\";\n \t\n \t$postfieldsArr['purchase_units'][0]['description'] = \"PayPalPizza\";\n \t$postfieldsArr['purchase_units'][0]['invoice_id'] = \"INV-PayPalPizza-\" . $randNo;\n \t$postfieldsArr['purchase_units'][0]['amount']['currency_code'] = $_POST['currency'];\n \t$postfieldsArr['purchase_units'][0]['amount']['value'] = $_POST['total_amt'];\n \t$postfieldsArr['purchase_units'][0]['amount']['breakdown']['item_total']['currency_code'] = $_POST['currency'];\n \t$postfieldsArr['purchase_units'][0]['amount']['breakdown']['item_total']['value'] = $_POST['total_amt'];\n\t\t\t$postfieldsArr['purchase_units'][0]['shipping']['address']['recipient_name']= $_POST['shipping_recipient_name'];\n\t\t\t$postfieldsArr['purchase_units'][0]['shipping']['address']['phone']= $_POST['shipping_phone'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['address_line_1']= $_POST['shipping_line1'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['address_line_2']= $_POST['shipping_line2'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['admin_area_2']= $_POST['shipping_city'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['admin_area_1']= $_POST['shipping_state'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['postal_code']= $_POST['shipping_postal_code'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['country_code']= $_POST['shipping_country_code'];\n \n for($a = 0; $a < $_POST['itemnum']; $a++){\n $postfieldsArr['purchase_units'][0]['items'][$a]['name'] = $_POST[('itemname'. $a )];\n $postfieldsArr['purchase_units'][0]['items'][$a]['description'] = $_POST[('itemname'. $a)]; \n $postfieldsArr['purchase_units'][0]['items'][$a]['sku'] = $_POST[('itemsku'. $a)]; \n $postfieldsArr['purchase_units'][0]['items'][$a]['unit_amount']['currency_code'] = $_POST['currency']; \n $postfieldsArr['purchase_units'][0]['items'][$a]['unit_amount']['value'] = $_POST[('itemprice'. $a)];\n $postfieldsArr['purchase_units'][0]['items'][$a]['quantity'] = $_POST[('itemamount'. $a)];\n $postfieldsArr['purchase_units'][0]['items'][$a]['category'] = \"PHYSICAL_GOODS\";\n }\n \n $postfields = json_encode($postfieldsArr);\n \n/* Call Orders API */\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $paymentHeaders);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_POST, true);\n $run = curl_exec($ch);\n curl_close($ch);\n/* Call Orders API */\n\n echo $run;\n }",
"public function create()\n {\n if (Gate::allows('create-order')) {\n return view('orders.create', [\n 'order' => null\n ]);\n }\n else {\n abort(403);\n }\n }",
"public function create()\n\t{\n $this->load->model('ordersmodel');\n $data['json']=$this->ordersmodel->insertorders();\n\t\t$this->load->view('json',$data);\n\t}",
"public function createOrder($orderID) { global $db;\n \n // Insert Order\n $insert = $db->query(\"INSERT INTO `orders` (order_id, email_address, order_date, dispatch_date, delivery_address_id, delivery_id) \n VALUES(:order_id, :email_address, :order_date, :dispatch_date, :delivery_address_id, :delivery_id)\",\n array(\n 'order_id' => $orderID,\n 'email_address' => $_SESSION['user']['email_address'],\n 'order_date' => date(\"YmdHis\"),\n 'dispatch_date' => \"\",\n 'delivery_address_id' => $_SESSION['address']['id'],\n 'delivery_id' => $_SESSION['checkout']['delivery']['id']\n ));\n // Insert Order Totals\n $insert = $db->query(\"INSERT INTO `order_totals` (order_id, order_discount, order_delivery, order_vat, order_gross) \n VALUES(:order_id, :order_discount, :order_delivery, :order_vat, :order_gross)\",\n array(\n 'order_id' => $orderID,\n 'order_discount' => $_SESSION['checkout']['totals']['savings_total'],\n 'order_delivery' => $_SESSION['checkout']['totals']['delivery'],\n 'order_vat' => $_SESSION['checkout']['totals']['order_vat'],\n 'order_gross' => $_SESSION['checkout']['totals']['gross_total'],\n ));\n \n // Insert Order Items\n foreach($_SESSION['checkout']['items'] as $key => $item) {\n $insert = $db->query(\"INSERT INTO `order_items` (order_id, prod_code, price, qty) \n VALUES(:order_id, :prod_code, :price, :qty)\",\n array(\n 'order_id' => $orderID,\n 'prod_code' => $item['prod_code'],\n 'price' => $item['sale_total'] != 0.00 ? $item['sale_total'] : $item['price_total'],\n 'qty' => $item['qty']\n ));\n }\n \n return $orderID;\n }",
"public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Orderdelivery::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tOrderdelivery::create($data);\n\n\t\treturn Redirect::route('orderdeliveries.index');\n\t}",
"public function store(OrderCreateRequest $request)\n {\n return $this->repository->storeOrder($request);\n }",
"public function create(Request $request)\n {\n $user = $request->id;\n $restaurant = $request->restaurant;\n $date = $request->date;\n\n $cart = Cart::where('user_id', '=', $user)->first();\n\n $cart_items = CartItem::with('menu_item')->where('cart_id', '=', $cart->id)->get();\n\n $price_array = array();\n\n // get the menu item price from cart item\n foreach ($cart_items as $cart_item) {\n $price_array[] = ($cart_item->menu_item->price);\n }\n\n // create new order\n $new_order = new Order([\n 'user_id' => $user,\n 'restaurant_id' => $restaurant,\n 'total_amount' => array_sum($price_array),\n 'delivery_time' => $date,\n 'accepted' => 0,\n 'status' => 0\n ]);\n $new_order->save();\n\n foreach ($cart_items as $cart_item) {\n //create new order items\n $new_order_items = new OrderItem([\n 'order_id' => $new_order->id,\n 'menu_item_id' => $cart_item->menu_item->id,\n ]);\n $new_order_items->save();\n }\n\n // get full order just placed\n $fullOrder = Order::with('order_item.menu_item', 'restaurant')->find($new_order->id);\n return response()->json($fullOrder);\n }",
"function createOrder($order,$requester,$numberId){\n $sql='';\n //status==0 mean have to cook and else will finish now status will be send\n $finish_time=$order->status==0 ? '\\'0000-00-00 00:00:00\\'' :'now()';\n $sql = 'INSERT INTO `order` (waiter_id,chef_id, number_id, table_id, product_id,bill_detail_id, count, comments, order_time, finish_time, status, price) VALUES ';\n $sql.= '(\\''.$requester.'\\',\\'\\','.$numberId.', '.$order->table_id.', '.$order->product_id.',-1,'.$order->count.',\\''.$order->comments.'\\', now(), '.$finish_time.', \\''.$order->status.'\\', '.$order->price.');';\n //echo $sql;\n if(isset($this->connection)){\n return $this->queryNotAutoClose($sql);\n }else{\n return $this->query($sql);\n }\n }",
"public function makeorder (Request $request) {\n\n $order = new Order;\n $order->pizza_id = $request->pizzaId;\n $order->user_id = Auth::user()->id;\n\n $order->save();\n \n return redirect ('/pizzas');\n }",
"public function postOrderDelivery(OrderDeliveryRequest $request){\n $data = [\n 'ongkir_real'=>$request->input('ongkir_real'),\n 'kurir'=>$request->input('kurir'),\n 'no_resi'=>$request->input('no_resi'),\n 'delivery_date'=>xformatDate($request->input('delivery_date')),\n 'status'=>'on delivery',\n 'modified_by'=>Auth::user()->username\n ];\n $order = Order::where('id',Input::get('order_id'))->update($data);\n //ipansuryadiflash()->success('Success', 'Order delivery success...');\n return redirect()->route('admin.pages.order');\n }",
"public function createOrder()\n {\n if(!request()->ajax())\n {\n throw new BadRequestHttpException();\n }\n\n $data = request()->all();\n\n $model = new OrderViewModel(request('language'));\n\n $this->orderService->fill($model);\n\n DB::beginTransaction();\n\n if (auth()->check())\n {\n $userId = auth()->id();\n }\n else\n {\n $userId = null;\n }\n \n $this->orderService->createOrder($data, $userId, $model);\n\n $this->orderService->createOrderProducts($model);\n \n try \n {\n \\Mail::to(request('email'))->send(new OrderReport($model, request('name')));\n\n \\Mail::to(config('mail.from.address'))->send(new OrderReportManager($model, request('name')));\n }\n catch (\\Exception $e)\n {\n\n DB::rollBack();\n \n return response()->json([\n 'status' => 'error'\n ]);\n }\n \n $this->cartService->clearCart();\n \n DB::commit();\n \n Session::put('isOrderCreated', true);\n \n return response()->json([\n 'status' => 'success'\n ]);\n }",
"public function createOrder($cartData,$token,$isApi,$customerId = NULL);",
"public function create(OrderFormRequest $request)\n {\n try {\n $request->validated();\n if (empty($request->status)) {\n $request->status = 2;\n }\n if (empty($request->user_id)) {\n $request->customer = auth()->user()->id;\n }\n $order = Order::where([\n 'user_id' => $request->customer,\n 'room_id' => $request->room,\n 'status' => $request->status\n ])->count();\n if ($order) {\n throw new \\Exception('Такой заказ уже существует');\n }\n $order = new Order();\n $order->fill([\n 'user_id' => $request->customer,\n 'room_id' => $request->room,\n 'status' => $request->status,\n 'note_date' => $this->convertDate($request->note_date, $request->note_time),\n 'days' => $request->days\n ]);\n $order->save();\n if ($order->status == 2) {\n event(new FreeRoom(0, $order->room_id));\n }\n $mail_order = $order->with(['customer', 'room'])->findOrFail($order->id);\n event(new OrderComplete($mail_order));\n event(new WriteAudit((object)[\n 'id' => $order->id,\n 'customer' => $order->user_id,\n 'room' => $order->room_id,\n 'type' => 'room'\n ], 1, 15));\n// Mail::to($mail_order->customer)->send(new OrderShipped(\n// $mail_order\n// ));\n return response()->json([\n 'status' => 'success',\n 'msg' => 'Заказ успешно добавлен'\n ], 200);\n } catch (\\Exception $error) {\n return response()->json([\n 'status' => 'error',\n 'msg' => $error->getMessage()\n ]);\n }\n }",
"public function create()\n\t{\n return view('orders.create');\n\t}",
"public function create()\n {\n //\n $data = Order::join('order_dist','order.oid','=','order_dist.oid')\n ->join('eval','order.uid','=','eval.uid')\n ->join('cart','cart.sid','=','eval.sid')\n ->join('addr','order_dist.did','=','addr.did')\n ->select('order_dist.odid','order.order','addr.dname','order_dist.uway','order_dist.ostatus','cart.cafee','order_dist.ocoupon','order_dist.endprice','eval.ereply','cart.cafee')\n ->get();\n // dd($data);\n\n return view('admin.order.create',['data'=>$data]);\n\n }",
"public function createAction(){\n $nameArr= [1,2];\n $priceArr=[10,12];\n $qtyArr=[2,1];\n $data = [ [\n 'emailid' => 'issaqsyed918@gmail.com',\n 'status' => 'created'\n ] , 'nameArr' => $nameArr , 'priceArr' => $priceArr ,'qtyArr' => $qtyArr ];\n $client = new Client();\n\n $ServerPort =\"\";\n if($_SERVER['SERVER_PORT']){\n $ServerPort = ':'.$_SERVER['SERVER_PORT'];\n }\n $client->setUri('http://'.$_SERVER['SERVER_NAME'].$ServerPort.'/order-rest');\n\n // $client->setUri('http://localhost:9015/order-rest');\n $client->setOptions(array(\n 'maxredirects' => 5,\n 'timeout' => 30\n ));\n $client->setParameterPost(\n $data\n );\n $client->setMethod( Request::METHOD_POST );\n $response = $client->send();\n if ($response->isSuccess()) {\n $result = json_decode( $response->getContent() , true);\n }\n return $this->redirect()->toRoute('ordermanagement', array('action' => 'index') );\n }",
"static function createOrder(Order $newOrder) : int {\r\n $sqlInsert = \"INSERT INTO Orders (CustomerID, Amt, Dates) \r\n VALUES (:CustomerID, :Amount, :Date) \";\r\n\r\n self::$db->query($sqlInsert);\r\n\r\n self::$db->bind(':CustomerID', $newOrder->getCustomerID());\r\n self::$db->bind(':Amount', $newOrder->getAmount());\r\n self::$db->bind(':Date', $newOrder->getDate());\r\n \r\n\r\n self::$db->execute();\r\n\r\n return self::$db->lastInsertId();\r\n\r\n }",
"public function postOrderMake() {\n\n /*\n Array\n (\n [12_97d170e1550eee4afc0af065b78cda302a97674c] => 5\n [metrics] => Порода:\n Пол:\n Обхват шеи:\n Обхват груди:\n Длина спины:\n Обхват передней лапы:\n От шеи до передней лапы:\n Между передними лапами:\n\n [name] => фывчфы\n [email] => sdfsdf@masd.sd\n [address] => фывфы\n [tel] => фывфы\n [pay_type] => 1\n )\n */\n\n #Helper::ta(Input::all());\n\n /**\n * Получаем корзину\n */\n CatalogCart::getInstance();\n $goods = CatalogCart::get_full();\n #Helper::ta($goods);\n\n /**\n * Формируем массив с продуктами\n */\n $products = [];\n if (count($goods)) {\n foreach ($goods as $good_hash => $good) {\n $products[$good_hash] = [\n 'id' => $good->id,\n 'count' => $good->_amount,\n 'price' => $good->price,\n 'attributes' => (array)$good->_attributes,\n ];\n }\n }\n #Helper::ta($products);\n\n $pay_type = @$this->pay_types[Input::get('pay_type')] ?: NULL;\n\n /**\n * Формируем окончательный массив для создания заказа\n */\n $order_array = [\n 'client_name' => Input::get('name'),\n 'delivery_info' => Input::get('address') . ' ' . Input::get('email') . ' ' . Input::get('tel'),\n 'comment' => $pay_type . \"\\n\\n\" . Input::get('metrics'),\n 'status' => 1, ## Статус заказа, нужно подставлять ID статуса наподобие \"Новый заказ\"\n 'products' => $products,\n ];\n #Helper::tad($order_array);\n\n $order = Catalog::create_order($order_array);\n\n /*\n $json_request = [];\n $json_request['responseText'] = '';\n $json_request['status'] = FALSE;\n\n if (is_object($order) && $order->id)\n $json_request['status'] = TRUE;\n\n\n return Response::json($json_request, 200);\n */\n\n if (is_object($order) && $order->id) {\n\n CatalogCart::clear();\n return Redirect::route('mainpage');\n #return Redirect::route('catalog-order-success');\n\n } else {\n\n return URL::previous();\n }\n }",
"public function store(Request $request){ \n $data = $request->all();\n $user = session('user');\n unset($data['_token']);\n \n $data['buyed'] = (!empty($data['buyed']))?date_format(date_create_from_format(\"d/m/Y\",$data['buyed']),\"Y-m-d\"):NULL;\n $data['id_user'] = $user->id;\n $data['status'] = 'pending';\n $data['n_order'] = (empty($data['n_order']))?NULL:$data['n_order'];\n $data['n_tracking'] = (empty($data['n_tracking']))?NULL:$data['n_tracking'];\n $data['observations'] = (empty($data['observations']))?NULL:$data['observations'];\n \n $order = Order::updateOrCreate($data);\n\n Mail::send('email.newOrder', ['user' => $user, 'order'=>$order], function ($m) use ($user, $order) {\n $m->from('auto@soluciones-integrales.com.ve', 'Soluciones Integrales');\n $m->to($user->email, $user->name)->subject('Orden número '.$order->id);\n $m->bcc('envios@soluciones-integrales.com.ve', 'Soluciones Integrales')->subject('Orden número '.$order->id); \n }); \n \n return redirect('order/index/pending');\n }",
"public function Create() {\n\t\tvalid_only_single_method ( 'POST' );\n\t\trequire_authorization ();\n\n\t\t// Check the Phone number and Telephone number, then call the Notier model\n\t\t$courier_id\t\t\t\t= get_validated_courier_id ();\n\n\t\t$this->load->model ( 'delivery_session_model' );\n\t\t$delivery_session_id = $this->delivery_session_model->Create ( $courier_id );\n\n\n\t\tjson_response ( array ( 'response' => $this->config->item ( 'response_success' ),\n\t\t\t\t'delivery_session_id'\t=> $delivery_session_id ) );\n\t}",
"public function store(Request $request)\n {\n $this->validate($request, [\n 'service' => 'required',\n 'issue' => 'required'\n\n ]);\n\n //create Post\n $orders = new Order;\n $orders->user_id = auth()->user()->id;\n $account = Account::find($request->id);\n $orders->account()->associate($account);\n $orders->issue = $request->input('issue');\n $orders->save();\n\n return redirect ('/orders')->with('success', 'Order Created');\n\n\n }",
"public function create()\n\t{\n\t\treturn View::make('admin.orders.create');\n\t}",
"public function create_purchaseorder($ponbr) {\n\t\t\t$purchaseorder = $this->create_purchaseorderheader($ponbr);\n\t\t\t$purchaseorder['LineItem'] = $this->create_purchaseorderdetails($ponbr);\n\t\t\t$this->response = $this->curl_post($this->endpoints['purchase-order'], $purchaseorder, $json = true);\n\t\t\t$this->response['response']['PurchaseOrderNumber'] = isset($this->response['response']['PurchaseOrderNumber']) ? $this->response['response']['PurchaseOrderNumber'] : $purchaseorder['ID'];\n\t\t\t$this->process_response();\n\t\t\t//$this->response['response']['request'] = $purchaseorder;\n\t\t\treturn $this->response['response'];\n\t\t}",
"public function create()\n {\n $parts = Part::all(); \n return view('purchaseOrders.create', ['parts'=>$parts]); \n }",
"public function create()\n {\n return view('backend.orders.create');\n }",
"public function create(OrderRequest $request)\n {\n\n $order = $this->repository->newInstance([]);\n\n Form::populate($order);\n\n return response()->view('order::admin.order.create', compact('order'));\n\n }",
"public function create() {\n //Si el usuario solicito recordar entonces verifica a cookie\n if (!empty($_COOKIE['tokenCookie'])){\n $user = Account::where('token', $_COOKIE['tokenCookie'])->first();\n if (!empty($user))\n session(['user'=>$user]);\n }\n \n //Si la session esta vacia devuelve la pantalla a login\n if (empty(session('user')))\n return redirect('account/login');\n \n $user = session('user');\n $orders = array();\n $status = \"new\";\n $subtitle = 'Reportar un paquete nuevo';\n $statusName='<p style=\"color: orange; margin:0;\">Reportar un paquete nuevo</p>'; \n \n \n return view('order.create', ['user'=>$user]);\n }",
"public function makeOrderRequest()\n {\n //check if the user is logged and user permission\n if (UserManager::isUserLogged()) {\n if (UserManager::getPermission($_SESSION['email']) == BASE) {\n\n //check post variables\n if (isset($_POST['delivery_date']) && isset($_POST['article_id']) && isset($_POST['article_quantity']) && !empty($_POST['article_id']) && !empty($_POST['article_quantity']) && !empty($_POST['delivery_date'])) {\n\n //test input\n $article_id = Validator::testInput($_POST['article_id']);\n $article_quantity = Validator::testInput($_POST['article_quantity']);\n $delivery_date = Validator::testInput($_POST['delivery_date']);\n $article = ArticleManager::getArticleById($article_id);\n $expire_date = $article['data_scadenza'];\n $available_date = $article['disponibile_il'];\n\n if (Validator::isDeliveryDateValid($delivery_date, $expire_date, $available_date)) {\n\n //create order\n $order = new OrderModel($article_quantity, $article_id, UserManager::getUserByEmail($_SESSION['email'])['id'], $delivery_date);\n\n //try to make the order request\n if (OrderManager::addOrder($order)) {\n MessageManager::setSuccessMsg('Richiesta inviata. Il tuo ordine verrà visionato');\n MessageManager::unsetErrorMsg();\n } else {\n MessageManager::setErrorMsg('Impossibile richiedere questo articolo');\n }\n } else {\n MessageManager::setErrorMsg('La data di consegna non è valida');\n }\n }\n }\n header('Location: ' . URL . 'catalog');\n exit;\n }\n header('Location: ' . URL . 'home');\n }",
"public function create()\n {\n //显示添加页面\n return view('Admin.Order.add');\n }",
"public function store(CreateOrderRequest $request)\n {\n $input = $request->all();\n\n $order = $this->orderRepository->create($input);\n\n Flash::success('Order saved successfully.');\n\n return redirect(route('admin.orders.index'));\n }",
"public function create()\n {\n //\n return view('quanly.orderdetail.create');\n }",
"public function createOrder($order, $comment, $deliveryType, $datetime)\n {\n $data = $this->_prepareCreateOrder($order, $comment, $deliveryType, $datetime);\n\n return $this->apiClient->doCall(\"POST\", \"order/create\", $data);\n }",
"public function create()\n {\n $data = Order::getDataToCreteOrders();\n $data['invoice_comments'] = OfferSettings::whereType(2)->select('data')->first();\n $data['is_offer'] = 0;\n if (@$data) {\n return view('order.form', $data);\n }\n return Redirect::route($this->route)->with($this->warning, __('main.something_went_wrong'));\n }",
"private function create_order_record($id_order) {\n $aux['details'] = $this->m_orders_overview->get_details($id_order);\n\n $record['id_order'] = null; // auto-increment\n $record['id_menu_order'] = $id_order;\n $record['id_table'] = $aux['details'][0]->id_table;\n $record['id_count_ks'] = $aux['details'][0]->id_count_ks;\n $record['date_pay'] = date(\"Y-m-d\");\n\n $record['id_employee'] = $aux['details'][0]->id_employee;\n $record['pay_method'] = 'hotovost';\n $record['sum_price'] = $aux['details'][0]->price;\n $record['is_closed'] = 0;\n\n $this->m_orders_overview->insert_new_order_record($record);\n }",
"public function store(Request $request)\n {\n\n\n// return $request->all();\n $this->validate($request, [\n 'p_id' => 'required|unique:orders',\n 'product_id' => 'required',\n 'email' => 'required|email',\n 'first_name' => 'required',\n ], [\n 'p_id.required' => 'Purchase/Order ID is required',\n 'p_id.unique' => 'Purchase/Order ID is already in the database',\n 'product_id.required' => 'You should select a product'\n ]);\n\n\n $order = new Order();\n $order->p_id = $request->p_id;\n $order->product_id = $request->product_id;\n $prod_order = Order::where('product_id', '=', $request->product_id)->first();\n if (isset($prod_order)) {\n $order->product_name = $prod_order->product_name;\n } else {\n $order->product_name = '';\n }\n $order->email = $request->email;\n $order->first_name = $request->first_name;\n $order->last_name = $request->last_name;\n $order->country = $request->country;\n $order->status = $request->status;\n $order->payment_method = $request->payment_method;\n\n $date1 = new Carbon($request->p_date);\n $order->p_date = $date1->format('m/d/Y h:i:s A');\n\n $order->save();\n Flash::success('Order Created');\n return Redirect::back();\n }",
"public function store(StoreDeliveryDetailsRequest $request)\n {\n $executives = new DeliveryExecutive;\n $executives->method = $request->method;\n $executives->delivery_date = date(\"Y-m-d\",strtotime(str_replace('/', '-',$request->delivery_date)));\n if($request->method=='others')\n $executives->others = $request->others;\n $executives->distance = $request->distance;\n $executives->delivery_time = date(\"H:i\", strtotime($request->delivery_time));\n $executives->delivery_person = $request->delivery_person;\n $executives->delivery_vehicle_type = $request->delivery_vehicle_type;\n if($request->delivery_vehicle_type=='company')\n $executives->delivery_vehicle_id = $request->delivery_vehicle_id;\n $executives->branch_id = $request->branch_id;\n $executives->delivery_note = $request->delivery_note;\n $executives->save();\n return redirect('executives')->withSuccess('Delivery Details Added Successfully.');\n }",
"function submitOrder() {\n\techo \"Submitting Order </br>\";\n\t$data = createOrder();\n\t$response = postRequest('/api/order', $data);\n\tprintInfo($response);\n}",
"public function store(Request $request)\n {\n return Order::create([\"client_id\" => $request->client_id]);\n }",
"public function testCreateOrder()\n {\n $result = OrdersService::create([\n 'title' => 'Test Order',\n 'state' => 'INITIAL',\n 'res_id' => 1,\n 'foods' => [1, 2],\n ]);\n\n $this->assertInstanceOf(Model::class, $result);\n }",
"public function newOrder(NewOrderRequest $newOrderRequest)\n {\n try {\n $origin = $newOrderRequest->get('origin');\n $destination = $newOrderRequest->get('destination');\n $order = $this->orderService->createNewOrder($origin, $destination);\n\n if ($order) {\n $orderResponseData = ['id' => $order->id, 'distance' =>$order->getDistance(), 'status' => $order->status];\n\n return $this->responseHelper->sendSuccess('Success', JsonResponse::HTTP_OK, $orderResponseData);\n } else {\n return $this->responseHelper->sendError($this->orderService->error, $this->orderService->errorCode);\n }\n } catch (\\Exception $e) {\n return $this->responseHelper->sendError($e->getMessage(), JsonResponse::HTTP_INTERNAL_SERVER_ERROR);\n }\n }"
] | [
"0.7703821",
"0.7626359",
"0.7538761",
"0.73991853",
"0.72813505",
"0.7203322",
"0.71186084",
"0.7100838",
"0.70221245",
"0.70188093",
"0.6951099",
"0.6908209",
"0.69081455",
"0.6892893",
"0.68606913",
"0.685998",
"0.68514556",
"0.68488896",
"0.68323207",
"0.6815331",
"0.67487097",
"0.67378694",
"0.67209816",
"0.6713116",
"0.67122275",
"0.6686188",
"0.66822237",
"0.66786104",
"0.6667969",
"0.6664494",
"0.6660085",
"0.66505516",
"0.6648054",
"0.6605477",
"0.6603079",
"0.66006327",
"0.6568794",
"0.6568794",
"0.65527564",
"0.6546171",
"0.65430176",
"0.65006",
"0.64932185",
"0.6483296",
"0.6472785",
"0.64719594",
"0.64634377",
"0.6463235",
"0.6461879",
"0.6461879",
"0.6461879",
"0.645748",
"0.6456544",
"0.6443042",
"0.6431842",
"0.64231503",
"0.64198256",
"0.6407893",
"0.64031696",
"0.6395649",
"0.63638115",
"0.6360425",
"0.63582224",
"0.63461024",
"0.6333353",
"0.63260895",
"0.6312416",
"0.6311",
"0.6308277",
"0.6306485",
"0.6302593",
"0.6301526",
"0.6301329",
"0.630004",
"0.62911224",
"0.62844247",
"0.6273736",
"0.6273353",
"0.6268525",
"0.6268085",
"0.6249235",
"0.62463707",
"0.6226627",
"0.6221857",
"0.6218902",
"0.6216574",
"0.62152374",
"0.6207376",
"0.62057817",
"0.6193121",
"0.61858356",
"0.61832726",
"0.61657476",
"0.61650926",
"0.61640733",
"0.61628115",
"0.6157222",
"0.61562604",
"0.6150002",
"0.6148464",
"0.61437154"
] | 0.0 | -1 |
Get messages of a thread | public function threadMessages($thread, $participant)
{
//If user has deleted conversation once
if (!$metaData = $thread->getMetadataForParticipant($participant)) {
throw new \InvalidArgumentException(sprintf('No metadata exists for participant with id "%s"', $participant->getId()));
}
$messages = $this->createQueryBuilder('msg')
->innerJoin('msg.thread', 'th')
->innerJoin('th.metadata', 'thMeta')
->where('th.id = :threadID')
->andWhere('thMeta.participant = :participant')
->orderBy('msg.createdAt', 'DESC')
->setParameters(array(
'threadID' => $thread->getId(),
'participant' => $participant
));
return $messages->getQuery();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getMessages();",
"public function getMessages();",
"public function getMessages();",
"public function getMessages();",
"public function getMessages();",
"public function getMessages();",
"public function getMessages();",
"public function getMessages() {}",
"public function getMessages() {}",
"public function getReceivedMessages();",
"public function get_messages() {\n\t\t$messages = $this->_read_messages();\n\t\t$this->clear_messages();\n\t\treturn apply_filters( 'tn_get_messages', $messages );\t\n\t}",
"public function testMessageThreadsV2GetMessages()\n {\n }",
"public function getMessages(){ }",
"public function testMessageThreadsV2GetMessages0()\n {\n }",
"public function getMessages(): array;",
"public function getMessages(): array;",
"public function getMessages(): array;",
"public function getMessages()\r\n {\n return $this->fm->getMessages();\n }",
"public function getMessageQueue()\n\t{\n\t\treturn $this->messages;\n\t}",
"function loadMessages($thread_id)\n\t\t{\n\t\t\t$query=sqlite_query($this->connection, \"SELECT user_id, message, date FROM message WHERE thread_id='$thread_id' ORDER BY message_id ASC\");\n\t\t\twhile ($row = sqlite_fetch_array($query))\n\t\t\t{\n\t\t\t\t$row[0]=$this->loadUser($row[0]);\n\t\t\t}\n\t\t\treturn $row;\n\t\t}",
"public function getMessages()\n {\n return $this->_msg;\n }",
"public function getMessages(){\n\t\treturn $this->messages;\n\t}",
"public function getMessages(){\n\t\treturn $this->messages;\n\t}",
"public function getMessages() {\n return $this->message;\n }",
"public function getMessages()\n {\n return $this->_messages;\n }",
"public function getMessagesAndFlush() {}",
"public function getMessages($f) { }",
"public function getMessages () {\n return $this->messages;\n }",
"function getMessages(){\r\n return $this->messages;\r\n }",
"function getThreadById($id){\n \n return $this->find($id)->toArray(); \n }",
"public function getMessages()\n {\n return $this->_messages;\n }",
"public function getMessages()\n {\n return $this->_messages;\n }",
"public function getMessages()\n {\n return $this->_messages;\n }",
"public function getMessages()\n {\n return $this->_messages;\n }",
"public function getMessages()\n {\n return $this->_messages;\n }",
"public function getMessages()\n {\n $chat_info = $this->_Database->query(\"SELECT chat.*, users.user_name, users.staff_status FROM chat LEFT JOIN users ON users.user_id = chat.user_id ORDER BY chat_id DESC\", null, \"fetchAll\");\n return $chat_info;\n }",
"public function getMessages()\n {\n return $this->messages;\n }",
"public function getMessages()\n {\n return $this->messages;\n }",
"public function getMessages() {\n\t\treturn isset($this->messages) ? $this->messages : [];\n\t}",
"public function getAllMsg() : array\n {\n return $this->messages;\n }",
"public function messages() {\n\t\treturn $this->master->call('account/messages');\n\t}",
"public function messages();",
"public function messages();",
"public function messages();",
"public function getMessages ()\n\t{\n\t\t$messages = array();\t//Prevent foreach loop error\n\t\t$Statement = $this->Database->prepare(\"SELECT messages.*, users.first_name, users.last_name, users.thumbnail FROM messages INNER JOIN users ON messages.sender_id = users.id WHERE reciever = ? ORDER BY id DESC LIMIT 30\");\n\t\t$Statement->execute(array($this->id));\n\t\t$messages = $Statement->fetchAll();\n\t\t\n\t\treturn $messages;\n\t}",
"static function getMessages(){\n if(key_exists(MESSAGES, $_REQUEST)){\n return $_REQUEST[MESSAGES];\n }else{\n return array();\n }\n }",
"public function get_messages() {\n return $this->messages;\n }",
"function GetMessages()\n\t{\n\t\t$trns = LiveChat::GetSessionsHeaders(array('sid' => $this->sid));\n\t\t$trns = $trns[0];\n\t\t\n\t\t$r = $this->db->q(\"\n\t\t\tSELECT *\n\t\t\tFROM #_PREF_lc_messages messages\n\t\t\t LEFT JOIN #_PREF_lc_users users ON messages.user_id = users.user_id\n\t\t\tWHERE messages.sid = \". $this->sid .\"\n\t\t\");\n\t\t\n\t\t$chat = array();\n\t\twhile ($item = $this->db->fetchAssoc()) {\n\t\t\t$chat[] = $item;\n\t\t}\n\t\t\n\t\t$trns['messages'] = $chat;\n\t\treturn $trns;\n\t}",
"public function get_messages(){\n return $this->messages;\n }",
"public function getMessages(): array\n {\n return $this->messages;\n }",
"public function getMessages(): array\n {\n return $this->messages;\n }",
"public function getMessages(): array\n {\n return $this->messages;\n }",
"public function getMessages(): array\n {\n return $this->messages;\n }",
"public function getMessages() {\n return $this->messages;\n }",
"public function getMessages(): array\n {\n }",
"public function get_message_strings() {\n foreach($this->messages as $singleMessage) {\n \n }\n }",
"function messages()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n\r\n $db->array_query( $message_array, \"SELECT ID, PostingTime FROM\r\n eZForum_Message\r\n WHERE ForumID='$this->ID' AND IsTemporary='0'\r\n ORDER BY PostingTime DESC\" );\r\n\r\n $ret = array();\r\n\r\n foreach ( $message_array as $message )\r\n {\r\n $ret[] = new eZForumMessage( $message[$db->fieldName( \"ID\" )] );\r\n }\r\n\r\n return $ret;\r\n }",
"private function _read_messages() {\n\n\t\tif( $this->messages ) {\n\t\t\treturn $this->messages;\n\t\t}\n\n\t\tif( !isset( $_COOKIE[ $this->cookie_handle ] ) || $_COOKIE[ $this->cookie_handle ] == \"null\" ) {\n\t\t\treturn array();\n\t\t}\n\n\t\treturn $this->parse_cookie( $_COOKIE[ $this->cookie_handle ] );\n\t}",
"public function messages() {\n return $this->get_from_model(__FUNCTION__);\n }",
"public function getMessages(): Collection;",
"public function getMessages(): Collection;",
"public function getMessages() :array\r\n {\r\n return $this->messages;\r\n }",
"static private function _getMsgs()\n\t{\n\t\t$msgs = Factory::getInstance( 'Session' )->get( self::$var_name );\n\n\t\tif ( $msgs )\n\t\t{\n\t\t\treturn $msgs;\n\t\t}\n\n\t\treturn array();\n\t}",
"public function fetchMessages(){\n\t\t$sql = $this->dbh->query(\"SELECT * FROM `wsMessages`\");\n\t\t$msgs = $sql->fetchAll();\n\t\treturn $msgs;\n\t}",
"public function getMessages() : array\n {\n return $this->messages;\n }",
"public function getMessages(): array\n {\n if (empty($this->messages)) {\n $messageText = $this->event->get('body');\n $account_id = $this->event->get(static::ACCOUNT_ID);\n $room_id = $this->event->get('room_id');\n\n $this->messages = [new IncomingMessage($messageText, $account_id, $room_id, $this->event)];\n }\n\n return $this->messages;\n }",
"public function testMessageThreadsV2Get0()\n {\n }",
"public function threadsWithNewMessages()\n {\n $threadsWithNewMessages = [];\n $participants = Participant::where('user_id', $this->id)->lists('last_read', 'thread_id');\n\n /**\n * @todo: see if we can fix this more in the future.\n * Illuminate\\Foundation is not available through composer, only in laravel/framework which\n * I don't want to include as a dependency for this package...it's overkill. So let's\n * exclude this check in the testing environment.\n */\n if (getenv('APP_ENV') == 'testing' || !str_contains(\\Illuminate\\Foundation\\Application::VERSION, '5.0')) {\n $participants = $participants->all();\n }\n\n if ($participants) {\n $threads = Thread::whereIn('id', array_keys($participants))->get();\n\n foreach ($threads as $thread) {\n if ($thread->updated_at > $participants[$thread->id]) {\n $threadsWithNewMessages[] = $thread->id;\n }\n }\n }\n\n return $threadsWithNewMessages;\n }",
"public function getMessages()\n {\n //PEMBAHASAN MENGENAI EAGER LOADING BISA DI CARI DI DAENGWEB.ID\n return Message::with('user')->get();\n }",
"public function fetchAllMessages()\n {\n return Chat::with('user')->get();\n }",
"public function getInboxMessages() {\n\t\t$urlInboxMessages = \"http://www.reddit.com/message/messages/.json\";\n\t\treturn $this->runCurl ( $urlInboxMessages );\n\t\t// Surely: return $this->getRawJSON('message/messages/'); is preferable.\n\t}",
"public function testMessageThreadsV2Get()\n {\n }",
"public function loadMessages() :array {\n $chatModel = new ChatModel();\n return $chatModel->getLastTenMessages();\n }",
"public function get_conversation($match_id) {\n\t\t$ex = explode(',', $match_id);\n\t\tif (count($ex)>1) {\n\t\t\t$i = rMatches::get_matches_by_user_interest($ex[0], $ex[1], array('interest','matched_interest','unread'));\n\t\t} else {\n\t\t\t$i = rMatches::get_match($match_id);\n\t\t}\n\t\tif($i !== False && count($i)>0) {\n\t\t\t$i = $i[0];\n\t\t} else {\n\t\t\treturn(array());\n\t\t}\n\t\t\t\n\t\t// check if the thread exists\n\t\t// TODO: call threads.get_id_by_interests(iid1, iid2);\n\t\t$t = ca_mysql_query(\"\nSELECT `id`\nFROM `thread`\nWHERE\n(`interest` = {$i['interest']} AND `matched_interest` = {$i['matched_interest']})\nOR\n(`interest` = {$i['matched_interest']} AND `matched_interest` = {$i['interest']})\n\t\t\");\n\t\tif($t !== False && count($t)>0) {\n\t\t\t$thread_id = $t[0]['id'];\n\t\t} else {\n\t\t\treturn(array());\n\t\t}\n\n\t\t$r = ca_mysql_query(\"\nSELECT *\nFROM `message`\nWHERE\n`thread` = {$thread_id}\nORDER BY `create_time` DESC\nLIMIT 20\n\t\t\");\n\t\tif($r !== False) {\n\t\t\treturn(array_reverse($r, False)); // return in ASC order\n\t\t} else {\n\t\t\treturn(array());\n\t\t}\n\t}",
"public function getMessages() {\r\n \t$this->getForm()->getMessages();\r\n }",
"public function getMessagesReceived()\n {\n return $this->request->getMessagesReceived();\n }",
"public function getMessages()\n\t{\n\t\t$messages = Message::orderBy( 'created_at', 'asc' )->get();\n\t\treturn $messages;\n\t}",
"public function messages() {\n return $this->_messages;\n }",
"public static function getWordMessages()\n {\n return Message::where('type', '=', 'word')->get();\n }",
"public function getMessagesAction(Board $board)\n {\n return $board->getChatMessages();\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 getMessages()\n\t{\n\t\t$model = JModel::getInstance('Messages', 'SfsModel', array('ignore_request' => true) );\n\n\t\t$model->setDbo($this->getDbo());\n\t\t$model->setState('block.id', $this->id );\n\n\t\t$messages = $model->getItems();\n\n\t\treturn $messages;\n\t}",
"public static function getMessagesByThreadId($id, $limit = 4, $offset = 0)\n\t{\n\t\t$messages = (array) FrontendModel::getDB()->getRecords(\n\t\t\t'SELECT pm.created_on, pm.text, p.display_name, p.url, ps.value AS facebook_id, ps1.value AS avatar\n\t\t\t FROM profiles_message AS pm\n\t\t\t INNER JOIN profiles AS p ON pm.user_id = p.id\n\t\t\t LEFT JOIN profiles_settings AS ps ON p.id = ps.profile_id AND ps.name = \"facebook_id\"\n\t\t\t LEFT JOIN profiles_settings AS ps1 ON p.id = ps1.profile_id AND ps1.name = \"avatar\"\n\t\t\t WHERE pm.thread_id = ?\n\t\t\t ORDER BY pm.created_on DESC\n\t\t\t LIMIT ?,?', array((int) $id, (int) $offset, (int) $limit)\n\t\t);\n\n\t\tforeach($messages as &$message)\n\t\t{\n\t\t\t$message['facebook_id'] = unserialize($message['facebook_id']);\n\t\t\t$message['avatar'] = unserialize($message['avatar']);\n\t\t}\n\n\t\treturn array_reverse($messages);\n\t}",
"public function getMessages(): array\n {\n $result = [];\n foreach (array_keys($this->__data) as $key) {\n $result[$key] = $this->__data[$key]->message;\n }\n\n return $result;\n }",
"public function getMessages() {\n if (isset($_SESSION['messages'])) {\n $messages = $_SESSION['messages'];\n unset($_SESSION['messages']);\n return $messages;\n } else {\n return array();\n }\n }",
"public function getMessagesFor($id)\n {\n Receiver::where('message_id', $id)->where('recipient_id', Auth::user()->id)->update(['is_seen' => true]);\n\n // get all messages between the authenticated user and the selected user\n $messages = Message_Thread::where(function($q) use ($id) {\n $q->where('message_id', $id);\n })->get();\n for($i = 0; $i < count($messages); $i++){\n $name = User::select('firstName','middleName', 'lastName')->where('id', '=', $messages[$i]['from_id'])->first();\n $messages[$i]['name'] = $name->full_name;\n }\n return response()->json($messages);\n }",
"public function all()\r\n {\r\n return $this->messages;\r\n }",
"public static function getMessages() {\n $con = pg_connect(\"host=\".CON_HOST.\" dbname=\".CON_DBNAME.\" user=\".CON_USER.\" password=\".CON_PASSWORD.\"\")\n or die (\"Could not connect to server.\");\n\n $query = \"SELECT * FROM message WHERE start_date <= now()::date AND end_date >= now()::date AND removed = false\";\n\n $result = pg_query($con, $query)\n or die(\"Cannot execute the query.\");\n\n return pg_fetch_all($result);\n }",
"public function getOneThread()\n\t{\t\n\t\tglobal $ilDB;\n\t\t\t\n\t\t$data_type = array();\n\t\t$data_value = array();\n\t\t\n\t\t$query = 'SELECT * FROM frm_threads WHERE ';\n\t\t\n\t\tif($this->getMDB2Query() != '' && $this->getMDB2DataType() != '' && $this->getMDB2DataValue() != '')\n\t\t{\n\t\t\t$query .= $this->getMDB2Query();\n\t\t\t$data_type = $data_type + $this->getMDB2DataType();\n\t\t\t$data_value = $data_value + $this->getMDB2DataValue();\n\t\t\t\n\t\t\t$sql_res = $ilDB->queryf($query, $data_type, $data_value);\n\t\t\t$result = $sql_res->fetchRow(DB_FETCHMODE_ASSOC);\n\t\t\t$result[\"thr_subject\"] = trim($result[\"thr_subject\"]);\n\t\t}\n\n\t\treturn $result;\n\t}",
"private function receiveMessages(): array\n {\n $result = SqsClient::instance()->receiveMessage(\n [\n 'AttributeNames' => ['SentTimestamp'],\n 'MaxNumberOfMessages' => 1,\n 'MessageAttributeNames' => ['All'],\n 'QueueUrl' => $this->getSqsUrl(),\n 'WaitTimeSeconds' => 20,\n ]\n );\n\n $messages = $result->get('Messages');\n if (isset($messages) === true) {\n return $messages;\n }\n\n return [];\n }",
"public function & getMessageArray() {\n\t\tif (null === $this->messages) {\n\t\t\t$this->getMessages();\n\t\t}\n\t\treturn $this->messages;\n\t}",
"function getAllMessages(){\n\t\t$query = \"SELECT M.message_id, U1.username AS fromUser, U2.username AS toUser, M.messageTitle, M.messageText\n\t\t\tFROM Messages AS M\n\t\t\tINNER JOIN User AS U1 ON M.fromUserId = U1.user_id\n\t\t\tINNER JOIN User AS U2 ON M.toUserId = U2.user_id\";\n\t\t$result = doQuery($query);\n\t\t\n\t\t// save query results in an array\n\t\t$result_array = array();\n\t\twhile($row = mysqli_fetch_assoc($result))\n\t\t{\n \t\t$result_array[] = $row;\n\t\t}\n\t\t\n\t\treturn $result_array;\n\t}",
"public function receive()\n {\n $messages = array();\n\n if (apcu_exists($this->key)) {\n $messages = apcu_fetch($this->key);\n apcu_delete($this->key);\n }\n\n return $messages;\n }",
"public function getMessages()\n {\n if (empty($this->messages)) {\n $intent = $this->event->get('intent')['displayName'];\n $session = $this->payload->get('session');\n $user = $this->payload->get('originalDetectIntentRequest')['payload']['user'] ?? null;\n\n $message = new IncomingMessage($intent, $user ? $user['userId'] : $session, $session, $this->payload);\n\n $message->addExtras('queryText', $this->event->get('queryText'));\n $message->addExtras('intent', $intent);\n $message->addExtras('action', $this->event->get('action'));\n $message->addExtras('parameters', $this->event->get('parameters'));\n $message->addExtras('languageCode', $this->event->get('languageCode'));\n\n $this->messages = [$message];\n }\n\n return $this->messages;\n }",
"protected function get_messages() {\n global $SESSION;\n\n $messages = array();\n if (!empty($SESSION->languagelesson_messages) && is_array($SESSION->languagelesson_messages) && array_key_exists($this->properties->id, $SESSION->languagelesson_messages)) {\n $messages = $SESSION->languagelesson_messages[$this->properties->id];\n unset($SESSION->languagelesson_messages[$this->properties->id]);\n }\n\n return $messages;\n }",
"public function getMessages()\n {\n if (empty($this->messages)) {\n $this->loadMessages();\n }\n\n return $this->messages;\n }",
"function getMessages() {\n\t\t$pre= $this->code;\n\t\tif (defined('CACHE_IDENTIFIER')) {\n\t\t\t$pre= CACHE_IDENTIFIER;\n\t\t}\n\n\t\tif (function_exists('apc_fetch') && (DEBUG < 1)) {\n\t\t\t$temp= apc_fetch($pre.'_lang_'.$this->code);\n\t\t\tif (false != $temp) {\n\t\t\t\t$this->messages= & $temp;\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else {\n\t\t\t//TODO eaccellerator? cacheutil?\n\t\t}\n\n\t\t$messages= array ();\n\t\tinclude (ROOT.'controllers'.DS.'lang'.DS.$this->code.'.php');\n\t\t$this->messages= & $messages;\n\n\t\tif (function_exists('apc_store') && (DEBUG < 1)) {\n\t\t\tapc_store($pre.'lang_'.$this->code, $this->messages, 300);\n\t\t} else {\n\t\t\t//TODO eaccellerator? cacheutil?\n\t\t}\n\t}",
"public function messages()\n {\n return $this->hasMany(Chat::class, 'conversation_id')\n ->latest();\n }",
"function getUserMessages($username){\n\t\t$username = escapeQuery($username);\n\t\t$query = \"SELECT M.message_id, U1.username AS fromUser, U2.username AS toUser, M.messageTitle, M.messageText\n\t\t\tFROM Messages AS M\n\t\t\tINNER JOIN User AS U1 ON M.fromUserId = U1.user_id\n\t\t\tINNER JOIN User AS U2 ON M.toUserId = U2.user_id\n\t\t\tWHERE U2.username = '$username'\";\n\t\t\n\t\t$result = doQuery($query);\n\t\t\n\t\t// save query results in an array\n\t\t$result_array = array();\n\t\twhile($row = mysqli_fetch_assoc($result))\n\t\t{\n \t\t$result_array[] = $row;\n\t\t}\n\t\t\n\t\treturn $result_array;\n\t}",
"static public function fetch_messages($level)\n\t{\n\t\treturn self::get_logger()->fetch_messages($level);\n\t}"
] | [
"0.72268987",
"0.72268987",
"0.72268987",
"0.72268987",
"0.72268987",
"0.72268987",
"0.72268987",
"0.7064421",
"0.7064421",
"0.697666",
"0.6836428",
"0.6663522",
"0.66266036",
"0.66040385",
"0.6556932",
"0.6556932",
"0.6556932",
"0.65410376",
"0.65060556",
"0.6491372",
"0.6457197",
"0.62545747",
"0.62545747",
"0.62468743",
"0.6205409",
"0.62031376",
"0.6196966",
"0.6192211",
"0.616555",
"0.6162067",
"0.6159061",
"0.6159061",
"0.6159061",
"0.6159061",
"0.6159061",
"0.61565113",
"0.6151469",
"0.6151469",
"0.61444604",
"0.61330754",
"0.6129555",
"0.6123165",
"0.6123165",
"0.6123165",
"0.611377",
"0.61099863",
"0.60965717",
"0.6089821",
"0.6087881",
"0.6085134",
"0.6085134",
"0.6085134",
"0.6085134",
"0.6084956",
"0.6084551",
"0.6082506",
"0.60789335",
"0.60556334",
"0.60416496",
"0.6032401",
"0.6032401",
"0.60316795",
"0.60310197",
"0.602025",
"0.6014531",
"0.5986409",
"0.5930818",
"0.5922094",
"0.592038",
"0.5905726",
"0.58908355",
"0.58861744",
"0.58789724",
"0.5873707",
"0.58689475",
"0.5822281",
"0.5822201",
"0.58158207",
"0.5809391",
"0.5808103",
"0.5803981",
"0.5791474",
"0.5791075",
"0.5781118",
"0.5780539",
"0.5773791",
"0.57717884",
"0.57684326",
"0.57673717",
"0.5757895",
"0.57429314",
"0.57360035",
"0.57304096",
"0.57268417",
"0.5724405",
"0.5723185",
"0.5684722",
"0.56834674",
"0.5659499",
"0.5656035"
] | 0.59011304 | 70 |
Returns last message of a thread | public function lastThreadMessage($thId)
{
$query = $this->createQueryBuilder('message')
->innerJoin('message.thread', 'th')
->where('th.id = :thId')
->orderBy('message.createdAt', 'DESC')
->setMaxResults(1)
->setParameter('thId', $thId);
return $query->getQuery()->getResult();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function lastMessage()\n {\n return $this->messages()\n ->take(1);\n }",
"public function getLastMessage()\r\n\t{\r\n\t\treturn mssql_get_last_message();\r\n\t}",
"public function getLastMessage() {\r\n $messages = $this->getMessages();\r\n if (is_array($messages) && count($messages)>0) {\r\n return $messages[count($messages)-1];\r\n }\r\n return false;\r\n }",
"public function getLastMessageID()\n {\n return $this->lastMessageID;\n }",
"function sybase_get_last_message()\n{\n}",
"public function getLastMessage(): ?MessageInterface;",
"public function get_last_msg($token) {\n $val = $this->db->select('message,created_at')->\n from('chat_table')->\n where('sender_token', $token)->\n or_where('receiver_token', $token)->\n order_by('chat_id', 'DESC')->\n limit(1)->get()->row_array();\n return $val;\n }",
"public function getLatestThread() {\n\t\t$latestThread = FALSE;\n\t\tif ($this->threads->count()) {\n\t\t\t$threads = $this->threads->toArray();\n\t\t\t$latestThread = $threads[$this->threads->count() - 1];\n\t\t}\n\n\t\treturn $latestThread;\n\t}",
"public function getLastMessageId ()\n {\n return $this->_lastMessageId;\n }",
"public function getLastMessageAttribute(): ?string\n {\n $message = $this->messages()->orderByDesc('created_at')->first();\n return $message ? $message->text : null;\n }",
"protected function getLastLogEntryMessage() {}",
"public function lastHealthMessage() {\n return $this->health_messages()\n ->orderBy('timestamp', 'desc')\n ->first();\n }",
"public function getLastMessage()\n {\n $messages = $this->getRequest('messages');\n if (empty($messages)) throw new \\Exception(\"Don't have any messages on server\");\n\n $res = $this->getRequest('message', ['id' => $messages[0]['id']]);\n $res['attachments'] = $this->getRequest('attachments', ['id' => $messages[0]['id']]);\n\n return $res;\n }",
"public function getLastMessageID()\n {\n }",
"public function getLastReply()\n {\n return $this->last_reply;\n }",
"public function getLastActivity()\r\n {\r\n $lastId = end($this->messages);\r\n\r\n $lastMsg = new TicketMessage($lastId);\r\n $lastActive = $lastMsg->getTimeCreated();\r\n \r\n return $lastActive; \r\n }",
"function getLastMsg($conv_id, $fromUser=false){\n\t\tglobal $db;\n\t\t// first we get the ID of the msg now (supposed to be only one msg with this msg_id --> [0])\n\t\t$statement = $db->prepare('SELECT * FROM msg_conversation WHERE by_bot=:by AND conv_id=:conv_id ORDER BY date DESC LIMIT 1');\n\t\t$statement->execute(array(':by'=>!$fromUser, ':conv_id'=>$conv_id));\n\t\treturn $statement->rowCount()==0?null:$statement->fetch(PDO::FETCH_ASSOC);\n\t}",
"function getLastMsg($channel, $nb)\n {\n if ($this->hasErrors())\n return array();\n \n // to be sure the $nb params is a positive number\n if (! ($nb >= 0))\n $nb = 10;\n \n // to get the channel recipient name\n // @todo must use another function to get a private message last messages\n $channel = pfcCommand_join :: GetRecipient($channel);\n \n $ct = pfcContainer :: Instance();\n $lastmsg_id = $ct->getLastId($channel);\n $lastmsg_raw = $ct->read($channel, $lastmsg_id - $nb);\n return $lastmsg_raw;\n }",
"public function latestMessage()\n {\n return $this->hasOne('App\\Message', 'conversation_id')->latest();\n }",
"public function getmessage()\n {\n return array_shift($this->storage);\n }",
"public function last_reply()\n\t{\n\t\treturn isset($this->last_reply) ? $this->last_reply : FALSE;\n\t}",
"private function getLastCommitMessage()\n {\n // hash\n // subject\n // body\n $process = new Process('git log -1 --format=\"%h%n%s%n%b\"');\n $process->run();\n\n return \\trim($process->getOutput());\n }",
"public function getLastErrorMessage()\n {\n return $this->lastErrorMessage;\n }",
"function get_last_post($topic_id) {\n return Database::get()->querySingle(\"SELECT post_time FROM forum_post\n WHERE topic_id = ?d\n ORDER BY post_time DESC LIMIT 1\", $topic_id)->post_time;\n}",
"public function getLastsend();",
"public function getLastReply()\n {\n }",
"public function getMessage()\n {\n $lastMsg = $this->getUpdates();\n if(count($lastMsg))\n {\n $lastMsg = $lastMsg[count($lastMsg) - 1];\n $this->currentChat = $lastMsg['message']['chat']['id'];\n $this->currentMsg = $lastMsg['message'];\n $this->currentMsgId = $lastMsg['message']['message_id'];\n $this->currentUser = $lastMsg['message']['from']['id'];\n $this->messageType = (isset($lastMsg['message']['contact'])) ? 'register' : 'text';\n $this->setLastUpdate($lastMsg['update_id'] + 1);\n }\n else\n {\n $this->currentMsg = array();\n }\n }",
"function getLastMessageBlock(){\n global $mysqli;\n $results = $mysqli->query(\"SELECT block_index FROM messages ORDER BY message_index DESC LIMIT 1\");\n if($results){\n $row = $results->fetch_assoc();\n return $row['block_index'];\n }\n}",
"public function latestMessage()\n {\n return \\App\\HistoriChat::join('users','users.id','=','histori_chats.another_user_id_chat')\n ->where('histori_chats.user_id_chat',\\Auth::id())\n ->orderBy('histori_chats.last_chat_at','DESC')\n ->get();\n }",
"public function getLast()\n\t{\n\t\treturn $this->last;\n\t}",
"public function getLongMessage()\n {\n return $this->longMessage;\n }",
"function ppmess_get_last_message($post_id, $logged_user, $user2){\n\t\n\tglobal $wpdb;\n\t\n\t$query = \"SELECT * FROM {$wpdb->prefix}private_messages WHERE post_id = $post_id AND ( ( receiver_id = $logged_user AND sender_id = $user2 ) OR (receiver_id = $user2 AND sender_id = $logged_user) ) ORDER BY date_created DESC LIMIT 1\";\n\t\t\t\n\t$result = $wpdb->get_results( $query, ARRAY_A );\n\t\n\tif($wpdb->num_rows == 1)\n\t\treturn $result[0];\n\telse \n\t\treturn FALSE;\n}",
"public function get_last_data_received() {\n\t\treturn $this->_last_data_received;\n\t}",
"private function getMsg()\n {\n return $this->msg;\n }",
"public function getLastLog () {\n return end($this->log);\n }",
"public function get_message()\n {\n return $this->_message;\n }",
"public static function getLastNotificationID(){\n $row = getDatabase()->queryFirstRow(\"SELECT `id` FROM `notifications` ORDER BY `id` DESC\");\n return $row['id'];\n }",
"public function getLast()\n {\n $k = count($this);\n if ($k > 0) {\n return $this[$k - 1];\n }\n }",
"public function getTMsg()\n {\n return $this->t_msg;\n }",
"public function getLastRequest() {\n\t\treturn $this->_lastRequest;\n\t}",
"public function lastReply()\n\t{\n\t\treturn $this->hasOne(Reply::class)->latest();\n\t}",
"public function get_msg() {\r\n return $this->msg;\r\n }",
"public function getLastRequest() {\n\t\treturn $this->lastRequest;\n\t}",
"public function getLastQuery()\n {\n $query_num = $this->query_count - 1;\n if ($query_num < 0) {\n return \"\";\n } else {\n return $this->queries[$this->query_count - 1];\n }\n }",
"public function getLastPost($lastPost)\n\t{\n\t\t$data = explode('#', $lastPost);\n\t\t\n\t\t$objLastPost = new ilForumPost($data[2]);\t\n\n\t\t// limit the message-size\n\t\t$message = $this->prepareText($objLastPost->getMessage(), 2);\n\t\t\n\t\tif (strpos($message, $this->txtQuote2) > 0)\n\t\t{\n\t\t\t$viewPos = strrpos($message, $this->txtQuote2) + strlen($this->txtQuote2);\n\t\t\t$message = substr($message, $viewPos);\t\t\t\t\n\t\t}\n\t\t\n\t\tif (strlen($message) > 40)\n\t\t{\n\t\t\t$message = substr($objLastPost->getMessage(), 0, 37).'...';\n\t\t}\n\t\t\n\t\t$result[\"pos_message\"] = $result[\"pos_message\"];\n\t\n\t\t// convert date\n\t\t$objLastPost->setCreateDate($this->convertDate($objLastPost->getCreateDate()));\n\t\t\t\t\n\t\treturn $objLastPost;\n\t}",
"public function getMsg()\n {\n return $this->msg;\n }",
"public function getMsg()\n {\n return $this->msg;\n }",
"function getLastPost()\n{\n\tglobal $db_prefix, $user_info, $scripturl, $modSettings;\n\n\t// Find it by the board - better to order by board than sort the entire messages table.\n\t$request = db_query(\"\n\t\tSELECT ml.posterTime, ml.subject, ml.ID_TOPIC, ml.posterName, ml.body, ml.smileysEnabled\n\t\tFROM {$db_prefix}boards AS b, {$db_prefix}messages AS ml\n\t\tWHERE ml.ID_MSG = b.ID_LAST_MSG\" . (!empty($modSettings['recycle_enable']) && $modSettings['recycle_board'] > 0 ? \"\n\t\t\tAND b.ID_BOARD != $modSettings[recycle_board]\" : '') . \"\n\t\t\tAND $user_info[query_see_board]\n\t\tORDER BY b.lastUpdated DESC\n\t\tLIMIT 1\", __FILE__, __LINE__);\n\tif (mysql_num_rows($request) == 0)\n\t\treturn array();\n\t$row = mysql_fetch_assoc($request);\n\tmysql_free_result($request);\n\n\t// Censor the subject and post...\n\tcensorText($row['subject']);\n\tcensorText($row['body']);\n\n\t$row['body'] = strip_tags(strtr(doUBBC($row['body'], $row['smileysEnabled']), array('<br />' => ' ')));\n\tif (strlen($row['body']) > 128)\n\t\t$row['body'] = substr($row['body'], 0, 128) . '...';\n\n\t// Send the data.\n\treturn array(\n\t\t'topic' => $row['ID_TOPIC'],\n\t\t'subject' => $row['subject'],\n\t\t'short_subject' => strlen(un_htmlspecialchars($row['subject'])) > 24 ? strtr(substr(strtr($row['subject'], array('<' => '<', '>' => '>', '"' => '\"')), 0, 24) . '...', array('<' => '<', '>' => '>', '\"' => '"')) : $row['subject'],\n\t\t'preview' => $row['body'],\n\t\t'time' => timeformat($row['posterTime']),\n\t\t'timestamp' => $row['posterTime'],\n\t\t'href' => $scripturl . '?topic=' . $row['ID_TOPIC'] . '.new;topicseen#new',\n\t\t'link' => '<a href=\"' . $scripturl . '?topic=' . $row['ID_TOPIC'] . '.new;topicseen#new\">' . $row['subject'] . '</a>'\n\t);\n}",
"public function last_post() {\n\t\treturn Model_Forum_Post::factory($this->last_post_id);\n\t}",
"public function lastTopic() {\n\t\treturn $this->topics()->orderBy(\"id\", \"asc\")->first();\n\t}",
"public function get_last_request(){\n\t\treturn $this->request_data;\n\t}",
"public final function last_error_message()\n {\n return isset($this->error) ? $this->error['message'] : '';\n }",
"protected function getMostRecentUnreadEmail()\n {\n if(empty($this->unreadInbox))\n {\n $this->fail('Unread Inbox is Empty');\n }\n\n return array_shift($this->unreadInbox);\n }",
"public function last() {\n\t\t$result = $this->get_result();\n\n\t\treturn array_pop( $result );\n\t}",
"public function getLastResponse() {\n\t\treturn $this -> data['lastResponse'];\n\t}",
"public function getMsg()\n {\n return $this->Msg;\n }",
"public function getLastRequest()\n {\n return $this->lastRequest;\n }",
"public function getLastRequest()\n {\n return $this->lastRequest;\n }",
"protected function lastEmailSent()\n {\n return end($this->emails);\n }",
"public function getLastLogin()\n {\n return $this->get(self::_LAST_LOGIN);\n }",
"public function getLastLogin()\n {\n return $this->get(self::_LAST_LOGIN);\n }",
"public function getLast()\n\t{\n\t\t$this->_db->setQuery(\"SELECT publish_down FROM $this->_tbl ORDER BY publish_down DESC LIMIT 1\");\n\t\treturn $this->_db->loadResult();\n\t}",
"public function getLastRequest($msgName)\n {\n return null;\n }",
"public function getLatestComment() {\n\t\t$lastComment = NULL;\n\t\tforeach ($this->comments as $comment) {\n\t\t\t$lastComment = $comment;\n\t\t}\n\t\treturn $lastComment;\n\t}",
"public function message()\n {\n return $this->msg;\n }",
"public function message()\n {\n return $this->msg;\n }",
"public function message()\n {\n return $this->msg;\n }",
"public function lastRequest()\n\t{\n\t\treturn $this->_source->lastRequest();\n\t}",
"public function GetLastRecord(){$this->LastPosts();return $this->lastrecord;}",
"public function getLastPost()\n\t{\n\t\t$table = new Zend_Db_Table(array('name'=>PrecurioTableConstants::FORUM_POSTS, 'rowClass'=>'Post'));\n\t\t$select = $table->select(false);\n\t\t\n\t\t$select->setTable($table)->setIntegrityCheck(false);\t\t\t\n\t\t\t\n\t\t$select = $select->from(array('a' => PrecurioTableConstants::FORUM_POSTS))\n\t\t\t->join(array('b' => PrecurioTableConstants::USERS), 'a.user_id = b.user_id', array('first_name', 'last_name'))\t\n\t\t\t->join(array('d' => PrecurioTableConstants::FORUM_TOPICS), 'd.id = a.topic_id', array())\n\t\t\t->join(array('c' => PrecurioTableConstants::FORUMS), 'c.id = d.forum_id', array())\n\t\t\t\t\t\t\n\t\t\t->where(\"a.active = 1 AND c.id = {$this->getId()}\")\n\t\t\t->order(\"a.id DESC\");\n\t\t\n\t\n\t\treturn $table->fetchRow($select);\n\t}",
"public function getLastRequest()\n {\n return $this->__getLastRequest();\n }",
"public function message()\r\n {\r\n return $this->message;\r\n }",
"public function message()\r\n {\r\n return $this->message;\r\n }",
"function ppmess_get_last_message_date($message_id, $post_id, $logged_user){\n\t\n\tglobal $wpdb;\n\t\n\t$query = \"SELECT date_created FROM {$wpdb->prefix}private_messages WHERE ((message_parent = $message_id OR ( message_parent = 0 AND message_id = $message_id))\n\t\t\tAND post_id = $post_id AND ( receiver_id = $logged_user OR sender_id = $logged_user )) ORDER BY date_created DESC LIMIT 1\";\n\t\t\t\n\t$result = $wpdb->get_results( $query, ARRAY_A );\n\t\n\tif($wpdb->num_rows == 1)\n\t\treturn $result[0];\n\telse \n\t\treturn FALSE;\t\n}",
"public function getLastRequest()\n {\n $last = end($this->transactions);\n\n return $last['request'];\n }",
"function getLastContext($conv_id){\n\t\tglobal $db;\n\t\t$statement = $db->prepare('SELECT watson_context FROM msg_conversation WHERE watson_context IS NOT NULL AND conv_id=:conv_id ORDER BY date DESC LIMIT 1');\n\t\t$statement->execute(array(':conv_id'=>$conv_id));\n\t\treturn $statement->fetch()['watson_context'];\n\t}",
"public function lastReply()\n {\n return $this->hasOne('App\\Reply')->latest();\n }",
"public function getLastLine()\n {\n $buffer = $this->getBuffer();\n $lines = preg_split('/\\r\\n|\\r|\\n/', $buffer);\n return array_pop($lines);\n }",
"public function lastMessage()\n\t{\n\t\t$data = $this->getDoctrine()->getRepository(Posting::class)->findBy(array(), ['id' => 'DESC'], 3);\n\t\t//$data = $posting->addOrderBy('id', 'desc')->take(3)->get();\n\t\treturn $this->render('page/main.html.twig', ['data' => $data]);\n\t}",
"final public function getLast() {\n\t\treturn null;\n\t}",
"public final function getLastErrorMsg() {\n return $this->lastErrorMsg;\n }",
"public function getLastQuery(): string\n {\n return array_values(array_slice($this->History, -1))[0];\n }",
"public function getLastEvent()\n {\n return $this->_lastEvent;\n }",
"public function get_message() {\n\n\t\t$entity = $this->get_current_entity();\n\n\t\tswitch ($entity) {\n\t\t\tcase self::$ARTICLE:\n\t\t\t\treturn $this->maybe_get_restricted_excerpt() .\n\t\t\t\t $this->maybe_get_restricted_message() .\n\t\t\t\t $this->maybe_get_before_html() .\n\t\t\t\t $this->maybe_get_login_form() .\n\t\t\t\t $this->maybe_get_after_html();\n\n\t\t\tcase self::$ARCHIVE:\n\t\t\t\treturn MKB_Options::option('restrict_topic_message');\n\n\t\t\tcase self::$HOME:\n\t\t\t\treturn MKB_Options::option('restrict_page_message');\n\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn '';\n\t}",
"public function getLast();",
"public function getLast();",
"public function mostraUltimaMensagem()\n { \n $arMsgSessao = $_SESSION['msg'];\n $stUltimaMensagem = $arMsgSessao[count($arMsgSessao)-1];\n return $stUltimaMensagem;\n }",
"private function retrieveMessage() : ?string {\n $message = [];\n\n // The regex to find the head of the message wrapper (message lies between head and foot wrapper)\n $messageHeadWrapperRegex = $this->buildRegex([\n self::REGEX_CONTENT_HEAD ,\n self::REGEX_MESSAGE_WRAPPER_BODY,\n \"(\\s{2})\"\n ], \"\", \"\");\n\n // The regex to find the foot of the message wrapper (message lies between head and foot wrapper)\n $messageFootWrapperRegex = $this->buildRegex([\n self::REGEX_CONTENT_HEAD,\n self::REGEX_MESSAGE_WRAPPER_BODY\n ], \"\", \"\");\n\n // The regex for querying the message, including its queried wrapper\n $messageRegex = $this->buildRegex([\n $messageHeadWrapperRegex,\n self::REGEX_ALL,\n $messageFootWrapperRegex\n ]);\n\n // Querying the message\n preg_match($messageRegex, $this->currentEmail, $message);\n\n // If the message not found, there is most likely no message, so return null\n // Use index \"4\", because the regex group which represents the message only is at index \"4\"\n if (!isset($message[4]))\n return null;\n\n // Return the quoted-printable decoded and trimmed message\n // Use index \"4\", because the regex group which represents the message only is at index \"4\"\n $message = quoted_printable_decode($message[4]);\n return trim($message);\n }",
"public function getLastLine()\n {\n return $this->lastLine;\n }",
"public function LastActivity()\n\t{\n\t\treturn $this->LastActivity;\n\t}",
"public function getLastResetWorldChatTime()\n {\n return $this->get(self::_LAST_RESET_WORLD_CHAT_TIME);\n }",
"public function message()\n {\n return $this->message;\n }",
"public function message()\n {\n return $this->message;\n }",
"public function message()\n {\n return $this->message;\n }",
"public function message()\n {\n return $this->message;\n }",
"public function message()\n {\n return $this->message;\n }",
"public function message()\n {\n return $this->message;\n }",
"public function message()\n {\n return $this->message;\n }",
"public function message()\n {\n return $this->message;\n }",
"public function message()\n {\n return $this->message;\n }"
] | [
"0.78238636",
"0.76291853",
"0.75569564",
"0.73905355",
"0.70998883",
"0.70667607",
"0.703985",
"0.70375454",
"0.7033407",
"0.70280385",
"0.6999804",
"0.6946482",
"0.6915974",
"0.6859133",
"0.6794395",
"0.6751393",
"0.66989756",
"0.6691588",
"0.65560114",
"0.6522138",
"0.64603263",
"0.64538306",
"0.62996376",
"0.6293512",
"0.62705594",
"0.6264784",
"0.6260789",
"0.625268",
"0.6224421",
"0.62170875",
"0.6213492",
"0.6180918",
"0.616202",
"0.6132716",
"0.6096141",
"0.60802513",
"0.607828",
"0.6061623",
"0.6055515",
"0.60429573",
"0.60160136",
"0.5998769",
"0.59983087",
"0.59982777",
"0.598809",
"0.5972651",
"0.5972651",
"0.59652567",
"0.59652066",
"0.5960535",
"0.59516484",
"0.59513766",
"0.5948379",
"0.59478706",
"0.59430873",
"0.59409106",
"0.5938233",
"0.5938233",
"0.59295356",
"0.59254396",
"0.59254396",
"0.59218323",
"0.5920315",
"0.591778",
"0.5908353",
"0.5908353",
"0.5908353",
"0.5886325",
"0.5879624",
"0.58758914",
"0.58696425",
"0.5856102",
"0.5856102",
"0.5855847",
"0.5855635",
"0.5847884",
"0.5846484",
"0.5846338",
"0.58373237",
"0.58350337",
"0.58337736",
"0.5832161",
"0.58292085",
"0.5828707",
"0.5824059",
"0.5824059",
"0.58234894",
"0.5814662",
"0.5805224",
"0.580404",
"0.57987845",
"0.57984686",
"0.57984686",
"0.57984686",
"0.57984686",
"0.57984686",
"0.57984686",
"0.57984686",
"0.57984686",
"0.57984686"
] | 0.6805047 | 14 |
/ Initialize action controller here | public function init()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function init()\n {\n /* Initialize action controller here */\n }",
"public function init()\n {\n /* Initialize action controller here */\n }",
"protected function initializeController() {}",
"protected function initializeAction() {}",
"protected function initializeAction() {}",
"protected function initializeAction() {}",
"protected function initAction()\n {\n }",
"protected function initializeAction() {\n\t\t/* Merge flexform and setup settings\n\t\t * \n\t\t */\n\t\t$this->settings['action'] = $this->actionMethodName;\n\t}",
"public function initializeAction() {}",
"public function initializeAction() {}",
"public function initializeAction() {}",
"public function initializeAction() {}",
"public function initializeAction() {}",
"public function initializeAction() {\n\n\t}",
"public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }",
"protected function initializeAction() {\n\t\t$this->akismetService->setCurrentRequest($this->request->getHttpRequest());\n\t}",
"public function __construct($controller,$action) {\n\t\tparent::__construct($controller, $action);\n\t\t\n\t}",
"public function init()\n {\n $controller = $this->router->getController();\n $action = $this->router->getAction();\n $params = $this->router->getParams();\n\n $objController = registerObject($controller);\n\n call_user_func_array([$objController, $action], $params);\n }",
"public function __construct($controller, $action) {\n parent::__construct($controller, $action); //parent is Controller.php\n }",
"protected function initAction()\r\n {\r\n $return = false;\r\n\r\n // parse request URI\r\n $parts_url = parse_url(strtolower(trim($_SERVER['REQUEST_URI'], '/')));\r\n // @TODO: fix\r\n $parts_url_array = explode('/', $parts_url['path']);\r\n list($this->controllerName, $this->itemId) = $parts_url_array;\r\n\r\n // parse method\r\n $this->requestMethod = strtolower($_SERVER['REQUEST_METHOD']);\r\n\r\n switch ($this->requestMethod) {\r\n case 'get':\r\n // default actions for GET\r\n if ($this->controllerName == 'login' || $this->controllerName == 'logout') {\r\n $this->actionName = $this->controllerName;\r\n $this->controllerName = 'users';\r\n } elseif (is_null($this->itemId)) {\r\n $this->actionName = 'index';\r\n } else {\r\n $this->actionName = 'view';\r\n }\r\n break;\r\n case 'post':\r\n // default action for POST\r\n $this->actionName = 'add';\r\n break;\r\n case 'put':\r\n // default action for PUT\r\n $this->actionName = 'edit';\r\n break;\r\n case 'delete':\r\n // default action for DELETE\r\n $this->actionName = 'delete';\r\n break;\r\n }\r\n\r\n if (!$this->controllerName) {\r\n $this->controllerName = 'main';\r\n }\r\n if (!$this->actionName) {\r\n $this->actionName = 'index';\r\n }\r\n\r\n // get, check & requre class\r\n $className = sprintf('mob%s', ucfirst($this->controllerName));\r\n $className = 'pages\\\\' . $className;\r\n \r\n if (class_exists($className)) {\r\n //create a instance of the controller\r\n $this->controller = new $className();\r\n\r\n //check if the action exists in the controller. if not, throw an exception.\r\n $actionName = sprintf('action%s', ucfirst($this->actionName));\r\n if (method_exists($this->controller, $actionName) !== false) {\r\n $this->action = $actionName;\r\n // set request params\r\n if ($this->itemId) {\r\n $this->controller->setParams(array('id' => $this->itemId));\r\n }\r\n $this->controller->setRequestParams($this->requestMethod);\r\n\r\n $return = true;\r\n } else {\r\n $this->controller->httpStatusCode = HTTP_STATUS_METHOD_NOT_ALLOWED;\r\n// throw new \\Exception('Action is invalid.');\r\n }\r\n } else {\r\n $this->controller = new clsMobController();\r\n $this->controller->httpStatusCode = HTTP_STATUS_NOT_FOUND;\r\n// throw new \\Exception('Controller class is invalid.');\r\n }\r\n\r\n return $return;\r\n }",
"public function __construct()\n {\n // Prepare the action for execution, leveraging constructor injection.\n }",
"public function __construct() {\n // filter controller, action and params\n $url = filter_input(INPUT_GET, 'url', FILTER_SANITIZE_URL); // $_GET['url']\n $params = explode('/', trim($url, '/'));\n\n // store first and seccond params, removing them from params list\n $controller_name = ucfirst(array_shift($params)); // uppercase classname\n $action_name = array_shift($params);\n\n require_once APP . 'config.php';\n\n // default controller and action\n if (empty($controller_name)) {\n $controller_name = AppConfig::DEFAULT_CONTROLLER;\n }\n if (empty($action_name)) {\n $action_name = AppConfig::DEFAULT_ACTION;\n }\n\n // load requested controller\n if (file_exists(APP . \"Controller/$controller_name.php\")) {\n require CORE . \"Controller.php\";\n require CORE . \"Model.php\";\n require APP . \"Controller/$controller_name.php\";\n $controller = new $controller_name();\n\n // verify if action is valid\n if (method_exists($controller, $action_name)) {\n call_user_func_array(array($controller, $action_name), $params);\n $controller->render(\"$controller_name/$action_name\"); // skipped if already rendered\n } else {\n // action not found\n $this->notFound();\n }\n } else {\n // controller not found\n $this->notFound();\n }\n }",
"public static function init() {\n\t\tself::setup_actions();\n\t}",
"protected function initializeAction()\n\t{\n\t\tparent::init('Form');\n\t}",
"public function initController()\n {\n $this->model = new AliveSettingServiceMeta();\n\n $this->middleware([\n\n ]);\n }",
"public function init() {\n\n $this->jobs = new Hb_Jobs();\n if ($this->_request->getActionName() == 'view') {\n\n $this->_request->setActionName('index');\n }\n\n $this->searchParams = $this->_request->getParams();\n $this->view->searchParams = $this->searchParams;\n\n $this->view->actionName = $this->_request->getActionName();\n }",
"protected function initializeAction()\n {\n $this->extKey = GeneralUtility::camelCaseToLowerCaseUnderscored('BwrkOnepage');\n /** @var LanguageAspect $languageAspect */\n $languageAspect = GeneralUtility::makeInstance(Context::class)->getAspect('language');\n $this->languageUid = $languageAspect->getId();\n }",
"protected function initializeAction()\n {\n parent::initializeAction();\n $this->customer = SubjectResolver::get()\n ->forClassName(Customer::class)\n ->forPropertyName('user')\n ->resolve();\n }",
"public function initialize()\n {\n parent::initialize();\n $this->loadComponent('RequestHandler');\n $this->loadComponent('Flash');\n $this->loadComponent('Cookie');\n $this->cors();\n\n $currentController = $this->request->getParam('controller');\n // pr($currentController); die();\n if($currentController == 'Tenants'){\n $currentController = 'TenantUsers';\n }\n if($currentController == 'CorporateClients'){\n $currentController = 'CorporateClientUsers';\n // pr($currentController);die();\n }\n // $currentController = $this->request->params['controller'];\n $loginAction = $this->Cookie->read('loginAction');\n if(!$loginAction){\n $loginAction = ['controller' => $currentController,'action' => 'login'];\n }\n // pr($loginAction);die;\n $this->loadComponent('Auth',[\n 'loginAction' => ['controller' => $currentController,'action' => 'login'],\n 'authenticate' => [\n 'Form' =>\n [\n 'userModel' => $currentController,\n 'fields' => ['username' => 'email', 'password' => 'password']\n ]\n ],\n 'authorize'=> ['Controller'],\n 'loginAction' => $loginAction,\n 'loginRedirect' => $loginAction,\n 'logoutRedirect' => $loginAction \n\n ]);\n // $this->loadComponent('Auth', [\n\n // 'unauthorizedRedirect' => false,\n // 'checkAuthIn' => 'Controller.initialize',\n\n // // If you don't have a login action in your application set\n // // 'loginAction' to false to prevent getting a MissingRouteException.\n // 'loginAction' => false\n // ]);\n /*\n * Enable the following components for recommended CakePHP security settings.\n * see https://book.cakephp.org/3.0/en/controllers/components/security.html\n */\n }",
"public function init() {\n\t\t$this->load_actions();\n\t}",
"public function init()\r\n {\r\n\r\n /* Initialize action controller here */\r\n\r\n //=====================================must add in all Controller class constructor ===================================//\r\n if(defined('SITEURL')) $this->site_url = SITEURL;\r\n if(defined('SITEASSET')) $this->site_asset = SITEASSET;\r\n $this->view->site_url = $this->site_url;\r\n $this->view->site_asset = $this->site_asset;\r\n Zend_Loader::loadClass('Signup');\r\n Zend_Loader::loadClass('User');\r\n Zend_Loader::loadClass('Request');\r\n //Zend_Loader::loadClass('mailerphp');\r\n\t\t//Zend_Loader::loadClass('Permission');\r\n\r\n\r\n //-----------------------------------------------authenticate logged in user---------------------------------------------//\r\n Zend_Loader::loadClass('LoginAuth');\r\n $this->view->ob_LoginAuth = $this->sessionAuth = new LoginAuth();\r\n\r\n $this->sessionAuth->login_user_check();\r\n\r\n $this->sessionAuth->cookie_check();\r\n $this->view->server_msg = $this->sessionAuth->msg_centre();\r\n\r\n //-----------------------------------------------authenticate logged in user---------------------------------------------//\r\n unset($_SESSION['tranzgo_session']['export_list']);\r\n $this->view->ControllerName = $this->_request->getControllerName();\r\n $this->view->page_id = ($_SESSION['tranzgo_session']['role_id']==1)?'5':'7';\r\n //______________________________________must add in all Controller class constructor _____________________________________//\r\n\r\n\r\n }",
"public function __construct() {\n\t\t\t$this->init_globals();\n\t\t\t$this->init_actions();\n\t\t}",
"public function __construct()\n\t{\n\t\t$this->actionable = \"\";\n\t\t$this->action_taken = \"\";\n\t\t$this->action_summary = \"\";\n\t\t$this->resolution_summary = \"\";\n\t\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}",
"public function __init()\n\t{\n\t\t// This code will run before your controller's code is called\n\t}",
"function __construct()\n\t\t{\n\t\t\tparent::__construct();\n\t\t\t$this->_actionModel = new Action_Model();//khoi tao class\n\t\t}",
"protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}",
"protected function initializeAction() {\t\n\t\t$this->persdataRepository = t3lib_div::makeInstance('Tx_PtConference_Domain_Repository_persdataRepository');\n\t}",
"public function __construct()\n\t{\n\t\t$this->actionable = \"\";\n\t\t$this->action_taken = \"\";\n\t\t$this->action_summary = \"\";\n\t\t$this->media_values = array(\n\t\t\t101 => Kohana::lang('ui_main.all'),\n\t\t\t102 => Kohana::lang('actionable.actionable'),\n\t\t\t103 => Kohana::lang('actionable.urgent'),\n\t\t\t104 => Kohana::lang('actionable.action_taken')\n\t\t);\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}",
"public function __construct() {\n\n list($null,$controller, $action, $id) = explode(\"/\", $_SERVER['PATH_INFO']);\n \n $this->urlValues['base'] = \"http://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n $this->urlValues['controller'] = $controller ? $controller : \"home\";\n $this->urlValues['action'] = $action;\n $this->urlValues['id'] = $id;\n\n $this->controllerName = strtolower($this->urlValues['controller']);\n $this->controllerClass = ucfirst(strtolower($this->urlValues['controller'])) . \"Controller\";\n\n if ($this->urlValues['action'] == \"\") {\n $this->action = \"index\";\n } else {\n $this->action = $this->urlValues['action'];\n }\n }",
"protected function _initControllers()\n\t{\n\t\treturn;\n\t}",
"public function init()\n {\n $this->vars['CRUD']['Object'] = $this;\n $this->kernel = kernel();\n\n // Dynamic initialization\n if (! $this->modelName) {\n $modelRefl = new ReflectionClass($this->modelClass);\n $this->modelName = $modelRefl->getShortName();\n }\n\n\n if (! $this->crudId) {\n $this->crudId = \\Phifty\\Inflector::getInstance()->underscore($this->modelName);;\n }\n if (! $this->templateId) {\n $this->templateId = $this->crudId;\n }\n\n // Derive options from request\n if ($request = $this->getRequest()) {\n if ($useFormControls = $request->param('_form_controls')) {\n $this->actionViewOptions['submit_btn'] = true;\n $this->actionViewOptions['_form_controls'] = true;\n }\n }\n\n $this->reflect = new ReflectionClass($this);\n $this->namespace = $ns = $this->reflect->getNamespaceName();\n\n // XXX: currently we use FooBundle\\FooBundle as the main bundle class.\n $bundleClass = \"$ns\\\\$ns\";\n if (class_exists($bundleClass)) {\n $this->bundle = $this->vars['Bundle'] = $bundleClass::getInstance($this->kernel);\n } else {\n $bundleClass = \"$ns\\\\Application\";\n $this->bundle = $this->vars['Bundle'] = $bundleClass::getInstance($this->kernel);\n }\n\n $this->vars['Handler'] = $this;\n $this->vars['Controller'] = $this;\n\n // anyway, we have the model classname, and the namespace, \n // we should be able to registerRecordAction automatically, so we don't have to write the code.\n if ($this->registerRecordAction) {\n $self = $this;\n $this->kernel->event->register('phifty.before_action',function() use($self) {\n $self->kernel->action->registerAction('RecordActionTemplate', array(\n 'namespace' => $self->namespace,\n 'model' => $self->modelName,\n 'types' => (array) $self->registerRecordAction\n ));\n });\n }\n\n\n $this->initPermissions();\n\n /*\n * TODO: Move this to before render CRUD page, keep init method simple\n\n if ( $this->isI18NEnabled() ) {\n $this->primaryFields[] = 'lang';\n }\n */\n $this->initNavBar();\n }",
"public function _initialize()\n {\n $this->cate=CONTROLLER_NAME;\n }",
"protected function initializeActionEntries() {}",
"protected function initializeAction() {\n\t\t$this->feusers = $this->feusersRepository->findByUid( $GLOBALS['TSFE']->fe_user->user['uid'] ) ;\n\t\t$this->schule = $this->feusers->getSchule();\n\t\n\t\t$this->extKey = $this->request->getControllerExtensionKey();\n\t\t$this->extPath = t3lib_extMgm::extPath($this->extKey);\n\t\n\t\t$this->importClassFile = $this->extPath.'Classes/tmp/class.importtext.php';\n\t\t$this->importClass = 'ImportText';\n\t \n\t\tif ( $this->settings[pidAjaxContainerKlassenuebersicht] > 0) $this->pidAjaxContainerKlassenuebersicht = (int) $this->settings[pidAjaxContainerKlassenuebersicht];\n\t\n\t}",
"public function init(){\r\n\t$this->_helper->_acl->allow('public',NULL);\r\n\t$this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');\r\n\t$this->_contexts = array('xml','json');\r\n\t$this->_helper->contextSwitch()\r\n\t\t->setAutoDisableLayout(true)\r\n\t\t->addActionContext('oneto50k',$this->_contexts)\r\n\t\t->addActionContext('index',$this->_contexts)\r\n\t\t->initContext();\r\n\t}",
"private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}",
"public function initBaseController();",
"public function init() {\n $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');\n\t\t$this->_helper->acl->allow('public',null);\n\t\t$this->_helper->contextSwitch()\n\t\t\t ->setAutoDisableLayout(true)\n\t\t\t ->addActionContext('index', array('xml','json'))\n ->initContext();\n\t}",
"public function __construct()\n {\n // Call the CI_Controller constructor\n parent::__construct();\n }",
"public function __construct()\n\t{\t\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}",
"public function initAction() : object\n {\n /**\n * Show all movies.\n */\n $response = $this->app->response;\n return $response->redirect(\"cms/posts\");\n }",
"protected function initializeAction() {\n\t\t$this->frontendUserRepository = t3lib_div::makeInstance('Tx_GrbFeusermanager_Domain_Repository_FrontendUserRepository');\n\t}",
"public function contentControllerInit()\n\t{\n\t}",
"protected function initializeAction()\n {\n parent::initializeAction();\n\n $query = GeneralUtility::_GET('q');\n if ($query !== null) {\n $this->request->setArgument('q', $query);\n }\n }",
"public function __construct()\n {\n $this->setAction('index', array('idle', 'toggleEnabled', 'expunge'));\n }",
"public static function init() {\n\t\t$_GET = App::filterGET();\n\t\t\n\t\t// Checken of er params zijn meegegeven\n\t\ttry {\n\t\t\tif (count($_GET) == 0) {\n\t\t\t\t$_GET[0] = '';\n\t\t\t}\n\t\t\t\n\t\t\t// Is de eerste param een controller ? Anders een pageView\n\t\t\tif (self::isController($_GET[0])) {\n\t\t\t\t$controllerName = self::formatAsController($_GET[0]);\n\t\t\t\t$controller = self::loadController($controllerName);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Er is sprake van een pageview\n\t\t\t\t$controllerName = 'PagesController';\n\t\t\t\t$controller = self::loadController($controllerName);\n\t\t\t}\n\t\t\t\n\t\t\t$action = self::getAction($controller);\n\t\t\t$controller->setAction($action);\n\n\t\t\t// Try to exec the action\n\t\t\ttry {\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\tcatch(ActionDoesNotExistException $ex) {\n\n\t\t\t\techo $action;\n\t\t\t\t// Action bestaat niet\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\t\n\t\t\t\t// Als development is ingeschakeld, dan de ware error tonen, anders een 404 pagina\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('invalidAction');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\tcatch(MissingArgumentsException $ex) {\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\t\n\t\t\t\t// Als development is ingeschakeld, dan de ware error tonen, anders een 404 pagina\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('missingArguments');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\t\n\t\t\t// Try to render the view\n\t\t\ttry {\n\t\t\t\t$controller->render();\n\t\t\t}\n\t\t\tcatch(ViewDoesNotExistException $ex) {\n\t\t\t\t// View bestaat niet\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('invalidView');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t\t\n\t\t\t\t$controller->render();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tcatch(NoValidTemplateException $ex) {\n\t\t\techo 'Invalid template';\n\t\t}\n\t\tcatch(IsNotControllerException $ex) {\n\t\t\techo 'Controller not found';\n\t\t}\n\t}",
"public function init()\r\n { \r\n //date_default_timezone_set('America/Phoenix');\r\n $ajaxContext = $this->_helper->getHelper('AjaxContext');\r\n\t$ajaxContext->addActionContext('list', 'html')\r\n ->addActionContext('edit', 'html')\r\n ->addActionContext('dashboard', 'html')\r\n ->addActionContext('handler', 'html')\r\n ->initContext();\r\n $auth = Zend_Auth::getInstance();\r\n $action = Zend_Controller_Front::getInstance()->getRequest()->getActionName();\r\n $type = $this->getRequest()->getParam('type');\r\n if (!$auth->hasIdentity() && $action!='handler') {\r\n //echo \"THIS IS AN ERROR: \".$action;\r\n $this->_redirect('login', array('UseBaseUrl' => true));\r\n }\r\n }",
"public function __construct()\n {\n $this->model = new MainModel();\n $this->params[\"pagination\"][\"totalItemsPerPage\"] = 5;\n view()->share ('controllerName', $this->controllerName);//đặt controllerName cho all action\n }",
"public function __construct()\n\t{\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}",
"public function __construct()\n\t{\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}",
"public function init() {\n $this->_temporizador = new Trf1_Admin_Timer ();\n $this->_temporizador->Inicio();\n\n /* Initialize action controller here */\n $this->view->titleBrowser = 'e-Sisad';\n }",
"public function __construct()\n\t{\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}",
"function __construct()\n {\n parent::Controller();\n }",
"public function controller()\n\t{\n\t\n\t}",
"public function init() {\n\t\t\t\t\t\t$this->view->controller = $this->_request->getParam ( 'controller' );\n\t\t\t\t\t\t$this->view->action = $this->_request->getParam ( 'action' );\n\t\t\t\t\t\t$this->getLibBaseUrl = new Zend_View_Helper_BaseUrl ();\n\t\t\t\t\t\t$this->GetModelOrganize = new Application_Model_ModOrganizeDb ();\n\t\t\t\t\t\t$this->_helper->ajaxContext->addActionContext('deleteOrganisme1','json')->initContext();\n\t\t\t\t\t\t// call function for dynamic sidebar\n\t\t\t\t\t\t$this->_Categories = new Application_Model_ModCatTerm ();\n\t\t\t\t\t\t$parent_id = $this->_getParam ( 'controller' );\n\t\t\t\t\t\t$this->view->secondSideBar = $this->_Categories->showCateParent ( $parent_id );\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}",
"public function initializeAction() {\t\t\n\t\t$this->contactRepository = t3lib_div::makeInstance('Tx_Addresses_Domain_Repository_ContactRepository');\t\n\t}",
"public function init() {\n\t$this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');\n\t$this->_helper->acl->allow('public',null);\n\t$this->_helper->contextSwitch()\n\t\t->setAutoDisableLayout(true)\n\t\t->addActionContext('index', array('xml','json'))\n\t\t->addActionContext('mint', array('xml','json'))\n\t\t->initContext();\n }",
"public function __construct()\n {\n if (get_called_class() != 'ApplicationController') {\n $this->_set_default_layout();\n $this->_vars = new stdClass();\n $this->_init();\n }\n }",
"public function initializeAction() {\n parent::initializeAction();\n $this->umDiv = new Tx_Magenerator_Domain_UserManagement_Div();\n }",
"public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }",
"public function actionInit()\n {\n $this->initRoles($this->roles);\n $this->initPermissions($this->permissions);\n $this->initDependencies($this->dependencies);\n }",
"public function getControllerAction() {}",
"public function __construct($action = '') {\n\t\t$this->app = Application::app();\n\t\t$this->setAction($action);\n\t}",
"function initialize(Controller $controller) {\n $this->controller=&$controller;\n \t}",
"public function __construct($controller, $action) {\n parent::__construct($controller, $action);\n $this->loadModel('Baskets');\n $this->loadModel('Orders');\n $this->loadModel('Messages');\n $this->loadModel('Products');\n\n if(Session::exists(BUYER_SESSION_NAME)) {\n $this->view->totalProductInBasket = $this->BasketsModel->countProductInBasket();\n $this->view->totalOrders = $this->OrdersModel->countSentOrder();\n $this->view->msgCount = $this->MessagesModel->unReadMessages();\n } elseif(Session::exists(STORE_SESSION_NAME)) {\n $this->view->msgCount = $this->MessagesModel->unReadMessages();\n $this->view->newOrders = $this->OrdersModel->newOrders(Session::get(STORE_SESSION_NAME));\n }\n\n $this->view->setLayout('details');\n }",
"function initialize(Controller $controller) {\n $this->controller = $controller;\n }",
"public function __construct() {\n if (isset($_GET['rc'])) {\n $this->url = rtrim($_GET['rc'], '/'); // We don't want no empty arg\n $this->args = explode('/', $this->url);\n }\n \n // Load index controller by default, or first arg if specified\n $controller = ($this->url === null) ? 'null' : array_shift($this->args);\n $this->controllerName = ucfirst($controller);\n\n // Create controller and call method\n $this->route();\n // Make the controller display something\n $this->controllerClass->render();\n }",
"public function __construct() {\r\n\t\t\r\n\t\tSession::init();\n\t\tif (!Session::get('local'))\n\t\t\tSession::set('local', DEFAULT_LANGUAGE);\r\n\t\t\r\n\t\t$this->getUrl();\r\n\t\t\r\n\t\t//No controller is specified.\r\n\t\tif (empty($this->url[0])) {\r\n\t\t\t$this->loadDefaultController();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$this->loadCurrentController();\r\n\t\t$this->callControllerMethod();\r\n\r\n\t}",
"public function __construct() {\n $this->urlValues = $_GET;\n if (!isset($this->urlValues['c'])) {\n $this->controllerName = \"home\";\n $this->controllerClass = \"HomeController\";\n } else {\n $this->controllerName = strtolower($this->urlValues['c']);\n $this->controllerClass = ucfirst(strtolower($this->urlValues['c'])) . \"Controller\";\n }\n \n if (!isset($this->urlValues['a'])) {\n $this->action = \"index\";\n } else {\n $this->action = $this->urlValues['a']; \n }\n }",
"public function preAction() {\n $this->apiBrowser = new ApiBrowser();\n\n $basePath = $this->request->getBasePath();\n $this->namespaceAction = $basePath . '/namespace/';\n $this->classAction = $basePath . '/class/';\n $this->searchAction = $basePath . '/search';\n }",
"function __construct($controller, $action)\n {\n global $inflect;\n\n $this->renderPage = true;\n $this->renderHeader = true;\n \t\n\t\t$this->requireUser = false;\n\t\t \n $this->_controller = ucfirst($controller);\n $this->_action = $action;\n \n $model = ucfirst($inflect->singularize($controller));\n $this->$model = new $model;\n\n $this->_template = new Template($controller, $action);\n }",
"public function init()\n {\n $this->ctrlModel = new Admin_Model_Acl_ControllersActions();\n $this->dbCtrl = new Admin_Model_DbTable_Acl_ModuleController();\n }",
"public function setup_actions() {}",
"public function init(){\r\n\t\t$this->_data = $this->_request->getParams();\r\n $controller = $this->_data['controller']; //Get controller\r\n $action = $this->_data['action']; //Get action\r\n \r\n $loadfunction = new Default_Model_Common();\r\n foreach($loadfunction->loadFunction($controller) as $value){\r\n if($action == $value['action']){\r\n $load = new $value['model_load']();\r\n $this->view->$value['varname'] = $load->$value['function_load']();\r\n }\r\n }\r\n\r\n $this->view->lang = Zend_Registry::get(\"lang\"); //load language\r\n \r\n //List menu\r\n $listmenu = Zend_Registry::get(\"listmenu\");\r\n $this->view->listmenu = $listmenu;\r\n \r\n $this->view->selectaccount = ' class=\"selected\"';\r\n }",
"function __construct() {\n\t\t\n\t\tparent::__construct();\n\t\t\n\t\t// skip the timestamp check for this app\n\t\tSession::check(true);\n\t\t$this->data[\"showActions\"] = true;\n\t\t$this->data[\"csrfToken\"] = CSRF::generateToken();\n\t\t\n\t}",
"abstract public function getControllerAction();",
"public function _construct($controller,$view){\r\n $this->controller = $controller;\r\n }",
"public function initialize()\n { $model= new \\Yabasi\\ModelController();\n $this->setSchema($model->model());\n $this->setSource(\"notification\");\n }",
"protected function __construct() {\n\t\t\tadd_action( 'init', array( $this, 'action__init' ), 11 );\n\t\t}",
"public function init()\n {\n $this->ctrlActionModel = new Admin_Model_Acl_ControllersActions();\n $this->dbController = new Admin_Model_DbTable_Acl_ModuleController();\n $this->dbAction = new Admin_Model_DbTable_Acl_Action();\n }",
"public function init()\n {\n $this->projectController->init();\n }",
"function __construct() {\n\t\t\t$this->register_actions();\t\t\n\t\t\t$this->register_filters();\n\t\t}",
"public function __construct() {\n // Call Module constructur\n parent::__construct();\n\n // Add additional route\n $this->_actions['GET']['/people/:id'] = 'people';\n }",
"public function initialize()\n {\n $model= new \\Yabasi\\ModelController();\n $this->setSchema($model->model());\n $this->setSource(\"refund\");\n }",
"function Controller()\n\t{\t\t\n\t\t$this->method = \"showView\";\n\t\tif (array_key_exists(\"method\", $_REQUEST))\n\t\t\t$this->method = $_REQUEST[\"method\"];\n\t\t\t\t\n\t\t$this->icfTemplating = new IcfTemplating();\n\t\t$this->tpl =& $this->icfTemplating->getTpl();\n\t\t$this->text =& $this->icfTemplating->getText();\t\t\n\t\t$this->controllerMessageArray = array();\n\t\t$this->pageTitle = \"\";\n\t\t$this->dateFormat = DateFormatFactory::getDateFormat();\n\t\t$this->controllerData =& $this->newControllerData();\n\t}",
"function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}",
"function __construct($module,$controller,$action) {\n\t\t$this->action = $action;\n\t\t$this->controller = preg_replace('%Controller$%','',$controller);\n\t\t$this->module = $module;\n\n\t\t$jadeCacheDir = J::path(\"App/Cache/Jade/$this->module/$this->controller\");\n\t\t(is_dir($jadeCacheDir)) || mkdir($jadeCacheDir,0777,true);\n\t\t$this->cacheFile = J::path(\"$jadeCacheDir/$this->action.php\");\n\t\t$this->viewFile = J::path(\"App/Modules/$this->module/Views/$this->controller/$this->action.jade\");\n\t}",
"public function __construct()\n {\n $url = $this->getUrl();\n // Look in controllers folder for first value and ucwords(); will capitalise first letter \n if (isset($url[0]) && file_exists('../app/controllers/' . ucwords($url[0]) . '.php')) {\n $this->currentController = ucwords($url[0]); // Setting the current controllers name to the name capitilised first letter\n unset($url[0]); \n }\n\n // Require the controller\n require_once '../app/controllers/' . $this->currentController . '.php';\n // Taking the current controller and instantiating the controller class \n $this->currentController = new $this->currentController;\n // This is checking for the second part of the URL\n if (isset($url[1])) {\n if (method_exists($this->currentController, $url[1])) { // Checking the seond part of the url which is the corresponding method from the controller class\n $this->currentMethod = $url[1];\n unset($url[1]);\n }\n }\n\n // Get params, if no params, keep it empty\n $this->params = $url ? array_values($url) : []; \n\n // Call a callback with array of params\n call_user_func_array([$this->currentController, $this->currentMethod], $this->params);\n }",
"public function __construct() {\n\t\tparent::__construct();\n\t\t$this->view = new ViewController();\t\t\n\t}",
"public function __construct()\n {\n $this->controller = new Controller;\n $this->error_message = 'bad request or duplicate data';\n }",
"public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }"
] | [
"0.89566046",
"0.89566046",
"0.82057846",
"0.80040884",
"0.80040884",
"0.8004028",
"0.7928566",
"0.7802862",
"0.7750365",
"0.7750365",
"0.7750365",
"0.7750365",
"0.7750365",
"0.7741994",
"0.76497424",
"0.7542271",
"0.7541656",
"0.7458589",
"0.7430627",
"0.7382884",
"0.73493266",
"0.73307425",
"0.7321889",
"0.73055863",
"0.7295852",
"0.7274981",
"0.72531754",
"0.7246773",
"0.7212456",
"0.72057885",
"0.71661454",
"0.71535975",
"0.7130195",
"0.7116122",
"0.70873964",
"0.7080964",
"0.7078719",
"0.70654655",
"0.7053619",
"0.7048942",
"0.7036025",
"0.7028192",
"0.6996098",
"0.69914645",
"0.6983108",
"0.69822043",
"0.6978827",
"0.69710267",
"0.69653803",
"0.6934731",
"0.69341296",
"0.6926329",
"0.692468",
"0.69113386",
"0.6909758",
"0.6896174",
"0.68904704",
"0.6874338",
"0.68700373",
"0.68700373",
"0.6862786",
"0.6847179",
"0.6844484",
"0.68443036",
"0.68056643",
"0.6804595",
"0.68018633",
"0.67917275",
"0.6769771",
"0.676602",
"0.6765842",
"0.67582476",
"0.67257833",
"0.6721477",
"0.6721169",
"0.67196625",
"0.67082113",
"0.6707143",
"0.6706214",
"0.67023355",
"0.6700337",
"0.669937",
"0.6695276",
"0.66930395",
"0.6692887",
"0.6688026",
"0.66866106",
"0.66839683",
"0.6674853",
"0.6667438",
"0.6658782",
"0.66509074",
"0.6642763",
"0.66400504",
"0.6634305",
"0.6610988",
"0.6610453",
"0.66071516",
"0.66062886",
"0.6600459",
"0.6599095"
] | 0.0 | -1 |
Get show expired bindings | public function getShowExpired(): ?string
{
return $this->getParameter('showExpired');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function listExpired() \n\t{\n\t\treturn $this->list(true);\n\t}",
"public function getExpired();",
"public static function getExpiredInfoConnectors()\n\t{\n\t\t$filter = array(\n\t\t\t'<EXPIRES' => \\Bitrix\\Main\\Type\\DateTime::createFromTimestamp(time())\n\t\t);\n\n\t\t$result = self::getInfoConnectors($filter);\n\n\t\treturn $result;\n\t}",
"function getExpiredList( &$pParamHash ) {\n\t\t$pParamHash['get_expired'] = TRUE;\n\t\treturn( $this->getList( $pParamHash ));\n\t}",
"public function getExpired()\n {\n return Item::join('item_batches', 'items.id', '=', 'item_batches.item_id')\n ->join('measurement_units', 'items.unit_id', '=', 'measurement_units.id')\n ->where('item_batches.expiry_date', '<', Carbon::now())\n ->where('item_batches.current_quantity', '!=', 0)\n ->select('items.description', 'item_batches.current_quantity', 'measurement_units.short_name', 'item_batches.expiry_date')\n ->get();\n }",
"public function onlyExpired()\n {\n return $this->withoutGlobalScope(ExpirationScope::class)\n ->where($this->model->getExpirationAttribute(), '<=', Carbon::now());\n }",
"public function getExpired() {\n\t\t\n\t}",
"public function findExpiredRegistrationsDataProvider() {\n\t\treturn array(\n\t\t\t'allRegistrationsExpired' => array(\n\t\t\t\t1402826400, /* 15.06.2014 10:00 */\n\t\t\t\t3\n\t\t\t),\n\t\t\t'noRegistrationsExpired' => array(\n\t\t\t\t1402736400, /* 14.06.2014 09:00 */\n\t\t\t\t0\n\t\t\t),\n\t\t\t'nowIs1030Am' => array(\n\t\t\t\t1402741800, /* 14.06.2014 10:30 */\n\t\t\t\t1\n\t\t\t),\n\t\t);\n\t}",
"public function scopeExpired($query) {\n return $query->where('status', 'expired');\n }",
"protected function getNotExpiredStatement() {}",
"public static function getExpiredProfiles()\n\t{\n\n\t\treturn self::where('status', '=', 'expired');\n\n\t}",
"public function findAllExpired()\n {\n $queryBuilder = $this->createQueryBuilder('r');\n $date = date('Y-m-d', strtotime(\"-30 days\"));\n\n $queryBuilder\n ->where('r.validated = :state')\n ->setParameter('state', 0)\n ->andWhere('r.addedOn <= :date')\n ->setParameter('date', new \\DateTime($date));\n\n return $queryBuilder\n ->getQuery()\n ->getResult()\n ;\n }",
"public static function whereNotExpired()\n {\n return self::where('expiration_date', '>', date('Y-m-d'));\n }",
"public function getExpired()\r\n {\r\n return $this->expired;\r\n }",
"public function expired() {\n\n $data = array();\n $data['result'] = $this->property_model->fetchAll(getLoginUserId(), NULL, TRUE);\n $data['title'] = \"Expired Properties\";\n \n $this->render('admin/property/expired', $data);\n }",
"public function get_inactive_days()\n {\n $obj = new View();\n $obj->view('json', [\n 'msg' => ['inactive_days' => $this->config['days_inactive']]\n ]);\n }",
"public function get_expired_resource_ids() {\n $sql = 'SELECT id\n FROM resources\n WHERE is_allocated = 1\n AND expires_at < datetime(\"now\", \"localtime\")';\n\n $query = $this->pdo->prepare($sql);\n $query->execute();\n\n $return_ids = [];\n while ($row = $query->fetch()) {\n $return_ids[] = (int) $row['id'];\n }\n\n return $return_ids;\n }",
"public function withExpired()\n {\n return $this->withoutGlobalScope(ExpirationScope::class);\n }",
"public function getCredentialsExpired()\r\n {\r\n return $this->credentials_expired;\r\n }",
"public function providerInvalidResponse(): array {\n return [\n 'expired' => [\n -86400,\n ],\n 'fresh' => [\n 86400,\n ],\n ];\n }",
"function getAllPlksExpiredWorkers(){\n\t\t\t$sqlQuery = \"SELECT * FROM workers WHERE wkr_permitexp < CURDATE() \n\t\t\t\t\t\t \t\tAND wkr_transtatus IN ('4', '6', '7')\t\t\t\n\t\t\t\t\t\t \t AND wkr_status = 1\n\t\t\t\t\t\t \t\tAND wkr_id NOT IN(\n\t\t\t\t\t\t\t\t\tSELECT permit_wkrid FROM wkr_updatepermit WHERE permit_progress <> 'complete'\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t \t\tORDER BY wkr_permitexp\";\t\n\t\t\t\n\t\t\treturn $this->db->query($sqlQuery);\n\t\t}",
"public static function get_expired_parking_history() {\n return ParkingHistory::where(\"is_towed\", \"=\", 1)->with(\"parking\")->with(\"vehicle.user\")->get()->toArray();\n }",
"public function getExpiredAttribute()\n {\n return $this->subscription_payment\n && ! is_null($this->paid_at)\n && $this->paid_at->lessThan(now()->subDays(60))\n && (is_null($this->payments_required) || $this->payments_made < $this->payments_required);\n }",
"final public static function ExpiredAwaitingAuthorization()\n {\n return self::get(184);\n }",
"public function onlyEternal()\n {\n return $this->withoutGlobalScope(ExpirationScope::class)\n ->whereNull($this->model->getExpirationAttribute());\n }",
"public function toBeExpired(): \\Illuminate\\Http\\JsonResponse\n {\n $today = new \\DateTime('now');\n $from = $today->format('Y-m-d');\n $end = $today->add(new \\DateInterval('P30D'))->format('Y-m-d');\n $clients = $this->client->whereBetween('membership_expiry_date', [$from, $end])->get();\n if(!$clients) {\n abort(204);\n }\n \n return response()->json($clients);\n }",
"protected function collectExpiredLoginHashes()\n {\n $hashes = RememberLoginHash::get()->filter([\n 'ExpiryDate:LessThan' => date('Y-m-d H:i:s')\n ]);\n $hashes->removeAll();\n }",
"protected function isReservedButExpired()\n {\n $expiration = Carbon::now()->subSeconds($this->retryAfter)->getTimestamp();\n\n return [\n 'reservedAt' => [ '$lte' => $expiration ]\n ];\n }",
"public function listExpiringWithin($days = 30) \n\t{\n $this->api->setParam('DaysToExpired',$days);\n $this->api->setParam('Tab','ExpiringNames');\n\t\treturn $this->api->call(['command' => 'GetDomains'])->response();\n\t}",
"public function getTimerBindings(): array\n {\n return $this->timers;\n }",
"public function getExpiredAttribute()\n {\n return $this->hasExpired();\n }",
"public function is_expired()\n {\n }",
"public function getOnHoldExpiration()\n {\n return $this->getParameter('onHoldExpiration');\n }",
"public function getUnexpiredContents()\n {\n return $this->reader\n ->addFilter([$this, 'filterByDate'])\n ->addSortBy([$this, 'orderByDate'])\n ->fetchAssoc($this->associativeMap);\n }",
"function isExpired() {\n return $this->expired;\n }",
"protected function collectImplicitlyExpiredSessions()\n {\n $sessions = LoginSession::get()->filter([\n 'Persistent' => true,\n 'LoginHash.ExpiryDate:LessThan' => date('Y-m-d H:i:s')\n ]);\n $sessions->removeAll();\n }",
"public function getExpiration();",
"function listUserTimedoutUsedkeys($username) {\r\n\t\t$query = \"SELECT * FROM \".TBL_USED_KEYS.\" WHERE username = :username AND status = 'timedout'\";\r\n\t\t$stmt = $this->connection->prepare($query);\r\n\t\t$stmt->execute(array(':username' => $username));\r\n\t\t$dbarray = $stmt->fetch(PDO::FETCH_ASSOC);\r\n\t\t$count = $stmt->rowCount();\r\n\t\tif(!$dbarray || $count < 1){\r\n\t\t\treturn 1; // failure\r\n\t\t} else {\r\n\t\t\treturn $dbarray; // success\r\n\t\t}\r\n\t}",
"public function clean_expired_keys()\n {\n }",
"public function removeExpired();",
"public function revokeExpiredPermissions()\n {\n $expiredPermissions = $this->permissions()->wherePivot('expires', '<', Carbon::now())->get();\n\n if ($expiredPermissions->count() > 0) {\n return $this->permissions()->detach($expiredPermissions->modelKeys());\n }\n }",
"public function is_expired() {\n\t\treturn $this->data['created_at'] + HOUR_IN_SECONDS < ITSEC_Core::get_current_time_gmt();\n\t}",
"public function isExpired() {}",
"public function getExpiringSoon()\n {\n return Item::join('item_batches', 'items.id', '=', 'item_batches.item_id')\n ->join('measurement_units', 'items.unit_id', '=', 'measurement_units.id')\n ->where('item_batches.expiry_date', '<', Carbon::now()->addMonths(3))\n ->where('item_batches.expiry_date', '>', Carbon::now())\n ->where('item_batches.current_quantity', '!=', 0)\n ->select('items.description', 'item_batches.current_quantity', 'measurement_units.short_name', 'item_batches.expiry_date')\n ->get();\n }",
"function fa_status_expired(){\n\tglobal $fa_pro;\n\treturn $fa_pro->get_status_expired();\n}",
"public function expired($key) {\n return parent::expired($this->key($key));\n }",
"public function getInactive()\n\t{\n\n\t\tself::addArgument('courses', Course::inactives());\n\n\t\treturn self::make('inactive');\n\n\t}",
"public function getExpiredStatus()\n {\n if ( !$this->owner->isPublished() ) {\n return false;\n }\n $expiry = $this->owner->dbObject(\"Expiry\");\n if ( $this->owner->Expiry && $expiry->InPast() ) {\n return true;\n }\n\n return false;\n }",
"function dialogue_delete_expired_conversations() {\n global $DB;\n $sql = \"SELECT d.id AS dialogueid, dc.id as conversationid FROM {dialogue_conversations} dc\n INNER JOIN {dialogue} d ON dc.dialogueid = d.id\n WHERE dc.closed = 1 AND d.deleteafter IS NOT NULL AND d.deleteafter > 0\n AND dc.timemodified < (\".time().\" - (d.deleteafter * :timenow))\";\n\n $dialogues = $DB->get_records_sql($sql, array('timenow' => time()));\n foreach ($dialogues as $dialogue) {\n mtrace(\"Deleting expired conversations for Dialogue id \".$dialogue->dialogueid);\n $DB->delete_records('dialogue_conversations',\n array('id' => $dialogue->conversationid, 'dialogueid' => $dialogue->dialogueid));\n $DB->delete_records('dialogue_entries',\n array('conversationid' => $dialogue->conversationid, 'dialogueid' => $dialogue->dialogueid));\n }\n}",
"public function getActivePolls()\n {\n $pollz = $this->em\n ->createQuery('SELECT p\n FROM NkgPollBundle:Poll p\n WHERE p.active = 1\n AND CURRENT_TIMESTAMP() BETWEEN p.startdate AND p.enddate\n ORDER BY p.enddate DESC');\n\n try {\n $res = $pollz->getResult();\n return $res;\n } catch (\\Doctrine\\ORM\\NoResultException $e) {\n return array();\n }\n }",
"public function get_expired_posts() {\n $today = date(\"Y-m-d\");\n\n $args = array(\n 'post_type' => $this->_post_types_to_cover,\n 'meta_key' => 'bbx_best_before_expiry_date',\n 'orderby' => 'meta_value',\n 'order' => 'ASC',\n 'post_status' => 'publish',\n 'meta_query' => array(\n array(\n 'key' => 'bbx_best_before_expiry_date',\n 'value' => $today,\n 'compare' => '<=',\n 'type' => 'DATE'\n )\n )\n );\n\n $expired_posts = get_posts( $args );\n\n return $expired_posts;\n }",
"public function isExpired()\n {\n return $this->expired;\n }",
"public function inactive()\n {\n return $this->newQuery('getUsers', ['type' => 'DeactiveUsers']);\n }",
"protected function collectExpiredSessions()\n {\n $lifetime = Config::inst()->get(LoginSession::class, 'default_session_lifetime');\n $sessions = LoginSession::get()->filter([\n 'LastAccessed:LessThan' => date('Y-m-d H:i:s', time() - $lifetime),\n 'Persistent' => false\n ]);\n $sessions->removeAll();\n }",
"public function getExpired(Request $request)\n {\n $templates = $request->input('templates');\n\n $type = Auth::check()?Auth::type():\"app\";\n $request = Template::select('path')->where('type','=',$type)\n ->where(function($request) use($templates)\n {\n foreach($templates as $template)\n {\n $request = $request->orWhere(function($query) use($template)\n {\n $query->where('path','=',$template[\"url\"]);\n if(isset($template[\"version\"]))\n {\n $query->where(\"version\",'<>',$template['version']);\n }else\n if(isset($template[\"md5\"]))\n {\n $query->where(\"md5\",'<>',$template['md5']);\n }\n });\n }\n \n });\n $results = $request\n ->get()->pluck('path')->all();\n return $results;\n }",
"public function is_expired() {\n\t\treturn $this->get_expires() < time();\n\t}",
"public function getExchangeBindings()\n {\n return $this->exchangeBindings;\n }",
"public function scopeDeactivated($query)\n {\n return $query->where($this->ends_at_field, '<', date('Y-m-d H:i:s'));\n }",
"protected function get_bindings(): array {\n\t\treturn [];\n\t}",
"public function isExpired();",
"public function isExpired();",
"public function isExpired();",
"public function isExpired();",
"public function isExpired();",
"public function isExpired();",
"public function isExpired();",
"public function scopeNotActivated($query)\n {\n return $query->where($this->starts_at_field, '>', date('Y-m-d H:i:s'));\n }",
"public function getExpiringMembers() {\n\t\t$date = new DateTime();\n\t\t$end = $date->setTimestamp(strtotime('+30 days'));\n\n\t\treturn Member::get()->filter(array(\n\t\t\t'MembershipStatus' => 'Verified',\n\t\t\t'ExpiryDate:LessThan' => $end->format('Y-m-d H:i:s'),\n\t\t\t'Notified' => 0\n\t\t));\n\t}",
"public function getInactiveUsers() {\n\t\t$db = GetGlobal('db');\n\t\t$text = localize('_inactiveuser',getlocal());\n\t\t$sSQL = \"select username,timein from users where active=0 and DATE(timein) BETWEEN DATE( DATE_SUB( NOW() , INTERVAL 30 DAY ) ) AND DATE ( NOW() ) order by DATE(timein) desc\";\n\t\t$result = $db->Execute($sSQL,2);\n\n\t\tforeach ($result as $i=>$rec) {\n\t\t\t$saytime = _m('rccontrolpanel.timeSayWhen use ' . strtotime($rec[1]));\n\t\t\t$msg = \"warning|\" . $text .' '. $rec[0] . \"|$saytime|cpusers.php|\".$rec[0];\n\t\t\t$this->setMessage($msg);\n\t\t}\n\t\treturn null;\n\t}",
"public function scopeNotDeactivated($query)\n {\n return $query->where($this->ends_at_field, '>=', date('Y-m-d H:i:s'));\n }",
"final public static function noConnectionTicketsAvailable()\n {\n return self::get(2063);\n }",
"public function clearExpiredItems(): array\n {\n return $this->gc([\n 'gc_enable' => true,\n 'gc_probability' => 1,\n 'gc_divisor' => 1,\n ]);\n }",
"public function getExpiredCount()\n {\n return $this->expiredCount;\n }",
"public function provides()\n {\n return ['live'];\n }",
"public abstract function get(string $query, bool &$expired = null) : array;",
"public function getBinds(): array;",
"public function getExpiredCacheSites()\n\t{\n\t\t$keystore = Interspire_KeyStore::instance();\n\n\t\t$prefix = 'ebay:details:last_update:site:';\n\n\t\t$expiredSites = array();\n\n\t\tforeach ($this->getSupportedSites() as $siteId => $siteName) {\n\t\t\t// the time the cache for the site was last updated\n\t\t\t$lastUpdate = $keystore->get($prefix . $siteId);\n\n\t\t\t$cacheFile = $this->cacheBaseDir . '/ebaydetails_' . $siteId . '.xml';\n\n\t\t\t// if the cache has never been updated, has expired or the cache file doesn't exist then add it to our list of expired sites\n\t\t\tif (!$lastUpdate ||\n\t\t\t\t(($lastUpdate + self::CACHE_VALID_FOR) < time()) ||\n\t\t\t\t!is_file($cacheFile)\n\t\t\t\t) {\n\t\t\t\t$expiredSites[] = $siteId;\n\t\t\t}\n\t\t}\n\n\t\treturn $expiredSites;\n\t}",
"public function getExpiration()\n {\n }",
"public function scopeLifetimeBan ($query)\n {\n return $query->where('ban_lifetime', true);\n }",
"protected function expired()\n {\n return Carbon::now()->diffInSeconds($this->valid, false) < 0;\n }",
"public function deleteExpiredRequests()\n {\n $helper = Mage::helper('mp_debug');\n if (!$helper->isEnabled()) {\n return 'skipped: module is disabled.';\n }\n\n if ($helper->getPersistLifetime() == 0) {\n return 'skipped: lifetime is set to 0';\n }\n\n $expirationDate = $this->getExpirationDate(date(self::DATE_FORMAT));\n $table = $this->getRequestsTable();\n $deleteSql = \"DELETE FROM {$table} WHERE date <= '{$expirationDate}'\";\n\n /** @var Magento_Db_Adapter_Pdo_Mysql $connection */\n $connection = Mage::getSingleton('core/resource')->getConnection('core_write');\n\n /** @var Varien_Db_Statement_Pdo_Mysql $result */\n $result = $connection->query($deleteSql);\n return \"{$result->rowCount()} requests deleted\";\n }",
"public function providerGetNotExist()\n {\n $getList = $this->getMethodsName('get');\n $provider = [];\n\n foreach ($getList as $name) {\n $provider[$name] = [\n 'name' => $name,\n 'argId1' => 123,\n 'argId2' => 123,\n ];\n }\n\n return $provider;\n }",
"public function getBind();",
"public function isExpired(): bool\n {\n return $this->expired;\n }",
"static function check_expired_cache(){\n\n\t\tglobal $wpdb;\n\t\t$limit = 2000;\n\t\tif ( class_exists( 'WRC_Logger' ) ) {\n\t\t\tself::$logger = new WRC_Logger( get_called_class() );\n\t\t\t$cron_limit = get_option( WRC_Logger::SETTING_FLAG . '_limit', '2000' );\n\t\t\tif ( is_numeric( $cron_limit ) ) {\n\t\t\t\t$limit = $cron_limit;\n\t\t\t}\n\t\t}\n\n\t\t$expiredBefore = date('Y-m-d', strtotime('-1 year'));\n\n\t\t$query = '\nDELETE FROM ' . REST_CACHE_TABLE . ' \nWHERE rest_expires < \"' . $expiredBefore . '\" AND rest_to_update=0\nLIMIT ' . $limit;\n\n\t\ttry {\n\t\t\tif ( $wpdb->query( $query ) ) {\n\t\t\t\t// executed successfully\n\t\t\t} else {\n\t\t\t\tif ( function_exists( 'newrelic_notice_error' ) ) {\n\t\t\t\t\tnewrelic_notice_error( 'CRON FAIL: Unable to perform cleanup on un-requested old API cache. Limit ' . $limit . ', Expired ' . $expiredBefore );\n\t\t\t\t}\n\t\t\t}\n\t\t}catch( \\Exception $e){\n\t\t\tif ( function_exists( 'newrelic_notice_error' ) ) {\n\t\t\t\tnewrelic_notice_error( 'CRON FAIL: '.$e->getMessage().'. Limit ' . $limit . ', Expired ' . $expiredBefore );\n\t\t\t}\n\t\t}\n\t\treturn;\n\n\t}",
"public function provides()\n {\n return array_keys($this->getBindings());\n }",
"public function getPaymentAuthExpiration();",
"public function getOldDps()\n {\n return $this->get(self::_OLD_DPS);\n }",
"public function deactivateExpiredBlocks()\n {\n $expiredBlocks = SecurityBlockedAccess::find()->where(['is_active' => 1])->andWhere(\n ['<', 'expire', new Expression('NOW()')]\n )->all();\n\n /** @var SecurityBlockedAccess $block */\n foreach ($expiredBlocks as $block) {\n $block->deactivate();\n }\n echo t('app', \"Expired blocks were deactivated.\");\n\n return ExitCode::OK;\n }",
"public function stale_users() {\n\t\tif (!$this->get_settings()) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$http = new HttpSocket(array(\n\t\t\t'timeout' => 15,\n\t\t\t'ssl_verify_host' => false // PHP does not seem to check SANs for CNs\n\t\t));\n\t\ttry {\n\t\t\t$results = $http->get($this->settings['hostname.mbd'].'/panelists/stale?X-ApiKey='.$this->settings['mbd.api_key'], array(), $this->options);\n\t\t} catch (Exception $e) {\n\t\t\t$this->out('Stale Api endpoint failed.');\n\t\t\treturn;\n\t\t}\n\n\t\t$results = json_decode($results['body'], true);\n\t\tCakeLog::write('mbd.stale', print_r($results, true));\n\t\tprint_r($results);\n\t}",
"public function active()\n {\n // Create query finding all active sessions\n $query = $this->entityManager->createQuery('SELECT s.id, s.name, s.isPrivate, count(m.id) memberCount FROM Session s LEFT JOIN s.members m WHERE s.lastAction > ?1 GROUP BY s.id');\n $query->setParameter(1, new DateTime('-1 hour'));\n $sessions = $query->getArrayResult();\n return $sessions;\n }",
"private function getPendingEvents ()\n {\n return EventQueue::pending()->with('event_detail')\n ->orderBy('scheduled_start_time', 'asc')\n ->limit(100)\n ->get();\n }",
"public function refreshLifetimeAction()\n {\n return $this->_forward('refreshLifetime', 'report_statistics');\n }",
"public function isExpired(): bool;",
"public function has_expired()\n\t{\n\t\treturn $this->until < time();\n\t}",
"function attendance_return_passwords($session) {\n global $DB;\n\n $sql = 'SELECT * FROM {attendance_rotate_passwords} WHERE attendanceid = ? AND expirytime > ? ORDER BY expirytime ASC';\n return json_encode($DB->get_records_sql($sql, ['attendanceid' => $session->id, time()], $strictness = IGNORE_MISSING));\n}",
"public static function futureDeadlines() {\n return self::query()\n ->select('deadline')\n ->whereDate('deadline', '>', Carbon::today()->toDateString())\n ->groupBy('deadline');\n }",
"public function getSessionInPastTabPlanning()\n {\n $id = Yii::app()->user->idUser;\n $sessionPastPlanning = Yii::app()->db->createCommand(\n 'SELECT u.firstName, u.lastName, u.avatarPath, name, title, description, s.datePost, COUNT(DISTINCT(i.idUserInvited)) AS numInvitedUser,\n s.dateCreate, s.idSession, COUNT(DISTINCT(a.idArchive)) AS numArchive,s.active, s.idUserCreate\n FROM sessions AS s\n LEFT JOIN invited_session AS i ON s.idSession = i.idSession\n INNER JOIN users AS u ON s.idUserCreate = u.idUser\n INNER JOIN topics AS t ON s.idTopic = t.idTopic \n LEFT JOIN archive_session AS a ON s.idSession = a.idSession\n WHERE (s.idUserCreate = :idUserCreate) AND ((s.datePost+ INTERVAL 1 DAY) < Now())\n AND (t.active = 1)\n GROUP BY s.idSession\n ORDER BY s.dateCreate DESC')\n ->bindValues(array(':idUserCreate' => $id))\n ->queryAll();\n return $sessionPastPlanning;\n }",
"public function get_binds(){\n\t\treturn $this->binds;\n\t}",
"function getViewablePausedReports($conn){\n\t$sql = \"SELECT temporaryreport.PlanId, DatePaused FROM temporaryreport JOIN plan ON temporaryreport.PlanId = plan.PlanId WHERE plan.UserId = :userID\";\n\n\n\t$userID = getLoggedInID();\n\n\t\n\t$sth = $conn->prepare($sql);\n\t$sth->bindParam(':userID', $userID, PDO::PARAM_INT, 11);\n\t$sth->execute();\n\t\n\t$rows = array();\n\t\n\twhile($r = $sth->fetch(PDO::FETCH_ASSOC)) {\n\t\t$rows[] = $r;\n\t}\n\treturn $rows;\n}"
] | [
"0.6891562",
"0.6321306",
"0.6313475",
"0.6182815",
"0.6139195",
"0.6111996",
"0.60274583",
"0.5888512",
"0.5799219",
"0.577477",
"0.56747746",
"0.5660916",
"0.5632513",
"0.5594552",
"0.5556552",
"0.5548642",
"0.5533709",
"0.5524876",
"0.5474842",
"0.5358597",
"0.5353482",
"0.533554",
"0.53321457",
"0.5278863",
"0.52777046",
"0.5276667",
"0.5267832",
"0.52566695",
"0.5251869",
"0.52310306",
"0.5156866",
"0.5154463",
"0.51495105",
"0.50891167",
"0.5076739",
"0.50575286",
"0.50265",
"0.4977423",
"0.497608",
"0.49738526",
"0.4966708",
"0.49614882",
"0.49539992",
"0.4952571",
"0.49498692",
"0.49469468",
"0.49392626",
"0.49348274",
"0.49334702",
"0.49309254",
"0.49296916",
"0.49275097",
"0.4917148",
"0.49153966",
"0.490284",
"0.48962778",
"0.48927358",
"0.48880255",
"0.48819587",
"0.4880582",
"0.4880582",
"0.4880582",
"0.4880582",
"0.4880582",
"0.4880582",
"0.4880582",
"0.48785582",
"0.48654434",
"0.48614112",
"0.48605677",
"0.48587188",
"0.4853049",
"0.4838417",
"0.48286057",
"0.48224846",
"0.4816865",
"0.4800845",
"0.47895527",
"0.4786003",
"0.478146",
"0.4779844",
"0.47734076",
"0.4768239",
"0.4767456",
"0.47638774",
"0.4745539",
"0.47455144",
"0.47451407",
"0.4733299",
"0.47296208",
"0.47289968",
"0.4716662",
"0.4716624",
"0.4715151",
"0.47028732",
"0.46943212",
"0.46870708",
"0.4687029",
"0.46864602",
"0.4682651"
] | 0.49951494 | 37 |
Set show expired bindings | public function setShowExpired($showExpired): self
{
return $this->setParameter('showExpired', $showExpired);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setExpired()\n {\n $this->attributes['status'] = 'expired';\n self::save();\n }",
"public function setExpired()\n {\n $this->attributes['status'] = 'expired';\n self::save();\n }",
"public function withExpired()\n {\n return $this->withoutGlobalScope(ExpirationScope::class);\n }",
"public function expired() {\n\n $data = array();\n $data['result'] = $this->property_model->fetchAll(getLoginUserId(), NULL, TRUE);\n $data['title'] = \"Expired Properties\";\n \n $this->render('admin/property/expired', $data);\n }",
"public function is_expired()\n {\n }",
"public function onlyExpired()\n {\n return $this->withoutGlobalScope(ExpirationScope::class)\n ->where($this->model->getExpirationAttribute(), '<=', Carbon::now());\n }",
"public function setExpired($expired)\r\n {\r\n $this->expired = $expired;\r\n\r\n return $this;\r\n }",
"public function listExpired() \n\t{\n\t\treturn $this->list(true);\n\t}",
"function setExpired($expired) {\n\n // A transaction can always be expired but this can not be reversed.\n if (!$expired && $this->expired) {\n $this->checkChange();\n }\n $this->expired = $expired;\n return $this;\n }",
"public function clean_expired_keys()\n {\n }",
"public function scopeExpired($query) {\n return $query->where('status', 'expired');\n }",
"public function getExpired();",
"public function expired($key) {\n return parent::expired($this->key($key));\n }",
"protected function getNotExpiredStatement() {}",
"function isExpired() {\n return $this->expired;\n }",
"public function getExpiredAttribute()\n {\n return $this->subscription_payment\n && ! is_null($this->paid_at)\n && $this->paid_at->lessThan(now()->subDays(60))\n && (is_null($this->payments_required) || $this->payments_made < $this->payments_required);\n }",
"public function getExpired() {\n\t\t\n\t}",
"public function enableNoExpiryMode()\n\t{\n\t\t$this->_no_expire = true;\n\t}",
"public function is_expired() {\n\t\treturn $this->get_expires() < time();\n\t}",
"public function removeExpired();",
"public function getExpiredAttribute()\n {\n return $this->hasExpired();\n }",
"public function setOnHoldExpiration($value)\n {\n return $this->setParameter('onHoldExpiration', $value);\n }",
"private function setExpiringSession()\n {\n $now = new Chronos();\n if ($this->session->get('createdAt') === '') {\n $this->session->saveForced('createdAt', $now->toDateTimeString());\n }\n\n $sessionCreatedAt = $this->session->get('createdAt');\n $expired = new Chronos($sessionCreatedAt);\n $expired = $expired->addSeconds($this->expiringTime);\n\n if ($expired->lte($now) && !headers_sent()) {\n $this->destroy();\n }\n }",
"public function is_expired() {\n\t\treturn $this->data['created_at'] + HOUR_IN_SECONDS < ITSEC_Core::get_current_time_gmt();\n\t}",
"public function isExpired() {}",
"public function isExpired()\n {\n return $this->expired;\n }",
"function getExpiredList( &$pParamHash ) {\n\t\t$pParamHash['get_expired'] = TRUE;\n\t\treturn( $this->getList( $pParamHash ));\n\t}",
"public function isExpired(): bool\n {\n return $this->expired;\n }",
"public function getExpired()\r\n {\r\n return $this->expired;\r\n }",
"public function expire();",
"public function onlyEternal()\n {\n return $this->withoutGlobalScope(ExpirationScope::class)\n ->whereNull($this->model->getExpirationAttribute());\n }",
"protected function expired()\n {\n return Carbon::now()->diffInSeconds($this->valid, false) < 0;\n }",
"public function setExpiry( $expiry );",
"public static function is_expired()\n { \n $conf = $GLOBALS['CONF'];\n \n if (!$conf)\n { \n $conf = new Ossim_conf();\n $GLOBALS['CONF'] = $conf;\n }\n \n $expired_timeout = intval($conf->get_conf('session_timeout')) * 60;\n \n if ($expired_timeout != 0)\n { \n $time = gmdate('U');\n \n if (isset($_SESSION['_expiration_time']) && intval($_SESSION['_expiration_time']) + $expired_timeout < $time) \n {\n $ossim_link = $conf->get_conf('ossim_link');\n $login_location = preg_replace(\"/(\\/)+/\",\"/\",$ossim_link . '/session/login.php?action=logout'); \n \n header(\"Location: $login_location\");\n }\n \n //Only update if not exists bypass => header ajax responses\n if (intval(GET('bypassexpirationupdate')) != 1 && intval(POST('bypassexpirationupdate')) != 1) \n {\n $_SESSION['_expiration_time'] = $time;\n \n Session_activity::update($_SESSION['_expiration_time']);\n }\n }\n }",
"function timeout() {\n $q = Doctrine_Query::create()\n ->update('Zim_Model_User u')\n ->set('u.timedout', '?', '1')\n ->where(\"u.updated_at <= ?\", date('Y-m-d H:i:s', time()- $this->getVar('timeout_period', 30)));\n $q->execute();\n return;\n }",
"public function makeEternal()\n {\n return $this->update([\n $this->model->getExpirationAttribute() => null\n ]);\n }",
"public function isExpired();",
"public function isExpired();",
"public function isExpired();",
"public function isExpired();",
"public function isExpired();",
"public function isExpired();",
"public function isExpired();",
"static function autoExpiryUpdated($value) {\n if($value > 0) {\n DB::execute('UPDATE ' . TABLE_PREFIX . 'users SET password_expires_on = ? WHERE password_expires_on IS NULL', DateTimeValue::makeFromString(\"+$value months\"));\n } else {\n DB::execute('UPDATE ' . TABLE_PREFIX . 'users SET password_expires_on = NULL');\n } // if\n\n AngieApplication::cache()->removeByModel('users');\n }",
"public static function getExpiredInfoConnectors()\n\t{\n\t\t$filter = array(\n\t\t\t'<EXPIRES' => \\Bitrix\\Main\\Type\\DateTime::createFromTimestamp(time())\n\t\t);\n\n\t\t$result = self::getInfoConnectors($filter);\n\n\t\treturn $result;\n\t}",
"public function expire()\n {\n return $this->update([\n $this->model->getExpirationAttribute() => Carbon::now()\n ]);\n }",
"function expireall() {\n\t\t$now = $this->_fromunixtime( time() );\n\t\t$this->_query( \"DELETE FROM $0 WHERE exptime<'$now'\" );\n\t}",
"function deactivate() {\n \n $this->reset_caches();\n $this->ext->update_option( 'livefyre_deactivated', 'Deactivated: ' . time() );\n\n }",
"public function setCredentialsExpired($credentials_expired)\r\n {\r\n $this->credentials_expired = $credentials_expired;\r\n\r\n return $this;\r\n }",
"public function getCredentialsExpired()\r\n {\r\n return $this->credentials_expired;\r\n }",
"public function setExpired($boolean)\n {\n $this->expired = (boolean) $boolean;\n \n return $this;\n }",
"public function expire() {\n logit_r($this, 'expire'); \n $status = ($this->status == UserLoginReq::STATUS_NOTIFIED) ? UserLoginReq::STATUS_PAST_GRACE : UserLoginReq::STATUS_EXPIRED;\n logit_r($status, 'status');\n $this->status = $status;\n $this->save(true);\n }",
"public function hasExpired(){\n if($this->isIndefinied())\n return false;\n\n \\Log::info('Hoy'.print_r(Carbon::now(),true));\n \\Log::info('Expira'.print_r(Carbon::parse($this->expires_on),true));\n return (bool) Carbon::now()->greaterThan(Carbon::parse($this->expires_on));\n }",
"protected function addIsExpired(BuilderBase $builder)\n {\n $builder->macro('isExpired', function (BuilderBase $builder) {\n $model = $builder->getModel();\n $builder->withoutGlobalScope($this)->where(\n $model->getExpirableColumn(), '<=',\n Carbon::now()\n );\n\n return $builder;\n });\n\n }",
"public static function whereNotExpired()\n {\n return self::where('expiration_date', '>', date('Y-m-d'));\n }",
"final public static function ExpiredAwaitingAuthorization()\n {\n return self::get(184);\n }",
"public function providerInvalidResponse(): array {\n return [\n 'expired' => [\n -86400,\n ],\n 'fresh' => [\n 86400,\n ],\n ];\n }",
"public function isExpired()\n {\n return Carbon::now()->gt(Carbon::parse($this->getExpirationDate()));\n }",
"public function clearExpiry();",
"public function toBeExpired(): \\Illuminate\\Http\\JsonResponse\n {\n $today = new \\DateTime('now');\n $from = $today->format('Y-m-d');\n $end = $today->add(new \\DateInterval('P30D'))->format('Y-m-d');\n $clients = $this->client->whereBetween('membership_expiry_date', [$from, $end])->get();\n if(!$clients) {\n abort(204);\n }\n \n return response()->json($clients);\n }",
"public function markAsExpired()\n {\n // Set subscription to end on next billing date\n $this->trialEndsAt = $this->trialEndsAt ? : $this->nextBillingDate;\n $this->endsAt = $this->nextBillingDate;\n\n return $this->save();\n }",
"public function updateVisitsToExpired() {\n\t\ttry {\n\n\t\t\t$command = Yii::app()->db->createCommand(\"UPDATE visit\n LEFT JOIN card_generated ON card_generated.id = visit.card\n SET visit_status = \" . VisitStatus::EXPIRED . \",card_status =\" . CardStatus::NOT_RETURNED . \"\n WHERE CURRENT_DATE > date_expiration AND visit_status = \" . VisitStatus::ACTIVE . \"\n AND card_status =\" . CardStatus::ACTIVE . \" and card_type=\" . CardType::MULTI_DAY_VISITOR . \"\")->execute();\n\n\t\t\techo \"Affected Rows : \" . $command . \"<br>\";\n\t\t\tif ($command > 0) {\n\t\t\t\techo \"Update visit to expired status successful.\";\n\t\t\t} else {\n\t\t\t\techo \"No record to update.\";\n\t\t\t}\n\n\t\t\treturn true;\n\t\t} catch (Exception $ex) {\n\t\t\techo 'Query failed', $ex->getMessage();\n\t\t\treturn false;\n\t\t}\n\t}",
"public function setExpiredAt(string $expired_at): void\n {\n $this->_expired_at = $expired_at;\n }",
"public function isExpiring() {\n return $this->expiration - time() < 22 * 24 * 3600;\n }",
"public function setExpired($boolean)\n {\n $this->expired = (Boolean)$boolean;\n\n return $this;\n }",
"public function findExpiredRegistrationsDataProvider() {\n\t\treturn array(\n\t\t\t'allRegistrationsExpired' => array(\n\t\t\t\t1402826400, /* 15.06.2014 10:00 */\n\t\t\t\t3\n\t\t\t),\n\t\t\t'noRegistrationsExpired' => array(\n\t\t\t\t1402736400, /* 14.06.2014 09:00 */\n\t\t\t\t0\n\t\t\t),\n\t\t\t'nowIs1030Am' => array(\n\t\t\t\t1402741800, /* 14.06.2014 10:30 */\n\t\t\t\t1\n\t\t\t),\n\t\t);\n\t}",
"public function isExpired ()\n {\n return $this->getExpirationDate()->getTimestamp() < time();\n }",
"protected function _removeExpiredRegistrations() {\n\t\t$this->deleteAll(array(\n\t\t\t$this->alias . '.email_verified' => 0,\n\t\t\t$this->alias . '.email_token_expires <' => date('Y-m-d H:i:s')));\n\t}",
"protected function collectExpiredLoginHashes()\n {\n $hashes = RememberLoginHash::get()->filter([\n 'ExpiryDate:LessThan' => date('Y-m-d H:i:s')\n ]);\n $hashes->removeAll();\n }",
"public function getShowExpired(): ?string\n {\n return $this->getParameter('showExpired');\n }",
"public function cache_lifetime_callback()\n {\n $this->view('params/lifetime', [\n 'dim' => __('minutes', 'sepw'),\n 'lifetime' => isset($this->options['cache_lifetime']) ? esc_attr($this->options['cache_lifetime']) : 30,\n ]);\n }",
"public function isExpired()\n {\n return ! is_null($this->expiration) &&\n Carbon::now()\n ->gte($this->expiration);\n }",
"public function isExpired(): bool;",
"private function expiredSession() {\r\n\r\n if (time()>$this->forcedExpire) return true;\r\n else return false;\r\n }",
"public function remove_expired()\n\t{\n\t\t$this->db->where('expiration <', date('Y-m-d H:i:s'));\n\t\t$this->db->delte($this->Table);\n\t}",
"private function removeExpiredCarpools()\n {\n $this->db->query(CaronaDAO::QUERY_SET_EXPIRED_CARPOOLS);\n\n $this->db->execute();\n error_log(\"Erro: \" . $this->db->getError());\n\n }",
"public function setMaxAge($expiry)\n {\n $this->expiry = $expiry;\n }",
"public function setCredentialsExpired($boolean)\n {\n $this->credentialsExpired = $boolean;\n \n return $this;\n }",
"public function expired(): Factory\n {\n return $this->state(fn () => [\n 'disabled_at' => $this->faker->dateTime,\n ]);\n }",
"static function expirePasswords($exclude = null) {\n $yesterday = date(\"Y-m-d\", time() - 24 * 60 * 60); // password expired yesterday\n\n if($exclude) {\n DB::execute('UPDATE ' . TABLE_PREFIX . 'users SET password_expires_on = ? WHERE id NOT IN (?)', $yesterday, $exclude);\n } else {\n DB::execute('UPDATE ' . TABLE_PREFIX . 'users SET password_expires_on = ?', $yesterday);\n } // if\n\n AngieApplication::cache()->removeByModel('users');\n }",
"public function has_expired()\n\t{\n\t\treturn $this->until < time();\n\t}",
"public function hasExpired() {\n return $this->getExpirationTime() <= time();\n }",
"public function hasExpired() {\n return $this->getExpirationTime() <= time();\n }",
"public function isExpired() : bool\n {\n return $this->getExpiryAttribute()->timestamp < Carbon::now()->timestamp\n && $this->length !== 0\n && !$this->isRemoved();\n }",
"protected function handleSessionLifeTimeExpired() {}",
"protected function handleSessionLifeTimeExpired() {}",
"public function isPasswordExpired()\n {\n return $this->getPasswordExpiredAt() instanceof \\DateTime &&\n $this->getPasswordExpiredAt()->getTimestamp() < time();\n }",
"public function deleteExpiredTokens(): void\n {\n $this->model->newQuery()\n ->where('expires_at', '<', Carbon::now()->addSecond())\n ->delete();\n }",
"private static function _age() {\n if (isset($_SESSION['LAST_ACTIVE']) && time() - $_SESSION['LAST_ACTIVE'] > self::$SESSION_AGE) {\n self::destroy();\n throw new ExpiredSessionException();\n }\n $_SESSION['LAST_ACTIVE'] = time();\n }",
"private function expireSudoMode(): void\n {\n $expiresAfter = SudoModeService::config()->get('lifetime_minutes') * 60;\n DBDatetime::set_mock_now(DBDatetime::now()->getTimestamp() + $expiresAfter);\n }",
"abstract protected function isExpired();",
"public function setInactive()\r\n {\r\n $this->active = false;\r\n }",
"public function getExpired()\n {\n return Item::join('item_batches', 'items.id', '=', 'item_batches.item_id')\n ->join('measurement_units', 'items.unit_id', '=', 'measurement_units.id')\n ->where('item_batches.expiry_date', '<', Carbon::now())\n ->where('item_batches.current_quantity', '!=', 0)\n ->select('items.description', 'item_batches.current_quantity', 'measurement_units.short_name', 'item_batches.expiry_date')\n ->get();\n }",
"protected function disableApplicationsPeriod()\n {\n $settings = app('settings');\n $settings->applications_start_at = Carbon::yesterday();\n $settings->applications_end_at = Carbon::yesterday();\n $settings->save();\n }",
"public function isExpired(): bool\n {\n return $this->expires != 0 && $this->expires < time();\n }",
"protected function collectImplicitlyExpiredSessions()\n {\n $sessions = LoginSession::get()->filter([\n 'Persistent' => true,\n 'LoginHash.ExpiryDate:LessThan' => date('Y-m-d H:i:s')\n ]);\n $sessions->removeAll();\n }",
"public function isExpired() :bool\n {\n return ($this->expires < time());\n }",
"protected function fixLifetime()\n {\n Config::set('session.expire_on_close', true);\n }",
"public function getOnHoldExpiration()\n {\n return $this->getParameter('onHoldExpiration');\n }",
"public function expiredtoken($name){\n $url = $this->Social->RequestNewToken();\n //set some data\n $this->set('name',$name);\n $this->set('url',$url);\n \n }"
] | [
"0.61204654",
"0.61204654",
"0.60253847",
"0.59638876",
"0.56959724",
"0.56729937",
"0.56215596",
"0.5548643",
"0.5547078",
"0.54188794",
"0.53913593",
"0.53698313",
"0.5336648",
"0.5312425",
"0.53030884",
"0.5285658",
"0.5266446",
"0.5233276",
"0.5210515",
"0.5193316",
"0.5166726",
"0.5146264",
"0.51441664",
"0.513136",
"0.51297694",
"0.5111936",
"0.5110805",
"0.5107564",
"0.5085682",
"0.5074388",
"0.50431186",
"0.50420946",
"0.5014685",
"0.4998991",
"0.4981848",
"0.49769947",
"0.49752358",
"0.49752358",
"0.49752358",
"0.49752358",
"0.49752358",
"0.49752358",
"0.49752358",
"0.4955511",
"0.4954991",
"0.49139985",
"0.4912328",
"0.49089175",
"0.4899616",
"0.48987663",
"0.48978359",
"0.48945937",
"0.48847014",
"0.48740923",
"0.4869447",
"0.48526692",
"0.48500898",
"0.4839849",
"0.48239538",
"0.48167166",
"0.48121864",
"0.4799539",
"0.47904342",
"0.47899443",
"0.47888184",
"0.4787328",
"0.47803715",
"0.47796273",
"0.4767079",
"0.4764157",
"0.4755673",
"0.47523007",
"0.473996",
"0.4738887",
"0.47345185",
"0.4732559",
"0.47315213",
"0.47288653",
"0.47272825",
"0.4725609",
"0.47255868",
"0.47237352",
"0.47237352",
"0.4723478",
"0.4710936",
"0.4710936",
"0.47042543",
"0.4703081",
"0.47023702",
"0.46999907",
"0.46909362",
"0.46902055",
"0.46872267",
"0.46868914",
"0.46830165",
"0.46739447",
"0.46701646",
"0.46659383",
"0.4661562",
"0.46606436"
] | 0.57122386 | 4 |
Method name from bank API | protected function getMethod(): string
{
return 'rest/getBindingsByCardOrId.do';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getMethodName();",
"public function getMethodName();",
"public function getMethodName();",
"public function getMethod(): string {}",
"public function getMethod(): string;",
"public function getMethod(): string;",
"public function getMethod(): string;",
"public function getMethod(): string;",
"public function getMethod(): string;",
"public function getMethod(): string;",
"public function getMethod() :string;",
"protected function getMethodSuffix()\n {\n return 'TopBuyer';\n }",
"abstract protected function getMethodName();",
"public function get_method()\n {\n }",
"function getApiMethod()\n {\n }",
"public function getMethod() : string;",
"public function method() {\n\t\treturn strtoupper($this->getMethod());\n\t}",
"public function method(): string{\n return $this->_method;\n }",
"public function getApiMethodName() : string {\n\t\treturn $this->apiMethod;\n\t}",
"public function get_method();",
"public function getPaymentName()\n {\n return self::METHOD_NAME;\n }",
"function getMethod()\r\n {\r\n }",
"public function getMethod();",
"public function getMethod();",
"public function getMethod();",
"public function getMethod();",
"public function getMethod();",
"public function getMethod();",
"public function getMethod();",
"public function getMethodName() {\n return $this->methodName;\n }",
"public function GetMethod ();",
"public function getMethod() {}",
"public function getMethod() {}",
"public function getMethod() {}",
"public function getMethod() {}",
"public function getMethodName() : string\n {\n\n return $this->methodName;\n }",
"public function getMethodName() {\r\n\t\treturn($this->method_name);\r\n\t}",
"public function method(): string\n {\n return $this->method;\n }",
"public function method(): string\n {\n return $this->getMethod();\n }",
"public function getMethodName()\n {\n return $this->methodName;\n }",
"public function getMethodName()\n {\n return $this->methodName;\n }",
"public function method(){\n return $this->__method;\n }",
"public function getMethod()\n {\n }",
"public function getMethod() : string\n {\n return static::$method;\n }",
"public function getHttpMethodName() : string \n {\n return $this->method;\n }",
"public function getName()\n {\n return 'TatraBank';\n }",
"public function method() {\n return $this->method;\n }",
"public function get_name() {\n\t\t\treturn 'costumapi';\n\t\t}",
"public function getMethodName()\n {\n return $this->method;\n }",
"abstract public function getPaymentMethod();",
"public function getMethod(){\n return $this->method;\n }",
"protected function getMethod(): string\n {\n return $this->getTwoStep() ? 'rest/registerPreAuth.do' : 'rest/register.do';\n }",
"public function getMethod(): string\n {\n return $this->method;\n }",
"public function getMethod(): string\n {\n return $this->method;\n }",
"public function method()\n {\n return $this->method;\n }",
"public function method()\n {\n return $this->method;\n }",
"public function method()\n {\n return $this->method;\n }",
"public function get_method() {\n\t\treturn $this->method;\n\t}",
"public function getMethod(bool $upper = false): string;",
"public function GetMethod () {\n\t\treturn $this->method;\n\t}",
"public function method() {\n return $this->method;\n }",
"public function method()\n {\n return $this->_method;\n }",
"public function method()\n {\n return $this->_method;\n }",
"public function getShippingMethodName();",
"public function getName()\n {\n return 'European Central Bank';\n }",
"public function method(): string\n {\n return \\strtoupper($this->request()->getMethod());\n }",
"public static function getMethodBase($methodName) {\r\n \r\n BaseController::PARTIAL;\r\n BaseController::ACTION;\r\n}",
"protected function getMethodSuffix()\n {\n return 'Subscriber';\n }",
"#[Pure]\nfunction http_request_method_name($method) {}",
"public function getMethod() : string\n {\n return $this->method;\n }",
"public function getMethod() { return $this->_method; }",
"public function getMethod ()\n {\n return $this->method;\n }",
"protected function getMethodName($key){\n\t\t$method = $this->getMethod($key);\n\t\t\n\t\treturn $method->getName();\n\t}",
"public function get_method() {\n return $this->_method;\n }",
"public function getServiceMethod(): string\n {\n // If we don't have a shipper, we want to create a shipment without shipper.\n return $this->hasShipper() ? 'addShip' : 'addShipment';\n }",
"public function getApiGetterMethod()\n {\n return 'getBox';\n }",
"protected function getMethod(): string\n {\n return self::METHOD_POST;\n }",
"protected function getMethod($methodName)\n {\n // that takes precendence.\n if ($this->isAnAlias($methodName))\n {\n return $this->aliases[$methodName];\n }\n\n\n return 'assert' . ucwords($methodName);\n\n }",
"public function getBankName()\n {\n return $this->bank_name;\n }",
"public function getBankName()\n {\n return $this->bank_name;\n }",
"public function getBankName()\n {\n return $this->bank_name;\n }",
"public function Name()\n {\n return parent::CallMethod(__FUNCTION__, array(), func_get_args());\n }",
"public function getMethod()\n {\n return $this->method;\n }",
"public function __callIntern($methodName);",
"public function getMethod() : string\n {\n\n return $this->method;\n }",
"function spoofMethod($method)\n {\n print \"<input type='hidden' name='_METHOD' value='$method'>\";\n }",
"abstract protected function fetchAlgorithmMethodName();",
"public function getMethod()\n {\n return $this->values[\"method\"];\n }",
"public function getMethodName()\n {\n return PhandArr::last(explode('@', $this->getMethodInvokerName()));\n }",
"public function getMethod(): string\n {\n return QueryInterface::POST;\n }",
"public function getMethod() {\n\t\tif (isset($_GET[$this->config->get('methodParam')]))\n\t\t\t$method = urldecode($_GET[$this->config->get('methodParam')]);\n\t\telse\n\t\t\t$method = $this->config->get('defaultMethod');\n\t\t\n\t\treturn strtolower($method);\n\t}",
"public function getMethod() \n {\n return $this->method;\n }",
"function getMethod()\n {\n return $this->method;\n }",
"public function getActionName(){ }",
"public function getFcpoBankname() \n {\n return $this->getResponseParameter('clearing_bankname');\n }",
"function METHOD_default()\n {\n $this->sendTerminal(\"Available methods (use {$this->params[0]}/{method}):\");\n $this->sendTerminal(\" - {$this->params[0]}/hello\");\n }",
"public function getMethod()\r\n {\r\n return $this->method;\r\n }",
"public function getMethod(): string {\n\n return strtoupper($_SERVER['REQUEST_METHOD']);\n }",
"public function getMethod ()\n {\n\n return $this->method;\n\n }",
"private function getFieldNameFromMethodName($methodName)\n {\n $str = substr($methodName, 3); // removing 'get'\n $str = $this->lcfirst($str);\n $str = preg_replace('/([A-Z])/', '_$1', $str);\n return strtolower($str);\n }"
] | [
"0.70913523",
"0.70913523",
"0.70913523",
"0.6937817",
"0.6933159",
"0.6933159",
"0.6933159",
"0.6933159",
"0.6933159",
"0.6933159",
"0.69155526",
"0.68805087",
"0.6879324",
"0.68602467",
"0.6857345",
"0.6850681",
"0.6760536",
"0.6720995",
"0.66732085",
"0.665745",
"0.6591754",
"0.6571714",
"0.654031",
"0.654031",
"0.654031",
"0.654031",
"0.654031",
"0.654031",
"0.654031",
"0.6530531",
"0.65160584",
"0.6510761",
"0.6510761",
"0.6510761",
"0.6510761",
"0.650758",
"0.648867",
"0.64667994",
"0.644799",
"0.6438486",
"0.6438486",
"0.6437814",
"0.642763",
"0.6315654",
"0.6312661",
"0.63070035",
"0.6282719",
"0.6239736",
"0.6235358",
"0.62142354",
"0.62096995",
"0.61786056",
"0.6154512",
"0.6154512",
"0.6138263",
"0.6138263",
"0.6138263",
"0.6129782",
"0.61192596",
"0.61152166",
"0.6106701",
"0.610446",
"0.610446",
"0.6098122",
"0.60940176",
"0.6092191",
"0.6078536",
"0.6058101",
"0.6050751",
"0.60386705",
"0.6032269",
"0.60254294",
"0.60092896",
"0.5999079",
"0.5996322",
"0.5993114",
"0.5962074",
"0.59548974",
"0.59513056",
"0.59513056",
"0.59513056",
"0.59483117",
"0.59301627",
"0.59291375",
"0.59279144",
"0.5917043",
"0.59103495",
"0.5908637",
"0.5904104",
"0.5894351",
"0.5890309",
"0.5876119",
"0.5842515",
"0.5835613",
"0.5815703",
"0.5815619",
"0.58145195",
"0.5786482",
"0.5780534",
"0.5778006"
] | 0.64290464 | 42 |
Response class name. Method will be ignored if class name passed to constructor third parameter | public function getResponseClass(): string
{
return 'GetCardBindingsResponse';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function GetResponseClass ();",
"public function getResponseClass();",
"public function getResponseClass(): string\n {\n return 'AuthorizeResponse';\n }",
"public function getClassName(){return \"Core.Http.ApiRequest\";}",
"abstract protected function requestClass(): string;",
"public function & SetResponseClass ($responseClass);",
"public static function requestClass(): string;",
"private function instantiateRequestedClass($urlArray, $res) {\r\n foreach ($this->resources as $key => $value) {\r\n if (array_key_exists($key, $urlArray) || array_key_exists($key . 's', $urlArray)) {\r\n $clssname = self::API_PREFIX . $value;\r\n break;\r\n }\r\n }\r\n\r\n if (!file_exists(APPPATH . \"models/$clssname.php\")) {\r\n throw new Exception('', 404001);\r\n }\r\n\r\n $this->load->model($clssname);\r\n\r\n $reqParam = $this->input->get() ? $this->input->get() : file_get_contents(\"php://input\");\r\n\r\n $this->$clssname->__set('userip', $this->input->server('REMOTE_ADDR'));\r\n $this->$clssname->__set('apikey', $res->apikey);\r\n $this->$clssname->__set('clientid', $res->clientid);\r\n $this->$clssname->__set('usertype', $res->usertype);\r\n $this->$clssname->__set('apiclientid', $res->apiclientid);\r\n $this->$clssname->__set('requestMethod', $this->input->server('REQUEST_METHOD'));\r\n $this->$clssname->__set('requestParameters', $reqParam);\r\n\r\n $response = $this->$clssname->index($urlArray);\r\n $response['className'] = $clssname;\r\n return $response;\r\n }",
"public function getClassResponse()\n {\n return GetRolesResponse::class;\n }",
"public function __construct()\n {\n $this->response = new Response();\n }",
"public static function newInstance($class)\r\n {\r\n // the class exists\r\n $object = new $class();\r\n\r\n if (!($object instanceof sfResponse))\r\n {\r\n // the class name is of the wrong type\r\n $error = 'Class \"%s\" is not of the type sfResponse';\r\n $error = sprintf($error, $class);\r\n\r\n throw new sfFactoryException($error);\r\n }\r\n\r\n return $object;\r\n }",
"protected function response()\r\n {\r\n return Message::className();\r\n }",
"protected function response()\r\n {\r\n return Message::className();\r\n }",
"public static function processResponse( $oResponse, $sClass = __CLASS__ )\r\n\t{\r\n\t\t//\tOverride to do stuff here\r\n\t\treturn new $sClass();\r\n\t}",
"public function testSerializerMethodAllowsClassNameStrings()\n {\n $this->errorFactory->shouldReceive('make')->andReturn([]);\n\n $this->responseBuilder->serializer($serializer = get_class(Mockery::mock(ErrorSerializer::class)))->respond();\n\n $this->errorFactory->shouldHaveReceived('make')->with($serializer, null, null, null)->once();\n }",
"public function GetRequestClass ();",
"public function __construct()\n {\n parent::__construct();\n $this->response->type('application/json; charset=UTF-8');\n }",
"function getResponseClass()\n {\n return 'com\\dic\\qiusir\\site\\dss\\response\\CommonNotifyResponse';\n }",
"protected function getResponseFactory()\n {\n }",
"public function responseType ();",
"public function __construct()\n {\n return response([],400);\n }",
"abstract protected function to_single($res, $className);",
"public function get_response_object()\n {\n }",
"protected function _response() {}",
"function __construct($response, $request)\n\t{\n\t\tparent::__construct($response, $request);\n\t}",
"public function setResponseClass($className)\n {\n if (!class_exists($className)) {\n throw new Services_DoingText_Exception(\n \"Class {$className} not found\",\n self::ERR_PRECONDITION\n );\n }\n $this->responseClass = $className;\n return $this;\n }",
"public function get_response_class($classid) {\n if (!isset($this->responseclasses[$classid])) {\n debugging('Unexpected class id ' . $classid . ' encountered.');\n $this->responseclasses[$classid] = new analysis_for_class('[Unknown]', $classid);\n }\n return $this->responseclasses[$classid];\n\n }",
"public function testConstructor()\n {\n // no params\n $result = new ExperimentRecruitingTokenResponse();\n $this->assertEquals('Sizzle\\Bacon\\Database\\ExperimentRecruitingTokenResponse', get_class($result));\n }",
"abstract public function response();",
"public function classAction() {\n $args = func_get_args();\n $class = array_pop($args);\n $namespace = implode(ApiBrowser::NAMESPACE_SEPARATOR, $args);\n\n try {\n $form = new SearchForm($this->searchAction);\n\n $namespaces = $this->apiBrowser->getNamespaces($namespace);\n $classes = $this->apiBrowser->getClassesForNamespace($namespace);\n\n $classDefinition = $this->apiBrowser->getClass($namespace, $class);\n\n $view = new ClassView($form, $namespaces, $this->namespaceAction, $classes, $this->classAction, $namespace, $class, $classDefinition);\n $view->setPageTitle(Module::TRANSLATION_API, true);\n $this->setBreadcrumbsToView($view, $namespace, $class);\n\n $this->response->setView($view);\n } catch (Exception $e) {\n $namespace = implode('\\\\', $args);\n $this->addError(self::TRANSLATION_CLASS_NOT_FOUND, array('class' => $namespace . '\\\\' . $class));\n $this->response->setRedirect($this->request->getBasePath());\n }\n }",
"abstract public function responseProvider();",
"public function testClassname()\n {\n $input = Request::all();\n\n //path params validation\n\n\n //not path params validation\n if (!isset($input['client'])) {\n throw new \\InvalidArgumentException('Missing the required parameter $client when calling testClassname');\n }\n $client = $input['client'];\n\n\n return response('How about implementing testClassname as a patch method ?');\n }",
"public function __construct($response)\n {\n $this->response = $response;\n }",
"public function __construct($response)\n {\n $this->response = $response;\n }",
"public function __construct($response)\n {\n $this->response = $response;\n }",
"public function __construct($response)\n {\n $this->response = $response;\n }",
"function response() {\n return new Response;\n }",
"public function testIsResponseClass()\n {\n $cut = new ListAddresses();\n $this->assertInstanceOf('\\Sake\\BlockchainWalletApi\\Response\\ResponseInterface', $cut);\n }",
"protected function _getResponse() {\n\t\treturn new Response;\n\t}",
"public function getResponseFormatInstance()\n\t{\n\t\t### check the _responseFormatInstance property\n\t\tif (is_null($this->_responseFormatInstance)) {\n\t\t\t// the format class instance is not set, find it\n\t\t\t$requestedMimeTypes = $this->parseHTTPAcceptHeader();\n\t\t\t\n\t\t\t// loop through them, if a supported mime is found, return it\n\t\t\tforeach ($requestedMimeTypes as $requestedFormat) {\n\t\t\t\tforeach ($this->_responseFormats as $supportedFormat) {\n\t\t\t\t\tif ($requestedFormat['data_format'] === $supportedFormat['format_content_type']) {\n\t\t\t\t\t\t// match found, create instance, and set the property\n\t\t\t\t\t\t$this->_responseFormatInstance = new $supportedFormat['format_class']();\n\t\t\t\t\t\tbreak 2; // dont need to loop any further\n\t\t\t\t\t} // end if match found\n\t\t\t\t} // end inner loop (supported)\n\t\t\t} // end outer loop (requested)\n\t\t\t\n\t\t\t### if the format class was not set (and json class exists as it MUST), set it as json\n\t\t\tif ( is_null($this->_responseFormatInstance) && class_exists('ResponseFormatJSON') ) {\n\t\t\t\t// set the property as an instance of ResponseFormatJSON (a default response format/ failsafe)\n\t\t\t\t$this->_responseFormatInstance = new ResponseFormatJSON(); // included in addResponseFormat()\n\t\t\t}\n\t\t\t# if the instance is null and the json class D.N.E, normal json_encode will be used on \n\t\t\t# the response (which is definitely an error) because the json class d.n.e - automatically added by framework\n\t\t\t\n\t\t} // end if instance is set\n\t\t\n\t\t// the format class instance is not null (set in _responseFormatInstance property) return it\n\t\treturn $this->_responseFormatInstance;\n\t}",
"public function me():ResponseInterface;",
"public function & GetResponse ();",
"public function __construct()\n {\n $fullClassName = explode('\\\\', get_class($this));\n $this->type = (string)array_pop($fullClassName);\n }",
"function __construct()\r\n {\r\n parent::__construct(HttpStatusCode::OK);\r\n }",
"public function createResponse(): IResponse;",
"function responCls($class)\n\t{\n\t\t$result = $class[2];\n\t\t$queue = array();\n\t\t\n\t\t//remove all width classes\n\t\tforeach ($this->prefixes as $prefix) {\n\t\t\tif($result && preg_match_all('@' . preg_quote($prefix) . '[^\\s]*@', $result, $match)){\n\t\t\t\t$result = preg_replace('@' . preg_quote($prefix) . '[^\\s]*@', ' ', $result);\n\n\t\t\t\tforeach ($match[0] as $m) {\n\t\t\t\t\t$parts = preg_split('@(\\d+)@', $m, -1, PREG_SPLIT_DELIM_CAPTURE);\n\t\t\t\t\t$parts[0] = str_replace($prefix, $this->nonrspprefix, $parts[0]);\n\t\t\t\t\tif(!isset($queue[$parts[0]])){\n\t\t\t\t\t\t$queue[$parts[0]] = $parts[1];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(!empty($queue)){\n\t\t\t$result = trim($result); //would be better than preg_replace ?\n\t\t\tforeach ($queue as $key => $value) {\n\t\t\t\t$result .= ' ' . $key . $value;\t\n\t\t\t}\n\t\t}\n\n\t\treturn 'class=\"' . trim($result) . '\"';\n\t}",
"public function create(string $class);",
"public function __construct( array $response = array() ) {\n\t\t$this->response = $response;\n\t}",
"public static function response(): Response\n {\n return new Response;\n }",
"public function __construct($response)\n {\n $this->init($response);\n\n }",
"public function __construct(Response $response) {\n parent::__construct('', 500);\n $this->response = $response;\n }",
"public static function fromResponse(Response $response, string $class): static\n {\n $collection = static::make($response->json('data'))->mapInto($class);\n\n if ($links = $response->json('links')) {\n $collection->setLinks($links);\n }\n\n if ($meta = $response->json('meta')) {\n $collection->setMeta($meta);\n }\n\n return $collection;\n }",
"public function getClassName() {}",
"public function getClassName() {}",
"public function getClassName() {}",
"public function getClassName() {}",
"public static function factory($raw_message = null, $class_name = null) {}",
"public function makeResponse(): ResponseInterface;",
"public function handleRequests() {\r\n $response = null;\r\n try {\r\n $urlArray = $this->uri->uri_to_assoc(3);\r\n if (array_key_exists('login', $urlArray)) {\r\n $response = self::postLogin();\r\n } else {\r\n $login = self::clientLogin();\r\n $response = self::instantiateRequestedClass($urlArray, $login);\r\n }\r\n } catch (Exception $ex) {\r\n $response = $this->apiv1_core->errorResponse($ex->getCode(), $ex->getMessage());\r\n }\r\n\r\n $httpcode = substr($response['code'], 0, 3);\r\n\r\n $name = '';\r\n foreach ($urlArray as $key => $value) {\r\n $this->$key = $value;\r\n $name = ucfirst($key);\r\n }\r\n $method = strtolower($this->input->server('REQUEST_METHOD')) . $name;\r\n $reqParam = $this->input->get() ? $this->input->get() : file_get_contents(\"php://input\");\r\n\r\n $msg = array(\r\n 'resourceURL' => $this->uri->assoc_to_uri($urlArray),\r\n 'className' => $response['className'],\r\n 'methodName' => $method,\r\n 'requestJSON' => json_encode($reqParam),\r\n 'responseHTTP' => $httpcode,\r\n 'responseJSON' => ($response['message']) ? json_encode($response) : json_encode($response['res']),\r\n );\r\n\r\n $logCid = isset($urlArray['account']) ? $urlArray['account'] : NULL;\r\n dblog_message(LOG_LEVEL_INFO, LOG_TYPE_API, \"API: \" . \r\n $this->input->server('REQUEST_METHOD') . \" \" .\r\n $this->uri->assoc_to_uri($urlArray) . \"\\n\" . print_r($msg, TRUE), $logCid);\r\n\r\n header(\"Content-Type: application/json\");\r\n header(\"HTTP/1.1 $httpcode\", true, $httpcode);\r\n\r\n if ($response['message']) {\r\n echo json_encode($response);\r\n } else {\r\n echo json_encode($response['res']);\r\n }\r\n return;\r\n }",
"public function handledClass();",
"public function __construct(Response $response)\n {\n $this->response = $response;\n }",
"public function getApiClass(): string\n {\n return $this->apiClass;\n }",
"public function __construct(array $response = array())\n {\n $this->response = $response;\n }",
"public function __construct(array $response = array())\n {\n $this->response = $response;\n }",
"public function __construct(array $response = array())\n {\n $this->response = $response;\n }",
"public function __construct(array $response = array())\n {\n $this->response = $response;\n }",
"public function & SetRequestClass ($requestClass);",
"function json_response() {\n return app(JsonResponse::class);\n }",
"public function createResponse()\n {\n return new Response;\n }",
"public function Response($response);",
"public function getClassName() : string;",
"public function __construct(Request $request, Response $response)\n\t{\n\t\tparent::__construct($request, $response);\t\n\t}",
"public function __construct(Request $request, Response $response)\n\t{\n\t\tparent::__construct($request, $response);\t\n\t}",
"public function __construct(Request $request, Response $response)\n\t{\n\t\tparent::__construct($request, $response);\t\n\t}",
"public function Response($response) {\n\t\t\n\t}",
"public function getResponse()\n {\n }",
"public function response ();",
"public function getClassName() ;",
"function __construct(ResponseFactory $response)\n {\n $this->response = $response;\n }",
"public function __construct($response){\n \n $this->_helper = new Helper();\n \n $this->_response = $response;\n \n }",
"public function getResponse($response) {\r\n\r\n\r\n }",
"public function getClass($name = null);",
"public function __construct($class)\r\n {\r\n parent::__construct($class);\r\n }",
"abstract public function provide() :ResponseProvider;",
"public function __call($name, $arguments)\n {\n return $this->_response->$name(...$arguments);\n }",
"public function __construct(string $message, array $response) {\n parent::__construct(\n $message . '(response : ' . json_encode($response) . ')'\n ) ;\n }",
"public function factory_provider(): Response_Factory {\n\t\treturn new Response_Factory( new HTTP() );\n\t}",
"public function getResponseInstance(){\n\t\treturn ControllerResponse::getInstance();\n\t}",
"public function setResponseType() {\n\t\t$uri_end = end($this->registry->router->uri);\n\t\t$this->response_type = substr(strrchr($uri_end,'.'),1);\n\t\t\n\t\tif($this->response_type) {\n\t\t\t\n\t\t\t// remove the extension from the method so that it loads properly\n\t\t\t$response_index = count($this->registry->router->uri) - 1;\n\t\t\t$this->registry->router->uri[$response_index] = str_replace(\".\".$this->response_type,'',$this->registry->router->uri[$response_index]);\n\t\t\t\n\t\t} else {\n\t\t\techo \"no response type defined\";\n\t\t\texit;\n\t\t}\n\t}",
"public function getResponse() {\n }",
"public function getClassName(): string;",
"public function getResponse() {}",
"public function getResponse() {}",
"function __construct(array $data) {\n global $slim;\n $slim->response->headers->set('Content-Type', 'application/json');\n parent::__construct($data);\n }",
"public function instantiate($className);",
"function __construct($service) {\n // return new $class;\n }",
"private function bodyToClass()\n {\n $ticket = $this->readTicket();\n\n if(isset($ticket->{$this->classname})) {\n $this->classReturn = $ticket->{$this->classname};\n } else {\n $this->classReturn = $ticket;\n }\n\n }",
"public function __construct($className)\n {\n $this->className = $className;\n }",
"protected function createHttpResponse()\n {\n return new Response();\n }",
"public static function forge($type)\n\t{\n\t\t$args = func_get_args();\n\t\tarray_shift($args);\n\n\t\treturn static::getContainer()->get('response.'.$type, $args);\n\t}"
] | [
"0.79724103",
"0.75091696",
"0.70144874",
"0.6922975",
"0.68510425",
"0.66158694",
"0.6521042",
"0.6493877",
"0.64865637",
"0.64300823",
"0.6409179",
"0.63861394",
"0.63861394",
"0.6197521",
"0.61401105",
"0.6137356",
"0.61224264",
"0.6116626",
"0.6109231",
"0.6087968",
"0.60627484",
"0.60455006",
"0.5978589",
"0.5954427",
"0.5938909",
"0.58958226",
"0.5857176",
"0.5810829",
"0.5806982",
"0.578652",
"0.5771063",
"0.5769663",
"0.5762603",
"0.5762603",
"0.5762603",
"0.5762603",
"0.5750946",
"0.57285684",
"0.57234067",
"0.57147616",
"0.5705189",
"0.57051355",
"0.570012",
"0.5699086",
"0.56868786",
"0.56733817",
"0.5656428",
"0.56523675",
"0.56306916",
"0.56037676",
"0.560335",
"0.5595828",
"0.55922365",
"0.55922365",
"0.55922365",
"0.55922365",
"0.55913734",
"0.55711555",
"0.5569218",
"0.55422",
"0.5540873",
"0.5521917",
"0.55147237",
"0.55147237",
"0.55147237",
"0.55147237",
"0.5514036",
"0.54995435",
"0.5487287",
"0.5473344",
"0.5472077",
"0.5463424",
"0.5463424",
"0.5463424",
"0.5455921",
"0.5443343",
"0.54382324",
"0.54136264",
"0.5401065",
"0.5398985",
"0.53939867",
"0.53895944",
"0.5387072",
"0.5381612",
"0.53688675",
"0.5366648",
"0.53646684",
"0.5363437",
"0.53568274",
"0.53487897",
"0.5342321",
"0.5332961",
"0.5332961",
"0.5332282",
"0.53306484",
"0.53248197",
"0.53136575",
"0.5313007",
"0.53127205",
"0.5304909"
] | 0.64066005 | 11 |
Get the raw data array for this message. The format of this varies from gateway to gateway, but will usually be either an associative array, or a SimpleXMLElement. | public function getData(): array
{
$data = [];
if ($pan = $this->getPan()) {
$data['pan'] = $pan;
}
if ($bindingId = $this->getBindingId()) {
$data['bindingId'] = $bindingId;
}
if (\count($data) === 0) {
throw new InvalidArgumentException('You must provide pan or bindingId to data');
}
if ($showExpired = $this->getShowExpired()) {
$data['showExpired'] = ($showExpired === 'true') ? 'true' : 'false';
}
return $data;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function data()\n {\n return [\n 'MsgType' => $this->type(),\n 'MsgContent' => [\n 'UUID' => $this->UUID,\n 'ImageFormat' => $this->ImageFormat,\n 'ImageInfoArray' => $this->ImageInfoArray,\n ],\n ];\n }",
"public function getData()\n {\n return $this->raw;\n }",
"public function getRawData() {\n return $this->rawData;\n }",
"public function getMessageData()\n {\n return (array) array();\n }",
"public static function getRawData()\n {\n return self::$rawData;\n }",
"public function toArray(): array\n {\n return $this->rawData;\n }",
"public function getRaw() : array\n {\n return $this->raw;\n }",
"public function get_raw_data() {\n\t\treturn $this->raw_data;\n\t}",
"public function getRawData()\n {\n return $this->getProperty('raw_data');\n }",
"public function getRaw(): array\n {\n return $this->raw;\n }",
"abstract public function getRawPostPayload() : array;",
"public function getRawData();",
"public function getRawData();",
"public function getRawData() {}",
"public function raw(): array\n\t{\n\t\treturn $this->configData;\n\t}",
"public function getData()\n {\n $this->validateData();\n $data = array(\n \"service\" => $this->getService(),\n \"partner\" => $this->getPartner(),\n \"_input_charset\" => $this->getInputCharset(),\n \"notify_url\" => $this->getNotifyUrl(),\n \"account_name\" => $this->getAccountName(),\n \"email\" => $this->getEmail(),\n \"detail_data\" => $this->getDetailData(),\n \"batch_no\" => $this->getBatchNo(),\n \"batch_num\" => $this->getBatchNum(),\n \"batch_fee\" => $this->getBatchFee(),\n \"pay_date\" => $this->getPayDate(),\n );\n $data = array_filter($data);\n $data['sign'] = $this->getParamsSignature($data);\n $data['sign_type'] = $this->getSignType();\n return $data;\n }",
"public function getData()\n {\n unset($this->data['version']);\n unset($this->data['locale']);\n unset($this->data['privateKey']);\n unset($this->data['gatewayCertificate']);\n unset($this->data['testMode']);\n\n $this->data['TranMessage'] = self::CODES[$this->data['TranCode'] ?? '-'] ?? '';\n\n return $this->data;\n }",
"public static function getRawData() {\n\t\tif (static::$rawData === null) {\n\t\t\tstatic::$rawData = file_get_contents('php://input');\n\t\t}\n\n\t\treturn static::$rawData;\n\t}",
"public function getRawData($format = self::RawDataArray) {\n return $this->data;\n }",
"public function getAsArray() {\n return $this->message;\n }",
"public function getData () : array {\n\t\treturn $this->data;\n\t}",
"public function getRawBody()\n {\n return $this->rawMessage;\n }",
"function getRawData()\n {\n $this->mkHeaders();\n $out = \"\";\n if ($this->mailto) {\n foreach ($this->mailto as $res) $out .= \"TO: \" . $res . \"<br /><br />\\n\";\n }\n $out .= \"SUBJECT: \" . $this->mailsubj . \"<br /><br />\\n\";\n $out .= \"MESSAGE: \" . $this->mailbody . \"<br /><br />\\n\";\n $out .= \"HEADERS: \" . htmlentities($this->mailheaders) . \"<br /><br />\\n\";\n return $out;\n }",
"public function getData() : array\n {\n return $this->data;\n }",
"public function getData() : array\n {\n return $this->data;\n }",
"public function getData() : array\n {\n return $this->data;\n }",
"public function getData()\n\t{\n\t\treturn $this->arrData;\n\t}",
"public function getData()\n\t{\n\t\treturn $this->arrData;\n\t}",
"public function toArray() {\n\n\t\tif (! $this->isMessagePrepared()) {\n\t\t\t$this->prepareMessage();\n\t\t}\n\n\t\t$values = array(\n\t\t\t'sender' => $this->formatAddresses($this->getSender()),\n\t\t\t'recipient' => $this->formatAddresses($this->getTo()), // @todo change me! recipient has been deprecated in favor of \"to\".\n\t\t\t'to' => $this->formatAddresses($this->getTo()),\n\t\t\t'cc' => $this->formatAddresses($this->getCc()),\n\t\t\t'bcc' => $this->formatAddresses($this->getBcc()),\n\t\t\t'reply_to' => $this->formatAddresses($this->getReplyTo()),\n\t\t\t'subject' => $this->getMailMessage()->getSubject(),\n\t\t\t'body' => $this->getMailMessage()->getBody(),\n\t\t\t'attachment' => count($this->getMailMessage()->getChildren()),\n\t\t\t'context' => (string)GeneralUtility::getApplicationContext(),\n\t\t\t'was_opened' => 0,\n\t\t\t'message_template' => $this->messageTemplate->getUid(),\n\t\t\t'message_layout' => is_object($this->messageLayout) ? $this->messageLayout->getUid() : 0,\n\t\t\t'sent_time' => time(),\n\t\t\t'mailing' => is_object($this->mailing) ? $this->mailing->getUid() : 0,\n\t\t);\n\n\t\treturn $values;\n\t}",
"protected function getEmailData()\n {\n $message = ZendMessage::fromString($this->getMessage()->getRawMessage());\n\n return [\n 'to' => $this->prepareRecipients($message),\n 'subject' => $this->prepareSubject($message),\n 'content' => $this->getMessage()->getDecodedBodyText()\n ];\n }",
"public function getData()\n {\n return $this->getRefundId()\n ? []\n : [\n 'type' => 'PAYSAFECARD',\n 'capture' => $this->shouldCapture(),\n 'amount' => $this->getAmount(),\n 'currency' => $this->getCurrency(),\n 'customer' => $this->getCustomerDetails(),\n ];\n }",
"protected function getData(): array\n {\n if (!is_array($this->data)) {\n return [];\n }\n return $this->data;\n }",
"public function getData() {\n return $this->parse()['data'];\n }",
"public function getData(): array\n\t{\n\t\treturn $this->data;\n\t}",
"private function getPayload()\n {\n if (count($this->_messages) === 1) {\n return $this->_messages[0]->getContent();\n }\n\n $payload = [];\n foreach ($this->_messages as $message) {\n $payload[] = $message->getContent();\n }\n\n return $payload;\n\n }",
"public function getData()\n {\n $this->validate('transactionReference', 'amount');\n\n return [\n 'amount' => [\n 'currency' => $this->currency,\n 'total' => $this->amount,\n ],\n 'is_final_capture' => true,\n ];\n }",
"public function toArray()\n {\n $message = [\n 'from' => $this->from,\n 'message' => $this->message,\n ];\n\n return $message;\n }",
"public function getData()\n {\n return $this->data->reply;\n }",
"public function getData()\n {\n return array(\n\n );\n }",
"public function getArray() {\n\t\treturn $this->data; \n\t}",
"public function getArray() {\n\t\treturn $this->data; \n\t}",
"public function getData() {\n\t\treturn $this->_data;\n\t}",
"public function getData() {\n\t\treturn $this->_data;\n\t}",
"public function getData() {\n\t\treturn $this->_data;\n\t}",
"public function getData() {\n\t\treturn $this->_data;\n\t}",
"public function getData() {\n\t\treturn $this->_data;\n\t}",
"public function getData()\n\t\t{\n\t\t\treturn $this->_data;\n\t\t}",
"public function getData() {\n if ($this->_multiple) {\n return $this->_data;\n }\n return isset($this->_data[0])? $this->_data[0] : [];\n }",
"public function getData() {\n return $this->_data;\n }",
"public function getData() {\n return $this->_data;\n }",
"protected function getData()\n {\n return $this->mixed;\n }",
"public function getResponseData()\n {\n return json_decode($this->responseData);\n }",
"public function getData() {\n\t\treturn $this->Data;\n\t}",
"public function getData(): array\n {\n return $this->data;\n }",
"public function getData(): array\n {\n return $this->data;\n }",
"public function getData(): array\n {\n return $this->data;\n }",
"public function getData()\n {\n $rtn = $this->data['data'];\n\n return $rtn;\n }",
"public function getResponseData(): array\n {\n $this->build();\n\n return $this->responseData;\n }",
"public function getPayload(): array;",
"public function getPayload(): array;",
"public function get_raw_data() {\n\t\treturn $this->rule_data;\n\t}",
"public function getData() {\n\t\treturn $this->data;\n\t}",
"public function getData() {\n\t\treturn $this->data;\n\t}",
"public function asArray()\n {\n return $this->data;\n }",
"public function getData() {\r\n return $this->modx->fromJSON($this->getProperty('data'));\r\n }",
"public function getData()\n\t{\n\t\treturn $this->_data;\n\t}",
"public function payload()\n {\n $payload = parent::payload();\n\n $payload['job'] = $this->handler;\n\n $payload['data'] = unserialize($payload['Message']);\n\n return $payload;\n }",
"public function asArray()\r\n {\r\n return $this->data;\r\n }",
"public function getBody(): array\n {\n if (empty($this->message)) {\n $this->message = $this->generateMessage();\n }\n\n return $this->message;\n }",
"public function getData()\n {\n return $this->_data;\n }",
"public function getData()\n {\n return $this->_data;\n }",
"public function getData()\n {\n return $this->_data;\n }",
"public function getData()\n {\n return $this->_data;\n }",
"public function getData()\n {\n return $this->_data;\n }",
"public function getData()\n {\n return $this->_data;\n }",
"public function getData()\n\t{\n\t\treturn $this->data;\n\t}",
"public function getData()\n\t{\n\t\treturn $this->data;\n\t}",
"public function getData()\n\t{\n\t\treturn $this->data;\n\t}",
"public function getData()\n\t{\n\t\treturn $this->data;\n\t}",
"public function getData() {\r\n\t\treturn $this->_data;\r\n\t}",
"public function getRawData()\n\t{\n\n\t\treturn @file_get_contents($this->tmpFileName);\n\n\t}",
"public function data() : array\n {\n return $this->data->toArray();\n }",
"public function Data()\n {\n return $this->parseobject($this->content);\n }",
"public function buildData()\n {\n $message = $this->getMessage();\n\n if ($this->data == []) {\n return [\n 'success' => false,\n 'message' => $message\n ];\n }\n\n return [\n 'success' => false,\n 'message' => $message,\n 'data' => (object) $this->data\n ];\n }",
"public function getResponseData(): array\n {\n $responseData = [\n 'success' => $this->isSuccessful(),\n 'data' => $this->data,\n ];\n\n if ($this->error && !$this->isSuccessful()) {\n $responseData['error'] = $this->getErrorData();\n }\n\n if ($this->message) {\n $responseData['message'] = $this->message;\n }\n\n if (!empty($this->meta)) {\n $responseData['meta'] = $this->meta;\n }\n\n $responseData += ($this->fields ?: []);\n\n return $responseData;\n }",
"public static function get_raw_data()\n {\n }",
"public static function get_raw_data()\n {\n }",
"public function getStanzaData() {\r\n return [\r\n 'id' => $this->id,\r\n 'floor' => $this->floor,\r\n 'roomNumber' => $this->roomNumber,\r\n 'beds' => $this->beds,\r\n ];\r\n }",
"public function getData()\n {\n $this->validate('app_id', 'mch_id', 'sub_mch_id', 'out_trade_no', 'cert_path', 'key_path');\n\n $data = array (\n 'appid' => $this->getAppId(),\n 'mch_id' => $this->getMchId(),\n 'sub_mch_id' => $this->getSubMchId(),\n 'device_info' => $this->getDeviceInfo(),//<>\n 'transaction_id' => $this->getTransactionId(),\n 'out_trade_no' => $this->getOutTradeNo(),\n 'out_refund_no' => $this->getOutRefundNo(),\n 'total_fee' => $this->getTotalFee(),\n 'refund_fee' => $this->getRefundFee(),\n 'refund_fee_type' => $this->getRefundFee(),//<>\n 'op_user_id' => $this->getOpUserId() ?: $this->getMchId(),\n 'nonce_str' => md5(uniqid()),\n );\n\n $data = array_filter($data);\n\n $data['sign'] = Helper::sign($data, $this->getApiKey());\n\n return $data;\n }",
"public function getData()\n {\n return $this->Data;\n }",
"protected function _getData()\n {\n $data = Transform::toUInt8($this->_format);\n foreach ($this->_events as $timestamp => $type)\n $data .= Transform::toUInt8($type) . Transform::toUInt32BE($timestamp);\n return $data;\n }",
"public function get_raw_data()\n {\n }",
"public function get_raw_data()\n {\n }",
"public function getData()\n\t{\n if ( is_string($this->_data) ) {\n return $this->_data; \n }\n\t\telse \n return $this->_internal_request->to_postdata();\n\t}",
"public /*array*/ function toArray()\n\t{\n\t\treturn $this->_data;\n\t}",
"public function getData(): array\n\t{\n\t\treturn [\n\t\t\t'status' => $this->status,\n\t\t\t'statusMessage' => $this->statusMessage,\n\t\t\t'formattedStatusMessage' => $this->getFormattedStatusMessage(),\n\t\t\t'step' => $this->step,\n\t\t];\n\t}",
"public function getData() {\n return $this->data;\n }",
"public function getData() {\n return $this->data;\n }",
"public function getData() {\n return $this->data;\n }",
"public function getData() {\n return $this->data;\n }",
"public function getData() {\n return $this->data;\n }"
] | [
"0.7381358",
"0.7207645",
"0.7182269",
"0.7099539",
"0.69754446",
"0.69528323",
"0.6951559",
"0.69264436",
"0.6905849",
"0.68478644",
"0.6784603",
"0.6754725",
"0.6754725",
"0.67492914",
"0.6634363",
"0.66209763",
"0.6611004",
"0.6585039",
"0.65539056",
"0.6519298",
"0.6512443",
"0.6502014",
"0.64762384",
"0.6464749",
"0.6464749",
"0.6464749",
"0.64242923",
"0.64242923",
"0.6404817",
"0.63855267",
"0.6334809",
"0.632578",
"0.6317526",
"0.630814",
"0.6303466",
"0.6299478",
"0.6295554",
"0.62870765",
"0.6271214",
"0.62701374",
"0.62701374",
"0.6257438",
"0.6257438",
"0.6257438",
"0.6257438",
"0.6257438",
"0.62569565",
"0.625301",
"0.6248256",
"0.6248256",
"0.62467545",
"0.6242481",
"0.6239889",
"0.62398225",
"0.62398225",
"0.62398225",
"0.62369365",
"0.6235097",
"0.6233613",
"0.6233613",
"0.6228557",
"0.62265474",
"0.62265474",
"0.62185913",
"0.6211996",
"0.6207697",
"0.6206689",
"0.62043315",
"0.62032706",
"0.61923695",
"0.61923695",
"0.61923695",
"0.61923695",
"0.61923695",
"0.61923695",
"0.6191948",
"0.6191948",
"0.6191948",
"0.6191948",
"0.6169913",
"0.61624485",
"0.6158361",
"0.6156258",
"0.6156229",
"0.615607",
"0.61559993",
"0.61559993",
"0.61521554",
"0.6149306",
"0.61487293",
"0.61451375",
"0.6137679",
"0.61376494",
"0.6128552",
"0.61212194",
"0.6121074",
"0.6115458",
"0.6115458",
"0.61150104",
"0.61150104",
"0.61150104"
] | 0.0 | -1 |
Sets up the fixture, for example, opens a network connection. This method is called before a test is executed. | protected function setUp()
{
$this->object = Qwin::getInstance()->session;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function fixture_setup() {\r\n $this->service = SQLConnectionService::get_instance($this->configuration);\r\n test_data_setup($this->service);\r\n }",
"public function setUp() {\n\t\t$options = [\n\t\t\t'db' => [\n\t\t\t\t'adapter' => 'Connection',\n\t\t\t\t'connection' => $this->_connection,\n\t\t\t\t'fixtures' => $this->_fixtures\n\t\t\t]\n\t\t];\n\n\t\tFixtures::config($options);\n\t\tFixtures::save('db');\n\t}",
"protected function setUp()\n {\n $this->fixture = new Record();\n }",
"protected function setUp(): void\n {\n parent::setUp();\n\n $this->load();\n }",
"protected function setUp()\n {\n\t global $sys_datacite_username, $sys_datacite_password, $sys_datacite_url ;\n\n\t $this->client = new DataCiteClient($sys_datacite_username, $sys_datacite_password);\n $this->client->setDataciteUrl($sys_datacite_url);\n }",
"protected function setUp()\n {\n $this->fixture = new Configuration();\n }",
"public function setUp() {\r\n // and doing it every test slows the tests down to a crawl\r\n $this->sharedFixture = new MovieLensDataSet(DATA_DIR);\r\n }",
"public function setUp()\n {\n parent::setUp();\n $this->prepareForTests();\n }",
"protected function setUp() {\n\n $this->client = new Client(['base_uri' => getenv('API_ADDR')]);\n $this->locIDs = $this->insertTestLocations();\n reuse_generateXML();\n }",
"protected function setUp(): void\n {\n $servername = '18.222.31.30';\n $username = 'phpclient';\n $password = 'leftoverkillerphp';\n $dbname = 'leftover_killer';\n self::$RecipeModel = new GetRecipeDetails($servername, $username, $password, $dbname);\n }",
"public function setUp()\n {\n\n $this->db = Db::getActive();\n $this->response = Response::getActive();\n\n }",
"protected function setUp() {\n parent::setUp ();\n $this->storage = new Storage();\r\n $this->connectDB();\r\n $this->cleanDB();\r\n $this->createUser();\n $this->storage->connect($this->dbh);\n }",
"protected function setUp() {\r\n\t\tparent::setUp ();\r\n\t\t$this->storage = new Storage ( );\r\n\t\t$this->connectDB();\r\n\t\t$this->cleanDB ();\r\n\t\t$this->createUser ();\r\n\t\t$this->storage->connect ( $this->dbh );\n\t}",
"public function setUp() {\n $this->fixture= new FreeTdsLookup($this->getClass()->getPackage()->getResourceAsStream('freetds.conf'));\n }",
"public static function setUpBeforeClass(): void\r\n {\r\n self::$MemoryTestAsset = new MemoryTestAsset();\r\n\r\n self::$clients = self::$MemoryTestAsset->getClients();\r\n self::$ClientsStorage = self::$MemoryTestAsset->getClientsStorage();\r\n }",
"public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}",
"public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}",
"public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}",
"public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}",
"public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}",
"protected function setUp()\n {\n parent::setUp();\n $config = new LocalConfiguration();\n $this->local = new Local($config);\n }",
"function setUp() {\n\t\t$this->originalIsRunningTest = self::$is_running_test;\n\t\tself::$is_running_test = true;\n\t\t\n\t\t// Remove password validation\n\t\t$this->originalMemberPasswordValidator = Member::password_validator();\n\t\t$this->originalRequirements = Requirements::backend();\n\t\tMember::set_password_validator(null);\n\t\tCookie::set_report_errors(false);\n\n\t\t$className = get_class($this);\n\t\t$fixtureFile = eval(\"return {$className}::\\$fixture_file;\");\n\t\t\n\t\t// Set up fixture\n\t\tif($fixtureFile) {\n\t\t\tif(substr(DB::getConn()->currentDatabase(),0,5) != 'tmpdb') {\n\t\t\t\t//echo \"Re-creating temp database... \";\n\t\t\t\tself::create_temp_db();\n\t\t\t\t//echo \"done.\\n\";\n\t\t\t}\n\n\t\t\t// This code is a bit misplaced; we want some way of the whole session being reinitialised...\n\t\t\tVersioned::reading_stage(null);\n\n\t\t\tsingleton('DataObject')->flushCache();\n\n\t\t\t$dbadmin = new DatabaseAdmin();\n\t\t\t$dbadmin->clearAllData();\n\t\t\t\n\t\t\t// We have to disable validation while we import the fixtures, as the order in\n\t\t\t// which they are imported doesnt guarantee valid relations until after the\n\t\t\t// import is complete.\n\t\t\t$validationenabled = DataObject::get_validation_enabled();\n\t\t\tDataObject::set_validation_enabled(false);\n\t\t\t$this->fixture = new YamlFixture($fixtureFile);\n\t\t\t$this->fixture->saveIntoDatabase();\n\t\t\tDataObject::set_validation_enabled($validationenabled);\n\t\t}\n\t\t\n\t\t// Set up email\n\t\t$this->originalMailer = Email::mailer();\n\t\t$this->mailer = new TestMailer();\n\t\tEmail::set_mailer($this->mailer);\n\t}",
"protected function setUp() {\n\t\tparent::setUp();\n\n\t\t$this->object = new ControllerFixture([\n\t\t\t'module' => 'module',\n\t\t\t'controller' => 'controller',\n\t\t\t'action' => 'action',\n\t\t\t'args' => [100, 25]\n\t\t]);\n\n\t\t// Used by throwError()\n\t\tTiton::router()->initialize();\n\t}",
"protected function setUp(): void\n {\n \tparent::setUp();\n\n \t$this->authorize();\n\n \t$this->loadFixtures([\n \t\t'product'=>ProductFixture::class\n \t]);\n }",
"protected function setUp()\n {\n $this->fixture = new NamespaceDescriptor();\n }",
"public function setUp()\n {\n $this->fixture = new Finder();\n }",
"protected function setUp(): void\n {\n $this->fixture = new TestSubjectDescriptor();\n }",
"function setUp() {\n\t\t$this->originalIsRunningTest = self::$is_running_test;\n\t\tself::$is_running_test = true;\n\t\t\n\t\t// i18n needs to be set to the defaults or tests fail\n\t\ti18n::set_locale(i18n::default_locale());\n\t\ti18n::set_date_format(null);\n\t\ti18n::set_time_format(null);\n\t\t\n\t\t// Remove password validation\n\t\t$this->originalMemberPasswordValidator = Member::password_validator();\n\t\t$this->originalRequirements = Requirements::backend();\n\t\tMember::set_password_validator(null);\n\t\tCookie::set_report_errors(false);\n\t\t\n\t\tif(class_exists('RootURLController')) RootURLController::reset();\n\t\tif(class_exists('Translatable')) Translatable::reset();\n\t\tVersioned::reset();\n\t\tDataObject::reset();\n\t\tif(class_exists('SiteTree')) SiteTree::reset();\n\t\tHierarchy::reset();\n\t\tif(Controller::has_curr()) Controller::curr()->setSession(new Session(array()));\n\t\t\n\t\t$this->originalTheme = SSViewer::current_theme();\n\t\t\n\t\tif(class_exists('SiteTree')) {\n\t\t\t// Save nested_urls state, so we can restore it later\n\t\t\t$this->originalNestedURLsState = SiteTree::nested_urls();\n\t\t}\n\n\t\t$className = get_class($this);\n\t\t$fixtureFile = eval(\"return {$className}::\\$fixture_file;\");\n\t\t$prefix = defined('SS_DATABASE_PREFIX') ? SS_DATABASE_PREFIX : 'ss_';\n\n\t\t// Set up fixture\n\t\tif($fixtureFile || $this->usesDatabase || !self::using_temp_db()) {\n\t\t\tif(substr(DB::getConn()->currentDatabase(), 0, strlen($prefix) + 5) != strtolower(sprintf('%stmpdb', $prefix))) {\n\t\t\t\t//echo \"Re-creating temp database... \";\n\t\t\t\tself::create_temp_db();\n\t\t\t\t//echo \"done.\\n\";\n\t\t\t}\n\n\t\t\tsingleton('DataObject')->flushCache();\n\t\t\t\n\t\t\tself::empty_temp_db();\n\t\t\t\n\t\t\tforeach($this->requireDefaultRecordsFrom as $className) {\n\t\t\t\t$instance = singleton($className);\n\t\t\t\tif (method_exists($instance, 'requireDefaultRecords')) $instance->requireDefaultRecords();\n\t\t\t\tif (method_exists($instance, 'augmentDefaultRecords')) $instance->augmentDefaultRecords();\n\t\t\t}\n\n\t\t\tif($fixtureFile) {\n\t\t\t\t$pathForClass = $this->getCurrentAbsolutePath();\n\t\t\t\t$fixtureFiles = (is_array($fixtureFile)) ? $fixtureFile : array($fixtureFile);\n\n\t\t\t\t$i = 0;\n\t\t\t\tforeach($fixtureFiles as $fixtureFilePath) {\n\t\t\t\t\t// Support fixture paths relative to the test class, rather than relative to webroot\n\t\t\t\t\t// String checking is faster than file_exists() calls.\n\t\t\t\t\t$isRelativeToFile = (strpos('/', $fixtureFilePath) === false || preg_match('/^\\.\\./', $fixtureFilePath));\n\t\t\t\t\tif($isRelativeToFile) {\n\t\t\t\t\t\t$resolvedPath = realpath($pathForClass . '/' . $fixtureFilePath);\n\t\t\t\t\t\tif($resolvedPath) $fixtureFilePath = $resolvedPath;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$fixture = new YamlFixture($fixtureFilePath);\n\t\t\t\t\t$fixture->saveIntoDatabase();\n\t\t\t\t\t$this->fixtures[] = $fixture;\n\n\t\t\t\t\t// backwards compatibility: Load first fixture into $this->fixture\n\t\t\t\t\tif($i == 0) $this->fixture = $fixture;\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->logInWithPermission(\"ADMIN\");\n\t\t}\n\t\t\n\t\t// Set up email\n\t\t$this->originalMailer = Email::mailer();\n\t\t$this->mailer = new TestMailer();\n\t\tEmail::set_mailer($this->mailer);\n\t\tEmail::send_all_emails_to(null);\n\t\t\n\t\t// Preserve memory settings\n\t\t$this->originalMemoryLimit = ini_get('memory_limit');\n\t}",
"public function setUp(): void\n {\n $this->fixture = new Finder();\n }",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp()\n {\n $this->request = new Request();\n $this->response = new Response();\n\n $this->request->load();\n $this->response->load();\n }",
"protected function setUp()\n {\n $this->request = new Request();\n $this->response = new Response();\n\n $this->request->load();\n $this->response->load();\n }",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}"
] | [
"0.7592421",
"0.7170481",
"0.6926806",
"0.69099826",
"0.6890797",
"0.6882697",
"0.68143797",
"0.68031055",
"0.6752615",
"0.6752469",
"0.6745298",
"0.6732061",
"0.67128885",
"0.67059344",
"0.6701692",
"0.6682299",
"0.6682299",
"0.6682299",
"0.6682299",
"0.6682299",
"0.6679019",
"0.6676617",
"0.6672804",
"0.6669872",
"0.66469216",
"0.6645176",
"0.6644375",
"0.66361",
"0.6617653",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617297",
"0.6617178",
"0.6617178",
"0.6616965",
"0.6616965",
"0.6616744",
"0.6616744",
"0.6616744",
"0.6616744",
"0.6616744",
"0.6616744",
"0.6616744",
"0.6616744",
"0.6616744",
"0.6616744"
] | 0.0 | -1 |
Tears down the fixture, for example, closes a network connection. This method is called after a test is executed. | protected function tearDown()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function tearDown(): void\n {\n parent::tearDown();\n\n Mockery::close();\n\n unset($this->faker, $this->waqi);\n }",
"public function teardown()\n {\n //\n }",
"protected function tearDown(): void\n\t{\n\t\tglobal $modSettings;\n\n\t\t// remove temporary test data\n\t\tunset($modSettings);\n\t}",
"public function teardown()\n {\n }",
"public function tearDown()\n {\n unset(\n $this->plugins,\n $this->events,\n $this->connection,\n $this->config\n );\n }",
"public function _after(TestCase $test)\n {\n $this->unloadFixtures();\n }",
"public function tearDown()\n {\n unset($this->app);\n unset($this->client);\n\n m::close();\n }",
"protected function tearDown(): void\n {\n self::$driver->close();\n }",
"public function tearDown()\n\t{\n\t\tm::close();\n\t}",
"protected function tearDown()\n {\n if ($this->databaseTester !== null) {\n if (method_exists($this, 'getTearDownOperation')) {\n $this->getDatabaseTester()->setTearDownOperation($this->getTearDownOperation());\n }\n if (method_exists($this, 'getDataSet')) {\n $this->getDatabaseTester()->setDataSet($this->getDataSet());\n }\n $this->getDatabaseTester()->onTearDown();\n }\n\n $this->databaseTester = null;\n\n set_time_limit(0);\n }",
"public function tearDown() {\n\t\tFixtures::clear('db');\n\t\tGalleries::reset();\n\t\tImages::reset();\n\t}",
"function teardown() {\n // close database connection\n $this->conn = null;\n }",
"protected function tearDown()\r\n {\r\n DirectoryManager::recursiveRemoveDir('data/tests');\r\n }",
"protected function tearDown() {\r\n\t\t$this->dbh = null;\r\n\t\t$this->storage = null;\r\n\t\tparent::tearDown ();\r\n\t}",
"protected function tearDown(): void\n {\n $this->closeDatabase();\n }",
"protected function tearDown() {\n\t\tm::close();\n\t}",
"public function tearDown()\n\t{\n\t\t$this->beforeApplicationDestroyed(function () {\n\t\t\tDB::disconnect();\n\t\t});\n\t\n\t\t\tparent::tearDown();\n\t\t\t// \t\tMockery::close();\n\t}",
"public function tearDown()\n {\n unset($this->db);\n unset($this->statement);\n unset($this->mockData);\n }",
"protected function tearDown() {\n\t\tparent::tearDown();\n\n\t\t$this->cleanupTestDirectory();\n\t}",
"protected function tearDown()\n {\n $this->testData = null;\n parent::tearDown();\n }",
"protected function tearDown(): void\n {\n $this->provider = null;\n $this->response = null;\n }",
"protected function tearDown(): void\n {\n $client = $this->getProvidedData()[0] ?? null;\n if ($client instanceof Client) {\n $this->logout($client);\n }\n }",
"public function teardown()\n {\n parent::teardown();\n }",
"protected function doTearDown(): void\n {\n }",
"protected function tearDown()\n\t{\n\t\tunset($GLOBALS['__DB__']);\n\n\t\tparent::tearDown();\n\t}",
"public function teardown() {\n m::close();\n }",
"public function tearDownFixtures()\n {\n if (is_array($this->_fixtures)) {\n /** @var ActiveRecordFixture $object */\n foreach ($this->_fixtures as $object) {\n $object->cleanup();\n }\n }\n }",
"protected function tearDown()\n {\n // Make sure any test entities created are deleted\n foreach ($this->testEntities as $entity)\n {\n // Second param is a 'hard' delete which actually purges the data\n $this->entityLoader->delete($entity, true);\n }\n }",
"public function teardown()\n {\n m::close();\n }",
"public function tearDown()\n\t{\n\t\tunset($this->target);\n\t}",
"protected function tearDown ()\n {\n $this->downTest();\n\n parent::tearDown();\n }",
"public function tearDown()\n {\n $fs = new SymfonyFileSystem();\n $fs->remove($this->fakeTestFileDir);\n\n unset($this->builder);\n unset($this->builder);\n unset($this->fs);\n m::close();\n }",
"protected function tearDown(): void\n {\n $this->tearDownTheTestEnvironment();\n }",
"protected function tearDown() {\r\n\t\tunset ( $this->configReader );\r\n\t}",
"protected function tearDown() {\n\t\t$this->sql->Disconnect(__FILE__, __LINE__);\n\t\tsqlsolution_unlink_sqlite($this->sql);\n\t\t$this->sql = null;\n\t}",
"protected function tearDown()\n {\n parent::tearDown();\n\n $this->em->close();\n $this->em = null; // avoid memory leaks\n }",
"protected function tearDown()\n {\n $this->testDBConnector->clearDataFromTables();\n }",
"public function tearDown() {\n\n\t\tparent::tearDown();\n\t\tMockery::close();\n\t}",
"public function tearDown()\n {\n $this->stop();\n }",
"public function tearDown()\n {\n m::close();\n }",
"public function tearDown()\n {\n m::close();\n }",
"public function tearDown()\n {\n m::close();\n }",
"protected function tearDown() {\n\n $this->client = null;\n $this->deleteTestLocations();\n $this->locIDs = null;\n reuse_generateXML();\n }",
"public function tearDown()\n {\n unset($this->helper);\n }",
"public function tearDown()\n\t{\n\t\tunset($this->stub);\n\t}",
"protected function tearDown()\n\t {\n\t\tunset($this->object);\n\n\t\t$conn = $this->getConnection();\n\t\t$db = $conn->getConnection();\n\t\t$db->exec(\"DROP TABLE IF EXISTS `MySQLdatabase`;\");\n\n\t\tunset($GLOBALS[\"errstr\"]);\n\t\tunset($GLOBALS[\"stuckerror\"]);\n\t }",
"protected function tearDown()\n {\n $this->local = null;\n parent::tearDown();\n }",
"protected function tear_down()\n {\n }",
"protected function tear_down()\n {\n }",
"protected function tear_down()\n {\n }",
"protected function tear_down()\n {\n }",
"protected function tear_down()\n {\n }",
"protected function tearDown() {\n $this->dbh = null;\n $this->storage = null;\n parent::tearDown ();\n }",
"public function tear_down()\n {\n }",
"public function tear_down()\n {\n }",
"public function tear_down()\n {\n }",
"protected function tearDown()\n {\n $this->kernel->shutdown();\n $this->kernel = null;\n parent::tearDown();\n }",
"public function tearDown()\n\t{\n\t\t\\Orchestra\\Core::shutdown();\n\n\t\tunset($this->user);\n\t\tunset($this->stub);\n\n\t\tparent::tearDown();\n\t}",
"public function tearDown()\n {\n unset($this->VenusFuelDepot);\n }",
"protected function tearDown()\n\t{\n\t\tunset($this->_instance);\n\t\tparent::tearDown();\n\t}",
"public function tearDown()\n {\n parent::tearDown();\n\n if ((bool) getenv('CLEANUP_TEST_DOCKER_SECRETS')) {\n DockerSecretFile::cleanup();\n }\n }",
"protected function tearDown()\n\t{\n\t\t$this->restoreFactoryState();\n\t}",
"protected function tearDown()\n {\n $this->dataCollector = null;\n parent::tearDown();\n }",
"public function tearDown()\n {\n unset($this->app);\n unset($_SERVER['RouteManagerTest@callback']);\n m::close();\n }",
"protected function tearDown(): void\n {\n $this->config = null;\n $this->container = null;\n $this->instance = null;\n }",
"public function tearDown(){\n\t\t$this->container->get('doctrine')->getConnection()->close();\n\t\n\t\tparent::tearDown();\n\t}",
"protected function tearDown()\n {\n unset($this->app);\n\n m::close();\n }",
"protected function tearDown(): void\n {\n $this->_connection->dropTable($this->_tableName);\n $this->_connection->resetDdlCache($this->_tableName);\n $this->_connection = null;\n }",
"public function tearDown()\n {\n if (null !== $this->ldap) {\n $this->ldap->unbind();\n }\n }",
"public function tearDown()\n {\n $this->deleteAdminUserFixture();\n }",
"public function tearDown()\n {\n $this->flushModelEventListeners();\n parent::tearDown();\n unset($this->app);\n\n /*\n * Restore environment\n */\n if (file_exists(base_path($this->envTestingFile())) && file_exists(base_path('.env.backup'))) {\n $this->restoreEnvironment();\n }\n }",
"public function tearDown()\n {\n unset($this->commonDataClassRepository);\n }",
"protected function tearDown()\n\t{\n\t\tparent::tearDown();\n\t\tEnUser::release();\n\t\tRPCContext::getInstance()->resetSession();\n\t\tRPCContext::getInstance()->unsetSession('global.uid');\n\t\tFragseizeObj::release( $this->uid );\n\t}",
"protected function tearDown()\n {\n $this->client = null;\n }",
"public function tearDown() \n {\n $this->flushSession();\n \n $this->inactiveUser->delete();\n $this->basicUser->delete();\n $this->contactManager->delete();\n $this->projectManager->delete();\n $this->administrator->delete();\n\n parent::tearDown();\n Mockery::close();\n }",
"public function tearDown() {\n // tests using these functions.\n \\mod_forum\\subscriptions::reset_forum_cache();\n\n $this->messagesink->clear();\n $this->messagesink->close();\n unset($this->messagesink);\n\n $this->mailsink->clear();\n $this->mailsink->close();\n unset($this->mailsink);\n }",
"public function tearDown()\n\t{\n\t\tparent::tearDown();\n\t\t$this->databaseTester = NULL;\n\t}",
"public function tearDown(): void\n {\n self::$environ->cleanupTestUploadFiles();\n self::$environ->clean();\n }",
"public function tearDown()\n {\n $this->client = null;\n }",
"protected function tearDown()\n {\n $this->helper = null;\n parent::tearDown();\n }",
"protected function tearDown() {\n\t}",
"protected function tearDown() {\n\t}",
"protected function tearDown() {\n\t}",
"protected function tearDown() {\n\t}",
"protected function tearDown() {\n\t}",
"protected function tearDown() {\n\t}",
"protected function tearDown()\n\t{\n\t\t$this->instance = null;\n\t}",
"public static function tearDownAfterClass(): void\n {\n if (file_exists(static::$ou)) {\n unlink(static::$ou);\n }\n }",
"protected function tearDown()\r\n {\r\n $application = new Application(self::$kernel);\r\n $application->setAutoExit(false);\r\n\r\n $options = array('command' => 'doctrine:database:drop', '--force' => true);\r\n $application->run(new ArrayInput($options));\r\n\r\n parent::tearDown();\r\n\r\n $this->em->close();\r\n $this->em = null;\r\n }",
"protected function tearDown()\n {\n $this->deleteTemporaryFiles();\n }",
"protected function tearDown()\n {\n parent::tearDown();\n if (!is_null($this->em)) {\n $this->em->getConnection()->close();\n }\n }",
"protected function tearDown(): void\n {\n m::close();\n }",
"protected function tearDown(): void\n {\n m::close();\n }",
"protected function tearDown(): void\n {\n m::close();\n }",
"protected function tearDown(): void\n {\n m::close();\n }",
"protected function tearDown(): void\n {\n m::close();\n }",
"protected function tearDown(): void\n {\n m::close();\n }",
"public function tearDown()\n {\n Resistance::reset();\n }",
"protected function tearDown()\n {\n $this->clock = NULL;\n }",
"public function tearDown()\n\t{\n\t\tMockery::close();\n\t}",
"protected function tearDown()\n\t{\n\t\tparent::tearDown ();\n\t\tEnUser::release();\n\t\tRPCContext::getInstance()->resetSession();\n\t\tRPCContext::getInstance()->unsetSession('global.uid');\n\t}"
] | [
"0.73085034",
"0.7238805",
"0.7223046",
"0.7188461",
"0.7188435",
"0.714933",
"0.7141436",
"0.7135038",
"0.7120606",
"0.7104586",
"0.7082648",
"0.7080378",
"0.70787424",
"0.7053767",
"0.70497805",
"0.703357",
"0.70235306",
"0.70159763",
"0.7002275",
"0.7001596",
"0.7000987",
"0.6993526",
"0.69916004",
"0.698286",
"0.6959795",
"0.69573665",
"0.69564736",
"0.69477165",
"0.6939232",
"0.69360495",
"0.6929275",
"0.6927601",
"0.6923523",
"0.69200057",
"0.69107914",
"0.6909982",
"0.6908006",
"0.6901039",
"0.68935215",
"0.6890444",
"0.6890444",
"0.6890444",
"0.68904144",
"0.6890287",
"0.68845636",
"0.68642277",
"0.6863069",
"0.6858973",
"0.6858973",
"0.6858973",
"0.6858973",
"0.6858973",
"0.68554384",
"0.6853015",
"0.6853015",
"0.6853015",
"0.6852734",
"0.68527234",
"0.6845723",
"0.68411696",
"0.6839497",
"0.68341726",
"0.68311834",
"0.6829875",
"0.6812756",
"0.68114704",
"0.6809042",
"0.6808085",
"0.6807916",
"0.68047583",
"0.680173",
"0.6794308",
"0.67930144",
"0.67900205",
"0.6780973",
"0.67752963",
"0.6770919",
"0.6770848",
"0.6769022",
"0.6768637",
"0.6762083",
"0.6762083",
"0.6762083",
"0.6762083",
"0.6762083",
"0.6762083",
"0.6761352",
"0.6760682",
"0.6758833",
"0.67562973",
"0.6754873",
"0.67541283",
"0.67541283",
"0.67541283",
"0.67541283",
"0.67541283",
"0.67541283",
"0.6752504",
"0.6750722",
"0.67498803",
"0.6749673"
] | 0.0 | -1 |
Get a plastic manager instance for the default connection. | protected static function getFacadeAccessor()
{
return static::$app['mysticquent'];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function analogue()\n {\n return Manager::getInstance();\n }",
"protected function getDoctrine_Orm_DefaultManagerConfiguratorService()\n {\n return $this->services['doctrine.orm.default_manager_configurator'] = new \\Doctrine\\Bundle\\DoctrineBundle\\ManagerConfigurator(array(), array());\n }",
"protected function getDoctrine_Orm_DefaultManagerConfiguratorService()\n {\n return $this->services['doctrine.orm.default_manager_configurator'] = new \\Doctrine\\Bundle\\DoctrineBundle\\ManagerConfigurator(array(), array());\n }",
"function getDefaultConnection()\n{\n\tglobal $cman;\n\treturn $cman->getDefault();\n}",
"public function getConnection()\n {\n $eManager = $this->getServiceLocator();\n $entityManager = $eManager->get('doctObjMngr');\n return $entityManager;\n }",
"protected function getManager()\n {\n return $this->manager;\n }",
"public function getManager()\n {\n return $this->manager;\n }",
"public function getManager()\n {\n return $this->manager;\n }",
"public function getManager()\n {\n return $this->manager;\n }",
"public function getManager() {\n return $this->manager;\n }",
"protected function getDefaultConnection()\n {\n return $this->app['config']['quickbooks_manager.default_connection'];\n }",
"protected function getEntityManager()\n {\n $em = $this->getServiceLocator()->get('doctrine.entitymanager.orm_default');\n return $em;\n }",
"public function getManager() {\n return $this->em;\n }",
"public function getManager($name = null)\n {\n // TODO: Implement getManager() method.\n }",
"protected function getObjectManager()\n {\n return $this->managerRegistry->getManager($this->managerName);\n }",
"public function getDefaultConnection()\n {\n return $this->getConnection('default');\n }",
"public function getDefaultConnection(): Connection\n {\n return $this->getConnection($this->default);\n }",
"protected function getDoctrine_Dbal_DefaultConnectionService()\n {\n $a = new \\Doctrine\\DBAL\\Logging\\LoggerChain();\n $a->addLogger(new \\Symfony\\Bridge\\Doctrine\\Logger\\DbalLogger(${($_ = isset($this->services['logger']) ? $this->services['logger'] : $this->services['logger'] = new \\Symfony\\Component\\HttpKernel\\Log\\Logger()) && false ?: '_'}, NULL));\n $a->addLogger(new \\Doctrine\\DBAL\\Logging\\DebugStack());\n\n $b = new \\Doctrine\\DBAL\\Configuration();\n $b->setSQLLogger($a);\n\n $c = new \\Symfony\\Bridge\\Doctrine\\ContainerAwareEventManager($this);\n $c->addEventListener(array(0 => 'loadClassMetadata'), ${($_ = isset($this->services['doctrine.orm.default_listeners.attach_entity_listeners']) ? $this->services['doctrine.orm.default_listeners.attach_entity_listeners'] : $this->services['doctrine.orm.default_listeners.attach_entity_listeners'] = new \\Doctrine\\ORM\\Tools\\AttachEntityListenersListener()) && false ?: '_'});\n\n return $this->services['doctrine.dbal.default_connection'] = ${($_ = isset($this->services['doctrine.dbal.connection_factory']) ? $this->services['doctrine.dbal.connection_factory'] : $this->services['doctrine.dbal.connection_factory'] = new \\Doctrine\\Bundle\\DoctrineBundle\\ConnectionFactory(array())) && false ?: '_'}->createConnection(array('driver' => 'pdo_mysql', 'charset' => 'utf8mb4', 'url' => $this->getEnv('resolve:DATABASE_URL'), 'host' => 'localhost', 'port' => NULL, 'user' => 'root', 'password' => NULL, 'driverOptions' => array(), 'serverVersion' => '5.7', 'defaultTableOptions' => array('charset' => 'utf8mb4', 'collate' => 'utf8mb4_unicode_ci')), $b, $c, array());\n }",
"public static function getDefaultConnection(){\n return self::get_dba('default');\n\t}",
"public static function getInstance()\n\t{\n\t\tstatic $xInstance = null;\n\t\tif(!$xInstance)\n\t\t{\n\t\t\t$xInstance = new Manager();\n\t\t}\n\t\treturn $xInstance;\n\t}",
"public function getManager(): Gutenberg\n {\n return $this->manager;\n }",
"public function getManager($name = null)\n {\n return $this->entityManager;\n }",
"public function manager()\n {\n \treturn $this->hasOne(manager::class);\n }",
"public function getDefaultConnection()\n {\n return $this->resolver->getDefaultConnection();\n }",
"protected function entityManager() {\n\t\treturn $this->serviceLocator->get('Doctrine\\ORM\\EntityManager');\n\t}",
"public function getDefaultManagerName()\n {\n return $this->entityManager;\n }",
"function getConfiguredDefaultManager(&$input)\n {\n $defaultModule = SGL_Config::get('site.defaultModule');\n $defaultMgr = SGL_Config::get('site.defaultManager');\n\n // load default module's config if not present\n $c = &SGL_Config::singleton();\n $conf = $c->ensureModuleConfigLoaded($defaultModule);\n\n if (PEAR::isError($conf)) {\n SGL::raiseError('could not locate module\\'s config file',\n SGL_ERROR_NOFILE);\n return false;\n }\n\n $mgrName = SGL_Inflector::caseFix(\n SGL_Inflector::getManagerNameFromSimplifiedName($defaultMgr));\n $path = SGL_MOD_DIR .'/'.$defaultModule.'/classes/'.$mgrName.'.php';\n if (!is_file($path)) {\n SGL::raiseError('could not locate default manager, '.$path,\n SGL_ERROR_NOFILE);\n return false;\n }\n require_once $path;\n if (!class_exists($mgrName)) {\n SGL::raiseError('invalid class name for default manager',\n SGL_ERROR_NOCLASS);\n return false;\n }\n $mgr = new $mgrName();\n $input->moduleName = $defaultModule;\n $input->set('manager', $mgr);\n $req = $input->getRequest();\n $req->set('moduleName', $defaultModule);\n $req->set('managerName', $defaultMgr);\n\n if (SGL_Config::get('site.defaultParams')) {\n $aParams = SGL_Url::querystringArrayToHash(\n explode('/', SGL_Config::get('site.defaultParams')));\n $req->add($aParams);\n }\n $input->setRequest($req); // this ought to take care of itself\n return true;\n }",
"public static function getConnection() {\n return self::$defaultConnection;\n }",
"public function getDefaultConnection()\n {\n return $this->default;\n }",
"public function getEntityManager($name = self::DEFAULT_ENTITYMANAGER_NAME) {\n\t\t\n\t\tif (empty($name)) {\n\t\t\tthrow new Exception(\"Entity Manager alias name should be set\");\n\t\t} elseif (isset($this->_entityManagers[$name])) {\n\t\t\tthrow new Exception(\"Entity Manager '{$name}' is not set\");\n\t\t}\n\t\t\n\t\treturn $this;\n\t}",
"protected function getEm($name = null){\n return $this->getDoctrine()->getManager($name);\n }",
"public static function getInstance()\n {\n return Doctrine_Core::getTable('Default_Model_Doctrine_Service');\n }",
"public function getEntityManager() {\n\t\tif (null === $this->em) {\n\t\t\t$this->em = $this->getServiceLocator()\n\t\t\t\t\t->get('doctrine.entitymanager.orm_default');\n\t\t}\n\t\treturn $this->em;\n\t}",
"public static function &getInstance() {\n\t\tstatic $instance = NULL;\n\t\tif (!isset($instance))\n\t\t\t$instance = new Manager();\n\t\treturn $instance;\n\t}",
"public function getDefaultConnectionModel()\n {\n return ConnectionModel::default();\n }",
"public function getEntityManager($name = null)\n {\n return $this->controller->getEntityManager($name);\n }",
"public function entity()\n {\n return Manager::class;\n }",
"public function getDefaultManagerName()\n {\n // TODO: Implement getDefaultManagerName() method.\n }",
"private function getUserManager() {\n return $this->get('seip.user_manager');\n }",
"public function getEntityManager($emName = null);",
"public function getEntityManager()\n {\n return $this->container->get('doctrine')->getManager($this->emName);\n }",
"public function getConnectorManager()\n {\n if (empty($this->connectorManger)) {\n $this->connectorManager = new ConnectorManager();\n }\n return $this->connectorManager;\n }",
"protected function getConnection()\n {\n $pdo = new PDO(DB_DSN, DB_USER, DB_PASS);\n return new DefaultConnection($pdo, DB_NAME);\n }",
"public function getDefaultGrammarManager(): Manager|null;",
"public function getObjectManager() {\n\t\tif(($this->objectManager instanceof \\TYPO3\\CMS\\Extbase\\Object\\ObjectManager) === false) {\n\t\t\t$this->objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance(\\TYPO3\\CMS\\Extbase\\Object\\ObjectManager::class);\n\t\t}\n\n\t\treturn $this->objectManager;\n\t}",
"public static function getDefaultAccount() {\n $type = 'system';\n $id = 0;\n $account = self::query($type, $id);\n if (!$account) {\n $account = self::createAccount($type, $id);\n }\n return $account;\n }",
"public function getObjectManager() {\n\t\tif(($this->objectManager instanceof \\TYPO3\\CMS\\Extbase\\Object\\ObjectManager) === false) {\n\t\t\t$this->objectManager = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Extbase\\\\Object\\\\ObjectManager');\n\t\t}\n\n\t\treturn $this->objectManager;\n\t}",
"public function getDatabaseManager(): DatabaseManager\n {\n return $this->manager;\n }",
"public function db(){\n\treturn Manager::getManager($this);\n }",
"public function getEntityManager()\n {\n if (null === $this->em) {\n $this->em = $this->getServiceLocator()\n ->get('doctrine.entitymanager.orm_default');\n }\n return $this->em;\n }",
"public static function entityManager($name = 'default')\n {\n if (isset(self::$entityManagers[$name])) {\n return self::$entityManagers[$name];\n }\n $databaseConnection = self::connection($name)->getDbalConnection();\n\n if (Configuration::get('app.env') == 'development') {\n $cache = new ArrayCache();\n } else { // @codeCoverageIgnore\n $cache = new FilesystemCache(Configuration::get('app.cache')); // @codeCoverageIgnore\n }\n\n $config = new \\Doctrine\\ORM\\Configuration();\n $config->setMetadataCacheImpl($cache);\n $driver = $config->newDefaultAnnotationDriver([APPPATH . 'Entity'], false);\n\n $config->setMetadataDriverImpl($driver);\n $config->setQueryCacheImpl($cache);\n\n $proxyDir = APPPATH . 'Proxy';\n $proxyNamespace = 'App\\Proxy';\n\n $config->setProxyDir($proxyDir);\n $config->setProxyNamespace($proxyNamespace);\n Autoloader::register($proxyDir, $proxyNamespace);\n\n $loggerChain = new LoggerChain();\n if (Configuration::get('app.env') == 'development') {\n $config->setAutoGenerateProxyClasses(true);\n\n $loggerChain->addLogger(new DoctrineLogBridge(\\Logger::getInstance()->getMonologInstance()));\n $loggerChain->addLogger(DebugBarHelper::getInstance()->getDebugStack());\n } else { // @codeCoverageIgnore\n $config->setAutoGenerateProxyClasses(false); // @codeCoverageIgnore\n }\n $em = EntityManager::create($databaseConnection, $config);\n\n $em->getConnection()->getConfiguration()->setSQLLogger($loggerChain);\n $em->getConfiguration()->setSQLLogger($loggerChain);\n\n self::$entityManagers[$name] = $em;\n return $em;\n }",
"public static function getDefaultConnection()\n {\n }",
"public static function connect() {\n\t\t$connection = new Connection(MONGO_DB_HOST);\n\t\t$config = new Configuration();\n\t\t$config->setProxyDir('../cache/mongo/proxies');\n\t\t$config->setProxyNamespace('MongoProxies');\n\t\t$config->setHydratorDir('../cache/mongo/hydrators');\n\t\t$config->setHydratorNamespace('MongoHydrators');\n\t\t$config->setDefaultDB(MONGO_DB_NAME);\n\t\t$config->setMetadataDriverImpl(AnnotationDriver::create('../app/models/MongoDocs'));\n\t\tAnnotationDriver::registerAnnotationClasses();\n\t\treturn DocumentManager::create($connection, $config);\n\t}",
"public function getEntityManager($name = null)\n {\n return $this->getDoctrine()->getManager($name);\n }",
"public function getObjectManager() {}",
"public function getObjectManager(): mixed\n {\n return $this->objectManager;\n }",
"public function getDefaultConnection()\n {\n if (null !== $this->defaultConnectionName) {\n if (!isset($this->connections[$this->defaultConnectionName])) {\n throw new \\RuntimeException(sprintf('The default connection \"%s\" does not exists.', $this->defaultConnectionName));\n }\n\n $connection = $this->connections[$this->defaultConnectionName];\n } elseif (!$connection = reset($this->connections)) {\n throw new \\RuntimeException('There is not connections.');\n }\n\n return $connection;\n }",
"public function getDBManagerHandler(): DatabaseManager\n {\n if (empty($this->dbManager)) {\n $this->dbManager = new DatabaseManager(Config::get('database'), new ConnectionFactory());\n }\n return $this->dbManager;\n }",
"private function getEntityManager()\n {\n if ($this->em === null) {\n $this->em = $this->container->get('doctrine')->getManager();\n }\n return $this->em;\n }",
"public static function getInstance()\n {\n if (self::$instance == null) {\n self::$instance = Administrador::select('*')->where('type', '=', self::ADMINISTRADOR)->first();\n }\n return self::$instance;\n }",
"public function get_data_manager()\n {\n // return DataManager :: getInstance();\n }",
"private function getDM(){\n if (null === $this->dm){\n $connection = new Connection();\n $config = new Configuration();\n $config->setProxyDir(__DIR__ . '/../Documents/Proxies');\n $config->setProxyNamespace('Proxies');\n $config->setHydratorDir(__DIR__ . '/../Documents/Hydrators');\n $config->setHydratorNamespace('Hydrators');\n $config->setDefaultDB('saintSeya');\n $config->setMetadataDriverImpl(AnnotationDriver::create(__DIR__ . '/../Documents'));\n AnnotationDriver::registerAnnotationClasses();\n $this->dm = DocumentManager::create($connection, $config);\n }\n return $this->dm;\n }",
"public static function getInstance(): Manager\n {\n if (!self::$instance) {\n self::$instance = new Manager();\n }\n return self::$instance;\n }",
"public static function getInstance(){\n if(empty(static::$default_database))\n static::initDB();\n \n return static::$default_database;\n }",
"public static function getConnection()\n {\n return static::getInstance();\n }",
"static public function GetInstance()\n\t{\n\t\tif ( null == self::$m_dbconnection )\n\t\t{\n\t\t\tself::$m_dbconnection = NewADOConnection(self::$ado_db_type);\n\t\t\ttry\n\t\t\t{\n\t\t\t\tself::$m_dbconnection->Connect(self::$db_host,self::$db_user, self::$db_pwd, self::$db_name) ;\n\t\t\t}catch (Exception $e)\n\t\t\t{\n\t\t\t\tdie(\"Could Not Connect Database!\".$e->getMessage());\n\t\t\t}\n\t\t}\n\t\treturn self::$m_dbconnection;\n\t}",
"public static function instance() {\n if (static::$instance === null) {\n static::$instance = static::resolve_connection();\n }\n\n return static::$instance;\n }",
"public static function getInstance()\n {\n return self::$instance ?? self::getNewInstance();\n }",
"private function getDefaultConnection()\n {\n # get the selected adapter to be our basis\n $selected_adapter = config()->app->db_adapter;\n\n # here, check selected adapter if empty, then\n # disable this provider\n if (strlen($selected_adapter) == 0 || $selected_adapter === false) {\n return $this;\n }\n\n return $this->connection($selected_adapter);\n }",
"public function getDefaultConnection(): string\n {\n return $this->app['config']['manticore.defaultConnection'];\n }",
"public static function getInstance()\n {\n if (null === static::$_instance) {\n static::$_instance = new \\medoo(\\Core\\Config::$db_connection);\n }\n \n return static::$_instance;\n }",
"protected function getEntityManager()\n {\n return $this->getContainer()->get('doctrine')->getManager();\n }",
"public function getEm()\n {\n if( null === $this->em )\n $this->em = $this->getServiceLocator()->get('Doctrine\\ORM\\EntityManager');\n\n return $this->em;\n\n }",
"public static function get($connectionAlias = self::MCO_DB)\n {\n if (!Registry::get($connectionAlias)) {\n try {\n $instance = new self($connectionAlias);\n } catch (\\PDOException $e) {\n die('Connection failed: ' . $e->getMessage());\n }\n return $instance;\n }\n return Registry::get($connectionAlias);\n }",
"public function getDefaultConnection(): string;",
"static function getInstance(){\n if(MethodologiesManager::$obj == null){\n MethodologiesManager::$obj = new MethodologiesManager(new EloquentConnection());\n }\n return MethodologiesManager::$obj;\n }",
"public function getEntityManager()\n{\nif (null === $this->em) {\n$this->em = $this->getServiceLocator()\n->get('doctrine.entitymanager.orm_default');\n}\nreturn $this->em;\n}",
"public function getDefaultConnection()\n {\n return config::get('database.default');\n }",
"protected function getDoctrineCache_Providers_Doctrine_Orm_DefaultQueryCacheService()\n {\n $this->services['doctrine_cache.providers.doctrine.orm.default_query_cache'] = $instance = new \\Doctrine\\Common\\Cache\\ArrayCache();\n\n $instance->setNamespace('sf2orm_default_8bf1da162ef326421c99a13a9a5830680c7abfd955a06a3c69aa2f56d644e2eb');\n\n return $instance;\n }",
"public function getDefaultEntityManagerName()\n {\n // TODO: Implement getDefaultEntityManagerName() method.\n }",
"public static function newModel()\n {\n return resolve(Manager::class);\n }",
"public static function getInstance() {\n\n if (self::$instance == null) {\n self::$instance = new ProjectsManager();\n }\n return self::$instance;\n }",
"public function getGearmanClient() {\n\t\tif(!empty($this->servers)) {\n\t\t\treturn new Client($this->servers);\n\t\t}\n\t}",
"protected function getInstance()\n {\n if ($this->modx) {\n return $this->modx;\n }\n\n $path = $this->getCorePath();\n require_once \"{$path}/model/modx/modx.class.php\";\n\n $this->modx = \\modX::getInstance('setup');\n $this->modx->initialize('mgr');\n $this->modx->getService('error', 'error.modError');\n\n return $this->modx;\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}",
"protected function getObjectManager() {}",
"protected function getDoctrineCache_Providers_Doctrine_Orm_DefaultQueryCacheService()\n {\n $this->services['doctrine_cache.providers.doctrine.orm.default_query_cache'] = $instance = new \\Doctrine\\Common\\Cache\\ArrayCache();\n\n $instance->setNamespace('sf_orm_default_ffac7d8ed8da8c1e8ea974c49c51bce96663f58872f3015986f6eba7d71c052f');\n\n return $instance;\n }",
"protected function getIntentionManager()\n {\n return $this->get('intention.execution_manager');\n }",
"public function getConnection() {\n\t\t$db = Config::get('librarydirectory::database.default');\n return static::resolveConnection($db);\n }",
"public static function getInstance(): ConnectionManager\n\t{\n\t\tif (self::$instance === NULL)\n\t\t{\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}",
"public static function instance()\n {\n global $container;\n return $container->getByType(self::class);\n }",
"public function getEntityManager()\r\n {\r\n if (null === $this->em) {\r\n $this->em = $this->getServiceLocator()->get('Doctrine\\ORM\\EntityManager') ;\r\n }\r\n return $this->em;\r\n }",
"public function getInstance() {\n\t\treturn $this->instance;\n\t}",
"protected function getConnection()\n {\n return $this->createDefaultDBConnection($this->createPdo(), static::NAME);\n }",
"public function connectDefault() {\n\t\t\treturn $this->connect(Config::DB_SERVER, Config::DB_NAME, Config::DB_USERNAME, Config::DB_PASSWORD);\n\t\t}",
"protected function getObject()\n\t{\n\t\tif( !isset( $this->object ) ) {\n\t\t\t$this->object = \\Aimeos\\MAdmin\\Cache\\Manager\\Factory::createManager( $this->context )->getCache();\n\t\t}\n\n\t\treturn $this->object;\n\t}",
"public function getDefaultConnection()\n {\n if (null === $this->defaultConnectionName) {\n throw new \\RuntimeException('There is not default connection name.');\n }\n\n if (!isset($this->connections[$this->defaultConnectionName])) {\n throw new \\RuntimeException(sprintf('The default connection \"%s\" does not exists.', $this->defaultConnectionName));\n }\n\n return $this->connections[$this->defaultConnectionName];\n }",
"public function get_data_manager()\n {\n return DataManager::getInstance();\n }",
"static function instance() {\n if (!self::$instance) {\n self::$instance = new ApiResponseManager(new DefaultResponseModel());\n }\n return self::$instance;\n }",
"function connection()\n\t{\n\t\tif (isset($this->conn_name)) {\n\t\t\treturn Db::getConnection($this->conn_name);\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}",
"public function getInstance()\n {\n return $this->instance;\n }"
] | [
"0.6633718",
"0.64424646",
"0.64424646",
"0.6314597",
"0.61041397",
"0.6075214",
"0.60350317",
"0.60350317",
"0.60350317",
"0.60118586",
"0.59947115",
"0.5986109",
"0.5926368",
"0.5906448",
"0.5886991",
"0.58846325",
"0.5882649",
"0.5860674",
"0.585219",
"0.5846827",
"0.58015656",
"0.5795958",
"0.579149",
"0.5764888",
"0.5752716",
"0.57502925",
"0.57475895",
"0.5717192",
"0.5702548",
"0.5682815",
"0.56652313",
"0.564901",
"0.5618327",
"0.55386615",
"0.5537024",
"0.552581",
"0.5519113",
"0.5507963",
"0.5497579",
"0.54942393",
"0.5482764",
"0.54819214",
"0.54813623",
"0.5466497",
"0.5464973",
"0.5452569",
"0.54490954",
"0.54451436",
"0.5434851",
"0.5432539",
"0.5419198",
"0.54012674",
"0.5384076",
"0.53770834",
"0.5371286",
"0.5368959",
"0.536327",
"0.5357326",
"0.5355292",
"0.5342462",
"0.53379744",
"0.5335735",
"0.5334424",
"0.5333777",
"0.5333338",
"0.5333089",
"0.5332708",
"0.53314143",
"0.5326343",
"0.53232867",
"0.53224415",
"0.53210944",
"0.53176206",
"0.53175795",
"0.5315247",
"0.5308342",
"0.5305859",
"0.53029877",
"0.52858937",
"0.52851146",
"0.5279034",
"0.5269012",
"0.5262737",
"0.52563035",
"0.5255977",
"0.52469164",
"0.5243006",
"0.52411616",
"0.523956",
"0.52382827",
"0.5236971",
"0.5228523",
"0.5224459",
"0.5222468",
"0.52201134",
"0.52189624",
"0.52112246",
"0.520253",
"0.5201543",
"0.5191828",
"0.5190509"
] | 0.0 | -1 |
Test simple request data | public function testGetServiceCall()
{
$this->_markTestAsRestOnly();
$itemId = 1;
$name = 'Test';
$serviceInfo = [
'rest' => [
'resourcePath' => '/V1/testmodule4/' . $itemId,
'httpMethod' => \Magento\Webapi\Model\Rest\Config::HTTP_METHOD_GET,
],
];
$item = $this->_webApiCall($serviceInfo, [], null, null, $this->integration);
$this->assertEquals($itemId, $item['entity_id'], 'id field returned incorrectly');
$this->assertEquals($name, $item['name'], 'name field returned incorrectly');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testSimpleExtractionFromRequest()\n {\n $queryData = ['a' => 1, 'b' => 2];\n $requestData = ['a' => 2, 'b' => 4, 'c' => 8];\n $contentData = ['b' => 3, 'c' => 6, 'd' => 9];\n $request = $this->createRequest($queryData, $requestData, $contentData);\n\n $this->assertEquals($requestData, $this->extractParameters($request, null, 'request'));\n }",
"public function testInputDataHttpServer(): void\n {\n $this->post('/request_action/input_test', '{\"hello\":\"world\"}');\n if ($this->_response->getBody()->isSeekable()) {\n $this->_response->getBody()->rewind();\n }\n $this->assertSame('world', $this->_response->getBody()->getContents());\n $this->assertHeader('X-Middleware', 'true');\n }",
"public function testGetRequest()\n {\n $response= $this->apiObject->getRequest();\n $request=$response->getBody()->getContents();\n $this->assertMatchesJsonSnapshot($request);\n echo('\n El request recibido:\n '.$request);\n }",
"public function testInputDataSecurityToken(): void\n {\n $this->enableSecurityToken();\n\n $this->post('/request_action/input_test', '{\"hello\":\"world\"}');\n $this->assertSame('world', '' . $this->_response->getBody());\n $this->assertHeader('X-Middleware', 'true');\n }",
"public function test_example()\n {\n $response = $this->get('/toto/2');\n $response->assertStatus(200);\n $response->assertJson([]);\n $this->assertJsonStringEqualsJsonString(json_encode([\"params\" => \"2\"]), $response->content());\n }",
"public function test_happy_flow_get()\n {\n $_SERVER['REQUEST_METHOD'] = 'GET';\n $_GET['sp-entity-id'] = 'http://mock-sp';\n\n $request = new Request($_GET, $_POST, [], [], [], $_SERVER);\n\n $this->assertTrue($this->validator->isValid($request));\n }",
"public function test_valid_data()\n {\n\n\n\n $data=[\"amount\"=> 1000,\n \"unpaid_appliance_rates\"=> 2,\n \"appliance_rate_cost\"=> 200,\n \"tariff_fixed_costs\"=> 160,\n \"price_per_kwh\"=> 700\n ];\n\n $response = $this->post('/api/transactions', $data);\n // $response->assertStatus(200);\n $response->assertJson( [\"data\"=> [\n \"type\"=> \"transaction\",\n \"attributes\"=> [\n \"paid_for_appliance_rates\"=> 400,\n \"fully_covered_appliance_rate\"=> 2,\n \"paid_for_fixed_tariff\"=> 160,\n \"paid_for_energy\"=> 490,\n \"topup_for_energy\"=> 50,\n \"sold_energy\"=> 0.7\n ]\n ]]);\n }",
"public function testValidRequest()\n {\n $this->client->{$this->method}(\n $this->endpoint,\n $this->getValidData(),\n $this->requestHeaders\n );\n $this->assertResponseCode(200, 299);\n }",
"public function testVerifyUsingPOST()\n {\n\n }",
"public function testGetMeasurementsUsingPOST()\n {\n }",
"public function testPostDataHttpServer(): void\n {\n $this->post('/request_action/post_pass', ['title' => 'value']);\n $data = json_decode('' . $this->_response->getBody());\n $this->assertSame('value', $data->title);\n $this->assertHeader('X-Middleware', 'true');\n }",
"public function testAPIWorking()\n\t{\t\t \n\t\t$data = $this->get(route('ride-data'));\n\t\t \n\t\tif (!empty($data))\n\t\t{\n\t\t\t$this->assertTrue(TRUE);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->assertTrue(FALSE);\n\t\t}\n\t}",
"public function testGetCurrentPricingDataUsingPOST()\n {\n }",
"public function testEnterCorrectData()\n {\n $user = User::factory()->create();\n \n $response = $this->call('POST', '/admin/signin', [\n 'email' => $user->email,\n 'password' => '123456',\n '_token' => csrf_token()\n ]);\n \n $this->assertEquals(200, $response->getStatusCode());\n\n \n\n }",
"public function testGetRequest()\n {\n $admin = $this->getAdminUser();\n $user = factory(\\App\\User::class)->create();\n $grade = factory(\\App\\Grade::class)->create();\n $userGrade = UserGrade::create([\n 'user_id' => $user->id,\n 'grade_id' => $grade->id\n ]);\n $response = $this->actingAs($user)->call('GET', \"/api/user/{$user->id}/grade\");\n $this->assertEquals(200, $response->status());\n }",
"public function testAllData()\n {\n Runner::truncate();\n Runner::factory()->count(15)->create();\n\n $headers['Accept'] = 'application/json';\n\n $response = $this->get('/api/v1/runner/1/form-data', $headers);\n\n $response->assertStatus(200)->assertJsonStructure(['success', 'data', 'status']);\n }",
"public function test_request(){\n\n return $this->send_request( 'en', 'es', array( 'about' ) );\n\n }",
"public function test_getData_returnsArray_ifDataDoesExist()\n\t{\n\t\t$data = ['foo' => 'bar', 'baz' => 'qux'];\n\t\t\n\t\t$request = new Post('http://example.com');\n\t\t$request->setData($data);\n\t\t\n\t\t$this->assertEquals($data, $request->getData());\n\t\t\n\t\treturn;\n\t}",
"public function testLogSimpleUsingPOST()\n {\n\n }",
"public function testBasicTest()\n {\n\n\n $testData = [\n \"msisdn\" => \"441632960960\",\n \"to\" => \"441632960961\",\n \"messageId\" => \"02000000E68951D8\",\n \"text\" => \"Hello7\",\n \"type\" => \"text\",\n \"keyword\" => \"HELLO7\",\n \"message-timestamp\" => \"2016-07-05 21:46:15\"\n ];\n $response = $this->postJson('/receive-sms', $testData);\n\n $response->assertStatus(200);\n }",
"public function testGetPostParams()\n {\n // simulate a post\n $expected = array('document' => array('name' => 'hey'),\n 'post_test1' => 'false', 'post_test2' => 'go yanks');\n $this->assertEquals($expected, $this->_req->getPostParams());\n }",
"public function getRequestData();",
"public function testHomePost()\n {\n\n $requestParams = [\n 'inputBike' => 3,\n ];\n\n $response = $this->call('POST', '/', $requestParams);\n\n $response->assertSeeText(\"Intive FDV test\");\n $response->assertSeeText(\"ACME RENTAL'S BIKES\");\n $response->assertSeeText(\"Thanks to use ACME RENTAL'S BIKES service.\");\n $response->assertSeeText(\"Your bikes\");\n $response->original->getData()['bikes'];\n $response->assertViewHas(\"bikes\", !null);\n $response->assertViewHas(\"byHour\", !null);\n $response->assertViewHas(\"byDay\", !null);\n $response->assertViewHas(\"byWeek\", !null);\n $response->assertViewIs(\"success\");\n $this->assertTrue($response->isOk(), \"Wrong params\");\n\n\n }",
"public function testDataResponse()\n {\n $driverPassesEndpoint = new DriverPassesEndpoint(getenv('MRP_API_KEY'));\n $data = $driverPassesEndpoint->setClassId(1000)\n ->setScheduleId(5508)\n ->setDataOrder('nameAsc')\n ->setDriverId(1023)\n ->setEndDate('8/21/2016')\n ->setStartDate('8/21/2015')\n ->getRequest();\n\n $this->assertNotEmpty($data);\n $this->assertTrue(is_object($data));\n $this->assertEquals(1, $data->RequestValid);\n }",
"public function testSimpleExtractionFromQuery()\n {\n $queryData = ['a' => 1, 'b' => 2];\n $requestData = ['a' => 2, 'b' => 4, 'c' => 8];\n $contentData = ['b' => 3, 'c' => 6, 'd' => 9];\n $request = $this->createRequest($queryData, $requestData, $contentData);\n\n $this->assertEquals($queryData, $this->extractParameters($request, null, 'query'));\n }",
"private function fetchDataFromRequest()\n {\n $this->data = (object)$_REQUEST;\n if ($this->getParameter('apicheck',self::REGEX_INTEGER)) {\n $this->apiCheck = true;\n }\n\n return true;\n }",
"public function testInitActionPost()\n {\n $this->app->request->setPost(\"dices\", 2);\n $this->app->request->setPost(\"opponents\", 2);\n $res = $this->controller->initActionPost();\n $this->assertInstanceOf(ResponseUtility::class, $res);\n //$this->assertStringEndsWith(\"active\", $res);\n }",
"public function testGetBody() {\n $request = $this->createRequest();\n\n static::setInput('hello world');\n $this->assertEquals('hello world', $request->getBody());\n $this->assertEquals('hello world', $request->body);\n }",
"public function testGetGetParams()\n {\n $expected = array('document' => array('filesize' => 100),\n 'get_test1' => 'true', 'get_test2' => 'go mets');\n $this->assertEquals($expected, $this->_req->getGetParams());\n }",
"public function testSearchUsingGET()\n {\n\n }",
"public function testBasic()\n {\n $config = array(\n 'cn', 'mail'\n );\n\n $result = self::processFilter($config, self::$request);\n $attributes = $result['Attributes'];\n $this->assertArrayHasKey('cn', $attributes);\n $this->assertArrayHasKey('mail', $attributes);\n $this->assertCount(2, $attributes);\n }",
"public function testSimple() {\n $client = new Client();\n $client->post = array(\n 'login' => 'bgates',\n 'password' => 'monkey',\n 'form_token' => '123123123',\n );\n $response = $client->fetch('http://' . TestCase::$settings['envHttpMirrorServer'] . '/');\n $responseParsed = ClientHelper::parseRequest($response);\n $this->assertSame('login=bgates&password=monkey&form_token=123123123', $responseParsed['Body']);\n }",
"public function testAddGetParam()\n\t{\n\t\t$URL = new URL('http://' . self::TESTHOST . \"/requestInfos.php?getA=hallo\");\n\t\t$Payload = new Payload(new DataAsGET('getB', 'halloB'));\n\n\t\t$Request = new Request($URL, new PUT(), $Payload);\n\t\t$this->assertTrue(\n\t\t\t$Request->getResponseAs(\n\t\t\t\tnew class extends AbstractResponse\n\t\t\t\t{\n\t\t\t\t\tpublic function createByRequest($body, Headerlist $Headers, HTTPStatusCode $Status, \\DateInterval $RequestTime)\n\t\t\t\t\t{\n\t\t\t\t\t\t$bodyArr = json_decode($body, true);\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t$bodyArr['_GET']['getA'] == 'hallo'\n\t\t\t\t\t\t\t&& $bodyArr['_GET']['getB'] == 'halloB'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\t}",
"public function test_example()\n {\n\n $this->withoutExceptionHandling();\n\n $response = $this->post(route('api.contact'), [\n 'name' => Str::random(10),\n 'email' => 'bt.' . Str::random(5) . '@teste.com',\n 'phoneNumber' => '84999289436',\n 'subject' => Str::random(6),\n 'messageBody' => Str::random(100),\n ]);\n\n $response->assertStatus(200);\n }",
"public function testBasicGET()\n\t{\n\t\t$Request = new Request(\n\t\t\tnew URL('http://' . self::TESTHOST . '/hallo'),\n\t\t\tnull, // method. Default GET\n\t\t\tnull, // Payload\n\t\t\t$this->_getDefaultOptions());\n\n\t\t// Return the body as string\n\t\t$Result = $Request->getResponseAs(new StringValue());\n\n\t\t$this->assertEquals('hallo', (string)$Result);\n\t}",
"public function testRequestParsingFromInput() {\n\n\t\t$router = new Nether\\Avenue\\Router(static::$RequestData['Index']);\n\n\t\t(new Verify(\n\t\t\t'parsed domain from input',\n\t\t\t$router->GetDomain()\n\t\t))->equals('nether.io');\n\n\t\t(new Verify(\n\t\t\t'parsed path from input',\n\t\t\t$router->GetPath()\n\t\t))->equals('/index');\n\n\t\treturn;\n\t}",
"private function makeFakeData(){\n // URL = http://localhost/tweeter/test.php/stuff/morestuff/?id=15\n\n $_SERVER['SCRIPT_NAME'] = '/tweeter/test.php';\n $_SERVER['REQUEST_METHOD'] = 'GET';\n $_SERVER['PATH_INFO'] = '/stuff/morestuff/';\n $_GET['id'] = '15';\n $_POST['text'] = 'Un texte.';\n }",
"public function testSendDataOnly()\n {\n $expectedBody = $this->getExpectedBody(\n [\n ['SKU' => 'test123']\n ],\n []\n );\n\n $this->mockEndpoint();\n $this->mockCurl($expectedBody);\n\n $this->subject->addData(['SKU' => '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 testGetRequest() {\n\t\t$this->call('GET', '/');\n\t\t$this->assertResponseStatus(404);\n\t}",
"public function test_data() {\n\t\t$omnikassa = new Client();\n\n\t\t$omnikassa->set_amount( 55 );\n\t\t$omnikassa->set_currency_numeric_code( 978 );\n\t\t$omnikassa->set_merchant_id( '011223744550001' );\n\t\t$omnikassa->set_normal_return_url( 'http://www.normalreturnurl.nl' );\n\t\t$omnikassa->set_automatic_response_url( 'http://www.automaticresponseurl.nl' );\n\t\t$omnikassa->set_transaction_reference( '534654' );\n\t\t$omnikassa->set_order_id( '201208345' );\n\t\t$omnikassa->set_key_version( 1 );\n\n\t\t$string = 'amount=55|currencyCode=978|merchantId=011223744550001|normalReturnUrl=http://www.normalreturnurl.nl|automaticResponseUrl=http://www.automaticresponseurl.nl|transactionReference=534654|orderId=201208345|keyVersion=1';\n\n\t\t$expected = Client::parse_piped_string( $string );\n\n\t\t$actual = $omnikassa->get_data_array();\n\n\t\t$this->assertEquals( $expected, $actual );\n\t}",
"public function testBasicTest()\n {\n //$response = $this->get('http://admin.test.ledu.com/api/newsbulletin/');\n $response = $this->json('get','http://admin.test.ledu.com/api/newsbulletin/');\n\n $response->assertStatus(200)\n ->assertJsonStructure([\n 'error',\n 'msg',\n 'data'\n ])->assertExactJson([\n 'error'=>1,\n 'msg'=>'success',\n 'data'=>[]\n ]);\n }",
"final public function onTest()\n {\n // identical to a GET request without the body output.\n // shodul proxy to the get method\n return array(); // MUST NOT return a message-body in the response\n }",
"public function testRequestIsPassedCorrectly()\n {\n $this->assertPropertySame('request', $this->request);\n }",
"public function testGetProductsUsingPOST()\n {\n }",
"public function doRequest()\n {\n $this->post('/api_v1/webhook/log/1',\n json_decode('{\n \"transaction_time\": \"1603711958\",\n \"id\": \"e0c523cd-3dfd-4206-83b4-9c0dc32dd77e\",\n \"event\": \"in-store-txn\",\n \"value\": 13.98,\n \"status\": \"complete\",\n \"customer_id\": \"e0c523cd-3dfd-4206-83b4-9c0dc32dd77e\"\n }'),\n [\n \"Accept\" => \"application/json\"\n ]\n );\n\n $this->assertEquals(\n 200, $this->response->getStatusCode()\n );\n }",
"protected function test() {\n // TEST BLOCK - comment out once validation to here is verified\n $resp[\"method\"] = $this->method;\n $resp[\"request\"] = $this->request;\n $resp[\"putfile\"] = $this->file;\n $resp[\"verb\"] = $this->verb;\n $resp[\"args\"] = $this->args;\n //return $resp;\n // END TEST BLOCK\n if ($this->method == 'GET') {\n //return $this->verb; // For testing if-else ladder\n return testGetHandler( $this->args ); // Invoke your handler here\n }\n elseif ($this->method == 'POST') {\n return testPostHandler( $this->args );// Invoke your handler here\n }\n elseif ($this->method == 'DELETE' && count($this->args) == 1 ) {\n return $this->args[0]; // ID of delete request\n }\n else {\n return $resp; // DEBUG usage, help determine why failure occurred\n return \"Invalid requests\";\n }\n }",
"public function testQueryStringDataReachesEndpoint(): void\n {\n // See tests/EndpointFixture\n $req = $this->getMockRequestWithUriPath(\n '/user/5',\n 'GET',\n ['shortstring' => 'aBcD']\n );\n\n $response = (new Dispatcher())\n ->setEndpointList($this->getEndpointListForFixture())\n ->dispatch($req);\n $this->checkResponse($response, 200);\n $data = json_decode((string)$response->getBody(), true);\n $this->assertSame(\n [\n 'id' => 5,\n 'shortstring' => 'aBcD',\n ],\n $data,\n 'The data did not reach the endpoint'\n );\n }",
"public function test(Request $request) {\n\n return response()->json(['floaing' => 1.25]);\n return [filter_var('true', FILTER_VALIDATE_BOOLEAN)];\n }",
"public function testRequest() {\n $params = array('type'=>'categorie-name',\n 'search'=>'android');\n $this->assertType(PHPUnit_Framework_Constraint_IsType::TYPE_OBJECT, $this->object->request('get-product-categories', $params));\n }",
"public function testGetData()\n {\n $this->getWeather->setUrl();\n $result = $this->getWeather->getData();\n\n $this->assertIsArray($result);\n }",
"public function testPutDataFormUrlEncoded(): void\n {\n $this->configRequest([\n 'headers' => [\n 'Content-Type' => 'application/x-www-form-urlencoded',\n ],\n ]);\n $this->put('/request_action/post_pass', ['title' => 'value']);\n $this->assertResponseOk();\n $data = json_decode('' . $this->_response->getBody());\n $this->assertSame('value', $data->title);\n }",
"public function testLogUsingPOST()\n {\n\n }",
"public function testIndexActionGet()\n {\n $request = $this->di->get(\"request\");\n $request->setGet(\"ip\", \"8.8.8.8\");\n\n\n $res = $this->controller->indexActionGet();\n\n $body = $res->getBody();\n\n // var_dump($body);\n $this->assertInstanceOf(\"Anax\\Response\\ResponseUtility\", $res);\n $this->assertContains(\"Kolla vädret\", $body);\n }",
"public function testSingle() {\n $client = new Client();\n $request = $client->get('http://web/v1/combined/ibuprofen');\n $response = $request;\n $this->assertEquals(200, $response->getStatusCode());\n }",
"public function youCanUseNullAsData()\n {\n // Act...\n $response = $this->responder->success( null );\n\n // Assert...\n $this->assertEquals( $response->getData( true ), [\n 'status' => 200,\n 'success' => true,\n 'data' => null\n ] );\n }",
"public function testSimpleExtractionFromContent()\n {\n $queryData = ['a' => 1, 'b' => 2];\n $requestData = ['a' => 2, 'b' => 4, 'c' => 8];\n $contentData = ['b' => 3, 'c' => 6, 'd' => 9];\n $request = $this->createRequest($queryData, $requestData, $contentData);\n\n $this->assertEquals($contentData, $this->extractParameters($request, null, 'content'));\n }",
"public function testHack()\n\t{\n\t\t$request =\n<<<EOF\nGET /login HTTP/1.1\nHost: $this->domain\nConnection: close\n\n\nEOF;\n$content = $this->sendData($request, GameTest::DOMAIN);\n\n\n$this->assertSame(1, preg_match('#\"floozBought\": \"1000\"#ms', $content));\n$this->assertSame(1, preg_match('#\"dailySpin\": 1000#ms', $content));\n$this->assertSame(1, preg_match('#\"spin\": 1000#ms', $content));\n$this->assertSame(1, preg_match('#Content-Type: application/json#ms', $content));\n }",
"public function testCallTest()\n {\n $expected = '{\"widget\":\"test\",\"price\":\"111.11\",\"date\":\"2016-12-28 11:11:11\"}';\n // make the call\n $response = $this->api->findByName('test');\n $this->assertEquals($expected, $response);\n }",
"public function testNestedData() {\n $client = new Client();\n $client->post = array(\n 'form' => array(\n 'login' => 'bgates',\n 'password' => 'monkey'\n ),\n 'form_token' => '123123123',\n );\n $response = $client->fetch('http://' . TestCase::$settings['envHttpMirrorServer'] . '/');\n $responseParsed = ClientHelper::parseRequest($response);\n $this->assertSame('form%5Blogin%5D=bgates&form%5Bpassword%5D=monkey&form_token=123123123', $responseParsed['Body']);\n }",
"public function testStringObject() {\n $client = new Client();\n $client->post = array(\n 'data' => Parser::create('<b>the-data</b>')->inner('<b>', '</b>'),\n 'nestedData' =>\n array(\n 'one' => Parser::create('<i>the-data2</i>')->inner('<i>', '</i>'),\n ),\n 'form_token' => '123123123',\n );\n $response = $client->fetch('http://' . TestCase::$settings['envHttpMirrorServer'] . '/');\n $responseParsed = ClientHelper::parseRequest($response);\n $this->assertSame('data=the-data&nestedData%5Bone%5D=the-data2&form_token=123123123', $responseParsed['Body']);\n }",
"public function testExample()\n {\n \t$response = $this->json('POST', '/users', ['name' => 'Sally']);\n $response\n ->assertStatus(200)\n ->assertJson([\n 'created' => true,\n ]);\n }",
"function testf(Request $request)\n {\n return $this->sendSubsriptionSmsToSubscriber($request->str, $request->str1, $request->str2);\n }",
"public function testInitiateAccountRequestUsingPOST()\n {\n }",
"public function test_aptivate_request_extracts_parameter_subsets()\n\t{\n\t\t$_GET = array('hello' => array('bonk' => 'whee!'));\n\t\t$req = new Aptivate_Request('GET', '/fake-test-script.php',\n\t\t\t'/fake-test-url');\n\t\t$this->assertEquals('whee!', $req['hello']->param('bonk'));\n\t\t$this->assertEquals('whee!', $req['hello']->param('bonk'));\n\t\t\n\t\t$_POST = $_GET;\n\t\t$_GET = array();\n\t\t$req = new Aptivate_Request('GET', '/fake-test-script.php',\n\t\t\t'/fake-test-url');\n\t\t$this->assertEquals('whee!', $req['hello']->param('bonk'));\n\t\t$this->assertEquals('whee!', $req['hello']->param('bonk'));\n\t}",
"public function testGetPostdata()\n {\n\t \tprint \"testGetPostdata()\\n\";\n\n\t \t// TODO: Impl\n\n\t \t$this->fail();\n }",
"public function test_getTagRequest() {\n\n }",
"public function testExample()\n {\n $response = $this->json('POST', '/players/store', [\n 'nama' => $this->faker->words(3, true),\n 'teams_id' => $this->faker->randomNumber(1),\n ]);\n\n \n $response->assertStatus(200);\n }",
"public function test_example()\n {\n /* $data = [\n 'station_name' => 'Santa Ana',\n 'station_razon' => 'Servi Gasoleo S. de RL. de C.V.',\n 'station_rfc' => 'SGS07111877R',\n 'station_dire' => 'AV Santa Ana 56 SN',\n 'station_mpo' =>'Tepic',\n 'station_edo' => 'Nayarit',\n 'station_cp' => '44886',\n 'station_phone' => '2281092986',\n 'station_gas' => '12',\n 'station_diesel' => '4',\n ];\n $response = $this->post('/api/station',$data);\n $response\n ->assertStatus(200)\n ->assertJson(['success' => true]);\n $this->assertDatabaseHas('stations', $data);*/\n }",
"public function testIndex()\n\t{\n\t\t$response = $this->call('GET', '/'.self::$endpoint);\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t\t$result = $response->getOriginalContent()->toArray();\n\t\t$this->assertTrue(is_array($result));\n\t\t$this->assertTrue(count($result)>0);\n\n\t\t// tes apakah hasil return adalah yang sesuai\n\t\tforeach ($this->obj->attributesToArray() as $attr => $attr_val)\n\t\t\t$this->assertArrayHasKey($attr, $result[0]);\n\t}",
"public function test_example()\n {\n $response = $this->post('/api/v1/login', ['email' => 'kam.zarandy@gmail.com', 'password' => 'vihan123']);\n if($response->status() != 200) {\n print_r('route call error (test 1)');\n return $response->assertStatus(500);\n\n }\n $data = json_decode($response->content());\n if( (int)$data->status != 200 ) {\n print_r('User can not login (test 2)');\n return$response->assertStatus(500);\n }\n var_dump('user logined to the system');\n\n $token = $data->data->token;\n $response = $this->withHeaders([\n 'Authorization' => 'Bearer '.$token,\n ])->get('/api/v1/GetCurrencyInformation?currency=DOLLAR');\n\n if($response->status() != 200) {\n print_r('Route error or authentication error (test 3)');\n return $response->assertStatus(500);\n }\n\n $data = json_decode($response->content());\n if( (int)$data->status !== 200 ) {\n print_r('Data error in output (test 4)');\n return $response->assertStatus(500);\n }\n if( !isset($data->data->id) || $data->data->id <= '' ) {\n print_r('Data Error (test 5)');\n return $response->assertStatus(500);\n }\n var_dump('Currency information get successfully');\n\n return $response->assertStatus(200);\n }",
"public function testRestApiMethod()\n {\n $response = $this->json('GET', '/api/testRoute');\n\n $response\n\t ->assertStatus(200)\n\t ->assertJson([\n\t\t 'field1' => 'value1',\n\t\t 'field2' => 'value2'\n\t ]);\n }",
"public function testCreateRequest() {\n\t\t$uri = 'http://www.php.net';\n\t\t$request = new HttpWebRequest($uri);\n\t\t\n\t\t// make sure it's the correct type/sub-type\n\t\t$this->assertTrue($request instanceof WebRequest);\n\t\t$this->assertTrue($request instanceof HttpWebRequest);\n\t\t\n\t\t// check to see if the uri was properly set\n\t\t$this->assertEquals($uri, $request->requestUri);\n\t}",
"public function testGetMatchingSuggestionsUsingPOST()\n {\n }",
"public function testPostHospital(){\r\n\t\t$this->http = new Client(['base_uri' => 'http://localhost/casecheckapp/public/index.php/']);\r\n\t\t\r\n\t\t//Test array\r\n\t\t$inputdata = ['json' => [\r\n 'name' => 'Hospital added',\r\n 'city' => 'Chicago',\r\n 'state' => 'IL',\r\n\t\t'address' =>'22 Random St']\r\n\t\t];\r\n\r\n\t\t//Test HTTP status ok\r\n\t\t$response= $this->http->post('api/v1/hospital',$inputdata);\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\t\r\n\t}",
"public function testGetUrlsUsingPOST()\n {\n }",
"public function test_customer() {\n $_POST = array('name' => \"customer2\", 'password' => \"p455w0rd:\");\n $expected = json_encode(array(\"status\" => 1, \"message\" => \"customer\"));\n $this->expectOutputString($expected);\n $this->object->main();\n }",
"public function testSettingRequest()\n {\n $this->apiRequest->setApiKey('testKey')->setAvailable(true)->resolve();\n\n // check http method\n $this->assertEquals('GET', $this->apiRequest->getHttpMethod());\n // check uri\n $this->assertEquals('/v1/games?available=true', $this->apiRequest->getUri());\n // check headers\n $this->assertEquals(['Authorization' => 'Bearer testKey'], $this->apiRequest->getHeaders());\n // check data\n $this->assertNull($this->apiRequest->getData());\n }",
"public function test_example()\n {\n $response = $this->get('/regist');\n\n $response->assertStatus(200);\n }",
"public function testInit()\n {\n $request = new Request();\n $obj = $request->init();\n $this->assertEquals($request, $obj);\n }",
"public function testBasicTest()\n {\n $response = $this->withHeaders([\n 'X-Header' => 'LaravelAcademy',\n ])->json('POST', '/api/login', ['email' => 'admin@test.com', 'password' => 'toptal']);\n\n $response\n ->assertStatus(200)\n ->assertJson([\n 'data' => [\n 'name' => 'admin'\n ],\n ]);\n }",
"public function testGetCustom()\n {\n $response = $this->call('GET', '/graphql/custom', [\n 'query' => $this->queries['examplesCustom']\n ]);\n\n $content = $response->getData(true);\n $this->assertArrayHasKey('data', $content);\n $this->assertEquals($content['data'], [\n 'examplesCustom' => $this->data\n ]);\n }",
"public function testIndexAction() : void\n {\n $this->di->request->setPost(\"ip\", \"2002:c0a8:101::42\");\n\n $res = $this->controller->indexActionPost();\n $this->assertInternalType(\"array\", $res);\n\n list($json, $status) = $res;\n $this->assertEquals($json[\"valid\"], true);\n $this->assertEquals($status, 200);\n }",
"public function test_good_index_route()\n {\n //correct uri\n $response = $this->get('api/students');\n $response \n ->assertStatus(200)\n ->assertJson([['first_name'=> 'Chadwick'], ['first_name'=> 'Evelyn']]);\n }",
"public function testgetParameters()\n {\n $this->_req->setPathParams(array('test3' => 'true'));\n\n $expected = array(\n 'test3' => 'true',\n 'get_test1' => 'true',\n 'get_test2' => 'go mets',\n 'post_test1' => 'false',\n 'post_test2' => 'go yanks', \n\n 'picture' => new Mad_Controller_FileUpload(array(\n 'name' => 'my_picture.gif',\n 'type' => 'image/gif',\n 'size' => '1234567',\n 'tmp_name' => '/tmp/test1')), \n 'document' => array(\n 'name' => 'hey',\n 'filesize' => 100,\n 'icon' => new Mad_Controller_FileUpload(array(\n 'name' => 'dummy.gif',\n 'type' => 'image/gif',\n 'size' => '32',\n 'tmp_name' => '/tmp/test2')), \n 'photo' => new Mad_Controller_FileUpload(array(\n 'name' => 'dummy.jpg',\n 'type' => 'image/jpeg',\n 'size' => '45',\n 'tmp_name' => '/tmp/test3'))\n ));\n $this->assertEquals($expected, $this->_req->getParameters());\n }",
"public function testExample()\n {\n $response = $this->get('/api/users');\n $response->assertStatus(200)\n\t\t ->assertJsonStructure([\n\t\t \t\t[\n\t\t \t\t\t'id',\n\t\t \t\t\t'name',\n\t\t \t\t\t'last_name',\n\t\t \t\t\t'age',\n\t\t \t\t\t'phone',\n\t\t \t\t\t'photo',\n\t\t \t\t\t'admission_date'\n\t\t \t\t]\n\t\t ]);\n }",
"public function testWrongFieldsData()\n {\n $response = $this->call('POST','api/auth/login',array(\"email\"=>\"test@mail.com\",\"password\"=>\"test\"));\n\n $this->assertEquals(401,$response->status());\n }",
"public function testIndexActionPost()\n {\n $request = $this->di->get(\"request\");\n $request->setPost(\"ip\", \"8.8.8.8\");\n // var_dump($request);\n\n $res = $this->controller->indexActionPost();\n\n $body = $res->getBody();\n\n // var_dump($body);\n $this->assertInstanceOf(\"Anax\\Response\\ResponseUtility\", $res);\n $this->assertContains(\"Kolla vädret\", $body);\n }",
"public function testLogAuthActionUsingPOST()\n {\n\n }",
"public function testValidRedemtion()\n {\n $response = $this->json('POST', 'api/voucher/redeem', ['email' => 'anjali@yahoo.com','code'=>'XkKp8Jki']);\n\n $response\n ->assertStatus(200)\n ->assertJsonStructure([\n 'percentage_discount'\n ]);\n }",
"public function testMagic() {\n\t\t$client = new \\Esprit\\Transport\\Fake(array(\n\t\t\t'index' => 'twitter',\n\t\t\t'type' => 'tweet'\n\t\t)) ;\n\n\t\t$request = $client->get(array('id' => 1)) ;\n\t\t$body = $request->body() ;\n\t\t$this->assertEquals('twitter',$request->index()) ;\n\t\t$this->assertEquals('tweet',$request->type()) ;\n\n\t\t$client->config('index', 'facebook') ;\n\t\t$request = $client->get(array('id' => 2)) ;\n\t\t$body = $request->body() ;\n\t\t$this->assertEquals('facebook',$request->index()) ;\n\n\t\t// Magic params\n\t\t$request = $client->get(666) ;\n\t\t$body = $request->body() ;\n\t\t$this->assertEquals('facebook',$request->index()) ;\n\t\t$this->assertEquals('tweet',$request->type()) ;\n\t\t$this->assertEquals(666,$body['id']) ;\n\n\t\ttry {\n\t\t\t$client->stats('ouch') ;\n\t\t\t$this->fail() ;\n\t\t} catch (\\Exception $e) {\n\t\t\treturn ;\n\t\t}\n\t}",
"public function testGetData() {\r\n $action = $this->_action;\r\n $this->assertEquals(null, $action->getData());\r\n\r\n $action->setData(array());\r\n $this->assertEquals(array(), $action->getData());\r\n }",
"public function testRequestBuilding(): void\n {\n $this->requestAsJson();\n $this->configRequest([\n 'headers' => [\n 'X-CSRF-Token' => 'abc123',\n ],\n 'base' => '',\n 'webroot' => '/',\n 'environment' => [\n 'PHP_AUTH_USER' => 'foo',\n 'PHP_AUTH_PW' => 'bar',\n ],\n ]);\n $this->cookie('split_token', 'def345');\n $this->session(['User' => ['id' => '1', 'username' => 'mark']]);\n $request = $this->_buildRequest('/tasks/add', 'POST', ['title' => 'First post']);\n\n $this->assertSame('abc123', $request['environment']['HTTP_X_CSRF_TOKEN']);\n $this->assertSame('application/json', $request['environment']['CONTENT_TYPE']);\n $this->assertSame('/tasks/add', $request['url']);\n $this->assertArrayHasKey('split_token', $request['cookies']);\n $this->assertSame('def345', $request['cookies']['split_token']);\n $this->assertSame(['id' => '1', 'username' => 'mark'], $request['session']->read('User'));\n $this->assertSame('foo', $request['environment']['PHP_AUTH_USER']);\n $this->assertSame('bar', $request['environment']['PHP_AUTH_PW']);\n }",
"public function testIndexNoParametersAction() {\n\n // Dispatch page request and ensure it's successful\n //test given no parameters \n\n $this->dispatch('/settings/ajax');\n $this->assertController(\"ajax\");\n $this->assertAction(\"index\");\n $this->assertResponseCode(200);\n\n // Parse the response\n $response = Zend_Json::decode($this->getResponse()->getBody());\n\n //Ensure that the authenticated identity information matches the logged in user with the email and password in setUp()\n \n $this->assertTrue($response['payload']['first_name'] == 'admin');\n\n $this->assertEquals($response['payload']['email'], 'directorEmail@mailtest.com');\n \n $this->assertTrue($response['payload']['job_type'] == 1);\n }",
"public function testInboundDocumentGet()\n {\n }",
"public function testGetFeatureDetailsUsingGET()\n {\n }",
"public function testGetParameterReturnsValueOfRequestedParameter()\n {\n $queryString = http_build_query(\n [\n 'foo' => 'bar',\n 'baz' => 'samoflange',\n ]\n );\n\n $server = [\n 'QUERY_STRING' => $queryString,\n ];\n $request = new Request($this->config, $server);\n\n $this->assertEquals('bar', $request->getParameter('foo'));\n $this->assertEquals('samoflange', $request->getParameter('baz'));\n }",
"public function testGetDefault()\n {\n $response = $this->call('GET', '/graphql', [\n 'query' => $this->queries['examples']\n ]);\n\n $this->assertEquals($response->getStatusCode(), 200);\n\n $content = $response->getData(true);\n $this->assertArrayHasKey('data', $content);\n $this->assertEquals($content['data'], [\n 'examples' => $this->data\n ]);\n }",
"public function testRequest() {\n\t\t$this->startHttpHalting();\n\n\t\t$client_id = uniqid();\n\t\t$client_secret = uniqid();\n\n\t\tself::$options->set( 'domain', self::TEST_DOMAIN );\n\t\tself::$options->set( 'client_id', $client_id );\n\t\tself::$options->set( 'client_secret', $client_secret );\n\t\t$api_client_creds = new WP_Auth0_Api_Client_Credentials( self::$options );\n\n\t\t$decoded_res = [];\n\t\ttry {\n\t\t\t$api_client_creds->call();\n\t\t} catch ( Exception $e ) {\n\t\t\t$decoded_res = unserialize( $e->getMessage() );\n\t\t}\n\n\t\t$this->assertNotEmpty( $decoded_res );\n\t\t$this->assertEquals( 'https://' . self::TEST_DOMAIN . '/oauth/token', $decoded_res['url'] );\n\t\t$this->assertEquals( 'POST', $decoded_res['method'] );\n\t\t$this->assertArrayHasKey( 'Content-Type', $decoded_res['headers'] );\n\t\t$this->assertEquals( 'application/json', $decoded_res['headers']['Content-Type'] );\n\t\t$this->assertArrayHasKey( 'client_id', $decoded_res['body'] );\n\t\t$this->assertEquals( $client_id, $decoded_res['body']['client_id'] );\n\t\t$this->assertArrayHasKey( 'client_secret', $decoded_res['body'] );\n\t\t$this->assertEquals( $client_secret, $decoded_res['body']['client_secret'] );\n\t\t$this->assertArrayHasKey( 'audience', $decoded_res['body'] );\n\t\t$this->assertEquals( 'https://' . self::TEST_DOMAIN . '/api/v2/', $decoded_res['body']['audience'] );\n\t\t$this->assertArrayHasKey( 'grant_type', $decoded_res['body'] );\n\t\t$this->assertEquals( 'client_credentials', $decoded_res['body']['grant_type'] );\n\t}",
"public function youCanUseABuilderAsData()\n {\n // Arrange...\n $fruit = $this->createTestModel()->newQuery();\n\n // Act...\n $response = $this->responder->success( $fruit );\n\n // Assert...\n $this->assertEquals( $response->getData( true ), [\n 'status' => 200,\n 'success' => true,\n 'data' => [\n [\n 'name' => 'Mango',\n 'price' => 10,\n 'isRotten' => false\n ]\n ]\n ] );\n }",
"public function testCms()\n {\n $client = new Client();\n $response = $client->request('GET', 'http://localhost:5005/students/1');\n $this->assertEquals($response->getHeaderLine('content-type'), 'application/json');\n }",
"public function testGetPostDataReturnsNull()\n {\n $this->assertNull($this->class->get_post_data('invalid'));\n }"
] | [
"0.7118828",
"0.70824975",
"0.7072472",
"0.6878323",
"0.67960525",
"0.6769193",
"0.6682783",
"0.66697425",
"0.6667823",
"0.6654757",
"0.66335076",
"0.66046935",
"0.6527936",
"0.6517767",
"0.64961845",
"0.64823467",
"0.64347225",
"0.64346737",
"0.6429513",
"0.6419085",
"0.640724",
"0.63614225",
"0.63457984",
"0.6325347",
"0.6321674",
"0.62973243",
"0.6296302",
"0.6279768",
"0.62740034",
"0.6272601",
"0.62699366",
"0.62542397",
"0.6235971",
"0.62245524",
"0.62196773",
"0.62171304",
"0.62051624",
"0.61993176",
"0.61987585",
"0.6196952",
"0.6195537",
"0.618944",
"0.6177256",
"0.6154392",
"0.6150657",
"0.6148809",
"0.61314756",
"0.6129075",
"0.6127554",
"0.6120494",
"0.608114",
"0.60760915",
"0.6057766",
"0.60569453",
"0.60513806",
"0.60370046",
"0.6035405",
"0.6023993",
"0.60220516",
"0.60130113",
"0.60046184",
"0.5999281",
"0.5998684",
"0.5985071",
"0.59843504",
"0.59808445",
"0.5975985",
"0.5968523",
"0.59612966",
"0.5959726",
"0.5958463",
"0.59443307",
"0.59426135",
"0.59230334",
"0.5915114",
"0.5911044",
"0.5908544",
"0.59027994",
"0.5902611",
"0.58993876",
"0.58991736",
"0.5897146",
"0.5891216",
"0.5891021",
"0.5889532",
"0.58860534",
"0.5883205",
"0.5881708",
"0.58801377",
"0.5877721",
"0.5871236",
"0.58657235",
"0.5859452",
"0.58552086",
"0.58540225",
"0.5847064",
"0.5845947",
"0.5840771",
"0.5840771",
"0.5840621",
"0.58401805"
] | 0.0 | -1 |
Test Integration access token cannot be used as Bearer token by default | public function testIntegrationAsBearerTokenDefault()
{
$this->_markTestAsRestOnly();
$oauthService = ObjectManager::getInstance()->get(OauthServiceInterface::class);
$accessToken = $oauthService->getAccessToken($this->integration->getConsumerId());
$serviceInfo = [
'rest' => [
'token' => $accessToken,
'resourcePath' => '/V1/store/storeViews',
'httpMethod' => \Magento\Webapi\Model\Rest\Config::HTTP_METHOD_GET,
],
];
self::expectException(\Exception::class);
self::expectExceptionMessage('The consumer isn\'t authorized to access %resources.');
$this->_webApiCall($serviceInfo);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testToken()\n {\n\t\t\t$response = $this->json('POST', '/api/login', ['email' => 'admin@admin.com', 'password' => 'adminadmin']);\n\n\t\t\t$response\n\t\t\t\t\t->assertStatus(200)\n\t\t\t\t\t->assertJson([\n\t\t\t\t\t\t\t'token_type' => 'bearer',\n\t\t\t\t\t]);\n }",
"public function testIntegrationAsBearerTokenEnabled()\n {\n $this->_markTestAsRestOnly();\n $oauthService = ObjectManager::getInstance()->get(OauthServiceInterface::class);\n $accessToken = $oauthService->getAccessToken($this->integration->getConsumerId());\n $serviceInfo = [\n 'rest' => [\n 'token' => $accessToken->getToken(),\n 'resourcePath' => '/V1/store/storeViews',\n 'httpMethod' => \\Magento\\Webapi\\Model\\Rest\\Config::HTTP_METHOD_GET,\n ],\n ];\n $this->_webApiCall($serviceInfo);\n }",
"public function testAuthenticationServiceAccessTokenInformation()\n {\n }",
"public function testTokenRequirement()\n {\n $this->get('/api/data')\n ->assertJson([\n 'status' => 'error'\n ])\n ->isOK();\n }",
"public function testAuthenticationServiceSignAccessToken()\n {\n }",
"public function testFailedDifferentUserLoggedIn(): void\n {\n self::$httpAuthorizationToken = AccessTokenFixture::DATA['access-token-juliette']['id'];\n\n $this->checkFailedAccessDenied();\n }",
"public function testWithInvalidToken()\n {\n Configure::write('debug', false);\n $request = new ServerRequest();\n\n $request = $request->withEnv('HTTP_AUTHORIZATION', 'Bearer this.is.invalid');\n $result = $this->auth->getUser($request, $this->response);\n $this->assertFalse($result);\n }",
"public function testGetUserToken()\n {\n\n }",
"public function testFetchingResourceWithInvalidAccessTokenBearer()\n {\n $client = new OAuth2\\Client(CLIENT_ID, CLIENT_SECRET, OAuth2\\Client::AUTH_TYPE_AUTHORIZATION_BASIC);\n\n // Here you can define any other params that you want to pass.\n $params = array();\n\n // Generating Token\n $tokenResponse = $client->getAccessToken(TOKEN_URI, OAuth2\\Client::GRANT_TYPE_CLIENT_CREDENTIALS, $params);\n $httpCode = $tokenResponse['code'];\n \n $client->setAccessToken($tokenResponse['result']['access_token']);\n // Setting Up the access Token Type to client Object\n $client->setAccessTokenType(OAuth2\\Client::ACCESS_TOKEN_OAUTH);\n\n // Finally fetching resource from Resource URL using access token\n $resourceResponse = $client->fetch('https://api.fronter.com/clients/'.CLIENT_ID);\n\n $resourceURLResponseHttpCode = $resourceResponse['code'];\n\n $this->assertEquals(401, $resourceURLResponseHttpCode);\n }",
"public function testGetTokenWithInValidTokenEndPoint()\n {\n $client = new OAuth2\\Client(CLIENT_ID, CLIENT_SECRET, OAuth2\\Client::AUTH_TYPE_AUTHORIZATION_BASIC);\n\n // Here you can define any other params that you want to pass.\n $params = array();\n\n // Generating Token\n $tokenResponse = $client->getAccessToken(\n 'http://api.fronter.com/clients',\n OAuth2\\Client::GRANT_TYPE_CLIENT_CREDENTIALS,\n $params\n );\n $httpCode = $tokenResponse['code'];\n\n $this->assertEquals($httpCode, 404);\n }",
"public function testSucceededDifferentUserLoggedInButAdmin(): void\n {\n self::$httpAuthorizationToken = AccessTokenFixture::DATA['access-token-yannis']['id'];\n\n $this->checkSucceeded();\n }",
"public function testAuthenticateTokenHeader()\n {\n $request = new ServerRequest();\n\n $expected = [\n 'id' => 1,\n 'group_id' => 1,\n 'user_name' => 'admad',\n 'email' => 'admad@example.com',\n 'created' => new FrozenTime('2014-03-17 01:18:23'),\n 'updated' => new FrozenTime('2014-03-17 01:20:31'),\n ];\n $request = $request->withEnv('HTTP_AUTHORIZATION', 'Bearer ' . $this->token);\n $result = $this->auth->getUser($request, $this->response);\n $this->assertEquals($expected, $result);\n\n $request = $request->withEnv('HTTP_AUTHORIZATION', 'WrongBearer ' . $this->token);\n $result = $this->auth->getUser($request, $this->response);\n $this->assertFalse($result);\n\n $this->expectException('UnexpectedValueException');\n $request = $request->withEnv('HTTP_AUTHORIZATION', 'Bearer foobar');\n $result = $this->auth->getUser($request, $this->response);\n $this->assertFalse($result);\n }",
"public function testGetInstantUserWithOutToken()\n {\n $this->get('api/Users/edit')\n ->seeJson([\n 'success' => false,\n 'error_code' => \"TOKEN_EMPTY\",\n 'error_massage' => \"Please send token\"\n ])\n ->seeJsonStructure([\n 'success',\n 'error_code',\n 'error_massage'\n ]);\n }",
"public function test_authorization_header()\n {\n }",
"public function testGetTokenWithInValidClientId()\n {\n $client = new OAuth2\\Client('', CLIENT_SECRET, OAuth2\\Client::AUTH_TYPE_AUTHORIZATION_BASIC);\n\n // Here you can define any other params that you want to pass.\n $params = array();\n\n // Generating Token\n $tokenResponse = $client->getAccessToken(TOKEN_URI, OAuth2\\Client::GRANT_TYPE_CLIENT_CREDENTIALS, $params);\n $httpCode = $tokenResponse['code'];\n\n $this->assertEquals($httpCode, 401);\n }",
"public function test_create_task_token_not_given_or_expired()\n {\n $credential = [\n 'body' => 'testing task'\n ];\n\n $token = '';\n\n $response = $this->json('POST', '/api/tasks', $credential, ['Accept' => 'application/json', 'Authorization' => 'Bearer '.$token]);\n\n $response\n ->assertStatus(401)\n ->assertJsonStructure(['message'])\n ->assertJsonPath('message', \"Unauthenticated.\");\n }",
"public function testIntegrationAuthenticated()\n {\n $request = new HTTPRequest('POST', Director::absoluteBaseURL() . '/graphql');\n\n $response = Director::test(\n '/graphql',\n [],\n [],\n 'POST',\n '',\n [\n $this->headerName => $this->key->ApiKey,\n ],\n [],\n $request\n );\n\n $body = json_decode($response->getBody());\n $errors = $body->errors;\n $this->assertCount(1, $errors);\n $this->assertEquals('Not authorised', $errors[0]->message);\n }",
"public function testGetToken()\n {\n $client = new Client();\n\n $body['grant_type'] = \"client_credentials\";\n $user = 'testclient';\n $pass = 'testpass';\n $res = $client->post($this->baseUrl . '/token', [ \n 'form_params' => $body,\n 'auth' => [$user, $pass] \n ]);\n\n $code = $res->getStatusCode();\n $body = $res->getBody();\n\n $this->assertEquals(200, $code);\n }",
"public function testOGParserAuthentication()\n {\n $response = $this->json(\n 'POST',\n '/api/content/ogparser',\n ['url' => 'https://www.codejungle.org'],\n ['HTTP_Authorization' => 'Bearer xxx']\n );\n\n $response->assertStatus(401);\n }",
"public function testValidateToken()\n {\n }",
"public function testLoginToken(){\n \n $client = static::createClient();\n $data = '{\n \"token_session\": \"8b0d9c93a3545d0d99f6486208dd3659ec802ee1\",\n \"login\": \"santevet\"\n }';\n $crawler = $client->request(\n 'PUT', '/generate/token/temp', array(), array(),\n array(\n 'CONTENT_TYPE' => 'application/json',\n 'HTTP_X-Requested-With' => 'XMLHttpRequest'\n ),\n $data\n ); \n $response = $client->getResponse();\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertSame('application/json', $response->headers->get('Content-Type'));\n $body = json_decode($response->getContent(), true);\n $this->assertArrayHasKey('token_temp', $body);\n $this->assertArrayHasKey('expiration', $body);\n $this->assertNotEquals(null,$body['token_temp']);\n $this->assertNotEquals(null,$body['expiration']);\n \n $_data = $body;\n \n $data = '{\n \"login\": \"santevet\",\n \"token_temp\": \"'.$_data['token_temp'].'\",\n \"expiration\": \"'.$_data['expiration'].'\"\n }';\n $crawler = $client->request(\n 'POST', '/login/token', array(), array(),\n array(\n 'CONTENT_TYPE' => 'application/json',\n 'HTTP_X-Requested-With' => 'XMLHttpRequest'\n ),\n $data\n );\n $response = $client->getResponse();\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertSame('application/json', $response->headers->get('Content-Type'));\n $body = json_decode($response->getContent(), true);\n $this->assertArrayHasKey('token_session', $body);\n $this->assertArrayHasKey('validity', $body);\n $this->assertNotEquals(null,$body['token_session']);\n $this->assertNotEquals(null,$body['validity']);\n }",
"public function testFetchingResourceWithInvalidAthorizationType()\n {\n $client = new OAuth2\\Client(CLIENT_ID, CLIENT_SECRET, OAuth2\\Client::AUTH_TYPE_URI);\n\n // Here you can define any other params that you want to pass.\n $params = array();\n\n // It will throw an Exception(InvalidArgumentException)\n $tokenResponse = $client->getAccessToken(TOKEN_URI, OAuth2\\Client::GRANT_TYPE_PASSWORD, $params);\n }",
"public function testExample()\n {\n $response = $this->json('POST', '/api/login', ['email' => 'paul@client.com','password' => '987654321']);\n\n $response\n\n ->assertJsonFragment([\n 'token_type' => 'bearer',\n ]);\n }",
"public function testSendingRequestWithToken()\n {\n $response = $this->get('/api/drivers', ['api_token' => config('constants.TEST_TOKEN')]);\n\n $response->assertStatus(200);\n }",
"public function testAndRefresh()\n {\n try {\n if (JWTAuth::parseToken()->getClaim('origin') == $this->claim) {\n $payload = JWTAuth::parseToken()->getPayload()->get('exp');\n\n switch (true) {\n case ($payload - Carbon::now()->timestamp > 600):\n return response()->json(['data' => ['status' => 1]], 200);\n break;\n case ($payload - Carbon::now()->timestamp > 0):\n return response()->json([\n 'data' => [\n 'status' => 2,\n 'access_token' => JWTAuth::parseToken()->refresh(),\n 'token_type' => 'bearer',\n 'expires_in' => JWTAuth::factory()->getTTL()\n ]\n ], 200);\n break;\n }\n } else {\n throw new AuthenticationException(null, 'Invalid Token');\n }\n } catch (TokenExpiredException $e) {\n return response()->json(['data' => ['status' => 0]], 200);\n } catch (JWTException $e) {\n throw new AuthenticationException($e->getMessage(), 'The token cannot be tested');\n }\n\n return response()->json(['data' => ['status' => 0]], 200);\n }",
"public function testSearchAdminWithoutToken()\n {\n $this -> call('GET','api/classes/admins/search',['string' => $this -> userCredentials[\"email\"]]);\n $this -> seeJsonEquals([\n 'error' => 'Token does not exist anymore. Login again.'\n ]);\n }",
"public function testLogin()\n {\n $response = $this->json('post', '/api/login',\n ['email' => 'ekeenyinnaya@gmail.com', 'password' => 'password']);\n $response->assertStatus(200)\n ->assertJsonStructure(['access_token']);\n }",
"public function testViewNotAToken()\n {\n $response = $this->actingAsTestingUser()\n ->withEncryptionKey()\n ->get(route('tokens.code', ['notatoken']));\n\n $response->assertStatus(404);\n }",
"public function testInvalidToken()\n {\n $this->sessionInfo['logged_in'] = true;\n $this->sessionInfo['token'] = 'foo';\n\n $this->session($this->sessionInfo);\n\n $response = $this->call('GET', '/api/user');\n\n $this->assertEquals(200, $response->getStatusCode());\n\n $decoded = json_decode($response->getContent());\n\n $this->assertEquals('error', $decoded->status);\n }",
"public function testGeneratetTokenTempFaillureToken(){\n $client = static::createClient();\n $data = '{\n \"token_session\": \"token_not_exist\",\n \"login\": \"santevet\"\n }';\n $crawler = $client->request(\n 'PUT', '/generate/token/temp', array(), array(),\n array(\n 'CONTENT_TYPE' => 'application/json',\n 'HTTP_X-Requested-With' => 'XMLHttpRequest'\n ),\n $data\n ); \n $response = $client->getResponse();\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertSame('application/json', $response->headers->get('Content-Type'));\n $body = json_decode($response->getContent(), true);\n $this->assertArrayHasKey('token_temp', $body);\n $this->assertArrayHasKey('expiration', $body);\n $this->assertEquals(null,$body['token_temp']);\n $this->assertEquals(null,$body['expiration']);\n }",
"public function testLoginTokenFaillureExpired(){\n $client = static::createClient();\n $data = '{\n \"token_session\": \"8b0d9c93a3545d0d99f6486208dd3659ec802ee1\",\n \"login\": \"santevet\"\n }';\n $crawler = $client->request(\n 'PUT', '/generate/token/temp', array(), array(),\n array(\n 'CONTENT_TYPE' => 'application/json',\n 'HTTP_X-Requested-With' => 'XMLHttpRequest'\n ),\n $data\n ); \n $response = $client->getResponse();\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertSame('application/json', $response->headers->get('Content-Type'));\n $_data = json_decode($response->getContent(), true);\n \n $data = '{\n \"login\": \"santevet\",\n \"token_temp\": \"'.$_data['token_temp'].'\",\n \"expiration\": \"2015-01-01 00:00:00\"\n }';\n $crawler = $client->request(\n 'POST', '/login/token', array(), array(),\n array(\n 'CONTENT_TYPE' => 'application/json',\n 'HTTP_X-Requested-With' => 'XMLHttpRequest'\n ),\n $data\n );\n $response = $client->getResponse();\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertSame('application/json', $response->headers->get('Content-Type'));\n $body = json_decode($response->getContent(), true);\n $this->assertArrayHasKey('token_session', $body);\n $this->assertArrayHasKey('validity', $body);\n $this->assertEquals(null,$body['token_session']);\n $this->assertEquals(null,$body['validity']);\n }",
"public function testAuthenticate()\n {\n $this->mockWebApplication([\n 'modules' => [\n 'oauth2' => [\n 'resourceServerAccessTokenRevocationValidation' => false, // Token revocation validation is tested during functional testing.\n ]\n ]\n ]);\n // phpcs:enable Generic.Files.LineLength.TooLong\n\n $request = Yii::$app->request;\n $request->headers->set('Authorization', 'Bearer ' . $this->validAccessToken);\n\n $httpBearerAuth = new Oauth2HttpBearerAuth();\n\n $identity = $httpBearerAuth->authenticate(Yii::$app->user, $request, Yii::$app->response);\n $this->assertNotNull($identity);\n $this->assertEquals(123, $identity->getId());\n }",
"public function testIndexWithoutToken()\n {\n // Create user\n $this -> createUser($this -> userCredentials);\n\n $this -> call('GET','api/classes');\n $this -> seeJsonEquals([\n 'error' => 'Token does not exist anymore. Login again.'\n ]);\n }",
"public function testAuthenticateTokenParameter()\n {\n $request = new ServerRequest();\n\n $result = $this->auth->getUser($request, $this->response);\n $this->assertFalse($result);\n\n $expected = [\n 'id' => 1,\n 'group_id' => 1,\n 'user_name' => 'admad',\n 'email' => 'admad@example.com',\n 'created' => new FrozenTime('2014-03-17 01:18:23'),\n 'updated' => new FrozenTime('2014-03-17 01:20:31'),\n ];\n $request = new ServerRequest(['url' => 'posts/index?token=' . $this->token]);\n $result = $this->auth->getUser($request, $this->response);\n $this->assertEquals($expected, $result);\n\n $this->auth->setConfig('parameter', 'tokenname');\n $request = new ServerRequest(['url' => 'posts/index?tokenname=' . $this->token]);\n $result = $this->auth->getUser($request, $this->response);\n $this->assertEquals($expected, $result);\n\n $request = new ServerRequest(['url' => 'posts/index?wrongtoken=' . $this->token]);\n $result = $this->auth->getUser($request, $this->response);\n $this->assertFalse($result);\n }",
"public function testSucceededDifferentUserLoggedInButModerator(): void\n {\n self::$httpAuthorizationToken = AccessTokenFixture::DATA['access-token-leslie']['id'];\n\n $this->checkSucceeded();\n }",
"public function testShowUnauthicatedAccess(): void { }",
"public function testValidCredentialsInHeader()\n {\n $server = $this->getTestServer();\n $headers = array('HTTP_AUTHORIZATION' => 'Basic '.base64_encode('Test Client ID:TestSecret'), 'REQUEST_METHOD' => 'POST');\n $params = array('grant_type' => 'client_credentials');\n $request = new Request(array(), $params, array(), array(), array(), $headers);\n $token = $server->grantAccessToken($request, new Response());\n\n $this->assertNotNull($token);\n $this->assertArrayHasKey('access_token', $token);\n $this->assertNotNull($token['access_token']);\n\n // create using PHP Authorization Globals\n $headers = array('PHP_AUTH_USER' => 'Test Client ID', 'PHP_AUTH_PW' => 'TestSecret', 'REQUEST_METHOD' => 'POST');\n $params = array('grant_type' => 'client_credentials');\n $request = new Request(array(), $params, array(), array(), array(), $headers);\n $token = $server->grantAccessToken($request, new Response());\n\n $this->assertNotNull($token);\n $this->assertArrayHasKey('access_token', $token);\n $this->assertNotNull($token['access_token']);\n }",
"public function testFetchResourceWithInValidToken()\n {\n $client = new OAuth2\\Client(CLIENT_ID, CLIENT_SECRET, OAuth2\\Client::AUTH_TYPE_AUTHORIZATION_BASIC);\n\n // Here you can define any other params that you want to pass.\n $params = array();\n\n // Generating Token\n $tokenResponse = $client->getAccessToken(TOKEN_URI, OAuth2\\Client::GRANT_TYPE_CLIENT_CREDENTIALS, $params);\n $httpCode = $tokenResponse['code'];\n \n $client->setAccessToken('');\n // Setting Up the access Token Type to client Object\n $client->setAccessTokenType(OAuth2\\Client::ACCESS_TOKEN_BEARER);\n\n // Finally fetching resource from Resource URL using access token\n $resourceResponse = $client->fetch('https://api.fronter.com/clients/'.CLIENT_ID);\n $resourceURLResponseHttpCode = $resourceResponse['code'];\n\n $this->assertEquals(401, $resourceURLResponseHttpCode);\n }",
"public function testAuthorization(){\n $this->client->request('POST', '/api',[\n 'method' => 'createTransaction',\n 'user_id' => '0',\n 'token' => 'xxxxx',\n 'category_id' => '2',\n 'cost' => '123123',\n 'note' => 'asdadasgfa asfas ',\n ]);\n $data = json_decode($this->client->getResponse()->getContent(), true);\n $this->assertEquals(0, $data['success']);\n $this->assertEquals('User not found', $data['message']);\n\n $this->client->request('POST', '/api',[\n 'method' => 'createTransaction',\n 'user_id' => '-1',\n 'token' => 'xxxxx',\n 'category_id' => '2',\n 'cost' => '123123',\n 'note' => '',\n ]);\n $data = json_decode($this->client->getResponse()->getContent(), true);\n $this->assertEquals(0, $data['success']);\n $this->assertEquals('User not found', $data['message']);\n\n $this->client->request('POST', '/api',[\n 'method' => 'createTransaction',\n 'user_id' => '1',\n 'token' => 'xxxxx',\n 'category_id' => '2',\n 'cost' => '123123',\n 'note' => 'Test note',\n ]);\n $data = json_decode($this->client->getResponse()->getContent(), true);\n $this->assertEquals(0, $data['success']);\n $this->assertEquals('Request Fail,logout or sign in again', $data['message']);\n\n //Token of user already in database\n $this->client->request('POST', '/api',[\n 'method' => 'createTransaction',\n 'user_id' => '1',\n 'token' => '73a395f4b62a75ba12512e2d2b3b6dac',\n 'category_id' => '2',\n 'cost' => '123123',\n 'note' => 'Test note',\n ]);\n $data = json_decode($this->client->getResponse()->getContent(), true);\n $this->assertEquals(1, $data['success']);\n }",
"public function testLoginTokenFaillureTokenTemp(){\n $client = static::createClient();\n $data = '{\n \"token_session\": \"8b0d9c93a3545d0d99f6486208dd3659ec802ee1\",\n \"login\": \"santevet\"\n }';\n $crawler = $client->request(\n 'PUT', '/generate/token/temp', array(), array(),\n array(\n 'CONTENT_TYPE' => 'application/json',\n 'HTTP_X-Requested-With' => 'XMLHttpRequest'\n ),\n $data\n ); \n $response = $client->getResponse();\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertSame('application/json', $response->headers->get('Content-Type'));\n $_data = json_decode($response->getContent(), true);\n \n $data = '{\n \"login\": \"santevet\",\n \"token_temp\": \"error_token_temp\",\n \"expiration\": \"'.$_data['expiration'].'\"\n }';\n $crawler = $client->request(\n 'POST', '/login/token', array(), array(),\n array(\n 'CONTENT_TYPE' => 'application/json',\n 'HTTP_X-Requested-With' => 'XMLHttpRequest'\n ),\n $data\n );\n $response = $client->getResponse();\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertSame('application/json', $response->headers->get('Content-Type'));\n $body = json_decode($response->getContent(), true);\n $this->assertArrayHasKey('token_session', $body);\n $this->assertArrayHasKey('validity', $body);\n $this->assertEquals(null,$body['token_session']);\n $this->assertEquals(null,$body['validity']);\n }",
"public function testSendVerificationTokenGet()\n {\n }",
"public function testThatClientSecretIsRequired()\n {\n $env = self::getEnv();\n $api = new Authentication($env['DOMAIN'], $env['APP_CLIENT_ID'], $env['APP_CLIENT_SECRET']);\n\n try {\n $api->refresh_token( uniqid(), [ 'client_secret' => '' ] );\n $caught_exception = false;\n } catch (ApiException $e) {\n $caught_exception = $this->errorHasString( $e, 'client_secret is mandatory' );\n }\n\n $this->assertTrue( $caught_exception );\n }",
"public function get_test_authorization_header()\n {\n }",
"public function testGetListActionWithToken()\n {\n // Get an authenticated client\n $client = $this->createAuthenticatedClient('sjouan', '1GreatP@ssword');\n // Test the route\n $client->request('GET', '/api/products');\n\n // Check the response\n $this->assertSame(Response::HTTP_OK, $client->getResponse()->getStatusCode());\n // asserts that the response status code is 2xx\n $this->assertTrue($client->getResponse()->isSuccessful(), 'response status is 2xx');\n }",
"public function testGetTokenWithValidClientId()\n {\n $client = new OAuth2\\Client(CLIENT_ID, CLIENT_SECRET, OAuth2\\Client::AUTH_TYPE_AUTHORIZATION_BASIC);\n\n // Here you can define any other params that you want to pass.\n $params = array();\n\n // Generating Token\n $tokenResponse = $client->getAccessToken(TOKEN_URI, OAuth2\\Client::GRANT_TYPE_CLIENT_CREDENTIALS, $params);\n $httpCode = $tokenResponse['code'];\n $this->assertEquals($httpCode, 200);\n }",
"public function testGeneratetTokenTempFaillureLogin(){\n $client = static::createClient();\n $data = '{\n \"token_session\": \"8b0d9c93a3545d0d99f6486208dd3659ec802ee1\",\n \"login\": \"error_login\"\n }';\n $crawler = $client->request(\n 'PUT', '/generate/token/temp', array(), array(),\n array(\n 'CONTENT_TYPE' => 'application/json',\n 'HTTP_X-Requested-With' => 'XMLHttpRequest'\n ),\n $data\n ); \n $response = $client->getResponse();\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertSame('application/json', $response->headers->get('Content-Type'));\n $body = json_decode($response->getContent(), true);\n $this->assertArrayHasKey('token_temp', $body);\n $this->assertArrayHasKey('expiration', $body);\n $this->assertEquals(null,$body['token_temp']);\n $this->assertEquals(null,$body['expiration']);\n }",
"public function test_it_must_be_authenticated_user()\n {\n $this->json('post' , 'api/orders')->assertStatus(401);\n }",
"public function testGeneratetTokenTempFaillure(){\n $client = static::createClient();\n $data = '{\n \"token_session\": \"token_not_exist\",\n \"login\": \"error_login\"\n }';\n $crawler = $client->request(\n 'PUT', '/generate/token/temp', array(), array(),\n array(\n 'CONTENT_TYPE' => 'application/json',\n 'HTTP_X-Requested-With' => 'XMLHttpRequest'\n ),\n $data\n ); \n $response = $client->getResponse();\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertSame('application/json', $response->headers->get('Content-Type'));\n $body = json_decode($response->getContent(), true);\n $this->assertArrayHasKey('token_temp', $body);\n $this->assertArrayHasKey('expiration', $body);\n $this->assertEquals(null,$body['token_temp']);\n $this->assertEquals(null,$body['expiration']);\n }",
"public function setaccess_token($value);",
"public function testThatRefreshTokenIsRequired()\n {\n $env = self::getEnv();\n $api = new Authentication($env['DOMAIN'], $env['APP_CLIENT_ID'], $env['APP_CLIENT_SECRET']);\n\n try {\n $api->refresh_token( null );\n $caught_exception = false;\n } catch (ApiException $e) {\n $caught_exception = $this->errorHasString( $e, 'Refresh token cannot be blank' );\n }\n\n $this->assertTrue( $caught_exception );\n }",
"public function testDoTokenRequest() {\n $params = [\n 'redirect_uri' => 'http://localhost/eloqua_api_redux/callback',\n 'grant_type' => 'refresh_token',\n 'refresh_token' => 'SplxlOBeZQQYbYS6WxSbIA',\n ];\n $mockedResponse = new Response(200,\n ['Content-Type' => 'application/json'],\n $this->getMockResponseContents(self::ACCESS_TOKEN_RESPONSE)\n );\n\n $httpClientFactory = $this->getMockBuilder('Drupal\\Core\\Http\\ClientFactory')\n ->disableOriginalConstructor()\n ->setMethods(['fromOptions'])\n ->getMock();\n\n $guzzleClient = $this->getMockBuilder('GuzzleHttp\\Client')\n ->disableOriginalConstructor()\n ->setMethods(['request'])\n ->getMock();\n\n $guzzleClient->expects($this->any())\n ->method('request')\n ->will($this->returnValue($mockedResponse));\n\n $httpClientFactory->expects($this->any())\n ->method('fromOptions')\n ->will($this->returnValue($guzzleClient));\n\n $eloquaApiClient = $this->getMockBuilder('Drupal\\eloqua_api_redux\\Service\\EloquaApiClient')\n ->setConstructorArgs([\n $this->configFactory,\n $this->loggerFactory,\n $this->cacheBackend,\n $httpClientFactory,\n ])\n ->setMethods(['setEloquaApiCache', 'doBaseUrlRequest'])\n ->getMock();\n\n $eloquaApiClient->expects($this->at(0))\n ->method('setEloquaApiCache')\n ->with('access_token');\n $eloquaApiClient->expects($this->at(1))\n ->method('setEloquaApiCache')\n ->with('refresh_token');\n\n $eloquaApiClient->expects($this->any())\n ->method('setEloquaApiCache');\n\n $response = $eloquaApiClient->doTokenRequest($params);\n $this->assertNotEmpty($response);\n }",
"public function run()\n {\n $accessToken = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIzMjkiLCJqdGkiOiI5NDdjODdlMWI0MTU1N2Q1NzRiMmIzOTgzM2ViZWJjZWY3NjZmZTA3Yjc5NjllYTI3NTc1NTgwNTYzNTBlOGUyMjBlMDhhZTA0ZjhlYzM3MyIsImlhdCI6MTYyNTI0MjM0MywibmJmIjoxNjI1MjQyMzQzLCJleHAiOjE2NTY3NzgzNDMsInN1YiI6IjE0NjEiLCJzY29wZXMiOltdfQ.RjIAPcd6oSptTTKM0HhDIp8vA_xqhI5iccoxw1whZRvCzYHVii-WHiHU3JwRQDtJXKzRheqqcioUKkpoHH2SZQ1biWX0S5mqmunITFLoIHXhi61YYp4ctvlfvxud-9EGeQ4agqLazGDwxgCAwbo5dJRhvSX_SLcq0XLIdHU-_WqYXyb1Cy7vejsfR2Tx26vDqKsneHOiOTji7RT8TRg0Ej222WivgfBfcB-FzKPlFoKp6kYoSeLBvd5hZLERzFjfeWDVd38S4zxTFoSZH6Sg-WqZ5s3472CJ36_zWsh3R3Ebu0S7s-0uriCkdrVlzNY1xZABkVAedd-JyNgmKgA-zVb4AsNUXOqKJ-S7Nn3uVZmdbBWYjMPJBomsjt3xSSP4zq3-aJGJabG-GMvzWSGMxBDQeYlzFy_B3JLK0ZWaWLFN8eLJsHuHhF2zjypcPZkOajuQvrXNSFgm69_x57SSveM0eFkcbcvYzfHDcw6EvBrwPcvGE9RDajqBz3_So57WJRx2P_S7DJm64O_1m53AsmJz34MQxwCcDSUc7ZKwEX8mRRcu2RjWWoCLvOtA3mWx7v8nuREKXweBeHgSoPwXAJLIlsLT0yWVT603mseTVZ1MDSdtr46demlr_FGwqsKHyu5Fz54SBMpUEsqD3qIkFDT4VMc6Ge8v3ll_WVRui3M';\n\n $client = new ClientGuzzle([\n 'headers' => [\n 'Accept' => 'application/json',\n 'Authorization' => 'Bearer '.$accessToken,\n 'Content-Type' => 'application/json'\n ],\n ]);\n\n $response = $client->get('https://www.lioren.cl/api/ciudades');\n $responseBody = json_decode((string) $response->getBody(), true);\n foreach($responseBody as $ciudad){\n Ciudad::create([\n 'nombre' => $ciudad['nombre'],\n 'codigo' => $ciudad['id'],\n ]);\n }\n }",
"public function testLoginController() {\n $user = $this->createUser(true);\n\n // Try to fail the login controller.\n $client = static::createClient();\n $client->request('POST', '/api/user/login');\n\n $this->assertEquals($client->getResponse()->getContent(), '{\"error\":\"The payload is not correct.\"}');\n\n $client = static::createClient();\n $client->request('POST', '/api/user/login', array(), array(), array('CONTENT_TYPE' => 'application/json'), '{\"auth\":\"pizza\"}');\n\n $this->assertEquals($client->getResponse()->getContent(), '{\"error\":\"The payload is not correct.\"}');\n\n // Create access token and start to check it's attached to the correct user.\n $auth = $this->getAuthString($user->username);\n\n $client = static::createClient();\n $client->request('POST', '/api/user/login', array(), array(), array('CONTENT_TYPE' => 'application/json'), '{\"auth\":\"' . $auth . '\"}');\n\n $response = $client->getResponse()->getContent();\n $decoded_response = json_decode($response);\n\n // Checking the access token belong to the user.\n $this->assertEquals($user->id, $decoded_response->user_id);\n\n // Checking the expires is valid for 1 day.\n $this->assertTrue($decoded_response->expires - time() > 86000);\n\n // Making sure we got the access token belongs to the user we created.\n $this->assertEquals($user->id, $this->getTahiniAccessToken()->loadByAccessToken($decoded_response->access_token)->user->id);\n }",
"public function testCreateTokenFromIdentity()\n {\n }",
"public function testCreateToken()\n {\n $response = $this->actingAsTestingUser()\n ->withEncryptionKey()\n ->get(route('tokens.create'));\n\n $response->assertStatus(200);\n $response->assertViewIs('tokens.form');\n }",
"public function testViewToken()\n {\n $response = $this->actingAsTestingUser()\n ->withEncryptionKey()\n ->get(route('tokens.code', [$this->token->path]));\n\n $response->assertStatus(200);\n $response->assertViewIs('tokens.code');\n }",
"#[\n OpenApi\\Operation(\n tags: ['Auth/Tokens'],\n security: 'AccessTokenSecurityScheme'\n )\n ]\n #[OpenApi\\Parameters(factory: AuthTokenParameters::class)]\n #[OpenApi\\Response(factory: TokenIndexResponse::class, statusCode: 200)]\n #[OpenApi\\Response(factory: UnauthorizedResponse::class, statusCode: 401)]\n #[\n OpenApi\\Response(\n factory: TooManyRequestsResponse::class,\n statusCode: 429\n )\n ]\n public function index() {\n $this->verifyNoDemo();\n\n return response()->pagination(\n fn($perPage) => AuthTokenResource::collection(\n authUser()\n ->tokens()\n ->active()\n ->type(TokenType::REFRESH)\n ->paginate($perPage)\n )\n );\n }",
"public function testComAdobeGraniteDistributionCoreImplTransportAccessTokenDistribu()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.granite.distribution.core.impl.transport.AccessTokenDistributionTransportSecretProvider';\n\n $crawler = $client->request('POST', $path);\n }",
"public function testListTokens()\n {\n $response = $this->actingAsTestingUser()\n ->withEncryptionKey()\n ->get(route('tokens.code'));\n\n $response->assertStatus(200);\n $response->assertViewIs('tokens.list');\n }",
"public function test_token_invalid() {\n\t\t$this->uri->rsegments[3] = 'b';\n\t\tset_valid_authorization();\n\t\t$out = run_action($this->c, 'token');\n\n\t\t$json = json_decode($out, true);\n\n\t\t$this->assertTrue($json['error']);\n\t\t$this->assertFalse(array_key_exists('opportunity', $json));\n\t\t$this->assertFalse(array_key_exists('opportunities', $json));\n\t}",
"public function testFetchingResourceWithInvalidGrantType()\n {\n $client = new OAuth2\\Client(CLIENT_ID, CLIENT_SECRET, OAuth2\\Client::AUTH_TYPE_AUTHORIZATION_BASIC);\n\n // Here you can define any other params that you want to pass.\n $params = array();\n\n // It will throw an Exception(InvalidArgumentException)\n $tokenResponse = $client->getAccessToken(TOKEN_URI, OAuth2\\Client::GRANT_TYPE_PASSWORD, $params);\n }",
"public function testAuthenticate($token, $fail, $version)\n\t{\n\t\t// Already got some credentials stored?\n\t\tif (!is_null($token))\n\t\t{\n\t\t\t$this->object->setToken($token);\n\t\t\t$result = $this->object->authenticate();\n\t\t\t$this->assertEquals($result, $token);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->object->setOption('requestTokenURL', 'https://example.com/request_token');\n\t\t\t$this->object->setOption('authoriseURL', 'https://example.com/authorize');\n\t\t\t$this->object->setOption('accessTokenURL', 'https://example.com/access_token');\n\n\t\t\t// Request token.\n\t\t\t$returnData = new stdClass;\n\t\t\t$returnData->code = 200;\n\t\t\t$returnData->body = 'oauth_token=token&oauth_token_secret=secret&oauth_callback_confirmed=true';\n\n\t\t\t$this->client->expects($this->at(0))\n\t\t\t\t->method('post')\n\t\t\t\t->with($this->object->getOption('requestTokenURL'))\n\t\t\t\t->will($this->returnValue($returnData));\n\n\t\t\t$input = TestReflection::getValue($this->object, 'input');\n\t\t\tTestReflection::setValue($this->object, 'input', $input);\n\n\t\t\tif (strcmp($version, '1.0a') === 0)\n\t\t\t{\n\t\t\t\t$this->object->setOption('callback', 'TEST_URL');\n\t\t\t}\n\t\t\t$this->object->authenticate();\n\n\t\t\t$token = $this->object->getToken();\n\t\t\t$this->assertEquals($token['key'], 'token');\n\t\t\t$this->assertEquals($token['secret'], 'secret');\n\n\t\t\t// Access token.\n\t\t\t$input = TestReflection::getValue($this->object, 'input');\n\n\t\t\tif (strcmp($version, '1.0a') === 0)\n\t\t\t{\n\t\t\t\tTestReflection::setValue($this->object, 'version', $version);\n\t\t\t\t$data = array('oauth_verifier' => 'verifier', 'oauth_token' => 'token');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tTestReflection::setValue($this->object, 'version', $version);\n\t\t\t\t$data = array('oauth_token' => 'token');\n\t\t\t}\n\t\t\tTestReflection::setValue($input, 'data', $data);\n\n\t\t\t// Get mock session\n\t\t\t$mockSession = $this->getMock('JSession', array( '_start', 'get'));\n\n\t\t\tif ($fail)\n\t\t\t{\n\t\t\t\t$mockSession->expects($this->at(0))\n\t\t\t\t\t\t\t->method('get')\n\t\t\t\t\t\t\t->with('key', null, 'oauth_token')\n\t\t\t\t\t\t\t->will($this->returnValue('bad'));\n\n\t\t\t\t$mockSession->expects($this->at(1))\n\t\t\t\t\t\t\t->method('get')\n\t\t\t\t\t\t\t->with('secret', null, 'oauth_token')\n\t\t\t\t\t\t\t->will($this->returnValue('session'));\n\n\t\t\t\tJFactory::$session = $mockSession;\n\n\t\t\t\t$this->setExpectedException('DomainException');\n\t\t\t\t$result = $this->object->authenticate();\n\t\t\t}\n\n\t\t\t$mockSession->expects($this->at(0))\n\t\t\t\t\t\t->method('get')\n\t\t\t\t\t\t->with('key', null, 'oauth_token')\n\t\t\t\t\t\t->will($this->returnValue('token'));\n\n\t\t\t$mockSession->expects($this->at(1))\n\t\t\t\t\t\t->method('get')\n\t\t\t\t\t\t->with('secret', null, 'oauth_token')\n\t\t\t\t\t\t->will($this->returnValue('secret'));\n\n\t\t\tJFactory::$session = $mockSession;\n\n\t\t\t$returnData = new stdClass;\n\t\t\t$returnData->code = 200;\n\t\t\t$returnData->body = 'oauth_token=token_key&oauth_token_secret=token_secret';\n\n\t\t\t$this->client->expects($this->at(0))\n\t\t\t\t->method('post')\n\t\t\t\t->with($this->object->getOption('accessTokenURL'))\n\t\t\t\t->will($this->returnValue($returnData));\n\n\t\t\t$result = $this->object->authenticate();\n\n\t\t\t$this->assertEquals($result['key'], 'token_key');\n\t\t\t$this->assertEquals($result['secret'], 'token_secret');\n\t\t}\n\t}",
"public function testOrgApacheJackrabbitOakSecurityAuthenticationTokenTokenConfigura()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/org.apache.jackrabbit.oak.security.authentication.token.TokenConfigurationImpl';\n\n $crawler = $client->request('POST', $path);\n }",
"public function testApiRedirect()\n {\n $_SERVER['HTTP']['Token'] = Session::get('Token');\n\n $response = $this->call('GET', '/api/');\n\n $this->assertEquals(200, $response->getStatusCode());\n\n $decoded = json_decode($response->getContent());\n\n $this->assertEquals('error', $decoded->status);\n }",
"private function requestToken() \n {\n $requestUrl = $this->configuration->getBaseUrl() . \"connect/token\";\n $postData = \"grant_type=client_credentials\" . \"&client_id=\" . $this->configuration->getClientId() . \"&client_secret=\" . $this->configuration->getClientSecret();\n $headers = [];\n $headers['Content-Type'] = \"application/x-www-form-urlencoded\";\n $headers['Content-Length'] = strlen($postData);\n $response = $this->client->send(new Request('POST', $requestUrl, $headers, $postData));\n $result = json_decode($response->getBody()->getContents(), true);\n $this->configuration->setAccessToken($result[\"access_token\"]);\n }",
"public function testInvalidAccessTokenThrowsException(): void\n {\n $apiKey = $this->createValidFakeApiKey();\n $this->expectException(InvalidAccessTokenException::class);\n $this->tryTestWithCredentials($apiKey);\n }",
"public function testComAdobeGraniteAuthOauthAccesstokenProvider()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.granite.auth.oauth.accesstoken.provider';\n\n $crawler = $client->request('POST', $path);\n }",
"public function testGetListActionWithoutToken()\n {\n // Create an un-authenticated client\n $client = static::createClient();\n // Test the route\n $client->request('GET', '/api/products');\n // Check the response\n $this->assertSame(Response::HTTP_UNAUTHORIZED, $client->getResponse()->getStatusCode());\n }",
"public function testLoginTokenFaillureLogin(){\n $client = static::createClient();\n $data = '{\n \"token_session\": \"8b0d9c93a3545d0d99f6486208dd3659ec802ee1\",\n \"login\": \"santevet\"\n }';\n $crawler = $client->request(\n 'PUT', '/generate/token/temp', array(), array(),\n array(\n 'CONTENT_TYPE' => 'application/json',\n 'HTTP_X-Requested-With' => 'XMLHttpRequest'\n ),\n $data\n ); \n $response = $client->getResponse();\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertSame('application/json', $response->headers->get('Content-Type'));\n $_data = json_decode($response->getContent(), true);\n \n $data = '{\n \"login\": \"error_login\",\n \"token_temp\": \"'.$_data['token_temp'].'\",\n \"expiration\": \"'.$_data['expiration'].'\"\n }';\n $crawler = $client->request(\n 'POST', '/login/token', array(), array(),\n array(\n 'CONTENT_TYPE' => 'application/json',\n 'HTTP_X-Requested-With' => 'XMLHttpRequest'\n ),\n $data\n );\n $response = $client->getResponse();\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertSame('application/json', $response->headers->get('Content-Type'));\n $body = json_decode($response->getContent(), true);\n $this->assertArrayHasKey('token_session', $body);\n $this->assertArrayHasKey('validity', $body);\n $this->assertEquals(null,$body['token_session']);\n $this->assertEquals(null,$body['validity']);\n }",
"public function testSearchModuleWithoutToken()\n {\n $this -> call('GET','api/classes/search',['string' => $this -> classSetting[\"code\"]]);\n $this -> seeJsonEquals([\n 'error' => 'Token does not exist anymore. Login again.'\n ]);\n }",
"public function testAccessToken($isSuccessful)\r\n {\r\n $accessToken = $isSuccessful ? $this->getAccessToken() : 'invalidtoken';\r\n\r\n $client = $this->client;\r\n $client->request(\r\n 'POST', \r\n '/api/product/create', \r\n array(),\r\n array(),\r\n array('CONTENT_TYPE' => 'application/x-www-form-urlencoded'),\r\n 'access_token='.$accessToken\r\n );\r\n\r\n if($isSuccessful){\r\n $this->assertEquals(\r\n \\Symfony\\Component\\HttpFoundation\\Response::HTTP_OK,\r\n $client->getResponse()->getStatusCode()\r\n );\r\n }\r\n else{\r\n $this->assertNotEquals(\r\n \\Symfony\\Component\\HttpFoundation\\Response::HTTP_OK,\r\n $client->getResponse()->getStatusCode()\r\n );\r\n }\r\n }",
"public function testLoginTokenFaillure(){\n $client = static::createClient();\n $data = '{\n \"login\": \"error_login\",\n \"token_temp\": \"error_token_temp\",\n \"expiration\": \"2010-02-02 05:00:00\"\n }';\n $crawler = $client->request(\n 'POST', '/login/token', array(), array(),\n array(\n 'CONTENT_TYPE' => 'application/json',\n 'HTTP_X-Requested-With' => 'XMLHttpRequest'\n ),\n $data\n );\n $response = $client->getResponse();\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertSame('application/json', $response->headers->get('Content-Type'));\n $body = json_decode($response->getContent(), true);\n $this->assertArrayHasKey('token_session', $body);\n $this->assertArrayHasKey('validity', $body);\n $this->assertEquals(null,$body['token_session']);\n $this->assertEquals(null,$body['validity']);\n }",
"public static function set_token_access() {\n if (SesLibrary::_get('_uuid') || SesLibrary::_get('_uuid') == null) {\n $param = [\n 'uri' => config('app.base_api_uri') . '/generate-token-access?deviceid=' . SesLibrary::_get('_uuid'),\n 'method' => 'GET'\n ];\n $this->__init_request_api($param);\n }\n }",
"public function testRefreshToken() {\n $client = static::createClient();\n\n $client->request('POST', '/api/user/refresh');\n $this->assertEquals($client->getResponse()->getContent(), '{\"error\":\"The payload is not correct.\"}');\n\n $client = static::createClient();\n $client->request('POST', '/api/user/refresh', array(), array(), array('CONTENT_TYPE' => 'application/json'), '{\"auth\":\"pizza\"}');\n\n $this->assertEquals($client->getResponse()->getContent(), '{\"error\":\"The refresh token is missing\"}');\n\n // Get the access token.\n $access_token = $this->getTahiniAccessToken()->getAccessToken($this->createUser(false));\n\n // Refreshing the access token.\n $client = static::createClient();\n $client->request('POST', '/api/user/refresh', array(), array(), array('CONTENT_TYPE' => 'application/json'), '{\"refresh_token\":\"' . $access_token->refresh_token . '\"}');\n\n $decoded_response = json_decode($client->getResponse()->getContent());\n\n $new_access_token = $this->getTahiniAccessToken()->loadByAccessToken($decoded_response->access_token);\n $this->assertNotEquals($new_access_token->id, $access_token->id);\n }",
"public function test_unauthorized_fetch()\n {\n $headers = [\n 'Authorization' => \"Bearer None\"\n ];\n\n $response = $this\n ->withHeaders($headers)\n ->json('GET', '/api/github-users', [\n 'logins' => [\n 'souinhua',\n 'taylorotwell',\n 'no_one_151asd@'\n ]\n ]);\n\n $response->assertStatus(Response::HTTP_UNAUTHORIZED);\n }",
"public function test_you_have_to_be_authenticated()\n {\n $this->json('get' , 'api/cart')->assertStatus(401);\n\n }",
"public function testAccessTokenGranted() {\n $controller = new Controller();\n $response = new Response();\n\n $request = new Request(['response_type'=>'device_code', 'client_id'=>'x']);\n $response_data = $controller->generate_code($request, $response);\n $data = json_decode($response_data->getContent());\n $this->assertObjectNotHasAttribute('error', $data);\n\n $device_code = $data->device_code;\n\n # simulate the access token being granted\n Cache::set($device_code, [\n 'status' => 'complete',\n 'token_response' => [\n 'access_token' => 'abc123',\n 'expires_in' => 600,\n 'custom' => 'foo'\n ]\n ]);\n\n # check the status of the device code\n $request = new Request(['grant_type'=>'urn:ietf:params:oauth:grant-type:device_code', 'client_id'=>'x', 'device_code'=>$device_code]);\n $response_data = $controller->access_token($request, $response);\n $data = json_decode($response_data->getContent());\n\n $this->assertObjectNotHasAttribute('error', $data);\n $this->assertEquals('abc123', $data->access_token);\n $this->assertEquals(600, $data->expires_in);\n $this->assertEquals('foo', $data->custom);\n }",
"public function getAccessTokenType(){\n $this->tokenType = variable_get(EBConsts::EBS_CONFIG_AUTHTOKEN_TYPE, 'bearer');\n return $this;\n }",
"abstract public function url_access_token();",
"public function testRefreshToken($token)\n {\n $reqData = [\n 'grant_type' => AccessToken::TYPE_REFRESH_TOKEN,\n 'refresh_token' => $token,\n 'client_id' => 1,\n 'client_secret' => ClientsSeeder::SECRET_KEYS[0],\n 'scope' => 'default',\n ];\n /** @var \\Tests\\Functional\\AuthTest $data */\n $data = $this->post('/oauth/access_token', $reqData);\n\n $resp = \\json_decode($data->response->getContent(), true);\n\n $this->assertArrayHasKey('access_token', $resp);\n $this->assertEquals('Bearer', $resp['token_type']);\n $this->assertArrayHasKey('refresh_token', $resp);\n }",
"public function testIsValid()\n {\n $isValid = JWT::getInstance()->isValidToken('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnRfaWQiOiJyYWlsc19sZWdhY3kifQ.Dciipit-lh9N5FuPLNviTU-4Q5PUIdweJOCmPg7ucN4');\n $this->assertTrue($isValid);\n }",
"public function test_teams_index_authenticated_user_returns_403(){\n $this->signInUser();\n $response = $this->get(route('teams.index'));\n $response->assertStatus(403); }",
"public function testThatClientIdIsRequired()\n {\n $env = self::getEnv();\n $api = new Authentication($env['DOMAIN'], $env['APP_CLIENT_ID'], $env['APP_CLIENT_SECRET']);\n\n try {\n $api->refresh_token( uniqid(), [ 'client_id' => '' ] );\n $caught_exception = false;\n } catch (ApiException $e) {\n $caught_exception = $this->errorHasString( $e, 'client_id is mandatory' );\n }\n\n $this->assertTrue( $caught_exception );\n }",
"public function testProtected()\n {\n $response = $this->json('post', '/api/logout');\n $response->assertUnauthorized();\n }",
"public function testValidateResourceWithValidToken()\n {\n $client = new OAuth2\\Client(CLIENT_ID, CLIENT_SECRET, OAuth2\\Client::AUTH_TYPE_AUTHORIZATION_BASIC);\n\n // Here you can define any other params that you want to pass.\n $params = array();\n\n // Generating Token\n $tokenResponse = $client->getAccessToken(TOKEN_URI, OAuth2\\Client::GRANT_TYPE_CLIENT_CREDENTIALS, $params);\n $httpCode = $tokenResponse['code'];\n \n $client->setAccessToken($tokenResponse['result']['access_token']);\n // Setting Up the access Token Type to client Object\n $client->setAccessTokenType(OAuth2\\Client::ACCESS_TOKEN_BEARER);\n\n // Finally fetching resource from Resource URL using access token\n $resourceResponse = $client->fetch('https://api.fronter.com/clients/'.CLIENT_ID);\n $checkClientId = $resourceResponse['result']['client_id'];\n\n $this->assertEquals($checkClientId, CLIENT_ID);\n }",
"private function getToken() {\n\t // CHECK API and get token\n\t\t$post = [\n\t\t\t'grant_type' => 'password',\n\t\t\t'scope' => 'ost_editor',\n\t\t\t'username' => 'webmapp',\n\t\t\t'password' => 'webmapp',\n\t\t\t'client_id' => 'f49353d7-6c84-41e7-afeb-4ddbd16e8cdf',\n\t\t\t'client_secret' => '123'\n\t\t];\n\n\t\t$ch = curl_init('https://api-intense.stage.sardegnaturismocloud.it/oauth/token');\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\n\t\t$j=json_decode($response,TRUE);\n\t\t$this->token=$j['access_token'];\n\t}",
"public function testComAdobeGraniteAuthOauthImplBearerAuthenticationHandler()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.granite.auth.oauth.impl.BearerAuthenticationHandler';\n\n $crawler = $client->request('POST', $path);\n }",
"public function testGetAccessTokenByRefreshToken() {\n $tokenResponse = Json::decode($this->getMockResponseContents(self::ACCESS_TOKEN_RESPONSE));\n $refreshToken = 'tGzv3JOkF0XG5Qx2TlKW';\n\n $eloquaApiClient = $this->getMockBuilder('Drupal\\eloqua_api_redux\\Service\\EloquaApiClient')\n ->setConstructorArgs([\n $this->configFactory,\n $this->loggerFactory,\n $this->cacheBackend,\n $this->httpClientFactory,\n ])\n ->setMethods(['getEloquaApiCache', 'doTokenRequest'])\n ->getMock();\n\n $eloquaApiClient->expects($this->at(0))\n ->method('getEloquaApiCache')\n ->with('access_token')\n ->will($this->returnValue(NULL));\n\n $eloquaApiClient->expects($this->at(1))\n ->method('getEloquaApiCache')\n ->with('refresh_token')\n ->will($this->returnValue($refreshToken));\n\n $eloquaApiClient->expects($this->any())\n ->method('doTokenRequest')\n ->will($this->returnValue($tokenResponse));\n\n $response = $eloquaApiClient->getAccessTokenByRefreshToken();\n $this->assertNotNull($response);\n }",
"public function testGetAccessTokenByAuthCode() {\n $tokenResponse = Json::decode($this->getMockResponseContents(self::ACCESS_TOKEN_RESPONSE));\n $authCode = 'SplxlOBeZQQYbYS6WxSbIA';\n\n $eloquaApiClient = $this->getMockBuilder('Drupal\\eloqua_api_redux\\Service\\EloquaApiClient')\n ->setConstructorArgs([\n $this->configFactory,\n $this->loggerFactory,\n $this->cacheBackend,\n $this->httpClientFactory,\n ])\n ->setMethods(['getEloquaApiCache', 'doTokenRequest'])\n ->getMock();\n\n $eloquaApiClient->expects($this->at(0))\n ->method('getEloquaApiCache')\n ->with('access_token')\n ->will($this->returnValue(NULL));\n\n $eloquaApiClient->expects($this->any())\n ->method('doTokenRequest')\n ->will($this->returnValue($tokenResponse));\n\n $response = $eloquaApiClient->getAccessTokenByAuthCode($authCode);\n $this->assertNotNull($response);\n }",
"private function _requestToken() \n {\n $requestUrl = $this->config->getHost() . \"/oauth2/token\";\n $postData = \"grant_type=client_credentials\" . \"&client_id=\" . $this->config->getAppSid() . \"&client_secret=\" . $this->config->getAppKey();\n $response = $this->client->send(new Request('POST', $requestUrl, [], $postData));\n $result = json_decode($response->getBody()->getContents(), true);\n $this->config->setAccessToken($result[\"access_token\"]);\n $this->config->setRefreshToken($result[\"refresh_token\"]);\n }",
"public function testGetIntegrationTokenNonTestMode()\n {\n $this->helper\n ->expects($this->exactly(2))\n ->method('getConfigData')\n ->withConsecutive(\n [$this->equalTo('test_mode_enabled'), $this->equalTo(null)],\n [$this->equalTo('integration_token'), $this->equalTo(null)]\n )\n ->willReturnOnConsecutiveCalls(\n false,\n 'production_key'\n );\n\n $this\n ->helper\n ->getIntegrationToken();\n }",
"public function testExportToken()\n {\n $response = $this->actingAsTestingUser()\n ->withEncryptionKey()\n ->get(route('tokens.export', [$this->token->path]));\n\n $response->assertStatus(200);\n $response->assertViewIs('tokens.export');\n }",
"public function _before(ApiTester $I)\n {\n // Perform the user validation\n $this->token = $I->userAuthorization($this->url, $this->email, $this->password);\n }",
"public function testRefreshUserByToken_()\n {\n $response = $this->apiCall($this->endpoint, 'post', [], true);\n\n // assert response status is correct\n $this->assertEquals($response->getStatusCode(), '200');\n }",
"public function testAuthTest()\n {\n $response = $this->post('posts', array());\n $response->assertStatus(401);\n }",
"public function getAccessToken($access_token);",
"public function disable_testLogin()\n {\n $this->callMigration(); \n \n $credentials = [ \n\n 'email' => 'demo@bumin.com.tr',\n 'password' => 'cjaiU8CV'\n ];\n \n $this->assertTrue(\\Auth::attempt($credentials, true, true));\n \n $this->assertTrue(\\Auth::check()); \n \n $user = \\Auth::getUser();\n \n $token = $this->jwtRepo()->getByUser($user);\n \n $this->assertNotEmpty($token); \n }",
"public function testInvalidTokenException(): void\n {\n $this->expectException(InvalidArgumentException::class);\n\n (new ApiKeyAsBasicAuthUsernameEncoder())->encode(new JwtApiToken([]));\n }",
"public static function getAccessToken()\n {\n $authorization = request()->header('Authorization');\n // $authorization = @getallheaders()['Authorization'];\n // before running unit tests...\n //$authorization = '$2y$10$tSM.PiN9BnMfyonqjHlwTONa1DPHbyQSAMOtmt4chJYXenGeYySHC';\n return (isset($authorization))?$authorization:null;\n }",
"function test_treatments_unauthorized_true()\n {\n $this->seed();\n\n $response = $this->json('GET', '/api/treatments/1');\n $response->assertUnauthorized();\n }"
] | [
"0.721804",
"0.71535766",
"0.69993305",
"0.6805702",
"0.6754451",
"0.6603976",
"0.6519365",
"0.64961326",
"0.64931196",
"0.648985",
"0.6385605",
"0.63719034",
"0.6366531",
"0.6350531",
"0.63168067",
"0.63012946",
"0.6274989",
"0.6252704",
"0.62266237",
"0.61946076",
"0.61917484",
"0.616566",
"0.6158924",
"0.6089174",
"0.60779893",
"0.607511",
"0.606795",
"0.6051173",
"0.60380524",
"0.6009259",
"0.60073835",
"0.6002072",
"0.5998138",
"0.598395",
"0.59757566",
"0.59676963",
"0.59667856",
"0.59608287",
"0.595917",
"0.5955291",
"0.59507954",
"0.5937087",
"0.59347713",
"0.5933055",
"0.59094447",
"0.58964753",
"0.58831257",
"0.5879144",
"0.58791184",
"0.58773446",
"0.58721775",
"0.58645713",
"0.58592904",
"0.5859259",
"0.58572334",
"0.58555156",
"0.5827643",
"0.5818184",
"0.5816545",
"0.5809741",
"0.5803952",
"0.5802054",
"0.58011377",
"0.57887685",
"0.57753813",
"0.5768656",
"0.57616764",
"0.57574797",
"0.57550347",
"0.5752254",
"0.575141",
"0.57468325",
"0.57298654",
"0.5729617",
"0.57265776",
"0.57188874",
"0.57143474",
"0.57027924",
"0.56939626",
"0.56887424",
"0.5685149",
"0.56851465",
"0.56609446",
"0.5653649",
"0.56495064",
"0.56492925",
"0.56219876",
"0.5612501",
"0.56109124",
"0.5603625",
"0.55985135",
"0.5597934",
"0.5596418",
"0.55941224",
"0.5593279",
"0.55826557",
"0.5582119",
"0.5574832",
"0.55733764",
"0.5569061"
] | 0.73715276 | 0 |
Test Integration access token can be used as Bearer token when explicitly enabled | public function testIntegrationAsBearerTokenEnabled()
{
$this->_markTestAsRestOnly();
$oauthService = ObjectManager::getInstance()->get(OauthServiceInterface::class);
$accessToken = $oauthService->getAccessToken($this->integration->getConsumerId());
$serviceInfo = [
'rest' => [
'token' => $accessToken->getToken(),
'resourcePath' => '/V1/store/storeViews',
'httpMethod' => \Magento\Webapi\Model\Rest\Config::HTTP_METHOD_GET,
],
];
$this->_webApiCall($serviceInfo);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testToken()\n {\n\t\t\t$response = $this->json('POST', '/api/login', ['email' => 'admin@admin.com', 'password' => 'adminadmin']);\n\n\t\t\t$response\n\t\t\t\t\t->assertStatus(200)\n\t\t\t\t\t->assertJson([\n\t\t\t\t\t\t\t'token_type' => 'bearer',\n\t\t\t\t\t]);\n }",
"public function testIntegrationAsBearerTokenDefault()\n {\n $this->_markTestAsRestOnly();\n $oauthService = ObjectManager::getInstance()->get(OauthServiceInterface::class);\n $accessToken = $oauthService->getAccessToken($this->integration->getConsumerId());\n $serviceInfo = [\n 'rest' => [\n 'token' => $accessToken,\n 'resourcePath' => '/V1/store/storeViews',\n 'httpMethod' => \\Magento\\Webapi\\Model\\Rest\\Config::HTTP_METHOD_GET,\n ],\n ];\n self::expectException(\\Exception::class);\n self::expectExceptionMessage('The consumer isn\\'t authorized to access %resources.');\n $this->_webApiCall($serviceInfo);\n }",
"public function testAuthenticationServiceAccessTokenInformation()\n {\n }",
"public function testAuthenticationServiceSignAccessToken()\n {\n }",
"public function testTokenRequirement()\n {\n $this->get('/api/data')\n ->assertJson([\n 'status' => 'error'\n ])\n ->isOK();\n }",
"public function test_authorization_header()\n {\n }",
"public function setaccess_token($value);",
"public function testGetUserToken()\n {\n\n }",
"public function testComAdobeGraniteAuthOauthAccesstokenProvider()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.granite.auth.oauth.accesstoken.provider';\n\n $crawler = $client->request('POST', $path);\n }",
"public function testSucceededDifferentUserLoggedInButAdmin(): void\n {\n self::$httpAuthorizationToken = AccessTokenFixture::DATA['access-token-yannis']['id'];\n\n $this->checkSucceeded();\n }",
"public function testGetToken()\n {\n $client = new Client();\n\n $body['grant_type'] = \"client_credentials\";\n $user = 'testclient';\n $pass = 'testpass';\n $res = $client->post($this->baseUrl . '/token', [ \n 'form_params' => $body,\n 'auth' => [$user, $pass] \n ]);\n\n $code = $res->getStatusCode();\n $body = $res->getBody();\n\n $this->assertEquals(200, $code);\n }",
"public static function set_token_access() {\n if (SesLibrary::_get('_uuid') || SesLibrary::_get('_uuid') == null) {\n $param = [\n 'uri' => config('app.base_api_uri') . '/generate-token-access?deviceid=' . SesLibrary::_get('_uuid'),\n 'method' => 'GET'\n ];\n $this->__init_request_api($param);\n }\n }",
"public function testAuthenticateTokenHeader()\n {\n $request = new ServerRequest();\n\n $expected = [\n 'id' => 1,\n 'group_id' => 1,\n 'user_name' => 'admad',\n 'email' => 'admad@example.com',\n 'created' => new FrozenTime('2014-03-17 01:18:23'),\n 'updated' => new FrozenTime('2014-03-17 01:20:31'),\n ];\n $request = $request->withEnv('HTTP_AUTHORIZATION', 'Bearer ' . $this->token);\n $result = $this->auth->getUser($request, $this->response);\n $this->assertEquals($expected, $result);\n\n $request = $request->withEnv('HTTP_AUTHORIZATION', 'WrongBearer ' . $this->token);\n $result = $this->auth->getUser($request, $this->response);\n $this->assertFalse($result);\n\n $this->expectException('UnexpectedValueException');\n $request = $request->withEnv('HTTP_AUTHORIZATION', 'Bearer foobar');\n $result = $this->auth->getUser($request, $this->response);\n $this->assertFalse($result);\n }",
"public function testIntegrationAuthenticated()\n {\n $request = new HTTPRequest('POST', Director::absoluteBaseURL() . '/graphql');\n\n $response = Director::test(\n '/graphql',\n [],\n [],\n 'POST',\n '',\n [\n $this->headerName => $this->key->ApiKey,\n ],\n [],\n $request\n );\n\n $body = json_decode($response->getBody());\n $errors = $body->errors;\n $this->assertCount(1, $errors);\n $this->assertEquals('Not authorised', $errors[0]->message);\n }",
"public function getAccessTokenType(){\n $this->tokenType = variable_get(EBConsts::EBS_CONFIG_AUTHTOKEN_TYPE, 'bearer');\n return $this;\n }",
"public function testGetTokenWithInValidTokenEndPoint()\n {\n $client = new OAuth2\\Client(CLIENT_ID, CLIENT_SECRET, OAuth2\\Client::AUTH_TYPE_AUTHORIZATION_BASIC);\n\n // Here you can define any other params that you want to pass.\n $params = array();\n\n // Generating Token\n $tokenResponse = $client->getAccessToken(\n 'http://api.fronter.com/clients',\n OAuth2\\Client::GRANT_TYPE_CLIENT_CREDENTIALS,\n $params\n );\n $httpCode = $tokenResponse['code'];\n\n $this->assertEquals($httpCode, 404);\n }",
"public function testOGParserAuthentication()\n {\n $response = $this->json(\n 'POST',\n '/api/content/ogparser',\n ['url' => 'https://www.codejungle.org'],\n ['HTTP_Authorization' => 'Bearer xxx']\n );\n\n $response->assertStatus(401);\n }",
"public function testSendingRequestWithToken()\n {\n $response = $this->get('/api/drivers', ['api_token' => config('constants.TEST_TOKEN')]);\n\n $response->assertStatus(200);\n }",
"public function testAuthenticate()\n {\n $this->mockWebApplication([\n 'modules' => [\n 'oauth2' => [\n 'resourceServerAccessTokenRevocationValidation' => false, // Token revocation validation is tested during functional testing.\n ]\n ]\n ]);\n // phpcs:enable Generic.Files.LineLength.TooLong\n\n $request = Yii::$app->request;\n $request->headers->set('Authorization', 'Bearer ' . $this->validAccessToken);\n\n $httpBearerAuth = new Oauth2HttpBearerAuth();\n\n $identity = $httpBearerAuth->authenticate(Yii::$app->user, $request, Yii::$app->response);\n $this->assertNotNull($identity);\n $this->assertEquals(123, $identity->getId());\n }",
"public function get_test_authorization_header()\n {\n }",
"public function testComAdobeGraniteAuthOauthImplBearerAuthenticationHandler()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.granite.auth.oauth.impl.BearerAuthenticationHandler';\n\n $crawler = $client->request('POST', $path);\n }",
"public function testExample()\n {\n $response = $this->json('POST', '/api/login', ['email' => 'paul@client.com','password' => '987654321']);\n\n $response\n\n ->assertJsonFragment([\n 'token_type' => 'bearer',\n ]);\n }",
"private function requestToken() \n {\n $requestUrl = $this->configuration->getBaseUrl() . \"connect/token\";\n $postData = \"grant_type=client_credentials\" . \"&client_id=\" . $this->configuration->getClientId() . \"&client_secret=\" . $this->configuration->getClientSecret();\n $headers = [];\n $headers['Content-Type'] = \"application/x-www-form-urlencoded\";\n $headers['Content-Length'] = strlen($postData);\n $response = $this->client->send(new Request('POST', $requestUrl, $headers, $postData));\n $result = json_decode($response->getBody()->getContents(), true);\n $this->configuration->setAccessToken($result[\"access_token\"]);\n }",
"public function testValidCredentialsInHeader()\n {\n $server = $this->getTestServer();\n $headers = array('HTTP_AUTHORIZATION' => 'Basic '.base64_encode('Test Client ID:TestSecret'), 'REQUEST_METHOD' => 'POST');\n $params = array('grant_type' => 'client_credentials');\n $request = new Request(array(), $params, array(), array(), array(), $headers);\n $token = $server->grantAccessToken($request, new Response());\n\n $this->assertNotNull($token);\n $this->assertArrayHasKey('access_token', $token);\n $this->assertNotNull($token['access_token']);\n\n // create using PHP Authorization Globals\n $headers = array('PHP_AUTH_USER' => 'Test Client ID', 'PHP_AUTH_PW' => 'TestSecret', 'REQUEST_METHOD' => 'POST');\n $params = array('grant_type' => 'client_credentials');\n $request = new Request(array(), $params, array(), array(), array(), $headers);\n $token = $server->grantAccessToken($request, new Response());\n\n $this->assertNotNull($token);\n $this->assertArrayHasKey('access_token', $token);\n $this->assertNotNull($token['access_token']);\n }",
"#[\n OpenApi\\Operation(\n tags: ['Auth/Tokens'],\n security: 'AccessTokenSecurityScheme'\n )\n ]\n #[OpenApi\\Parameters(factory: AuthTokenParameters::class)]\n #[OpenApi\\Response(factory: TokenIndexResponse::class, statusCode: 200)]\n #[OpenApi\\Response(factory: UnauthorizedResponse::class, statusCode: 401)]\n #[\n OpenApi\\Response(\n factory: TooManyRequestsResponse::class,\n statusCode: 429\n )\n ]\n public function index() {\n $this->verifyNoDemo();\n\n return response()->pagination(\n fn($perPage) => AuthTokenResource::collection(\n authUser()\n ->tokens()\n ->active()\n ->type(TokenType::REFRESH)\n ->paginate($perPage)\n )\n );\n }",
"public function testFetchingResourceWithInvalidAccessTokenBearer()\n {\n $client = new OAuth2\\Client(CLIENT_ID, CLIENT_SECRET, OAuth2\\Client::AUTH_TYPE_AUTHORIZATION_BASIC);\n\n // Here you can define any other params that you want to pass.\n $params = array();\n\n // Generating Token\n $tokenResponse = $client->getAccessToken(TOKEN_URI, OAuth2\\Client::GRANT_TYPE_CLIENT_CREDENTIALS, $params);\n $httpCode = $tokenResponse['code'];\n \n $client->setAccessToken($tokenResponse['result']['access_token']);\n // Setting Up the access Token Type to client Object\n $client->setAccessTokenType(OAuth2\\Client::ACCESS_TOKEN_OAUTH);\n\n // Finally fetching resource from Resource URL using access token\n $resourceResponse = $client->fetch('https://api.fronter.com/clients/'.CLIENT_ID);\n\n $resourceURLResponseHttpCode = $resourceResponse['code'];\n\n $this->assertEquals(401, $resourceURLResponseHttpCode);\n }",
"public function testGetTokenWithInValidClientId()\n {\n $client = new OAuth2\\Client('', CLIENT_SECRET, OAuth2\\Client::AUTH_TYPE_AUTHORIZATION_BASIC);\n\n // Here you can define any other params that you want to pass.\n $params = array();\n\n // Generating Token\n $tokenResponse = $client->getAccessToken(TOKEN_URI, OAuth2\\Client::GRANT_TYPE_CLIENT_CREDENTIALS, $params);\n $httpCode = $tokenResponse['code'];\n\n $this->assertEquals($httpCode, 401);\n }",
"public function testAndRefresh()\n {\n try {\n if (JWTAuth::parseToken()->getClaim('origin') == $this->claim) {\n $payload = JWTAuth::parseToken()->getPayload()->get('exp');\n\n switch (true) {\n case ($payload - Carbon::now()->timestamp > 600):\n return response()->json(['data' => ['status' => 1]], 200);\n break;\n case ($payload - Carbon::now()->timestamp > 0):\n return response()->json([\n 'data' => [\n 'status' => 2,\n 'access_token' => JWTAuth::parseToken()->refresh(),\n 'token_type' => 'bearer',\n 'expires_in' => JWTAuth::factory()->getTTL()\n ]\n ], 200);\n break;\n }\n } else {\n throw new AuthenticationException(null, 'Invalid Token');\n }\n } catch (TokenExpiredException $e) {\n return response()->json(['data' => ['status' => 0]], 200);\n } catch (JWTException $e) {\n throw new AuthenticationException($e->getMessage(), 'The token cannot be tested');\n }\n\n return response()->json(['data' => ['status' => 0]], 200);\n }",
"public function testLoginToken(){\n \n $client = static::createClient();\n $data = '{\n \"token_session\": \"8b0d9c93a3545d0d99f6486208dd3659ec802ee1\",\n \"login\": \"santevet\"\n }';\n $crawler = $client->request(\n 'PUT', '/generate/token/temp', array(), array(),\n array(\n 'CONTENT_TYPE' => 'application/json',\n 'HTTP_X-Requested-With' => 'XMLHttpRequest'\n ),\n $data\n ); \n $response = $client->getResponse();\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertSame('application/json', $response->headers->get('Content-Type'));\n $body = json_decode($response->getContent(), true);\n $this->assertArrayHasKey('token_temp', $body);\n $this->assertArrayHasKey('expiration', $body);\n $this->assertNotEquals(null,$body['token_temp']);\n $this->assertNotEquals(null,$body['expiration']);\n \n $_data = $body;\n \n $data = '{\n \"login\": \"santevet\",\n \"token_temp\": \"'.$_data['token_temp'].'\",\n \"expiration\": \"'.$_data['expiration'].'\"\n }';\n $crawler = $client->request(\n 'POST', '/login/token', array(), array(),\n array(\n 'CONTENT_TYPE' => 'application/json',\n 'HTTP_X-Requested-With' => 'XMLHttpRequest'\n ),\n $data\n );\n $response = $client->getResponse();\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertSame('application/json', $response->headers->get('Content-Type'));\n $body = json_decode($response->getContent(), true);\n $this->assertArrayHasKey('token_session', $body);\n $this->assertArrayHasKey('validity', $body);\n $this->assertNotEquals(null,$body['token_session']);\n $this->assertNotEquals(null,$body['validity']);\n }",
"public function testGetInstantUserWithOutToken()\n {\n $this->get('api/Users/edit')\n ->seeJson([\n 'success' => false,\n 'error_code' => \"TOKEN_EMPTY\",\n 'error_massage' => \"Please send token\"\n ])\n ->seeJsonStructure([\n 'success',\n 'error_code',\n 'error_massage'\n ]);\n }",
"public function testLogin()\n {\n $response = $this->json('post', '/api/login',\n ['email' => 'ekeenyinnaya@gmail.com', 'password' => 'password']);\n $response->assertStatus(200)\n ->assertJsonStructure(['access_token']);\n }",
"public function testOrgApacheJackrabbitOakSecurityAuthenticationTokenTokenConfigura()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/org.apache.jackrabbit.oak.security.authentication.token.TokenConfigurationImpl';\n\n $crawler = $client->request('POST', $path);\n }",
"public function testComAdobeGraniteDistributionCoreImplTransportAccessTokenDistribu()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.granite.distribution.core.impl.transport.AccessTokenDistributionTransportSecretProvider';\n\n $crawler = $client->request('POST', $path);\n }",
"public function run()\n {\n $accessToken = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIzMjkiLCJqdGkiOiI5NDdjODdlMWI0MTU1N2Q1NzRiMmIzOTgzM2ViZWJjZWY3NjZmZTA3Yjc5NjllYTI3NTc1NTgwNTYzNTBlOGUyMjBlMDhhZTA0ZjhlYzM3MyIsImlhdCI6MTYyNTI0MjM0MywibmJmIjoxNjI1MjQyMzQzLCJleHAiOjE2NTY3NzgzNDMsInN1YiI6IjE0NjEiLCJzY29wZXMiOltdfQ.RjIAPcd6oSptTTKM0HhDIp8vA_xqhI5iccoxw1whZRvCzYHVii-WHiHU3JwRQDtJXKzRheqqcioUKkpoHH2SZQ1biWX0S5mqmunITFLoIHXhi61YYp4ctvlfvxud-9EGeQ4agqLazGDwxgCAwbo5dJRhvSX_SLcq0XLIdHU-_WqYXyb1Cy7vejsfR2Tx26vDqKsneHOiOTji7RT8TRg0Ej222WivgfBfcB-FzKPlFoKp6kYoSeLBvd5hZLERzFjfeWDVd38S4zxTFoSZH6Sg-WqZ5s3472CJ36_zWsh3R3Ebu0S7s-0uriCkdrVlzNY1xZABkVAedd-JyNgmKgA-zVb4AsNUXOqKJ-S7Nn3uVZmdbBWYjMPJBomsjt3xSSP4zq3-aJGJabG-GMvzWSGMxBDQeYlzFy_B3JLK0ZWaWLFN8eLJsHuHhF2zjypcPZkOajuQvrXNSFgm69_x57SSveM0eFkcbcvYzfHDcw6EvBrwPcvGE9RDajqBz3_So57WJRx2P_S7DJm64O_1m53AsmJz34MQxwCcDSUc7ZKwEX8mRRcu2RjWWoCLvOtA3mWx7v8nuREKXweBeHgSoPwXAJLIlsLT0yWVT603mseTVZ1MDSdtr46demlr_FGwqsKHyu5Fz54SBMpUEsqD3qIkFDT4VMc6Ge8v3ll_WVRui3M';\n\n $client = new ClientGuzzle([\n 'headers' => [\n 'Accept' => 'application/json',\n 'Authorization' => 'Bearer '.$accessToken,\n 'Content-Type' => 'application/json'\n ],\n ]);\n\n $response = $client->get('https://www.lioren.cl/api/ciudades');\n $responseBody = json_decode((string) $response->getBody(), true);\n foreach($responseBody as $ciudad){\n Ciudad::create([\n 'nombre' => $ciudad['nombre'],\n 'codigo' => $ciudad['id'],\n ]);\n }\n }",
"public function testAuthenticateTokenParameter()\n {\n $request = new ServerRequest();\n\n $result = $this->auth->getUser($request, $this->response);\n $this->assertFalse($result);\n\n $expected = [\n 'id' => 1,\n 'group_id' => 1,\n 'user_name' => 'admad',\n 'email' => 'admad@example.com',\n 'created' => new FrozenTime('2014-03-17 01:18:23'),\n 'updated' => new FrozenTime('2014-03-17 01:20:31'),\n ];\n $request = new ServerRequest(['url' => 'posts/index?token=' . $this->token]);\n $result = $this->auth->getUser($request, $this->response);\n $this->assertEquals($expected, $result);\n\n $this->auth->setConfig('parameter', 'tokenname');\n $request = new ServerRequest(['url' => 'posts/index?tokenname=' . $this->token]);\n $result = $this->auth->getUser($request, $this->response);\n $this->assertEquals($expected, $result);\n\n $request = new ServerRequest(['url' => 'posts/index?wrongtoken=' . $this->token]);\n $result = $this->auth->getUser($request, $this->response);\n $this->assertFalse($result);\n }",
"public function testAccessTokenGranted() {\n $controller = new Controller();\n $response = new Response();\n\n $request = new Request(['response_type'=>'device_code', 'client_id'=>'x']);\n $response_data = $controller->generate_code($request, $response);\n $data = json_decode($response_data->getContent());\n $this->assertObjectNotHasAttribute('error', $data);\n\n $device_code = $data->device_code;\n\n # simulate the access token being granted\n Cache::set($device_code, [\n 'status' => 'complete',\n 'token_response' => [\n 'access_token' => 'abc123',\n 'expires_in' => 600,\n 'custom' => 'foo'\n ]\n ]);\n\n # check the status of the device code\n $request = new Request(['grant_type'=>'urn:ietf:params:oauth:grant-type:device_code', 'client_id'=>'x', 'device_code'=>$device_code]);\n $response_data = $controller->access_token($request, $response);\n $data = json_decode($response_data->getContent());\n\n $this->assertObjectNotHasAttribute('error', $data);\n $this->assertEquals('abc123', $data->access_token);\n $this->assertEquals(600, $data->expires_in);\n $this->assertEquals('foo', $data->custom);\n }",
"public function testDoTokenRequest() {\n $params = [\n 'redirect_uri' => 'http://localhost/eloqua_api_redux/callback',\n 'grant_type' => 'refresh_token',\n 'refresh_token' => 'SplxlOBeZQQYbYS6WxSbIA',\n ];\n $mockedResponse = new Response(200,\n ['Content-Type' => 'application/json'],\n $this->getMockResponseContents(self::ACCESS_TOKEN_RESPONSE)\n );\n\n $httpClientFactory = $this->getMockBuilder('Drupal\\Core\\Http\\ClientFactory')\n ->disableOriginalConstructor()\n ->setMethods(['fromOptions'])\n ->getMock();\n\n $guzzleClient = $this->getMockBuilder('GuzzleHttp\\Client')\n ->disableOriginalConstructor()\n ->setMethods(['request'])\n ->getMock();\n\n $guzzleClient->expects($this->any())\n ->method('request')\n ->will($this->returnValue($mockedResponse));\n\n $httpClientFactory->expects($this->any())\n ->method('fromOptions')\n ->will($this->returnValue($guzzleClient));\n\n $eloquaApiClient = $this->getMockBuilder('Drupal\\eloqua_api_redux\\Service\\EloquaApiClient')\n ->setConstructorArgs([\n $this->configFactory,\n $this->loggerFactory,\n $this->cacheBackend,\n $httpClientFactory,\n ])\n ->setMethods(['setEloquaApiCache', 'doBaseUrlRequest'])\n ->getMock();\n\n $eloquaApiClient->expects($this->at(0))\n ->method('setEloquaApiCache')\n ->with('access_token');\n $eloquaApiClient->expects($this->at(1))\n ->method('setEloquaApiCache')\n ->with('refresh_token');\n\n $eloquaApiClient->expects($this->any())\n ->method('setEloquaApiCache');\n\n $response = $eloquaApiClient->doTokenRequest($params);\n $this->assertNotEmpty($response);\n }",
"public function testAccessToken($isSuccessful)\r\n {\r\n $accessToken = $isSuccessful ? $this->getAccessToken() : 'invalidtoken';\r\n\r\n $client = $this->client;\r\n $client->request(\r\n 'POST', \r\n '/api/product/create', \r\n array(),\r\n array(),\r\n array('CONTENT_TYPE' => 'application/x-www-form-urlencoded'),\r\n 'access_token='.$accessToken\r\n );\r\n\r\n if($isSuccessful){\r\n $this->assertEquals(\r\n \\Symfony\\Component\\HttpFoundation\\Response::HTTP_OK,\r\n $client->getResponse()->getStatusCode()\r\n );\r\n }\r\n else{\r\n $this->assertNotEquals(\r\n \\Symfony\\Component\\HttpFoundation\\Response::HTTP_OK,\r\n $client->getResponse()->getStatusCode()\r\n );\r\n }\r\n }",
"public function setAuthorization()\n\t{\n\t\t// @TODO We don't deal with a case where during your session the token expires\n\t\tif (is_null($this->access_token))\n\t\t{\n\t\t\t$response = $this->getToken();\n\t\t\t$this->access_token = $response->access_token;\n\t\t\t$this->authorization = \"Bearer \" . $this->access_token;\n\t\t}\n\t}",
"public function testViewToken()\n {\n $response = $this->actingAsTestingUser()\n ->withEncryptionKey()\n ->get(route('tokens.code', [$this->token->path]));\n\n $response->assertStatus(200);\n $response->assertViewIs('tokens.code');\n }",
"public function testGetListActionWithToken()\n {\n // Get an authenticated client\n $client = $this->createAuthenticatedClient('sjouan', '1GreatP@ssword');\n // Test the route\n $client->request('GET', '/api/products');\n\n // Check the response\n $this->assertSame(Response::HTTP_OK, $client->getResponse()->getStatusCode());\n // asserts that the response status code is 2xx\n $this->assertTrue($client->getResponse()->isSuccessful(), 'response status is 2xx');\n }",
"public function testSucceededDifferentUserLoggedInButModerator(): void\n {\n self::$httpAuthorizationToken = AccessTokenFixture::DATA['access-token-leslie']['id'];\n\n $this->checkSucceeded();\n }",
"public function access_token() {\n\t\ttry {\n\t\t\tif ($this->request->is('post')) {\n\t\t\t\t$this->OAuth2Lib->grantAccessToken();\n\t\t\t}\n\t\t} catch(Exception $e) {\n\t\t\t$this->fail($e);\n\t\t}\n\t}",
"public function testFailedDifferentUserLoggedIn(): void\n {\n self::$httpAuthorizationToken = AccessTokenFixture::DATA['access-token-juliette']['id'];\n\n $this->checkFailedAccessDenied();\n }",
"public function get_access_token($oauth_token, $oauth_addon);",
"abstract public function url_access_token();",
"public function testWithInvalidToken()\n {\n Configure::write('debug', false);\n $request = new ServerRequest();\n\n $request = $request->withEnv('HTTP_AUTHORIZATION', 'Bearer this.is.invalid');\n $result = $this->auth->getUser($request, $this->response);\n $this->assertFalse($result);\n }",
"public function test_it_must_be_authenticated_user()\n {\n $this->json('post' , 'api/orders')->assertStatus(401);\n }",
"private function getToken() {\n\t // CHECK API and get token\n\t\t$post = [\n\t\t\t'grant_type' => 'password',\n\t\t\t'scope' => 'ost_editor',\n\t\t\t'username' => 'webmapp',\n\t\t\t'password' => 'webmapp',\n\t\t\t'client_id' => 'f49353d7-6c84-41e7-afeb-4ddbd16e8cdf',\n\t\t\t'client_secret' => '123'\n\t\t];\n\n\t\t$ch = curl_init('https://api-intense.stage.sardegnaturismocloud.it/oauth/token');\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\n\t\t$j=json_decode($response,TRUE);\n\t\t$this->token=$j['access_token'];\n\t}",
"private function _requestToken() \n {\n $requestUrl = $this->config->getHost() . \"/oauth2/token\";\n $postData = \"grant_type=client_credentials\" . \"&client_id=\" . $this->config->getAppSid() . \"&client_secret=\" . $this->config->getAppKey();\n $response = $this->client->send(new Request('POST', $requestUrl, [], $postData));\n $result = json_decode($response->getBody()->getContents(), true);\n $this->config->setAccessToken($result[\"access_token\"]);\n $this->config->setRefreshToken($result[\"refresh_token\"]);\n }",
"public function testAuthenticate($token, $fail, $version)\n\t{\n\t\t// Already got some credentials stored?\n\t\tif (!is_null($token))\n\t\t{\n\t\t\t$this->object->setToken($token);\n\t\t\t$result = $this->object->authenticate();\n\t\t\t$this->assertEquals($result, $token);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->object->setOption('requestTokenURL', 'https://example.com/request_token');\n\t\t\t$this->object->setOption('authoriseURL', 'https://example.com/authorize');\n\t\t\t$this->object->setOption('accessTokenURL', 'https://example.com/access_token');\n\n\t\t\t// Request token.\n\t\t\t$returnData = new stdClass;\n\t\t\t$returnData->code = 200;\n\t\t\t$returnData->body = 'oauth_token=token&oauth_token_secret=secret&oauth_callback_confirmed=true';\n\n\t\t\t$this->client->expects($this->at(0))\n\t\t\t\t->method('post')\n\t\t\t\t->with($this->object->getOption('requestTokenURL'))\n\t\t\t\t->will($this->returnValue($returnData));\n\n\t\t\t$input = TestReflection::getValue($this->object, 'input');\n\t\t\tTestReflection::setValue($this->object, 'input', $input);\n\n\t\t\tif (strcmp($version, '1.0a') === 0)\n\t\t\t{\n\t\t\t\t$this->object->setOption('callback', 'TEST_URL');\n\t\t\t}\n\t\t\t$this->object->authenticate();\n\n\t\t\t$token = $this->object->getToken();\n\t\t\t$this->assertEquals($token['key'], 'token');\n\t\t\t$this->assertEquals($token['secret'], 'secret');\n\n\t\t\t// Access token.\n\t\t\t$input = TestReflection::getValue($this->object, 'input');\n\n\t\t\tif (strcmp($version, '1.0a') === 0)\n\t\t\t{\n\t\t\t\tTestReflection::setValue($this->object, 'version', $version);\n\t\t\t\t$data = array('oauth_verifier' => 'verifier', 'oauth_token' => 'token');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tTestReflection::setValue($this->object, 'version', $version);\n\t\t\t\t$data = array('oauth_token' => 'token');\n\t\t\t}\n\t\t\tTestReflection::setValue($input, 'data', $data);\n\n\t\t\t// Get mock session\n\t\t\t$mockSession = $this->getMock('JSession', array( '_start', 'get'));\n\n\t\t\tif ($fail)\n\t\t\t{\n\t\t\t\t$mockSession->expects($this->at(0))\n\t\t\t\t\t\t\t->method('get')\n\t\t\t\t\t\t\t->with('key', null, 'oauth_token')\n\t\t\t\t\t\t\t->will($this->returnValue('bad'));\n\n\t\t\t\t$mockSession->expects($this->at(1))\n\t\t\t\t\t\t\t->method('get')\n\t\t\t\t\t\t\t->with('secret', null, 'oauth_token')\n\t\t\t\t\t\t\t->will($this->returnValue('session'));\n\n\t\t\t\tJFactory::$session = $mockSession;\n\n\t\t\t\t$this->setExpectedException('DomainException');\n\t\t\t\t$result = $this->object->authenticate();\n\t\t\t}\n\n\t\t\t$mockSession->expects($this->at(0))\n\t\t\t\t\t\t->method('get')\n\t\t\t\t\t\t->with('key', null, 'oauth_token')\n\t\t\t\t\t\t->will($this->returnValue('token'));\n\n\t\t\t$mockSession->expects($this->at(1))\n\t\t\t\t\t\t->method('get')\n\t\t\t\t\t\t->with('secret', null, 'oauth_token')\n\t\t\t\t\t\t->will($this->returnValue('secret'));\n\n\t\t\tJFactory::$session = $mockSession;\n\n\t\t\t$returnData = new stdClass;\n\t\t\t$returnData->code = 200;\n\t\t\t$returnData->body = 'oauth_token=token_key&oauth_token_secret=token_secret';\n\n\t\t\t$this->client->expects($this->at(0))\n\t\t\t\t->method('post')\n\t\t\t\t->with($this->object->getOption('accessTokenURL'))\n\t\t\t\t->will($this->returnValue($returnData));\n\n\t\t\t$result = $this->object->authenticate();\n\n\t\t\t$this->assertEquals($result['key'], 'token_key');\n\t\t\t$this->assertEquals($result['secret'], 'token_secret');\n\t\t}\n\t}",
"public function testGetTokenWithValidClientId()\n {\n $client = new OAuth2\\Client(CLIENT_ID, CLIENT_SECRET, OAuth2\\Client::AUTH_TYPE_AUTHORIZATION_BASIC);\n\n // Here you can define any other params that you want to pass.\n $params = array();\n\n // Generating Token\n $tokenResponse = $client->getAccessToken(TOKEN_URI, OAuth2\\Client::GRANT_TYPE_CLIENT_CREDENTIALS, $params);\n $httpCode = $tokenResponse['code'];\n $this->assertEquals($httpCode, 200);\n }",
"public function setAccessToken($access_token, $token_type=\"bearer\"){\n /* Access Check */ \n if (!$this->validCredentials()){\n return;\n }\n /* Access Check */ \n variable_set(EBConsts::EBS_CONFIG_AUTHTOKEN, $access_token);\n variable_set(EBConsts::EBS_CONFIG_AUTHTOKEN_TYPE, $token_type);\n }",
"public function testValidateToken()\n {\n }",
"public function testSendVerificationTokenGet()\n {\n }",
"public function testCreateToken()\n {\n $response = $this->actingAsTestingUser()\n ->withEncryptionKey()\n ->get(route('tokens.create'));\n\n $response->assertStatus(200);\n $response->assertViewIs('tokens.form');\n }",
"public function setAccessToken($token);",
"public function getAccessToken($access_token);",
"public function testGetAccessTokenByAuthCode() {\n $tokenResponse = Json::decode($this->getMockResponseContents(self::ACCESS_TOKEN_RESPONSE));\n $authCode = 'SplxlOBeZQQYbYS6WxSbIA';\n\n $eloquaApiClient = $this->getMockBuilder('Drupal\\eloqua_api_redux\\Service\\EloquaApiClient')\n ->setConstructorArgs([\n $this->configFactory,\n $this->loggerFactory,\n $this->cacheBackend,\n $this->httpClientFactory,\n ])\n ->setMethods(['getEloquaApiCache', 'doTokenRequest'])\n ->getMock();\n\n $eloquaApiClient->expects($this->at(0))\n ->method('getEloquaApiCache')\n ->with('access_token')\n ->will($this->returnValue(NULL));\n\n $eloquaApiClient->expects($this->any())\n ->method('doTokenRequest')\n ->will($this->returnValue($tokenResponse));\n\n $response = $eloquaApiClient->getAccessTokenByAuthCode($authCode);\n $this->assertNotNull($response);\n }",
"public function testAuthorization(){\n $this->client->request('POST', '/api',[\n 'method' => 'createTransaction',\n 'user_id' => '0',\n 'token' => 'xxxxx',\n 'category_id' => '2',\n 'cost' => '123123',\n 'note' => 'asdadasgfa asfas ',\n ]);\n $data = json_decode($this->client->getResponse()->getContent(), true);\n $this->assertEquals(0, $data['success']);\n $this->assertEquals('User not found', $data['message']);\n\n $this->client->request('POST', '/api',[\n 'method' => 'createTransaction',\n 'user_id' => '-1',\n 'token' => 'xxxxx',\n 'category_id' => '2',\n 'cost' => '123123',\n 'note' => '',\n ]);\n $data = json_decode($this->client->getResponse()->getContent(), true);\n $this->assertEquals(0, $data['success']);\n $this->assertEquals('User not found', $data['message']);\n\n $this->client->request('POST', '/api',[\n 'method' => 'createTransaction',\n 'user_id' => '1',\n 'token' => 'xxxxx',\n 'category_id' => '2',\n 'cost' => '123123',\n 'note' => 'Test note',\n ]);\n $data = json_decode($this->client->getResponse()->getContent(), true);\n $this->assertEquals(0, $data['success']);\n $this->assertEquals('Request Fail,logout or sign in again', $data['message']);\n\n //Token of user already in database\n $this->client->request('POST', '/api',[\n 'method' => 'createTransaction',\n 'user_id' => '1',\n 'token' => '73a395f4b62a75ba12512e2d2b3b6dac',\n 'category_id' => '2',\n 'cost' => '123123',\n 'note' => 'Test note',\n ]);\n $data = json_decode($this->client->getResponse()->getContent(), true);\n $this->assertEquals(1, $data['success']);\n }",
"public function getAuthorizationMethod()\n {\n return 'bearer';\n }",
"public function test_create_task_token_not_given_or_expired()\n {\n $credential = [\n 'body' => 'testing task'\n ];\n\n $token = '';\n\n $response = $this->json('POST', '/api/tasks', $credential, ['Accept' => 'application/json', 'Authorization' => 'Bearer '.$token]);\n\n $response\n ->assertStatus(401)\n ->assertJsonStructure(['message'])\n ->assertJsonPath('message', \"Unauthenticated.\");\n }",
"public function setBearerToken($token)\n {\n $this->options['headers']['Authorization'] = \"Bearer $token\";\n }",
"private function get_bitly_client_access_token()\n {\n\n if (FCMSUtils::acf_available()) {\n\n return get_field('fpt_bitly_access_token', 'options');\n\n }\n\n }",
"public function testListTokens()\n {\n $response = $this->actingAsTestingUser()\n ->withEncryptionKey()\n ->get(route('tokens.code'));\n\n $response->assertStatus(200);\n $response->assertViewIs('tokens.list');\n }",
"static function BearerToken()\n {\n return trim(str_replace('Bearer', '', self::GetHeader()));\n }",
"private static function generate_access_token()\n {\n $url = 'https://' . env('MPESA_SUBDOMAIN') . '.safaricom.co.ke/oauth/v1/generate?grant_type=client_credentials';\n\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n $credentials = base64_encode(env('MPESA_CONSUMER_KEY') . ':' . env('MPESA_CONSUMER_SECRET'));\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Authorization: Basic ' . $credentials)); //setting a custom header\n curl_setopt($curl, CURLOPT_HEADER, false);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n $curl_response = curl_exec($curl);\n\n return json_decode($curl_response)->access_token;\n }",
"protected function _setOauthToken()\n {\n $this->_initHttpClient($this->_endpointUrls['access_token'], CurlHttpClient::POST);\n $this->_httpClient->setPostParam('client_id', $this->_config['client_id']);\n $this->_httpClient->setPostParam('client_secret', $this->_config['client_secret']);\n $this->_httpClient->setPostParam('grant_type', $this->_config['grant_type']);\n $this->_httpClient->setPostParam('redirect_uri', $this->_config['redirect_uri']);\n $this->_httpClient->setPostParam('code', $this->getAccessCode());\n $this->_oauthToken = $this->_getHttpClientResponse();\n }",
"public function testFetchResourceWithInValidToken()\n {\n $client = new OAuth2\\Client(CLIENT_ID, CLIENT_SECRET, OAuth2\\Client::AUTH_TYPE_AUTHORIZATION_BASIC);\n\n // Here you can define any other params that you want to pass.\n $params = array();\n\n // Generating Token\n $tokenResponse = $client->getAccessToken(TOKEN_URI, OAuth2\\Client::GRANT_TYPE_CLIENT_CREDENTIALS, $params);\n $httpCode = $tokenResponse['code'];\n \n $client->setAccessToken('');\n // Setting Up the access Token Type to client Object\n $client->setAccessTokenType(OAuth2\\Client::ACCESS_TOKEN_BEARER);\n\n // Finally fetching resource from Resource URL using access token\n $resourceResponse = $client->fetch('https://api.fronter.com/clients/'.CLIENT_ID);\n $resourceURLResponseHttpCode = $resourceResponse['code'];\n\n $this->assertEquals(401, $resourceURLResponseHttpCode);\n }",
"public function testLoginController() {\n $user = $this->createUser(true);\n\n // Try to fail the login controller.\n $client = static::createClient();\n $client->request('POST', '/api/user/login');\n\n $this->assertEquals($client->getResponse()->getContent(), '{\"error\":\"The payload is not correct.\"}');\n\n $client = static::createClient();\n $client->request('POST', '/api/user/login', array(), array(), array('CONTENT_TYPE' => 'application/json'), '{\"auth\":\"pizza\"}');\n\n $this->assertEquals($client->getResponse()->getContent(), '{\"error\":\"The payload is not correct.\"}');\n\n // Create access token and start to check it's attached to the correct user.\n $auth = $this->getAuthString($user->username);\n\n $client = static::createClient();\n $client->request('POST', '/api/user/login', array(), array(), array('CONTENT_TYPE' => 'application/json'), '{\"auth\":\"' . $auth . '\"}');\n\n $response = $client->getResponse()->getContent();\n $decoded_response = json_decode($response);\n\n // Checking the access token belong to the user.\n $this->assertEquals($user->id, $decoded_response->user_id);\n\n // Checking the expires is valid for 1 day.\n $this->assertTrue($decoded_response->expires - time() > 86000);\n\n // Making sure we got the access token belongs to the user we created.\n $this->assertEquals($user->id, $this->getTahiniAccessToken()->loadByAccessToken($decoded_response->access_token)->user->id);\n }",
"public static function getAccessToken()\n {\n $authorization = request()->header('Authorization');\n // $authorization = @getallheaders()['Authorization'];\n // before running unit tests...\n //$authorization = '$2y$10$tSM.PiN9BnMfyonqjHlwTONa1DPHbyQSAMOtmt4chJYXenGeYySHC';\n return (isset($authorization))?$authorization:null;\n }",
"public function getAccessToken();",
"public function getAccessToken();",
"public function getAccessToken();",
"public function getAccessToken();",
"public function getAccessToken();",
"public function testGetAccessTokenByRefreshToken() {\n $tokenResponse = Json::decode($this->getMockResponseContents(self::ACCESS_TOKEN_RESPONSE));\n $refreshToken = 'tGzv3JOkF0XG5Qx2TlKW';\n\n $eloquaApiClient = $this->getMockBuilder('Drupal\\eloqua_api_redux\\Service\\EloquaApiClient')\n ->setConstructorArgs([\n $this->configFactory,\n $this->loggerFactory,\n $this->cacheBackend,\n $this->httpClientFactory,\n ])\n ->setMethods(['getEloquaApiCache', 'doTokenRequest'])\n ->getMock();\n\n $eloquaApiClient->expects($this->at(0))\n ->method('getEloquaApiCache')\n ->with('access_token')\n ->will($this->returnValue(NULL));\n\n $eloquaApiClient->expects($this->at(1))\n ->method('getEloquaApiCache')\n ->with('refresh_token')\n ->will($this->returnValue($refreshToken));\n\n $eloquaApiClient->expects($this->any())\n ->method('doTokenRequest')\n ->will($this->returnValue($tokenResponse));\n\n $response = $eloquaApiClient->getAccessTokenByRefreshToken();\n $this->assertNotNull($response);\n }",
"public function testShowUnauthicatedAccess(): void { }",
"public function setAccessToken($token): ClientInterface;",
"public function testCreateTokenFromIdentity()\n {\n }",
"private function getBearerToken() {\n\n // Encoding the consumer key and secret\n $bearer_auth = $this->encodeBearerAuth();\n\n // The POST request has to have\n // a specific grant_type in the body\n $request_body = ['grant_type' => 'client_credentials'];\n $request_body = http_build_query($request_body);\n\n // Setting the required headers\n $headers = [\n 'Authorization: Basic ' . $bearer_auth,\n 'Content-Type: application/x-www-form-urlencoded;charset=UTF-8',\n 'Content-Length: ' . strlen($request_body)\n ];\n\n // Requesting the bearer token\n $result = $this->makePostRequest(\n 'oauth2/token',\n $headers,\n $request_body,\n true\n );\n\n if (isset($result['token_type']) &&\n strlen($result['token_type']) &&\n $result['token_type'] === 'bearer' &&\n isset($result['access_token']) &&\n strlen($result['access_token'])) {\n\n $this->bearer_token = $result['access_token'];\n }\n }",
"public function testGetIntegrationTokenTestMode()\n {\n $this->helper\n ->expects($this->exactly(2))\n ->method('getConfigData')\n ->withConsecutive(\n [$this->equalTo('test_mode_enabled'), $this->equalTo(null)],\n [$this->equalTo('test_integration_token'), $this->equalTo(null)]\n )\n ->willReturnOnConsecutiveCalls(\n true,\n 'test_key'\n );\n\n $this\n ->helper\n ->getIntegrationToken();\n }",
"public function testGeneratetTokenTempFaillureToken(){\n $client = static::createClient();\n $data = '{\n \"token_session\": \"token_not_exist\",\n \"login\": \"santevet\"\n }';\n $crawler = $client->request(\n 'PUT', '/generate/token/temp', array(), array(),\n array(\n 'CONTENT_TYPE' => 'application/json',\n 'HTTP_X-Requested-With' => 'XMLHttpRequest'\n ),\n $data\n ); \n $response = $client->getResponse();\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertSame('application/json', $response->headers->get('Content-Type'));\n $body = json_decode($response->getContent(), true);\n $this->assertArrayHasKey('token_temp', $body);\n $this->assertArrayHasKey('expiration', $body);\n $this->assertEquals(null,$body['token_temp']);\n $this->assertEquals(null,$body['expiration']);\n }",
"private function prepareAuth()\n {\n $this->client->setHeaders(\n [\n 'Content-Type' => 'application/json',\n 'Authorization' => 'Bearer ' . $this->zendeskHelper->getToken()\n ]\n );\n }",
"protected function initializeTest()\n {\n $fixturesList = $this->loadDataFixtures();\n $this->fixtures = $this->loadFixtures($fixturesList)->getReferenceRepository();\n\n $player = $this->getPlayer();\n $access_token = $this->getAccessTokenPlayer($player->getApiKey());\n\n return $access_token;\n }",
"public function test_you_have_to_be_authenticated()\n {\n $this->json('get' , 'api/cart')->assertStatus(401);\n\n }",
"public function testRefreshToken() {\n $client = static::createClient();\n\n $client->request('POST', '/api/user/refresh');\n $this->assertEquals($client->getResponse()->getContent(), '{\"error\":\"The payload is not correct.\"}');\n\n $client = static::createClient();\n $client->request('POST', '/api/user/refresh', array(), array(), array('CONTENT_TYPE' => 'application/json'), '{\"auth\":\"pizza\"}');\n\n $this->assertEquals($client->getResponse()->getContent(), '{\"error\":\"The refresh token is missing\"}');\n\n // Get the access token.\n $access_token = $this->getTahiniAccessToken()->getAccessToken($this->createUser(false));\n\n // Refreshing the access token.\n $client = static::createClient();\n $client->request('POST', '/api/user/refresh', array(), array(), array('CONTENT_TYPE' => 'application/json'), '{\"refresh_token\":\"' . $access_token->refresh_token . '\"}');\n\n $decoded_response = json_decode($client->getResponse()->getContent());\n\n $new_access_token = $this->getTahiniAccessToken()->loadByAccessToken($decoded_response->access_token);\n $this->assertNotEquals($new_access_token->id, $access_token->id);\n }",
"public function testLoginTokenFaillureExpired(){\n $client = static::createClient();\n $data = '{\n \"token_session\": \"8b0d9c93a3545d0d99f6486208dd3659ec802ee1\",\n \"login\": \"santevet\"\n }';\n $crawler = $client->request(\n 'PUT', '/generate/token/temp', array(), array(),\n array(\n 'CONTENT_TYPE' => 'application/json',\n 'HTTP_X-Requested-With' => 'XMLHttpRequest'\n ),\n $data\n ); \n $response = $client->getResponse();\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertSame('application/json', $response->headers->get('Content-Type'));\n $_data = json_decode($response->getContent(), true);\n \n $data = '{\n \"login\": \"santevet\",\n \"token_temp\": \"'.$_data['token_temp'].'\",\n \"expiration\": \"2015-01-01 00:00:00\"\n }';\n $crawler = $client->request(\n 'POST', '/login/token', array(), array(),\n array(\n 'CONTENT_TYPE' => 'application/json',\n 'HTTP_X-Requested-With' => 'XMLHttpRequest'\n ),\n $data\n );\n $response = $client->getResponse();\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertSame('application/json', $response->headers->get('Content-Type'));\n $body = json_decode($response->getContent(), true);\n $this->assertArrayHasKey('token_session', $body);\n $this->assertArrayHasKey('validity', $body);\n $this->assertEquals(null,$body['token_session']);\n $this->assertEquals(null,$body['validity']);\n }",
"protected function respondWithToken($token)\n{\n return response()->json([\n 'access_token' => $token,\n 'token_type' => 'bearer',\n 'user'=> $this->guard()->user(),\n 'expires_in' => $this->guard()->factory()->getTTL() * 60\n ]);\n}",
"public function testBasicTest()\r\n {\r\n $client = new LoginClient();\r\n\r\n $result = $client->getToken('您的帳號', '您的密碼');\r\n\r\n// echo $result['access_token'];\r\n if (!empty($result['access_token'])) {\r\n // save token to local\r\n file_put_contents(\"token.txt\", $result['access_token']);\r\n }\r\n var_dump($result);\r\n }",
"public function testAuthWithCode($code)\n {\n $reqData = [\n 'grant_type' => AccessToken::TYPE_AUTHORIZATION_CODE,\n 'code' => $code,\n 'client_id' => 1,\n 'client_secret' => ClientsSeeder::SECRET_KEYS[0],\n 'scope' => 'default',\n ];\n /** @var \\Tests\\Functional\\AuthTest $data */\n $data = $this->post('/oauth/access_token', $reqData);\n\n $resp = \\json_decode($data->response->getContent(), true);\n\n $this->assertArrayHasKey('access_token', $resp);\n $this->assertEquals('Bearer', $resp['token_type']);\n $this->assertArrayHasKey('refresh_token', $resp);\n }",
"public function test_token_opportunity() {\n\t\t$this->uri->rsegments[3] = 'b6286e5aa2';\n\t\tset_valid_authorization();\n\t\t$out = run_action($this->c, 'token');\n\n\t\t$json = json_decode($out, true);\n\n\t\t$this->assertTrue($json['error']);\n\t\t$this->assertFalse(array_key_exists('opportunity', $json));\n\t\t$this->assertFalse(array_key_exists('opportunities', $json));\n\t}",
"public function testExportToken()\n {\n $response = $this->actingAsTestingUser()\n ->withEncryptionKey()\n ->get(route('tokens.export', [$this->token->path]));\n\n $response->assertStatus(200);\n $response->assertViewIs('tokens.export');\n }",
"public function testApiRedirect()\n {\n $_SERVER['HTTP']['Token'] = Session::get('Token');\n\n $response = $this->call('GET', '/api/');\n\n $this->assertEquals(200, $response->getStatusCode());\n\n $decoded = json_decode($response->getContent());\n\n $this->assertEquals('error', $decoded->status);\n }",
"public function testAccessTokenCanBeGetByTokenId(): void\n {\n // Collects a random AccessToken.\n $model = $this->model\n ->newQuery()\n ->inRandomOrder()\n ->first();\n\n // Get the AccessToken from the Repository.\n $accessToken = $this->repository->getByToken($model->token_id);\n\n // Perform assertions\n $this->assertInstanceOf(\n AccessToken::class,\n $accessToken,\n 'The instance should be an AccessToken entity.'\n );\n $this->assertEquals(\n $accessToken->id(),\n $model->id,\n 'The ids should be equal.'\n );\n $this->assertEquals(\n $accessToken->tokenId(),\n $model->token_id,\n 'The token IDs should be equal.'\n );\n $this->assertEquals(\n $accessToken->userId(),\n $model->user_id,\n 'The last names should be equal.'\n );\n $this->assertEquals(\n $accessToken->revoked(),\n $model->revoked,\n 'The revoked flag should be equal.'\n );\n }",
"function new_access_token($token, $consumer) {\n // for the user associated with this token if the request token \n // is authorized \n // should also invalidate the request token \n }",
"public function testRefreshToken($token)\n {\n $reqData = [\n 'grant_type' => AccessToken::TYPE_REFRESH_TOKEN,\n 'refresh_token' => $token,\n 'client_id' => 1,\n 'client_secret' => ClientsSeeder::SECRET_KEYS[0],\n 'scope' => 'default',\n ];\n /** @var \\Tests\\Functional\\AuthTest $data */\n $data = $this->post('/oauth/access_token', $reqData);\n\n $resp = \\json_decode($data->response->getContent(), true);\n\n $this->assertArrayHasKey('access_token', $resp);\n $this->assertEquals('Bearer', $resp['token_type']);\n $this->assertArrayHasKey('refresh_token', $resp);\n }",
"public function bearerToken($request)\n {\n $header = $request->header('Authorization', '');\n if($header){\n if (Str::startsWith($header, 'Bearer ')) {\n $token = Str::substr($header, 7);\n \n // Verify the token with the user.\n $check = User::where('api_token', $token)->first();\n if($check){\n return ['msg' => 'User is authorized.', 'status'=>100];\n }else{\n return ['msg' => 'Unauthorized user.', 'status'=>101];\n }\n }\n } else{\n return ['msg' => 'Authentication token is missing.', 'status'=>101];\n }\n }",
"public function testGetIntegrationTokenNonTestMode()\n {\n $this->helper\n ->expects($this->exactly(2))\n ->method('getConfigData')\n ->withConsecutive(\n [$this->equalTo('test_mode_enabled'), $this->equalTo(null)],\n [$this->equalTo('integration_token'), $this->equalTo(null)]\n )\n ->willReturnOnConsecutiveCalls(\n false,\n 'production_key'\n );\n\n $this\n ->helper\n ->getIntegrationToken();\n }",
"public function testGeneratetTokenTempFaillureLogin(){\n $client = static::createClient();\n $data = '{\n \"token_session\": \"8b0d9c93a3545d0d99f6486208dd3659ec802ee1\",\n \"login\": \"error_login\"\n }';\n $crawler = $client->request(\n 'PUT', '/generate/token/temp', array(), array(),\n array(\n 'CONTENT_TYPE' => 'application/json',\n 'HTTP_X-Requested-With' => 'XMLHttpRequest'\n ),\n $data\n ); \n $response = $client->getResponse();\n $this->assertEquals(200, $response->getStatusCode());\n $this->assertSame('application/json', $response->headers->get('Content-Type'));\n $body = json_decode($response->getContent(), true);\n $this->assertArrayHasKey('token_temp', $body);\n $this->assertArrayHasKey('expiration', $body);\n $this->assertEquals(null,$body['token_temp']);\n $this->assertEquals(null,$body['expiration']);\n }"
] | [
"0.71440214",
"0.7135889",
"0.68260735",
"0.6617825",
"0.6343384",
"0.6270952",
"0.6245528",
"0.6206643",
"0.61611056",
"0.61605346",
"0.61241585",
"0.6090617",
"0.6077614",
"0.60605365",
"0.6044816",
"0.6044037",
"0.6041538",
"0.60245776",
"0.601401",
"0.6008106",
"0.600706",
"0.6006257",
"0.5992941",
"0.5992896",
"0.596613",
"0.59576994",
"0.59536034",
"0.594385",
"0.59380877",
"0.58948076",
"0.5877351",
"0.5873566",
"0.5870072",
"0.58512926",
"0.5849876",
"0.58472675",
"0.58370286",
"0.58230525",
"0.58087754",
"0.5803297",
"0.57947576",
"0.57898015",
"0.57776314",
"0.5774976",
"0.577336",
"0.5766813",
"0.5763538",
"0.5732493",
"0.5731272",
"0.57300735",
"0.5724066",
"0.5720556",
"0.571715",
"0.5715567",
"0.5712185",
"0.5691335",
"0.5689076",
"0.5688922",
"0.56793296",
"0.5655129",
"0.5649394",
"0.56371546",
"0.5634661",
"0.5632534",
"0.5627921",
"0.56142867",
"0.5613385",
"0.5608226",
"0.5605572",
"0.56011003",
"0.5597485",
"0.5590133",
"0.5590133",
"0.5590133",
"0.5590133",
"0.5590133",
"0.55870754",
"0.5582694",
"0.5582073",
"0.55733186",
"0.5565367",
"0.55612093",
"0.55595654",
"0.55508643",
"0.55443907",
"0.5537641",
"0.5523047",
"0.55061626",
"0.55012983",
"0.5487854",
"0.54872566",
"0.5486603",
"0.548513",
"0.5479233",
"0.5470102",
"0.5469242",
"0.5467605",
"0.5465449",
"0.5465234",
"0.5461371"
] | 0.76971054 | 0 |
Make path from array, can check if exists return path if true | public static function makePath(array $path, bool $withCheck = false): string|false
{
$path = array_filter($path, fn($p) => $p);
$path = array_map(fn($p) => trim($p, '\/'), $path);
$res = join(DIRECTORY_SEPARATOR, $path);
if ($withCheck) {
if (!file_exists($res) && !is_dir($res)) {
return false;
}
}
return $res;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setValueByPath($arr,$path,$value,$createPath=false) {\n\t\tif ($createPath)\n\t\t\t$r=&$arr;\n\t\telse\t\n\t\t\t$r=$arr;\n\t\tif (!is_array($path)) return false;\n\t\tforeach ($path as $key) {\n\t\t\tif ($createPath and !isset($r[$key])) {\n\t\t\t\t$r[$key]='';\n\t\t\t}\n\t\t\tif (isset($r[$key])) {\n\t\t\t\t$r=&$r[$key];\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t$r=$value;\n\t\t\n\t\treturn $r;\n\t}",
"function array_path($array, $path, $default = null) {\n $path = explode('.', $path);\n while ($key = array_shift($path)) {\n if (!isset($array[$key])) return $default;\n $array = $array[$key];\n }\n return $array;\n}",
"private function mkpath($path){\n $dirs=array();\n $path=preg_replace('/(\\/){2,}|(\\\\\\){1,}/','/',$path);\n $dirs=explode(\"/\",$path);\n $path=\"\";\n foreach ($dirs as $element){\n $path.=$element.\"/\";\n if(!is_dir($path)){ \n if(!mkdir($path)){ \n return false; \n }\n } \n }\n }",
"public function test_path()\n {\n $data = [\n 'level1' =>\n [\n 'level1a' =>\n [\n 'level1aa' => 'foo',\n 'level1ab' => 'bar',\n 'level1ac' => true,\n 'common' => 'foobar1'\n ],\n 'level1b' => true,\n 'level1c' =>\n [\n 'common' => 'foobar2'\n ]\n\n ],\n 'level2' =>\n [\n 'level2a' => false,\n 'level2b' => 10000\n ]\n ];\n\n $this->assertFalse(Arr::path($data, 'level2.level2a'));\n\n $this->assertTrue(Arr::path($data, 'level1|level1b', null, '|'));\n\n $this->assertEquals('Foobar', Arr::path($data, 'level1.level1a.levelX', 'Foobar'));\n\n $this->assertEquals(10000, Arr::path($data, ['level2', 'level2b']));\n\n $this->assertContains([\n 'level1aa' => 'foo',\n 'level1ab' => 'bar',\n 'level1ac' => true,\n 'common' => 'foobar'\n ], Arr::path($data, 'level1.level1a'));\n\n $this->assertArraySubset(['foobar1', 'foobar2'], Arr::path($data, 'level1.*.common'));\n\n\n Arr::setPath($data, 'level2-level2c', true, '-');\n $this->assertTrue(Arr::path($data, 'level2.level2c', false));\n\n Arr::setPath($data, 'level1.level1a', 'foo');\n $this->assertEquals('foo', Arr::path($data, 'level1.level1a'));\n\n }",
"protected function createPathIfNeeded() {}",
"protected function _path($array, $path, $level, $no_error = false)\n\t{\n\t\t// Is $array even an array? It might be false!\n\t\tif (!is_array($array))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Asking for *no* path?\n\t\tif ($path === '' || $path === '.')\n\t\t{\n\t\t\treturn $array;\n\t\t}\n\t\t$paths = explode('|', $path);\n\n\t\t// A * means all elements of any name.\n\t\t$show_all = in_array('*', $paths);\n\n\t\t$results = array();\n\n\t\t// Check each element.\n\t\tforeach ($array as $value)\n\t\t{\n\t\t\tif (!is_array($value) || $value['name'] === '!')\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($show_all || in_array($value['name'], $paths))\n\t\t\t{\n\t\t\t\t// Skip elements before \"the one\".\n\t\t\t\tif ($level !== null && $level > 0)\n\t\t\t\t{\n\t\t\t\t\t$level--;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$results[] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// No results found...\n\t\tif (empty($results))\n\t\t{\n\t\t\t$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);\n\t\t\t$i = 0;\n\t\t\twhile ($i < count($trace) && isset($trace[$i]['class']) && $trace[$i]['class'] == get_class($this))\n\t\t\t{\n\t\t\t\t$i++;\n\t\t\t}\n\n\t\t\t$debug = ' from ' . $trace[$i - 1]['file'] . ' on line ' . $trace[$i - 1]['line'];\n\n\t\t\t// Cause an error.\n\t\t\tif ($this->debug_level & E_NOTICE && !$no_error)\n\t\t\t{\n\t\t\t\ttrigger_error('Undefined XML element: ' . $path . $debug, E_USER_NOTICE);\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\t\t// Only one result.\n\t\telseif (count($results) === 1 || $level !== null)\n\t\t{\n\t\t\treturn $results[0];\n\t\t}\n\t\t// Return the result set.\n\t\telse\n\t\t{\n\t\t\treturn $results + array('name' => $path . '[]');\n\t\t}\n\t}",
"function pathExists($path);",
"public static function relativeFromArray(array $array): string\n {\n return implode('/', $array);\n }",
"private function arrayPath( &$array, $path = array(), &$value = null ) {\n\t\t$args = func_get_args();\n\t\t$ref = &$array;\n\t\tforeach ( $path as $key ) {\n\t\t\tif ( !is_array( $ref ) ) {\n\t\t\t\t$ref = [];\n\t\t\t}\n\t\t\t$ref = &$ref[$key];\n\t\t}\n\t\t$prev = $ref;\n\t\tif ( array_key_exists(\n\t\t\t2,\n\t\t\t$args\n\t\t) ) {\n\t\t\t// value param was passed -> we're setting\n\t\t\t$ref = $value; // set the value\n\t\t}\n\n\t\treturn $prev;\n\t}",
"public static function existsOrCreatePath($path)\n\t{\n\t\tFile::exists($path) or File::makeDirectory($path);\n\t\treturn $path;\n\t}",
"abstract public function gotPath( array $path );",
"public function returnPaths(array $array, $reverse = false)\n {\n \n }",
"private function arrayPath(array &$array, $path = array(), &$value = null)\n {\n $ref = &$array;\n foreach ($path as $key) {\n if (!is_array($ref)) {\n $ref = array();\n }\n $ref = &$ref[$key];\n }\n $prev = $ref;\n if (null !== $value) {\n $ref = $value;\n }\n return $prev;\n }",
"public static function absoluteFromArray(array $array): string\n {\n return '/'.implode('/', $array);\n }",
"public function pathExists($path);",
"function prefix_safelist($safelist){\n\t\t\tif (!is_array($safelist)){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tforeach($safelist as $key => $value){\n\t\t\t\tif (!is_string($value)){\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$safelist[$key] = file_path($value);\n\t\t\t}\n\t\t\treturn $safelist;\n\t\t}",
"private function _makepath() {\n $params = func_get_args();\n $path = '';\n\n foreach ($params as $value) {\n $path .= $value;\n\n if (!empty($value)) $path .= PS;\n }\n\n return $path;\n }",
"function directory( $array = [], $root = false )\n{\n if ( $root )\n $start = __DIR__ . DIRECTORY_SEPARATOR;\n else\n $start = '';\n \n return $start . implode( DIRECTORY_SEPARATOR, $array );\n}",
"public function stringifyPaths(array $array, array $path = [])\n {\n $result = [];\n foreach ($array as $key => $val) {\n $currentPath = array_merge($path, [$key]);\n if (is_array($val)) {\n $result[] = join('/', $currentPath);\n $result = array_merge($result, $this->stringifyPaths($val, $currentPath));\n } else {\n $result[] = join('/', $currentPath);\n }\n }\n\n return $result;\n }",
"function createpath($path)\n{\n\t\t$exp=explode(\"/\",$path);\n\t\t\t\t$way='';\n\t\t\t\tforeach($exp as $n)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t$way.=$n;\n\t\t\t\t\t\t@mkdir($way, 0777);\n\t\t\t\t\t\t@chmod($way, 0777);\n\t\t\t\t\t$way.='/';\n\t\t\t\t\t\t\n\t\t\t\t}\n}",
"abstract protected function paths();",
"public function createPath(string $path): string;",
"function build_path()\n {\n // We build the path only if arguments are passed\n if ( ! empty($args = func_get_args()))\n {\n // Make sure arguments are an array but not a mutidimensional one\n isset($args[0]) && is_array($args[0]) && $args = $args[0];\n\n return implode(DIRECTORY_SEPARATOR, array_map('rtrim', $args, array(DIRECTORY_SEPARATOR))).DIRECTORY_SEPARATOR;\n }\n\n return NULL;\n }",
"private function getPath(array $path = null): string\n {\n if ($path === null) {\n $path = $this->path;\n }\n return __DIR__ . '/../' . implode('/', $path);\n }",
"public static function path(array $array, $path, $default = NULL, ?string $delimiter = NULL)\n {\n if (!self::isArray($array)) {\n // This is not an array!\n return $default;\n }\n\n if (is_array($path)) {\n // The path has already been separated into keys\n $keys = $path;\n } else {\n if (array_key_exists($path, $array)) {\n // No need to do extra processing\n return $array[$path];\n }\n\n if ($delimiter === NULL) {\n // Use the default delimiter\n $delimiter = static::$delimiter;\n }\n\n // Remove starting delimiters and spaces\n $path = ltrim($path, \"{$delimiter} \");\n\n // Remove ending delimiters, spaces, and wildcards\n $path = rtrim($path, \"{$delimiter} *\");\n\n // Split the keys by delimiter\n $keys = explode($delimiter, $path);\n }\n\n do {\n $key = array_shift($keys);\n\n if (ctype_digit($key)) {\n // Make the key an integer\n $key = (int)$key;\n }\n\n if (isset($array[$key])) {\n if ($keys) {\n if (self::isArray($array[$key])) {\n // Dig down into the next part of the path\n $array = $array[$key];\n } else {\n // Unable to dig deeper\n break;\n }\n } else {\n // Found the path requested\n return $array[$key];\n }\n } elseif ($key === '*') {\n // Handle wildcards\n\n $values = [];\n foreach ($array as $arr) {\n if ($value = self::path($arr, implode('.', $keys))) {\n $values[] = $value;\n }\n }\n\n if ($values) {\n // Found the values requested\n return $values;\n }\n\n break;\n } else {\n // Unable to dig deeper\n break;\n }\n } while ($keys);\n\n // Unable to find the value requested\n return $default;\n }",
"public function setArrayValueByPath($pathArray, &$array, $value)\n {\n if (isset($value)) {\n if (!is_array($pathArray)) {\n $pathArray = explode('/', $pathArray);\n }\n if (is_array($array) && !empty($pathArray)) {\n $key = array_shift($pathArray);\n if (empty($pathArray)) {\n $array[$key] = $value;\n return true;\n }\n if (!isset($array[$key])) {\n $array[$key] = [];\n }\n return $this->setArrayValueByPath($pathArray, $array[$key], $value);\n }\n }\n }",
"private function check_path()\n\t{\n\t\t$ar = func_get_args();\n\t\tforeach ( $ar as $a ){\n\t\t\tif ( !is_string($a) ||\n (strpos($a,'./') !== false) ||\n (strpos($a,'/') === 0) ){\n\t\t\t\tdie(\"The path $a is not an acceptable value\");\n\t\t\t}\n\t\t}\n\t\treturn 1;\n\t}",
"public function getPath(): array;",
"private function getArrayItemByPath($array)\n\t{\n\t\t$p = $array;\n\t\t$argc = func_num_args();\n\t\tfor ($i = 1; $i < $argc; $i++) {\n\t\t\t$k = func_get_arg($i);\n\t\t\tif ($k === null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (is_array($k)) {\n\t\t\t\tforeach ($k as $kk) {\n\t\t\t\t\tif (isset($p[$kk])) {\n\t\t\t\t\t\t$p = $p[$kk];\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (isset($p[$k])) {\n\t\t\t\t\t$p = $p[$k];\n\t\t\t\t} else {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $p;\n\t}",
"function create_paths($DataArray) {\n\n function concat_path($row) {\n $newPath = base_url() . \"img/pictos/\" . $row[\"imgPicto\"];\n $row[\"imgPicto\"] = $newPath;\n return $row;\n }\n\n return array_map(\"concat_path\", $DataArray);\n }",
"function getValueByPath($arr,$path) {\n\t\t$r=$arr;\n\t\tif (!is_array($path)) return false;\n\t\tforeach ($path as $key) {\n\t\t\tif (isset($r[$key]))\n\t\t\t\t$r=$r[$key];\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t\treturn $r;\n\t}",
"public function prep_url_array($array,$unset = 0){\n for($i = 0; $i < $unset; $i++){\n unset($array[$i]);\n }\n return implode($array, '/');\n }",
"public function isValidPathReturnsTrueIfPathExists() {}",
"public function createPath( $path ) {\n\t\tif ( !file_exists($path) || !is_dir($path) ) {\n\t\t\tif ( !mkdir( $path, 0777, true ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn $path;\n\t}",
"public function testPath()\n {\n $json = new JsonArray(['foo' => ['bar' => 'baz']]);\n $json->set('bar/bar\\/baz', 'foo');\n\n $this->assertFalse($json->has('foo\\/bar'));\n $this->assertTrue($json->has('foo/bar'));\n $this->assertFalse($json->has('foo/bar/baz'));\n $this->assertEquals('baz', $json->get('foo/bar'));\n $this->assertNull($json->get('foo\\/bar'));\n $this->assertTrue($json->has('bar/bar\\/baz'));\n $this->assertEquals('foo', $json->get('bar/bar\\/baz'));\n $this->assertEquals(['bar/baz' => 'foo'], $json->get('bar'));\n }",
"static protected function findData ($path, $array)\n {\n if (!$path) {\n return $array;\n }\n\n $ids = explode ('/', $path);\n $root = array_shift($ids);\n\n return self::findData(implode ('/', $ids), $array[$root]);\n }",
"function array_get_in($array, array $path, $default = null)\n{\n if (empty($path)) {\n return $array;\n }\n\n $head = array_shift($path);\n\n if (!is_array($array) || !array_key_exists($head, $array)) {\n return $default;\n }\n\n return array_get_in($array[$head], $path, $default);\n}",
"public static function buildPath()\n {\n $path = [];\n\n foreach( func_get_args() as $item )\n {\n if( !empty( $item ) )\n {\n $path[] = trim( $item, \"/ \" );\n }\n }\n return \"/\".implode( \"/\", $path );\n }",
"function check_create($name) {\n global $lsarray;\n if (!in_array($name, $lsarray)) { mkdir($name); return true; }\n else { echo \"Folder already exists: $name\".PHP_EOL; return false; }\n}",
"public function checkIsPathExists($path);",
"public function isReadable(array $array, string $path): bool\n {\n try {\n return $this->pa->isReadable($array, $path);\n } catch (\\Exception $exception) {\n return false;\n }\n }",
"function my_addslashes($array) {\n\n\tforeach ( $array as $var => $value ) :\n\t\tif ( is_array($value) ) :\n\t\t\t$array[$var] = my_addslashes($value);\n\t\telse :\n\t\t\tif ( substr($value, -1) != '/' ) :\n\t\t\t\t$array[$var] = $value . '/';\n\t\t\tendif;\n\t\tendif;\n\tendforeach;\n\t\n\treturn $array;\n}",
"protected function makePath(...$parts) : string\n {\n return implode('::', $parts);\n }",
"public function checkPathExists($path);",
"public function create($array)\n\t\t{\t\t\n\n\t\t\tif($this->ioCreate($array))\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}",
"public static function path( $array, $key, $otherKeys = null )\n\t{\n\t\tif ( is_array( $key ) ) {\n\t\t\t// take the first array member as key and leave the others for further processing\n\t\t\t$_ = array_shift( $key );\n\t\t\t$otherKeys = $key;\n\t\t\t$key = $_;\n\t\t}\n\n\n\t\tif ( !empty( $otherKeys ) ) {\n\t\t\t$argv = func_get_args();\n\t\t\tif ( count( $argv ) > 3 ) { // may be true first time, not in recursion\n\t\t\t\tif ( !is_array( $otherKeys ) ) {\n\t\t\t\t\t$otherKeys = array( $otherKeys );\n\t\t\t\t}\n\t\t\t\tunset( $argv[0], $argv[1], $argv[2] );\n\n\t\t\t\t$otherKeys += $argv;\n\t\t\t}\n\n\t\t\tif ( is_array( $otherKeys ) ) {\n\t\t\t\t$nextKey = array_shift( $otherKeys );\n\n\t\t\t} else {\n\t\t\t\t$nextKey = $otherKeys;\n\t\t\t\t$otherKeys = null;\n\t\t\t}\n\n\t\t\treturn isset( $array[$key] ) ? self::path( $array[$key], $nextKey, $otherKeys ) : null;\n\t\t}\n\t\treturn isset( $array[$key] ) ? $array[$key] : null;\n\t}",
"private function make_path($path){\n\t\t\t// Test if path extist\n\t\t\tif(is_dir($path) || file_exists($path))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Create it\n\t\t\t\tmkdir($path, 0777, true);\n\t\t\t}\n\t}",
"public static function make(string ...$parts)\n {\n return realpath(join(DIRECTORY_SEPARATOR, $parts));\n }",
"function path_join($base, $path)\n {\n }",
"public static function arrayToEnv(array $array, string $env_path)\n {\n\n if(file_exists($env_path))\n {\n\n $env = \"\";\n $position = 0;\n foreach($array as $key => $value)\n {\n $position++;\n // If value isn't blank, or key isn't numeric meaning not a blank line, then add entry\n if($value !== \"\" || !is_numeric($key))\n {\n // If passed in option is a boolean (true or false) this will normally\n // save as 1 or 0. But we want to keep the value as words.\n if(is_bool($value))\n {\n if($value === true)\n {\n $value = \"true\";\n }\n else\n {\n $value = \"false\";\n }\n }\n\n // Always convert $key to uppercase\n $env .= strtoupper($key) . \"=\" . $value;\n\n // If isn't last item in array add new line to end\n if($position != count($array))\n {\n $env .= \"\\n\";\n }\n }\n else\n {\n $env .= \"\\n\";\n }\n }\n\n if(file_put_contents($env_path, $env) !== false)\n return true;\n\n return false;\n\n }\n\n else\n throw new \\Exception(\"Attempt to read '\" . $env_path . \"' but this file does not exist !\");\n\n\n }",
"function buildPath() {\n\t$args = func_get_args();\n\t$path = '';\n\tforeach ($args as $arg) {\n\t\tif (strlen($path)) {\n\t\t\t$path .= \"/$arg\";\n\t\t} else {\n\t\t\t$path = $arg;\n\t\t}\n\t}\n\n\t/* DO NOT USE realpath() -- it hoses everything! */\n\t$path = str_replace('//', '/', $path);\n\t\n\t/* 'escape' the squirrely-ness of Bb's pseudo-windows paths-in-filenames */\n\t$path = preg_replace(\"|(^\\\\\\\\]\\\\\\\\)([^\\\\\\\\])|\", '\\\\1\\\\\\2', $path);\n\t\n\treturn $path;\n}",
"function _wp_array_set(&$input_array, $path, $value = \\null)\n {\n }",
"public static function buildPath( array $segs ) {\n\t\tif ( empty( $segs ) ) {\n\t\t\treturn '';\n\t\t}\n\t\t\n\t\treturn \n\t\t\\strtr( \n\t\t\timplode( '/', $segs ), \n\t\t\t[ '//' => '/', '..' => '' ] \n\t\t);\n\t}",
"public static function _getPath($args, $path = '') {\n\t\tif (is_array($args)) {\n\t\t\tforeach ($args as $arg) {\n\t\t\t\t$path = self::_getPath($arg, $path);\n\t\t\t}\n\t\t\treturn $path;\n\t\t} else {\n\t\t\treturn self::folderElement($path) . $args;\n\t\t}\n\t}",
"public function path();",
"protected static function makePath(...$path_components): string { // phpcs:ignore\n return self::gluePartsTogether($path_components, '/');\n }",
"public function path() {\n\t\t$args = func_get_args();\n\t\tif (count($args)) {\n\t\t\t$this->path = $this->verify($args[0]);\n\t\t}\n\t\treturn $this->path;\n\t}",
"function build_url($name, $array = array())\n {\n $i = 0;\n $i = $this->_search_by_key($this->routes, self::NAME, $name);\n \n if($i === FALSE)\n {\n log_message('ERROR', 'Try to create undefined url with name: '.$name);\n return $this->config->site_url();\n }\n\n $rule = $this->routes[$i];\n \n if(is_null($array)){\n return $rule[self::URL];\n }\n\n //v1.5 ������������ ��������\n if(preg_match_all(\"#\\[([\\w_]+)\\]#\", $rule[self::URL], $mas)){\n $l = count($mas[1]);\n \n for($i = 0; $i < $l; $i++){\n $j = $this->_search_by_key($this->routes, self::NAME, $mas[1][$i]);\n if($j !== FALSE){\n $parent_rule = $this->routes[$j];\n $rule[self::URL] = str_replace('[' . $mas[1][$i] . ']', $parent_rule[self::URL], $rule[self::URL]);\n }\n }\n }\n \n\t\t//AG EDIT\n\t\t$rule_array = explode('/', $rule[self::URL]);\n\t\tforeach($rule_array as $key => $ms)\n\t\t{\n\t\t\tif($ms == '') unset($rule_array[$key]);\n\t\t\tif(($pos = strpos($ms, ':')) !== FALSE)\n\t\t\t{\n\t\t\t\t$u_key = substr($ms, $pos+1);\n\t\t\t\tif(isset($array[$u_key]) && $array[$u_key] !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$rule_array[$key] = str_replace(':'.$u_key , $array[$u_key] , $ms);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tunset($rule_array[$key]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$rule[self::URL] = '';\n\t\tif(count($rule_array)>0)\n\t\t{\n\t\t\tforeach($rule_array as $ms)\n\t\t\t{\n\t\t\t\t$rule[self::URL] .= $ms.'/';\n\t\t\t}\n\t\t\t$rule[self::URL] = substr($rule[self::URL], 0, -1);\n\t\t}\n\t\t/*\n foreach($array as $k => $v)\n {\n $rule[self::URL] = str_replace(':'.$k . '/', $v . '/', $rule[self::URL]);\n }\n */\n //����������� ���������� �������, ����� �������� ���������� �� ������������� ������.\n /*if(preg_match(\"@:\\w+$@\", $rule[self::URL])){\n foreach($array as $k => $v){\n $rule[self::URL] = str_replace(':'.$k, $v, $rule[self::URL]);\n }\n }*/\n return $this->config->site_url($rule[self::URL]);\n }",
"static function is_set(array &$data, $path) {\n\t\t$keys = explode('.', $path);\n\t\t$last = array_pop($keys);\n\t\tforeach($keys as $k){\n\t\t\tif(isset($data[$k]) && is_array($data[$k])){\n\t\t\t\t$data = & $data[$k];\n\t\t\t}else{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t\treturn isset($data[$last]);\n\t}",
"public function testConstructSingleArrayDirectory()\n {\n $filter = new FileRename([\n 'source' => $this->oldFile,\n 'target' => $this->newDir]);\n\n $this->assertEquals(\n [0 => [\n 'source' => $this->oldFile,\n 'target' => $this->newDir,\n 'overwrite' => false,\n 'randomize' => false,\n ]],\n $filter->getFile()\n );\n $this->assertEquals($this->newDirFile, $filter($this->oldFile));\n $this->assertEquals('falsefile', $filter('falsefile'));\n }",
"function setPath($path) {\n if (substr($path,-1)!=\"/\") $path.=\"/\";\n //if (!file_exists($path)) echo \"<div>Path $path not found</div>\";\n $this->mat = $path;\n return true;\n }",
"public function testDir_ArrayPathWithDsn()\n {\n $config = new Config_Dir(array(\"mock:{$this->dir}\"));\n $this->checkWithResult($config);\n }",
"public static function convertPath($records){\n if(!empty($records)){\n foreach($records as $key => $value){\n $path = explode('public/', $value['path']);\n $records[$key]['path'] = $path[1];\n }\n }\n return $records;\n }",
"protected function buildPath($ref_ids)\n\t{\n\t\tinclude_once 'Services/Link/classes/class.ilLink.php';\n\n\t\tif (!count($ref_ids)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$result = array();\n\t\tforeach ($ref_ids as $ref_id) {\n\t\t\t$path = \"\";\n\t\t\t$path_full = self::dic()->tree()->getPathFull($ref_id);\n\t\t\tforeach ($path_full as $idx => $data) {\n\t\t\t\tif ($idx) {\n\t\t\t\t\t$path .= \" » \";\n\t\t\t\t}\n\t\t\t\tif ($ref_id != $data['ref_id']) {\n\t\t\t\t\t$path .= $data['title'];\n\t\t\t\t} else {\n\t\t\t\t\t$path .= ('<a target=\"_top\" href=\"' . ilLink::_getLink($data['ref_id'], $data['type']) . '\">' . $data['title'] . '</a>');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$result[] = $path;\n\t\t}\n\n\t\treturn $result;\n\t}",
"public function mkdirIfNotExist($path=array())\n\t{\n\t\tforeach($path as $key=>$value)\n\t\t{\n\t\t\tif(file_exists($value) && is_dir($value)){\n\t\t\t}else{\n\t\t\t\tmkdir($value,0777);\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn true;\n\t}",
"public function hasValueByChildPath($path, array &$array)\n\t{\n\t\t$p = $this->pushRetNew($path);\n\n\t\treturn $p->hasValue($array);\n\t}",
"abstract protected function getPath();",
"public function testPath() {\n $obj = json_decode('{\n \"a\": {\n \"b\": {\n \"c\": 100,\n \"d\": 200\n },\n \"e\": {\n \"f\": [100, 101, 102],\n \"g\": \"G\"\n },\n \"h\": \"H\"\n },\n \"i\": \"I\",\n \"j\": [\"J\"]\n }');\n\n $this->assertEquals(R::path(['a', 'b', 'c'], $obj), 100);\n $this->assertEquals(R::path([], $obj), $obj);\n $this->assertEquals(R::path(['a', 'e', 'f', 1], $obj), 101);\n $this->assertEquals(R::path(['j', 0], $obj), 'J');\n $this->assertEquals(R::path(['j', 1], $obj), null);\n\n // takes a path that contains indices into arrays.\n $obj = json_decode('{\n \"a\": [[{}], [{\"x\": \"first\"}, {\"x\": \"second\"}, {\"x\": \"third\"}, {\"x\": \"last\"}]]\n }');\n $this->assertEquals(R::path(['a', 0, 0], $obj), (new stdClass()));\n $this->assertEquals(R::path(['a', 0, 1], $obj), null);\n $this->assertEquals(R::path(['a', 1, 0, 'x'], $obj), 'first');\n $this->assertEquals(R::path(['a', 1, 1, 'x'], $obj), 'second');\n $this->assertEquals(R::path([0], ['A']), 'A');\n\n //Takes a path that contains negative indices into arrays.\n $this->assertEquals(R::path(['x', -2], json_decode('{\"x\": [\"a\", \"b\", \"c\", \"d\"]}')), 'c');\n $this->assertEquals(R::path([-1, 'y'], json_decode('[{\"x\": 1, \"y\": 99}, {\"x\": 2, \"y\": 98}, {\"x\": 3, \"y\": 97}]')), 97);\n\n $deepObject = json_decode('{\"a\": {\"b\": {\"c\": \"c\"}}, \"falseVal\": false, \"nullVal\": null, \"undefinedVal\": \"undefined\", \"arrayVal\": [\"arr\"]}');\n\n // Gets a deep property's value from objects.\n $this->assertEquals(R::path(['a', 'b', 'c'], $deepObject), 'c');\n $this->assertEquals(R::path(['a'], $deepObject), $deepObject->a);\n\n // Returns undefined for items not found.\n $this->assertEquals(R::path(['a', 'b', 'foo'], $deepObject), null);\n $this->assertEquals(R::path(['bar'], $deepObject), null);\n $this->assertEquals(R::path(['a', 'b'], json_decode('{\"a\": null}')), null);\n\n // Works with falsy items'.\n $this->assertEquals(R::path(['toString'], false), '');\n\n }",
"public function getPath($create_path = false) {\n\n if($this->option['path'] == \"\" && self::$config['path']!=\"\") {\n $this->option(\"path\", self::$config['path']);\n }\n\n\n if ($this->option['path'] =='')\n {\n // revision 618\n if($this->isPHPModule()) {\n $tmp_dir = ini_get('upload_tmp_dir') ? ini_get('upload_tmp_dir') : sys_get_temp_dir();\n $this->option(\"path\",$tmp_dir);\n\n } else {\n $this->option(\"path\", dirname(__FILE__));\n }\n\n if(self::$config['path'] == \"\") {\n self::$config['path']= $this->option(\"path\");\n }\n\n }\n\n\n $full_path = $this->option(\"path\").DIRECTORY_SEPARATOR.$this->option(\"securityKey\").DIRECTORY_SEPARATOR;\n\n if($create_path == false && $this->checked['path'] == false) {\n\n clearstatcache(TRUE, $full_path);\n if(!file_exists($full_path) || !is_writable($full_path)) {\n if(!file_exists($full_path)) {\n @mkdir($full_path,0777);\n }\n if(!is_writable($full_path)) {\n @chmod($full_path,0777);\n }\n clearstatcache(TRUE, $full_path);\n if(!file_exists($full_path) || !is_writable($full_path)) {\n return false;\n }\n }\n\n\n $this->checked['path'] = true;\n $this->htaccessGen($full_path);\n }\n\n $this->option['cachePath'] = $full_path;\n return $this->option['cachePath'];\n }",
"public function getIsAbsolutePath() {}",
"public function exists($path)\n\t{\n\t\t// Split up the path.\n\t\t$path = explode('/', $path);\n\n\t\t// Start with a base array.\n\t\t$array = $this->array;\n\n\t\t// For each element in the path.\n\t\tforeach ($path as $el)\n\t\t{\n\t\t\t// Deal with sets....\n\t\t\t$el_strpos = strpos($el, '[');\n\n\t\t\tif ($el_strpos !== false)\n\t\t\t{\n\t\t\t\t$lvl = (int) substr($el, $el_strpos + 1);\n\t\t\t\t$el = substr($el, 0, $el_strpos);\n\t\t\t}\n\t\t\t// Find an attribute.\n\t\t\telseif (substr($el, 0, 1) === '@')\n\t\t\t{\n\t\t\t\treturn isset($array[$el]);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$lvl = null;\n\t\t\t}\n\n\t\t\t// Find this element.\n\t\t\t$array = $this->_path($array, $el, $lvl, true);\n\t\t}\n\n\t\treturn $array !== false;\n\t}",
"public function path($path = null);",
"public function path($path = null);",
"private function allowedPath(array $path)\n {\n \n $findParam = $this->findRequestParam();\n \n $param1 = (is_array($findParam) && array_key_exists(0, $findParam)) ? $findParam[0] : '';\n \n if (!(in_array($this->findRequestPath(0), $path, true) || (in_array($param1, $path, true)))) {\n\n return false; \n \n } else {\n\n return true;\n\n }\n\n }",
"public function makePath($a, $b, $ds = DIRECTORY_SEPARATOR) {\n\t\treturn $this->cleanPath($a . $ds . $b, $ds);\n\t}",
"private static function resolveByDotNotation( array $array, $path, $default = null ) {\n\t\t$current = $array;\n\t\t$p = strtok( $path, '.' );\n\n\t\twhile ( $p !== false ) {\n\t\t\tif ( ! isset( $current[ $p ] ) ) {\n\t\t\t\treturn $default;\n\t\t\t}\n\t\t\t$current = $current[ $p ];\n\t\t\t$p = strtok( '.' );\n\t\t}\n\n\t\treturn $current;\n\t}",
"private function & refArrayItemByPath(& $array)\n\t{\n\t\t$p = & $array;\n\t\t$argc = func_num_args();\n\t\tfor ($i = 1; $i < $argc; $i++) {\n\t\t\t$k = func_get_arg($i);\n\t\t\tif ($k === null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (is_array($k)) {\n\t\t\t\tforeach ($k as $kk) {\n\t\t\t\t\tif (!isset($p[$kk])) {\n\t\t\t\t\t\t$p[$kk] = array();\n\t\t\t\t\t}\n\t\t\t\t\t$p = & $p[$kk];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (!isset($p[$k])) {\n\t\t\t\t\t$p[$k] = array();\n\t\t\t\t}\n\t\t\t\t$p = & $p[$k];\n\t\t\t}\n\t\t}\n\n\t\treturn $p;\n\t}",
"public function validPathStrDataProvider() {}",
"public function exists($path);",
"public static function setPath( & $array, $keys, $value )\n\t{\n\t\twhile ( count( $keys ) > 1 ) {\n\t\t\t$key = array_shift( $keys );\n\n\t\t\tif ( ctype_digit( $key ) ) {\n\t\t\t\t// Make the key an integer\n\t\t\t\t$key = (int)$key;\n\t\t\t}\n\n\t\t\tif ( !isset( $array[$key] ) ) {\n\t\t\t\t$array[$key] = array();\n\t\t\t}\n\n\t\t\t$array = & $array[$key];\n\t\t}\n\n\t\t// Set key on inner-most array\n\t\t$array[array_shift( $keys )] = $value;\n\t}",
"public function getRealPath(Array $values = array()) {\n if (empty($values)) {\n $path = str_replace('/', '\\/', $this->path);\n $values = array_fill_keys($this->getParameters(), '[\\w]+');\n } else {\n \n $path = $this->path;\n $values = array_combine($this->getParameters(), $values);\n }\n\n // Replace the reqular expressions\n foreach ($values as $key => $value) {\n $path = str_replace($key, $value, $path);\n }\n\n return $path;\n }",
"function getPathArray($mixedPath) {\r\n\t$toReturn = array();\r\n\t\r\n\t$matchResult = preg_match('/^[\\\\\\\\|\\/]+/', $mixedPath);\r\n\t\r\n\tif ($matchResult != 0) {\r\n\t\t$toReturn[] = DS; // add / or \\ to beginning of path if that is intended.\r\n\t}\r\n\t\r\n\t$splitPath = spliti('[/\\]', $mixedPath);\r\n\t\r\n\tfor ($i = 0; $i < count($splitPath)-1; ++$i) {\r\n\t\t$toReturn[] = $splitPath[$i]; // add all the directories minus the filename.\r\n\t}\r\n\t\r\n\treturn $toReturn;\r\n}",
"private function _doDirectMatch(array $path) {}",
"private static function printPath(?array $path = null)\n {\n }",
"public function testDir_ArrayPath_Arg0IsPathAndArgExt()\n {\n $config = new Config_Dir(array($this->dir, 'ext'=>'mock'));\n $this->checkWithResult($config);\n }",
"function truepath($path){\n $unipath=strlen($path)==0 || $path[0]!='/';\n // attempts to detect if path is relative in which case, add cwd\n if(strpos($path,':')===false && $unipath)\n $path=getcwd().DIRECTORY_SEPARATOR.$path;\n // resolve path parts (single dot, double dot and double delimiters)\n $path = str_replace(array('/', '\\\\'), DIRECTORY_SEPARATOR, $path);\n $parts = array_filter(explode(DIRECTORY_SEPARATOR, $path), 'strlen');\n $absolutes = array();\n foreach ($parts as $part) {\n if ('.' == $part) continue;\n if ('..' == $part) {\n array_pop($absolutes);\n } else {\n $absolutes[] = $part;\n }\n }\n $path=implode(DIRECTORY_SEPARATOR, $absolutes);\n // resolve any symlinks\n if(file_exists($path) && linkinfo($path)>0)$path=readlink($path);\n // put initial separator that could have been lost\n $path=!$unipath ? '/'.$path : $path;\n return $path;\n}",
"function path_res ($path) {\r\n\tif (file_exists(DIR_RES.$path)) {\r\n\t\t$path = DIR_RES.$path;\r\n\t} else {\r\n\t\t$path = \"no file $path\";\r\n\t}\r\n\treturn $path;\r\n}",
"public function testGetUniquePath(): void\n {\n $result = $this->phpcrMapper->getUniquePath('/products/machines', 'sulu_io', 'de');\n $this->assertEquals('/products/machines-2', $result);\n $this->assertTrue($this->phpcrMapper->unique($result, 'sulu_io', 'de'));\n\n // drill & drill-1 exists\n $result = $this->phpcrMapper->getUniquePath('/products/machines/drill', 'sulu_io', 'de');\n $this->assertEquals('/products/machines/drill-2', $result);\n $this->assertTrue($this->phpcrMapper->unique($result, 'sulu_io', 'de'));\n\n // products exists\n $result = $this->phpcrMapper->getUniquePath('/products', 'sulu_io', 'de');\n $this->assertEquals('/products-1', $result);\n $this->assertTrue($this->phpcrMapper->unique($result, 'sulu_io', 'de'));\n\n // news not exists\n $result = $this->phpcrMapper->getUniquePath('/news', 'sulu_io', 'de');\n $this->assertEquals('/news', $result);\n $this->assertTrue($this->phpcrMapper->unique($result, 'sulu_io', 'de'));\n }",
"public static function make_save_str_in($array) {\n\t\t\t$string = self::trim($array);\n\t\t\treturn $string;\n\t\t}",
"protected abstract function getPath();",
"public function arrayAddUnique($path, $value, $createParents = false) {\n $this->commands[] = array(\n 'opcode' => COUCHBASE_SDCMD_ARRAY_ADD_UNIQUE,\n 'path' => $path,\n 'value' => $value,\n 'createParents' => $createParents,\n );\n return $this;\n }",
"function findRouteGet(array &$variaveis): string\n {\n $url = \"\";\n $path = \"\";\n $count = count($variaveis);\n for ($i = 0; $i < $count; $i++) {\n $path .= ($i > 0 ? \"/{$url}\" : \"\");\n $url = array_shift($variaveis);\n foreach (\\Config\\Config::getRoutesTo(\"get\" . $path) as $item) {\n if (file_exists($item . $url . \".php\"))\n return $item . $url . \".php\";\n }\n }\n\n return \"\";\n }",
"public function insertByPath(&$curr_node, $path='', $array=null)\n {\n if (is_string($path)) {\n $p = explode('/', $path);\n $n = array_shift($p);\n if ($curr_node instanceof Node) {\n $curr_name = $curr_node->getName();\n }\n if ($curr_name === $n) {\n if (isset($p[0])) {\n $n = $p[0];\n }\n if ($next_node = $curr_node->getNode($n)) {\n $next_node = $next_node;\n } else {\n $next_node = $curr_node;\n }\n \n } else {\n $new_node = self::build($n);\n $new_node->setData($array);\n $curr_node->insert($new_node);\n $next_node = $new_node;\n }\n if ($n !== '') {\n $remaining_path = implode('/', $p);\n while (count($p) > 0) {\n return $this->insertByPath($next_node, $remaining_path, $array);\n }\n }\n }\n }",
"public function testWithPathInvalidArray()\n {\n $uri = $this->getUriForTest();\n $uri->withPath(['/foo/bar']);\n }",
"private function getPathConfig($path=null) {\n $pathCons = null;\n if (!is_null($path)){\n $pathCons = $path;\n } elseif (count($this->config)>0) {\n $pathCons = array_first($this->config())['path'];\n }\n return str_replace(\"\\\\\",\"/\", $pathCons);\n }",
"private static function getPath($path) {\n if ($path == 'image') $addr = self::IMAGE_PATH;\n elseif ($path == 'album') $addr = self::ALBUM_PATH;\n elseif ($path == 'rates') $addr = self::RATES_PATH;\n else {\n Print 'Path was not recognized.';\n Die;\n }\n\n Return self::API_PATH . $addr;\n }",
"public function path($path, $return_full = false)\n\t{\n\t\t// Split up the path.\n\t\t$path = explode('/', $path);\n\n\t\t// Start with a base array.\n\t\t$array = $this->array;\n\n\t\t// For each element in the path.\n\t\tforeach ($path as $el)\n\t\t{\n\t\t\t// Deal with sets....\n\t\t\tif (strpos($el, '[') !== false)\n\t\t\t{\n\t\t\t\t$lvl = (int) substr($el, strpos($el, '[') + 1);\n\t\t\t\t$el = substr($el, 0, strpos($el, '['));\n\t\t\t}\n\t\t\t// Find an attribute.\n\t\t\telseif (substr($el, 0, 1) === '@')\n\t\t\t{\n\t\t\t\t// It simplifies things if the attribute is already there ;).\n\t\t\t\tif (isset($array[$el]))\n\t\t\t\t{\n\t\t\t\t\treturn $array[$el];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);\n\t\t\t\t\t$i = 0;\n\t\t\t\t\twhile ($i < count($trace) && isset($trace[$i]['class']) && $trace[$i]['class'] == get_class($this))\n\t\t\t\t\t{\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t\t$debug = ' from ' . $trace[$i - 1]['file'] . ' on line ' . $trace[$i - 1]['line'];\n\n\t\t\t\t\t// Cause an error.\n\t\t\t\t\tif (($this->debug_level & E_NOTICE) !== 0)\n\t\t\t\t\t{\n\t\t\t\t\t\ttrigger_error('Undefined XML attribute: ' . substr($el, 1) . $debug, E_USER_NOTICE);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$lvl = null;\n\t\t\t}\n\n\t\t\t// Find this element.\n\t\t\t$array = $this->_path($array, $el, $lvl);\n\t\t}\n\n\t\t// Clean up after $lvl, for $return_full.\n\t\tif ($return_full && (!isset($array['name']) || substr($array['name'], -1) !== ']'))\n\t\t{\n\t\t\t$array = array('name' => $el . '[]', $array);\n\t\t}\n\n\t\t// Create the right type of class...\n\t\t$newClass = get_class($this);\n\n\t\t// Return a new \\ElkArte\\XmlArray for the result.\n\t\treturn $array === false ? false : new $newClass($array, $this->trim, $this->debug_level, true);\n\t}",
"function _wp_array_get($input_array, $path, $default_value = \\null)\n {\n }",
"function directory_exploder($input)\n{\n if (is_array($input)) {\n $return = [];\n foreach ($input as $path) {\n array_push($return, explode(DIRECTORY_SEPARATOR, $path));\n }\n } else {\n $return = explode(DIRECTORY_SEPARATOR, $input);\n }\n return $return;\n}",
"protected function _checkPath()\n {\n if (class_exists('tracer_class')) {\n tracer_class::marker(array(\n 'check that path is given on error or normal page',\n debug_backtrace(),\n '#006400'\n ));\n }\n\n $path = array();\n\n if ($this->_get) {\n $path[0] = $this->_get->path();\n $path[1] = $this->_get->path(TRUE);\n } else {\n $path[0] = $path[1] = get::realPath($this->_options['test']);\n }\n\n return $path;\n }"
] | [
"0.6308871",
"0.6159034",
"0.5989001",
"0.593621",
"0.59325856",
"0.5919715",
"0.5820442",
"0.57614005",
"0.57301354",
"0.572789",
"0.564101",
"0.55868685",
"0.5580734",
"0.55511594",
"0.554611",
"0.55447173",
"0.5527763",
"0.5510852",
"0.5499492",
"0.5491391",
"0.5487691",
"0.5482353",
"0.54516685",
"0.54405516",
"0.5417448",
"0.5371869",
"0.5370407",
"0.5353398",
"0.53505105",
"0.5337119",
"0.52989775",
"0.5283036",
"0.5279539",
"0.52777636",
"0.52650833",
"0.52623916",
"0.5252935",
"0.5235732",
"0.52065176",
"0.52011806",
"0.5189329",
"0.51883245",
"0.5179757",
"0.51531345",
"0.51093256",
"0.5104516",
"0.50998294",
"0.50967103",
"0.50837344",
"0.50788563",
"0.5075024",
"0.5074687",
"0.50738525",
"0.507292",
"0.5068047",
"0.5060828",
"0.50600994",
"0.5050614",
"0.5048083",
"0.50477517",
"0.50356936",
"0.5023894",
"0.501854",
"0.5013346",
"0.5007907",
"0.4991255",
"0.49864233",
"0.4984284",
"0.49804017",
"0.49803558",
"0.49762705",
"0.49612623",
"0.49612623",
"0.49589854",
"0.49535477",
"0.49442947",
"0.49428356",
"0.4941612",
"0.4934004",
"0.49288067",
"0.49270597",
"0.49263522",
"0.49054095",
"0.48981366",
"0.48961228",
"0.4895705",
"0.4894596",
"0.48878038",
"0.48841426",
"0.48835716",
"0.48828515",
"0.4874843",
"0.48687395",
"0.4867612",
"0.48647064",
"0.4864447",
"0.48534632",
"0.48506013",
"0.48481804",
"0.4843976"
] | 0.67370176 | 0 |
Make namespace from array, can check if exists return path if true | public static function makeNamespace(string $file, bool $withCheck = false): string|false
{
$file = str_replace([app()->get('path:app'), '.php', '/'], ['App', '', '\\'], $file);
$file = trim($file, '\/');
if ($withCheck) {
if (!class_exists($file)) {
return false;
}
}
return $file;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mdl_find_namespace_component(array $values, $name)\n{\n foreach ($values as $value) {\n $directory = $value['directory'] ?? null;\n $local_name = isset($value['name']) ? preg_replace(\"/\\s+/\", \"\", $value['name']) : null;\n if (null === $local_name) {\n continue;\n }\n if (trim($directory ? mdl_create_sub_namespace('', $directory) . \"\\\\\" . $local_name : $local_name, '\\\\') === trim($name, '\\\\')) {\n return $value;\n }\n }\n return false;\n}",
"function mdl_create_sub_namespace(string $base, string $directory)\n{\n return rtrim($base, \"\\\\\") . \"\\\\\" . implode(\"\\\\\", explode('/', $directory ?? ''));\n}",
"function path_to_namespace($path)\n {\n\t $stripped = preg_replace(\"#\".app_path().\"/#uism\", config('melon.app_name', 'App') . \"\\\\\", dirname($path));\n\n\t return str_replace('/', '\\\\', $stripped);\n }",
"abstract protected function registerNamespaces();",
"function mdl_create_namespace(array $definition, bool $strict = true, bool $setters = false, bool $getters = false)\n{\n $path = $definition['path'] ?? './src';\n $namespace = preg_replace(\"/\\s+/\", \"\", str_replace(\"\\\\\\\\\", \"\\\\\", $definition['name'] ?? 'App'));\n // TODO : Add interface method to class if interface is in namespace\n $blueprint_definitions = isset($definition['directories']['classes']) ? array_map(function ($class_definition) use ($definition) {\n return mdl_set_component_directory($class_definition, $definition['directories']['classes']);\n }, mdl_array_wrap($definition['classes'] ?? [])) : mdl_array_wrap($definition['classes'] ?? []);\n $interface_definitions = isset($definition['directories']['interfaces']) ? array_map(function ($interface) use ($definition) {\n return mdl_set_component_directory($interface, $definition['directories']['interfaces']);\n }, mdl_array_wrap($definition['interfaces'] ?? [])) : mdl_array_wrap($definition['interfaces'] ?? []);\n $mixin_definitions = isset($definition['directories']['mixins']) ? array_map(function ($mixins) use ($definition) {\n return mdl_set_component_directory($mixins, $definition['directories']['mixins']);\n }, mdl_array_wrap($definition['mixins'] ?? [])) : mdl_array_wrap($definition['mixins'] ?? []);\n $blueprint_definitions = array_map(function ($blueprint) use ($interface_definitions, $blueprint_definitions, $mixin_definitions, $namespace) {\n // #region Rewrite extended class path\n $extends = isset($blueprint['extends']) ? (is_array($blueprint['extends']) ? array_values($blueprint['extends'])[0] : $blueprint['extends']) : null;\n // #endregion Rewrite extended class path\n if ($blueprint['abstract'] ?? false) {\n return mdl_fix_class_import_paths(\n $namespace,\n $blueprint,\n $blueprint_definitions,\n $mixin_definitions,\n $interface_definitions,\n $extends\n );\n }\n $methods = [];\n $mixin_methods = [];\n $mixin_properties = [];\n // #region Find mixin methods that might be excluded from class inherited method definitions\n if (isset($blueprint['mixins'])) {\n foreach ($blueprint['mixins'] as $mixin_name) {\n if (!is_string($mixin_name)) {\n continue;\n }\n mdl_find_mixing_methods($mixin_name, $mixin_definitions, $mixin_methods);\n mdl_find_mixing_properties($mixin_name, $mixin_definitions, $mixin_properties);\n }\n }\n // #endregion Find mixin methods that might be excluded from class inherited method definitions\n\n // #region Merge the extended class implementation with the current class implementations\n $iterable = mdl_array_wrap($blueprint['implements'] ?? []);\n if ($extends) {\n mdl_resolve_base_class_implementations($extends, $blueprint_definitions, $iterable);\n }\n // #endregion Merge the extended class implementation with the current class implementations\n mdl_resolve_interface_methods($iterable, $interface_definitions, $mixin_methods, $methods);\n $blueprint['methods'] = array_merge($blueprint['methods'] ?? [], $methods);\n $blueprint['mixin_properties'] = $mixin_properties;\n return mdl_fix_class_import_paths(\n $namespace,\n $blueprint,\n $blueprint_definitions,\n $mixin_definitions,\n $interface_definitions,\n $extends\n );\n }, $blueprint_definitions);\n\n $mixins = $mixin_definitions ? array_map(function ($mixin) use ($path, $namespace, $strict, $setters, $getters) {\n // TODO : Validate the component\n return mdl_create_component_source(\n mdl_create_mixin(mdl_component_fix_duplicate_members($mixin), $setters, $getters),\n $path,\n $namespace,\n $mixin['directory'] ?? null,\n $strict\n );\n }, array_map(function ($mixin) use ($namespace, $mixin_definitions) {\n return mdl_fix_trait_import_paths($namespace, $mixin, $mixin_definitions);\n }, $mixin_definitions)) : [];\n\n printf(\"\\nCompiling component, please wait...\\n\");\n\n $implementations = $interface_definitions ? array_map(function ($interface) use ($path, $namespace, $strict) {\n // TODO : Validate the component\n return mdl_create_component_source(\n mdl_create_interface(\n mdl_component_fix_duplicate_members($interface)\n ),\n $path,\n $namespace,\n $interface['directory'] ?? null,\n $strict\n );\n }, array_map(function ($current) use ($namespace, $interface_definitions) {\n return mdl_fix_interface_import_paths($namespace, $current, $interface_definitions);\n }, $interface_definitions)) : [];\n\n $classes = $blueprint_definitions ? array_map(function ($class) use ($path, $namespace, $strict, $setters, $getters) {\n // TODO : Validate the component\n return mdl_create_component_source(\n mdl_create_class(mdl_component_fix_duplicate_members($class), $setters, $getters),\n $path,\n $namespace,\n $class['directory'] ?? null,\n $strict\n );\n }, $blueprint_definitions) : [];\n\n // Merged the generated components\n $components = array_merge($mixins, $implementations, $classes);\n\n printf(\"\\nWriting component, to disk...\");\n\n // # Write compiled component to disk\n foreach ($components as $value) {\n mdl_write_component_to_disk($value);\n printf(\".\");\n }\n printf(\"\\n\");\n}",
"function addNamespaces(array $namespaces);",
"abstract protected function namespace(): string;",
"public function addMap($prefix, $paths, $prepend = false)\n\t{\n\t\tif ($prefix)\n\t\t{\n\t\t\t$prefix = ltrim($prefix, '\\\\');\n\t\t}\n\n\t\tif (!$prefix)\n\t\t{\n\t\t\t// Register directories for the root namespace.\n\t\t\tif ($prepend)\n\t\t\t{\n\t\t\t\t$this->fallbackDirs = array_merge(\n\t\t\t\t\t(array) $paths,\n\t\t\t\t\t$this->fallbackDirs\n\t\t\t\t);\n\n\t\t\t\t$this->fallbackDirs = array_unique($this->fallbackDirs);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->fallbackDirs = array_merge(\n\t\t\t\t\t$this->fallbackDirs,\n\t\t\t\t\t(array) $paths\n\t\t\t\t);\n\n\t\t\t\t$this->fallbackDirs = array_unique($this->fallbackDirs);\n\t\t\t}\n\t\t}\n\t\telseif (!isset($this->prefixDirs[$prefix]))\n\t\t{\n\t\t\t// Register directories for a new namespace.\n\t\t\t$length = strlen($prefix);\n\t\t\tif ('\\\\' !== $prefix[$length - 1])\n\t\t\t{\n\t\t\t\tthrow new InvalidArgumentException(\"A non-empty PSR-4 prefix must end with a namespace separator.\");\n\t\t\t}\n\t\t\t$this->prefixLengths[$prefix[0]][$prefix] = $length;\n\t\t\t$this->prefixDirs[$prefix] = (array) $paths;\n\t\t}\n\t\telseif ($prepend)\n\t\t{\n\t\t\t// Prepend directories for an already registered namespace.\n\t\t\t$this->prefixDirs[$prefix] = array_merge(\n\t\t\t\t(array) $paths,\n\t\t\t\t$this->prefixDirs[$prefix]\n\t\t\t);\n\n\t\t\t$this->prefixDirs[$prefix] = array_unique($this->prefixDirs[$prefix]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Append directories for an already registered namespace.\n\t\t\t$this->prefixDirs[$prefix] = array_merge(\n\t\t\t\t$this->prefixDirs[$prefix],\n\t\t\t\t(array) $paths\n\t\t\t);\n\n\t\t\t$this->prefixDirs[$prefix] = array_unique($this->prefixDirs[$prefix]);\n\t\t}\n\n\t\treturn $this;\n\t}",
"function generateNamespace($uri)\r\n\t{\r\n\t\t// QUESTION: should we try to make shorter namespaces using humpback?\r\n\t\t$className = 'phase_';\r\n\r\n\t\t$info = pathinfo(substr($uri, 1));\r\n\t\t$dirname = ltrim($info['dirname'], '.');\r\n\t\tif (strlen($dirname) > 0) {\r\n\t\t\t$className .= str_replace('/', '_', $dirname) . '_';\r\n\t\t}\r\n\r\n\t\t$className .= basename($uri, '.' . $info['extension']);\r\n\t\t// make sure we don't have an invalid name\r\n\t\t$className = preg_replace('/[^A-Za-z0-9_]/', '_', $className);\r\n\t\treturn $className;\r\n\t}",
"public function getFactoryNamespace();",
"function addNamespace($namespace);",
"public function getNamespaceFromDirectories(array $directories): array;",
"public function getNamespace()\n {\n if ($this->getBackend()->hasCapability('NAMESPACE') === true) {\n $namespaces = array();\n foreach ($this->getBackend()->getNamespace() as $type => $elements) {\n foreach ($elements as $namespace) {\n switch ($type) {\n case 'others':\n $namespace['type'] = 'other';\n break;\n default:\n $namespace['type'] = $type;\n break;\n }\n $namespace['delimiter'] = $namespace['delimter'];\n $namespaces[] = $namespace;\n }\n }\n return new Horde_Kolab_Storage_Folder_Namespace_Imap(\n $this->getAuth(),\n $namespaces,\n $this->getParam('namespaces', array())\n );\n }\n return parent::getNamespace();\n }",
"function classExistsInNamespaces($class);",
"private function mkpath($path){\n $dirs=array();\n $path=preg_replace('/(\\/){2,}|(\\\\\\){1,}/','/',$path);\n $dirs=explode(\"/\",$path);\n $path=\"\";\n foreach ($dirs as $element){\n $path.=$element.\"/\";\n if(!is_dir($path)){ \n if(!mkdir($path)){ \n return false; \n }\n } \n }\n }",
"public static function generateNameSpaceByPath(string $path):string{\n $parentNamespaces = self::getParentNameSpaces($path);\n $path = explode(DIRECTORY_SEPARATOR,$path);\n $result = '';\n $number = null;\n foreach($path as $num => $subPath){\n foreach($parentNamespaces as $key =>$parentNamespace){\n if($subPath == $parentNamespace){\n $number = $num;\n $result = $key;\n }\n }\n }\n if($result == ''){\n throw new Exception('Wrond Path');\n } else {\n for($i = $number + 1; $i < count($path); ++$i){\n $result .= \"\\\\\".$path[$i];\n }\n }\n return $result;\n }",
"public function add(string $path, string $namespace): self;",
"function namespace_to_path($namespace, $file = null)\n {\n\t $prefixed = preg_replace(\"#^\" . $this->getRoot() . \"#uism\", app_path(), $namespace);\n\n\t return trim(str_replace('\\\\', '/', $prefixed) . '/' . $file, '/');\n }",
"public function GetControllerHasAbsoluteNamespace ();",
"function getNamespace ();",
"function getNamespace();",
"function getNamespace();",
"function resolve_namespaces(array $pathes, $vendor = null)\n { \n $namespaces = [];\n\n foreach ((array) $pathes as $namespace => $path) { \n $namespace = studly_case($namespace); \n $vendor = studly_case($vendor ?? app()->getNamespace());\n // register classes with namespaces\n $namespaces[\"{$vendor}\\\\{$namespace}\\\\\"] = $path; \n } \n\n \\Helper::resolvePsr4($namespaces);\n }",
"public static function prefixForUri($uri, $alwaysCreate = false)\n\t{\n\t\tself::registerPrefixes();\n\t\t$uri = strval($uri);\n\t\tif(isset(self::$namespaces[$uri]))\n\t\t{\n\t\t\treturn self::$namespaces[$uri];\n\t\t}\n\t\tif($alwaysCreate)\n\t\t{\n\t\t\t$prefix = 'ns' . count(self::$namespaces);\n\t\t\tself::$namespaces[$uri] = $prefix;\n\t\t\treturn $prefix;\n\t\t}\n\t\treturn null;\n\t}",
"private function updateNamespace(): void\n {\n //now path is totally sorted, update namespace based on path\n foreach ($this->filesCreated as $filePath) {\n $this->findAndReplaceHelper->setNamespaceFromPath(\n $filePath,\n $this->srcSubFolderName,\n $this->projectRootNamespace\n );\n }\n }",
"public function create(string $appNamespace): void;",
"public function addNamespacePaths($namespace, $paths, $prepend = false)\n {\n $paths = is_array($paths) ? $paths : [$paths];\n\n if ($this->namespaceIsKnown($namespace)) {\n $paths = $prepend\n ? array_merge($paths, $this->namespacePaths[$namespace])\n : array_merge($this->namespacePaths[$namespace], $paths);\n }\n\n $this->namespacePaths[$namespace] = $paths;\n\n return $this;\n }",
"public function getNamespace();",
"public function getNamespace();",
"public function getNamespace();",
"function createAlbum($inputArr) {\n \n $ro = new BaseRO();\n $aname = $inputArr[\"name\"];\n\n $oldumask = umask(0); \n $ro->success = mkdir(\"Pics/$aname\", 0777);\n if (!($ro->success)) {\n $ro->retcode = 2;\n }\n umask($oldumask); \n\n return $ro;\n}",
"public function setMap($prefix, $paths)\n\t{\n\t\tif ($prefix)\n\t\t{\n\t\t\t$prefix = ltrim($prefix, '\\\\');\n\t\t}\n\n\t\tif (!$prefix)\n\t\t{\n\t\t\t$this->fallbackDirs = (array) $paths;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$length = strlen($prefix);\n\t\t\tif ('\\\\' !== $prefix[$length - 1])\n\t\t\t{\n\t\t\t\tthrow new InvalidArgumentException(\"A non-empty PSR-4 prefix must end with a namespace separator.\");\n\t\t\t}\n\t\t\t$this->prefixLengths[$prefix[0]][$prefix] = $length;\n\t\t\t$this->prefixDirs[$prefix] = (array) $paths;\n\t\t}\n\t}",
"public function testConstructSingleArrayDirectory()\n {\n $filter = new FileRename([\n 'source' => $this->oldFile,\n 'target' => $this->newDir]);\n\n $this->assertEquals(\n [0 => [\n 'source' => $this->oldFile,\n 'target' => $this->newDir,\n 'overwrite' => false,\n 'randomize' => false,\n ]],\n $filter->getFile()\n );\n $this->assertEquals($this->newDirFile, $filter($this->oldFile));\n $this->assertEquals('falsefile', $filter('falsefile'));\n }",
"function setNamespace ($name);",
"function array_path($array, $path, $default = null) {\n $path = explode('.', $path);\n while ($key = array_shift($path)) {\n if (!isset($array[$key])) return $default;\n $array = $array[$key];\n }\n return $array;\n}",
"public function validateNamespace()\r\n {\r\n $this->ns = ltrim($this->ns, '\\\\');\r\n $path = Az::getAlias('@' . str_replace('\\\\', '/', $this->ns), false);\r\n if ($path === false) {\r\n $this->addError('ns', 'Namespace must be associated with an existing directory.');\r\n }\r\n }",
"public function classNamespace() {}",
"function directory( $array = [], $root = false )\n{\n if ( $root )\n $start = __DIR__ . DIRECTORY_SEPARATOR;\n else\n $start = '';\n \n return $start . implode( DIRECTORY_SEPARATOR, $array );\n}",
"function getNamespacePrefix(String $var1, String $var2): String;",
"public function testSameNamespace(): void\n {\n $importing = new Importing(__NAMESPACE__);\n $importing->addClass(__NAMESPACE__.'\\\\ClassOne');\n $importing->addClass(__NAMESPACE__.'\\\\ClassTwo');\n $importing->addClass(__NAMESPACE__.'\\\\ClassThree');\n $importing->addClass('\\\\Throwable');\n\n $importing->prepare();\n\n self::assertSame([], $importing->imports());\n\n $expected = ['\\\\'.__NAMESPACE__.'\\\\ClassThree' => 'ClassThree',\n '\\\\'.__NAMESPACE__.'\\\\ClassOne' => 'ClassOne',\n '\\\\'.__NAMESPACE__.'\\\\ClassTwo' => 'ClassTwo'];\n\n self::assertSame($expected, $importing->replacePairs());\n\n self::assertSame('ClassOne', $importing->simplyFullyQualifiedName(__NAMESPACE__.'\\\\ClassOne'));\n self::assertSame('ClassTwo', $importing->simplyFullyQualifiedName(__NAMESPACE__.'\\\\ClassTwo'));\n self::assertSame('ClassThree', $importing->simplyFullyQualifiedName(__NAMESPACE__.'\\\\ClassThree'));\n self::assertSame('\\\\Throwable', $importing->simplyFullyQualifiedName('\\\\Throwable'));\n }",
"protected abstract function _getNamespaces();",
"function check_create($name) {\n global $lsarray;\n if (!in_array($name, $lsarray)) { mkdir($name); return true; }\n else { echo \"Folder already exists: $name\".PHP_EOL; return false; }\n}",
"public function testGetNamespacesForClass()\n {\n $lookup = new Lookup;\n $lookup->setUpgraderMap(array(\n 'DataExtension' => 'SilverStripe\\ORM\\DataExtension',\n 'SiteTree' => 'SilverStripe\\CMS\\Model\\SiteTree',\n 'Director' => 'SilverStripe\\Control\\Director'\n ));\n\n $this->assertSame('SilverStripe\\ORM\\DataExtension', $lookup->getWithNamespace('DataExtension', false));\n $this->assertSame('SilverStripe\\CMS\\Model\\SiteTree', $lookup->getWithNamespace('SiteTree', false));\n $this->assertSame('SilverStripe\\Control\\Director', $lookup->getWithNamespace('Director', false));\n $this->assertSame('SilverStripe.Control.Director', $lookup->getWithNamespace('Director', true));\n }",
"private static function resolveByDotNotation( array $array, $path, $default = null ) {\n\t\t$current = $array;\n\t\t$p = strtok( $path, '.' );\n\n\t\twhile ( $p !== false ) {\n\t\t\tif ( ! isset( $current[ $p ] ) ) {\n\t\t\t\treturn $default;\n\t\t\t}\n\t\t\t$current = $current[ $p ];\n\t\t\t$p = strtok( '.' );\n\t\t}\n\n\t\treturn $current;\n\t}",
"public static function splitUri($uri, $createNamespace = false)\n {\n if ($uri === null or $uri === '') {\n throw new \\InvalidArgumentException(\n \"\\$uri cannot be null or empty\"\n );\n }\n\n if (is_object($uri) and ($uri instanceof Resource)) {\n $uri = $uri->getUri();\n } elseif (!is_string($uri)) {\n throw new \\InvalidArgumentException(\n '$uri should be a string or EasyRdf\\Resource'\n );\n }\n\n foreach (self::namespaces() as $prefix => $long) {\n if (substr($uri, 0, strlen($long)) !== $long) {\n continue;\n }\n\n $local_part = substr($uri, strlen($long));\n\n if (strpos($local_part, '/') !== false) {\n // we can't have '/' in local part\n continue;\n }\n\n return array($prefix, $local_part);\n }\n\n if ($createNamespace) {\n // Try and create a new namespace\n # FIXME: check the valid characters for an XML element name\n if (preg_match('/^(.+?)([\\w\\-]+)$/', $uri, $matches)) {\n $prefix = \"ns\".(self::$anonymousNamespaceCount++);\n self::set($prefix, $matches[1]);\n return array($prefix, $matches[2]);\n }\n }\n\n return null;\n }",
"public function createNamespace(Request $request, Project $project) {\n\n $this->validate($request, [\n 'name' => 'required'\n ]);\n\n if(!Auth::user()->projects()->find($project->id)) {\n\n return response()->json([], 404);\n }\n\n $requestArray = $request->all();\n\n if ($project->namespaces()->where('name', $requestArray['name'])->first()) {\n\n return response([], 409);\n }\n\n $namespace = $project->namespaces()->create($requestArray);\n\n return response()->json($namespace, 201);\n }",
"public function canSetLocalNamespace();",
"public function getNamespacePrefix($index);",
"public function testKeywordNamespaceNameGeneration()\n {\n // More dummy configuration. The important part is the namespace.\n $config = new Config([\n 'inputFile' => null,\n 'outputDir' => null,\n 'namespaceName' => $this->namespace,\n ]);\n // Iterator is an existing interface.\n $complexType = new ComplexType($config, 'Iterator');\n $this->generateClass($complexType, $this->namespace);\n $this->assertClassExists('Iterator', $this->namespace);\n\n // stdClass is an existing class name.\n $complexType = new ComplexType($config, 'stdClass');\n $this->generateClass($complexType, $this->namespace);\n $this->assertClassExists('stdClass', $this->namespace);\n }",
"protected function makeDetector(): NamespaceDetectorInterface\n {\n return new NamespaceDetector();\n }",
"public static function toNamespace($path) {\n $path = static::ds(static::stripExt($path));\n\n // Attempt to split path at source folder\n foreach (array('lib', 'src') as $folder) {\n if (mb_strpos($path, $folder . static::SEPARATOR) !== false) {\n $paths = explode($folder . static::SEPARATOR, $path);\n $path = $paths[1];\n }\n }\n\n return trim(str_replace('/', static::PACKAGE, $path), static::PACKAGE);\n }",
"private function extractNamespaceFromTokens(array $tokens)\n {\n $namespace = [];\n for ($i = 0; $i < count($tokens); $i++) {\n $token = $tokens[ $i ];\n $isNamespace = is_array($token) &&\n T_NAMESPACE === $token[ 0 ];\n if (!$isNamespace) {\n continue;\n }\n\n $i += 1;\n while ($i < count($tokens)) {\n $token = $tokens[ $i ];\n $isNamespace = is_array($token) &&\n T_STRING === $token[ 0 ];\n if ($isNamespace) {\n $namespace[] = $token[1];\n }\n\n if (!is_array($token) && $token === ';') {\n break 2;\n }\n $i += 1;\n }\n }\n\n return implode('\\\\', $namespace);\n }",
"function &set(array $value, string $namespace = 'default'): array\n{\n return arr(array_unique($value), $namespace);\n}",
"public function addPsr4AutoloadRule(string $namespace, string $path, bool $isDev = false): bool;",
"public function addNamespace($prefix, $baseDir, $prepend = false)\n\t{\n\t\t// normalise $prefix\n\t\t$prefix = trim($prefix, '\\\\').'\\\\';\n\n\t\t// normalise $prefix\n\t\t$baseDir = rtrim($baseDir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;\n\n\t\t// initialise the $prefix array within $this->prefixes\n\t\tif (isset($this->prefixes[$prefix]) === false) {\n\t\t\t$this->prefixes[$prefix] = array();\n\t\t}\n\n\t\t// add direction to $prefix array\n\t\tif ($prepend) {\n\t\t\tarray_unshift($this->prefixes[$prefix], $baseDir);\n\t\t} else {\n\t\t\tarray_push($this->prefixes[$prefix], $baseDir);\n\t\t}\n\t}",
"private function namespaceAnalyzer($uri) {\r\n static $lookup=array(\r\n\t\t\t NS_RDF => 'rdf',\r\n\t\t\t NS_DC => 'dc'\r\n\t\t\t );\r\n /*\r\n * Name ::= (Letter | '_' | ':') (NameChar)*\r\n * NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' |\r\n * @todo regexp is not accurate - missing combining chars and extenders: see XML spec\r\n * @todo make global NS asigning to avoid duplicite NS declarations\r\n */\r\n preg_match('/^(.*?)([a-zA-Z_][a-zA-Z0-9._-]*)$/', $uri, $parts);\r\n $ns=$parts[1];\r\n $name=$parts[2];\r\n $prefix=false;\r\n\r\n // Find nice NS prefix\r\n if (isset($lookup[$ns])) {\r\n $prefix=$lookup[$ns];\r\n } else {\r\n // |\\.aero|\\.biz|\\.com|\\.coop|\\.edu|\\.gov|\\.info|\\.int|\\.mil|\\.museum|\\.name|\\.net|\\.org|\\.pro|\\.arpa\r\n $prefixVariants=preg_replace('/^[a-z]{3,}:\\/\\/(?:www\\.|ns\\.|rdf\\.)?([a-z0-9.-]+?)(?:\\.[a-z]{2,3})?([^a-z0-9.-].*)$/i', '\\2 \\1', $ns);\r\n $prefixVariants='ns '.preg_replace('/\\.rdf|[^a-z][0-9]+|[a-z]+:\\/\\/|&[a-z]+;|[^a-z0-9]/i', ' ', $prefixVariants);\r\n $prefixVariants=array_reverse(split('[^a-z0-9]+', trim($prefixVariants)));\r\n $suffix='';\r\n // echo print_r($prefixVariants);\r\n do {\r\n\tforeach($prefixVariants as $variant) {\r\n\t if (!in_array($variant.$suffix, $lookup)) {\r\n\t $lookup[$ns]=$prefix=$variant.$suffix;\r\n\t break;\r\n\t }\r\n\t}\r\n\t$suffix=(int) $suffix + 1;\r\n } while(!$prefix);\r\n }\r\n // echo \"\\n\"; print_r($lookup); echo \"\\n\";\r\n return array($ns, $name, $prefix);\r\n }",
"public function getNamespaceName();",
"public function namespaceAlias() {}",
"protected function formatNamespace(array $new, array $old)\n {\n if (isset($new['namespace']) && isset($old['namespace'])) {\n return trim($old['namespace'], '\\\\').'\\\\'.trim($new['namespace'], '\\\\');\n } elseif (isset($new['namespace'])) {\n return trim($new['namespace'], '\\\\');\n }\n\n return $old['namespace'] ?? null;\n }",
"public function setFactoryNamespace($namespace);",
"public function _get_namespaces($type);",
"public function getNamespace($namespaceName);",
"public static function getParentNameSpaces(): array{\n $configs = json_decode(file_get_contents(self::$composerPath),true);\n // get only neccesary data\n $configs = $configs['autoload']['psr-4'];\n foreach($configs as $key => $value){\n unset($configs[$key]);\n $configs[stripslashes($key)] = $value;\n }\n foreach($configs as $key => $value){\n $configs[$key] = explode(DIRECTORY_SEPARATOR,$value)[0];\n }\n return $configs;\n }",
"public static function get($path) {\n $pathArray = explode('.', $path);\n $current = static::$config;\n if(static::exists($current, $pathArray[0])) {\n //check the namespace exists\n foreach($pathArray as $item) {\n if(static::exists($current, $item)) {\n $current = &$current[$item];\n }\n }\n return $current;\n }\n return null;\n }",
"public function camelizeNamespace($camelize);",
"public function register_namespace_dir($namespace, $dir)\n\t{\n\t\tif (($dir = realpath($dir))===false)\n\t\t{\n\t\t\ttrigger_error('Namespace was not registered! Directory not found', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\t\tif (!empty($namespace)) $namespace = trim($namespace, '\\\\').'\\\\';\n\t\t$this->namespaces_dirs[$namespace] = $dir.DIRECTORY_SEPARATOR;\n\t}",
"function setNamespace($namespace);",
"public function validateNamespace()\n {\n $this->ns = ltrim($this->ns, '\\\\');\n $path = Yii::getAlias('@' . str_replace('\\\\', '/', $this->ns), false);\n if ($path === false) {\n $this->addError('ns', 'Namespace must be associated with an existing directory.');\n }\n }",
"public function testConstructDoubleArrayDirectory()\n {\n $filter = new FileRename([\n 0 => [\n 'source' => $this->oldFile,\n 'target' => $this->newDir]]);\n\n $this->assertEquals(\n [0 => [\n 'source' => $this->oldFile,\n 'target' => $this->newDir,\n 'overwrite' => false,\n 'randomize' => false,\n ]],\n $filter->getFile()\n );\n $this->assertEquals($this->newDirFile, $filter($this->oldFile));\n $this->assertEquals('falsefile', $filter('falsefile'));\n }",
"public static function makePath(array $path, bool $withCheck = false): string|false\n {\n $path = array_filter($path, fn($p) => $p);\n $path = array_map(fn($p) => trim($p, '\\/'), $path);\n $res = join(DIRECTORY_SEPARATOR, $path);\n if ($withCheck) {\n if (!file_exists($res) && !is_dir($res)) {\n return false;\n }\n }\n return $res;\n }",
"public function import(array $array): \\WPKG\\Interfaces\\Packages\n {\n $packages = new \\WPKG\\Packages();\n\n // If we have main structure mode\n if (isset($array['@attributes'])) {\n // Parse single package\n $this->parse_package($packages, $array);\n } else {\n // Parse array of packages\n foreach ($array as $item) {\n $this->parse_package($packages, $item);\n }\n }\n\n return $packages;\n }",
"public function getNamespace($add_slashes = false)\n {\n return ($add_slashes ? '\\\\' : '') . $this->namespace . ($add_slashes ? '\\\\' : '');\n }",
"function cleanPrefixes($array){\n return array_merge($array, Configure::read('appli.CleanPrefixes'));\n }",
"private function namespace_to_directory( $namespace ) {\n return str_replace( '\\\\', '/', $namespace );\n }",
"function build_url($name, $array = array())\n {\n $i = 0;\n $i = $this->_search_by_key($this->routes, self::NAME, $name);\n \n if($i === FALSE)\n {\n log_message('ERROR', 'Try to create undefined url with name: '.$name);\n return $this->config->site_url();\n }\n\n $rule = $this->routes[$i];\n \n if(is_null($array)){\n return $rule[self::URL];\n }\n\n //v1.5 ������������ ��������\n if(preg_match_all(\"#\\[([\\w_]+)\\]#\", $rule[self::URL], $mas)){\n $l = count($mas[1]);\n \n for($i = 0; $i < $l; $i++){\n $j = $this->_search_by_key($this->routes, self::NAME, $mas[1][$i]);\n if($j !== FALSE){\n $parent_rule = $this->routes[$j];\n $rule[self::URL] = str_replace('[' . $mas[1][$i] . ']', $parent_rule[self::URL], $rule[self::URL]);\n }\n }\n }\n \n\t\t//AG EDIT\n\t\t$rule_array = explode('/', $rule[self::URL]);\n\t\tforeach($rule_array as $key => $ms)\n\t\t{\n\t\t\tif($ms == '') unset($rule_array[$key]);\n\t\t\tif(($pos = strpos($ms, ':')) !== FALSE)\n\t\t\t{\n\t\t\t\t$u_key = substr($ms, $pos+1);\n\t\t\t\tif(isset($array[$u_key]) && $array[$u_key] !== FALSE)\n\t\t\t\t{\n\t\t\t\t\t$rule_array[$key] = str_replace(':'.$u_key , $array[$u_key] , $ms);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tunset($rule_array[$key]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$rule[self::URL] = '';\n\t\tif(count($rule_array)>0)\n\t\t{\n\t\t\tforeach($rule_array as $ms)\n\t\t\t{\n\t\t\t\t$rule[self::URL] .= $ms.'/';\n\t\t\t}\n\t\t\t$rule[self::URL] = substr($rule[self::URL], 0, -1);\n\t\t}\n\t\t/*\n foreach($array as $k => $v)\n {\n $rule[self::URL] = str_replace(':'.$k . '/', $v . '/', $rule[self::URL]);\n }\n */\n //����������� ���������� �������, ����� �������� ���������� �� ������������� ������.\n /*if(preg_match(\"@:\\w+$@\", $rule[self::URL])){\n foreach($array as $k => $v){\n $rule[self::URL] = str_replace(':'.$k, $v, $rule[self::URL]);\n }\n }*/\n return $this->config->site_url($rule[self::URL]);\n }",
"static function makeNewRout($str,$arr){\n Route::$routeName = trim(strip_tags($str));\n Route::$routeName = $arr['as'];\n $func=explode($arr,'@');\n Route::$controller=$func['0'];\n if (isset($func[1])){\n Route::$method=$func[1];\n }else{\n Route::$method='index';\n }\n return false;\n }",
"function setValueByPath($arr,$path,$value,$createPath=false) {\n\t\tif ($createPath)\n\t\t\t$r=&$arr;\n\t\telse\t\n\t\t\t$r=$arr;\n\t\tif (!is_array($path)) return false;\n\t\tforeach ($path as $key) {\n\t\t\tif ($createPath and !isset($r[$key])) {\n\t\t\t\t$r[$key]='';\n\t\t\t}\n\t\t\tif (isset($r[$key])) {\n\t\t\t\t$r=&$r[$key];\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t$r=$value;\n\t\t\n\t\treturn $r;\n\t}",
"public function getNamespace(): string;",
"function _a2ua($name,$array){\n $urlarray = array();\n foreach((array) $array as $key => $val){\n $urlarray[$name.'['.$key.']'] = $val;\n }\n return $urlarray;\n }",
"public function registerNamespaces(array $namespaces)\n\t{\n\t\tforeach($namespaces as $namespace => $locations)\n\t\t{\n\t\t\t$this->namespaces[$namespace] = (array) $locations;\n\t\t}\n\t}",
"function arrayToObject($array){\n if(!is_array($array)) { return $array; }\n $object = new stdClass();\n if (is_array($array) && count($array) > 0) {\n foreach ($array as $name=>$value) {\n $name = strtolower(trim($name));\n if (!empty($name)) { $object->$name = arrayToObject($value); }\n }\n return $object;\n } \n else {\n return false;\n }\n }",
"public function __construct($namespace);",
"public static function namespaceExist($namespace)\n {\n if (array_key_exists($namespace, $_SESSION)) {\n return true;\n }\n\n return false;\n }",
"public abstract function getApplicationNamespace();",
"public function getNamespaces() {}",
"function relativeNamespace($ns, $path = null) {\n\tif (is_object($ns)) $ns = get_namespace($ns);\n\n\t$path = str_replace('\\\\', '/', $path);\n\n\tif (!$path || $path === '' || $path === '.') {\n\t\treturn $ns;\n\t} else if ($path === '/') {\n\t\treturn '\\\\';\n\t} else {\n\t\t$pathParts = explode(\n\t\t\t'/',\n\t\t\ttrim($path, '/')\n\t\t);\n\n\t\tif (substr($path, 0, 1) === '/') {\n\t\t\t$parts = array();\n\t\t} else {\n\t\t\t$parts = explode('\\\\', trim($ns, '\\\\'));\n\t\t}\n\n\t\tforeach ($pathParts as $p) {\n\t\t\tif (! ($p === '' || $p === '.' || $p === '\\\\')) {\n\t\t\t\tif ($p === '..') {\n\t\t\t\t\tif (count($parts) > 0) {\n\t\t\t\t\t\tarray_pop($parts);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new IllegalStateException(\n\t\t\t\t\t\t\t\"Path ($path) go upper than root on namespace: $ns\"\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$parts[] = $p;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn implode('\\\\', $parts) . '\\\\';\n\t}\n}",
"function frame_dot_array(array $a, $path, $default = null)\n{\n $current = $a;\n $p = strtok($path, '.');\n\n while ($p !== false)\n {\n if (!isset($current[$p]))\n return $default;\n\n $current = $current[$p];\n $p = strtok('.');\n }\n\n return $current;\n}",
"function macro_convert_path_to_class_name($path)\n{\n if (!file_exists($path)) {\n if (!file_exists(dirname($path))) {\n \\Includes\\Utils\\FileManager::mkdirRecursive(dirname($path));\n }\n file_put_contents($path, '');\n }\n\n return str_replace(DIRECTORY_SEPARATOR, '\\\\', substr(realpath($path), strlen(LC_DIR_CLASSES), -4));\n}",
"public function preparePrefixes()\n {\n $this->prefixes['route'] = explode('/', config('app-generator.prefixes.route', ''));\n $this->prefixes['path'] = explode('/', config('app-generator.prefixes.path', ''));\n\n if ($prefix = $this->getOption('prefix')) {\n $multiplePrefixes = explode(',', $prefix);\n\n $this->prefixes['route'] = array_merge($this->prefixes['route'], $multiplePrefixes);\n $this->prefixes['path'] = array_merge($this->prefixes['path'], $multiplePrefixes);\n }\n\n $this->prefixes['route'] = array_filter($this->prefixes['route']);\n $this->prefixes['path'] = array_filter($this->prefixes['path']);\n\n $routePrefix = '';\n foreach ($this->prefixes['route'] as $singlePrefix) {\n $routePrefix .= Str::camel($singlePrefix) . '.';\n }\n $this->prefixes['route'] = !empty($routePrefix) ? substr($routePrefix, 0, -1) : $routePrefix;\n\n $namespacePrefix = $pathPrefix = '';\n foreach ($this->prefixes['path'] as $singlePrefix) {\n $namespacePrefix .= Str::title($singlePrefix) . '\\\\';\n $pathPrefix .= Str::title($singlePrefix) . '/';\n }\n\n $this->prefixes['namespace'] = !empty($namespacePrefix) ? substr($namespacePrefix, 0, -1) : $namespacePrefix;\n $this->prefixes['path'] = !empty($pathPrefix) ? substr($pathPrefix, 0, -1) : $pathPrefix;\n }",
"private function getNamespaceFromPath( $path )\n {\n foreach ( $this->getNamespaces() as $nsPath => $namespace ) {\n $path = str_replace( $nsPath, $namespace, $path );\n }\n return ltrim( str_replace( DIRECTORY_SEPARATOR, '\\\\', $path ), '\\\\');\n }",
"protected function load($paths, $namespace = null)\n {\n $paths = collect($paths)\n ->unique()\n ->filter(function ($path) {\n return is_dir($path);\n })->map(function ($path) {\n return realpath($path);\n })->all();\n\n if (empty($paths)) {\n return;\n }\n\n $namespace = $namespace ?: app()->getNamespace();\n $path = starts_with($namespace, 'Nuwave\\\\Lighthouse')\n ? realpath(__DIR__.'/../../src/')\n : app_path();\n\n /** @var SplFileInfo $file */\n foreach ((new Finder())->in($paths)->files() as $file) {\n $className = $namespace.str_replace(\n ['/', '.php'],\n ['\\\\', ''],\n str_after($file->getPathname(), $path.DIRECTORY_SEPARATOR)\n );\n\n $this->tryRegisterClassName($className);\n }\n }",
"abstract public function getDefaultNameSpace();",
"public static function getNamespacePrefixes( $encode = false ) {\n\t\tif ( $encode === true ) {\n\t\t\t$prefixes = self::$namespacePrefixesEncoded;\n\t\t} else {\n\t\t\t$prefixes = self::$namespacePrefixes;\n\t\t}\n\n\t\t// if we already figured it all out, just use that again\n\t\tif ( $prefixes !== null ) {\n\t\t\treturn $prefixes;\n\t\t}\n\n\t\t// always catch this one\n\t\t$namespaces = [\n\t\t\t'User',\n\t\t\t'User_talk',\n\t\t\t'User talk',\n\t\t];\n\n\t\t// add in user specified ones\n\t\t$namespaces = array_merge( $namespaces, array_values( $GLOBALS['wgRealnamesNamespaces'] ) );\n\n\t\t// try to figure out the wiki language\n\t\t// ! get language from the context somehow? (2011-09-26, ofb)\n\t \t// Eric Richter, 20210626, $GLOBALS['wgContLang'] is no longer available\n\t \t// This solution is copied from the ReplaceText extension\n\t\t$lang = MediaWikiServices::getInstance()->getContentLanguage();\n\t \n\t\t// user namespace's primary name in the wiki lang\n\t\t$namespaces[] = $lang->getNsText( NS_USER );\n\t\t$namespaces[] = $lang->getNsText( NS_USER_TALK );\n\n\t\t// namespace aliases and gendered namespaces (1.18+) in the wiki's lang\n\t\t// fallback for pre 1.16\n\t\tif ( method_exists( $lang, 'getNamespaceAliases' ) === true ) {\n\t\t\t$nss = $lang->getNamespaceAliases();\n\t\t} else {\n\t\t\t$nss = $GLOBALS['wgNamespaceAliases'];\n\t\t}\n\n\t\tforeach ( $nss as $name => $space ) {\n\t\t\tif ( in_array( $space, [ NS_USER, NS_USER_TALK ] ) === true ) {\n\t\t\t\t$namespaces[] = $name;\n\t\t\t}\n\t\t}\n\n\t\t// clean up\n\t\t$namespaces = array_unique( $namespaces );\n\n\t\tif ( $encode === true ) {\n\t\t\t$namespaces = array_map( 'urlencode', $namespaces );\n\t\t}\n\n\t\t// Escape namespaces for use in regex delimited with '/'.\n // Shouldn't do much for most namespaces.\n\t\t$namespaces = array_map(\n\t\t\tfunction ($namespace) {\n\t\t\t\treturn preg_quote($namespace, '/');\n\t\t\t},\n\t\t\t$namespaces\n\t\t);\n\n\t\t$prefixes = '(?:(?:' . implode( '|', $namespaces ) . '):)';\n\n\t\tself::debug( __METHOD__, 'namespace prefixes: ' . $prefixes );\n\n\t\tif ( $encode === true ) {\n\t\t\tself::$namespacePrefixesEncoded = $prefixes;\n\t\t} else {\n\t\t\tself::$namespacePrefixes = $prefixes;\n\t\t}\n\n\t\treturn $prefixes;\n\t}",
"public function getNamespace(){\n //base namepace\n $namespace = 'App\\Controllers\\\\';\n //if the namepace is defined\n if(array_key_exists('namespace', $this->params)){\n $namespace .= $this->params['namespace'] . '\\\\';\n }\n return $namespace;\n }",
"public function expandGenericPathPatternWorksWithNewNamingSchemeOfSubPackage() {}",
"function splitNamespace(string $class): array\n {\n $pos = strrpos($class, '\\\\');\n if ($pos === false) {\n return ['', $class];\n }\n\n return [substr($class, 0, $pos), substr($class, $pos + 1)];\n }",
"private static function autoLoader($namespace)\n {\n $filePath = explode('\\\\', $namespace);\n\n /**\n * To remove the Class name (Not class file name) from the end of the namespace.\n */\n array_pop($filePath);\n /**\n * to remove the root key from the beginning the namespace.\n */\n array_shift($filePath);\n \n /**\n * After taking and removing those stuffs, then we are converting namespace from array to an string .\n * using the directory separator that it can work perfectly in every OS (like: windows, linux, ...) .\n */\n $filePath = implode(DIRECTORY_SEPARATOR, $filePath);\n\n /**\n * Now we have just removed that root key from the beginning of the namespace that was extra and also\n * took the Class name (not its file name) from the namespace.\n * And now we have got the address to the class file from the root of the Framework.\n * \n * It means that with combining the (FILE_PATH) constant that gives us the absolute path to the Framework's root and having the address of the class name in the\n * Framework (that we it is) and adding the file extension to these things we can have the full path to that class that was called!\n */\n $filePath = FILE_PATH . $filePath . '.php';\n \n /*\n * We are checking to see whether that class exists or not,\n * If it exists then we are calling that class with using the (require_once) function.\n */\n if (is_readable($filePath))\n {\n require_once $filePath;\n self::registryInjection($namespace);\n\n return;\n }else\n {\n self::$registry->error->reportError(\"The Called Class File Does Not Exists! ({$filePath})\", __LINE__, __METHOD__, false);\n return;\n }\n return;\n }",
"protected static function insert_namespaces($element, array $namespaces) {\n $pos = strpos($element, '>');\n if (strpos(substr($element, 0, $pos), '/') !== FALSE) {\n // We may have an empty element, parse to see if the\n // backslash is inside an attribute.\n for ($x = $pos; $x > 0; $x -= 1) {\n if (substr($element, $x, 1) == \"/\") {\n $pos = $x;\n break;\n }\n elseif (substr($element, $x, 1) == \"\\\"\" || substr($element, $x, 1) == \"'\") {\n break;\n }\n }\n }\n $add_string = \"\";\n foreach ($namespaces as $prefix => $uri) {\n if (strpos($element, \"xmlns:$prefix\") === FALSE) {\n $add_string .= \" xmlns:$prefix=\\\"$uri\\\"\";\n }\n }\n return substr($element, 0, $pos) . $add_string . substr($element, $pos);\n }",
"function classLoader($class)\r\n{\r\n $parts = explode('_', $class);\r\n $namespace = $parts[0];\r\n $classname = $parts[1];\r\n \r\n switch($namespace)\r\n {\r\n case 'Base':\r\n $filename = B_PATH . $classname . '.php';\r\n break;\r\n case 'Controller':\r\n $filename = C_PATH . $classname . '.php';\r\n break;\r\n case 'Model':\r\n $filename = M_PATH . $classname . '.php';\r\n break;\r\n }\r\n\r\n if (!file_exists($filename)) {\r\n return false;\r\n }\r\n require_once $filename;\r\n}",
"private function folderRename($inputArray){\r\n\t\t\treturn $this->host.'/file/renamefolder?'.$this->queryBuilder($inputArray);\r\n\t\t}"
] | [
"0.6145813",
"0.56039894",
"0.5418388",
"0.5320841",
"0.52223384",
"0.5150258",
"0.5135476",
"0.5064399",
"0.5056255",
"0.5047895",
"0.50236213",
"0.4965043",
"0.4958236",
"0.49413478",
"0.49261832",
"0.48973146",
"0.4886516",
"0.4878662",
"0.4837746",
"0.48128757",
"0.4801266",
"0.4801266",
"0.4797824",
"0.47948444",
"0.4777888",
"0.4776082",
"0.4772515",
"0.47621402",
"0.47621402",
"0.47621402",
"0.475521",
"0.47394547",
"0.47347918",
"0.47274023",
"0.47040558",
"0.46790144",
"0.4669616",
"0.4668351",
"0.46658117",
"0.46658",
"0.46528816",
"0.46487564",
"0.4639377",
"0.46326092",
"0.4626882",
"0.46198368",
"0.46136484",
"0.46085572",
"0.4606037",
"0.459846",
"0.4583399",
"0.45607552",
"0.4559512",
"0.4556964",
"0.4556721",
"0.45566204",
"0.45565614",
"0.45549864",
"0.4554126",
"0.45523414",
"0.45513207",
"0.4546845",
"0.453541",
"0.45330557",
"0.451581",
"0.4515534",
"0.45054898",
"0.44956657",
"0.44903192",
"0.44898623",
"0.44803536",
"0.44800833",
"0.44734147",
"0.44731888",
"0.4471828",
"0.4471484",
"0.44700077",
"0.44599664",
"0.44596738",
"0.4459635",
"0.44559747",
"0.445317",
"0.44486582",
"0.44463554",
"0.44455796",
"0.4442359",
"0.44187912",
"0.44140333",
"0.44122243",
"0.44113845",
"0.4408365",
"0.4402608",
"0.43950883",
"0.43947956",
"0.4393313",
"0.4392449",
"0.43901744",
"0.4384272",
"0.43815842",
"0.4380647"
] | 0.4965011 | 12 |
Return true if there is no upload error | public function isOk(): bool
{
return $this->getError() === UPLOAD_ERR_OK;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function validUpload() {\t\n\t\tif($this->file['error'] == 0) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function isUploaded() {\n return ($this->getErrorCode() == UPLOAD_ERR_OK);\n }",
"public function checkUpload() {}",
"public static function upload(): bool\n {\n return true;\n }",
"function check_file_error($file_error) {\nif ($file_error === 0) {\nreturn true;\n}else {\necho \"There is an error uploading the file\";\n}\n}",
"public function HasError() {\n\n return !in_array($this->Error, array(UPLOAD_ERR_OK, UPLOAD_ERR_NO_FILE));\n }",
"public function isValid() : bool\n {\n return $this->status === UPLOAD_ERR_OK;\n }",
"public function isValid(): bool\n {\n return ($this->error === UPLOAD_ERR_OK) && is_uploaded_file($this->getPathname());\n }",
"private function wasFileSent() : bool\n {\n return isset($_FILES[$this->fieldName]['name']) && !empty($_FILES[$this->fieldName]['name']);\n }",
"public function hasFileUpload()\n\t{\n\t\treturn stripos($this->server->get('CONTENT_TYPE'),'multipart/form-data')!==false;\n\t}",
"function isUpload()\n {\n return ($this->type->getTypeName() == 'file');\n }",
"public function getStatus() {\n if (!isset($_FILES[$this->_file])) {\n return false;\n }\n \n return $_FILES[$this->_file]['error'];\n }",
"public function isUploadedFile() {}",
"public function isUploaded() {\n\t\t$this->msg = '';\n\t\t\t//\tcheck if the name of the file uploaded is not available\n\t\tif (!$_FILES[$this->fileName]['name'])\t{\n\t\t\t$this->msg .= 'File name not available';\n\t\t\treturn false;\n\t\t}\n\n\t\t\n\t\t\t// tests for an error in uploading\n\t\tif ($_FILES[$this->fileName]['error']) {\t\n\t\t\tswitch($_FILES[$this->fileName]['error']) {\n\t\t\t\tcase 1: $this->msg .= 'Your image is too big!'; // exceeds PHP\\'s maximun upload size\n\t\t\t\t\treturn false;\n\t\t\t\tcase 2: $this->msg .= 'Your image is too large!'; // File exceeds maximum upload file size set in the form\n\t\t\t\t\treturn false;\n\t\t\t\tcase 3: $this->msg .= 'That only partially worked!'; // File partially uploaded\n\t\t\t\t\treturn false;\n\t\t\t\tcase 4: $this->msg .= 'Your file wasn\\'t uploaded!'; // No file upload\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\t// check if file type is invalid\n\t\t$type = $_FILES[$this->fileName]['type'];\t//\tget the type of the uploaded file\n\t\tif (!in_array($type, $this->fileTypes)) {\n\t\t\t$this->msg .= 'Wrong file type';\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t\t// check if file did not reach the server\n\t\tif (!is_uploaded_file($_FILES[$this->fileName]['tmp_name'])) {\n\t\t\t$this->msg .= 'File did not reach the temporary location on the server';\n\t\t\treturn false;\n\t\t}\n\t\t$fleName = $_FILES[$this->fileName]['name'];\n\t\t$flePath = $this->folderPath ? $this->folderPath.'/'.$fleName : $fleName;\n\t\t\n\t\t\t// test if a file with the same name exists and rename it using a random generated (uniqid) if it does\n\t\tif (file_exists($flePath)) {\n\t\t\t$newName = uniqid('art').$fleName;\n\t\t\t$flePath = $this->folderPath ? $this->folderPath.'/'.$newName : $newName;\n\t\t}\n\n\t\t\t//move file from temporary location to the path specified and test if it's not successful\n\t\tif (!move_uploaded_file($_FILES[$this->fileName]['tmp_name'], $flePath)) {\t\n\t\t\t$this->msg .= 'Error in moving file to the specified location';\n\t\t\treturn false;\n\t\t}\n\t\t\t// check if new file does not exists in the destination folder\n\t\tif (!file_exists($flePath)) {\n\t\t\t$this->msg .= 'File did not reach the destination folder';\n\t\t\treturn false;\n\t\t}\n\t\t\t\t// all worked fine and returns the filepath\n\t\t\t$this->msg .= 'File '.$_FILES[$this->fileName]['name'].' uploaded successfully ';\n\t\t\treturn $flePath;\n\t\t}",
"public function hasJustUploaded() {\n return $this->_has(8);\n }",
"public function isUploaded()\n {\n return $this->uploaded;\n }",
"protected function checkFileUploadEnabled() {}",
"public function IsValid() {\n\n return $this->Error === UPLOAD_ERR_OK;\n }",
"protected function processFileUploads()\n {\n if ($this->errors) {\n return false;\n }\n\n foreach($this->getFields() as $name => $field) {\n if ($this->getField($name)->getFieldType() != 'file') {\n continue;\n }\n\n if ($this->getField($name)->save() === false) {\n return false;\n }\n }\n\n return true;\n }",
"public function upload(){\n\n\t\tif(move_uploaded_file($this->tmp_name,$this->uploadFile)){\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\t// throw exception according to error number\n\n\t\tswitch($this->error){\n\n\t\t\tcase 1:\n\n\t\t\tthrow new Exception('Target file exceeds maximum allowed size.');\n\n\t\t\tbreak;\n\n\t\t\tcase 2:\n\n\t\t\tthrow new Exception('Target file exceeds the MAX_FILE_SIZE value specified on the upload form.');\n\n\t\t\tbreak;\n\n\t\t\tcase 3:\n\n\t\t\tthrow new Exception('Target file was not uploaded completely.');\n\n\t\t\tbreak;\n\n\t\t\tcase 4:\n\n\t\t\tthrow new Exception('No target file was uploaded.');\n\n\t\t\tbreak;\n\n\t\t\tcase 6:\n\n\t\t\tthrow new Exception('Missing a temporary folder.');\n\n\t\t\tbreak;\n\n\t\t\tcase 7:\n\n\t\t\tthrow new Exception('Failed to write target file to disk.');\n\n\t\t\tbreak;\n\n\t\t\tcase 8:\n\n\t\t\tthrow new Exception('File upload stopped by extension.');\n\n\t\t\tbreak;\n\n\t\t}\n\n\t}",
"public function isImage(){\n if(isset($_POST[\"submit\"])) {\n $check = getimagesize($_FILES[\"fileToUpload\"][\"tmp_name\"]);\n if($check !== false) {\n echo \"File is an image - \" . $check[\"mime\"] . \".<br>\";\n $this->uploadOk = 1;\n } else {\n echo \"File is not an image.<br>\";\n $this->uploadOk = 0;\n }\n }\n return $this->uploadOk;\n }",
"public function hasFile()\n {\n \treturn empty($_FILES) ? false : true;\n }",
"public function isImage(){\n if($this->imageFileType != \"jpg\" && $this->imageFileType != \"png\" && $this->imageFileType != \"jpeg\"\n && $this->imageFileType != \"gif\" ) {\n echo \"Sorry, only JPG, JPEG, PNG & GIF files are allowed.<br>\";\n $this->uploadOk = 0;\n }\n return $this->uploadOk;\n }",
"public function upload(){\n if($this->validateFile()){\n if(move_uploaded_file($this->tmpLocation, $this->fullUploadPath)){\n return true;\n }else{\n $this->addError(['Upload Error','File Upload Failed']);\n return false;\n }\n }\n return false;\n }",
"public function isSafe()\n {\n return is_uploaded_file($this->tmp);\n }",
"function file_upload_successful()\n{\n $uploadSuccessful = true;\n\n foreach ($_FILES as $file)\n {\n //var_dump($file);\n if($file['name'])\n {\n if ($file['error'] > 0)\n {\n $uploadSuccessful = false;\n print_error_message('<p>Error uploading file ' . $file['name'] . ' !\n Please try again later or report a bug using the link in the Help menu.');\n }/*\n elseif ($file['type'] != 'text/plain')\n {\n $uploadSuccessful = false;\n print_error_message('Uploaded file ' . $file['name'] . ' type not supported!');\n }\n elseif (($file['size'] / 1024) > 20)\n {\n $uploadSuccessful = false;\n print_error_message('Uploaded file ' . $file['name'] . ' must be smaller than 10 MB!');\n }*/\n }\n\n\n }\n\n return $uploadSuccessful;\n}",
"public function isStatusUploading()\n\t{\n\t\treturn $this->status == self::STATUS_UPLOADING;\n\t}",
"public function validateCanUpload()\n {\n //do not allow upload for active session\n if (StreamSession::activeExists($this->shop->getId())) {\n $this->addError('file', Yii::t('app', 'You cannot upload products while Live Stream is active'));\n }\n }",
"function validate() {\r\n\t\t$post_ok = isset($this->params['form']['Filedata']);\r\n\t\t$upload_error = $this->params['form']['Filedata']['error'];\r\n\t\t$got_data = (is_uploaded_file($this->params['form']['Filedata']['tmp_name']));\r\n\t\t\r\n\t\tif (!$post_ok){\r\n\t\t\t$this->setError(2000, 'Validation failed.', 'Expected file upload field to be named \"Filedata.\"');\r\n\t\t}\r\n\t\tif ($upload_error){\r\n\t\t\t$this->setError(2500, 'Validation failed.', $this->getUploadErrorMessage($upload_error));\r\n\t\t}\r\n\t\treturn !$upload_error && $post_ok && $got_data;\r\n\t}",
"protected function _checkConfirmUploadFile()\n\t{\n\t\tswitch ($this->_uploadedFile->getError()) {\n\t\t\tcase UPLOAD_ERR_OK:\n\t\t\t\tbreak;\n\t\t\tcase UPLOAD_ERR_NO_FILE:\n\t\t\t\tthrow new Exception('Empty File Upload ERROR!');\n\t\t\t\tbreak;\n\t\t\tcase UPLOAD_ERR_FORM_SIZE;\n\t\t\tcase UPLOAD_ERR_INI_SIZE;\n\t\t\t\tthrow new Exception('Too Large File Size ERROR!');\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Exception('Something ERROR!');\n\t\t\t\tbreak;\n\t\t}\n\t}",
"function hasFiles()\n {\n return (count($_FILES) > 0);\n }",
"public function upload() {\n $out = false;\n\n if ( $this->isValidFile() ) {\n $newImage = $this->destination . \"/\" . $this->filename;\n if ( move_uploaded_file( $this->file, $newImage ) ) {\n $out = true;\n }\n } else {\n $this->typeErrorDetected = true;\n }\n return $out;\n }",
"function confirm_upload()\n\t{\n\t\tglobal $log, $root_directory, $upload_dir, $upload_badext;\n\t\t$log->debug(\"Eentering confirm_upload() method ...\");\n\t\t$upload_maxsize = GlobalVariable::getVariable('Application_Upload_MaxSize',3000000,$currentModule);\n\n\t\tif (!is_uploaded_file($_FILES[$this->field_name]['tmp_name']) )\n\t\t{\n\t\t\t$log->debug(\"Exiting confirm_upload method ...\");\n\t\t\treturn false;\n\t\t}\n\t\telse if ($_FILES[$this->field_name]['size'] > $upload_maxsize)\n\t\t{\n\t\t\tdie(\"ERROR: uploaded file was too big: max filesize:$upload_maxsize\");\n\t\t}\n\n\t\tif( !is_writable( $root_directory.'/'.$upload_dir))\n\t\t{\n\t\t\tdie(\"ERROR: cannot write to directory: $root_directory/$upload_dir for uploads\");\n\t\t}\n\n\t\trequire_once('include/utils/utils.php');\n\t\t$this->stored_file_name = sanitizeUploadFileName($_FILES[$this->field_name]['name'], $upload_badext);\n\t\t$log->debug(\"Exiting confirm_upload method ...\");\n\t\treturn true;\n\t}",
"public function testUploadErrors() {\n\t\t$this->data['tmp_name'] = null;\n\n\t\ttry {\n\t\t\t$transit = new Transit($this->data);\n\t\t\t$transit->upload();\n\n\t\t\t$this->assertTrue(false);\n\n\t\t} catch (Exception $e) {\n\t\t\t$this->assertTrue(true);\n\t\t}\n\n\t\t$this->data['tmp_name'] = $this->tempFile;\n\t\t$this->data['error'] = 3;\n\n\t\ttry {\n\t\t\t$transit = new Transit($this->data);\n\t\t\t$transit->upload();\n\n\t\t\t$this->assertTrue(false);\n\n\t\t} catch (Exception $e) {\n\t\t\t$this->assertTrue(true);\n\t\t}\n\t}",
"protected function checkHttpPost()\n {\n\n if (!is_uploaded_file($this->fileInfo['tmp_name'])) {\n\n $this->error = 'The file is not upload for HTTP POST method.';\n\n return false;\n\n }\n\n return true;\n\n }",
"function check()\r\n\t{\r\n\t\tif (isset($_FILES) and !empty($_FILES)) {\r\n\t\t\tforeach ($_FILES as $f) {\r\n\t\t\t\tif ($f['name'] != '') {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function isFileUploadsSupported()\n {\n $checking_result = (Bootstrap::getIniParam('file_uploads') == true) ? true : false;\n\n if (!$checking_result) {\n App::instance()->setNotification('E', App::instance()->t('error'), App::instance()->t('text_file_uploads_notice'), true, 'valiator');\n }\n\n return $checking_result;\n }",
"public function hasFile()\n {\n return (count($this->getUploadedFiles()) > 0);\n }",
"function check_file_uploaded($filename) {\n\t\t// If this request falls under any of them, treat it invalid.\n\t\tif (\n\t\t\t!isset($_FILES[$filename]['error']) ||\n\t\t\tis_array($_FILES[$filename]['error'])\n\t\t) {\n\t\t\tthrow new RuntimeException('Invalid parameters.');\n\t\t}\n\n\t\t// Check $_FILES[$filename]['error'] value.\n\t\tswitch ($_FILES[$filename]['error']) {\n\t\t\tcase UPLOAD_ERR_OK:\n\t\t\t\tbreak;\n\t\t\tcase UPLOAD_ERR_NO_FILE:\n\t\t\t\tthrow new RuntimeException('No file sent.');\n\t\t\tcase UPLOAD_ERR_INI_SIZE:\n\t\t\tcase UPLOAD_ERR_FORM_SIZE:\n\t\t\t\tthrow new RuntimeException('Exceeded filesize limit.');\n\t\t\tdefault:\n\t\t\t\tthrow new RuntimeException('Unknown errors.');\n\t\t}\n\t}",
"public function file_is_uploaded($name)\n\t{\n\t\tif (!array_key_exists($name, $this->_uploaded_files)) return false;\n\t\treturn ($this->_uploaded_files[$name] == UPLOAD_ERR_OK);\n\t}",
"function verifyUpload( $file ){\n $passed = false; //\tVariável de controle\n if( is_uploaded_file( $file[ \"tmp_name\" ] ) ){\n $ext = $this->getExt( $file[ \"name\" ] );\n if( ( count( $this->allowedExtensions ) == 0 ) || ( in_array( $ext, $this->allowedExtensions ) ) ){\n $passed = true;\n }\n }\n return $passed;\n }",
"public function exists()\n {\n if(isset($_FILES[$this->param_name])){\n return true;\n }\n else{\n return false;\n }\n }",
"public static function is_upload($name){ // 判断文件是否已上传\n if (!isset($_FILES[$name])){\n return false;\n }\n if (!isset($_FILES[$name]['tmp_name'])||empty($_FILES[$name]['tmp_name'])){\n return false;\n }\n if (is_uploaded_file($_FILES[$name]['tmp_name'])){\n return true;\n }else{\n return false;\n }\n }",
"public function hasUploadFile($key): bool {\n $file = $this->get($key);\n return is_uploaded_file($file['tmp_name']);\n }",
"public function fileupload_check()\n { \n \n // we retrieve the number of files that were uploaded\n $number_of_files = sizeof($_FILES['img']['tmp_name']);\n \n // considering that do_upload() accepts single files, we will have to do a small hack so that we can upload multiple files. For this we will have to keep the data of uploaded files in a variable, and redo the $_FILE.\n $files = $_FILES['img'];\n \n // first make sure that there is no error in uploading the files\n for($i=0; $i<$number_of_files; $i++)\n {\n if($_FILES['img']['error'][$i] != 0)\n {\n // save the error message and return false, the validation of uploaded files failed\n $this->form_validation->set_message('fileupload_check', 'Please add at least one Image');\n return FALSE;\n }\n return TRUE;\n }\n }",
"public function isThisYourUpload()\n\t{\n\t\treturn !($this->httpRequest->getHeader('user-agent') === 'Shockwave Flash');\n\t}",
"public function verifyUploadFailureAction(){\n\t}",
"private function allowUploads(): bool\n {\n $allowUploads = isset($this->modVars['allowUploads']) && true === (bool) $this->modVars['allowUploads'];\n if (!$allowUploads) {\n return false;\n }\n if (!file_exists($this->avatarPath) || !is_readable($this->avatarPath) || !is_writable($this->avatarPath)) {\n return false;\n }\n\n return true;\n }",
"function userfile_check()\n\t\t{\n\t\t\tif ($_FILES['userfile']['size'] > 0)\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->form_validation->set_message('userfile_check', 'The {field} file is required');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}",
"protected static function isEmptyFileUpload($value) {\n return (\n isset($value['name']) && '' === $value['name'] &&\n isset($value['type']) && '' === $value['type'] &&\n isset($value['tmp_name']) && '' === $value['tmp_name'] &&\n isset($value['error']) && UPLOAD_ERR_NO_FILE === $value['error'] &&\n isset($value['size']) && 0 === $value['size']\n );\n }",
"protected function _handleMediaFileUpload()\n {\n\n if (empty($this->files)\n || !isset($this->files['file_upload'])) {\n // nothing to do\n return false;\n }\n\n if ($this->files['file_upload']['error'] != UPLOAD_ERR_OK) {\n throw new UNL_MediaHub_Manager_PostHandler_UploadException($this->files['file_upload']['error'], 500);\n }\n\n // Verify extension\n if (!self::validMediaFileName($this->files['file_upload']['name'])) {\n throw new UNL_MediaHub_Manager_PostHandler_UploadException('Invalid file extension uploaded '.$this->files['file_upload']['name'], 500);\n }\n\n $extension = strtolower(pathinfo($this->files['file_upload']['name'], PATHINFO_EXTENSION));\n\n //3gp doesnt work with mediaelement. Right now call it an mp4 (won't always work because 3gps are not always h264.)\n //TODO: Handle this better. perhaps check the file encoding or convert it instead of just renaming it.\n if ($extension == '3gp') {\n $extension = 'mp4';\n }\n \n $filename = md5(microtime() + rand()) . '.'. $extension;\n\n // Copy file to uploads diretory\n if (false == copy($this->files['file_upload']['tmp_name'],\n UNL_MediaHub_Manager::getUploadDirectory()\n . DIRECTORY_SEPARATOR .$filename)) {\n throw new UNL_MediaHub_Manager_PostHandler_UploadException('Error copying file from temp location to permanent location', 500);\n }\n\n return UNL_MediaHub_Controller::$url.'uploads/'.$filename;\n }",
"public function hasError()\n {\n if ( curl_errno($this->handler) ) {\n return true;\n }\n return false;\n }",
"public function sizeFile(){\n if ($_FILES[\"fileToUpload\"][\"size\"] > 8300000) {\n echo \"Sorry, your file is too large.<br>\";\n $this->uploadOk = 0;\n }\n return $this->uploadOk;\n }",
"public function isSelected() : bool\n {\n return $this->status !== UPLOAD_ERR_NO_FILE;\n }",
"function _device_can_upload()\n {\n }",
"public function hasError(): bool;",
"public function hasError(): bool;",
"public function isUploadedFile($params){\n\t\t$val = array_shift($params);\n\t\tif ((isset($val['error']) && $val['error'] == 0) ||\n\t\t\t(!empty( $val['tmp_name']) && $val['tmp_name'] != 'none')\n\t\t) {\n\t\t\treturn is_uploaded_file($val['tmp_name']);\n\t\t}\n\t\treturn false;\n\t}",
"function upload_is_file_too_big($upload)\n {\n }",
"public function correctImage(){\n parent::isImage();\n parent::exist();\n parent::sizeFile();\n return $this->uploadOk;\n }",
"public function edit_fileupload_check()\n { \n \n // we retrieve the number of files that were uploaded\n $number_of_files = sizeof($_FILES['img']['tmp_name']);\n \n // considering that do_upload() accepts single files, we will have to do a small hack so that we can upload multiple files. For this we will have to keep the data of uploaded files in a variable, and redo the $_FILE.\n $files = $_FILES['img'];\n \n // first make sure that there is no error in uploading the files\n for($i=0; $i<$number_of_files; $i++)\n {\n if($_FILES['img']['error'][$i] != 0)\n {\n // save the error message and return false, the validation of uploaded files failed\n $this->form_validation->set_message('fileupload_check', 'Please add at least one Image');\n return FALSE;\n }\n return TRUE;\n }\n }",
"public function hasError()\n {\n return $this->info['http_code'] != '200';\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 hasError();",
"public function hasError();",
"public function hasError();",
"public function hasError();",
"function isUploadedFile($params = array(), $options = array()) {\n\t\tif (empty($options['allowEmpty'])) {\n\t\t\t$val = array_shift($params);\n\t\t\tif ((isset($val['error']) && $val['error'] == 0) || (!empty( $val['tmp_name']) && $val['tmp_name'] != 'none')) {\n\t\t\t\treturn is_uploaded_file($val['tmp_name']);\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public function isUploadedFile($params) {\r\n $val = array_shift($params);\r\n if ((isset($val['error']) && $val['error'] == 0) ||\r\n (!empty( $val['tmp_name']) && $val['tmp_name'] != 'none')\r\n ) {\r\n return is_uploaded_file($val['tmp_name']);\r\n }\r\n return false;\r\n }",
"public function isError()\n {\n return ($this->error_count > 0);\n }",
"public function hasError() {\n return ($this->getStatus() != 1);\n }",
"public function upload()\n {\n if (null === $this->getFile()) {\n return false;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->url = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n return true;\n }",
"public function validateFile(){\n // Check uploaded errors\t\n if($this->fileError){\n if(array_key_exists($this->fileError, $this->phpFileUploadErrors)){\n $this->addError(['PHP Upload Error',$this->phpFileUploadErrors[$this->fileError]]);\n } \n }else{\n // Check if file was uploaded via the form\n if(!is_uploaded_file($this->tmpLocation)){\n $this->addError(['File Upload', \"File uploading failed. Please upload the file again.\"]);\n }\t\n // Check extension\n if(!in_array($this->fileExt, $this->allowedExtensions)){\n $allowed = implode(', ', $this->allowedExtensions);\n $this->addError(['File Extension',\"Uploading this type of file is not allowed. Allowed file extensions are \".$allowed]);\n }\n // Check size\n if($this->size > $this->maxSize){\n $this->addError(['File Size',\"The file size must be up to \".$this->maxSize]);\n }\n // Check if upload folder exists\n if(!file_exists($this->uploadPath)){\n $this->addError(['Admin Error',\"The chosen upload directory does not exist.\"]);\n }\n } \n if(!$this->_errors){\n return true;\n } \n return false;\t\n }",
"function is_error() {\n\t\treturn $this->error;\n\t}",
"public function hasError() { return $this->error; }",
"public function hasError()\n {\n return $this->errors === 0;\n }",
"function upload($path) {\r\n\t\t$ok = false;\r\n\r\n\t\t$this->uploadpath .= $path . '/';\r\n\r\n\t\tif ($this->validate()) {\r\n\t\t\t$this->filename = $this->params['form']['Filedata']['name'];\r\n\t\t\t$ok = $this->write();\r\n\t\t}\r\n\t\t\r\n\t\tif (!$ok) {\r\n\t\t\theader(\"HTTP/1.0 500 Internal Server Error\");\t//this should tell SWFUpload what's up\r\n\t\t\t$this->setError();\t//this should tell standard form what's up\r\n\t\t}\r\n\t\t\r\n\t\treturn ($ok);\r\n\t}",
"private function _isHttpPostUpload($tmp_name)\n {\n if (!isset($tmp_name) || empty($tmp_name)) {\n return false;\n }\n\n return true;\n }",
"public function hasFileUpload()\n {\n $hasFileUpload = false;\n $option_id = $this->option_id;\n $fieldMaps = Engine_Api::_()->fields()->getFieldsMaps('yndynamicform_entry')->getRowsMatching('option_id', $option_id);\n foreach ($fieldMaps as $fieldMap) {\n $field = $fieldMap->getChild();\n $config = $field->config;\n if ($field->type == 'file_upload' && ($config['show_registered'] || $config['show_guest']))\n {\n $hasFileUpload = true;\n break;\n }\n }\n\n return $hasFileUpload;\n }",
"public function is_error()\n {\n }",
"public function IsError() {\n\t return ($this->error_count > 0);\n\t}",
"function isPresent($source) {\n global $debugging;\n $uploading = $this->uploading($source);\n if ($debugging > 2) {\n $ul = $uploading ? 'true':'false';\n echo \"<pre>uploading: {$ul} </pre>\";\n }\n return ($uploading || parent::isPresent($source));\n }",
"function is_upload_space_available()\n {\n }",
"function checkFileSize()\r\n\t{\r\n\t\tif ($this->file_size_max >= 0)\r\n\t\t{\r\n\t\t\t$post \t\t= $_FILES[$this->post_name];\r\n\t\t\t$size \t\t= ( !$this->isArrayPostName ) ? $post['size'] : $post['size'][$this->arrayPostName];\r\n\t\t\tif ($size > $this->file_size_max) return false;\r\n\t\t\telse return true;\r\n\t\t}else return true;\r\n\t}",
"public function testUpload() {\n\t\ttry {\n\t\t\tif ($this->object->upload()) {\n\t\t\t\t$this->object->getOriginalFile()->delete();\n\t\t\t}\n\n\t\t\t$this->assertTrue(true);\n\n\t\t} catch (Exception $e) {\n\t\t\t$this->assertTrue(false, $e->getMessage());\n\t\t}\n\t}",
"public function isError() {}",
"public function upload() {\r\n\t\t$user = JFactory::getUser();\r\n\t\t/*if (!$user->authorise('core.manage', 'com_djmediatools')){\r\n\t\t\techo JText::_('JLIB_APPLICATION_ERROR_ACCESS_FORBIDDEN');\r\n\t\t\texit(0);\r\n\t\t}*/\r\n\t\r\n\t\tDJUploadHelper::upload();\r\n\t\r\n\t\treturn true;\r\n\t}",
"function attemptUpload() {\n\t\tif (isset($_POST['upload']) && $_POST['upload'] = 'true') {\n\t\t\techoBSAlertBox(2, \"\\t\", 'success', 'glyphicon-upload', 'Upload Started', 'We attempted an upload, details displayed bellow.');\n\t\t\t//for every file we attempted to upload, we build a alert box\n\t\t\tforeach($_FILES['myfile']['name'] as $key=>$name) {\n\t\t\t\tif (empty($name))\n\t\t\t\t\tcontinue;\n\t\t\t\t$result = handleUpload($key);\n\t\t\t\tif ($result['success'] == true) {\n\t\t\t\t\t//add to queue\n\t\t\t\t\t$addedToQueue = queue_add($result['result']);\n\t\t\t\t\techoBSAlertBox(2, \"\\t\", 'success', 'glyphicon-ok', 'Success', 'We successfully uploaded <a href=\"../../browse/image/source/?id='.$result['result'].'\">'.$name.\n\t\t\t\t\t\t\t'</a>, '.($addedToQueue ? 'added to processing queue' : 'not added to processing queue').'! <a href=\"../../browse/\">Click here to view the processing queue.</a>');\n\t\t\t\t} else {\n\t\t\t\t\techoBSAlertBox(2, \"\\t\", 'danger', 'glyphicon-exclamation-sign', 'Error', 'Unable to upload '.$name.', we had error: '.$result['result']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function processUpload() {\n $result = FALSE;\n // we need the surfer id to save the file owner\n if (!$this->loadSurferData()) {\n return FALSE;\n }\n if (isset($this->params['folder_id']) && isset($_FILES) && is_array($_FILES) &&\n isset($_FILES[$this->paramName]) && is_array($_FILES[$this->paramName])) {\n $maxUploadSize = $this->getMaxUploadSize();\n $result = TRUE;\n for ($i = 0; $i < count($_FILES[$this->paramName]['name']['upload']); $i++) {\n if ($_FILES[$this->paramName]['tmp_name']['upload'][$i] != '') {\n $file['tempname'] = $_FILES[$this->paramName]['tmp_name']['upload'][$i];\n $file['size'] = $_FILES[$this->paramName]['size']['upload'][$i];\n $file['name'] = $_FILES[$this->paramName]['name']['upload'][$i];\n $file['type'] = $_FILES[$this->paramName]['type']['upload'][$i];\n $file['error'] = $_FILES[$this->paramName]['error']['upload'][$i];\n if ($i == 0 &&\n isset($this->params['file_id']) && $this->params['file_id'] != '' &&\n isset($this->currentFile) && isset($this->currentFile['current_version_id']) &&\n isset($this->params['replace']) && $this->params['replace']) {\n $this->replaceUploadedFile($file['tempname'], $file['name'], $file['type']);\n } else {\n $files[$i] = $file;\n }\n }\n if ($_FILES[$this->paramName]['error']['upload'][$i] != 0 &&\n $_FILES[$this->paramName]['error']['upload'][$i] != 4) {\n $result = FALSE;\n switch ($_FILES[$this->paramName]['error']['upload'][$i]) {\n case 1:\n $this->addMsg(\n MSG_ERROR,\n sprintf(\n $this->_gt('File #%d is too large (PHP_INI, %s).'),\n $i + 1,\n $this->formatFileSize($maxUploadSize)\n )\n );\n break;\n case 2:\n $this->addMsg(\n MSG_ERROR,\n sprintf(\n $this->_gt('File #%d is too large (HTML_FORM, %s).'),\n $i + 1,\n $this->formatFileSize($maxUploadSize)\n )\n );\n break;\n case 3:\n $this->addMsg(\n MSG_ERROR,\n sprintf($this->_gt('File #%d was only partially uploaded.'), $i + 1)\n );\n break;\n case 6:\n $this->addMsg(\n MSG_ERROR,\n $this->_gt('Temporary folder not found.')\n );\n break;\n case 7:\n $this->addMsg(\n MSG_ERROR,\n sprintf($this->_gt('File #%d could not be written to disk.'), $i + 1)\n );\n break;\n case 8:\n $this->addMsg(\n MSG_ERROR,\n sprintf($this->_gt('Extension of file #%d is blocked.'), $i + 1)\n );\n break;\n default:\n $this->addMsg(MSG_ERROR, $this->_gt('An unknown error occurred.'));\n break;\n }\n } elseif ($_FILES[$this->paramName]['size']['upload'][$i] > $maxUploadSize) {\n $this->addMsg(\n MSG_ERROR,\n sprintf(\n $this->_gt('File #%d \"%s\" is too large (PAPAYA_MAX_UPLOAD_SIZE, %s)'),\n $i + 1,\n $_FILES[$this->paramName]['name']['upload'][$i],\n $this->formatFileSize($maxUploadSize)\n )\n );\n unset($files[$i]);\n }\n }\n\n if (isset($files) && is_array($files) && count($files) > 0) {\n foreach ($files as $file) {\n $fileId = $this->addFile(\n $file['tempname'],\n $file['name'],\n empty($this->params['folder_id']) ? 0 : (int)$this->params['folder_id'],\n $this->surfer['surfer_id'],\n $file['type'],\n 'uploaded_file'\n );\n if ($fileId) {\n $this->addMsg(\n MSG_INFO,\n sprintf($this->_gt('File \"%s\" (%s) uploaded.'), $file['name'], $fileId)\n );\n $this->switchFile($fileId);\n } else {\n $this->getErrorForType($this->lastError);\n }\n }\n }\n } else {\n $this->addMsg(\n MSG_ERROR,\n $this->_gt('Upload failed.').' '.sprintf(\n $this->_gt('File may not be larger than %s.'),\n $this->formatFileSize($this->getMaxUploadSize())\n )\n );\n }\n return $result;\n }",
"public function saveUploads(){\n\n if ($_SERVER['REQUEST_METHOD'] === 'GET') {\n\n //check whether chunk exists\n if ($this->checkChunkExists()) {\n // if exists return ok as header, which wont upload\n header(\"HTTP/1.1 200 Ok\");\n } else {\n \t//flow js requires 204 error as return to do the post actions\n header(\"HTTP/1.1 204 No Content\");\n return false;\n }\n } else {\n \t// set the file parameter\n $this->uploadRequest();\n if ($this->validateChunk()) {\n $this->saveChunk();\n $this->validateChunkAfterMove();\n } else {\n // error, invalid chunk upload request, retry\n header(\"HTTP/1.1 400 Bad Request\");\n return false;\n }\n }\n\n if ($this->validateFile() && $this->saveToSingleFile($destination)) {\n \tif($this->setting_deleteChunks){\n \t\t$this->deleteAllChunks();\n \t}\n\n return true;\n }\n\n return false;\n }",
"public function fileUpload(): bool|FileUploadModel|EloquentCollection\n {\n if($this->request->file()) {\n $this->storeFiles();\n\n if (is_array($this->request->file($this->input))) {\n return $this->insertMultipleFiles();\n }\n\n return $this->insertSingleFile();\n }\n\n return false;\n }",
"function had_error() {\n return (bool) $this->error_msg;\n }",
"function is_uploaded_file($filename)\n{\n return file_exists($filename);\n}",
"public function isError();",
"function canUpload($file, &$err, &$params)\r\n\t{\r\n\t\tif (empty($file['name'])) {\r\n\t\t\t$err = 'Please input a file for upload';\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (!is_uploaded_file($file['tmp_name'])) {\r\n\t //handle potential malicous attack\r\n\t $err = JText::_('File has not been uploaded');\r\n\t\t\treturn false;;\r\n\t\t}\r\n\r\n\t\tjimport('joomla.filesystem.file');\r\n\t\t$format = strtolower(JFile::getExt($file['name']));\r\n\r\n\t\t$allowable = explode(',', strtolower($params->get('ul_file_types')));\r\n\r\n\t\t$format = FabrikString::ltrimword($format, '.');\r\n\t\t$format2 = \".$format\";\r\n\t\tif (!in_array($format, $allowable) && !in_array($format2, $allowable))\r\n\t\t{\r\n\t\t\t$err = 'WARNFILETYPE';\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$maxSize = (int)$params->get('upload_maxsize', 0);\r\n\t\tif ($maxSize > 0 && (int)$file['size'] > $maxSize)\r\n\t\t{\r\n\t\t\t$err = 'WARNFILETOOLARGE';\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$ignored = array();\r\n\t\t$user = JFactory::getUser();\r\n\t\t$imginfo = null;\r\n\t\tif ($params->get('restrict_uploads',1)) {\r\n\t\t\t$images = explode(',', $params->get('image_extensions'));\r\n\t\t\tif (in_array($format, $images)) { // if its an image run it through getimagesize\r\n\t\t\t\tif (($imginfo = getimagesize($file['tmp_name'])) === FALSE) {\r\n\t\t\t\t\t$err = 'WARNINVALIDIMG';\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t} else if (!in_array($format, $ignored)) {\r\n\t\t\t\t// if its not an image...and we're not ignoring it\r\n\t\t\t\t/*$allowed_mime = explode(',', $upload_mime);\r\n\t\t\t\t$illegal_mime = explode(',', $upload_mime_illegal);\r\n\t\t\t\tif (function_exists('finfo_open') && $params->get('check_mime',1)) {\r\n\t\t\t\t\t// We have fileinfo\r\n\t\t\t\t\t$finfo = finfo_open(FILEINFO_MIME);\r\n\t\t\t\t\t$type = finfo_file($finfo, $file['tmp_name']);\r\n\t\t\t\t\tif (strlen($type) && !in_array($type, $allowed_mime) && in_array($type, $illegal_mime)) {\r\n\t\t\t\t\t\t$err = 'WARNINVALIDMIME';\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfinfo_close($finfo);\r\n\t\t\t\t} else if (function_exists('mime_content_type') && $params->get('check_mime',1)) {\r\n\t\t\t\t\t// we have mime magic\r\n\t\t\t\t\t$type = mime_content_type($file['tmp_name']);\r\n\t\t\t\t\tif (strlen($type) && !in_array($type, $allowed_mime) && in_array($type, $illegal_mime)) {\r\n\t\t\t\t\t\t$err = 'WARNINVALIDMIME';\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}*/\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$xss_check = JFile::read($file['tmp_name'], false, 256);\r\n\t\t$html_tags = array('abbr','acronym','address','applet','area','audioscope','base','basefont','bdo','bgsound','big','blackface','blink','blockquote','body','bq','br','button','caption','center','cite','code','col','colgroup','comment','custom','dd','del','dfn','dir','div','dl','dt','em','embed','fieldset','fn','font','form','frame','frameset','h1','h2','h3','h4','h5','h6','head','hr','html','iframe','ilayer','img','input','ins','isindex','keygen','kbd','label','layer','legend','li','limittext','link','listing','map','marquee','menu','meta','multicol','nobr','noembed','noframes','noscript','nosmartquotes','object','ol','optgroup','option','param','plaintext','pre','rt','ruby','s','samp','script','select','server','shadow','sidebar','small','spacer','span','strike','strong','style','sub','sup','table','tbody','td','textarea','tfoot','th','thead','title','tr','tt','ul','var','wbr','xml','xmp','!DOCTYPE', '!--');\r\n\t\tforeach ($html_tags as $tag) {\r\n\t\t\t// A tag is '<tagname ', so we need to add < and a space or '<tagname>'\r\n\t\t\tif (JString::stristr($xss_check, '<'.$tag.' ') || JString::stristr($xss_check, '<'.$tag.'>')) {\r\n\t\t\t\t$err = 'WARNIEXSS';\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"public function is_error() {\n\t\treturn $this->upgrader_skin->error;\n\t}",
"public function isError(): bool\n {\n return !$this->isOk();\n }",
"function is_uploaded_file(string $filename): bool\n {\n if (FakeIsUploadedFile::isEnabled()) {\n return !str_ends_with($filename, '.not-uploaded');\n }\n\n return \\is_uploaded_file($filename);\n }",
"public function isError(): bool\n {\n return $this->error === true;\n }",
"public function canUpload()\n {\n return $this->checkFrontendUserPermissionsGeneric('userGroupAllowUpload');\n }"
] | [
"0.8616526",
"0.83273107",
"0.8103701",
"0.7758599",
"0.7623033",
"0.75870115",
"0.7519901",
"0.7447812",
"0.74384636",
"0.7379442",
"0.7319711",
"0.72945005",
"0.72617227",
"0.7234582",
"0.7229364",
"0.7228664",
"0.7217649",
"0.7209395",
"0.71876925",
"0.7124302",
"0.7103677",
"0.7088387",
"0.70828736",
"0.70236087",
"0.7009389",
"0.6994242",
"0.69355637",
"0.69196635",
"0.6918892",
"0.6918835",
"0.690983",
"0.68986607",
"0.68943447",
"0.6886729",
"0.68757653",
"0.68260425",
"0.6771982",
"0.67622274",
"0.6744535",
"0.67321134",
"0.66871524",
"0.6686858",
"0.6679738",
"0.6651316",
"0.66463834",
"0.6632471",
"0.66282207",
"0.66109693",
"0.6608616",
"0.6593462",
"0.6569708",
"0.65628994",
"0.6559542",
"0.65436786",
"0.6525928",
"0.65252024",
"0.65252024",
"0.65217435",
"0.65123314",
"0.64964926",
"0.64734244",
"0.6466217",
"0.6451983",
"0.64504147",
"0.64504147",
"0.64504147",
"0.64504147",
"0.6444924",
"0.6428096",
"0.64258003",
"0.64057803",
"0.64041424",
"0.6396597",
"0.6395195",
"0.6393976",
"0.63741404",
"0.6370591",
"0.6370572",
"0.6364414",
"0.6352162",
"0.63516283",
"0.63390183",
"0.6335798",
"0.6324678",
"0.6324107",
"0.6320823",
"0.63087404",
"0.6306851",
"0.63025236",
"0.6296862",
"0.6293545",
"0.6289877",
"0.6284789",
"0.6284525",
"0.62816715",
"0.6281403",
"0.62807214",
"0.62737983",
"0.6263478",
"0.6258889"
] | 0.7792434 | 3 |
Store file to file system | public function store(string|array $path, string $rename = null): bool
{
$space = null;
if (is_array($path)) {
$space = $path['space'] ?? null;
$path = $path['path'];
}
$name = $rename ?? $this->getClientFilename();
$location = trim($path, '\/') . DIRECTORY_SEPARATOR . $name;
if ($space) {
\MkyCore\Facades\FileManager::use($space)->write($location, $this->getStream());
} else {
\MkyCore\Facades\FileManager::write($location, $this->getStream());
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function store(File $file);",
"public function storeTo($path = './') {\n\t\tfile_put_contents($path . $this->filename, $this->content);\t\n\t}",
"function save($filePath);",
"public function save($file, $path);",
"public function storeDocument($file);",
"function storeFiles()\n {\n }",
"public function save()\n\t{\n\t\tif($this->beforeSave())\n\t\t{\n\t\t\t$dest = $this->getStorageFile();\n\t\t\t\n\t\t\tif(file_exists($dest) and is_writable($dest)===false)\n\t\t\t{\n\t\t\t\t@chmod($dest,0777);\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($dest,$this->mode);\n\t\t\tfwrite($fp,$this->data);\n\t\t\tfclose($fp);\n\t\t\t$this->afterSave();\n\t\t}\n\t}",
"protected function storeFiles()\n {\n $this->log(sprintf('%s', __METHOD__), 'debug');\n\n $this->log(sprintf('Playlist - Writing file list to temporary file. (%s)', basename($this->tempFilesFromFilename)), 'info');\n $stream = new Stream(fopen($this->tempFilesFromFilename, 'w'));\n\n try {\n $stream->write($this->filesToString());\n } catch (\\Exception $e) {\n $this->log(sprintf('Playlist - Error while writing to file %s. (%s)', basename($this->tempFilesFromFilename), $e->getMessage()), 'error');\n }\n\n $stream->close();\n }",
"public function storeFile($file, $name, $path, $mode = null)\n {\n $contentOrFalseOnFailure = file_get_contents($file);\n file_put_contents($path . \"/\" . $name, $contentOrFalseOnFailure);\n }",
"public function save($path);",
"public function saveStorage($file){\n\t\t$ser_storage = serialize($this->user);\n\t\tfile_put_contents($file, $ser_storage) or die(\"save: unable to open File\");\t\t\n\t}",
"public function saveToFile($file)\n {\n \n }",
"public function saveTo(string $path);",
"public function save()\n {\n if ($this->createDirectoryStructure($this->getPath())) {\n $content = $this->generateContents();\n file_put_contents($this->getPathname(), $content);\n }\n }",
"public function salvarArquivo()\n {\n $caminho = dirname($this->arquivo);\n if (!is_dir($caminho)) {\n mkdir($caminho, '0775', true);\n }\n // grava o arquivo\n file_put_contents($this->arquivo, $this->conteudo);\n }",
"public function file_put_contents($file, $content);",
"protected function writeFileToDisk(): void\n {\n $this->getFile()->move($this->getUploadRootDir(), $this->fileName);\n }",
"public function testFileSaveData() {\n $contents = $this->randomMachineName(8);\n $this->setSetting('file_chmod_file', 0777);\n\n // No filename.\n /** @var \\Drupal\\Core\\File\\FileSystemInterface $file_system */\n $file_system = \\Drupal::service('file_system');\n\n // Provide a filename.\n $filepath = $file_system->saveData($contents, 'public://asdf.txt', FileSystemInterface::EXISTS_REPLACE);\n $this->assertNotFalse($filepath, 'Unnamed file saved correctly.');\n $this->assertEquals('asdf.txt', \\Drupal::service('file_system')->basename($filepath), 'File was named correctly.');\n $this->assertEquals($contents, file_get_contents($filepath), 'Contents of the file are correct.');\n $this->assertFilePermissions($filepath, 0777);\n }",
"public function writeFile($data);",
"public function saveToFile() {\n\n $file = $this->getExtractedFile();\n\n $file->close();\n\n $this->extractedFile = false;\n }",
"public function writeFile($path, $data);",
"private function storeFile()\n {\n if (trim($this->path) == '') {\n throw new CacheException('no valid path is set!!');\n }\n if (!is_dir($this->path)) {\n $this->files->makeDirectory($this->path, $mode = 0777, true, true);\n }\n\n return $this->path.$this->file;\n }",
"public function save($filename) {\r\n file_put_contents($filename, $this->contents);\r\n }",
"protected function createFile($path,$data) {\n File::put($path,$data);\n }",
"protected function createFile() {}",
"public function save($filename, $content);",
"function StoreToCache($content)\n {\n File::CreateWithText($this->file, $content);\n }",
"public function storeFile ( $url, $file, $content_type ) {\n\t\tif ( $this->curl )\treturn $this->_curl_storeFile($url,$file,$content_type);\n\t\telse\t\t\t\treturn $this->_socket_storeFile($url,$file,$content_type);\n\t}",
"public function saveAs(string $path): void;",
"private function store(string $fullFilenamePath, string $data)\n {\n return file_put_contents($fullFilenamePath, $data);\n }",
"public function write($filename);",
"public function write($filename);",
"function SaveToFile($file) {\n\t\t\t$data = $this->GetData();\n\t\t\tif (!$data) {\n\t\t\t\t/* we have to store the data in a file but fetch it from the system,\n\t\t\t\t\tlets have curl store to the file directly to save memory usage */\n\t\t\t\t/* XXX */\n\t\t\t} else {\n\t\t\t\t/* have data, lets store it */\n\t\t\t\treturn file_put_contents($file, $data);\n\t\t\t}\n\t\t}",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n\n $filePath = md5(uniqid($this->getIdUser().\"_profil\",true)).\".\".\n $this->getFile()->guessClientExtension();\n\n $this->getFile()->move(\n $this->getUploadRootDir(),$filePath\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filePath;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"private function save_file_to_path($file){\n\t\tif(!is_dir($this->_mainFolder)){\n\t\t\tmkdir($this->_mainFolder);\n\t\t}\n\n\t\t//After making sure the main folder is created, another folder is created, with the idNews as name.\n\t\t//This just making sure no file is overwritten over time, also for making file order clear.\n\t\t$newFolder = $this->_mainFolder.'/'.$this->id;\n\t\tif(!is_dir($newFolder)){\n\t\t\tmkdir($newFolder);\n\t\t}\n\n\t\t//And now proceed to save the file to path.\n\t\t$f = $file['file'];\n\t\t$n = $file['name'];\n\n\n\t\tlist($type, $f) = explode(';', $f);\n\t\tlist(, $f) = explode(',', $f);\n\t\t$f = base64_decode($f);\n\t\tfile_put_contents($newFolder.'/'.$n, $f);\n\n\t\t//After saving the file, the name of the file is stored, just in case the path changes, we still have the name of the file.\n\t\t$query = \"INSERT INTO files (idNew, file) VALUES(\".$this->id.\", '\".$n.\"')\";\n\t\t$this->_db->query($query);\n\t}",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n $filename = substr( md5(rand()), 0, 15).'.'.$this->getFile()->guessExtension();\n // move takes the target directory and then the\n // target filename to move to\n\n\n\t\t\t\tif(!file_exists($this->getUploadRootDir())) mkdir($this->getUploadRootDir(), 0777, true);\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $filename\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filename;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"public static function save($content, $file = null)\n {\n if (null === $file) {\n $file = static::$dataFile;\n }\n\n $dir = Fluid::getBranchStorage() . '/' . dirname($file);\n if (!is_dir($dir)) {\n mkdir($dir);\n }\n\n $file = Fluid::getBranchStorage() . '/' . $file;\n\n file_put_contents($file, $content);\n\n //self::storeCache($content);\n }",
"public function crear(){\n\t\t$this->archivo = fopen($this->nombre , \"w+\");\n\t}",
"public static function create_file($path,$data) {\n\t\t\t\t\n\t\t// Open Empty File\n\t\tif(!$file = fopen($path,\"w+\")) {\n\t\t\tdie(\"Disk::create_file: Cant open File: \".$path);\n\t\t}\n\t\t\n\t\t// Set Content\n\t\tif(fwrite($file,$data) === false) {\n\t\t\tdie(\"Disk::create_file: Cant write to File: \".$path);\n\t\t}\n\t\t\n\t\t// Close\n\t\tfclose($file);\n\t}",
"public function put($data) {\n File::makeDirectory( $this->base_path );\n File::put( $this->path, $data );\n }",
"public function saveFile($file, $path)\n\t\t{\n\t\t\treturn Storage::disk('public')->put($path, $file);\n\t\t}",
"protected function initStorageFile()\n {\n $storageFilePath = $this->getStoragePath();\n if(!file_exists($storageFilePath)) {\n touch($storageFilePath);\n fwrite(fopen($storageFilePath, \"w\"), static::HEADER . \"\\n\");\n }\n }",
"public function storeResumeFile()\n\t\t{\n\t\t\t// check to make sure file was posted\n\t\t\tif (!isset($_FILES['resume'])) {\n\t\t\t\t$this->throwJsonError(500, 'No resume file found.');\n\t\t\t\texit();\n\t\t\t}\n\n\t\t\t// Get the PHP assigned file name & location from the RAM storage of the file\n\t\t\t$tmp_name = $_FILES['resume']['tmp_name'];\n\t\t\t// Get the original file name as uploaded\n\t\t\t$name = $_FILES['resume']['name'];\n\t\t\t// To ensure all files are unique, get the timestamp of the uplaod.\n\t\t\t$timestamp = date('YmdHis');\n\t\t\t// Determine the server location for the file to be stored.\n\t\t\t$location = \"$this->uploads_dir/$timestamp-$name\";\n\t\t\t// Store the file.\n\t\t\tif (move_uploaded_file($tmp_name, $location)) {\n\t\t\t\tchmod($location, 0666);\n\t\t\t\treturn $location;\n\t\t\t}\n\t\t\treturn $tmp_name;\n\t\t}",
"public function save()\n {\n $data = $this->read_file();\n\n if (( ! $data))\n {\n $data = array();\n }\n\n $data[$this->id] = array(\n 'id' => $this->id,\n 'email' => $this->email,\n 'firstname' => $this->firstname,\n 'lastname' => $this->lastname,\n 'password' => $this->password,\n 'token' => $this->token,\n 'logins' => $this->logins,\n );\n\n $this->write_file($data);\n }",
"public function add(){\n\t\t\n\t\t// Open or create file\n\t\t$f = fopen($this->file, 'wb');\n\t\tfclose($f);\n\t}",
"function transfer()\n\t{\n\t\tglobal $phpbb_root_path;\n\n\t\t$this->file_perms\t= 0644;\n\t\t$this->dir_perms\t= 0777;\n\n\t\t// We use the store directory as temporary path to circumvent open basedir restrictions\n\t\t$this->tmp_path = $phpbb_root_path . 'store/';\n\t}",
"public function store(Storage_Model_File $model, $file)\n {\n $path = $this->getScheme()->generate($model->toArray());\n\n // Prefix path with bucket?\n //$path = $this->_bucket . '/' . $path;\n \n // Copy file\n try {\n $return = $this->_internalService->putFile($file, $this->_bucket . '/' . $path, array(\n Zend_Service_Amazon_S3::S3_ACL_HEADER => Zend_Service_Amazon_S3::S3_ACL_PUBLIC_READ,\n 'Cache-Control' => 'max-age=864000, public',\n ));\n if( !$return ) {\n throw new Storage_Service_Exception('Unable to store file.');\n }\n } catch( Exception $e ) {\n throw $e;\n }\n\n return $path;\n }",
"public function store()\n {\n $classes = [];\n\n foreach ($this->classes as $class) {\n $classes[] = $class['input_file'];\n }\n\n $json_classes = json_encode($classes);\n\n $this->filesystem->put(config('larinterface.cache_directory') . '/larinterface.json', $json_classes);\n }",
"public function store($value) {\r\n $h = null;\r\n if (isset($this->handle)) {\r\n $h = $this->handle;\r\n }\r\n else {\r\n $h = $this->_open();\r\n flock($h, LOCK_EX); // exclusive lock for writing\r\n }\r\n if ($this->option_create) { // mode == 'a+'\r\n ftruncate($h,0);\r\n }\r\n $result = fwrite($h, $value);\r\n if (is_null($this->handle)) {\r\n flock($h, LOCK_UN);\r\n fclose($h);\r\n }\r\n }",
"public function save()\r\n {\r\n $module = Yii::$app->controller->module;\r\n if ($this->operation === self::OP_OVERWRITE) {\r\n $dir = dirname($this->path);\r\n if (!is_dir($dir)) {\r\n $mask = @umask(0);\r\n $result = @mkdir($dir, $module->newDirMode, true);\r\n @umask($mask);\r\n if (!$result) {\r\n return \"Unable to create the directory '$dir'.\";\r\n }\r\n }\r\n }\r\n if (@file_put_contents($this->path, $this->content) === false) {\r\n return \"Unable to write the file '{$this->path}'.\";\r\n }\r\n\r\n return true;\r\n }",
"public function writeToFile($data){\t\n\t\tfwrite($this->fptr,$data);\n\t}",
"protected function _save()\n\t{\n\t\t$_file = $this->_storagePath . DIRECTORY_SEPARATOR . $this->_fileName;\n\n\t\t$_data = json_encode( $this->contents() );\n\n\t\tif ( $this->_compressStore )\n\t\t{\n\t\t\t$_data = Utility\\Storage::freeze( $this->contents() );\n\t\t}\n\n\t\tif ( false === file_put_contents( $_file, $_data ) )\n\t\t{\n\t\t\tUtility\\Log::error( 'Unable to store Oasys data in \"' . $_file . '\". System error.' );\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"public function write($path, $data);",
"public function save(string $file, string $content): void\n {\n $this->filesystem->dumpFile($file, $content);\n }",
"public function store() {\n $logData = \"=========================================\\n\";\n $logData .= \"Date Time: \".$this->record_date.\"\\n\";\n $logData .= $this->title.\" (\".$this->type.\") \\n\";\n if(!empty($this->data)) {\n $logData .= var_export($this->data, true).\"\\n\";\n }\n \n file_put_contents($this->file, $logData, FILE_APPEND);\n \n }",
"public function setPutFile($file = null) {}",
"public function write_file ( $content ) {\r\n\r\n\t}",
"public function save( $filename )\n {\n \n }",
"public function save(IO\\File $file) {\n\t\t\tfile_put_contents($file, $this->render());\n\t\t\t$this->file = $file;\n\t\t}",
"public function setFile($file) {}",
"public function save()\n {\n return file_put_contents($this->getFilepath(), $this->read());\n }",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n $filename = substr( md5(rand()), 0, 15).'.'.$this->getFile()->guessExtension();\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $filename\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filename;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"function file_put_contents( $file, $text ) {\n\t\t$fp = fopen( $file, \"w\" );\n\t\tfwrite( $fp, $text );\n\t\tfclose( $fp );\n\t}",
"public function storeAs(UploadedFile $file, string $folder, $filename = null): string;",
"public function write($data, $filename = '', $uploadDir = '');",
"abstract public function writeFile( $fileName );",
"function file_put_contents($filename, $data, $flags = 0, $context = null) {\n\t\n}",
"function write() {\r\n\t\t// Include libraries\r\n\t\tif (!class_exists('Folder')) {\r\n\t\t\tuses('folder');\r\n\t\t}\r\n\t\t\r\n\t\t$moved = false;\r\n\t\t$folder = new Folder($this->uploadpath, true, 0777);\r\n\t\t\r\n\t\tif (!$folder) {\r\n\t\t\t$this->setError(1500, 'File system save failed.', 'Could not create requested directory: ' . $this->uploadpath);\r\n\t\t} else {\r\n\t\t\tif (!$this->overwrite) {\r\n\t\t\t\t$contents = $folder->ls(); //get directory contents\r\n\t\t\t\t$this->filename = $this->findUniqueFilename($contents[1]); //pass the file list as an array\r\n\t\t\t}\r\n\t\t\tif (!($moved = move_uploaded_file($this->params['form']['Filedata']['tmp_name'], $this->uploadpath . $this->savefilename))) {\r\n\t\t\t\t$this->setError(1000, 'File system save failed.');\r\n\t\t\t}\r\n\t\t\t@chmod($this->uploadpath . $this->savefilename,0666);\r\n\t\t}\r\n\t\treturn $moved;\r\n\t}",
"function store_file($file_path, $file_contents, $visibility = 'public')\n {\n return app('env') != 'production'\n ? \\Illuminate\\Support\\Facades\\Storage::put(\n env('ROOT_FOLDER') . DIRECTORY_SEPARATOR . $file_path, $file_contents, $visibility\n )\n : \\Illuminate\\Support\\Facades\\Storage::cloud()->put($file_path, $file_contents, $visibility);\n }",
"public function store(string $path, ?string $newName = null): File\n {\n $name = is_null($newName) ? Hash::from($this) : $newName;\n\n $this->move(static::normalizePath($path) . DIRECTORY_SEPARATOR . $name);\n }",
"private function store() {\n\n\t\tforeach ($this->filesToStore as $fileToStore) {\n\t\t\t$storedFile = null;\n\n\t\t\t$title = strtoupper($fileToStore['type']) . \"-\" . $fileToStore['host'] . \"-\" . $fileToStore['file_name'];\n\t\t\t$name = strtoupper($fileToStore['type']) . \"-\" . $fileToStore['host'] . \"-\" . $fileToStore['backup_name'];\n\t\t\t$description = strtoupper($fileToStore['type']) . \" on \" . $fileToStore['host'] . \" backup file\";\n\n\t\t\t//store files to remote storage or local\n\t\t\tforeach ($this->storages as $storage) {\n\n\t\t\t\t//store it to google drive\n\t\t\t\tif (isset($storage['type']) && $storage['type'] == strtolower('gdrive')) {\n\n\t\t\t\t\t$drive = new MaratusGoogleDrive($storage);\n\n\t\t\t\t\t$storedFile = $drive->store($fileToStore['file_path'], $title, $description);\n\n\t\t\t\t}\n\t\t\t\t//store it to dropbox\n\t\t\t\telse if (isset($storage['type']) && $storage['type'] == strtolower('dropbox')) {\n\n\t\t\t\t\t$dBox = new MaratusDropbox($storage);\n\n\t\t\t\t\t$storedFile = $dBox->store($fileToStore['file_path'], $title);\n\n\t\t\t\t}\n\t\t\t\t//store it to copy.com\n\t\t\t\telse if (isset($storage['type']) && $storage['type'] == strtolower('copy')) {\n\n\t\t\t\t\t$copy = new MaratusCopy($storage);\n\n\t\t\t\t\t$storedFile = $copy->store($fileToStore['file_path'], $title);\n\n\t\t\t\t}\n\t\t\t\t//store it to local place\n\t\t\t\telse if (isset($storage['type']) && $storage['type'] == strtolower('local')) {\n\n\t\t\t\t\t$localStorage = new MaratusLocalStorage($storage);\n\n\t\t\t\t\t$storedFile = $localStorage->store($fileToStore['file_path'], $title);\n\n\t\t\t\t}\n\t\t\t\t//store it on ftp server\n\t\t\t\telse if (isset($storage['type']) && $storage['type'] == strtolower('ftp')) {\n\n\t\t\t\t\t$localStorage = new MaratusFtp($storage);\n\n\t\t\t\t\t$storedFile = $localStorage->store($fileToStore['file_path'], $title);\n\n\t\t\t\t}\n\n\t\t\t\t//add result\n\t\t\t\t$this->filesStored[] = array(\n\t\t\t\t\t'type' => $storage['type'],\n\t\t\t\t\t'name' => $name,\n\t\t\t\t\t'file_name' => $title,\n\t\t\t\t\t'description' => $description,\n\t\t\t\t\t'storege_result' => is_object($storedFile) ? (array) $storedFile : $storedFile,\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Remove backup file from disk\n\t\t\t */\n\t\t\t$filesystem = new Filesystem();\n\t\t\t$filesystem->remove($fileToStore['file_path']);\n\t\t}\n\t}",
"public function storeFile($file)\n {\n $ex = $file->getClientOriginalExtension();\n Storage::disk('local')->put($file->getFilename(). '.' . $ex, File::get($file));\n\n $fileRecord = [\n 'name' => $file->getFilename(). '.' . $ex,\n 'mime' => $file->getClientMimeType(),\n 'original_name' => $file->getClientOriginalName(),\n ];\n\n $file = \\App\\File::create($fileRecord);\n return $file;\n }",
"public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n $path = ($this->isPublic()) ? 'public' : 'sections' . '/' . strtolower($this->getSection()->getCode());\n\n if (!is_dir($this->getUploadRootDir(). '/' .$path)){\n if (!mkdir($this->getUploadRootDir(). '/' .$path)){\n throw new \\Exception('Create dir exception');\n }\n }\n\n $filename = sha1(uniqid(mt_rand(), true)).'.'.$this->getFile()->guessExtension();\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(). '/' .$path,\n $filename\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $path . '/' . $filename;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }",
"function upload_file() {\n upload_file_to_temp();\n }",
"public function setFile(string $path): void\n {\n $this->fileHandle = fopen($path, \"w\");\n \\curl_setopt($this->connection, CURLOPT_RETURNTRANSFER, true);\n \\curl_setopt($this->connection, CURLOPT_FILE, $this->fileHandle);\n }",
"public function store($contents)\n {\n file_put_contents(self::$dataFolder . '/' . time() . '.data', serialize($contents));\n }",
"public static function saveToFile($path, $data)\n {\n $content = self::encodeContents($data);\n file_put_contents($path, $content);\n }",
"public function storeFileFromLocalPath($type, $path, $newFilename = null, $unlinkAfterStore = false);",
"public function silo_put($path, $filedata)\r\n\t{\r\n\t}",
"public function save(): bool\n {\n if ($this->operation === self::OP_CREATE) {\n $dir = dirname($this->path);\n if (!is_dir($dir)) {\n if ($this->newDirMode !== self::DIR_MODE) {\n $mask = @umask(0);\n $result = @mkdir($dir, $this->newDirMode, true);\n @umask($mask);\n } else {\n $result = @mkdir($dir, 0777, true);\n }\n if (!$result) {\n throw new RuntimeException(\"Unable to create the directory '$dir'.\");\n }\n }\n }\n if (@file_put_contents($this->path, $this->content) === false) {\n throw new RuntimeException(\"Unable to write the file '{$this->path}'.\");\n }\n\n if ($this->newFileMode !== self::FILE_MODE) {\n $mask = @umask(0);\n @chmod($this->path, $this->newFileMode);\n @umask($mask);\n }\n\n return true;\n }",
"public function save($path,$content,$lock = false) ;",
"private function writeFile($stub)\n {\n $this->files->put($this->path, $stub);\n }",
"public function store(Request $request)\n {\n $request->validate([\n 'file' => 'required|file|max:10240'\n ]);\n\n // store newly uploaded file to Google Drive\n $uploaded = $request->file('file')->store('/', 'google');\n\n // get file information from Google Drive\n $file = $this->getCloudFileData($uploaded);\n\n // create local database entry\n $newFile = File::create([\n 'name' => $file['name'],\n 'filename' => $file['filename'],\n 'extension' => $file['extension'],\n 'dirname' => $file['dirname'],\n 'path' => $file['path'],\n 'mimetype' => $file['mimetype']\n ]);\n\n return redirect()->route('drives.index')->with([\n 'filename' => $newFile->name,\n 'filelink' => route('drives.show', ['drive' => $newFile->name]),\n 'path' => $newFile->path,\n 'message' => 'Sukses menggunggah file'\n ]);\n }",
"public function saveToTemporaryDirectory($name, $content);",
"public function saveToFile()\n {\n $emails = $this->getEmailTemplatesFromRepository()->toJson();\n\n $this->filesystem->put($this->storagePath, $emails);\n }",
"public function saveFile()\n {\n $newFileName = $this->generateFilename();\n $this->getOwner()->setAttribute($this->attributeName, $newFileName);\n return $this->uploadManager->save($this->getUploadedFileInstance(), $this->getUploadPath(), $newFileName);\n }",
"function writeFile($filepath, $file_contents) {\n $parent = dirname($filepath);\n if (!is_dir($parent)) {\n mkdir($parent, 0777, TRUE);\n }\n if (file_put_contents($filepath, $file_contents) === FALSE) {\n Logger::log(dt('Error while writing to file @file', array('@file' => $filepath)), 'error');\n }\n else {\n Logger::log(dt('Updated file : @file', array('@file' => $filepath)), 'success');\n }\n }",
"public function store(Request $request)\n {\n \tFile::create($request->all());\n }",
"public function silo_put($path, $filedata)\n\t{\n\t}",
"function store(&$data) {\n\n\t\t// Prepare some info that we need all over\n\t\t$storageFolder = $this->getPropertyDefinition('dirBase');\n\t\t$optionTags = $this->getPropertyDefinition('optionTags');\n\t\t$canDelete = (!isset($optionTags['NODELETEFILE']) && $this->isRequired() === false);\n\t\t$shouldDelete = (KRequest::getInt($this->propertyName.'-delete', 0) == 1);\n\t\t$currentFileName = $this->getCurrentFilename($data->id);\n\t\t$recordId = $data->{$this->model->getTableKey()};\n\n\t\t// Create the storage folder if needed\n\t\tif (is_dir($storageFolder) == false) {\n\t\t\t$success = mkdir($storageFolder, 0777, true);\n\t\t\tif ($success == false) {\n\t\t\t\t$errorMsg = KText::sprintf('Could not create the file folder for %s in %s. Please check if your data folder and its content are writable and try again.', $this->getPropertyDefinition('label'), $storageFolder);\n\t\t\t\t$this->setError($errorMsg);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Get the uploaded file's info (This is the typical array you'd get from $_FILES['your_file'])\n\t\t$file = KRequest::getFile($this->propertyName);\n\n\t\t// If the user checked the 'delete' checkbox, delete the item\n\t\tif ($shouldDelete) {\n\n\t\t\tif ($canDelete == false) {\n\t\t\t\tthrow new Exception('User tried to delete a file that should not be deletable (by settings)');\n\t\t\t}\n\n\t\t\t$fileToRemove = $storageFolder.'/'.$currentFileName;\n\n\t\t\t// Go on and delete the file (if it exists, otherwise just let it be)\n\t\t\tif (is_file($fileToRemove)) {\n\n\t\t\t\t$success = unlink($fileToRemove);\n\n\t\t\t\tif ($success == false) {\n\t\t\t\t\t$errorMsg = KText::sprintf('Could not remove the file for field %s in %s. Please check if your data folder and its content are writable and try again.', $this->getPropertyDefinition('label'), $fileToRemove);\n\t\t\t\t\t$this->setError($errorMsg);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Set the file name storage field to empty (if we store the file name)\n\t\t\tif (isset($optionTags['SAVE_FILENAME'])) {\n\t\t\t\t$data->{$this->propertyName} = '';\n\t\t\t\t$this->updateFilenameBaseTable($recordId, '');\n\t\t\t}\n\n\t\t\treturn true;\n\n\t\t}\n\n\n\t\t// If the user uploaded no file, all stays the same for our prop.\n\t\tif (empty($file['tmp_name'])) {\n\n\t\t\t// Just sneak in the file name in the data object (just in case the data is used after storing)\n\t\t\t$data->{$this->propertyName} = $this->getCurrentFilename($recordId);\n\n\t\t\treturn true;\n\n\t\t}\n\n\n\t\t// Prepare the filename (there are a few settings that control how the file name is 'built' together)\n\t\t$newFileName = $this->getNewFileName($data);\n\n\t\t// Figure out the full filesystem path for the file\n\t\t$destinationPath = $storageFolder . '/' . $newFileName;\n\n\t\t// Move the file from tmp to destination\n\t\t$moveSuccess = rename($file['tmp_name'], $destinationPath);\n\n\t\t// Send false and feedback if moving didn't go well\n\t\tif ($moveSuccess == false) {\n\t\t\t$errorMsg = KText::sprintf('Could not store file for field %s in %s. Please check if your data folder and its content are writable and try again.', $this->getPropertyDefinition('label'), $destinationPath);\n\t\t\t$this->setError($errorMsg);\n\t\t\treturn false;\n\t\t}\n\n\t\t// Put file permissions to 0775 (it allows for having shared write permissions when you organise unix groups nicely)\n\t\tchmod($destinationPath, 0775);\n\n\t\t// Save the file name in table if configured for that\n\t\tif (isset($optionTags['SAVE_FILENAME'])) {\n\t\t\t$this->updateFilenameBaseTable($recordId, $newFileName);\n\t\t}\n\n\t\t// Add the file name to the data object (just in case someone uses this object right after storing)\n\t\t$data->{$this->propertyName} = $newFileName;\n\n\t\t// If the file name changed (because of the 'appendSerial' setting or anything else), remove the old file\n\t\tif ($currentFileName && $currentFileName != $newFileName) {\n\n\t\t\t$fileToRemove = $storageFolder . '/' . $currentFileName;\n\n\t\t\tif (is_file($fileToRemove)) {\n\n\t\t\t\t$success = unlink($fileToRemove);\n\n\t\t\t\tif ($success == false) {\n\t\t\t\t\t$errorMsg = KText::sprintf('Could not remove the previous file for field %s in %s. Please check if your data folder and its content are writable and try again.', $this->getPropertyDefinition('label'), $fileToRemove);\n\t\t\t\t\t$this->setError($errorMsg);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}",
"protected function write()\n {\n if (!is_dir($this->path)) {\n mkdir($this->path);\n }\n\n file_put_contents($this->file, json_encode([\n 'network' => $this->network,\n 'epoch' => static::$epoch,\n 'iteration' => static::$iteration,\n 'a' => $this->a,\n 'e' => $this->e\n ]));\n }",
"public function storeAsFile($url,$data,$content_type) {\n\t\tif ( $this->curl )\treturn $this->_curl_storeAsFile($url,$data,$content_type);\n\t\telse\t\t\t\treturn $this->_socket_storeAsFile($url,$data,$content_type);\n\n\t}",
"public function createFile(File $file): void;",
"public function setFile(?StreamInterface $value): void {\n $this->getBackingStore()->set('file', $value);\n }",
"public static function setFile($file) {}",
"public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n // si on avait un ancien fichier on le supprime\n if (null !== $this->tempFilename) {\n $oldFile = $this->getUploadRootDir().'/'.$this->id.'.'.$this->tempFilename;\n if (file_exists($oldFile)) {\n unlink($oldFile);\n }\n }\n\n // déplace le fichier envoyé dans le répertoire de notre choix\n $this->file->move(\n $this->getUploadRootDir(), // répertoire de destination\n $this->id.'.'.$this->url // nom du fichier à créer \"id.extension\"\n );\n\n }",
"public function saveLocalFile()\n {\n if (!Storage::disk('local')->exists(self::NAME_FILE_LOCAL) && $this->verificUrl()) {\n Storage::disk('local')->put(self::NAME_FILE_LOCAL, file(self::URL_UMASS_COUNTRYS));\n }\n }",
"protected function storeFile($file)\n {\n if (!$file) {\n return null;\n }\n\n $file_name = $file->getClientOriginalName();\n $path = \"companies\\logos\";\n $file_path = $file->storeAs($path, $file_name, 'public');\n\n return $file_path;\n }",
"public function save($path)\n {\n $curl_options = array (\n CURLOPT_HEADER => 0,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_BINARYTRANSFER => 1,\n );\n\n $file = $this->curl_query($curl_options);\n\n if (!$file) \n return false;\n\n if (($handle = fopen($path, 'w')) === false)\n return false;\n\n if ((fwrite($handle, $file)) === false)\n return false;\n\n fclose($handle);\n return true;\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 save()\n\t{\n\t\treturn file_put_contents(self::filepath($this->name), $this->content);\n\t}"
] | [
"0.7547365",
"0.7341288",
"0.7254175",
"0.70929605",
"0.6920497",
"0.6874379",
"0.6833743",
"0.6786467",
"0.67514163",
"0.67180157",
"0.66814077",
"0.66094065",
"0.6604195",
"0.6533021",
"0.6475231",
"0.645292",
"0.64499396",
"0.64471644",
"0.6444019",
"0.6410571",
"0.63588583",
"0.6342896",
"0.6289608",
"0.62721807",
"0.6269673",
"0.62378347",
"0.6229536",
"0.62224525",
"0.6207529",
"0.61892307",
"0.6168014",
"0.6168014",
"0.61533904",
"0.6128249",
"0.6120823",
"0.6119829",
"0.61107576",
"0.61073345",
"0.61050254",
"0.60926056",
"0.6090854",
"0.6072589",
"0.60650694",
"0.6057254",
"0.6055494",
"0.6039327",
"0.6032666",
"0.6025395",
"0.6015916",
"0.6008294",
"0.6005655",
"0.60013634",
"0.5993069",
"0.59819585",
"0.597918",
"0.59791535",
"0.597595",
"0.59728384",
"0.5971376",
"0.5951686",
"0.5946988",
"0.59460807",
"0.5945018",
"0.5943844",
"0.59361243",
"0.5934296",
"0.59330565",
"0.5932138",
"0.5931272",
"0.5925965",
"0.59213364",
"0.59172165",
"0.59142643",
"0.59100705",
"0.5904939",
"0.5900516",
"0.5896029",
"0.58890265",
"0.5887392",
"0.58845156",
"0.58838123",
"0.58834916",
"0.5879433",
"0.5876085",
"0.58746123",
"0.5871963",
"0.5871145",
"0.5869849",
"0.5867856",
"0.5864936",
"0.5864709",
"0.5858974",
"0.5857716",
"0.58510184",
"0.58325857",
"0.58276945",
"0.5824112",
"0.5823059",
"0.5817512",
"0.58147997",
"0.58104247"
] | 0.0 | -1 |
Lists all Task entities. | public function listAction()
{
$user = $this->get('security.context')->getToken()->getUser();
$em = $this->getDoctrine()->getManager();
$tasks = $em->getRepository('STMSBundle:Task')->findBy(array('user' => $user));
$normalizer = new GetSetMethodNormalizer();
$normalizer->setIgnoredAttributes(array('user'));
$normalizer->setCallbacks(array('date' => function ($dateTime) {
return $dateTime->format("Y-m-d");
}));
$serializer = new Serializer(array($normalizer), array(new JsonEncoder()));
$json = $serializer->serialize($tasks, 'json');
$response = new Response($json);
$response->headers->set('Content-Type', 'application/json');
return $response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function showAllTasks() {\n $result = $this->getTask();\n return response()->json($result);\n // return response()->json(Task::all());\n }",
"public function index()\n {\n return $this->task->all();\n }",
"public function list()\n\t\t{\n\t return Task::all();\n\t\t}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('tBundle:UserToTask')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }",
"public function index()\n {\n return Task::all();\n }",
"public function index()\n {\n return Task::all();\n }",
"public function index()\n {\n return Task::all();\n }",
"public function index()\n {\n $tasks = $this->task->paginate();\n\n return new TaskCollection($tasks);\n }",
"public function getAll()\n {\n return $this->taskResourceModel->getAll();\n }",
"public function getAllTasks()\n\t{\n\t\treturn $this->task->orderBy('is_completed', 'ASC')->get();\t\n\t}",
"public function index()\n {\n return task::all();\n }",
"public function fetch_all_tasks()\n {\n //\n }",
"public function index(){\n\n $this->paginate = array(\n 'contain' => array(),\n 'limit' => 7,\n 'order' => array(\n 'Task.created' => 'desc'\n )\n );\n\n $tasks = $this->paginate('Task');\n $this->set('tasks', $tasks);\n }",
"public function index()\n {\n $task_repo = $this->getDoctrine()->getRepository(Task::class);\n $tasks = $task_repo->findBy([], [\n 'id'=> 'desc'\n ]);\n /* desde task\n \n foreach ($tasks as $tarea) {\n echo $tarea->getUser()->getName().\" \".$tarea->getUser()->getSurname()\n .\" :\".$tarea->getTitle().\"<br>\";\n }*/\n /*foreach ($users as $usuario) {\n echo \"<h1>\".$usuario->getName().\" \".$usuario->getSurname().\"</h1>\";\n foreach ($usuario->getTasks() as $tarea) {\n echo $tarea->getTitle().\"<br>\";\n }\n }*/\n return $this->render('task/index.html.twig', [\n 'tasks' => $tasks,\n ]);\n }",
"public function actionTasks(){\n\t\t$userIdtmp = XenForo_Visitor::getUserId();\n\t\t$conditions = array('userId' => $userIdtmp);\n\t\t$order_items = $this->_getOrderItemModel()->getAllOrderItem($conditions);\n\t\t\n\t\t$viewParams = array(\n\t\t\t'tasks' => $order_items\n\t\t);\n\t\t\n\t\treturn $this -> responseView('DTUI_ViewPublic_EntryPoint_Tasks','dtui_task_list',$viewParams);\n\t}",
"function listTasks()\n {\n return view('tasks', [\n 'tasks' => Task::orderBy('created_at', 'asc')->get()\n ]);\n }",
"public function index()\n {\n $this->authorize('viewAny', Task::class);\n\n return TaskResource::collection(\n Task::where('user_id', Auth::user()->id)->get()\n );\n }",
"public function queryAll(){\n\t\t$sql = 'SELECT * FROM tbl_task';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}",
"public function taskList() {\n return $this->hasMany('Peteryan\\Task', 'ProjectId', 'Id');\n }",
"public function index(): TaskResourceCollection\n {\n return new TaskResourceCollection(TodoTask::paginate(10));\n }",
"public function index()\n {\n $task = Task::where('user_id', auth()->user()->id)->get();\n return TaskResource::collection($task);\n }",
"public function index()\n\t{\n\t\t$tasks = $this->task->all();\n\t\treturn $this->response($tasks, self::OK);\n\t}",
"public function index()\n {\n if( ! User::isLoggedIn()) {\n header(\"Location: /user/login\");\n }\n $model = new Task();\n $model->user_id = User::getLoggedInUserId();\n if(isset($_GET['sort'])) {\n $model->sort = $_GET['sort'];\n }\n\n $tasks = $model->read();\n\n if(count($tasks) > 0 ) {\n $this->render('index', $tasks);\n } else {\n $this->render('nodata', []);\n }\n }",
"public function index($id)\n {\n return $this->taskListRepository->tasks($id);\n }",
"public function getTasks();",
"public function getTasks();",
"public function all()\n {\n if (!$this->isLogged()) exit;\n $this->oUtil->getModel('Todo');\n $this->oModel = new \\TestProject\\Model\\Todo;\n\n $this->oUtil->oTodos = $this->oModel->getAll();\n\n $this->oUtil->getView('index');\n }",
"public function showAll(){\n\t\t\n\t\t//our tasks\n\t\t$this->set('tasks', $this->Task->find('all', array(\n\t\t\t'order' => array('Task.created_on'),\n\t\t)));\n\t\t\n\t\t//our statuses\n\t\t$this->set('statuses', $this->Task->Status->find('list'));\n\t\t\n\t\t//our locations\n\t\t$this->set('locations', $this->Task->Location->find('list'));\n\t\t\n\t\t//our keywords\n\t\t$this->set('keywords', $this->Task->Keyword->find('list'));\n\t\t\n\t\t//our link locations\n\t\t$linkLocation['/foundersFactory/tasks/'] = \"Show by Location\";\n\t\tforeach($this->Task->Location->find('list') as $key => $location){\n\t\t\t$linkLocation['/foundersFactory/tasks/showByLocation/'.$key] = $location;\n\t\t}\n\t\t$this->set('linkLocations', $linkLocation);\n\t}",
"public function getTasks()\n\t{\n\t\t$users = Task::all();\n\t\treturn Response::json($users);\n\t}",
"public function index()\n {\n // ->paginate(3);\n $tasks = QueryBuilder::for(Task::class)\n ->allowedIncludes(['project', 'user'])\n ->allowedFilters(['completed', 'due_date', Filter::exact('user_id'),Filter::exact('project_id')])\n ->get();\n\n\n return TaskResource::collection($tasks);\n }",
"public function index()\n {\n return TaskStatus::all();\n }",
"public function get()\n {\n $allTasks = Task::all();\n return response()->json($allTasks);\n }",
"function GetTasks()\n\t{\n\t\t$result = $this->sendRequest(\"GetTasks\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}",
"public function index()\n {\n $tasks = TaskModel::orderBy('order')->get();\n\n return response()->json($tasks, 200);\n }",
"public function index()\n {\n $tasks = Task::all('id', 'name', 'done');\n return response()->json($tasks, 200);\n }",
"public function index()\n {\n $tasks = Task::paginate(10);\n return view('admin.task.index',compact('tasks'));\n }",
"public function all($options = [])\n {\n list($code, $tasks) = $this->httpClient->get(\"/tasks\", $options);\n return $tasks; \n }",
"public function actionIndex()\n {\n $request = $this->getApp()->getRequest();\n $sortByUsername = strtoupper($request->param('username', ''));\n $sortByEmail = strtoupper($request->param('email', ''));\n $sortByStatus = strtoupper($request->param('status', ''));\n $page = $request->param('page', 1);\n\n $perPage = self::PER_PAGE;\n\n if (!$sortByUsername && !$sortByEmail && !$sortByStatus) {\n $tasks = $this->getDb()->tasks()->paged($perPage, $page);\n }\n if ($sortByUsername) {\n $tasks = $this->getDb()->tasks()->orderBy('username', $sortByUsername)->paged($perPage, $page);\n }\n if ($sortByEmail) {\n $tasks = $this->getDb()->tasks()->orderBy('email', $sortByEmail)->paged($perPage, $page);\n }\n if ($sortByStatus) {\n $tasks = $this->getDb()->tasks()->orderBy('status', $sortByStatus)->paged($perPage, $page);\n }\n\n $rows = $tasks->fetchAll();\n\n $pagesTotal = $this->getDb()->tasks()->count();\n $pagination = new Pagination($perPage, $pagesTotal);\n $pagination->page = $page;\n $pagination->url = \"/tasks?username=$sortByUsername&email=$sortByEmail&status=$sortByStatus&page=\";\n\n $canAccept = $this->isAdmin();\n\n return $this->render(\n 'task.index', compact(\n 'rows',\n 'sortByUsername',\n 'sortByEmail',\n 'sortByStatus',\n 'page',\n 'pagesTotal',\n 'perPage',\n 'canAccept',\n 'pagination'\n )\n );\n }",
"public function index()\n {\n $tasks = Task::with('causes','status')->orderBy(\"id\", \"DESC\")->paginate(5);\n\n return response()->json($tasks);\n }",
"public function index()\n {\n $tasks = Task::with('user')->orderByDesc('created_at')->get();\n return response([\n 'tasks' => resourceTask::collection($tasks),\n 'message' => 'Retrieved successfully'], 200);\n }",
"public function index()\n {\n $tasks = Task::scopeGet();\n return view('tasks', compact('tasks'));\n }",
"public function index()\n {\n $tasks = auth()->user()->tasks()->with('category', 'comments', 'files')->paginate(100);\n return TaskResource::collection($tasks);\n }",
"public function index()\n {\n $d['tasks'] = $this->tasks->getAll();\n $this->set($d);\n $this->render(\"index\");\n }",
"public function index()\n {\n $task = Task::all();\n return view('tasks.index')->with('task', $task);\n }",
"public function getTasks()\n {\n return $this->hasMany(Task::className(), ['author_id' => 'id']);\n }",
"public function index()\n {\n // Get all the tasks\n $tasks = Task::All();\n $data['tasks'] = $tasks;\n\n foreach ($tasks as &$task) {\n $task->teams = Team::findTeamsJson(json_decode($task->teams))->get();\n }\n\n // Return the tasks view.\n return view('task.index')->with('data', $data);\n }",
"public function index()\n {\n try {\n //$tasks = Task::orderBy('created_at', 'asc')->paginate();\n $tasks = Task::orderBy('created_at', 'asc')->get();\n return TaskResource::collection($tasks);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n 'message' => 'Error: ' . $e->getMessage()\n ], 404);\n }\n }",
"public function actionIndex()\n {\n $searchModel = new TaskSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $profile = (new UsersProfile())->getProfile();\n\n return $this->render(\n 'index',\n [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'profile' => $profile,\n ]\n );\n }",
"public function index()\n {\n return Entity::all();\n }",
"public function getTasks()\n {\n return $this->hasMany(Task::className(), ['address_id' => 'id']);\n }",
"public function index()\n {\n $tasks = Task::all();\n return view('task.index')->with('tasks', $tasks);\n }",
"public function index()\n {\n return response(Task::where('status', 0)->orderBy('id', 'DESC')->get()->jsonSerialize());\n }",
"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 {\n return response()->json(Task::all());\n }",
"public function index(Request $request)\n {\n return Task::with('user')->get();\n }",
"public function list()\n {\n $tasksList = Task::all()->load('category');\n //return response()->json($categoriesList, 200);\n return $this->sendJsonResponse($tasksList, 200);\n //dump($categoriesList);\n\n }",
"public function task_list()\n {\n \t//get list of tasks from database\n \t//instance the class\n $this->load->model('Task_model');\n\t\t$id_user = $this->User_model->getID();\n\t\t$data['name'] = $this->User_model->getID();\n $data['tasks'] = $this->Task_model->getTask(NULL, $this->User_model->getActiveProject());\n\t\t\n \t//load the view associated with this controller\n $this->load->view('header', $data);\n $this->load->view('nav', $data);\n $this->load->view('task/task', $data);\n $this->load->view('footer', $data);\n \t\n }",
"public function index()\n {\n $tasks = Task::all();\n\n // return view('tasks.index');\n return view('tasks.index', ['tasks' => $tasks]);\n }",
"function listaAll() {\n require ROOT . \"config/bootstrap.php\";\n return $em->getRepository('models\\Equipamentos')->findby(array(), array(\"id\" => \"DESC\"));\n $em->flush();\n }",
"public function tasks()\n {\n return $this->hasMany(Task::class);\n }",
"public function tasks()\n {\n return $this->hasMany(Task::class);\n }",
"public function tasks()\n {\n return $this->hasMany(Task::class);\n }",
"public function tasks()\n {\n return $this->hasMany(Task::class);\n }",
"public function tasks()\n {\n return $this->hasMany(Task::class);\n }",
"public function tasks()\n {\n return $this->hasMany(Task::class);\n }",
"public function index()\n {\n $tasks = $this->task->get();\n return view('tasks.index', compact('tasks'));\n }",
"public function index()\n {\n $tasklists = $this->tasklist->all();\n\n if (!count($tasklists) > 0) {\n return API::throwResourceNotFoundException();\n }\n\n return fractal($tasklists, new TaskListsTransformer())->toArray();\n }",
"public function index()\n {\n \t$tasks = Task::orderBy('created_at', 'asc')->paginate(5);\n \t\n \treturn view('tasks.index', compact('tasks'));\n }",
"public function tasks() {\n return $this->hasMany(Task::class);\n }",
"public function index()\n {\n $tasks= Task::orderBy('created_at','asc')->get();\n\n return view('task',['tasks'=>$tasks]);\n }",
"public function index()\n {\n $data = Task::with('user')->orderBy('id', 'desc')->get();\n return view('task.index', compact('data'));\n }",
"public function index()\n {\n $tasks = Task::all();\n\n return view('tasks.index', compact('tasks'));\n }",
"public function tasks() {\n\n return $this->hasMany(Task::class);\n }",
"public function getTasks()\r\n\t{\r\n\t\t$tasks = array();\r\n\t\t$sql = sprintf('\r\n\t\t\tSELECT\r\n\t\t\t\tid, title\r\n\t\t\tFROM\r\n\t\t\t\ttask\r\n\t\t');\t\t\r\n\r\n\t\t$result = mysqli_query($this->db, $sql);\r\n\r\n\t\twhile ($row = $result->fetch_object())\r\n\t\t{\r\n\t\t\t$task = new Task();\r\n\t\t\t$task->id = $row->id;\r\n\t\t\t$task->title = $row->title;\r\n\r\n\t\t\t$tasks[] = json_decode((string)$task);\r\n\t\t}\r\n\r\n\t\t$result->close();\r\n\r\n\t\treturn json_encode($tasks);\r\n\t}",
"public function tasklistsTasks()\n {\n $tasklistsWithTasks = $this->tasklist->with('tasks')->get();\n\n if (!count($tasklistsWithTasks)) {\n return API::throwResourceNotFoundException();\n }\n\n return fractal($tasklistsWithTasks, new TaskListsTransformer())->toArray();\n }",
"public function Task()\n {\n return $this-> hasMany(Task::class);\n }",
"public function index()\r\n {\r\n //\r\n // $task = Task::latest()->paginate(2);\r\n\r\n //return $this->sendResponse($task, 'Task list');\r\n $task = Task::orderBy('task')->get();\r\n\r\n return response()->json($task);\r\n }",
"public function index()\n {\n $tasks = $this->task->getAll();\n return view('task::index', ['tasks' => $tasks]);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $subtasks = $em->getRepository('AppBundle:Subtask')->findAll();\n\n return $this->render('@App/private/subtask/list_subtask.html.twig', array(\n 'subtasks' => $subtasks,\n ));\n }",
"public function getTasks()\n {\n return $this->hasMany(Task::className(), ['space_room_id' => 'id']);\n }",
"public function index() {\n $taskDAO = new ModelDAO(Task::class);\n $tasks = $taskDAO->readAll();\n \n return $this->render('index.php', ['tasks' => $tasks]);\n }",
"public function index()\n {\n $tasks = $this->tasks->all();\n return view('tasks.index',compact('tasks'));\n }",
"function getTaskList()\n\t{\n\t\t//Update Task List\n\t\t$this->Task_List = null;\n\t\t$assigned_tasks_rows = returnRowsDeveloperAssignments($this->getUsername(), 'Task');\n\t\tforeach($assigned_tasks_rows as $assigned_task)\n\t\t\t$this->Task_List[] = new Tasks( $assigned_task['ClientProjectTask'] );\n\t\treturn $this->Task_List;\n\t}",
"public function index()\n\n {\n\n \t$tasks = Task::all();// elequant in dedicated class ^^ easier than abobe\n\n \t//return $tasks; //return as json -- good for apis\n\n \treturn view('tasks.index', compact('tasks')); \n\n }",
"public function all(){\r\n\treturn $this->getRepository()->findAll();\r\n }",
"public function index()\n {\n $tasks = Task::latest()->get();\n\n return response($tasks, Response::HTTP_ACCEPTED);\n }",
"public function index()\n\t{\n\t\tView::share('title', 'ThinkClosing - Tasks');\n\t\tif ( !Auth::user()->isAdmin() ) {\n\t\t\t$tasks = Task::where('user_id', '=', Auth::user()->id)\n\t\t\t\t->paginate(10);\n\t\t} else {\n\t\t\t$tasks = Task::where('id', '>', 0)->paginate(10);\n\t\t}\n\t\treturn View::make('tasks.index', array('tasks' => $tasks));\n\t}",
"public function getTasks()\n {\n return $this->hasMany(Task::className(), ['contractor_id' => 'id']);\n }",
"public function viewTasks(){\n $task = new Tasks();\n $roles = new Role();\n $resp = $task->read();\n if($resp->status){\n $tasks = $resp->data;\n $temp = array();\n foreach ($tasks as $task){\n $task->mapped_roles = $task->getMappedRoles($task->tasks_id);\n $temp[] = $task;\n }\n $resp->data = $temp;\n }\n $this->data['response_tasks'] = $resp;\n $this->data['response_roles'] = $roles->readAll();\n return $this->view();\n }",
"public function tasks()\n {\n return $this->hasMany('App\\Model\\Task');\n }",
"public function index(ListTaskRequest $request)\n {\n $input = $request->validated()['params']; \n\n if (auth()->user()->isAdmin()) {\n $tasks = Task::with('project.owner', 'ticket', 'responsible', 'task_status'); \n } else {\n $taskModel = new Task();\n $tasks = $taskModel->ownTasks(auth()->user()->id);\n }\n\n // global search\n if (isset($input['global_search']) && $input['global_search']) {\n // to be all between ()\n $tasks->where(function($query) use ($input){\n // in direct relation\n $query->whereHas('task_status', function($query) use($input) {\n $query->where('name', 'like', '%'.$input['global_search'].'%');\n });\n $query->orWhereHas('project', function($query) use($input) {\n $query->where('name', 'like', '%'.$input['global_search'].'%');\n });\n $query->orWhereHas('responsible', function($query) use($input) {\n $query->where('name', 'like', '%'.$input['global_search'].'%');\n });\n $query->orWhereHas('project.owner', function($query) use($input) {\n $query->where('name', 'like', '%'.$input['global_search'].'%');\n });\n // direct relation\n $query->orWhere('tasks.name','LIKE','%'.$input['global_search'].'%');\n $query->orWhere('tasks.priority','LIKE','%'.$input['global_search'].'%');\n $query->orWhere('tasks.deadline','LIKE','%'.$input['global_search'].'%');\n $query->orWhere('tasks.created_at','LIKE','%'.$input['global_search'].'%');\n });\n }\n\n // sorting\n if (isset($input['sort']) && $input['sort']) {\n foreach ($input['sort'] as $sortObj) {\n //direct relation then in-direct relation\n if (in_array($sortObj['name'], ['created_at', 'name', 'deadline', 'priority'])) {\n if ($sortObj['order'] == 'desc') {\n $tasks->latest($sortObj['name']);\n } else {\n $tasks->oldest($sortObj['name']);\n }\n // inndirect relation\n } elseif ($sortObj['name'] == 'status.name') {\n $tasks->join('status', 'status.id', '=', 'tasks.status_id');\n $tasks->orderBy('status.name', $sortObj['order']);\n } elseif ($sortObj['name'] == 'project.name') {\n $tasks->join('projects', 'projects.id', '=', 'tasks.project_id');\n $tasks->orderBy('projects.name', $sortObj['order']);\n } elseif ($sortObj['name'] == 'project.owner.name') {\n $tasks->join('projects', 'projects.id', '=', 'tasks.project_id');\n $tasks->join('users as owners', 'owners.id', '=', 'projects.owner_id');\n $tasks->orderBy('owners.name', $sortObj['order']);\n } elseif ($sortObj['name'] == 'responsible.name') {\n $tasks->join('users', 'users.id', '=', 'tasks.responsible_id');\n $tasks->orderBy('users.name', $sortObj['order']);\n }\n }\n }\n\n // filter \n if (isset($input['filters']) && $input['filters']) {\n foreach ($input['filters'] as $filterObj) {\n // first type of filter\n if ($filterObj['type'] == 'simple') {\n if (in_array($filterObj['name'], ['name', 'deadline', 'priority', 'created_at'])) {\n $tasks->where('tasks.'.$filterObj['name'],'LIKE','%'.$filterObj['text'].'%');\n } elseif ($filterObj['name'] == 'project.name') {\n $tasks->whereHas('project', function($query) use($filterObj) {\n $query->where('name', 'like', '%'.$filterObj['text'].'%');\n });\n } elseif ($filterObj['name'] == 'status.name') {\n $tasks->whereHas('task_status', function($query) use($filterObj) {\n $query->where('name', 'like', '%'.$filterObj['text'].'%');\n });\n } elseif ($filterObj['name'] == 'responsible.name') {\n $tasks->whereHas('responsible', function($query) use($filterObj) {\n $query->where('name', 'like', '%'.$filterObj['text'].'%');\n });\n } elseif ($filterObj['name'] == 'project.owner.name') {\n $tasks->whereHas('project.owner', function($query) use($filterObj) {\n $query->where('name', 'like', '%'.$filterObj['text'].'%');\n });\n }\n // second type of filter\n } elseif ($filterObj['type'] == 'select') {\n if ($filterObj['name'] == 'status.name') {\n $tasks->whereHas('task_status', function($query) use($filterObj) {\n $query->where('name', 'in', $filterObj['selected_options']);\n });\n } elseif ($filterObj['name'] == 'priority') {\n $tasks->where($filterObj['name'], 'in', $filterObj['selected_options']);\n }\n }\n }\n }\n\n $tasks->select('tasks.*');\n $tasks->latest();\n\n $tasks = $tasks->paginate();\n return $this->sendResponse(new TaskCollection($tasks), 'Tasks retrieved successfully.');\n }",
"public function index()\n {\n $tasks = Task::where('is_deleted',false)->with(['filters','country_filter'])->get();\n foreach ($tasks as $task){\n $task->user = User::find($task->user_id);\n }\n return view('admin.tasks.index',compact('tasks'));\n }",
"public function index() {\n\n $database = App::resolve('database');\n $tasks = $database->fetchAll('tasks');\n require 'app/views/tasks.view.php';\n}",
"public function index(){\n\t\t\n\t\t//our tasks\n\t\t$this->set('tasks', $this->Task->find('all', array(\n\t\t\t'conditions' => array('Task.status_id' => '1'),\n\t\t\t'order' => array('Task.deadline'),\n\t\t)));\n\t\t\n\t\t//our statuses\n\t\t$this->set('statuses', $this->Task->Status->find('list'));\n\t\t\n\t\t//our locations\n\t\t$this->set('locations', $this->Task->Location->find('list'));\n\t\t\n\t\t//our keywords\n\t\t$this->set('keywords', $this->Task->Keyword->find('list'));\n\t\t\n\t\t//our link locations\n\t\t$linkLocation['/foundersFactory/tasks/'] = \"Show by Location\";\n\t\tforeach($this->Task->Location->find('list') as $key => $location){\n\t\t\t$linkLocation['/foundersFactory/tasks/showByLocation/'.$key] = $location;\n\t\t}\n\t\t$this->set('linkLocations', $linkLocation);\n\t}",
"public function listTasks()\n {\n $arr_tasks = [];\n $obj_request = new TaskQueueQueryTasksRequest();\n $obj_response = new TaskQueueQueryTasksResponse();\n $obj_request->setQueueName($this->str_name);\n $obj_request->setMaxRows(self::MAX_LIST_ROWS);\n $this->makeCall('QueryTasks', $obj_request, $obj_response);\n if ($obj_response->getTaskSize() > 0) {\n foreach ($obj_response->getTaskList() as $obj_source_task) {\n /** @var \\google\\appengine\\TaskQueueQueryTasksResponse\\Task $obj_source_task */\n $arr_tasks[] = (new Task())\n ->setName($obj_source_task->getTaskName())\n ->setPayload($obj_source_task->getBody())\n ->setEta($obj_source_task->getEtaUsec() / 1e6);\n }\n }\n return $arr_tasks;\n }",
"public function tasks()\n {\n return $this->hasMany('App\\Models\\Task');\n }",
"public function tasks()\n {\n return $this->hasMany('App\\Models\\Task');\n }",
"public function index()\n {\n $taskList = Task::doesntHave('user')->orderBy('deadline', 'asc')->get();\n return view('tasks.tasks', ['taskList' => $taskList]);\n }",
"public function test_list_page_shows_all_tasks()\n {\n\n // creiamo dei task e ci assicuriamo che nella vista ci siano un certo particolare set di dati\n // i assicuro che alla vista venga passata la ariabile dal controller ma non che sia stampata nella vista\n\n $task1 = factory(Task::class)->create();\n $task2 = factory(Task::class)->create();\n\n $this->get('tasks')\n ->assertViewHas('tasks')\n ->assertViewHas('tasks', Task::with('actions')->get())\n ->assertViewHasAll([\n 'tasks' => Task::with('actions')->get(),\n 'title' => 'Tasks page'\n ])->assertViewMissing('dogs');\n }",
"public function show()\n {\n $project = $this->getProject();\n $search = $this->helper->projectHeader->getSearchQuery($project);\n\n if ($this->request->getIntegerParam('show_subtasks') !== 0 ||\n $this->request->getIntegerParam('hide_subtasks') !== 0 ||\n $this->request->getStringParam('direction') !== '' ||\n $this->request->getStringParam('order') !== '') {\n $this->checkReusableGETCSRFParam();\n }\n\n if ($this->request->getIntegerParam('show_subtasks')) {\n session_set('subtaskListToggle', true);\n } elseif ($this->request->getIntegerParam('hide_subtasks')) {\n session_set('subtaskListToggle', false);\n }\n\n if ($this->userSession->hasSubtaskListActivated()) {\n $formatter = $this->taskListSubtaskFormatter;\n } else {\n $formatter = $this->taskListFormatter;\n }\n\n list($order, $direction) = $this->userSession->getListOrder($project['id']);\n $direction = $this->request->getStringParam('direction', $direction);\n $order = $this->request->getStringParam('order', $order);\n $this->userSession->setListOrder($project['id'], $order, $direction);\n\n $paginator = $this->paginator\n ->setUrl('TaskListController', 'show', array('project_id' => $project['id'], 'csrf_token' => $this->token->getReusableCSRFToken()))\n ->setMax(30)\n ->setOrder($order)\n ->setDirection($direction)\n ->setFormatter($formatter)\n ->setQuery($this->taskLexer\n ->build($search)\n ->withFilter(new TaskProjectFilter($project['id']))\n ->getQuery()\n )\n ->calculate();\n\n $this->response->html($this->helper->layout->app('task_list/listing', array(\n 'project' => $project,\n 'title' => $project['name'],\n 'description' => $this->helper->projectHeader->getDescription($project),\n 'paginator' => $paginator,\n )));\n }"
] | [
"0.7423356",
"0.73239136",
"0.73114467",
"0.7163995",
"0.7102767",
"0.7102767",
"0.7102767",
"0.7060338",
"0.7019721",
"0.695931",
"0.6930629",
"0.69196945",
"0.6912962",
"0.6850014",
"0.6766779",
"0.66844565",
"0.6676244",
"0.6674027",
"0.6660125",
"0.6611385",
"0.65838933",
"0.6577305",
"0.65713066",
"0.65585554",
"0.6547824",
"0.6547824",
"0.6534998",
"0.64843875",
"0.64617026",
"0.6455861",
"0.64545316",
"0.6423665",
"0.63779324",
"0.6375847",
"0.6365614",
"0.636489",
"0.6360288",
"0.6358685",
"0.63576645",
"0.63239866",
"0.6298459",
"0.6287278",
"0.62754357",
"0.6271039",
"0.62577283",
"0.62549216",
"0.6252584",
"0.6249268",
"0.624643",
"0.62017053",
"0.6200717",
"0.61977285",
"0.6191454",
"0.6188693",
"0.6149267",
"0.61364615",
"0.61327016",
"0.61242604",
"0.6108436",
"0.6102963",
"0.6102963",
"0.6102963",
"0.6102963",
"0.6102963",
"0.6102963",
"0.6102561",
"0.6097519",
"0.60945344",
"0.60934734",
"0.60932213",
"0.60924375",
"0.6090966",
"0.60859185",
"0.608398",
"0.60786957",
"0.60785955",
"0.6064191",
"0.6044572",
"0.6026287",
"0.6024646",
"0.60202014",
"0.60161555",
"0.60161084",
"0.60111254",
"0.6008251",
"0.5991997",
"0.5987869",
"0.5987487",
"0.5981773",
"0.59698135",
"0.59683096",
"0.5964866",
"0.59626293",
"0.5956795",
"0.5949831",
"0.59413993",
"0.59413993",
"0.59353006",
"0.59350497",
"0.5935002"
] | 0.6455063 | 30 |
Generate HTML sheet with all tasks for the current user that are within given time range | public function generateSheetAction(Request $request)
{
$user = $this->get('security.context')->getToken()->getUser();
$em = $this->getDoctrine()->getManager();
$startDate = $postData = $request->request->get('startDate');
$endDate = $request->request->get('endDate');
$tasks = $em->getRepository('STMSBundle:Task')->getTasksWithinDateRange($user, $startDate, $endDate);
$groupedTasks = array();
foreach($tasks as $task) {
$date = $task->getDate()->format('Y-m-d');
$groupedTasks[$date]['tasks'][] = $task;
if(!isset($groupedTasks[$date]['totalDuration'])) {
$groupedTasks[$date]['totalDuration'] = $task->getMinutes();
}
else {
$groupedTasks[$date]['totalDuration'] += $task->getMinutes();
}
}
return $this->render('STMSBundle:Default:sheet.html.twig', array('data' => $groupedTasks));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function timesheetAction()\r\n {\r\n $project = $this->projectService->getProject($this->_getParam('projectid'));\r\n $client = $this->clientService->getClient($this->_getParam('clientid'));\r\n \r\n if (!$project && !$client) {\r\n return;\r\n }\r\n \r\n if ($project) {\r\n $start = date('Y-m-d', strtotime($project->started) - 86400);\r\n $this->view->tasks = $this->projectService->getSummaryTimesheet(null, null, $project->id, null, null, $start, null);\r\n } else {\r\n $start = date('Y-m-d', strtotime($client->created));\r\n $this->view->tasks = $this->projectService->getSummaryTimesheet(null, null, null, $client->id, null, $start, null);\r\n }\r\n\r\n $this->renderRawView('timesheet/ajax-timesheet-summary.php');\r\n }",
"public function renderTimetable()\n\t{\n\t\t$data = $this->database->query(\"SELECT * FROM course NATURAL JOIN course_has_student NATURAL JOIN task WHERE id_user=? AND student_status=1 AND (course_status=1 OR course_status=2 OR course_status=3);\", $this->user->identity->id)->fetchAll();\n\n\t\tif (!$data) {\n\t\t\treturn;\n\t\t}\n\n\n\t\t$conflictArray=array();\n\n\t\t$tasks = array();\n\t\t$dayTasksCount = array();\n\t\tfor ($i = 1; $i <= 7; $i++) {\n\t\t\t$dayTasksCount[$i] = 0;\n\t\t\t$conflictArray[$i]=array();\n\t\t\tfor ($j=0; $j < 24; $j++) { \n\t\t\t\t$conflictArray[$i][$j]=0;\n\t\t\t}\n\t\t}\n\t\tforeach ($data as $value) {\n\t\n\t\t\t$day = date('N', $value->task_date->getTimestamp());\n\n\t\t\t$from=$value->task_from==NULL?$value->task_to-1:$value->task_from;\n\t\t\t$to=$value->task_from==NULL?$value->task_to:$value->task_to;\n\t\t\t$date=$value->task_from==NULL?strftime(\"%Y-%m-%d\",$value->task_date->getTimestamp()):\"\";\n\t\t\tif($value->task_type==\"ZK\")\n\t\t\t{\n\t\t\t\t$date=strftime(\"%Y-%m-%d\",$value->task_date->getTimestamp());\n\t\t\t}\n\n\t\t\t//Check exist of time in conflict array\n\t\t\tfor ($i=$from; $i < $to; $i++) { \n\t\t\t\t$conflictArray[$day][$i]+=1;\n\t\t\t}\n\n\t\t\tarray_push($tasks,[\n\t\t\t\t\"task_name\"=>\"[$value->id_course] $value->task_name \".$date,\n\t\t\t\t\"day\"=>$day,\n\t\t\t\t\"task_from\"=>$from,\n\t\t\t\t\"task_to\"=>$to\n\t\t\t\t]);\n\t\t\t\n\t\t}\n\n\t\tforeach ($conflictArray as $key => $value) {\n\t\t\t$dayTasksCount[$key]=max($value);\n\t\t}\n\n\t\tforeach ($tasks as $key => $value) {\n\t\t\t$day_p=\"\";\n\t\t\tswitch ($value[\"day\"]) {\n\t\t\t\tcase 1:\n\t\t\t\t\t$day_p=\"Pondělí\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\t$day_p=\"Úterý\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\t$day_p=\"Středa\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 4:\n\t\t\t\t\t$day_p=\"Čtvrtek\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 5:\n\t\t\t\t\t$day_p=\"Pátek\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 6:\n\t\t\t\t\t$day_p=\"Sobota\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 7:\n\t\t\t\t\t$day_p=\"Neděle\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif($conflictArray[$value[\"day\"]][$value[\"task_from\"]]==0)\n\t\t\t{\n\t\t\t\t$tasks[$key][\"day\"]=$day_p;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$tasks[$key][\"day\"]=$day_p.$conflictArray[$value[\"day\"]][$value[\"task_from\"]];\n\t\t\t$conflictArray[$value[\"day\"]][$value[\"task_from\"]]-=1;\n\t\t}\n\n\t\t\n\t\t$weekDays = array();\n\t\tforeach ($dayTasksCount as $key => $value) {\n\t\t\tif ($value == 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfor ($i = 1; $i <= $value; $i++) {\n\t\t\t\tswitch ($key) {\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tarray_push($weekDays, \"Pondělí$i\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tarray_push($weekDays, \"Úterý$i\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tarray_push($weekDays, \"Středa$i\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\tarray_push($weekDays, \"Čtvrtek$i\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 5:\n\t\t\t\t\t\tarray_push($weekDays, \"Pátek$i\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 6:\n\t\t\t\t\t\tarray_push($weekDays, \"Sobota$i\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 7:\n\t\t\t\t\t\tarray_push($weekDays, \"Neděle$i\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->template->weekDays=Json::encode($weekDays);\n\t\t$this->template->tasks=$tasks;\n\n\t}",
"public function summaryAction()\r\n {\r\n \t$timesheetid = -1;\r\n\r\n // Okay, so if we were passed in a timesheet, it means we want to view\r\n // the data for that timesheet. However, if that timesheet is locked, \r\n // we want to make sure that the tasks being viewed are ONLY those that\r\n // are found in that locked timesheet.\r\n $timesheet = $this->byId();\r\n\r\n $start = null;\r\n $end = null;\r\n $this->view->showLinks = true;\r\n $cats = array();\r\n\r\n $users = $this->userService->getUserList();\r\n\r\n if (!$start) {\r\n\t // The start date, if not set in the parameters, will be just\r\n\t // the previous monday\r\n\t $start = $this->_getParam('start', $this->calculateDefaultStartDate());\r\n\t // $end = $this->_getParam('end', date('Y-m-d', time()));\r\n\t $end = $this->_getParam('end', date('Y-m-d 23:59:59', strtotime($start) + (6 * 86400)));\r\n }\r\n\r\n // lets normalise the end date to make sure it's of 23:59:59\r\n\t\t$end = date('Y-m-d 23:59:59', strtotime($end));\r\n\r\n $order = 'endtime desc';\r\n\r\n $this->view->taskInfo = array();\r\n\r\n $project = null;\r\n if ($this->_getParam('projectid')) {\r\n \t$project = $this->projectService->getProject($this->_getParam('projectid'));\r\n }\r\n \r\n foreach ($users as $user) {\r\n \t$this->view->taskInfo[$user->username] = $this->projectService->getTimesheetReport($user, $project, null, -1, $start, $end, $cats, $order);\r\n }\r\n \r\n $task = new Task();\r\n \r\n $this->view->categories = $task->constraints['category']->getValues();\r\n $this->view->startDate = $start;\r\n $this->view->endDate = $end;\r\n $this->view->params = $this->_getAllParams();\r\n $this->view->dayDivision = za()->getConfig('day_length', 8) / 4; // za()->getConfig('day_division', 2);\r\n $this->view->divisionTolerance = za()->getConfig('division_tolerance', 20);\r\n \r\n $this->renderView('timesheet/user-report.php');\r\n }",
"public function indexAction()\r\n {\r\n \tini_set('memory_limit', '64M');\r\n $validFormats = array('weekly');\r\n $format = 'weekly'; // $this->_getParam('format', 'weekly');\r\n \r\n if (!in_array($format, $validFormats)) {\r\n $this->flash('Format not valid');\r\n $this->renderView('error.php');\r\n return;\r\n }\r\n\r\n $reportingOn = 'Dynamic';\r\n \r\n // -1 will mean that by default, just choose all timesheet records\r\n $timesheetid = -1;\r\n\r\n // Okay, so if we were passed in a timesheet, it means we want to view\r\n // the data for that timesheet. However, if that timesheet is locked, \r\n // we want to make sure that the tasks being viewed are ONLY those that\r\n // are found in that locked timesheet.\r\n $timesheet = $this->byId();\r\n\r\n $start = null;\r\n $end = null;\r\n $this->view->showLinks = true;\r\n $cats = array();\r\n\r\n if ($timesheet) {\r\n $this->_setParam('clientid', $timesheet->clientid);\r\n $this->_setParam('projectid', $timesheet->projectid);\r\n if ($timesheet->locked) {\r\n $timesheetid = $timesheet->id;\r\n $reportingOn = $timesheet->title;\r\n } else {\r\n $timesheetid = 0; \r\n $reportingOn = 'Preview: '.$timesheet->title;\r\n }\r\n if (is_array($timesheet->tasktype)) {\r\n \t$cats = $timesheet->tasktype;\r\n } \r\n\r\n $start = date('Y-m-d 00:00:01', strtotime($timesheet->from));\r\n $end = date('Y-m-d 23:59:59', strtotime($timesheet->to)); \r\n $this->view->showLinks = false;\r\n } else if ($this->_getParam('category')){\r\n \t$cats = array($this->_getParam('category'));\r\n }\r\n \r\n \r\n $project = $this->_getParam('projectid') ? $this->byId($this->_getParam('projectid'), 'Project') : null;\r\n\t\t\r\n\t\t$client = null;\r\n\t\tif (!$project) {\r\n \t$client = $this->_getParam('clientid') ? $this->byId($this->_getParam('clientid'), 'Client') : null;\r\n\t\t}\r\n\t\t\r\n $user = $this->_getParam('username') ? $this->userService->getUserByField('username', $this->_getParam('username')) : null;\r\n \r\n\t\t$this->view->user = $user;\r\n\t\t$this->view->project = $project;\r\n\t\t$this->view->client = $client ? $client : ( $project ? $this->byId($project->clientid, 'Client'):null);\r\n\t\t$this->view->category = $this->_getParam('category');\r\n \r\n if (!$start) {\r\n\t // The start date, if not set in the parameters, will be just\r\n\t // the previous monday\r\n\t $start = $this->_getParam('start', $this->calculateDefaultStartDate());\r\n\t // $end = $this->_getParam('end', date('Y-m-d', time()));\r\n\t $end = $this->_getParam('end', date('Y-m-d 23:59:59', strtotime($start) + (6 * 86400)));\r\n }\r\n \r\n // lets normalise the end date to make sure it's of 23:59:59\r\n\t\t$end = date('Y-m-d 23:59:59', strtotime($end));\r\n\r\n $this->view->title = $reportingOn;\r\n \r\n $order = 'endtime desc';\r\n if ($format == 'weekly') {\r\n $order = 'starttime asc';\r\n }\r\n\r\n $this->view->taskInfo = $this->projectService->getTimesheetReport($user, $project, $client, $timesheetid, $start, $end, $cats, $order);\r\n \r\n // get the hierachy for all the tasks in the task info. Make sure to record how 'deep' the hierarchy is too\r\n\t\t$hierarchies = array();\r\n\r\n\t\t$maxHierarchyLength = 0;\r\n\t\tforeach ($this->view->taskInfo as $taskinfo) {\r\n\t\t\tif (!isset($hierarchies[$taskinfo->taskid])) {\r\n\t\t\t\t$task = $this->projectService->getTask($taskinfo->taskid);\r\n\t\t\t\t$taskHierarchy = array();\r\n\t\t\t\tif ($task) {\r\n\t\t\t\t\t$taskHierarchy = $task->getHierarchy();\r\n\t\t\t\t\tif (count($taskHierarchy) > $maxHierarchyLength) {\r\n\t\t\t\t\t\t$maxHierarchyLength = count($taskHierarchy);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$hierarchies[$taskinfo->taskid] = $taskHierarchy;\r\n\t\t\t} \r\n\t\t}\r\n\t\r\n\t\t$this->view->hierarchies = $hierarchies;\r\n\t\t$this->view->maxHierarchyLength = $maxHierarchyLength;\r\n\r\n $this->view->startDate = $start;\r\n $this->view->endDate = $end;\r\n $this->view->params = $this->_getAllParams();\r\n $this->view->dayDivision = za()->getConfig('day_length', 8) / 4; // za()->getConfig('day_division', 2);\r\n $this->view->divisionTolerance = za()->getConfig('division_tolerance', 20);\r\n \r\n $outputformat = $this->_getParam('outputformat');\r\n if ($outputformat == 'csv') {\r\n \t$this->_response->setHeader(\"Content-type\", \"text/csv\");\r\n\t $this->_response->setHeader(\"Content-Disposition\", \"inline; filename=\\\"timesheet.csv\\\"\");\r\n\r\n\t echo $this->renderRawView('timesheet/csv-export.php');\r\n } else {\r\n\t\t\tif ($this->_getParam('_ajax')) {\r\n\t\t\t\t$this->renderRawView('timesheet/'.$format.'-report.php');\r\n\t\t\t} else {\r\n\t\t\t\t$this->renderView('timesheet/'.$format.'-report.php');\r\n\t\t\t}\r\n }\r\n }",
"public function getIndex()\n\t{\n\t\t\n\t\t//Get the user id of the currently logged in user\n $userId = Sentry::getUser()->id;\n //Current Date\n\t\t$day = date(\"Y-m-d\");\n //Get tasks list for the user\n\t\t$tasks = $this->timesheet->getIndex($userId);\n //Get the entries\n\t\t$entries = $this->timesheet->getEntries($day,$userId);\n //Current Week\n\t\t$week = $this->timesheet->getWeek($day);\n\t\treturn \\View::make('dashboard.timesheet.view')\n\t\t\t\t\t\t->with('week',$week)\n\t\t\t\t\t\t->with('selectedDate',$day)\n\t\t\t\t\t\t->with('entries', $entries)\n\t\t\t\t\t\t->with('tasks',$tasks);\n\t}",
"public function index()\n {\n $user = $this->getUser();\n $from = $this->request->getStringParam('from', date('Y-m-d'));\n $to = $this->request->getStringParam('to', date('Y-m-d', strtotime('next week')));\n $timetable = $this->timetable->calculate($user['id'], new DateTime($from), new DateTime($to));\n\n $this->response->html($this->helper->layout->user('timetable:timetable/index', array(\n 'user' => $user,\n 'timetable' => $timetable,\n 'values' => array(\n 'from' => $from,\n 'to' => $to,\n 'plugin' => 'timetable',\n 'controller' => 'timetable',\n 'action' => 'index',\n 'user_id' => $user['id'],\n ),\n )));\n }",
"public function detailedtimesheetAction()\r\n {\r\n $project = $this->projectService->getProject($this->_getParam('projectid'));\r\n $client = $this->clientService->getClient($this->_getParam('clientid'));\r\n $task = $this->projectService->getTask($this->_getParam('taskid'));\r\n $user = $this->userService->getUserByField('username', $this->_getParam('username'));\r\n\t\t\r\n if (!$project && !$client && !$task && !$user) {\r\n return;\r\n }\r\n\r\n\t\tif ($task) { \r\n $this->view->records = $this->projectService->getDetailedTimesheet(null, $task->id);\r\n } else if ($project) {\r\n \r\n $start = null;\r\n $this->view->records = $this->projectService->getDetailedTimesheet(null, null, $project->id);\r\n } else if ($client) {\r\n \r\n $start = null;\r\n $this->view->records = $this->projectService->getDetailedTimesheet(null, null, null, $client->id);\r\n } else if ($user) {\r\n\t\t\t$this->view->records = $this->projectService->getDetailedTimesheet($user);\r\n\t\t}\r\n\r\n\t\t$this->view->task = $task;\r\n $this->renderRawView('timesheet/ajax-timesheet-details.php');\r\n }",
"public function indexTomorrow()\n {\n $carbon = new Carbon(); \n // On récupère après demain à minuit, soit la date maximale des tâches\n $tomorrowTimestamp = $carbon->create('tomorrow')->timestamp + 86400;\n // On effectue notre requête en spécifiant une date de fin maximale à $tomorrowTimestamp\n $tasks = Task::select()->where('user_id', Auth::user()->id)->where('end_date', '<', date(\"Y-m-d H:i:s\", $tomorrowTimestamp) )->orderBy(\"end_date\", \"asc\")->paginate(9);\n return view('tasks.tasks', compact('tasks'));\n }",
"public function filterAction()\r\n {\r\n \t/*\r\n \t * form needs to include:\r\n \t * \r\n \t * user id\r\n \t * task category\r\n \t * client id\r\n \t * project id\r\n \t * start date\r\n \t * end date\r\n \t */\r\n $this->view->allUsers = $this->userService->getUserList();\r\n $task = new Task();\r\n $this->view->categories = $task->constraints['category']->getValues();\r\n $this->view->clients = $this->clientService->getClients();\r\n \t $this->view->projects = new ArrayObject();\r\n $this->renderView('timesheet/filter.php'); \t\r\n }",
"public function listTasks()\n\t{\n\t\t$this->import('BackendUser', 'User');\n\n\t\t$tasksReg = 0;\n\t\t$tasksNew = 0;\n\t\t$tasksDue = 0;\n\t\t$arrReturn = array();\n\n\t\t$objTask = $this->Database->prepare(\"SELECT t.deadline, s.status, s.assignedTo FROM tl_task t LEFT JOIN tl_task_status s ON t.id=s.pid AND s.tstamp=(SELECT MAX(tstamp) FROM tl_task_status ts WHERE ts.pid=t.id)\" . (!$this->User->isAdmin ? \" WHERE (t.createdBy=? OR s.assignedTo=?)\" : \"\"))\n\t\t\t\t\t\t\t\t ->execute($this->User->id, $this->User->id);\n\n\t\tif ($objTask->numRows) \n\t\t{\n\t\t\t$time = time();\n\n\t\t\twhile ($objTask->next())\n\t\t\t{\n\t\t\t\tif ($objTask->status == 'completed')\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ($objTask->deadline <= $time)\n\t\t\t\t{\n\t\t\t\t\t++$tasksDue;\n\t\t\t\t}\n\t\t\t\telseif ($objTask->status == 'created' && $objTask->assignedTo == $this->User->id)\n\t\t\t\t{\n\t\t\t\t\t++$tasksNew;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t++$tasksReg;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($tasksReg > 0)\n\t\t\t{\n\t\t\t\t$arrReturn[] = '<p class=\"tl_info\">' . sprintf($GLOBALS['TL_LANG']['MSC']['tasksCur'], $tasksReg) . '</p>';\n\t\t\t}\n\n\t\t\tif ($tasksNew > 0)\n\t\t\t{\n\t\t\t\t$arrReturn[] = '<p class=\"tl_new\">' . sprintf($GLOBALS['TL_LANG']['MSC']['tasksNew'], $tasksNew) . '</p>';\n\t\t\t}\n\n\t\t\tif ($tasksDue > 0)\n\t\t\t{\n\t\t\t\t$arrReturn[] = '<p class=\"tl_error\">' . sprintf($GLOBALS['TL_LANG']['MSC']['tasksDue'], $tasksDue) . '</p>';\n\t\t\t}\n\t\t}\n\n\t\treturn implode(\"\\n\", $arrReturn);\n\t}",
"function show_project_timeline($project_id){\n\n$pr=new project($project_id);\n$work_arr=$pr->current_timeline($project_id);\nfor($t=0;$t<sizeof($work_arr);$t++){\n$task1=new task($work_arr[$t]['w_id']);\n$mb1=new member($task1->alloted_by);\n$mb2=new member($task1->alloted_to);\n// show the csss view for the resulting timeline \n?>\n\n<div class=\"sl-item sl-primary\">\n <div class=\"sl-content\">\n <small class=\"text-muted\"><?php echo $this->return_timespan($task1->starts_at);?></small>\n <p><?php echo $task1->title?></p>\n </div>\n</div>\n\n\n\n<?php \n}\n?>\n<a href=\"all-task.php?projectid=<?php echo $project_id;?>\" style=\"color:red\">All activities</a>\n<?php \n}",
"public function actionCalendar()\n {\n // Get current ID of logined user\n $userId = Yii::$app->user->getId() ?: '1000';\n $profile = (new UsersProfile())->getProfile();\n\n // Fill array keyes with [1, .., date(\"t\")].\n // date(\"t\") - count of days in current month\n $calendar = array_fill_keys(range(1, date(\"t\")), []);\n $model = new TaskQuery(Task::class);\n\n foreach ($model->getByCurrentMonth($userId)->all() as $task) {\n // Get current $task->date and create new DateTime object\n // $date->format(\"j\") -- Day of the month: 1, 2, .., 31\n // Fill array $calender with $task objects\n $date = \\DateTime::createFromFormat(\"Y-m-d H:i:s\", $task->deadline);\n $calendar[$date->format(\"j\")][] = $task;\n }\n\n return $this->render('calendar', \\compact('calendar', 'profile'));\n }",
"public function timesheets(TimeEntry $timer)\n {\n $range = explode('-', $this->request->range);\n $start_date = date('Y-m-d', strtotime($range[0]));\n $end_date = date('Y-m-d', strtotime($range[1]));\n $this->request->request->add(['date_range' => [$start_date, $end_date]]);\n $entries = $timer->apply($this->request->except(['range']))->with(['user:id,username,name'])->get();\n $html = view('analytics::_ajax._timesheets', compact('entries'))->render();\n\n return response()->json(['status' => 'success', 'html' => $html, 'message' => 'Processed successfully'], 200);\n }",
"public function tasks(Task $task)\n {\n $range = explode('-', $this->request->range);\n $start_date = date('Y-m-d', strtotime($range[0]));\n $end_date = date('Y-m-d', strtotime($range[1]));\n $this->request->request->add(['date_range' => [$start_date, $end_date]]);\n $tasks = $task->apply($this->request->except(['range']))->with(['AsProject:id,name', 'AsMilestone:id,milestone_name'])->get();\n $html = view('analytics::_ajax._tasks', compact('tasks'))->render();\n\n return response()->json(['status' => 'success', 'html' => $html, 'message' => 'Processed successfully'], 200);\n }",
"public function timeline_tasks()\n {\n $user = factory(User::class)->create();\n\n $this->actingAs($user);\n\n $task = factory(Task::class)->create();\n \n// $task = Task::create([\n// 'name' => 'New Task',\n// 'description' => 'prova',\n// 'completed' => true,\n// 'user_id' => $user->id\n// ]);\n \n// $task2 = Task::find($task->id);\n\n $response = $this->get('tasks/timeline');\n\n $task_event = TaskEvent::all();\n\n $response->assertSuccessful();\n $response->assertViewIs('tasks.timeline');\n $response->assertViewHas('task_event', $task_event);\n $response->assertSee(\"User \".$user->name.\" created task \".$task->name.\" at \".$task->created_at);\n $response->assertSee(\"User \".$user->name.\" updated task \".$task->name);\n $response->assertSee(\"User \".$user->name.\" deleted task \".$task->name);\n }",
"public function index()\n {\n $tasks = Task::getDashboardTasks(Auth::user()->id);\n \n $dateFrom = date('Y-m') . '-01';\n $dateTo = date('Y-m-t');\n \n $salesWon = Sale::findWonWithinPeriod($dateFrom, $dateTo, Auth::user()->id);\n $salesTotal = Sale::findWithinPeriod($dateFrom, $dateTo, Auth::user()->id);\n\n $callsWon = Task::findWonWithinPeriod($dateFrom, $dateTo, Auth::user()->id, 1);\n $callsTotal = Task::findWithinPeriod($dateFrom, $dateTo, Auth::user()->id, 1);\n\n $meetsWon = Task::findWonWithinPeriod($dateFrom, $dateTo, Auth::user()->id, 2);\n $meetsTotal = Task::findWithinPeriod($dateFrom, $dateTo, Auth::user()->id, 2);\n \n $yearlySales = Sale::findYearlySales(Auth::user()->id);\n \n return view('dashboard.index', compact('tasks', 'salesWon', 'salesTotal', 'callsWon', 'callsTotal', 'meetsWon', 'meetsTotal', 'yearlySales'));\n }",
"public function index()\n {\n $month_number_lists = [];\n $month_name_lists = [];\n $on_progress_lists = [];\n $overdue_lists = [];\n $completed_overdue_lists = [];\n $approved_lists = [];\n\n $users = [];\n $user_name_lists = [];\n $complete_percentage_lists = [];\n $child_lists = [];\n\n $total_tasks = [];\n $on_progress = [];\n $done = [];\n $approved = [];\n $rejected = [];\n $over_due = [];\n $on_progress_overdue = [];\n\n $today = date(\"Y-m-d\");\n $start_date = Carbon::now()->startOfMonth()->toDateString();\n $end_date = Carbon::now()->endOfMonth()->toDateString();\n\n $date = Carbon::now();\n $current_user_id = Auth::user()->id;\n $system_permission = DB::table('system_permissions')->where('user_id', $current_user_id)->first();\n\n $startOfYear = $date->copy()->startOfYear()->toDateString();\n $endOfYear = $date->copy()->endOfYear()->toDateString();\n\n $interval = CarbonPeriod::create($startOfYear,'1 month', $endOfYear);\n\n foreach ($interval as $dt) {\n array_push($month_name_lists, $dt->format(\"M\"));\n array_push($month_number_lists, $dt->format(\"m\"));\n }\n\n if(Entrust::hasRole(\"EMPLOYEE\")){\n foreach($month_number_lists as $month_number){\n $all_onprogress_tasks= DB::table('all_tasks')\n ->whereBetween('all_tasks.task_date',[$startOfYear, $endOfYear])\n ->whereMonth('all_tasks.task_date', $month_number)\n ->where('status', '=', 'On Progress')\n ->where('pic_userid', $current_user_id)\n ->count();\n array_push($on_progress_lists, $all_onprogress_tasks);\n\n $all_approved_tasks = DB::table('all_tasks')\n ->whereBetween('all_tasks.task_date',[$startOfYear, $endOfYear])\n ->where('status', '=', 'Approved')\n ->whereMonth('all_tasks.task_date', $month_number)\n ->where('pic_userid', $current_user_id)\n ->count(); \n array_push($approved_lists, $all_approved_tasks);\n\n $all_overdue_tasks = DB::table('all_tasks')\n ->whereBetween('all_tasks.task_date',[$startOfYear, $endOfYear])\n ->where('status', '=', 'On Progress')\n ->whereMonth('all_tasks.task_date', $month_number)\n ->whereDate('task_date', '<', $today)\n ->where('pic_userid', $current_user_id)\n ->count();\n array_push($overdue_lists, $all_overdue_tasks);\n\n $all_completed_over_tasks = DB::table('all_tasks')\n ->whereBetween('all_tasks.task_date',[$startOfYear, $endOfYear])\n ->where('status', '=', 'Approved')\n ->whereMonth('all_tasks.task_date', $month_number)\n ->where('task_date', '<', DB::raw(\"(DATE_FORMAT(done_date, '%Y-%m-%d'))\"))\n ->where('pic_userid', $current_user_id)\n ->count();\n array_push($completed_overdue_lists, $all_completed_over_tasks);\n }\n\n //get tasks for performance section\n $total_tasks = DB::table('all_tasks')->whereBetween('task_date', [$start_date, $end_date])->where('pic_userid', $current_user_id)->get();\n $on_progress = DB::table('all_tasks')->where('status', '=', 'On Progress')->whereBetween('task_date', [$start_date, $end_date])->where('pic_userid', $current_user_id)->get();\n $done = DB::table('all_tasks')->where('status', '=', 'Done')->where('pic_userid', $current_user_id)->whereBetween('task_date', [$start_date, $end_date])->get();\n $approved = DB::table('all_tasks')->where('status', '=', 'Approved')->where('pic_userid', $current_user_id)->whereBetween('task_date', [$start_date, $end_date])->get();\n $rejected = DB::table('all_tasks')->where('status', '=', 'Rejected')->where('pic_userid', $current_user_id)->whereBetween('task_date', [$start_date, $end_date])->get();\n $over_due = DB::table('all_tasks')->where('status', '=', 'On Progress')->whereDate('task_date', '<', $today)->whereBetween('task_date', [$start_date, $end_date])->where('pic_userid', $current_user_id)->get();\n }\n\n $childs = DB::select('call getAllChildUsers(?)', array(Auth::user()->department));\n for ($i=0; $i < count($childs); $i++) { \n if($childs[$i]->id != Auth::user()->id && $childs[$i]->id != 1)\n array_push($users, $childs[$i]);\n }\n for ($i=0; $i < count($users); $i++) { \n array_push($child_lists, $users[$i]->id);\n }\n \\Session::put('child_user_lists', $child_lists);\n\n if(Entrust::hasRole(\"OFFICER\") || Entrust::hasRole(\"SUPER_ADMIN\")){\n \n $all_assigned_tasks = DB::table('tasks_by_pic')\n ->select('task_date', 'pic', 'pic_userid', DB::raw('SUM(total_tasks) as total_tasks'), \n DB::raw('SUM(on_progress) as on_progress'), DB::raw('SUM(approved) as approved'), \n DB::raw('SUM(approved_overdue) as approved_overdue'), DB::raw('SUM(on_progress_overdue) as on_progress_overdue'),\n DB::raw('SUM(done) as done'))\n ->whereBetween('task_date', [$start_date, $end_date])\n ->whereBetween('task_date',[$startOfYear, $endOfYear])\n ->whereIn('pic_userid', $child_lists)\n ->groupby('pic_userid')->get();\n\n //for percentage chart\n foreach($all_assigned_tasks as $assigned_task){\n if($assigned_task->approved != 0 && $assigned_task->total_tasks != 0){\n $assigned_task->complete_percentage = number_format(($assigned_task->approved / $assigned_task->total_tasks)* 100, 0) ;\n } else {\n $assigned_task->complete_percentage = 0;\n }\n array_push($user_name_lists, $assigned_task->pic);\n array_push($complete_percentage_lists, $assigned_task->complete_percentage);\n array_push($on_progress, $assigned_task->on_progress);\n array_push($approved, $assigned_task->approved);\n array_push($over_due, $assigned_task->approved_overdue);\n array_push($done, $assigned_task->done);\n array_push($on_progress_overdue, $assigned_task->on_progress_overdue);\n }\n }\n \n // get announcements data for announcement section\n $announcements = Announcement::whereDate('startdate', '<=', $today)->whereDate('enddate', '>=', $today)->whereNull('deleted_at')->get();\n\n try{\n $client = new Client();\n $response = $client->request('GET', 'https://cloud.acedatasystems.com:8028/api/smarthr/gettodayleaves');\n $statusCode = $response->getStatusCode();\n $leave_ppl_lists = json_decode($response->getBody()->getContents(), true);\n }catch(Exception $e){\n $leave_ppl_lists = [];\n }\n\n return view('la.dashboard',[\n 'total_tasks' => $total_tasks,\n 'announcements' => $announcements,\n 'on_progress' => $on_progress,\n 'done' => $done,\n 'approved' => $approved,\n 'over_due' => $over_due,\n 'rejected' => $rejected,\n 'month_number_lists' => $month_number_lists, // Jan, Feb\n 'month_name_lists' => $month_name_lists, // 01, 02\n 'approved_lists' => $approved_lists,\n 'on_progress_lists' => $on_progress_lists,\n 'overdue_lists' => $overdue_lists,\n 'completed_overdue_lists' => $completed_overdue_lists,\n 'complete_percentage_lists' => $complete_percentage_lists,\n 'user_name_lists' => $user_name_lists,\n 'on_progress_overdue' => $on_progress_overdue,\n 'users' => $users,\n 'leave_ppl_lists' => $leave_ppl_lists,\n 'system_permission' => $system_permission\n ]);\n }",
"public function index()\n {\n $business_id = request()->session()->get('user.business_id');\n $is_admin = $this->commonUtil->is_admin(auth()->user(), $business_id);\n $user = request()->session()->get('user');\n $statuses = ProjectTask::taskStatuses();\n \n if (!(auth()->user()->can('superadmin') || $this->moduleUtil->hasThePermissionInSubscription($business_id, 'project_module'))) {\n abort(403, 'Unauthorized action.');\n }\n\n if (request()->ajax()) {\n $project_task = ProjectTask::with(['members', 'createdBy', 'project', 'comments'])\n ->where('business_id', $business_id)\n ->select('*');\n\n //if user is not admin get assiged task only\n $user_id = $user['id'];\n if (empty(request()->get('project_id')) && !$is_admin) {\n $project_task->whereHas('members', function ($q) use ($user_id) {\n $q->where('user_id', $user_id);\n });\n }\n\n //filter by project id\n if (!empty(request()->get('project_id'))) {\n $project_task->where('project_id', request()->get('project_id'));\n }\n\n //filter by assigned to\n if (!empty(request()->get('user_id'))) {\n $user_id = request()->get('user_id');\n $project_task->whereHas('members', function ($q) use ($user_id) {\n $q->where('user_id', $user_id);\n });\n }\n\n // filter by status\n if (!empty(request()->get('status'))) {\n $project_task->where('status', request()->get('status'));\n }\n\n // filter by priority\n if (!empty(request()->get('priority'))) {\n $project_task->where('priority', request()->get('priority'));\n }\n\n // filter by due date\n if (!empty(request()->get('due_date'))) {\n if (request()->get('due_date') == 'overdue') {\n $project_task->where('due_date', '<', Carbon::today())\n ->where('status', '!=', 'completed');\n } elseif (request()->get('due_date') == 'today') {\n $project_task->where('due_date', Carbon::today())\n ->where('status', '!=', 'completed');\n } elseif (request()->get('due_date') == 'less_than_one_week') {\n $project_task->whereBetween('due_date', [Carbon::today(), Carbon::today()->addWeek()])\n ->where('status', '!=', 'completed');\n }\n }\n\n // check if user can crud task\n $project_id = request()->get('project_id');\n $project = Project::find($project_id);\n $is_lead = $this->projectUtil->isProjectLead(auth()->user()->id, $project_id);\n $is_member = $this->projectUtil->isProjectMember(auth()->user()->id, $project_id);\n\n $can_crud = false;\n if ($is_admin || $is_lead) {\n $can_crud = true;\n } elseif ($is_member && (isset($project->settings['members_crud_task']) && $project->settings['members_crud_task'])) {\n $can_crud = true;\n }\n\n if (request()->get('task_view') == 'list_view') {\n return Datatables::of($project_task)\n ->addColumn('action', function ($row) use ($can_crud) {\n $html = '<div class=\"btn-group\">\n <button class=\"btn btn-info dropdown-toggle btn-xs\" type=\"button\" data-toggle=\"dropdown\" aria-expanded=\"false\">\n '. __(\"messages.action\").'\n <span class=\"caret\"></span>\n <span class=\"sr-only\">'\n . __(\"messages.action\").'\n </span>\n </button>\n <ul class=\"dropdown-menu dropdown-menu-left\" role=\"menu\">\n <li>\n <a data-href=\"' . action('\\Modules\\Project\\Http\\Controllers\\TaskController@show', ['id' => $row->id, 'project_id' => $row->project_id]) . '\" class=\"cursor-pointer view_a_project_task\">\n <i class=\"fa fa-eye\"></i>\n '.__(\"messages.view\").'\n </a>\n </li>\n <li>\n <a data-href=\"' . action('\\Modules\\Project\\Http\\Controllers\\TaskController@getTaskStatus', ['id' => $row->id, 'project_id' => $row->project_id]) . '\"class=\"cursor-pointer change_status_of_project_task\">\n <i class=\"fa fa-check\"></i>\n '.__(\"project::lang.change_status\").'\n </a>\n </li>';\n\n if ($can_crud) {\n $html .= '<li>\n <a data-href=\"' . action('\\Modules\\Project\\Http\\Controllers\\TaskController@edit', ['id' => $row->id, 'project_id' => $row->project_id]) . '\" class=\"cursor-pointer edit_a_project_task\">\n <i class=\"fa fa-edit\"></i>\n '.__(\"messages.edit\").'\n </a>\n </li>\n <li>\n <a data-href=\"' . action('\\Modules\\Project\\Http\\Controllers\\TaskController@destroy', ['id' => $row->id, 'project_id' => $row->project_id]) . '\" class=\"cursor-pointer delete_a_project_task\">\n <i class=\"fas fa-trash\"></i>\n '.__(\"messages.delete\").'\n </a>\n </li>';\n }\n\n $html .= '</ul>\n </div>';\n\n return $html;\n })\n ->editColumn('priority', function ($row) {\n $priority = __('project::lang.'.$row->priority);\n\n $html = '<span class=\"label '.$this->priority_colors[$row->priority].'\">'.\n $priority\n .'</span>';\n\n \n return $html;\n })\n ->editColumn('start_date', '\n @if(isset($start_date))\n {{@format_date($start_date)}}\n @endif\n ')\n ->editColumn('due_date', '\n @if(isset($due_date))\n {{@format_date($due_date)}}\n @endif\n ')\n ->editColumn('createdBy', function ($row) {\n return optional($row->createdBy)->user_full_name;\n })\n ->editColumn('project', function ($row) {\n return $row->project->name;\n })\n ->editColumn('members', function ($row) {\n $html = ' ';\n foreach ($row->members as $member) {\n if (isset($member->media->display_url)) {\n $html .= '<img class=\"user_avatar\" src=\"'.$member->media->display_url.'\" data-toggle=\"tooltip\" title=\"'.$member->user_full_name.'\">';\n } else {\n $html .= '<img class=\"user_avatar\" src=\"https://ui-avatars.com/api/?name='.$member->first_name.'\" data-toggle=\"tooltip\" title=\"'.$member->user_full_name.'\">';\n }\n }\n\n return $html;\n })\n ->editColumn('status', function ($row) {\n if ($row->status == 'completed') {\n $status = __('project::lang.completed');\n $bg = 'bg-green';\n } elseif ($row->status == 'cancelled') {\n $status = __('project::lang.cancelled');\n $bg = 'bg-red';\n } elseif ($row->status == 'on_hold') {\n $status = __('project::lang.on_hold');\n $bg = 'bg-yellow';\n } elseif ($row->status == 'in_progress') {\n $status = __('project::lang.in_progress');\n $bg = 'bg-info';\n } elseif ($row->status == 'not_started') {\n $status = __('project::lang.not_started');\n $bg = 'bg-red';\n }\n\n $href = action(\"\\Modules\\Project\\Http\\Controllers\\TaskController@getTaskStatus\", [\"id\" => $row->id, \"project_id\" => $row->project_id]);\n\n $html = '<span class=\"cursor-pointer change_status_of_project_task label '.$bg.'\" data-href=\"'.$href.'\">\n '.\n $status\n .'</span>';\n\n return $html;\n })\n ->editColumn('subject', '\n <a data-href=\"{{action(\"\\Modules\\Project\\Http\\Controllers\\TaskController@show\", [\"id\" => $id, \"project_id\" => $project_id])}}\" class=\"cursor-pointer view_a_project_task text-black\">\n {{$subject}} <code>{{$task_id}}</code>\n </a>\n ')\n ->removeColumn('id')\n ->rawColumns(['action', 'project', 'subject', 'members', 'priority', 'start_date', 'due_date', 'status', 'createdBy'])\n ->make(true);\n } elseif (request()->get('task_view') == 'kanban') {\n $project_task = $project_task->get()->groupBy('status');\n\n //sort array based on status\n $project_tasks = [];\n foreach ($statuses as $key => $value) {\n if (!isset($project_task[$key])) {\n $project_tasks[$key] = [];\n } else {\n $project_tasks[$key] = $project_task[$key];\n }\n }\n\n $kanban_tasks = [];\n foreach ($project_tasks as $key => $tasks) {\n //get all the card for particular board(status)\n $cards = [];\n foreach ($tasks as $task) {\n $edit = '';\n $delete = '';\n if ($can_crud) {\n $edit = action('\\Modules\\Project\\Http\\Controllers\\TaskController@edit', ['id' => $task->id, 'project_id' => $task->project_id]);\n\n $delete = action('\\Modules\\Project\\Http\\Controllers\\TaskController@destroy', ['id' => $task->id, 'project_id' => $task->project_id]);\n }\n\n $view = action('\\Modules\\Project\\Http\\Controllers\\TaskController@show', ['id' => $task->id, 'project_id' => $task->project_id]);\n\n //if member then get their avatar\n if ($task->members->count() > 0) {\n $assigned_to = [];\n foreach ($task->members as $member) {\n if (isset($member->media->display_url)) {\n $assigned_to[$member->user_full_name] = $member->media->display_url;\n } else {\n $assigned_to[$member->user_full_name] = \"https://ui-avatars.com/api/?name=\".$member->first_name;\n }\n }\n }\n\n $cards[] = [\n 'id' => $task->id,\n 'title' => $task->subject,\n 'project_id' => $task->project_id,\n 'project' => $task->project->name,\n 'subtitle' => $task->task_id,\n 'viewUrl' => $view,\n 'viewUrlClass' => 'view_a_project_task',\n 'editUrl' => $edit,\n 'editUrlClass' => 'edit_a_project_task',\n 'deleteUrl' => $delete,\n 'deleteUrlClass' => 'delete_a_project_task',\n 'hasDescription' => !empty($task->description) ?: false,\n 'hasComments' => ($task->comments->count() > 0) ?: false,\n 'dueDate' => $task->due_date,\n 'assigned_to' => $assigned_to,\n 'tags' => [__('project::lang.'.$task->priority)],\n ];\n }\n\n //get all the card & board title for particular board(status)\n $kanban_tasks[] = [\n 'id' => $key,\n 'title' => __('project::lang.'.$key),\n 'cards' => $cards,\n ];\n }\n\n $output = [\n 'success' => true,\n 'project_tasks' => $kanban_tasks,\n 'msg' => __('lang_v1.success')\n ];\n\n return $output;\n }\n }\n\n $business_id = request()->session()->get('user.business_id');\n $users = User::forDropdown($business_id, false);\n $priorities = ProjectTask::prioritiesDropdown();\n $due_dates = ProjectTask::dueDatesDropdown();\n\n // if not admin get assigned project for filter\n $user_id = null;\n if (!$is_admin) {\n $user_id = $user['id'];\n }\n\n $projects = Project::projectDropdown($business_id, $user_id);\n\n return view('project::my_task.index')\n ->with(compact('users', 'statuses', 'priorities', 'due_dates', 'projects', 'is_admin'));\n }",
"public function index()\n {\n $taskList = Task::doesntHave('user')->orderBy('deadline', 'asc')->get();\n return view('tasks.tasks', ['taskList' => $taskList]);\n }",
"public function mytimesheet($start = null, $end = null)\n\t{\n\n\t\t$me = (new CommonController)->get_current_user();\n\t\t// $auth = Auth::user();\n\t\t//\n\t\t// $me = DB::table('users')\n\t\t// ->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"User\" Group By TargetId) as max'), 'max.TargetId', '=', 'users.Id')\n\t\t// ->leftJoin('files', 'files.Id', '=', DB::raw('max.`maxid` and files.`Type`=\"User\"'))\n\t\t// // ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'users.Id')\n\t\t// ->where('users.Id', '=',$auth -> Id)\n\t\t// ->first();\n\n\t\t// $showleave = DB::table('leaves')\n\t\t// ->leftJoin('leavestatuses', 'leaves.Id', '=', 'leavestatuses.LeaveId')\n\t\t// ->leftJoin('users as applicant', 'leaves.UserId', '=', 'applicant.Id')\n\t\t// ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'applicant.Id')\n\t\t// ->leftJoin('users as approver', 'leavestatuses.UserId', '=', 'approver.Id')\n\t\t// ->select('leaves.Id','applicant.Name','leaves.Leave_Type','leaves.Leave_Term','leaves.Start_Date','leaves.End_Date','leaves.Reason','leaves.created_at as Application_Date','approver.Name as Approver','leavestatuses.Leave_Status as Status','leavestatuses.updated_at as Review_Date','leavestatuses.Comment')\n\t\t// ->where('accesscontrols.Show_Leave_To_Public', '=', 1)\n\t\t// ->orderBy('leaves.Id','desc')\n\t\t// ->get();\n\t\t$d=date('d');\n\n\t\tif ($start==null)\n\t\t{\n\n\t\t\tif($d>=21)\n\t\t\t{\n\n\t\t\t\t$start=date('d-M-Y', strtotime('first day of this month'));\n\t\t\t\t$start = date('d-M-Y', strtotime($start . \" +20 days\"));\n\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t$start=date('d-M-Y', strtotime('first day of last month'));\n\t\t\t\t$start = date('d-M-Y', strtotime($start . \" +20 days\"));\n\n\t\t\t}\n\t\t}\n\n\t\tif ($end==null)\n\t\t{\n\t\t\tif($d>=21)\n\t\t\t{\n\n\t\t\t\t$end=date('d-M-Y', strtotime('first day of next month'));\n\t\t\t\t$end = date('d-M-Y', strtotime($end . \" +19 days\"));\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t$end=date('d-M-Y', strtotime('first day of this month'));\n\t\t\t\t$end = date('d-M-Y', strtotime($end . \" +19 days\"));\n\n\t\t\t}\n\n\t\t}\n\n\t\t$mytimesheet = DB::table('timesheets')\n\t\t->select('timesheets.Id','timesheets.UserId','timesheets.Latitude_In','timesheets.Longitude_In','timesheets.Latitude_Out','timesheets.Longitude_Out','timesheets.Date',DB::raw('\"\" as Day'),'holidays.Holiday','timesheets.Site_Name','timesheets.Check_In_Type','leaves.Leave_Type','leavestatuses.Leave_Status',\n\t\t'timesheets.Time_In','timesheets.Time_Out','timesheets.Leader_Member','timesheets.Next_Person','timesheets.State','timesheets.Work_Description','timesheets.Remarks','approver.Name as Approver','timesheetstatuses.Status','leaves.Leave_Type','timesheetstatuses.Comment','timesheetstatuses.updated_at as Updated_At','files.Web_Path')\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"Timesheet\" Group By TargetId) as maxfile'), 'maxfile.TargetId', '=', 'timesheets.Id')\n\t\t->leftJoin('files', 'files.Id', '=', DB::raw('maxfile.`maxid` and files.`Type`=\"Timesheet\"'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TimesheetId from timesheetstatuses Group By TimesheetId) as max'), 'max.TimesheetId', '=', 'timesheets.Id')\n\t\t->leftJoin('timesheetstatuses', 'timesheetstatuses.Id', '=', DB::raw('max.`maxid`'))\n\t\t->leftJoin('users as approver', 'timesheetstatuses.UserId', '=', 'approver.Id')\n\t\t// ->leftJoin('leaves','leaves.UserId','=',DB::raw('timesheets.Id AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(leaves.Start_Date,\"%d-%M-%Y\") and str_to_date(leaves.End_Date,\"%d-%M-%Y\")'))\n\t\t->leftJoin('leaves','leaves.UserId','=',DB::raw($me->UserId.' AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(leaves.Start_Date,\"%d-%M-%Y\") and str_to_date(leaves.End_Date,\"%d-%M-%Y\")'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,LeaveId from leavestatuses Group By LeaveId) as maxleave'), 'maxleave.LeaveId', '=', 'leaves.Id')\n\t\t->leftJoin('leavestatuses', 'leavestatuses.Id', '=', DB::raw('maxleave.`maxid`'))\n\t\t->leftJoin('holidays',DB::raw('1'),'=',DB::raw('1 AND str_to_date(timesheets.Date,\"%d-%M-%Y\") Between str_to_date(holidays.Start_Date,\"%d-%M-%Y\") and str_to_date(holidays.End_Date,\"%d-%M-%Y\")'))\n\t\t->where('timesheets.UserId', '=', $me->UserId)\n\t\t->where(DB::raw('str_to_date(timesheets.Date,\"%d-%M-%Y\")'), '>=', DB::raw('str_to_date(\"'.$start.'\",\"%d-%M-%Y\")'))\n\t\t->where(DB::raw('str_to_date(timesheets.Date,\"%d-%M-%Y\")'), '<=', DB::raw('str_to_date(\"'.$end.'\",\"%d-%M-%Y\")'))\n\t\t->orderBy('timesheets.Id','desc')\n\t\t->get();\n\n\t\t$user = DB::table('users')->select('users.Id','StaffId','Name','Password','User_Type','Company_Email','Personal_Email','Contact_No_1','Contact_No_2','Nationality','Permanent_Address','Current_Address','Home_Base','DOB','NRIC','Passport_No','Gender','Marital_Status','Position','Emergency_Contact_Person',\n\t\t'Emergency_Contact_No','Emergency_Contact_Relationship','Emergency_Contact_Address','files.Web_Path')\n\t\t// ->leftJoin('files', 'files.TargetId', '=', DB::raw('users.`Id` and files.`Type`=\"User\"'))\n\t\t->leftJoin( DB::raw('(select Max(Id) as maxid,TargetId from files where Type=\"User\" Group By Type,TargetId) as max'), 'max.TargetId', '=', 'users.Id')\n\t\t->leftJoin('files', 'files.Id', '=', DB::raw('max.`maxid` and files.`Type`=\"User\"'))\n\t\t->where('users.Id', '=', $me->UserId)\n\t\t->first();\n\n\t\t$arrDate = array();\n\t\t$arrDate2 = array();\n\t\t$arrInsert = array();\n\n\t\tforeach ($mytimesheet as $timesheet) {\n\t\t\t# code...\n\t\t\tarray_push($arrDate,$timesheet->Date);\n\t\t}\n\n\t\t$startTime = strtotime($start);\n\t\t$endTime = strtotime($end);\n\n\t\t// Loop between timestamps, 1 day at a time\n\t\tdo {\n\n\t\t\t if (!in_array(date('d-M-Y', $startTime),$arrDate))\n\t\t\t {\n\t\t\t\t array_push($arrDate2,date('d-M-Y', $startTime));\n\t\t\t }\n\n\t\t\t $startTime = strtotime('+1 day',$startTime);\n\n\t\t} while ($startTime <= $endTime);\n\n\t\tforeach ($arrDate2 as $date) {\n\t\t\t# code...\n\t\t\tarray_push($arrInsert,array('UserId'=>$me->UserId, 'Date'=> $date, 'updated_at'=>date('Y-m-d H:i:s')));\n\n\t\t}\n\n\t\tDB::table('timesheets')->insert($arrInsert);\n\n\t\t$options= DB::table('options')\n\t\t->whereIn('Table', [\"users\",\"timesheets\"])\n\t\t->orderBy('Table','asc')\n\t\t->orderBy('Option','asc')\n\t\t->get();\n\n // $mytimesheet = DB::table('timesheets')\n // ->leftJoin('users as submitter', 'timesheets.UserId', '=', 'submitter.Id')\n // ->select('timesheets.Id','submitter.Name','timesheets.Timesheet_Name','timesheets.Date','timesheets.Remarks')\n // ->where('timesheets.UserId', '=', $me->UserId)\n\t\t\t// ->orderBy('timesheets.Id','desc')\n // ->get();\n\n\t\t\t// $hierarchy = DB::table('users')\n\t\t\t// ->select('L2.Id as L2Id','L2.Name as L2Name','L2.Timesheet_1st_Approval as L21st','L2.Timesheet_2nd_Approval as L22nd',\n\t\t\t// 'L3.Id as L3Id','L3.Name as L3Name','L3.Timesheet_1st_Approval as L31st','L3.Timesheet_2nd_Approval as L32nd')\n\t\t\t// ->leftJoin(DB::raw(\"(select users.Id,users.Name,users.SuperiorId,accesscontrols.Timesheet_1st_Approval,accesscontrols.Timesheet_2nd_Approval,accesscontrols.Timesheet_Final_Approval from users left join accesscontrols on users.Id=accesscontrols.UserId) as L2\"),'L2.Id','=','users.SuperiorId')\n\t\t\t// ->leftJoin(DB::raw(\"(select users.Id,users.Name,users.SuperiorId,accesscontrols.Timesheet_1st_Approval,accesscontrols.Timesheet_2nd_Approval,accesscontrols.Timesheet_Final_Approval from users left join accesscontrols on users.Id=accesscontrols.UserId) as L3\"),'L3.Id','=','L2.SuperiorId')\n\t\t\t// ->where('users.Id', '=', $me->UserId)\n\t\t\t// ->get();\n\t\t\t//\n\t\t\t// $final = DB::table('users')\n\t\t\t// ->select('users.Id','users.Name')\n\t\t\t// ->leftJoin('accesscontrols', 'accesscontrols.UserId', '=', 'users.Id')\n\t\t\t// ->where('Timesheet_Final_Approval', '=', 1)\n\t\t\t// ->get();\n\n\t\t\treturn view('mytimesheet', ['me' => $me, 'user' =>$user, 'mytimesheet' => $mytimesheet,'start' =>$start,'end'=>$end,'options' =>$options]);\n\n\t\t\t//return view('mytimesheet', ['me' => $me,'showleave' =>$showleave, 'mytimesheet' => $mytimesheet, 'hierarchy' => $hierarchy, 'final' => $final]);\n\n\t}",
"public function index() {\n $currentDate = (new Datetime())->format('Y-m-d');\n \t$timesheets = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->get();\n \t$schedule = Schedule::whereDate('start_date','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->get();\n \t//Get total time worked\n \t$hours = 0;\n \tforeach ($timesheets as $timesheet) {\n\t \t$date1 = new Datetime($timesheet->start_time);\n\t\t\t$date2 = new Datetime($timesheet->end_time);\n\t\t\t$diff = $date2->diff($date1);\n\n $hours = $hours + (($diff->h * 60) + $diff->i);\n \t}\n //Get total breaks\n $breaks = 0;\n $first_timesheet = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->first();\n $last_timesheet = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->latest()->first();\n if($first_timesheet){\n $date1 = new Datetime($first_timesheet->start_time);\n $date2 = new Datetime($last_timesheet->end_time);\n $diff = $date2->diff($date1);\n $breaks = (($diff->h * 60) + $diff->i) - $hours;\n }\n\n $worked = $this->hoursandmins($hours);\n $breaks = $this->hoursandmins($breaks);\n // First Punch In in current day\n $first_punch_in = Timesheet::whereDate('start_time','=',$currentDate)\n ->where('member_id', Auth::user()->id)\n ->first();\n return view('attendance/index', ['timesheets'=>$timesheets, 'schedule'=>$schedule, 'first_punch_in'=>$first_punch_in, 'worked'=>$worked, 'breaks'=>$breaks, 'first_timesheet'=>$first_timesheet, 'last_timesheet'=>$last_timesheet]);\n }",
"public function actionIndex()\n {\n $request = $this->getApp()->getRequest();\n $sortByUsername = strtoupper($request->param('username', ''));\n $sortByEmail = strtoupper($request->param('email', ''));\n $sortByStatus = strtoupper($request->param('status', ''));\n $page = $request->param('page', 1);\n\n $perPage = self::PER_PAGE;\n\n if (!$sortByUsername && !$sortByEmail && !$sortByStatus) {\n $tasks = $this->getDb()->tasks()->paged($perPage, $page);\n }\n if ($sortByUsername) {\n $tasks = $this->getDb()->tasks()->orderBy('username', $sortByUsername)->paged($perPage, $page);\n }\n if ($sortByEmail) {\n $tasks = $this->getDb()->tasks()->orderBy('email', $sortByEmail)->paged($perPage, $page);\n }\n if ($sortByStatus) {\n $tasks = $this->getDb()->tasks()->orderBy('status', $sortByStatus)->paged($perPage, $page);\n }\n\n $rows = $tasks->fetchAll();\n\n $pagesTotal = $this->getDb()->tasks()->count();\n $pagination = new Pagination($perPage, $pagesTotal);\n $pagination->page = $page;\n $pagination->url = \"/tasks?username=$sortByUsername&email=$sortByEmail&status=$sortByStatus&page=\";\n\n $canAccept = $this->isAdmin();\n\n return $this->render(\n 'task.index', compact(\n 'rows',\n 'sortByUsername',\n 'sortByEmail',\n 'sortByStatus',\n 'page',\n 'pagesTotal',\n 'perPage',\n 'canAccept',\n 'pagination'\n )\n );\n }",
"public function index() {\n //\n $currentDate = \\Helpers\\DateHelper::getLocalUserDate(date('Y-m-d H:i:s')); \n $day = \\Helpers\\DateHelper::getDay($currentDate);\n $weekDays = \\Helpers\\DateHelper::getWeekDays($currentDate, $day); \n $workouts = \\App\\Schedule::getScheduledWorkouts($weekDays);\n \n return view('user/schedule', ['number_of_day' => $day, 'current_date' => $currentDate, 'weekDays' => $weekDays])\n ->with('target_areas', json_decode($this->target_areas, true))\n ->with('movements', json_decode($this->movements, true))\n ->with('workouts', $workouts);\n }",
"function showReport($val, $val2) {\n $userVal = $val;\n $dates = $val2;\n $from = substr($dates, 10, 10);\n $to = substr($dates, 29, 10);\n \n include ('Header.php');\n include $_SERVER[\"DOCUMENT_ROOT\"].'/JGWentworth/Model/database.php';\n?>\n<script type=\"text/javascript\">\n $(document).ready(function() { \n $('#daterange').daterangepicker( {dateFormat: \"yy-mm-dd\", applyOnMenuSelect: false} );\n \n function toggleTableRow(){\n $('.hiderow').hide();\n $('.showrow').show();\n }\n function setRowColours(){\n $('table tr:visible:odd').css({\"background\": \"white\"});\n $('table tr:visible:even').css({\"background\": \"#CEF2DF\"});\n}\n $('.ShowMe').click(function() {\n\tvar id = $(this).get(0).id;\n\n var x = document.getElementById(\"emp\"+id).className;\n \n if(x === \"hiderow\") {\n document.getElementById(\"emp\"+id).className = \"showrow\";\n }\n else {\n document.getElementById(\"emp\"+id).className = \"hiderow\";\n }\n \n\ttoggleTableRow();\n setRowColours();\n });\n \n toggleTableRow();\n setRowColours(); \n \n });\n \n</script>\n<style>\n .table-wrapper {\n float: left;\n overflow-x:scroll;\n overflow-y:visible;\n width: 90%;\n min-width: 300px;\n margin-left: auto;\n margin-right: auto;\n margin-top: 10px;\n padding-bottom: 10px;\n}\n\n.main-table-row {\n // background-color: #BBFFBB;\n font-weight: bold;\n}\n\n.local-table {\n white-space: nowrap;\n}\n\n\n</style>\n<body>\n <div id=\"page\">\n <div id=\"body\">\n <?php\n /******************************************************************************************\n ********** FILTER TITLE CRITERIA ********************************************************/\n $title = \"\";\n switch($userVal){\n case 'all':\n $title = \"All Employees\";\n break;\n default:\n $sqlTitle = \"SELECT FirstName, LastName FROM USER WHERE UserID = \".$userVal.\";\";\n $resultTitle = $pdo->query($sqlTitle); \n $val5=$resultTitle->fetch();\n $title = $val5['FirstName'] .\" \".$val5['LastName'];\n }// end switch\n \n $dateTitle = \"\";\n if($dates != NULL){\n $dateTitle = \"From \".$from.\" To \".$to; \n }\n \n ?>\n <label class=\"title\">REPORT for <?php echo $title.\" \".$dateTitle ?></label>\n <!------------------FORM THAT POSTS TO SAME PAGE, ALLOWS USER TO FILTER EMPLOYEES -------------------------> \n <div id=\"formDiv\">\n <form action=\"<?php echo htmlspecialchars($_SERVER[\"PHP_SELF\"]); ?>\" name=\"myform\" method=\"post\"> \n <input type=\"text\" id=\"daterange\" name=\"daterange\">\n <select id=\"filter\" name=\"emp\"> \n <option value=\"all\">All Employees</option>\n <?php \n $sql1 = \"SELECT UserID, FirstName, LastName FROM USER WHERE Role='Employee' ORDER BY LastName, FirstName;\";\n $result1 = $pdo->query($sql1); \n \n while($val=$result1->fetch()):\n $userID = $val['UserID'];\n $fName = $val['FirstName'];\n $lName = $val['LastName'];\n ?> \n <option id=\"option<?php echo $userID ?>\" value=\"<?php echo $userID ?>\"><?php echo $fName.\" \".$lName ?></option>\n <?php endwhile;?>\n </select>\n <input type=\"submit\" name=\"empReport\" value=\"Run Report\">\n </form>\n </div>\n <!-------------------- BEGIN OF TABLE WITH CONTACT FORM --------------------------------------------------------> \n <div id=\"reportDiv\" class=\"table-wrapper\">\n <table class=\"local-table\">\n <th>Action</th><th>Employee</th><th>Client</th><th>Subject</th><th>Duration</th><th>Date/Time</th><th>Result</th> \n <tr>\n <?php \n /******************************************************************************************\n ********** FILTER CONTACT CRITERIA *******************************************************/\n \n switch($userVal){\n case 'all':\n $sqlCriteria = \"SELECT UserID, FirstName, LastName FROM USER WHERE Role='Employee' ORDER BY LastName, FirstName;\";\n break;\n default:\n $sqlCriteria = \"SELECT UserID, FirstName, LastName FROM USER WHERE UserID = \".$userVal.\";\";\n }// end switch\n \n /******************************************************************************************\n ********** GET ALL EMPLOYEES ************************************************************/\n $sql4 = $sqlCriteria;\n $result4 = $pdo->query($sql4);\n \n while($usval=$result4->fetch()):\n $empID = $usval['UserID'];\n $empfName = $usval['FirstName'];\n $emplName = $usval['LastName'];\n \n //variables for TOTALs\n $numCalls = 0;\n $totalTime = 0;\n $numClient = 0;\n $allClient = array();\n $numnonClient = 0;\n $allnonClient = array();\n ?>\n \n <td><button class=\"ShowMe\" id=\"<?php echo $empID ?>\">Show Totals</button></td>\n <td colspan=\"7\" class=\"main-table-row\"><?php echo strtoupper($empfName.\" \".$emplName); ?></td>\n \n </tr>\n <?php\n /******************************************************************************************\n ******* GET ALL USER CONTACT FROM CONTACT TABLE *******************************************/\n \n if($dates == NULL){\n $sql2 = \"SELECT * FROM CONTACT WHERE UserID = \".$empID.\";\";\n }\n else{\n $sql2 = \"SELECT * FROM CONTACT WHERE UserID = \".$empID.\" AND (DateTime BETWEEN '\".$from.\" 00:00:00' AND '\".$to.\" 23:59:00');\";\n }\n $result2 = $pdo->query($sql2);\n \n while($value2=$result2->fetch()):\n $memID = $value2['MemberID'];\n $subject = $value2['Subject'];\n $duration = $value2['Duration'];\n $datetime = $value2['DateTime'];\n $res = $value2['Result'];\n \n // Get client's name \n $sql3 = \"SELECT FirstName, LastName FROM COMPANY_MEMBER WHERE MemberID = \".$memID.\";\";\n $result3 = $pdo->query($sql3);\n $value3 = $result3->fetch();\n $memberName = $value3['FirstName'] .\" \". $value3['LastName'];\n\n // Continue to Calculate TOTALs\n $numCalls ++;\n $totalTime = $totalTime + $duration; \n \n if(!in_array($memID, $allClient)){\n array_push($allClient, $memID);\n $numClient ++;\n }\n ?>\n <tr>\n <td></td>\n <td></td>\n <td><?php echo $memberName; ?></td> \n <td><?php echo $subject; ?></td>\n <td><?php echo $duration; ?> minutes</td>\n <td><?php echo $datetime; ?></td> \n <td><?php echo $res; ?></td>\n </tr>\n <?php\n endwhile;//end inner1 while\n /******************************************************************************************\n ******* GET ALL USER CONTACT FROM CONTACT_NON_MEMBER TABLE *******************************/\n // \n if($dates == NULL){\n $sql7 = \"SELECT * FROM CONTACT_NON_MEMBER WHERE UserID = \".$empID.\";\";\n }\n else{\n $sql7 = \"SELECT * FROM CONTACT_NON_MEMBER WHERE UserID = \".$empID.\" AND (DateTime BETWEEN '\".$from.\" 00:00:00' AND '\".$to.\" 23:59:00');\";\n }\n $result7 = $pdo->query($sql7);\n \n while($value7=$result7->fetch()):\n $nonmemID = $value7['MemberID'];\n $subject = $value7['Subject'];\n $duration = $value7['Duration'];\n $datetime = $value7['DateTime'];\n $res = $value7['Result'];\n \n // Get client's name \n $sql8 = \"SELECT FirstName, LastName FROM NON_MEMBER WHERE MemberID = \".$nonmemID.\";\";\n $result8 = $pdo->query($sql8);\n $value8 = $result8->fetch();\n $memberName = $value8['FirstName'] .\" \". $value8['LastName'];\n\n // Continue to Calculate TOTALs\n $numCalls ++;\n $totalTime = $totalTime + $duration; \n \n if(!in_array($nonmemID, $allnonClient)){\n array_push($allClient, $nonmemID);\n $numnonClient ++;\n }\n ?>\n <tr>\n <td></td>\n <td></td>\n <td><?php echo $memberName; ?></td> \n <td><?php echo $subject; ?></td>\n <td><?php echo $duration; ?> minutes</td>\n <td><?php echo $datetime; ?></td> \n <td><?php echo $res; ?></td>\n </tr>\n <?php\n endwhile;//end inner2 while\n ?> \n <tr id=\"emp<?php echo $empID ?>\" class=\"hiderow\" style=\"color: red;\">\n <td></td>\n <td class=\"main-table-row\">Totals</td>\n <td class=\"main-table-row\"># Clients collab: <?php echo \" \".$numClient + $numnonClient ?></td>\n <td class=\"main-table-row\"># of Calls:<?php echo \" \".$numCalls; ?></td>\n <td colspan=\"2\" class=\"main-table-row\">Total Call Time:<?php echo ' '.$totalTime.' minutes'; ?></td>\n <td></td>\n \n </tr>\n <?php\n endwhile; // end outer while\n ?>\n </table>\n </div>\n </div>\n </div>\n </body>\n</html>\n<?php \n\n}",
"public function index()\n {\n $user = Auth::user();\n $data['user'] = $user;\n $settings = $user->settings;\n Carbon::setWeekStartsAt(0);\n Carbon::setWeekEndsAt(6);\n\n // TODO: get this from config\n $start_time = '06:30';\n $end_time = '19:30';\n\n $today = new Carbon($this->choose_start);\n $today2 = new Carbon($this->choose_start);\n $today3 = new Carbon($this->choose_start);\n // $today4 = new Carbon($this->choose_start);\n // $today5 = new Carbon($this->choose_start);\n $today6 = new Carbon($this->choose_start);\n\n $data['start'] = $today6->startOfWeek();\n\n $days = array();\n $days_to_add = 7 * ($settings->weeks - 2);\n $end = $today2->startOfWeek()->setDate(\n $today->year,\n $today->month,\n $today->format('d') > 15 ?\n $today3->endOfMonth()->format('d') :\n 15\n )->addDays($days_to_add);\n\n $data['end_of_period'] = $end->copy()->endOfWeek()->format('Y-m-d');\n $data['end'] = $end;\n\n $added_range = false;\n $next_range = array();\n if ((new Carbon)->day >= 13 && (new Carbon)->day <= 15) {\n $added_range = true;\n $next_range['start'] = (new Carbon)->setDate((new Carbon)->year, (new Carbon)->month, 16)->startOfWeek();\n $next_range['start_of_period'] = (new Carbon)->setDate((new Carbon)->year, (new Carbon)->month, 16);\n $next_range['end'] = (new Carbon)->startOfWeek()->setDate((new Carbon)->year, (new Carbon)->month, $today3->endOfMonth()->format('d'));\n $next_range['end_of_period'] = (new Carbon)->startOfWeek()->setDate((new Carbon)->year, (new Carbon)->month, $today3->endOfMonth()->format('d'))->endOfWeek()->format('Y-m-d');\n } elseif ((new Carbon)->day >= 28 && (new Carbon)->day <= 31) {\n $added_range = true;\n $year = (new Carbon)->year + ((new Carbon)->month == 12?1:0); // Set year as next year if this month is December (12)\n $next_range['start'] = (new Carbon)->setDate($year, (new Carbon)->addMonthNoOverflow(1)->format(\"m\"), 1)->startOfWeek();\n $next_range['start_of_period'] = (new Carbon)->setDate($year, (new Carbon)->addMonthNoOverflow(1)->format(\"m\"), 1);\n $next_range['end'] = (new Carbon)->startOfWeek()->setDate($year, (new Carbon)->addMonthNoOverflow(1)->format(\"m\"), 15);\n $next_range['end_of_period'] = (new Carbon)->startOfWeek()->setDate($year, (new Carbon)->addMonthNoOverflow(1)->format(\"m\"), 15)->endOfWeek()->format('Y-m-d');\n }\n\n $data['days_a'] = $this->get_days($data);\n $data['days_b'] = $this->get_days($next_range);\n\n $data['days'] = [__('Su'), __('Mo'), __('Tu'), __('We'), __('Th'), __('Fr'), __('Sa')];\n $time_line = [];\n $time = new Carbon($start_time);\n while ($time->format('H:i') <= $end_time) {\n $time_line[] = $time->format('H:i');\n $time->addMinutes(60);\n }\n $data['time_line'] = $time_line;\n\n $user = auth()->user();\n if (isset($user) && isset($user->settings))\n if ($user->settings->is_admin)\n return view('admin.home');\n else\n return view('home', $data);\n }",
"public function index()\n {\n // ->paginate(3);\n $tasks = QueryBuilder::for(Task::class)\n ->allowedIncludes(['project', 'user'])\n ->allowedFilters(['completed', 'due_date', Filter::exact('user_id'),Filter::exact('project_id')])\n ->get();\n\n\n return TaskResource::collection($tasks);\n }",
"function displayWeeks($list,$task,$level,$fromPeriod,$toPeriod) {\n\n\tif ($fromPeriod==-1) { return \"\"; }\n\n\t$s=new CDate($fromPeriod);\n\t$e=new CDate($toPeriod);\n\t$sw=getBeginWeek($s); \t//intval($s->Format(\"%U\"));\n\t$ew=getEndWeek($e); //intval($e->Format(\"%U\"));\n\n\t$st=new CDate($task->task_start_date);\n\t$et=new CDate($task->task_end_date);\n\t$stw=getBeginWeek($st); //intval($st->Format(\"%U\"));\n\t$etw=getEndWeek($et); //intval($et->Format(\"%U\"));\n\n\t//print \"week from: $stw, to: $etw<br>\\n\";\n\n\t$row=\"\";\n\tfor($i=$sw;$i<=$ew;$i++) {\n\t\tif ($i>=$stw and $i<$etw) {\n\t\t\t$color=\"blue\";\n\t\t\tif ($level==0 and hasChildren($list,$task)) { $color=\"#C0C0FF\"; }\n\t\t\telse if ($level==1 and hasChildren($list,$task)) { $color=\"#9090FF\"; }\n\t\t\t$row.=\"<td nowrap=\\\"nowrap\\\" bgcolor=\\\"$color\\\">\";\n\t\t}\n\t\telse {\n\t\t\t$row.=\"<td nowrap=\\\"nowrap\\\">\";\n\t\t}\n\t\t$row.=\"  </td>\";\n\t}\n\nreturn $row;\n}",
"public function get_tasks()\n\t{\n\t\t$tasks = Auth::user()->tasks;\n\n\t\treturn View::make('index', array('tasks' => $tasks));\n\t}",
"public function index()\n {\n //$taskreportings = Taskreporting::latest()->paginate(5);\n $user_id = \\Auth::id();\n $usertasks = Taskuser::where('user_id', $user_id)->paginate(5);\n return view('taskreportings.index',compact('usertasks'))\n ->with('i', (request()->input('page', 1) - 1) * 5);\n }",
"public function getScheduleList($filter=null) {\n\t\t$return = array();\n\t\t$users = User::where('organisation_id', Auth::user()->organisation_id)\n\t\t\t->orderBy('name', 'asc')\n\t\t\t->get();\n\t\tforeach ($users as $user) {\n\t\t\t$temp_array = array();\n\t\t\t$temp_array['user'] = array(\n\t\t\t\t'id' => 'u'.$user->id,\n\t\t\t\t'name' => $user->name,\n\t\t\t\t'job_title' => $user->job_title,\n\t\t\t\t'avatar' => $user->avatar,\n\t\t\t);\n\t\t\t$temp_array['schedule'] = array();\n\t\t\t$schedules = DB::table('schedules')\n\t\t\t\t->join('tasks', 'schedules.task_id', '=', 'tasks.id')\n\t\t\t\t->join('projects', 'schedules.project_id', '=', 'projects.id')\n\t\t\t\t->select('schedules.*', 'tasks.name', 'projects.color')\n\t\t\t\t->where([\n\t\t\t\t\t['user_id', $user->id],\n\t\t\t\t\t['start_date', '>=', '2016-04-01'],\n\t\t\t\t\t['start_date', '<=', '2016-04-30'],\n\t\t\t\t])\n\t\t\t\t->orderBy('start_date', 'asc')\n\t\t\t\t->get();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\n\t\t\tforeach($schedules as $schedule){\n\t\t\t\tif(!isset($temp_array['schedule'][$schedule->start_date])){\n\t\t\t\t\t$temp_array['schedule'][$schedule->start_date] = array();\n\t\t\t\t}\n\t\t\t\t$temp_array['schedule'][$schedule->start_date][$schedule->id] = array(\n\t\t\t\t\t'id' => $schedule->id,\n\t\t\t\t\t'project_id' => $schedule->project_id,\n\t\t\t\t\t'color' => $schedule->color,\n\t\t\t\t\t'task_id' => $schedule->task_id,\n\t\t\t\t\t'task_name' => $schedule->name,\n\t\t\t\t\t'user_id' => $schedule->user_id,\n\t\t\t\t\t'start_date' => $schedule->start_date,\n\t\t\t\t\t'end_date' => $schedule->end_date,\n\t\t\t\t\t'num_working_days' => $schedule->num_working_days,\n\t\t\t\t\t'num_non_working_days' => $schedule->num_non_working_days,\n\t\t\t\t\t'daily_hours' => $schedule->daily_hours,\n\t\t\t\t\t'total_hours' => $schedule->total_hours,\n\t\t\t\t);\n\t\t\t}\n\t\t\t$return['u'.$user->id] = $temp_array;\n\t\t}\n\t\treturn $return;\n\t}",
"public function index()\n {\n //General data for charts\n $user = Auth::user();\n $statuses = Status::all();\n\n //data for chart who show the status of your project\n $project_array = array();\n foreach ($statuses as $status){\n $project_array[$status->name] = Project::countUserProjectBy('status', $user, $status->name);\n }\n\n //data for charts who show the status of your task\n $task_array = array();\n foreach ($statuses as $status){\n $task_array[$status->name] = Task::countUserTaskBy('status', $user ,$status->name);\n }\n\n //data for charts who show your task against your project's task\n $all_your_projects = $user->projects()->get();\n\n //get all the tasks of the auth user who must be finish in the next week and not late\n $this_week_tasks = Auth::User()->tasks()->get()->where('wanted_end_datetime', '<', Carbon::now()->endOfWeek())\n ->where('wanted_end_datetime', '>', Carbon::now()->startOfWeek());\n\n //get all the tasks of the auth user who should who should be done but are still open\n $too_late_tasks = Auth::User()->tasks()->get()->where('wanted_end_datetime', '<', Carbon::now());\n\n return view('home', compact( 'project_array', 'task_array', 'statuses', 'all_your_projects', 'this_week_tasks', 'too_late_tasks'));\n }",
"public function index() // tasks page\n {\n $fetched_data = tasks::get();\n \n foreach ($fetched_data as $d) {\n $d->start_date = date('d/m/y', $d->start_date) ;\n $d->end_date = date('d/m/y', $d->end_date);\n }\n $data = [\"data\"=>$fetched_data];\n return view('todo.index',$data);\n }",
"public function listAction()\r\n {\r\n $pid = $this->_getParam('projectid');\r\n $where = array();\r\n if ($pid) {\r\n $where['projectid='] = $pid;\r\n }\r\n $cid = $this->_getParam('clientid');\r\n if ($cid) {\r\n $where['clientid='] = $cid;\r\n }\r\n \r\n $this->view->timesheets = $this->projectService->getTimesheets($where);\r\n \r\n $this->renderView('timesheet/list.php');\r\n }",
"public function actionTaskhistory(){\n $user = Users::findOne(\\Yii::$app->user->getID());\n $tasks = AcceptedOrders::find()->joinWith('posts')->joinWith('order')->where('(post_services.owner_id = '.\\Yii::$app->user->getID() . ' OR accepted_orders.user_id = ' . \\Yii::$app->user->getID() . ') AND accepted_orders.payment = \"paid\" AND closed_date != \"\"')->all();\n return $this->render('taskHistory', ['tasks'=>$tasks, 'user'=>$user]);\n }",
"public function index()\n {\n //If is admin get all tasks\n if(Gate::allows('view_all_tasks_access')){\n $tasks = Task::with(['creator_user','assigned_user'])->get();\n }\n else {\n //If is user get user's tasks\n $loggedUserId = Auth::id();\n $tasks = Task::with(['assigned_user', 'creator_user'])->where('assigned_user_id',$loggedUserId)->get();\n }\n\n return view('tasks.index', compact('tasks'));\n }",
"function get_activities($user_id, $show_tasks, $view_start_time, $view_end_time, $view, $show_calls = true){\n\t\tglobal $current_user;\n\t\t$act_list = array();\n\t\t$seen_ids = array();\n\n\n\t\t// get all upcoming meetings, tasks due, and calls for a user\n\t\tif(ACLController::checkAccess('Meetings', 'list', $current_user->id == $user_id)) {\n\t\t\t$meeting = new Meeting();\n\n\t\t\tif($current_user->id == $user_id) {\n\t\t\t\t$meeting->disable_row_level_security = true;\n\t\t\t}\n\n\t\t\t$where = CalendarActivity::get_occurs_within_where_clause($meeting->table_name, $meeting->rel_users_table, $view_start_time, $view_end_time, 'date_start', $view);\n\t\t\t$focus_meetings_list = build_related_list_by_user_id($meeting,$user_id,$where);\n\t\t\tforeach($focus_meetings_list as $meeting) {\n\t\t\t\tif(isset($seen_ids[$meeting->id])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$seen_ids[$meeting->id] = 1;\n\t\t\t\t$act = new CalendarActivity($meeting);\n\n\t\t\t\tif(!empty($act)) {\n\t\t\t\t\t$act_list[] = $act;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif($show_calls){\n\t\t\tif(ACLController::checkAccess('Calls', 'list',$current_user->id == $user_id)) {\n\t\t\t\t$call = new Call();\n\n\t\t\t\tif($current_user->id == $user_id) {\n\t\t\t\t\t$call->disable_row_level_security = true;\n\t\t\t\t}\n\n\t\t\t\t$where = CalendarActivity::get_occurs_within_where_clause($call->table_name, $call->rel_users_table, $view_start_time, $view_end_time, 'date_start', $view);\n\t\t\t\t$focus_calls_list = build_related_list_by_user_id($call,$user_id,$where);\n\n\t\t\t\tforeach($focus_calls_list as $call) {\n\t\t\t\t\tif(isset($seen_ids[$call->id])) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t$seen_ids[$call->id] = 1;\n\n\t\t\t\t\t$act = new CalendarActivity($call);\n\t\t\t\t\tif(!empty($act)) {\n\t\t\t\t\t\t$act_list[] = $act;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\tif($show_tasks){\n\t\t\tif(ACLController::checkAccess('Tasks', 'list',$current_user->id == $user_id)) {\n\t\t\t\t$task = new Task();\n\n\t\t\t\t$where = CalendarActivity::get_occurs_within_where_clause('tasks', '', $view_start_time, $view_end_time, 'date_due', $view);\n\t\t\t\t$where .= \" AND tasks.assigned_user_id='$user_id' \";\n\n\t\t\t\t$focus_tasks_list = $task->get_full_list(\"\", $where,true);\n\n\t\t\t\tif(!isset($focus_tasks_list)) {\n\t\t\t\t\t$focus_tasks_list = array();\n\t\t\t\t}\n\n\t\t\t\tforeach($focus_tasks_list as $task) {\n\t\t\t\t\t$act = new CalendarActivity($task);\n\t\t\t\t\tif(!empty($act)) {\n\t\t\t\t\t\t$act_list[] = $act;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $act_list;\n\t}",
"public function index()\n {\n $progress = Progress::where('id', '!=', 5)->get();\n $tasks = Task::where('user_id', auth()->user()->id)->paginate();\n $tasks->map(function($task) {\n $time = 0;\n $last_time = NULL;\n TaskProgress::select('progress_id', 'created_at')->where('task_id', $task->id)->chunk(2, function($progresses) use(&$time, &$last_time) {\n if(isset($progresses[1])) {\n $time += $progresses[1]->created_at->diffInSeconds($progresses[0]->created_at);\n $last_time = $progresses[1];\n } else if(isset($last_time->progress_id) && $last_time->progress_id == 2) {\n $time += $progresses[0]->created_at->diffInSeconds($last_time->created_at);\n } else if($progresses[0]->progress_id == 2) {\n $time += $progresses[0]->created_at->diffInSeconds(now());\n }\n });\n $task->task_progress_time = $this->secondsToTime($time);\n $task->task_progress_seconds = $time;\n });\n \n return view('home', [\n 'tasks' => $tasks,\n 'progresses' => $progress\n ]);\n }",
"public function getDateEntries()\n\t{\n\t\t//Get Date\n\t\t$dateSubmit = \\Input::get('eventDate_submit');\n\t\t//Get Week\n\t\t$week = $this->timesheet->getWeek($dateSubmit);\n\t\t//Get the user id of the currently logged in user\n\t\t$userId = \\Sentry::getUser()->id;\n\t\t//Get Tasks List\n\t\t$tasks = $this->timesheet->getIndex($userId);\n\t\t//Get Entries\n\t\t$entries = $this->timesheet->getEntries($dateSubmit,$userId);\n\t\treturn \\View::make('dashboard.timesheet.view')\n\t\t\t\t\t->with('week',$week)\n\t\t\t\t\t->with('tasks',$tasks)\n\t\t\t\t\t->with('selectedDate',$dateSubmit)\n\t\t\t\t\t->with('entries', $entries);\n\t}",
"function show_all_tasks_for_dev($in_e_id) { \n $query_string = <<< MARKER\n SELECT t.task_id, t.task_name, t.create_date, t.completed_date, t.project_id, t.iteration_id, t.status_id, t.size_id, t.description, i.iteration_name\n FROM task t\n JOIN task_developer d ON t.task_id = d.task_id\n LEFT JOIN iteration i ON t.iteration_id = i.iteration_id\n WHERE d.emp_id = $in_e_id\n ORDER BY iteration_id DESC, create_date DESC;\nMARKER;\n $db_output = db_query($query_string);\n while ($row = mysqli_fetch_array($db_output)) {\n $task_name = $row['task_name'];\n $iteration_name = $row['iteration_name'];\n $status_id = $row['status_id'];\n $size_id = $row['size_id'];\n $description = $row['description'];\n $task_info_out = <<<MARKER\n <ul class=\"list-group\">\n <li class=\"list-group-item active\"> <strong>Task: </strong> $task_name</li>\n <li class=\"list-group-item \"> <strong>Iteration: </strong> $iteration_name</li>\n <li class=\"list-group-item \"> <strong>Status: </strong> $status_id</li>\n <li class=\"list-group-item \"> <strong>Size: </strong> $size_id</li>\n <li class=\"list-group-item \"> <strong>Description: </strong> $description</li>\n </ul>\nMARKER;\n echo ($task_info_out);\n }\n}",
"protected function getTasksList($data){\n\n\t\t$date_from = $this->dateFormat($data['date_from']);\n\t\t$date_to = $this->dateFormat($data['date_to']);\n\t\t$date_started = $this->dateFormat($data['date_started']);\n\t\t$deadline = $this->dateFormat($data['deadline']);\n\n\n\t\t// Date Created Filter\n\t\t$query = Task::whereDate('created_at', '>=', $date_from)\n\t\t ->whereDate('created_at', '<=', $date_to);\n\n\t\t// Date Started Filter\n\t\tif($date_started){\n\t\t $query = $query->whereDate('start_date', '=', $date_started);\n\t\t}\n\n\t\t// Deadline Filter\n\t\tif($deadline){\n\t\t $query = $query->whereDate('deadline', '=', $deadline);\n\t\t}\n\n\t\t// Status Filter\n\t\tif($data['status'] != 0){\n\t\t $query = $query->where('status', '=', $data['status']);\n\t\t}\n\n\t\t$user = Auth::user();\n\n\t\t// Team member or team leader\n\t\tif($user->user_type == 3 || 4){\n\t\t\t$data['department']\t= $user->department;\n\n\t\t\t// Team member\n\t\t\tif($user->user_type == 4){\n\t\t\t\t$data['assigned_to'] = $user->id;\n\t\t\t}\n\t\t}\n\n\n\n\t\t// Department Filter\n\t\tif($data['department'] != 0){\n\t\t $query = $query->where('department_id', '=', $data['department']);\n\t\t}\n\n\t\t// Assigned to filter\n\t\tif($data['assigned_to'] != 0){\n\t\t $query = $query->where('assigned_to', '=', $data['assigned_to']);\n\t\t}\n\n\t\treturn $query;\n\n\t}",
"public function index() {\n // paginate the authorized user's tasks with 5 per page\n $tasks = Auth::user()\n ->tasks()\n ->orderBy('is_complete')\n ->orderByDesc('created_at')\n ->paginate(5);\n\n //Get Data for Chart\n $chart = $this->getChartData();\n // return task index view with paginated tasks\n return view('home', [\n 'tasks' => $tasks,\n 'chart' => $chart\n ]);\n }",
"function show_all_tasks_for_project($in_project_id) { \n $query_string = <<< MARKER\n SELECT t.task_id, t.task_name, t.create_date, t.completed_date, t.project_id, t.iteration_id, t.status_id, \n t.size_id, t.description, i.iteration_name\n FROM task t\n LEFT JOIN iteration i ON i.iteration_id = t.iteration_id\n WHERE t.project_id = $in_project_id;\nMARKER;\n $db_output = db_query($query_string);\n while ($row = mysqli_fetch_array($db_output)) {\n $task_name = $row['task_name'];\n $iteration_name = $row['iteration_name'];\n $status_id = $row['status_id'];\n $size_id = $row['size_id'];\n $description = $row['description'];\n $task_info_out = <<<MARKER\n <ul class=\"list-group\">\n <li class=\"list-group-item active\"> <strong>Task: </strong> $task_name</li>\n <li class=\"list-group-item \"> <strong>Iteration: </strong> $iteration_name</li>\n <li class=\"list-group-item \"> <strong>Status: </strong> $status_id</li>\n <li class=\"list-group-item \"> <strong>Size: </strong> $size_id</li>\n <li class=\"list-group-item \"> <strong>Description: </strong> $description</li>\n </ul>\nMARKER;\n echo ($task_info_out);\n }\n}",
"public function displaytasks() {\n\n //SQL statement\n $date = date(\"Y/m/d\");\n $sql = \"SELECT * FROM approval WHERE date = '\".$date.\"' AND approval_status = 'pending' ORDER BY approval_id\";\n $result = $this->con->query($sql);\n $count = $result->num_rows;\n if ($count != 0) {\n while ($row = $result->fetch_assoc()){\n $array[] = $row;\n }\n return $array;\n }\n }",
"public function index()\n {\n $data = Task::where('ServicePersonID','=', Auth::user()->EmpID)->sortable()->paginate(5);\n \n if(Auth::user()->roles->name == 'Super-Admin' || Auth::user()->can('add-task', App\\Models\\Task::class) ){\n $data = task::sortable()->paginate(5);\n }\n\n return view('task/viewtask',['tasks'=>$data])\n ->with('orders', Order::all());\n }",
"public function filtersummaryAction()\r\n {\r\n \t/*\r\n \t * form needs to include:\r\n \t * \r\n \t * user id\r\n \t * task category\r\n \t * client id\r\n \t * project id\r\n \t * start date\r\n \t * end date\r\n \t */\r\n $this->view->allUsers = $this->userService->getUserList();\r\n $task = new Task();\r\n $this->view->categories = $task->constraints['category']->getValues();\r\n $this->view->clients = $this->clientService->getClients();\r\n \t $this->view->projects = new ArrayObject();\r\n $this->renderView('timesheet/filterSummary.php'); \t\r\n }",
"public function getTask()\n {\n try {\n $data = array();\n\n $userId = auth::user()->id;\n $user = User::where('id', $userId)->first();\n $levelId = ManageClass::where('id', $user->classId)->value('levelId');\n\n if ($user->isPassOut == 1) {\n $manageTaskQuarter = ManageTaskQuarter::where([['dateFrom', '<=', date('Y-m-d', strtotime(Carbon::now()))], ['dateTo', '>=', date('Y-m-d', strtotime(Carbon::now()))]])->whereNotIn('taskLevelId', [1])->first();\n if ($manageTaskQuarter == null) {\n goto a;\n } else {\n $topRankedUser = TopRankedUser::where([\n ['userId', $userId],\n ['levelId', $levelId],\n ['taskLevelId', $manageTaskQuarter->taskLevelId],\n ['taskQuarterId', $manageTaskQuarter->id],\n ])->first();\n if (!is_null($topRankedUser)) {\n return response()->json(['status' => 1, 'msg' => 'You have entered to top 100', \"payload\" => ['data' => $data]], config('constants.ok'));\n } else {\n $manageTasks = ManageTasks::where([\n ['taskLevelId', $manageTaskQuarter->taskLevelId],\n ['taskQuarterId', $manageTaskQuarter->id],\n ['levelId', $levelId],\n ['status', '1']\n ])->get();\n }\n }\n } else {\n $manageTaskQuarter = ManageTaskQuarter::where('taskLevelId', 1)->first();\n $manageTasks = ManageTasks::where([\n ['taskLevelId', 1],\n ['levelId', $levelId],\n ['status', '1']\n ])->get();\n }\n\n foreach ($manageTasks as $temp) {\n $taskResult = TaskResult::where([['taskId', $temp->id], ['userId', $userId]])->orderBy('id', 'desc')->first();\n $data[] = array(\n 'id' => $temp->id,\n 'taskLevelId' => $temp->taskLevelId,\n 'taskLevel' => ManageTaskLevel::where('id', $temp->taskLevelId)->value('title'),\n 'taskQuarterTitle' => $manageTaskQuarter->title,\n 'taskQuarterFrom' => date('d-m-Y', strtotime($manageTaskQuarter->dateFrom)),\n 'taskQuarterTo' => date('d-m-Y', strtotime($manageTaskQuarter->dateTo)),\n 'title' => $temp->title,\n 'point' => $temp->point,\n 'description' => $temp->description,\n 'image' => $this->picUrl($temp->image, 'taskQuestionPic', $this->platform),\n 'status' => ($taskResult == null) ? config('constants.notAttempted') : $taskResult->status,\n );\n }\n\n if (!empty($data)) {\n return response()->json(['status' => 1, 'msg' => config('constants.successMsg'), \"payload\" => ['data' => $data]], config('constants.ok'));\n } else {\n a:\n return response()->json(['status' => 0, 'msg' => 'No task found', \"payload\" => (object)[]], config('constants.ok'));\n }\n } catch (Exception $e) {\n return response()->json(['status' => 0, 'msg' => config('constants.serverErrMsg'), 'payload' => (object) []], config('constants.serverErr'));\n }\n }",
"public function get_alertable_tasks($min = 5, $allusers = false, $onlyexternal = false)\n {\n $return = array();\n $userfilter = ($allusers != false) ? '' : ' AND ('.$this->getGroupAndShareFilter(null, 't').')';\n $alertfilter = ($onlyexternal) ? ' AND (rm.`mailto` != \"\" OR rm.`smsto` != \"\")' : '';\n\n $query = 'SELECT DISTINCT t.`id`,t.`uuid`, rm.`id` `reminder_id`,rm.`text` `reminder`,rm.mailto,rm.smsto, t.uid, t.title, t.description, t.location'\n .', UNIX_TIMESTAMP(t.starts)`start`, UNIX_TIMESTAMP(t.ends) `end`'\n .', IF (UNIX_TIMESTAMP(rm.snooze) != 0, UNIX_TIMESTAMP(rm.snooze), IF (rm.mode=\"s\", UNIX_TIMESTAMP(DATE_SUB(CONCAT(DATE_FORMAT(NOW(), \"%Y-%m-%d\"), \" \",DATE_FORMAT(t.starts, \"%T\")), INTERVAL rm.time SECOND)), UNIX_TIMESTAMP(DATE_SUB(CONCAT(DATE_FORMAT(NOW(), \"%Y-%m-%d\"), \" \",DATE_FORMAT(t.ends, \"%T\")), INTERVAL rm.`time` SECOND)))) `warntime`'\n .' FROM '.$this->Tbl['cal_task'].' t,'.$this->Tbl['cal_reminder'].' rm'\n .' WHERE t.id=rm.eid AND rm.`ref`=\"tsk\" AND rm.mode!=\"-\"'.$userfilter.$alertfilter\n .' AND IF(rm.lastinfo!=0 AND rm.`snooze` < NOW(), 0, 1)'\n // Don't alert cancelled events\n .' AND t.`status` != 3 AND ('\n // Nonrepeated events get selected when they were not alerted yet or their warn_snooze is later than now\n .'IF (rm.`mode`=\"s\"'\n .', t.starts > NOW() AND rm.lastinfo != t.starts AND DATE_SUB(t.starts, INTERVAL rm.`time`+'.($min * 60).' SECOND) < NOW()'\n .', t.ends > NOW() AND rm.lastinfo != t.ends AND DATE_SUB(t.ends, INTERVAL rm.`time`+'.($min * 60).' SECOND) < NOW()'\n .') OR '\n // A rescheduled alert\n .'IF(UNIX_TIMESTAMP(rm.`snooze`) > 0 AND UNIX_TIMESTAMP(rm.`snooze`)-'.($min * 60).' < UNIX_TIMESTAMP(NOW()), 1, 0)'\n .') ORDER BY `warntime` ASC';\n // if (function_exists('vecho')) vecho($query);\n $qid = $this->query($query);\n // if (function_exists('vecho')) vecho $this->error();\n while ($line = $this->assoc($qid)) {\n $return[$line['id']] = array\n ('warn_time' => $line['warntime'], 'mailto' => $line['mailto']\n ,'smsto' => $line['smsto'], 'uid' => $line['uid']\n ,'title' => $line['title'], 'description' => $line['description']\n ,'location' => $line['location'], 'starts' => $line['start'], 'ends' => $line['end']\n ,'reminder' => $line['reminder'], 'reminder_id' => $line['reminder_id']\n );\n }\n return $return;\n }",
"public function index()\n {\n $this->getUser()->hasPermission(['select'], 'auto_tasks');\n\n // Retrieve the full task list\n $taskList = DB::connection($this->getUser()->getRole->name)->table('auto_tasks')->paginate(20);\n\n return view('autotasks.index', array(\n 'autotasks' => $taskList\n ));\n }",
"public function index()\n\t{\n\t\tView::share('title', 'ThinkClosing - Tasks');\n\t\tif ( !Auth::user()->isAdmin() ) {\n\t\t\t$tasks = Task::where('user_id', '=', Auth::user()->id)\n\t\t\t\t->paginate(10);\n\t\t} else {\n\t\t\t$tasks = Task::where('id', '>', 0)->paginate(10);\n\t\t}\n\t\treturn View::make('tasks.index', array('tasks' => $tasks));\n\t}",
"function get_user_tasks($user, $session_uid, $json=false,$limit=0, $where_attr='', $administrator=false) {\r\n global $conn, $task_attributes;\r\n $out = '{\"content\": []}';\r\n if (isset($conn)) {\r\n //make everything safe to use\r\n $user = make_safe($user);\r\n $session_uid = make_safe($session_uid);\r\n $limit = is_int($limit) ? $limit : 0;\r\n $where_attr = make_safe($where_attr);\r\n $adinistrator = $administrator===true ? true : false;\r\n\r\n //verify user's access before continuing\r\n if (verify_access($user, $session_uid)) {\r\n //get a list of all accessible tasks using get_accessible_tasks function\r\n $accessible_tasks = get_accessible_tasks($user, $administrator, $conn);\r\n\r\n //make where string\r\n $where_string = $where_attr==='' ? '' : \" AND $where_attr\";\r\n //return $where_attr;\r\n\r\n $task_db_results = array();\r\n //for all the available tasks, query them\r\n foreach($accessible_tasks as $task_id) {\r\n //prepare statement\r\n $q = \"SELECT * FROM tasks WHERE id=$task_id $where_string\";\r\n //query statement\r\n if ($qres = $conn->query($q)) {\r\n //add results to $task_db_results\r\n $qres->data_seek(0);\r\n array_push($task_db_results, $qres->fetch_assoc());\r\n //close query\r\n $qres->close();\r\n }\r\n }\r\n //if the limit is specified, shorten the results to the limit length\r\n if ($limit > 1) {\r\n $task_db_results = array_slice($task_db_results, 0, $limit);\r\n }\r\n\r\n if ($json==false) {\r\n return $json;\r\n return $task_db_results;\r\n }\r\n //write the output as json in the $out string\r\n $out = '{\"content\":[ ';\r\n foreach ($task_db_results as $row) {\r\n if (is_array($row)) {\r\n $out = $out.'{';\r\n foreach ($row as $key => $value) {\r\n $out = $out.'\"'.$key.'\":\"'.$value.'\",';\r\n }\r\n $l = strlen($out) - 1;\r\n $out = substr($out, 0, $l);\r\n $out = $out.'},';\r\n } else {\r\n $out = $out.'\"\",';\r\n }\r\n }\r\n $l = strlen($out) - 1;\r\n $out = substr($out, 0, $l);\r\n $out = $out.\"]\";\r\n //write types as types attr\r\n $out = $out.',\"types\": [';\r\n foreach($task_attributes as $ind => $type) {\r\n $out = $out.'\"'.$type.'\",';\r\n }\r\n $l = strlen($out) - 1;\r\n $out = substr($out, 0, $l);\r\n $out = $out.']';\r\n $out = $out.\"}\";\r\n\r\n } else {\r\n return 'hi';\r\n }\r\n }\r\n //return output\r\n return $out;\r\n}",
"public function index()\n {\n $tasks = Task::where('is_deleted',false)->with(['filters','country_filter'])->get();\n foreach ($tasks as $task){\n $task->user = User::find($task->user_id);\n }\n return view('admin.tasks.index',compact('tasks'));\n }",
"function alltimeAction() {\n\t\t$this->getModel()->setPage($this->getPageFromRequest());\n\n\t\t$oView = new userView($this);\n\t\t$oView->showAlltimeLeaderboard();\n\t}",
"public function date_range_report()\n\t{\n\t\t$this->data['crystal_report']=$this->reports_personnel_schedule_model->crystal_report_view();\n\t\t$this->data['company_list'] = $this->reports_personnel_schedule_model->company_list();\n\t\t$this->load->view('employee_portal/report_personnel/schedule/date_range_report',$this->data);\n\t}",
"public function index()\n {\n $user = Auth::user();\n $role = $user->role;\n $from_date = null;\n $i = 1;\n $sw = 0;\n $countAthleteArr = [];\n $arrOfTimes = [\n '08:00 - 08:30' => $this->toPersianNum('8'),\n '08:30 - 09:00' => $this->toPersianNum('8/5'),\n '09:00 - 09:30' => $this->toPersianNum('9'),\n '09:30 - 10:00' => $this->toPersianNum('9/5'),\n '10:00 - 10:30' => $this->toPersianNum('10'),\n '10:30 - 11:00' => $this->toPersianNum('10/5'),\n '11:00 - 11:30' => $this->toPersianNum('11'),\n '11:30 - 12:00' => $this->toPersianNum('11/5'),\n '12:00 - 12:30' => $this->toPersianNum('12'),\n '12:30 - 13:00' => $this->toPersianNum('12/5'),\n '13:00 - 13:30' => $this->toPersianNum('13'),\n '13:30 - 14:00' => $this->toPersianNum('13/5'),\n '14:00 - 14:30' => $this->toPersianNum('14'),\n '14:30 - 15:00' => $this->toPersianNum('14/5'),\n '15:00 - 15:30' => $this->toPersianNum('15'),\n '15:30 - 16:00' => $this->toPersianNum('15/5'),\n '16:00 - 16:30' => $this->toPersianNum('16'),\n '16:30 - 17:00' => $this->toPersianNum('16/5'),\n '17:00 - 17:30' => $this->toPersianNum('17'),\n '17:30 - 18:00' => $this->toPersianNum('17/5')\n ];\n $cancel = '';\n $slots = Slot::all();\n $englishDates = [];\n for ($i = 1; $i <= 30; $i++) {\n $englishDates[] = Carbon::now()->addDays($i - 1)->format('Y-m-d');\n }\n //if ($request->getMethod() == 'POST') {\n\n\n // $found = Slot::where('start', $start)\n // ->where('end', $end)\n // ->where('date', $from_date)\n // ->first();\n // if($found){\n // if ($found->athlete_id_1 == $user->id || $found->athlete_id_2 == $user->id || $found->athlete_id_3 == $user->id) {\n // $first = $found->athlete_id_1;\n // $second = $found->athlete_id_2;\n // $third = $found->athlete_id_3;\n // if ($first == $user->id) {\n // $found->athlete_id_1 = 0;\n // $found->save();\n // $request->session()->flash(\"msg_success\", \"با موفقیت حذف شدید.\");\n // return redirect()->back();\n // } else if ($second == $user->id) {\n // $found->athlete_id_2 = 0;\n // $found->save();\n // $request->session()->flash(\"msg_success\", \"با موفقیت حذف شدید.\");\n // return redirect()->back();\n // } else if ($third == $user->id) {\n // $found->athlete_id_3 = 0;\n // $found->save();\n // $request->session()->flash(\"msg_success\", \"با موفقیت حذف شدید.\");\n // return redirect()->back();\n // }\n // }\n // }\n // }\n foreach($slots as $slot){\n for($i = 0;$i < 20;$i++){\n $countAthleteArr[jdate($slot->date)->format('Y-m-d')][$i] = 0;\n }\n }\n foreach ($slots as $slot) {\n $slotsFoundByDate = Slot::where('date', $slot->date)->get();\n foreach ($slotsFoundByDate as $i => $item) {\n $countAthleteArr[jdate($item->date)->format('Y-m-d')][$i] = count(array_filter([$item->athlete_id_1, $item->athlete_id_2, $item->athlete_id_3]));\n }\n }\n $theUserSlots = [];\n $arrOfDates = [];\n for ($i = 1; $i <= 30; $i++) {\n $theUserSlots[jdate()->addDays($i - 1)->format('Y-m-d')] = [];\n $arrOfDates[] = jdate()->addDays($i - 1)->format('Y-m-d');\n }\n //dd($arrOfDates);\n $slotIndex = [\n \"08:00:00\" => 1,\n \"08:30:00\" => 2,\n \"09:00:00\" => 3,\n \"09:30:00\" => 4,\n \"10:00:00\" => 5,\n \"10:30:00\" => 6,\n \"11:00:00\" => 7,\n \"11:30:00\" => 8,\n \"12:00:00\" => 9,\n \"12:30:00\" => 10,\n \"13:00:00\" => 11,\n \"13:30:00\" => 12,\n \"14:00:00\" => 13,\n \"14:30:00\" => 14,\n \"15:00:00\" => 15,\n \"15:30:00\" => 16,\n \"16:00:00\" => 17,\n \"16:30:00\" => 18,\n \"17:00:00\" => 19,\n \"17:30:00\" => 20,\n ];\n foreach($slots as $item){\n $date = jdate($item->date)->format('Y-m-d');\n if(in_array($date,$arrOfDates)){\n for($j =1; $j <= 20; $j++){\n $theUserSlots[$date][\"slot-\".$j] = [\"is_mine\" => null, \"seat_count\" => null];\n }\n $theUserSlots[$date][\"is_mine\"] = null;\n }\n }\n foreach ($slots as $index => $item) {\n $date = jdate($item->date)->format('Y-m-d');\n if(in_array($date,$arrOfDates)){\n $slotsFoundByDate = Slot::where('date', $item->date)->get();\n foreach ($slotsFoundByDate as $i => $s) {\n $theSwitch = Slot::where('date', $s->date)\n ->where('start', $s->start)\n ->where('end', $s->end)\n ->where(function ($query) use ($user) {\n $query->where('athlete_id_1', $user->id)\n ->orWhere('athlete_id_2', $user->id)\n ->orWhere('athlete_id_3', $user->id)\n ->first();\n })->first();\n $theSelf = $theSwitch != null ? 1 : 0;\n $theUserSlots[$date][\"slot-\".($slotIndex[$s->start])] = [\"is_mine\" => $theSelf, \"seat_count\" => $countAthleteArr[$date][$i]];\n }\n $theUserSlots[$date][\"is_mine\"] = 0;\n }\n }\n foreach($theUserSlots as $x => $item){\n foreach($item as $y => $index){\n if(!empty($theUserSlots)){\n if(is_array($theUserSlots[$x][$y])){\n if($theUserSlots[$x][$y][\"is_mine\"] != null && $theUserSlots[$x][$y][\"is_mine\"]!= 0){\n $theUserSlots[$x][\"is_mine\"] = $theUserSlots[$x][$y][\"is_mine\"];\n }elseif($theUserSlots[$x][$y][\"is_mine\"] != null && $theUserSlots[$x][$y][\"is_mine\"]== 0){\n $theUserSlots[$x][\"is_mine\"] = 0;\n }\n }\n\n }\n }\n }\n $todayDate = jdate()->format('Y-m-d');\n $todayTime = jdate()->format('H:i');\n return view('Athlete.dashboard')->with([\n 'from_date' => $from_date,\n 'arrOfTimes' => $arrOfTimes,\n 'msg_success' => request()->session()->get('msg_success'),\n 'msg_error' => request()->session()->get('msg_error'),\n 'role' => $role->type,\n 'user_slots' => $theUserSlots,\n 'i' => $i,\n 'sw' => $sw,\n 'todayTime' => $todayTime,\n 'todayDate' => $todayDate,\n 'count' => $countAthleteArr,\n 'cancel' => $cancel\n ]);\n }",
"public function index(){\n $this->isAuthorize();\n\n // Get all User Specific Data\n $userID = $this->request->session()->get('userID');\n $allTimeslot = Apt_time_slot::where('userID','=',$userID)->orderBy('id','DESC')->paginate(10);\n return view('appointments.timeslot.index', compact('allTimeslot'));\n }",
"public function actionTaskUsers()\n {\n CommonUtility::startProfiling();\n try\n {\n Yii::app()->clientScript->scriptMap['jquery.js'] = false;\n Yii::app()->clientScript->scriptMap['jquery.min.js'] = false;\n Yii::app()->clientScript->scriptMap['jquery.yiiactiveform.js'] = false;\n Yii::app()->clientScript->scriptMap['chosen.jquery.js'] = false;\n \n $taskId = $_POST[Globals::FLD_NAME_TASK_ID];\n \n $task = Task::model()->with('taskcategory','category','categorylocale')->findByPk($taskId);\n $userDetail = array();\n if($task->{Globals::FLD_NAME_CREATER_USER_ID} == Yii::app()->user->id )\n {\n $taskUsers = TaskTasker::getAllProposalsOfTask($taskId);\n if($taskUsers)\n {\n foreach ( $taskUsers as $taskUser )\n {\n $userDetail[$taskUser->{Globals::FLD_NAME_TASKER_ID}] = CommonUtility::getUserFullName($taskUser->{Globals::FLD_NAME_TASKER_ID});\n }\n }\n }\n else\n {\n $userDetail[$task->{Globals::FLD_NAME_CREATER_USER_ID}] = CommonUtility::getUserFullName($task->{Globals::FLD_NAME_CREATER_USER_ID});\n }\n $usersHtml = $this->renderPartial('partial/_task_users', array( 'userDetail' => $userDetail ) , true , true);\n //code\n echo $error = CJSON::encode(array(\n 'status'=>'success',\n 'task_creator_user_id' => $task->{Globals::FLD_NAME_CREATER_USER_ID},\n 'html' => $usersHtml\n ));\n }\n catch(Exception $e)\n { \n //catch exception\n $msg = $e->getMessage();\n CommonUtility::catchErrorMsg( $msg );\n }\n CommonUtility::endProfiling();\n }",
"public function index()\n {\n $this->authorize('viewAny', Task::class);\n\n return TaskResource::collection(\n Task::where('user_id', Auth::user()->id)->get()\n );\n }",
"public function viewProjectTasks() {\n\n return $this->render('enterprise/task/project_tasks.html.twig', array(\n 'tasks' => array(\n '0' => array(\n 'titre' => 'titre',\n 'priority' => 'High',\n 'category' => 'Bug',\n 'status' => 'New',\n 'progress' => '20%',\n 'datemodif' => '20/05/2015'\n ),\n '1' => array(\n 'titre' => 'titre',\n 'priority' => 'Low',\n 'category' => 'Dev',\n 'status' => 'In Progress',\n 'progress' => '60%',\n 'datemodif' => '03/06/2004'\n ),\n '2' => array(\n 'titre' => 'titre',\n 'priority' => 'Med',\n 'category' => 'Doc',\n 'status' => 'Rejected',\n 'progress' => '20%',\n 'datemodif' => '02/08/2013'\n ),\n '3' => array(\n 'titre' => 'titre',\n 'priority' => 'Med',\n 'category' => 'Dev',\n 'status' => 'Valided',\n 'progress' => '100%',\n 'datemodif' => '02/05/2016'\n )\n )\n )\n );\n }",
"public function actionTasks(){\n\t\t$userIdtmp = XenForo_Visitor::getUserId();\n\t\t$conditions = array('userId' => $userIdtmp);\n\t\t$order_items = $this->_getOrderItemModel()->getAllOrderItem($conditions);\n\t\t\n\t\t$viewParams = array(\n\t\t\t'tasks' => $order_items\n\t\t);\n\t\t\n\t\treturn $this -> responseView('DTUI_ViewPublic_EntryPoint_Tasks','dtui_task_list',$viewParams);\n\t}",
"function getUserSchedule($userId) {\n\t\t$result = db_getUserSchedule($userId);\n\t\tif ($result) {\n\t\t\techo '<form method=\"post\" name=\"scheduleForm\">';\n\t\t\techo '<ul class=\"list-group\">';\n\t\t\tif ($result != FALSE) {\n\t\t\t\tforeach($result as $row) {\n\t\t\t\t\techo '<li class=\"list-group-item\">';\n\t\t\t\t\techo '<div class=\"row\">';\n\t\t\t\t\t\techo '<div class=\"col-md-9 row\">';\n\t\t\t\t\t\t\techo '<h4 class=\"list-group-item-heading col-md-6\" style=\"color:'. $row['colour'] .'\">Name: ' . $row[\"name\"] . \"</h4>\";\n\t\t\t\t\t\t\techo '<p class=\"col-md-6 text-center\">Start Date(d-m-y): ' . $row['startDate'] . '</p>';\n\t\t\t\t\t\t\techo '<p class=\"list-group-item-text col-md-12\">Description: ' . $row[\"description\"] . \"</p>\";\n\t\t\t\t\t\techo '</div>';\n\t\t\t\t\t\techo \"<div class=\\\"col-md-3 btn-group\\\"><a href=\\\"?edit&id=\" . $row['id'] . \"\\\" class=\\\"btn btn-default\\\">Edit</a>\";\n\t\t\t\t\t\techo '<button name=\"removeAction\" value=\"'.$row['id'].'\" class=\"btn btn-danger\">Remove</button></div>';\n\t\t\t\t\techo '</div>';\n\t\t\t\t\techo '</li>';\n\t\t\t\t}\n\t\t\t}\n\t\t\techo '</ul>';\n\t\t\techo '</form>';\n\t\t} else {\n\t\t\techo 'Nothing has been scheduled';\n\t\t}\n\t}",
"function drush_acapi_ac_task_list() {\n $api_args = acapi_get_site_args();\n $format = acapi_get_option('format');\n $state = drush_get_option('state', NULL);\n $days = drush_get_option('days', NULL);\n $limit = drush_get_option('limit', NULL);\n $params = array();\n if (isset($state)) {\n $params['state'] = $state;\n }\n if (isset($days)) {\n $params['days'] = $days;\n }\n if (isset($limit)) {\n $params['limit'] = $limit;\n }\n\n list($status, $result) = acapi_call(\n 'GET',\n '/sites/:realm::site/tasks',\n $api_args,\n $params,\n array(),\n array('display' => !empty($format))\n );\n\n $simulate = drush_get_option('simulate', FALSE);\n if ($simulate) {\n return;\n }\n\n if (empty($format)) {\n $display = array();\n foreach ($result as $id => $task) {\n $display[$task->id] = $task->description;\n }\n drush_print_table(drush_key_value_to_array_table($display));\n }\n}",
"function tripal_jobs_report () {\n //$jobs = db_query(\"SELECT * FROM {tripal_jobs} ORDER BY job_id DESC\");\n $jobs = pager_query(\n \"SELECT TJ.job_id,TJ.uid,TJ.job_name,TJ.modulename,TJ.progress,\n TJ.status as job_status, TJ,submit_date,TJ.start_time,\n TJ.end_time,TJ.priority,U.name as username\n FROM {tripal_jobs} TJ \n INNER JOIN {users} U on TJ.uid = U.uid \n ORDER BY job_id DESC\", 10,0,\"SELECT count(*) FROM {tripal_jobs}\");\n\t\n // create a table with each row containig stats for \n // an individual job in the results set.\n $output .= \"Waiting jobs are executed first by priority level (the lower the \".\n \"number the higher the priority) and second by the order they \".\n \"were entered\";\n $output .= \"<table class=\\\"tripal-table tripal-table-horz\\\">\". \n \" <tr>\".\n \" <th>Job ID</th>\".\n \" <th>User</th>\".\n \" <th>Job Name</th>\".\n \" <th nowrap>Dates</th>\". \n\t\t\t \" <th>Priority</th>\".\n\t\t\t \" <th>Progress</th>\".\n \" <th>Status</th>\".\n \" <th>Actions</th>\".\n \" </tr>\";\n $i = 0;\n while($job = db_fetch_object($jobs)){\n $class = 'tripal-table-odd-row';\n if($i % 2 == 0 ){\n $class = 'tripal-table-even-row';\n }\n $submit = tripal_jobs_get_submit_date($job);\n $start = tripal_jobs_get_start_time($job);\n $end = tripal_jobs_get_end_time($job);\n\n $cancel_link = '';\n if($job->start_time == 0 and $job->end_time == 0){\n $cancel_link = \"<a href=\\\"\".url(\"admin/tripal/tripal_jobs/cancel/\".$job->job_id).\"\\\">Cancel</a><br>\";\n }\n $rerun_link = \"<a href=\\\"\".url(\"admin/tripal/tripal_jobs/rerun/\".$job->job_id).\"\\\">Re-run</a><br>\";\n $view_link =\"<a href=\\\"\".url(\"admin/tripal/tripal_jobs/view/\".$job->job_id).\"\\\">View</a>\";\n $output .= \" <tr class=\\\"$class\\\">\";\n $output .= \" <td>$job->job_id</td>\".\n \" <td>$job->username</td>\".\n \" <td>$job->job_name</td>\".\n \" <td nowrap>Submit Date: $submit\".\n \" <br>Start Time: $start\".\n \" <br>End Time: $end</td>\".\n \" <td>$job->priority</td>\".\n\t\t\t\t \" <td>$job->progress%</td>\".\n \" <td>$job->job_status</td>\".\n \" <td>$cancel_link $rerun_link $view_link</td>\".\n \" </tr>\";\n $i++;\n }\n $output .= \"</table>\";\n\t$output .= theme_pager();\n return $output;\n}",
"public function run()\n {\n DB::table('tasks')->insert([\n 'user_id' => 1,\n 'description' => 'This is the first task for user 1.',\n 'status' => \"In Progress\",\n 'priority' => \"High\",\n 'due_at' => '2019-12-01',\n 'created_at' => '2019-10-01 12:20:02',\n 'updated_at' => '2019-10-01 12:20:02'\n ]);\n\n DB::table('tasks')->insert([\n 'user_id' => 2,\n 'description' => 'This is the first task for user 2.',\n 'status' => \"Not Started\",\n 'priority' => \"Medium\",\n 'due_at' => '2019-12-11',\n 'created_at' => '2019-10-01 12:20:02',\n 'updated_at' => '2019-10-01 12:20:02'\n ]);\n\n DB::table('tasks')->insert([\n 'user_id' => 1,\n 'description' => 'This is the second task for user 1.',\n 'status' => \"Not Started\",\n 'priority' => \"Low\",\n 'due_at' => '2020-02-01',\n 'created_at' => '2019-10-01 12:20:02',\n 'updated_at' => '2019-10-01 12:20:02'\n ]);\n\n }",
"public function task_list()\n {\n \t//get list of tasks from database\n \t//instance the class\n $this->load->model('Task_model');\n\t\t$id_user = $this->User_model->getID();\n\t\t$data['name'] = $this->User_model->getID();\n $data['tasks'] = $this->Task_model->getTask(NULL, $this->User_model->getActiveProject());\n\t\t\n \t//load the view associated with this controller\n $this->load->view('header', $data);\n $this->load->view('nav', $data);\n $this->load->view('task/task', $data);\n $this->load->view('footer', $data);\n \t\n }",
"public function timesheets(User $user, UserAdmin $incomingUser, UserRole $userRole)\n {\n return $this->view($user, $incomingUser, $userRole);\n }",
"public function indexCreated()\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n\n $createdTasks = [];\n foreach($currentUser->createdTasks as $createdTask){\n if ($this->compareTime($createdTask) > 0){\n array_push($createdTasks, \n array('task' => $createdTask,\n 'assets' => $this->getAssets($createdTask),\n 'locations' => $createdTask->locations));\n }\n }\n return response()->json($createdTasks);\n }",
"public function index()\n {\n $task_repo = $this->getDoctrine()->getRepository(Task::class);\n $tasks = $task_repo->findBy([], [\n 'id'=> 'desc'\n ]);\n /* desde task\n \n foreach ($tasks as $tarea) {\n echo $tarea->getUser()->getName().\" \".$tarea->getUser()->getSurname()\n .\" :\".$tarea->getTitle().\"<br>\";\n }*/\n /*foreach ($users as $usuario) {\n echo \"<h1>\".$usuario->getName().\" \".$usuario->getSurname().\"</h1>\";\n foreach ($usuario->getTasks() as $tarea) {\n echo $tarea->getTitle().\"<br>\";\n }\n }*/\n return $this->render('task/index.html.twig', [\n 'tasks' => $tasks,\n ]);\n }",
"public function taskhistory(){\n\n // SQL statement\n $sql = \"SELECT user_id FROM user WHERE user_name = '\".$_SESSION['user'].\"'\";\n $result = $this->con->query($sql);\n $result = $result->fetch_assoc();\n $id = $result['user_id'];\n\n\n // Get Task History Based on user ID\n\n // SQL statement\n $sql = \"SELECT * FROM approval WHERE user_id = '\".$id.\"' ORDER BY date DESC LIMIT 10\";\n $result = $this->con->query($sql);\n if ($result->num_rows > 0){\n while ($row = $result->fetch_assoc()){\n $array[] = $row;\n }\n return $array;\n }\n }",
"public function index()\n {\n $task = Task::where('user_id', auth()->user()->id)->get();\n return TaskResource::collection($task);\n }",
"public function viewTasks(){\n $task = new Tasks();\n $roles = new Role();\n $resp = $task->read();\n if($resp->status){\n $tasks = $resp->data;\n $temp = array();\n foreach ($tasks as $task){\n $task->mapped_roles = $task->getMappedRoles($task->tasks_id);\n $temp[] = $task;\n }\n $resp->data = $temp;\n }\n $this->data['response_tasks'] = $resp;\n $this->data['response_roles'] = $roles->readAll();\n return $this->view();\n }",
"public function scheduled()\n\t{\n\t\ttry {\n\t\t\t$requests = UserRequests::where( 'status', 'SCHEDULED' )\n\t\t\t\t->where( 'fleet_id', 0 )\n\t\t\t\t->RequestHistory();\n\n\t\t\t$acceptRequestID =\n\t\t\t\tPoolTransaction::where( 'fleet_id', 0 )->pluck( 'request_id' )\n\t\t\t\t\t->toArray();\n\t\t\t$request1 =\n\t\t\t\tUserRequests::where( 'status', 'SCHEDULED' )->RequestHistory()\n\t\t\t\t\t->whereIn( 'id', $acceptRequestID );\n\n\t\t\t$requests = $requests->union( $request1 )->get();\n\t\t\t\n\t\t\t//pool list that fleets create\n\t\t\t$self_pool_list = PrivatePools::where(['status'=>1,'from_fleet_id'=>'0']);\n\t\t\t//pool list that other fleets accepts\n\t\t\t$accept_pool_list_id = PrivatePoolPartners::where(['status'=>1,'action_id'=>'0'])->pluck('pool_id')->toArray();\n\t\t\t$accept_pool_list = PrivatePools::whereIn('id',$accept_pool_list_id);\n\n\t\t\t$private_pool_list = $self_pool_list->union($accept_pool_list)->get();\n\n\n\t\t\treturn view( 'admin.request.scheduled', compact( 'requests','private_pool_list' ) );\n\t\t} catch ( Exception $e ) {\n\t\t\treturn back()->with( 'flash_error',\n\t\t\t\ttrans( 'admin.something_wrong' ) );\n\t\t}\n\t}",
"public function index()\n {\n $taskSelect = Task::with('project')->where('user_id', auth()->user()->id)->get();\n $projects = Project::all();\n $tasks = Task::with('timer')->with('project')->where('user_id', auth()->user()->id)->get()->paginate(3);\n\n return view('index',['tasks' => $tasks , 'projects' => $projects, 'taskSelect' => $taskSelect]);\n }",
"public function userAccount()\n\t{\n $per_page = 4;\n $total_rows = (new Task())->countRows()->execute();\n $total_pages = ceil($total_rows / $per_page);\n $data = (new Task())->all('0','4')->execute();\n $pages = ['total_pages' => $total_pages, 'current_page' => 1];\n $data = [$data, $pages];\n View::render('userprofile', $data);\n\t}",
"public function index()\n {\n //\n // for test case\n $tasks = \\Auth::user()->myTasks()->get();\n // return $tasks;\n $shareableTask = \\App\\Shareable::all();\n $filtered = $shareableTask->filter(function ($value, $key) {\n if($value->share_user_id != \\Auth::user()->id){\n return $value;\n }\n });\n\n $tasksForOthers = $filtered->map(function ($item, $key) {\n return $item->task;\n });\n $allTasks = $tasksForOthers->merge($tasks); // Contains foo and bar.\n // $myTasks = \\Auth::user()->myTasks();\n $allTasks = $allTasks->filter(function ($value, $key) {\n return $value != null ;\n });\n\n return view('home')->with('data',$allTasks);\n\n // return view('home');\n }",
"public function worklogsReporting()\n {\n \t//\n \t// by developer\n //\n // by hours\n\n $worklogs_segmented_by_proj = [];\n $company_projects = $this->getAllProjects();\n\n foreach ($company_projects as $ndx => $company_project)\n {\n $worklogs_by_user = Werklog::with('user')\n ->selectRaw('user_id, COUNT(user_id) as user_occurrences, SUM(minutes) as user_project_total_time')\n ->where('project_id', $company_project->id)\n ->groupBy('user_id')\n ->orderBy('user_project_total_time', 'DESC')\n ->take(static::$_numrows)\n ->get();\n\n $worklogs_segmented_by_proj[$company_project->id] = $worklogs_by_user;\n }\n\n\t\tDebugbar::info($worklogs_segmented_by_proj);\n\n\t\treturn $worklogs_segmented_by_proj;\n }",
"public function index()\n {\n $tasks = Task::where('user_id', Auth::user()->id)->get();\n return view('task.index', compact('tasks'));\n\n }",
"public function index()\n {\n if (! Gate::allows('tasks_manage')) {\n return abort(401);\n// return response('Permission Denied.', 403);\n }\n\n $tasks = Task::with('project', 'assignee')->get();\n\n return view('admin.tasks.index', compact('tasks'));\n }",
"public function tasks()\r\n {\r\n // autorender off for view\r\n $this->autoRender = false;\r\n\r\n //--------- Post request -----------\r\n if ($this->request->is('post')) {\r\n $userId = $this->Auth->user('id');\r\n //check export task type\r\n $Tasktype = ($this->checkAdmin()) ? $this->request->data['Export']['type'] : '1';\r\n $fDate = date(\"Y-m-d\", strtotime($this->request->data['Export']['from_date']));\r\n $tDate = date('Y-m-d 24:00:00', strtotime($this->request->data['Export']['to_date']));\r\n //get all tasks by parametes\r\n $tasks = $this->Task->getExport($userId, $Tasktype, $fDate, $tDate);\r\n\r\n //Create file and add task in csv file for download\r\n $file_name = 'Task';\r\n $filename = $file_name . \"_\" . date(\"Y-m-d_H-i\", time()) . \".csv\";\r\n\r\n //force csv download\r\n header('Content-type: text/csv');\r\n header('Content-Disposition: attachment; filename=\"' . $filename . '\";');\r\n $file = fopen('php://output', 'w');\r\n $data = array('Task', 'Date', 'Time', 'Priority', 'Deal', 'Pipeline', 'By', 'Status');\r\n fputcsv($file, $data, ',', '\"');\r\n\r\n //add task data to csv file in loop for tasks\r\n foreach ($tasks as $row) {\r\n $data = array();\r\n $data[] = $row['Task']['task'];\r\n $data[] = $row['Task']['date'];\r\n $data[] = date('H:i a', strtotime($row['Task']['time']));\r\n if ($row['Task']['priority'] == '1') {\r\n $priority = 'High Priorty';\r\n } elseif ($row['Task']['priority'] == '2') {\r\n $priority = 'Medium Priorty';\r\n } else {\r\n $priority = 'Low Priorty';\r\n }\r\n $data[] = $priority;\r\n $data[] = $row['Deal']['name'];\r\n $data[] = $row['Pipeline']['name'];\r\n $data[] = $row['User']['first_name'] . ' ' . $row['User']['last_name'];\r\n $data[] = ($row['Task']['status'] == 1) ? 'Done' : '';\r\n fputcsv($file, $data, ',', '\"');\r\n }\r\n fclose($file);\r\n }\r\n }",
"public function index()\n {\n $query = Taske::query();\n\n foreach(request('filter', []) as $filter => $value){\n $query->orWhere($filter, $value);\n }\n \n $taskes = $query->orderBy('due_date', 'asc')\n ->paginate(15)->appends(request()->except('page'));\n\n return $taskes;\n\n }",
"function dwsim_flowsheet_progress_all()\n{\n\t$page_content = \"\";\n\t$query = db_select('dwsim_flowsheet_proposal');\n\t$query->fields('dwsim_flowsheet_proposal');\n\t$query->condition('approval_status', 1);\n\t$query->condition('is_completed', 0);\n\t$result = $query->execute();\n\tif ($result->rowCount() == 0)\n\t{\n\t\t$page_content .= \"Work is in progress for the following flowsheets under Flowsheeting Project<hr>\";\n\t} //$result->rowCount() == 0\n\telse\n\t{\n\t\t$page_content .= \"Work is in progress for the following flowsheets under Flowsheeting Project<hr>\";;\n\t\t$preference_rows = array();\n\t\t$i = $result->rowCount();\n\t\twhile ($row = $result->fetchObject())\n\t\t{\n\t\t\t$approval_date = date(\"Y\", $row->approval_date);\n\t\t\t$preference_rows[] = array(\n\t\t\t\t$i,\n\t\t\t\t$row->project_title,\n\t\t\t\t$row->contributor_name,\n\t\t\t\t$row->university,\n\t\t\t\t$approval_date\n\t\t\t);\n\t\t\t$i--;\n\t\t} //$row = $result->fetchObject()\n\t\t$preference_header = array(\n\t\t\t'No',\n\t\t\t'Flowsheet Project',\n\t\t\t'Contributor Name',\n\t\t\t'University / Institute',\n\t\t\t'Year'\n\t\t);\n\t\t$page_content .= theme('table', array(\n\t\t\t'header' => $preference_header,\n\t\t\t'rows' => $preference_rows\n\t\t));\n\t}\n\treturn $page_content;\n}",
"public function index()\n {\n $data = Task::with('user')->orderBy('id', 'desc')->get();\n return view('task.index', compact('data'));\n }",
"function Todo() {\n\t\t$query_string = Request::$GET;\n\t\t$global_string = $this->buildQuery($query_string);\n\n\t\t// we only want to do this is we have a valid, single user. \n\t\t$show_ical = FALSE;\n\n\t\t//Display User select tool if user has admin permissions\n\t\t$globalUser = '';\n\t\tif ($this->User->HasModuleItemAccess('administration', CU_ACCESS_ALL, CU_ACCESS_READ)) {\n\n\t\t\t// $actualUserID = $this->User->ID;\n\t\t\t// try to get a imitation user form the request string.\n\t\t\t$userID = Request::get('userID', Request::R_INT);\n\n\t\t\t// userID can be 'all'\n\t\t\tif (($userID == null) && (Request::get('userID') == 'all'))\n\t\t\t{\n\t\t\t\t$userID = 'all';\n\t\t\t}\n\n\t\t\t// else, check if we have a imitation user in the session object.\n\t\t\tif (!$userID) {\n\t\t\t $userID = $this->Session->Get('springboardID');\n\t\t\t}\n\t\t\t\n\t\t\t// Create Temp user for creating correct permissions\n\t\t\tif ($userID) {\n\t\t\t\t$this->Session->Set('springboardID', $userID);\n\n\t\t\t\tif ($userID == 'all')\n\t\t\t\t{\n\t\t\t\t $this->TempUser =& new User();\n\t\t\t\t $this->TempUser->ID = null;\n\t\t\t\t} else {\n\t\t\t\t\t$show_ical = TRUE;\n\t\t\t\t $this->TempUser =& new User();\n\t\t\t\t $this->TempUser->Initialise($userID, $this->DB);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->TempUser->ID = $this->User->ID;\n\t\t\t\t$userID = $this->User->ID;\n\t\t\t\t$this->Session->Set('springboardID', $userID);\n\t\t\t}\n\t\t\t\n\t\t\t$globalUser = '<label>' . MSG_USER_TO_SHOW . '</label>'\n\t\t\t\t\t\t.'<select name=\"UserID\" class=\"TaskUpdate_dd\" id=\"userToShowFilter\">';\n\n\t\t\t$SQL = sprintf(SQL_GET_USER_LIST);\n\t\t\t$userList = $this->DB->Query($SQL);\n\t\t\tif ($userList) {\n\t\t\t\t// first add in a \"All users option\"\n\t\t\t\t$globalUser .= '<option value=\"all\"'\n\t\t\t\t. (($this->TempUser->ID == null) ? ' selected' : '') . '>'\n\t\t\t\t. MSG_SHOW_ALL . '</option>';\n\t\t\t \n\t\t\t\tfor ($i = 0; $i < count($userList); $i++) {\n\t\t\t\t\t$globalUser .= '<option value=\"' . $userList[$i]['ID'] . '\"'\n\t\t\t\t\t. ($this->TempUser->ID == $userList[$i]['ID'] ? ' selected' : '') . '>'\n\t\t\t\t\t. $userList[$i]['FirstName'].' '.$userList[$i]['LastName'].'</option>';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$globalUser .= '</select>';\n\t\t\t$tmplDash['globalUser'] = $globalUser;\n\n\t\t} else {\n\t\t\t// don't allow non-admins to edit the user they view for.\n\t\t\t$tmplDash['globalUser'] = '';\n\t\t\t$userID = $this->User->ID;\n\t\t\t$show_ical = TRUE;\n\t\t\t$this->Session->Set('springboardID', $userID);\n\t\t}\n\n\t\t$filter_array = array('mytasks','owed','all');\n\t\t$filter_display = array(MSG_MINE,MSG_OWED,MSG_ALL);\n\t\tfor ($i = 0, $filteroptions = null, $filtercount = count($filter_array); $i < $filtercount; $i++) \n\t\t{\n\t\t\t$filteroptions .= sprintf('<option value=\"%s\" %s>%s</option>', \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$filter_array[$i],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t($_GET['action'] == $filter_array[$i]) ? ' SELECTED' : '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$filter_display[$i]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t}\n\n\t\t$tmplDash['showfilter'] = '<label>'.MSG_SHOW_THESE_TASKS.'</label>'\n\t\t\t.'<select id=\"showTheseTasksFilter\">'.$filteroptions.'</select>';\n\n\t\t$range_array = array('all' => '{MSG_ALL}', \n\t\t\t\t\t\t\t\t\t\t\t\t'lastweek' => '{MSG_LAST_WEEK}', \n\t\t\t\t\t\t\t\t\t\t\t\t'thisweek' => '{MSG_THIS_WEEK}',\n\t\t\t\t\t\t\t\t\t\t\t\t'nextweek' => '{MSG_NEXT_WEEK}',\n\t\t\t\t\t\t\t\t\t\t\t\t'today' => '{MSG_TODAY}',\n\t\t\t\t\t\t\t\t\t\t\t\t'yesterday' => '{MSG_YESTERDAY}',\n\t\t\t\t\t\t\t\t\t\t\t\t'lastmonth' => '{MSG_LAST_MONTH}',\n\t\t\t\t\t\t\t\t\t\t\t\t'thismonth' => '{MSG_THIS_MONTH}', \n\t\t\t\t\t\t\t\t\t\t\t\t'nextmonth' => '{MSG_NEXT_MONTH}'\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\n\t\tforeach($range_array as $key => $value) \n\t\t{\n\t\t\t$rangeoptions .= sprintf('<option value=\"%s\" %s>%s</option>',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$key, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t($key == $query_string['show']) ? 'selected' : '',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$value\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t}\n\n\t\t$tmplDash['period'] = '<label>'.MSG_PERIOD_TO_SHOW.'</label>\n\t\t\t\t\t\t\t <select id=\"periodToShowFilter\">'.$rangeoptions.'</select>';\n\n\t\t$URI = split (\"index\\.php\",Request::server(SCRIPT_NAME_VAR));\n\t\t// Create validity key\n\t\t\n\t\tif ($show_ical == TRUE)\n\t\t{\n\t\t $this->KeyUser =& new User();\n\t\t $this->KeyUser->Initialise($userID, $this->DB);\n\t\t $key = substr(md5($this->KeyUser->Fullname . $this->KeyUser->PasswordHash), 2, 8);\n\t\t $modAction[] = '<a href=\"webcal://' . Request::server(SERVER_NAME_VAR) . $URI[0] . 'system/ical_springboard.php?show=' . $query_string['show'] \n\t\t\t. '&completed=' . $query_string['completed'] \n\t\t\t. '&action=' . $query_string['action'] \n\t\t\t. '&key=' . $key \n\t\t\t. '&userid=' . $userID . '\">'.MSG_SYNC_TO_ICAL.'</a>';\n\t\t}\n\n\t\t$modAction[] = '<a id=\"dash-toggler\" href=\"#\" onclick=\"toggleDash(); return false;\">'.MSG_SHOW_DASH.'</a>';\n\t\t$this->setDash($this->getTemplate(\"dashBlock\", $tmplDash));\n\n\t\t// pick whether to show completed or active\n\t\t$completed = (isset($query_string['completed']) && ($query_string['completed'] == 1));\n\t\tif ($completed)\n\t\t{\n\t\t\t$modAction[] = '<a href=\"index.php?module=springboard\">'.MSG_VIEW_ACTIVE.'</a>';\n\t\t} else {\n\t\t\t$modAction[] = '<a href=\"index.php?module=springboard&completed=1\">'.MSG_VIEW_COMPLETED.'</a>';\n\t\t}\n\n\t\t$this->CreateTabs('todo');\n\t\t$tmpl['tasklist'] = $this->TaskList($query_string['action'], $userID);\n\n\t\t// Emulate the task view screen.\n\t\tif (Request::get('taskid', Request::R_INT)) {\n\t\t\tResponse::addToJavascript('auto_open_task', TRUE);\n\t\t\tResponse::addToJavascript('item_ids', array(\n\t\t\t\t'project_id' => Request::get('projectid', Request::R_INT),\n\t\t\t\t'task_id' => Request::get('taskid', Request::R_INT),\n\t\t\t\t'comment_id' => Request::get('commentid', Request::R_INT),\n\t\t\t));\n\t\t}\n\n\t\t// this is here to keep template happy.\n\t\t// remove when we are sure that nobody else calls the todo template.\n\t\t$tmpl['script'] = ''; \n\n\t\t$this->setTemplate('todo', $tmpl);\n\n\t\t$this->SetModule(MSG_TODO, $modAction);\n\t\t$this->Render();\n\t}",
"private function printTaskPage() {\n\t\treadfile ( 'html/task.html' );\n\t}",
"public function index()\n {\n if( ! User::isLoggedIn()) {\n header(\"Location: /user/login\");\n }\n $model = new Task();\n $model->user_id = User::getLoggedInUserId();\n if(isset($_GET['sort'])) {\n $model->sort = $_GET['sort'];\n }\n\n $tasks = $model->read();\n\n if(count($tasks) > 0 ) {\n $this->render('index', $tasks);\n } else {\n $this->render('nodata', []);\n }\n }",
"public function index()\n {\n if (request('by')) {\n $user = User::where('name', request('by'))->first();\n $tasks = Task::where('user_id', $user->id)->latest()->with('user')->paginate(5);\n }\n else {\n $tasks = Task::with('user')->latest()->paginate(5);\n }\n\n $users = User::all();\n return view('index', compact('tasks', 'users'));\n }",
"function devshop_render_tasks($tasks = NULL, $class = '', $actions = array(), $float = 'left'){\n global $user;\n\n if (is_null($tasks)){\n // Tasks\n $tasks = hosting_get_tasks(null, null, 10);\n }\n\n // Get active or queued\n $tasks_count = 0;\n foreach ($tasks as $task){\n if ($task->task_status == HOSTING_TASK_QUEUED || $task->task_status == HOSTING_TASK_PROCESSING){\n $tasks_count++;\n }\n }\n\n $task_class = '';\n if ($tasks_count > 0) {\n $task_class = 'active-task fa-spin';\n }\n\n $items = array();\n $text = '<i class=\"fa fa-list-alt\"></i> '. t('Task Logs');\n\n // If for an environment, change the link.\n if (!empty($actions)) {\n\n $environment_node = node_load($tasks[0]->rid);\n $environment = $environment_node->environment;\n\n $url = \"node/{$environment->project_nid}/logs/{$environment->name}\";\n }\n else {\n $url = 'hosting/tasks';\n }\n\n $task_items = array();\n $task_items[] = l($text, $url, array(\n 'html' => TRUE,\n 'attributes' => array(\n 'class' => array(\n 'list-group-item',\n ),\n ),\n ));\n\n $task_types = hosting_available_tasks();\n\n if (!empty($tasks)) {\n\n foreach ($tasks as $task) {\n\n switch ($task->task_status){\n case HOSTING_TASK_SUCCESS:\n $icon = 'check text-success';\n $item_class = 'list-group-item-success';\n break;\n\n case HOSTING_TASK_ERROR;\n $icon = 'exclamation-circle text-danger';\n $item_class = 'list-group-item-danger';\n break;\n case HOSTING_TASK_WARNING:\n $icon = 'warning text-warning';\n $item_class = 'list-group-item-warning';\n break;\n\n case HOSTING_TASK_PROCESSING;\n case HOSTING_TASK_QUEUED;\n $icon = 'cog fa-spin text-info';\n $item_class = 'list-group-item-info';\n break;\n }\n\n $task_node = node_load($task->rid);\n\n // If environment tasks...\n if (!empty($actions)) {\n $task->title = $task_types[$task_node->type][$task->task_type]['title'];\n }\n\n $text = '<i class=\"fa fa-' . $icon . '\"></i> ';\n $text .= $task->title;\n $datetime = date('c', $task->changed);\n $text .= ' <time class=\"timeago task-ago btn-block\" datetime=\"' . $datetime . '\">' . format_interval(REQUEST_TIME - $task->changed) .' '. t('ago') . '</time>';\n\n $id = isset($task_node->environment)? \"task-{$task_node->environment->project_name}-{$task_node->environment->name}\": \"task-\";\n $task_items[] = l($text, 'node/' . $task->nid, array(\n 'html' => TRUE,\n 'attributes' => array(\n 'class' => array('list-group-item ' . $item_class),\n 'id' => $id,\n ),\n ));\n }\n }\n else {\n $task_items[] = t('No Active Tasks');\n }\n\n $items[] = array(\n 'class' => array('tasks'),\n 'data' => '<div class=\"list-group\">' . implode(\"\\n\", $task_items) . '</div>',\n );\n\n if (!empty($actions)) {\n\n array_unshift($items, array(\n 'class' => array('divider'),\n ));\n\n // Add \"Environment Settings\" link\n if (node_access('update', $environment_node)) {\n array_unshift($items, l('<i class=\"fa fa-sliders\"></i> ' . t('Environment Settings'), \"node/{$environment->site}/edit\", array('html' => TRUE)));\n }\n\n $action_items = array();\n foreach ($actions as $link) {\n $action_items[] = l($link['title'], $link['href'], array(\n 'attributes' => array(\n 'class' => array('list-group-item'),\n ),\n 'query' => array(\n 'token' => drupal_get_token($user->uid),\n ),\n ));\n }\n\n $items[] = array(\n 'class' => array('actions'),\n 'data' => '<div class=\"list-group\">' . implode(\"\\n\", $action_items) . '</div>',\n );\n }\n\n $tasks = theme('item_list', array(\n 'items' => $items,\n 'attributes' => array(\n 'class' => array(\n 'devshop-tasks dropdown-menu dropdown-menu-' . $float,\n )\n ),\n 'role' => 'menu',\n )\n );\n\n if ($tasks_count == 0) {\n $tasks_count = '';\n }\n\n $logs = t('Task Logs');\n return <<<HTML\n <div class=\"task-list btn-group\">\n <button type=\"button\" class=\"btn btn-link task-list-button dropdown-toggle $class\" data-toggle=\"dropdown\" title=\"$logs\">\n <span class=\"count\">$tasks_count</span>\n <i class=\"fa fa-gear $task_class\"></i>\n </button>\n $tasks\n </div>\nHTML;\n\n}",
"public function displayTask()\n {\n $filters = array(\n 'start' => Request::getInt('start', 0),\n 'limit' => Request::getInt('limit', 20),\n 'search' => Request::getVar('search', ''),\n 'project' => Request::getVar('project', ''),\n 'authorized' => false,\n 'state' => 1,\n 'access' => User::getAuthorisedViewLevels()\n );\n\n $token = $this->getToken();\n if (!$token)\n {\n $this->redirect($url='login', null, null);\n }\n\n if ($this->config->get('access-manage-component'))\n {\n //$filters['state'] = null;\n $filters['authorized'] = true;\n array_push($filters['access'], 5);\n }\n\n $projects = $this->getProjects($token->get('access_token'), $this->getRadiamURL());\n if ($projects->count > 0) {\n $query = array();\n if (isset($filters['search'])) {\n $query[\"q\"] = $filters['search'];\n }\n\n $query[\"page\"] = $this->getRadiamPage($filters[\"start\"], $filters[\"limit\"]);\n $query[\"page_size\"] = $filters[\"limit\"];\n\n if (isset($filters[\"project\"])) {\n $foundProject = false;\n foreach ($projects->projects as &$project) {\n if ($project->id == $filters[\"project\"]) {\n $foundProject = true;\n }\n }\n if (!$foundProject) {\n $filters[\"project\"] = $projects->projects[0]->id;\n }\n\n } else {\n $filters[\"project\"] = $projects->projects[0]->id;\n }\n\n $files = $this->getFiles($token->get('access_token'), $this->getRadiamURL(), $filters[\"project\"], $query);\n } else {\n $files = new Files();\n }\n\n $pagination = new \\Hubzero\\Pagination\\Paginator($files->count, $filters[\"start\"], $filters[\"limit\"]);\n\n // Need to set any extra parameters for the pagination links to maintain the state\n if (isset($filters['search'])) {\n $pagination->setAdditionalUrlParam('search', $filters['search']);\n }\n\n $pagination->setAdditionalUrlParam('project', $filters[\"project\"]);\n\n // Output HTML\n $this->view\n ->set('config', $this->config)\n ->set('filters', $filters)\n ->set('projects', $projects)\n ->set('files', $files)\n ->set('pagination', $pagination)\n ->display();\n\n }",
"function getPendingStudentDashboard() {\n $this->layout->setField('page_title', 'Test Lesson');\n \n //user for changing only dates no clan.\n $data['change_only_date'] = false;\n \n $userdetail = new Userdetail();\n \n //Get the User extra details exit.\n $userdetail->where('student_master_id', $this->session_data->id)->get();\n \n //Get User details\n $user = $userdetail->User->get();\n \n // Get user Clan details if exits.\n $clan = $userdetail->Clan->get();\n \n //get Clan time\n $time_0 = strtotime(date('Y-m-d H:i:s', strtotime($userdetail->first_lesson_date . date('H:i', $clan->lesson_from))));\n \n //get time before 2 hours of clan start\n $time_1 = strtotime('-2 hour', $time_0);\n \n //get Current time\n $time_2 = strtotime(get_current_date_time()->get_date_time_for_db());\n \n //check user Extra Detail exist\n if ($userdetail->result_count() == 1) {\n \n //set user extra detail to access in view part\n $data['userdetail'] = $userdetail;\n \n // if status is Accepted\n if ($userdetail->status == 'A') {\n \n //get already applied clan name, date, time\n $data['already_applied'] = 'Your request for the clan <strong>' . $clan->{$this->session_data->language . '_class_name'} . '</strong> of school <strong>' . $clan->School->{$this->session_data->language . '_school_name'} . '</strong> at academy <strong>' . $clan->School->Academy->{$this->session_data->language . '_academy_name'} . '</strong><br /> on ' . date(\"d-m-Y\", strtotime($userdetail->first_lesson_date)) . ' : ' . date('h.i a', $clan->lesson_from) . ' - ' . date('h.i a', $clan->lesson_to) . ' is accepted';\n \n //for div color\n $data['type'] = 'success';\n \n //check that is time left to change dates.\n if ($time_2 <= $time_1) {\n $data['clans'] = $clan;\n $data['change_only_date'] = true;\n } else {\n \n //if time less than 2 hours from stating clan\n if ($time_2 <= $time_0) {\n $data['clans'] = 'Get ready for the Class';\n $data['change_only_date'] = true;\n } else {\n \n //Now if clan started check attadence\n $attadence = new Attendance();\n $attadence->where(array('clan_date' => $userdetail->first_lesson_date, 'student_id' => $this->session_data->id))->get();\n \n //Check Data extis in attandence table & check he is present or not\n if ($attadence->result_count() == 1 && $attadence->attendance == 1) {\n redirect(base_url() . 'register/step_2', 'refresh');\n } else {\n \n //get already applied clan name, date, time\n $data['already_applied'] = 'Your missed the clan <strong>' . $clan->{$this->session_data->language . '_class_name'} . '</strong> of school <strong>' . $clan->School->{$this->session_data->language . '_school_name'} . '</strong> at academy <strong>' . $clan->School->Academy->{$this->session_data->language . '_academy_name'} . '</strong><br /> on ' . date(\"d-m-Y\", strtotime($userdetail->first_lesson_date)) . ' : ' . date('h.i a', $clan->lesson_from) . ' - ' . date('h.i a', $clan->lesson_to);\n \n //for div color\n $data['type'] = 'danger';\n }\n }\n }\n } else if ($userdetail->status == 'P' || $userdetail->status == 'U') {\n \n //get already applied clan name, date, time\n $data['already_applied'] = 'You have already applied for the clan <strong>' . $clan->{$this->session_data->language . '_class_name'} . '</strong> of school <strong>' . $clan->School->{$this->session_data->language . '_school_name'} . '</strong> at academy <strong>' . $clan->School->Academy->{$this->session_data->language . '_academy_name'} . '</strong><br /> on ' . date(\"d-m-Y\", strtotime($userdetail->first_lesson_date)) . ' : ' . date('h.i a', $clan->lesson_from) . ' - ' . date('h.i a', $clan->lesson_to);\n \n //for div color\n $data['type'] = 'info';\n }\n }\n \n $user = New User();\n $data['user_details'] = $user->where('id', $this->session_data->id)->get();\n \n $clan = new Clan();\n $cities_ids = $clan->getCitiesofClans();\n \n $cities = new City();\n $cities->where_in('id', $cities_ids)->get();\n foreach ($cities as $city) {\n $temp = array();\n $temp['id'] = $city->id;\n $temp['city_name'] = ucwords($city->{$this->session_data->language . '_name'}) . ', ' . ucwords($city->state->{$this->session_data->language . '_name'}) . ', ' . ucwords($city->state->country->{$this->session_data->language . '_name'});\n $data['cities'][] = $temp;\n }\n \n if (!isset($data['clans'])) {\n $data['clans'] = null;\n }\n \n $this->load->helper('captcha');\n $this->session->unset_userdata('captcha_string');\n $random_string = random_string('alnum', 6);\n $this->session->set_userdata('captcha_string', $random_string);\n \n $captcha_argument = array('word' => $random_string, 'img_path' => './assets/captcha/', 'img_url' => base_url() . 'assets/captcha/', 'img_width' => 150, 'img_height' => 50, 'expiration' => 7200);\n \n $data['captcha_details'] = create_captcha($captcha_argument);\n \n //Set Layout view\n $this->layout->view('dashboard/pending_student', $data);\n }",
"private function get_personal_timetable_html() {\n\n global $USER;\n\n $result = '';\n\n $config = get_config('block_module_info');\n $params = array();\n\n $linkstring = get_string('default_personal_smart_link', 'block_module_info');\n\n if (strlen($USER->idnumber) == 9) {\n $params['objectclass'] = 'student+set';\n $linkstring = get_string('student_personal_smart_link', 'block_module_info');\n } elseif (strlen($USER->idnumber) == 6) {\n $params['objectclass'] = 'staff';\n $linkstring = get_string('staff_personal_smart_link', 'block_module_info');\n }\n\n $params['week'] = (empty($config->week)) ? '' : $config->week;\n $params['day'] = (empty($config->day)) ? '' : $config->day;\n $params['period'] = (empty($config->period)) ? '' : $config->period;\n $params['identifier'] = $USER->idnumber;\n $params['style'] = $config->style;\n $params['template'] = $config->template;\n\n $result = html_writer::link(new moodle_url($config->baseurl, $params), $linkstring, array('target' => '_BLANK'));\n $result = html_writer::tag('div', $result, array('class'=>'smart-link'));\n\n return $result;\n }",
"public function index(Request $request)\n {\n try {\n $user = $request->user();\n $start = $request->get('start');\n $end = $request->get('end');\n\n //Projects\n $project_ids = $this->CommonUtil->getAssignedProjectForEmployee($user->id);\n $projects = new Project();\n if (!$user->hasRole('superadmin')) {\n $projects = $projects->orWhere('projects.lead_id', $user->id)\n ->orWhereIn('projects.id', $project_ids);\n }\n\n $projects = $projects->whereBetween('end_date', [$start, $end])\n ->get()->toArray();\n\n //Projects tasks\n $project_task = new ProjectTask();\n if (!$user->hasRole('superadmin')) {\n $project_task = $project_task->whereHas('taskMembers', function ($query) use ($user) {\n $query->where('user_id', $user->id);\n });\n }\n\n $project_task = $project_task->whereBetween('due_date', [$start, $end])\n ->get()->toArray();\n\n //Projects transactions\n if ($user->hasRole('superadmin')) {\n $transaction_info = [];\n $transactions = Transaction::OfTransaction('invoice')\n ->whereBetween('due_date', [$start, $end])\n ->get()\n ->toArray();\n\n foreach ($transactions as $transaction) {\n $transaction['name'] = $transaction['title'];\n $transaction['date'] = \\Carbon::parse($transaction['due_date'])->toDateString();\n $transaction['type'] = 'invoice';\n $transaction_info[] = $transaction;\n }\n }\n\n //leaves\n $leaves = Leave::where('user_id', $user->id)\n ->where('status', 'approved')\n ->whereBetween('end_date', [$start, $end])\n ->get();\n \n $dates = [];\n $reasons = [];\n foreach ($leaves as $leave) {\n $start = \\Carbon::parse($leave->start_date)->toDateString();\n $end = \\Carbon::parse($leave->end_date)->toDateString();\n $periods = CarbonPeriod::create($start, $end);\n $reason = $leave->reason;\n foreach ($periods as $key => $date) {\n $dates [] = $date->format('Y-m-d');\n $reasons[] = $reason;\n }\n }\n\n $leave_date = [];\n if (!empty($dates)) {\n foreach ($dates as $key => $date) {\n $leave_date[$key]['date'] = $date;\n $leave_date[$key]['type'] = 'leave';\n $leave_date[$key]['name'] = $reasons[$key];\n }\n }\n \n $project_info = [];\n foreach ($projects as $project) {\n $project['date'] = \\Carbon::parse($project['end_date'])->toDateString();\n $project['type'] = 'project';\n $project_info[] = $project;\n }\n\n $tasks = [];\n foreach ($project_task as $task) {\n $task['type'] = 'task';\n $task['name'] = $task['subject'];\n $task['date'] = \\Carbon::parse($task['due_date'])->toDateString();\n $tasks[] = $task;\n }\n\n $calendar_data = array_merge($project_info, $tasks);\n\n if (!empty($transaction_info)) {\n $calendar_data = array_merge($calendar_data, $transaction_info);\n }\n\n if (!empty($leave_date)) {\n $calendar_data = array_merge($leave_date, $calendar_data);\n }\n \n $output = $calendar_data;\n } catch (Exception $e) {\n $output = $this->respondWentWrong($e);\n }\n \n return $output;\n }",
"public function index()\n {\n $tasks = Task::leftjoin('users','users.id','=','tasks.user_id')\n ->select('users.name as username','tasks.*')\n ->where('tasks.user_id',Auth::id())\n ->paginate(10);\n\n\n return view('tasks', [\n 'tasks' => $tasks\n ]);\n }",
"public function index() {\n $date = \\Carbon\\Carbon::now()->format('d-m-Y');\n $memberHelper = new MemberHelper();\n $created_by_user_type = Auth::guard('admin')->user()->userType->id;\n $arrTimes['start_time'] = config('settings.APP_SESSION_BOOKING_START_TIME');\n $arrTimes['end_time'] = config('settings.APP_SESSION_BOOKING_END_TIME');\n $timestamp = strtotime($arrTimes['end_time']) + 60 * 60;\n $arrTimes['end_time_resource_calendar'] = date('H:i', $timestamp);\n if ($created_by_user_type == 7 || $created_by_user_type == 8 || $created_by_user_type == 9 || $created_by_user_type == 11) {//7:CH, 8:SH, 9:ATH, 11:CA\n // Fetch Centers list\n $centersList = $memberHelper->getCentersList();\n } else if ($created_by_user_type == 7) {\n // Get Center Name\n } else {\n // 404 Not found\n }\n \n return view('admin::session-resources.index', compact('centersList', 'date', 'arrTimes'));\n }",
"public function exporthours($id)\n {\n // $export = new HoursExport();\n // $export->setId($id);\n //\n // Excel::download($export, 'hours {{$id}}.xlsx');\n $hours = Hour::whereProjectId($id)->get();\n (new FastExcel($hours))->export('uren'.$id.'.xlsx', function ($hour) {\n return [\n 'Project' => $hour->project->projectname . ' '.$hour->project->customer->companyname,\n 'Naam' => $hour->user->name,\n 'Van' => date('d-m-Y', strtotime($hour->workedstartdate)),\n 'Begin' => $hour->workedstarttime,\n 'Tot' => date('d-m-Y', strtotime($hour->workedenddate)),\n 'Eind' => $hour->workedendtime,\n 'Totaal' => sprintf('%02d:%02d:%02d', ($hour->worked_hours/3600),($hour->worked_hours/60%60), $hour->worked_hours%60)\n ];\n});\nreturn FastExcel($hours)->download('uren'.$id.'.xlsx');\n$projects = Project::findOrFail($id);\n$tasks = Task::whereProjectId($id)->get()->all();\n$users = User::pluck('name','id')->all();\n // $hours = Hour::whereProjectId($id)->get()->all();\n $availables = Available::whereProjectId($id)->get()->all();\n $sumtaskhours = Task::whereProjectId($id)->sum('planned_hours');\n $sumhourhours = Hour::whereProjectId($id)->sum('worked_hours');\n\nreturn view('planner.projects');\n\n\n\n\n }",
"function printTasksbyStatus2($status)\n{\n\n $myId = $_SESSION['mid'];\n //statement to get my tasks\n $sql = \"SELECT * from task , member where t_to = $myId and t_from = mid and $status \";\n if (VERBOSE)\n echo $sql;\n $result_Set = mysql_query($sql) or die(\"error :\" . mysql_error());\n\n\n\n if (mysql_num_rows($result_Set) == 0) {\n echo \"no task found !\";\n\n }\n else {\n echo \"<form method=\\\"post\\\" action=\\\"update_statuses.php\\\">\";\n echo \"<table border='1'>\";\n echo \"<tr>\";\n echo \"<th>Task Title</th>\";\n echo \"<th>Start Date</th>\";\n echo \"<th>Due Date</th>\";\n echo \"<th>Priority</th>\";\n echo \"<th>From</th>\";\n echo \"<th>status</th>\";\n echo \"</tr>\";\n //printing the tasks\n while ($row = mysql_fetch_array($result_Set)) {\n\n $status_ = $row['t_status'];\n $taskId = $row['t_id'];\n $senderName = $row['name'];\n if($status_ == 'PENDING')\n echo \"<tr class='pending_task'>\";\n elseif($status_ == 'ACTIVE')\n echo \"<tr class='active_task'>\";\n elseif($status_ == 'FINISHED')\n echo \"<tr class='finished_task'>\";\n else\n echo \"<tr class='Late_task'>\";\n\n echo \"<td><a href='TaskFull.php?t_id=$taskId&senderName=$senderName'>\" . $row['t_title'] . \"</a></td>\"; echo \"<td>\" . $row['t_start_date'] . \"</td> \";\n echo \"<td>\" . $row['t_due_date'] . \"</td> \";\n echo \"<td>\" . $row['t_priority'] . \"</td> \";\n\n\n $id = $row['mid'];\n $img_path = $row['pic_path'];\n echo \"<td><a href='searchByName.php?id=$id&name=$senderName&path=$img_path'>\" . \"$senderName\" . \"</a></td> \";\n\n\n $status_ = $row['t_status'];\n if($status_ != 'LATE') {\n echo \"<td><select name='$taskId' size=1 >\\n\";\n echo $status_ == \"PENDING\" ? \"<option selected>PENDING</option>\\n\" : \"<option >PENDING</option>\\n\";\n echo $status_ == \"ACTIVE\" ? \"<option selected>ACTIVE</option>\\n\" : \"<option >ACTIVE</option>\\n\";\n echo $status_ == \"FINISHED\" ? \"<option selected>FINISHED</option>\\n\" : \"<option >FINISHED</option>\\n\";\n echo \"</select></td>\\n\";\n echo \"</tr>\";\n }\n else //its late\n {\n echo \"<td>LATE</td>\";\n }\n }\n echo \"</table>\";\n echo \"<input class='updateStatus' type=\\\"submit\\\" name=\\\"submit\\\" value=\\\"update Statuses\\\" >\";\n echo \"</form>\";\n\n }\n}",
"public function index()\n {\n if (Auth::check()) {\n $tasks = Task::where('user_id', Auth::id())->get();\n return view('tasks.index', compact('tasks'));\n }\n }",
"public function date()\r\n {\r\n $from = $this->input->post('from');\r\n $to = $this->input->post('to');\r\n \r\n $data['results'] = $this->hours_model->get_between($from, $to);\r\n $this->load->view('logbook_view', $data);\r\n }",
"public function schedule()\n\t{\n\t\tif (! $this->is_leader) {\n\t\t\t$this->redirect('admin/error/deny');\n\t\t}\n\n\t\t$pageno = I('get.p', 1, 'intval');\n $pagesize = C('pagesize');\n $limit = $pageno . ',' . $pagesize;\n\n\t\t$uid \t = $this->uid;\n\t\t$username = $this->username;\n\t\t$time = time();\n\n\t\t$where = array();\n\t\t$where = array(\n\t\t\t'leader_uid' => array('EQ', $uid),\n\t\t\t's_time'\t => array('ELT', $time),\n\t\t\t'status' => array('NEQ', 3)\n\t\t);\n\n\t\t$projectModel = M('project');\n\t\t$projectArr = $projectModel\n\t\t\t->where($where)\n\t\t\t->order('status asc, s_time desc, id asc')\n\t\t\t->page($limit)\n\t\t\t->select();\n\n\t\t$total = $projectModel->where($where)->count();\n $Page = new \\Think\\Page($total, $pagesize);\n $Page->setConfig('prev', '«上一页');\n $Page->setConfig('next', '下一页»');\n $show = $Page->show();\n\n $startable_num = get_startable_projects_num($uid);\n $finished_num = get_markable_projects_num($uid);\n\n $this->assign('data', $projectArr);\n $this->assign('show', $show);\n $this->assign('pagenum', $Page->totalPages);\n $this->assign('index', $Page->firstRow+1);\n $this->assign('startable_num', $startable_num);\n $this->assign('finished_num', $finished_num);\n $this->assign('uid',\t $this->uid);\n $this->assign('truename', $this->truename);\n\t\t$this->display();\n\t}",
"public function action_taskexecuter() {\n $tasks = Model_Admin_Task::query()->where('done', 0)\n ->order_by('whentodo', 'asc')\n ->get();\n \n $now = time();\n foreach ($tasks as $task) {\n \n // This with all after tasks are futur tasks\n if(intval($task->whentodo) > $now)\n break;\n \n switch ($task->type) {\n case \"newsletter\":\n \n // Title and content\n $params = Format::forge($task->parameters, 'json')->to_array();\n $title = $params['title'];\n $content = $params['content'];\n $smscontent = $params['smscontent'];\n \n // Collect all users\n $users = Model_13user::find('all');\n // Send mail to email users\n foreach ($users as $user) {\n if($user->notif == \"sms\") {\n // Wait for sms implementation\n }\n else {\n $data = array(\n 'title' => $title,\n 'content' => $content,\n 'pseudo' => $user->pseudo\n );\n // Send mail\n Controller_Base::sendHtmlMail(\n 'no-reply@encrenomade.com', \n 'Season13.com', \n $user->email, \n 'Newsletter Season13.com', \n 'mail/newsletter', \n $data\n );\n }\n }\n \n $task->hasdone();\n \n break;\n }\n }\n $data['admin_tasks'] = $tasks;\n \t$this->template->title = \"Tasks just done\";\n \t$this->template->content = View::forge('admin/task/index', $data);\n }",
"public function index()\n {\n $aData = (session('grpid') === 2) ?\n DB::table('task')\n ->join('build','task.build_id','=', 'build.build_id')\n ->join('employee', 'task.emp_id', '=', 'employee.emp_id')\n ->where('task.emp_id', '=', session('empid'))->get()\n : DB::table('task')\n ->join('build','task.build_id','=', 'build.build_id')\n ->join('employee', 'task.emp_id', '=', 'employee.emp_id')->get();\n return view('tasks', ['aTaskData' => $aData]);\n }",
"function testTimeSheet()\n{\n\tcreateClient('The Business', '1993-06-20', 'LeRoy', 'Jenkins', '1234567890', 'leeroy@gmail.com', 'The streets', 'Las Vegas', 'NV');\n\n\t//Create Project to assign task\n\tcreateProject('The Business', 'Build Website', 'Build a website for the Business.');\n\tcreateProject('The Business', 'Fix CSS', 'Restyle the website');\n\n\t//Create Tasks\n\tcreateTask('The Business', 'Build Website', 'Start the Project', 'This is the first task for Build Website.');\n\tcreateTask('The Business', 'Build Website', 'Register domain name', 'Reserach webservices and make a good url');\n\tcreateTask('The Business', 'Fix CSS', 'Start the Project', 'Dont be lazy');\n\n\t//Create Developer to record time\n\tcreateEmployee('SE', 'b.zucker', 'Developer', 'bz', 'Brent', 'Zucker', '4045801384', 'brentzucker@gmail.com', 'Columbia St', 'Milledgeville', 'GA');\n\n\t//Create TimeSheet Entry\n\tcreateTimeSheet('b.zucker', 'The Business', 'Build Website', 'Start the Project', '2015-03-02 10-30-00', '2015-03-02 15-30-00');\n\t\n\t//prints out timesheet\n\techo \"<h3>TimeSheet</h3>\";\n\ttest(\"SELECT * FROM TimeSheet\");\n\n\t//deletes the timesheet\n\tdeleteTimeSheet('b.zucker', 'The Business', 'Build Website', 'Start the Project', '2015-03-02 10-30-00', '2015-03-02 15-30-00');\n\n\t//deletes the tasks\n\tdeleteTask('The Business', 'Build Website', 'Start the Project');\n\tdeleteTask('The Business', 'Build Website', 'Register domain name');\n\tdeleteTask('The Business', 'Fix CSS', 'Start the Project');\n\n\t//deletes the projects\n\tdeleteProject('The Business', 'Fix CSS');\n\tdeleteProject('The Business', 'Build Website');\n\t\n\t//deletes the client\n\tdeleteClient('The Business');\n\n\t//deletes employee\n\tdeleteEmployee('b.zucker');\n}"
] | [
"0.6494391",
"0.63122326",
"0.63024855",
"0.6212917",
"0.6110126",
"0.61040306",
"0.5947563",
"0.5911325",
"0.5877501",
"0.5825773",
"0.5813646",
"0.5771532",
"0.5759748",
"0.5733159",
"0.57264435",
"0.570289",
"0.56971455",
"0.56561184",
"0.563316",
"0.5632326",
"0.5598811",
"0.55923617",
"0.5566008",
"0.5518674",
"0.54770505",
"0.54687315",
"0.5467699",
"0.54675907",
"0.5460924",
"0.5452389",
"0.54509515",
"0.54494095",
"0.544301",
"0.5431153",
"0.54273427",
"0.54239845",
"0.54083",
"0.5398896",
"0.538762",
"0.5370017",
"0.536121",
"0.5334112",
"0.5333814",
"0.5333698",
"0.53254956",
"0.53217167",
"0.5306351",
"0.52984166",
"0.5283324",
"0.5281217",
"0.52784866",
"0.52758265",
"0.5274993",
"0.526247",
"0.5250444",
"0.5248953",
"0.5245253",
"0.5240716",
"0.5237621",
"0.52364695",
"0.5225541",
"0.52251774",
"0.5224384",
"0.5216503",
"0.5213158",
"0.5207493",
"0.5206246",
"0.51961756",
"0.5194851",
"0.5175011",
"0.51548505",
"0.5146235",
"0.5130996",
"0.5129719",
"0.51273984",
"0.51245093",
"0.5113967",
"0.51077545",
"0.5096959",
"0.5096229",
"0.50942904",
"0.5089336",
"0.50835955",
"0.50816286",
"0.5073941",
"0.5071829",
"0.50676787",
"0.50601524",
"0.5058982",
"0.50552654",
"0.5052861",
"0.5051425",
"0.5046609",
"0.5042443",
"0.5038278",
"0.5033024",
"0.50314766",
"0.50312614",
"0.503009",
"0.50262445"
] | 0.5751844 | 13 |
Creates a new Task entity. | public function addAction(Request $request)
{
$task = new Task();
$form = $this->createAddForm($task);
$form->handleRequest($request);
if ($form->isValid()) {
$em = $this->getDoctrine()->getManager();
$user = $this->get('security.context')->getToken()->getUser();
$task->setUser($user);
$em->persist($task);
$em->flush();
return new JsonResponse(array("result" => "success", "taskId" => $task->getId()));
}
$errorMessages = array();
foreach($form->getErrors(true) as $error) {
$errorMessages[] = $error->getMessage();
}
return new JsonResponse(array(
"result" => "error",
"messages" => $errorMessages)
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function CreateTask()\n {\n\n $data = $this->GetParamsFromRequestBody('create');\n\n if (!isset($data['status'])) {\n $data['status'] = \"open\";\n }\n\n $data['createdby'] = $this->loggedUser->getId();\n\n $this->insertArrayIntoDatabase('todo_task', $data);\n $id = mysql_insert_id();\n\n $this->response = array(\n \"status\" => 0,\n \"id\" => $id\n );\n $this->responseStatus = 201;\n }",
"public function create(): void {\n\t\t$rawdata = array(\n\t\t\t'datetime' => $this->request->request->get('datetime', null),\n\t\t\t'priority' => $this->request->request->getInt('priority', 1),\n\t\t\t'description' => $this->request->request->get('description'),\n\t\t);\n\n\t\t$rawdata['datetime'] ??= new DateTime();\n\n\t\tif ($rawdata['description'] !== '') {\n\t\t\tpreg_match('/^(.+?) ?(?:\\\\[(\\\\d+)\\\\]|)$/', strip_tags($rawdata['description'] ?? ''), $matches);\n\t\t\t$rawdata['description'] = $matches[1];\n\t\t}\n\n\t\t$data = array(\n\t\t\t'name' => $rawdata['description'],\n\t\t\t'donereward' => $matches[2] ?? 0,\n\t\t\t'priority' => $rawdata['priority'],\n\t\t\t'duedate' => $rawdata['datetime'],\n\t\t\t'user' => $this->user\n\t\t);\n\n\t\t$task = $this->di_repo->new(TaskModel::class, $data);\n\n\t\tif (($validResult = $task->valid()) === true) {\n\t\t\tif (!$task->save()) {\n\t\t\t\tthrow new RuntimeException('Could not save new task valid?:'.var_export($task->valid(), true));\n\t\t\t}\n\n\t\t\t$this->view->set('errors', false);\n\t\t} else {\n\t\t\t$this->view->set('errors', $validResult->getAll());\n\t\t}\n\n\t\t$this->respondTo('json');\n\t}",
"public function create(array $task)\n {\n $attributes = array_intersect_key($task, array_flip(self::$keysToPersist));\n \n list($code, $createdTask) = $this->httpClient->post(\"/tasks\", $attributes);\n return $createdTask; \n }",
"public function createTask()\n\t{\n\t\tif ( $this->taskValidate() ) {\n\t\t\tTask::create([\n\t\t\t\t\t'name' => htmlspecialchars($_POST['inputTaskName']),\n\t\t\t\t\t'email' => htmlspecialchars($_POST['inputTaskMail']),\n\t\t\t\t\t'text' => htmlspecialchars($_POST['inputTaskText'])\n\t\t\t\t]);\n\t\t}\n\t\t// to index\n\t\t\theader('Location: /');\n\t}",
"public function createNewTask($request) \n\t{\n\t\ttry {\n\t\t\t$data = [\n\t\t\t\t'user_id'\t\t=> $request->user_id,\n\t\t\t\t'title'\t\t\t=> $request->title,\n\t\t\t\t'body'\t\t\t=> $request->body,\n\t\t\t\t'type'\t\t\t=> $request->type,\n\t\t\t\t'deadline'\t\t=> $request->deadline,\n\t\t\t\t'isactive'\t\t=> $request->isactive,\n\t\t\t\t'settings'\t\t=> $request->settings\n\t\t\t];\n\t\t\t$task = Task::create($data);\n\t\t\t$this->setTask($task);\n\t\t} catch (\\Exception $e) {\n\t\t\tthrow new \\App\\Exceptions\\ModelException($e->getMessage());\n\t\t}\n\t}",
"public function create(TaskRequest $request)\n\t\t{\n\t $data = $request->only([\"task\", \"priority\"]);\n\t // create article with data and store in DB\n\t $task = Task::create($data);\n\t // return the article along with a 201 status code\n\t return response($task, 201);\n\n\t\t}",
"public function create($parent, Google_Service_CloudTasks_CreateTaskRequest $postBody, $optParams = array())\n {\n $params = array('parent' => $parent, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('create', array($params), \"Google_Service_CloudTasks_Task\");\n }",
"protected function Create() {\n // Assignment: Generate unique id for the new task\n $this->TaskId = $this->getUniqueId();\n $this->TaskName = 'New Task';\n $this->TaskDescription = 'New Description';\n }",
"public function createTask()\n {\n return factory($this->model)->create();\n }",
"public function createTask(TaskInterface $task) {\n\n return $this->request('tasks', 'POST', [], json_encode($task->getProperties()));\n }",
"public function store(TaskFormRequest $request)\n {\n $data = [\n 'task_title'=>$request->get('task_title'),\n 'project_id'=>$request->get('project_id'),\n 'content_start_id' =>$request->get('content_start'),\n 'description' =>$request->get('description') \n ];\n\n $task = $this->tasks->create($data);\n\n if($task){\n $users = null;\n }\n }",
"public function create_task(Request $request)\n {\n Task::create($request->all()); // create a task\n return response()->json([\n 'message' => 'task created successfully'\n ],201);\n }",
"public function store(TaskRequest $request)\n {\n $this->authorize('create', Task::class);\n return Task::create($request->all());\n }",
"public function addTask($task){\n $this->tasks()->create($task);\n\n \n \n }",
"public function createAction(Request $request)\n {\n $task = new Task(); \n $form = $this->createCreateForm($task);\n $form->handleRequest($request);\n \n if($form->isValid())\n {\n //esto para que nuestras tareas no sean procedas por el momento o inicialmente, por eso lo establecemos a cero. Cuando el ususario en la GUI finalice una tarea entonces dentro de la BD a ese campo se fija 1, que indica que la tarea está completada:\n $task->setStatus(0);\n $em = $this->getDoctrine()->getManager();\n $em->persist($task);\n $em->flush(); //para la persistencia de los datos\n \n //así era antes de aplicar la traducción\n //$this->addFlash('mensaje', 'The task has been created.');\n \n //y con aplicar traducción es:\n $successMessage = $this->get('translator')->trans('The task has been created.');\n $this->addFlash('mensaje', $successMessage);\n \n return $this->redirectToRoute('infunisa_task_index'); \n }\n \n return $this->render('INFUNISAUserBundle:Task:add.html.twig', array('form' => $form->createView()));\n }",
"public function store(AddTaskRequest $request)\n {\n $input = $request->validated();\n $input['created_at'] = Carbon::now();\n $input['created_by'] = auth()->user()->id;\n\n try {\n $task = Task::create($input);\n } catch (\\Throwable $th) {\n throw new ItemNotCreatedException('Task');\n }\n\n $task = Task::find($task->id);\n\n $task->project;\n $task->responsible;\n $task->task_status;\n $task->deadline;\n\n return $this->sendResponse(new TaskResource($task), 'Task created successfully.'); \n }",
"public function createTask(Request $request)\n : TaskInterface\n {\n // validate the base rules.\n $this\n ->getCreateTaskValidator()\n ->validate($request);\n\n // Create resource\n $resource = $this->createResource(\n $request->input('storage.channel'),\n $this->makePath($request->input('filename'))\n );\n\n // Create task\n $channel = $this->getChannel($resource);\n $channel->setRequest($request);\n\n return $channel->createTask();\n }",
"public function store(CreateTaskRequest $request)\n {\n $task = new Task;\n $task->name = $request->name;\n $task->save();\n\n return redirect('/task');\n }",
"public function create(Request $request)\n {\n $task = Task::create($request->all());\n\n return response()->json($task);\n }",
"public function store(TaskRequest $request)\n {\n $task = new Task();\n\n // //date($request->ui_date);\n // $date = date(\"Y-m-d H:i:s\");\n\n $task->user_id = auth()->user()->id;\n $task->title = $request->title;\n $task->notes = $request->notes;\n $task->priority = $request->priority;\n $task->due_date = $request->due_date;\n $task->ui_date = $request->ui_date;\n $task->project_id = $request->project_id;\n\n $task->save();\n\n\n\n return new TaskResource($task);\n }",
"public function create()\n {\n $cases = Casee::all();\n $users = User::all();\n $stages = Stage::all();\n\n return $this->view_('task.update',[\n 'object'=> new Task(),\n 'cases'=> $cases,\n 'users'=> $users,\n 'stages'=> $stages,\n ]);\n }",
"public function store(TaskRequest $request)\r\n {\r\n $task = Task::create([\r\n 'task' => $request['task']\r\n ]);\r\n return $this->sendResponse($task, 'Task Created Successfully');\r\n }",
"public function addTask($task){\n\n $this->tasks()->create($task);\n\n }",
"public function create(Request $request)\n {\n\n\t if(!$request instanceof RequestTask) {\n\t\t throw new \\LogicException(\"Request for task factory, should be instance of RequestTask\");\n\t }\n\n $task = new Task($request->getName(), $request->getDescription(), $request->getDate());\n\t $task->setUser($request->getUser());\n\n\t $this->repository->save($task);\n\t return $task;\n }",
"public function create(Entity $entity);",
"public function create(TaskInterface $task): void;",
"public function createEntity();",
"public function addTask($task) {\n \t$this->tasks()->create($task);\n }",
"public function createTask(\n Task $task,\n string $projectGid,\n $fields = 'name,notes,html_notes,completed,projects.gid'\n ): Task {\n try {\n $task = $this->client()->tasks->create($this->toAsanaTask($task, $projectGid), ['opt_fields' => $fields]);\n\n return $this->fromAsanaTask($task);\n } catch (NoAuthorizationError|InvalidTokenError|ForbiddenError $exception) {\n throw new UnauthorizedException($exception->getMessage());\n } catch (NotFoundError $exception) {\n throw new NotFoundException($exception->getMessage());\n }\n }",
"public function store()\n\t{\n\t\t$Task = new Task();\n\t\t$Task->user_id = Auth::user()->id;\t\n\t\t$Task->project_id = Request::get('project_id');\n\t\t$Task->category_id = Request::get('category_id');\n\t\t$Task->parent_id = Request::get('parent_id');\n\t\t$Task->title = Request::get('title');\n\t\t$Task->description = Request::get('description');\n\t\t$Task->end_at = new DateTime;\n\n\n\t\t$Task->save();\n\t\ttry {\n\t\t\tUser::find(Request::get('user_id'))->getTasks()->save($Task);\n\t\t\tProject::find(Request::get('project_id'))->getTasks()->save($Task);\n\t\t} catch (exception $e) {\n\t\t\treturn Response::json(['error' => true , 'message' => 'Couldnt create task'] , 201 );\n\t\t}\n\t\t\n\n\t\treturn Response::json(['error' => false , 'message' => 'Task Created'] , 201 );\n\t}",
"public function CreateTaskAction(Request $request)\n {\n $taskrouterclient = $this->get('commcloud_twilio_wrapper.twilio_taskrouter');\n \t$attributes = $request->request->get('customeAttributes');\n \t$attributes = json_encode($attributes);\n \ttry{\n \t $taskrouterclient->workspace->tasks->create($attributes, $this->getParameter('workflowSid'));\n \t return new Response(200);\n \t}catch(\\Exception $e){\n \t //return new Response(200);\n \t $this->get('logger')->error($e->getMessage());\n \t}\n \t\n \t\n }",
"public function create($parent_id)\n\t{\n $list = $this->service->findByOwnerAndId(\\Auth::user(), $parent_id);\n\n $task = new \\Task(Input::get());\n $task->validate();\n $task->list_id = $parent_id;\n\n if (!$task->save())\n {\n \\App::abort(500, 'Task was not saved');\n }\n\n return \\Response::json($task->toArray(), 201);\n\t}",
"public function addNewTask(string $name) : Task\n {\n // Try to init Task object from given name\n // Trigger exceptions when Task's name is empty or already existed\n try {\n $task = $this->taskFactory->createFromName($name);\n } catch (TaskNameIsEmptyException | TaskNameIsAlreadyExistedException $e) {\n throw $e;\n }\n\n // Persist Task object into repository\n try {\n $this->taskRepository->save($task);\n } catch (TaskCannotBeSavedException $e) {\n throw $e;\n }\n\n // Return Task object\n return $task;\n }",
"public function test_create_task()\n {\n \n $response = $this->post('/task', [\n 'name' => 'Task name', \n 'priority' => 'urgent', \n 'schedule_date_date' => '2020-12-12',\n 'schedule_date_time' => '12:22',\n 'project_id' => 1,\n ]);\n $response->assertStatus(302);\n }",
"public function testCreate()\n {\n $taskData = new Task();\n $taskData->setTitle('The Avengers');\n $taskData->setContent('Must defeat Thanos!');\n\n $container = self::$kernel->getContainer();\n\n $em = $container->get('doctrine.orm.entity_manager');\n $em->persist($taskData);\n $em->flush();\n\n $task = $container->get('doctrine')\n ->getRepository(Task::class)->find(1);\n\n $this->assertNotNull($task);\n $this->assertSame('The Avengers', $task->getTitle());\n $this->assertSame('Must defeat Thanos!', $task->getContent());\n }",
"public function create($entity);",
"public function create(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'type' => \"required|exists:task_types,name\",\n ]);\n if ($validator->fails())\n {\n return response()->json(['status' => 'failure', 'message' => 'Invalid value for parameter type', 'payload' => []], 400);\n }\n\n // Grab that task type, so we can use its ID in the new resource.\n $taskTypes = TaskType::where('task_types.name', '=', $request->type);\n $task = Task::create([\n 'user_id' => $request->user()->id,\n 'task_type_id' => $taskTypes->first()->task_type_id,\n 'status' => 'pending',\n 'request_details' => json_encode($request->request_details, JSON_FORCE_OBJECT),\n 'response_details' => null,\n ]);\n\n // Return the task we just made as a collection.\n return response()->json(['status' => 'success', 'message' => 'Resource Created', 'payload' => [$task]], 201);\n }",
"public function store(TaskCreateRequest $request)\n {\n DB::beginTransaction();\n try {\n Task::create($request->all());\n DB::commit();\n } catch (\\Exception $ex) {\n DB::rollBack();\n return redirect()->back()->with('error', 'Sorry ! Error occurred during the transaction.');\n }\n\n return redirect()->route('home')->with(\"success\", \"Task created successfully !\");\n }",
"public function created(Task $task)\n {\n broadcast(new Created($task))->toOthers();\n }",
"public function createTaskRequest($task_dto = null)\n {\n\n $resourcePath = '/task/create';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($task_dto)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($task_dto));\n } else {\n $httpBody = $task_dto;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function create() : bool\n {\n if( ! User::isLoggedIn()) {\n header(\"Location: /user/login\");\n }\n\n $model = new Task();\n $attributes = $this->request->body();\n $user_id = User::getLoggedInUserId();\n $attributes['user_id'] = $user_id;\n\n if($this->request->isPost() && $model->setAttributes($attributes)->validate() && $model->create() ) {\n\n header(\"Location: /task/index\");\n exit;\n }\n\n return $this->render('create', $model);\n }",
"public function store()\n\t{\n\t\t$rules = array(\n\t\t\t'title' => 'required',\n\t\t\t'description' => 'required',\n\t\t\t'status' => 'required|in:Open,In Progress,Fixed,Verified'\n\t\t);\n\n\t\t$validator = Validator::make(Input::all(), $rules);\n\t\tif ($validator->fails())\n\t\t\treturn $this->error($validator->messages(), self::BAD_REQUEST);\n\n\t\t$task = $this->task->create(\n\t\t\tarray(\n\t\t\t\t'title' => Input::get('title'),\n\t\t\t\t'description' => Input::get('description'),\n\t\t\t\t'status' => Input::get('status')\n\t\t\t)\n\t\t);\n\t\treturn $this->response($task, self::CREATED);\n\n\t}",
"public function testCreateTask()\n {\n $this->logInUserObject();\n $crawler = $this->client->request('GET', '/tasks/create');\n $form = $crawler->selectButton('Ajouter')->form();\n $form['task[title]'] = 'Titre test';\n $form['task[content]'] = 'Contenu de test pour la création d\\'une tâche';\n $this->task = $this->client->submit($form);\n\n $crawler = $this->client->followRedirect();\n $response = $this->client->getResponse();\n $statusCode = $response->getStatusCode();\n\n $this->assertEquals(200, $statusCode);\n $this->assertContains('Superbe! La tâche a été bien été ajoutée.', $crawler->filter('div.alert.alert-success')->text());\n }",
"public function addTask($task)\n {\n $this->tasks()->create($task);\n }",
"protected function createAdminsEntity()\n {\n $adminUser = $this->em->getRepository('APICoreBundle:User')->findOneBy([\n 'username' => 'admin'\n ]);\n\n $webSolCompany = $this->em->getRepository('APICoreBundle:Company')->findOneBy([\n 'title' => 'Web-Solutions'\n ]);\n\n $adminProject = $this->em->getRepository('APITaskBundle:Project')->findOneBy([\n 'title' => 'Project of admin'\n ]);\n\n $task = new Task();\n $task->setTitle('Task TEST - admin is creator, admin is requested 3');\n $task->setDescription('Description of Task TEST');\n $task->setImportant(false);\n $task->setCreatedBy($adminUser);\n $task->setRequestedBy($adminUser);\n $task->setCompany($webSolCompany);\n $task->setProject($adminProject);\n\n $this->em->persist($task);\n $this->em->flush();\n\n return $task;\n }",
"public function create()\n {\n $invoice = new InvoiceEntity();\n $invoice->setNumber('019101910191091')\n ->setValue(100.90)\n ->setUrl('http://domain.com')\n ->setIssuanceDate('2017-09-15')\n ->setKey('POL9898AS');\n\n $tracking = new TrackingEntity();\n $tracking->setOrderId('00001010101AA')\n ->setStatus('in_route')\n ->setCode('BR800OPR5')\n ->setInvoice($invoice);\n\n $this->dm->persist($tracking);\n $this->dm->flush();\n }",
"public function save(Task $task) {\n $id = $this->DBPersist($this->table, $task);\n if ($id) {\n $task->setId($id);\n return $task;\n } else {\n throw new \\Exception(\"Impossível inserir a task\", 1);\n\n }\n }",
"public function testNewTask()\n {\n $userId = User::first()->value('id');\n\n $response = $this->json('POST', '/api/v1.0.0/users/'.$userId.'/tasks', [\n 'description' => 'A new task from PHPUnit',\n ]);\n\n $response\n ->assertStatus(200)\n ->assertJson([\n 'description' => 'A new task from PHPUnit',\n ]);\n }",
"public function store(TaskRequest $request)\n {\n if($this->task->create()) {\n return $this->respondWithMessage('Task created', 201);\n }\n\n return $this->respondError('Failed to create', 500);\n }",
"public function create(Request $request) {\n // post da so se di vs form\n $task = new Task(); // tao ra mot instance cua Task ( mot mau cua Task )\n $task->name = $request->name; // lay du lieu name cua nguoi dung nhap len de chuan bi luu vao database\n // name dau la cua truong database name sau la cua nguoi dung nhap len dinh nghia trong form\n $task->description = $request->description;\n $task->user_id = Auth::user()->id;\n $request->validate([\n 'description'=>'required|min:6',\n 'name'=>'required|min:5',\n 'tags'=>'required'\n\n ]);\n\n $task->save();\n\n $task->tags()->sync($request->get('tags'));\n return redirect('/task');\n }",
"public function testCreateTask()\n {\n }",
"public function createTask($description){\n $this->tasks()->create(['description'=>$description]);\n }",
"public function createAction(Request $request)\n {\n $entity = new UserToTask();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('usertotask_show', array('id' => $entity->getId())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }",
"function create($entity);",
"public function store()\n\t{\n $task = new Task();\n $task->description = Request::get('description');\n $task->owner = Auth::user()->id;\n $task->performer = intval(Request::get('performer')) ? intval(Request::get('performer')): null;\n $task->state = Request::get('state');\n $task->save();\n\n return Response::json(array(\n 'errors' => false,\n 'data' => $task),\n 200\n );\n }",
"public function create(Request $request)\n {\n $task = new Task;\n $task->title = $request->title;\n $task->description = $request->description;\n $task->fkTodo = $request->fkTodo;\n $task->save();\n\n return redirect()->route('todo', ['id' => $request->fkTodo]);\n \n }",
"public function actionCreate()\r\n {\r\n $model = new Task();\r\n if(isset($_GET['project_id'])){\r\n $model->project_id=$_GET['project_id'];\r\n }\r\n $model->setScenario('create');\r\n if ($model->load(Yii::$app->request->post()) ) {\r\n $model->task_guid=CommonUtil::createUuid();\r\n $model->total_price=$model->price*$model->number;\r\n $model->user_guid=yii::$app->user->identity->user_guid;\r\n $model->end_time=strtotime($model->end_time);\r\n $photo=ImageUploader::uploadByName('photo');\r\n if($photo){\r\n $model->path=$photo['path'];\r\n $model->photo=$photo['photo'];\r\n }\r\n if(empty($model->group_id)){\r\n $model->group_id=0;\r\n }\r\n $model->desc=@$_POST['desc'];\r\n $model->created_at=time();\r\n $address=$model->address;\r\n //地址转经纬度\r\n $geoCoding=new GeoCoding(yii::$app->params['baiduMapAK']);\r\n $result=$geoCoding->getLngLatFromAddress(urldecode($address));\r\n if($result['status']==0){\r\n $model->lng=$result['result']['location']['lng'];\r\n $model->lat=$result['result']['location']['lat'];\r\n $model->lnglat=CommonUtil::getGeomLnglat($model->lng, $model->lat);\r\n }\r\n if($model->save()){\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n }else{\r\n yii::$app->getSession()->setFlash('error','任务创建失败!');\r\n }\r\n \r\n \r\n } else {\r\n $group=Group::find()->andWhere(['create_by'=>yii::$app->user->identity->user_guid])->all();\r\n return $this->render('create', [\r\n 'model' => $model,\r\n 'group'=>$group\r\n ]);\r\n }\r\n }",
"public function createFromName(string $name) : Task\n {\n // First we create a blank Task object\n $task = new Task();\n\n // Then we need to make sure the Task's name is not empty and not used\n // by another Task\n try {\n $this->taskValidationService->validateName($name);\n } catch (TaskNameIsEmptyException | TaskNameIsAlreadyExistedException $e) {\n throw $e;\n }\n\n // When we are sure the name is ok, just set the name\n $task->setName($name);\n\n // Return Task object\n return $task;\n }",
"public function test_create_task_all_fields_correct()\n {\n\n $credential = [\n 'body' => 'testing task'\n ];\n\n $token = User::factory()->create()->createToken('my-app-token')->plainTextToken;\n\n $response = $this->json('POST', '/api/tasks', $credential, ['Accept' => 'application/json', 'Authorization' => 'Bearer '.$token]);\n\n $response\n ->assertStatus(201)\n ->assertJsonStructure(['message'])\n ->assertJsonPath('message', \"Task created successfully.\");\n }",
"public function create(Task $task)\n {\n return view('task.create', ['task' => $task]);\n }",
"public function actionCreateTask() {\n // Check settings, show errors if there are any\n try {\n craft()->goLive_settings->verifySettings();\n }\n catch (Exception $e) {\n header('HTTP/1.1 ' . 500);\n\n $errorMessage = $e->getMessage();\n $this->returnErrorJson($errorMessage);\n }\n catch (HttpException $e) {\n header('HTTP/1.1 ' . $e->statusCode);\n\n $errorMessage = $e->getMessage();\n $this->returnErrorJson($errorMessage);\n }\n\n // Settings look good, create and run the task.\n // Also, set a random-ish backup file name to be referenced within the task steps\n $deployTask = craft()->tasks->createTask(\n 'GoLive_Deploy',\n 'GoLive_Deploy',\n array(\n 'backupFileName' => uniqid('goLive_') . '.sql'\n )\n );\n\n // Tries to end the HTTP session, and definitely starts running the pending tasks.\n // Our task may or may not be first in that queue.\n craft()->tasks->closeAndRun();\n }",
"function insert_task (Request $request) {\n $validator = Validator::make($request->all(), [\n 'name' => 'required|max:255',\n ]);\n\n if ($validator->fails()) {\n return redirect('/')\n ->withInput()\n ->withErrors($validator);\n }\n\n $task = new Task;\n $task->name = $request->name;\n $task->save();\n\n return redirect('/tasks');\n }",
"public function store(SaveTaskRequest $request)\n {\n $task = new Task();\n $task->user_id = Auth::user()->id;\n $task->description = $request->description;\n $task->save();\n\n return response('Task Added Successfully', 201);\n }",
"public function store(TaskCreateRequest $request)\n {\n\n DB::beginTransaction();\n\n try{\n\n $task = $this->repository->create(\n $request->all() + [\n 'owner_user_id' => Auth::user()->id\n ]\n );\n\n $files = $request->input('files');\n $syncData = [];\n\n if( !empty($files) )\n {\n $pivotData = array_fill(0, count($files), ['table_name' => $task->getTable()]);\n $syncData = array_combine($files, $pivotData);\n }\n\n $task->files()->sync($syncData);\n\n $task->load('client','propoal.status','status','task_type','files','owner');\n\n $message = 'Registro Exitoso!';\n DB::commit();\n }catch(\\Exception $e){\n $task = [];\n DB::rollback();\n $message = $e->getMessage();\n $this->responseCode = 500;\n }\n\n return response()->json([\n 'message' => $message,\n 'data' => $task,\n ],$this->responseCode);\n }",
"public function createTasks()\n {\n if (count($this->tasks) == 0)\n throw new \\Drupal\\ClassLearning\\Exception('No tasks defined for TaskFactory');\n\n foreach($this->tasks as $name => $task) :\n if (isset($task['count']))\n $count = $task['count'];\n else\n $count = 1;\n\n // Some need multiple tasks. Ex: grading a soln\n // This can be expanded to as many as needed\n for ($i = 0; $i < $count; $i++) :\n $t = new WorkflowTask;\n $t->workflow_id = $this->workflow->workflow_id;\n\n // We're not assigning users at this stage\n $n = null;\n if(isset($task['behavior']))\n \t$n = $task['behavior'];\n\t\telse\n\t\t\t$n = $name;\n\t\t\n\t\t$t->type = $n;\n $t->status = 'not triggered';\n $t->start = NULL;\n\n $t->settings = $this->tasks[$n];\n $t->data = [];\n\t\t\n\t\tif(isset($task['criteria'])){\n\t\t\t$t->setData('grades',$task['criteria']);\n\t\t}\n\t\t\n $t->save();\n endfor;\n endforeach;\n\t\n }",
"public function store(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'name' => 'required|max:255',\n ]);\n\n if ($validator->fails()) {\n return redirect($this->redirect_to)\n ->withInput()\n ->withErrors($validator);\n }\n\n $data = $request->all();\n $data['user_id'] = Auth::id();\n $task = Task::create($data);\n return redirect($this->redirect_to);\n }",
"public function store(Task $task): Task\n {\n $this->hydrator->assignId(1, $task);\n\n return $task;\n }",
"public function store(Request $request)\n {\n $validator = Validator::make(\n $request->all(),\n [\n 'title' => 'required|string|min:2|max:100',\n 'description' => 'required|string|min:5',\n ],\n [\n 'min' => ':attribute deve ter no mínimo :min caracteres.',\n 'max' => ':attribute não deve ter mais que :max caracteres.',\n 'required' => 'O campo :attribute é obrigatório.',\n 'string' => ':attribute deve ser uma string',\n ]\n );\n\n if ($validator->fails()) {\n return response()->json($validator->messages(), 400);\n }\n\n $task = TaskModel::create([\n 'title' => $request->title,\n 'description' => $request->description,\n 'order' => (DB::table('todo')\n ->orderBy('order', 'desc')\n ->first()->order + 1)\n ]);\n\n return response()->json($task, 201);\n }",
"public function create()\n {\n return view('task.add-task');\n }",
"public function show_create_form_task()\n {\n $user = factory(User::class)->create();\n $user->assignRole('task-manager');\n $this->actingAs($user);\n View::share('user', $user);\n\n factory(User::class, 5)->create();\n\n $response = $this->get('/tasks_php/create');\n $response->assertSuccessful();\n $response->assertViewIs('tasks.create_task');\n\n $users = User::all();\n $response->assertViewHas('users', $users);\n\n $response->assertSeeText('Create Task:');\n }",
"public function createEntity($entityName = null);",
"public function testTask()\n {\n $task = new Task();\n $user = new User();\n\n $this->assertNull($task->getId());\n $task->setTitle('test');\n $this->assertSame('test', $task->getTitle());\n $task->setContent('testcontent');\n $this->assertSame('testcontent', $task->getContent());\n $task->toggle(true);\n $this->assertTrue( $task->isDone());\n $task->setUser($user);\n $this->assertInstanceOf(User::class, $task->getUser());\n $task->setCreatedAt(new \\DateTime());\n $this->assertNotEmpty($task->getCreatedAt());\n }",
"public function store(Request $request)\n {\n $task = new Task();\n \n $task->name = $request->nom;\n $task->ref = bin2hex(random_bytes(12));\n $task->user_id = Auth::user()->id;\n $task->description = $request->desc;\n $task->priority = $request->priority;\n $task->category_id = $request->category;\n\n if(!empty($task->attachment)){\n $nameFile = Storage::disk(\"public\")->put(\"attachment\", $request->attachment);\n $task->attachment = $nameFile;\n }\n\n $task->begin_date = $request->begin_date . \":00\"; // A vérifier avant\n $task->end_date = $request->end_date . \"00\"; // A vérifier avant\n \n $task->save();\n $createdId = $task->id;\n \n $arrayTags = json_decode($request->tags);\n foreach($arrayTags as $tag){\n if($tag[0] === \"none\"){\n // On créé le tag\n $newTag = new Tag();\n $newTag->name = $tag[1];\n $faker = Factory::create('fr_FR');\n $newTag->color_bg = $faker->hexColor();\n $newTag->color_text = Color::fromHex($newTag->color_bg)->invert(true);\n $newTag->save();\n $tagId = $newTag->id;\n }else{\n $tagId = $tag[0];\n }\n // puis on créé la relation\n $tagTask = new TagTask();\n $tagTask->tag_id = $tagId;\n $tagTask->task_id = $createdId;\n\n \n \n $tagTask->save();\n }\n \n return redirect()->route('tasks');\n\n }",
"public function store(Request $request)\n {\n $validator = Validator::make($request->all(),\n [\n 'task_title' => ['required', 'max:64'],\n 'task_comment' => ['required', 'max:512'],\n 'start_date' => ['required'],\n 'finish_date' => ['required'],\n ],\n [\n 'task_title.max' => 'Title text too long. Try with less than 64 characters',\n 'task_comment.max' => 'Comment text too long. Try with less than 512 characters',\n ]\n );\n\n if ($validator->fails()) {\n $request->flash();\n return redirect()->back()->withErrors($validator);\n }\n\n $task = new Task();\n $task->title = $request->task_title;\n $task->comment = $request->task_comment;\n $task->start_time = $request->start_date;\n $task->finish_time = $request->finish_date;\n $task->user_id = $request->user()->id;\n $task->save();\n return redirect()->route('task.index')->with('success', 'Task added successfully.');\n }",
"public function store(Request $request)\n {\n $task = Task::create([\n 'name' => $request['name'],\n 'description' => $request['description'],\n 'status' => 'active',\n 'user_id' => Auth::user()->id,\n ]);\n\n return redirect('tasks');\n }",
"public function store(TaskRequest $request)\n {\n /** @var User $user */\n $user = $request->user();\n\n $user->tasks()->create($request->validated());\n\n return Redirect::route('tasks.index')->with('success', 'Task Created.');\n }",
"public function store(Request $request)\n { \n $user = $request->user();\n $task = new Task();\n\n $task->content = $request->content;\n $task->user_id = $user->id;\n $task->completed = false;\n $task->date = new Carbon();\n\n $task->save();\n\n return $task;\n }",
"public function actionCreate()\n\t{\n\n\t\t$model=new Templetstandardtask;\n\t\tif(isset($_POST['Templetstandardtask']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Templetstandardtask'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->fTaskNo));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionCreate() {\n $model = new Task;\n\n $reqModel = Yii::app()->getRequest()->getPost('Task');\n\n $user = new UserTask();\n $user->user_id = Yii::app()->user->id;\n $reqUser = Yii::app()->getRequest()->getPost('UserTask', array('user_id' => Yii::app()->user->id));\n\n// Uncomment the following line if AJAX validation is needed\n// $this->performAjaxValidation($model);\n\n if ($reqModel !== null) {\n $model->attributes = $reqModel;\n $user->attributes = $reqUser;\n if ($model->validate()) {\n if (is_array($reqUser['user_id'])) {\n if ($reqUser !== null) {\n $userIds = $reqUser['user_id'];\n $assoc = Yii::app()->getRequest()->getPost('Assoc', array('multiple' => '0'));\n if ($assoc['multiple'] === '1') {\n foreach ($userIds as $userId) {\n $task = new Task;\n $task->attributes = $reqModel;\n if ($task->save()) {\n UserTask::associate($task->id, $userId);\n Yii::app()->user->setFlash('success', Yii::t('app', 'Task.associate.success'));\n $this->_sendAssociationNotification(array($userId), $task->id);\n $this->_sendEmailAssociationNotification(array($userId), $task->id);\n }\n }\n } else {\n if ($model->save()) {\n foreach ($userIds as $userId) {\n UserTask::associate($model->id, $userId);\n }\n Yii::app()->user->setFlash('success', Yii::t('app', 'Task.create.success'));\n $this->_sendAssociationNotification($userIds, $model->id);\n $this->_sendEmailAssociationNotification($userIds, $model->id);\n }\n }\n }\n $this->redirect(array('view', 'id' => $model->id));\n } else {\n //this is bad but we need to check this part\n $user->addError('user_id', Yii::t('app', 'Task.associate.failure.user'));\n }\n }\n } else {\n $model->start_date = date('Y-m-d');\n $model->status = TaskStatus::model()->default()->find()->id;\n $model->type = TaskType::model()->default()->find()->id;\n }\n\n $this->render('create', array(\n 'model' => $model,\n 'user' => $user,\n 'projectId' => Yii::app()->getRequest()->getQuery('project_id')\n ));\n }",
"public function store(Request $request)\n {\n \n // Validation\n $this->validate($request, [\n 'title' => 'required|max:255',\n 'description' => 'required',\n 'priority' => 'required|max:5',\n ]);\n\n // Create the Task\n $request->user()->tasks()->create([\n 'title' => $request->title,\n 'description' => $request->description,\n 'priority' => $request->priority\n ]);\n\n notify()->flash(\"$request->title, successfully created\", 'success', [\n 'timer' => 4000,\n ]);\n\n return redirect('/tasks');\n\n }",
"public function store()\n\t{\n\t\t$validator = Validator::make(Input::all(), Task::$rules);\n\t\tif ($validator->passes()) {\n\t\t\t$task = new Task;\n\t\t\t$task->name = Input::get('name');\n\t\t\t$task->description = Input::get('description');\n\t\t\t$task->user_id = Auth::user()->id;\n\t\t\t$task->save();\n\n\t\t\tif ($task) {\n\t\t \treturn Redirect::to('tasks')->with('message', 'Task added.');\n\t\t }\n\t\t // fallback\t\n\t\t return Redirect::to('tasks')->with('message', 'Task added.');\n\t\t} else {\n\t\t // validation has failed, display error messages\n\t\t return Redirect::to('tasks')\n\t\t \t->with('message', 'The following errors occurred')\n\t\t \t->withErrors($validator)\n\t\t \t->withInput();\n\t\t}\n\t}",
"public function addTask(&$task)\r\n\t{\r\n\t\t$sql = sprintf('\r\n\t\t\tINSERT\r\n\t\t\tINTO\r\n\t\t\t\ttask (title)\r\n\t\t\tVALUES\r\n\t\t\t\t(\"%s\")\r\n\t\t', mysql_escape_string($task->title));\r\n\r\n\t\tmysqli_query($this->db, $sql);\r\n\t\t\r\n\t\t$task->id = mysqli_insert_id($this->db);\r\n\t}",
"public function actionCreate()\n {\n $model = new CompleteTask();\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 $project_id = request()->get('project_id');\n $project_members = ProjectMember::projectMembersDropdown($project_id);\n $priorities = ProjectTask::prioritiesDropdown();\n $statuses = ProjectTask::taskStatuses();\n\n return view('project::task.create')\n ->with(compact('project_members', 'priorities', 'project_id', 'statuses'));\n }",
"public function create($projectId = null)\n {\n $task = new Task();\n $task->project_id = $projectId;\n $task->priority_id = 2;\n\n $data['task'] = $task;\n $data['tags'] = Tag::orderBy('text')->get();\n\n return view('tasks.store', $data);\n }",
"public function store(Request $request)\n {\n\t\t\t\t//\tValidate the incoming data\n $this->validate($request, ['title'=>'required|string']);\n\n\t\t\t\t//\tCreate the task\n\t\t\t\t$task = Task::create(['user_id'=>auth()->user()->id, 'title'=>$request->title, 'completed'=>false]);\n\n\t\t\t\t//\tSend notification to all users\n\t\t\t\tNotification::send(User::all(), new \\App\\Notifications\\TaskCreated($task));\n\n\t\t\t\t//\tBroadcast the new task to other users\n\t\t\t\tevent(new TaskCreated($task));\n\n\t\t\t\t//\tReturn the task to the client\n\t\t\t\treturn $task;\n }",
"public function store(Request $request)\n {\n\n // validate the Data\n $this->validate($request, [\n 'tasks' => 'required|string',\n ]);\n\n // Create a new task\n $task = new Task;\n\n // Assign the task data from our request\n $task->tasks = $request->tasks;\n// $task->user_id = '1';\n $task->user_id = auth()->id();\n// $task->date = $request->date;\n\n // Save the task\n $task->save();\n // Flash session message\n Session::flash('success', 'Create Task Successfully');\n // Return A Redirect\n return redirect()->route('tasks.index');\n\n }",
"public function addTask(Request $request)\n {\n $this->checkIfLoggedIn();\n\n $user = $request->session()->get('user');\n\n /** @phpstan-ignore-next-line */\n Task::create([\n 'title' => $request->input(\"title\"),\n 'body' => $request->input(\"body\"),\n 'user_id' => $user->id\n ]);\n\n return redirect('/tasks');\n }",
"public function create()\n {\n return view(('tasks.create'));\n }",
"public function store(Request $request)\n {\n try\n\t\t{\n $data = $request->all();\n $today = date('Y-m-d');\n if(!array_key_exists('description', $data) || is_null($data['description']) || empty($data['description']))\n {\n $data['description'] = ' ';\n }\n if(!array_key_exists('finished', $data) || is_null($data['finished']) || empty($data['finished']))\n {\n $data['finished'] = $today;\n }\n if(!array_key_exists('remember', $data) || is_null($data['remember']) || empty($data['remember']))\n {\n $data['remember'] = $today;\n }\n\n\n\n\t\t\t$task = Task::create($data);\n return response()->json(['data' => $task,\n 'message' => 'Tarefa criada com sucesso.'], 201);\n\t\t}\n\t\tcatch (\\Exception $e)\n\t\t{\n if(config('app.debug'))\n {\n \t\t\treturn response()->json($e->getMessage(), 400);\n \t\t}\n\t\t\treturn response()->json('Houve um erro ao criar a tarefa.', 400);\n\t\t}\n }",
"public function store(Request $request)\n {\n //validate the requests\n $request->validate([\n 'name' => 'required',\n 'todo_list_id' => 'required',\n ]);\n //create the new user\n $todotask = TodoTask::create($request->all());\n return new TaskResource($todotask);\n }",
"public function getEntity()\n {\n self::bootKernel();\n\n $user = (new User())\n ->setEmail('test@test.fr')\n ->setUsername('test');\n $user->setPassword(self::$container->get('Symfony\\Component\\Security\\Core\\Encoder\\UserPasswordEncoderInterface')->encodePassword($user, 'demo'));\n\n return (new Task())\n ->setContent('Some content')\n ->setTitle('Some title')\n ->setUser($user);\n }",
"public function store(Request $request)\n {\n $task = new Task([\n 'name' => $request->get('name'),\n 'desc'=> $request->get('desc')\n ]);\n $task->save();\n \n return redirect('/tasks')->with('success', 'Task has been added');\n }",
"public function store(Request $request, Task $task)\n {\n try {\n $task->description = $request->description;\n $task->save();\n return response()->json(\"Task created\");\n }\n catch (\\Exception $error) {\n return response()->json([\"Description required\"]);\n }\n }",
"public function newTask(){\n if (!$this->validate()) {\n return null;\n }\n \n if( $activity = $this->saveTask() ){\n if($this->type == 'technique'){\n if(!$this->saveDevs()){ \n return null;\n }\n } \n return $activity; \n }\n return null; \n }",
"public function create()\n {\n return view('tasks.create');\n }",
"public function create(Request $request)\n {\n API::validate($request, [\n 'name' => 'required'\n ]);\n\n try {\n $this->tasklist->create([\n 'name' => $request->get('name'),\n 'slug' => strtolower($request->get('name')),\n 'user_id' => 1\n ]);\n\n return API::throwActionSuccessResponse($this->tasklist->name . ' is created');\n } catch (BadMethodCallException $e) {\n return API::throwActionFailedException($e);\n }\n }",
"public function store(Request $request)\n {\n if ($task = Task::create([\n 'list_id' => $request->list_id,\n 'task_name' => $request->task_name,\n 'task_description' => $request->task_description,\n ])) {\n return response()->json($task)->setStatusCode(201, 'Successful Created');\n } else return response()->json()->setStatusCode(400, 'Bad end');\n }",
"public function saveTask(){\n \n if( !empty($this->taskId) ){\n $task = Tache::findOne(['id_tache'=>$this->taskId]);\n }else{\n $task = new Tache();\n }\n $task->nom = $this->title;\n $task->description = $this->description;\n $task->date_debut = (!empty($this->dateStart)) \n ? Yii::$app->formatter->asDate($this->dateStart, 'yyyy-MM-dd') \n : Yii::$app->formatter->asDate($this->dateStart2, 'yyyy-MM-dd');\n $task->date_fin = (!empty($this->dateEnd)) \n ? Yii::$app->formatter->asDate($this->dateEnd, 'yyyy-MM-dd')\n : Yii::$app->formatter->asDate($this->dateEnd2, 'yyyy-MM-dd');\n $task->prestataire = $this->provider;\n $task->type = $this->type;\n if( !empty($this->activityId) ){\n $task->id_activite = $this->activityId;\n }\n $today = strtotime(Yii::$app->formatter->asDate('now', 'yyyy-MM-dd'));\n $start = strtotime(Yii::$app->formatter->asDate( $task->date_debut , 'yyyy-MM-dd'));\n if($today < $start ){\n $task->statut = 'en_attente';\n }else{\n $task->statut = 'en_cours';\n }\n if($task->save()){\n return true;\n }else{\n return false;\n } \n }",
"public function create()\n {\n // Get all projects\n $projects = Project::all();\n $data['projects'] = $projects;\n\n // Get all projects\n $teams = Team::all();\n $data['teams'] = $teams;\n\n // Return the task view.\n return view('task.create')->with('data', $data);\n }",
"public function create()\n {\n $this->getUser()->hasPermission(['insert'], 'auto_tasks');\n\n return view('autotasks.create');\n }"
] | [
"0.75978106",
"0.75709164",
"0.75538176",
"0.74150175",
"0.7412516",
"0.7333008",
"0.712303",
"0.7098575",
"0.7081263",
"0.6888306",
"0.68479073",
"0.6792882",
"0.6760081",
"0.6752991",
"0.67280126",
"0.66949135",
"0.6659794",
"0.665906",
"0.66475123",
"0.66461754",
"0.66461384",
"0.6633659",
"0.6607548",
"0.6604133",
"0.66033864",
"0.6596181",
"0.65958995",
"0.6560621",
"0.65453774",
"0.65339667",
"0.6481383",
"0.64770234",
"0.64690185",
"0.6449335",
"0.6430885",
"0.64293367",
"0.6398829",
"0.63914704",
"0.63592756",
"0.63428426",
"0.6330556",
"0.63270265",
"0.63134646",
"0.6293493",
"0.6282641",
"0.62748754",
"0.62661886",
"0.6262232",
"0.6256866",
"0.62428164",
"0.6216655",
"0.6208688",
"0.61955476",
"0.61843425",
"0.61828935",
"0.61671764",
"0.61608547",
"0.61524177",
"0.6147011",
"0.6130231",
"0.61282396",
"0.61017054",
"0.60995007",
"0.60935134",
"0.60644215",
"0.60499537",
"0.6048217",
"0.60461587",
"0.6041792",
"0.6040638",
"0.60356414",
"0.60200024",
"0.60152966",
"0.60039425",
"0.5992685",
"0.5991755",
"0.59877604",
"0.598215",
"0.5979799",
"0.5977629",
"0.5972612",
"0.5966964",
"0.5965463",
"0.5964021",
"0.59615546",
"0.5960429",
"0.59595275",
"0.5954019",
"0.5950651",
"0.59482235",
"0.59458774",
"0.59355307",
"0.5928188",
"0.5924752",
"0.59198207",
"0.59098625",
"0.5902548",
"0.5900396",
"0.5899064",
"0.5897366",
"0.58960134"
] | 0.0 | -1 |
Edits an existing Task entity. | public function editAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
$user = $this->get('security.context')->getToken()->getUser();
$task = $em->getRepository('STMSBundle:Task')->find($id);
if (!$task) {
return new JsonResponse(array(
"result" => "error",
"message" => "No task found for the given ID."));
}
if($user != $task->getUser()) {
return new JsonResponse(array(
"result" => "error",
"message" => "You are not authorized to perform this action."));
}
$form = $this->createEditForm($task);
$form->handleRequest($request);
if ($form->isValid()) {
$em->flush();
return new JsonResponse(array("result" => "success"));
}
$errorMessages = array();
foreach($form->getErrors(true) as $error) {
$errorMessages[] = $error->getMessage();
}
return new JsonResponse(array(
"result" => "error",
"messages" => $errorMessages)
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n\n }",
"public function edit(Task $task)\r\n {\r\n //\r\n }",
"public function edit(Task $task)\n {\n //var_dump($task);\n }",
"public\n function edit(\n Task $task\n ) {\n //\n }",
"public function editTask()\n\t{\n\t\t$jwt = Auth::isValidToken($_COOKIE['SSID']);\n \n if (!$jwt) {\n View::jsonResponse(['status' => 401, 'message' => 'Access denied for you!']);\n }\n\n $update = [ 'task' => $_POST['etask'], 'id' => $_POST['taskid']];\n $update = Validator::cleanData($update);\n\n if (Validator::isEmpty($update)) {\n View::jsonResponse(['status' => 401, 'message' => 'There are empty fields!']);\n }\n\n (new Task())->update($update)->execute();\n\n View::jsonResponse(['status' => 200, 'message' => 'Task edited successful!']); \n \n\t}",
"protected function editTaskAction() {}",
"public function putTaskAction(Task $task, Request $request)\n {\n // If not found will returns 404 exception automatically\n\n // All VALIDATION-RULES are defined in App\\Entity\\Task Entity Class!!!\n // As annotations\n // created_at and updated are automatically generating\n\n // Getting request form data (method PUT)\n $data = json_decode($request->getContent(), true);\n\n // If empty request\n if (empty($data))\n {\n return $this->handleView($this->view(\n [\n \"status_code\"=> Response::HTTP_BAD_REQUEST,\n 'reason_phrase' => 'At least one property must be updated',\n ],\n Response::HTTP_BAD_REQUEST)\n );\n }\n\n $entityManager = $this->getDoctrine()->getManager();\n\n // If property = null\n // Or is emtpy\n // Then replace with old property\n\n\n $task->setTitle($data['title'] ?? $task->getTitle());\n $task->setDescription($data['description'] ?? $task->getDescription());\n $task->setDone($data['done'] ?? $task->getDone());\n\n $errors = $this->validator->validate($task);\n\n\n if (count($errors) > 0) {\n return $this->handleView($this->view($errors, Response::HTTP_BAD_REQUEST));\n }\n\n // Update\n $entityManager->flush();\n\n // Return success\n return $this->handleView($this->view(\n [\n \"status_code\"=> Response::HTTP_ACCEPTED,\n 'reason_phrase' => 'Successfully updated',\n ],\n Response::HTTP_ACCEPTED)\n );\n\n }",
"public function testUpdateTask()\n {\n $this->addTestFixtures();\n $this->logInAsUser();\n $id = $this->task->getId();\n\n $crawler = $this->client->request('GET', '/tasks/'.$id.'/edit');\n\n $form = $crawler->selectButton('Modifier')->form();\n $form['task[title]'] = 'Titre';\n $form['task[content]'] = 'Contenu de test pour la création d\\'une tâche';\n $this->client->submit($form);\n\n $crawler = $this->client->followRedirect();\n $response = $this->client->getResponse();\n $statusCode = $response->getStatusCode();\n\n $this->assertEquals(200, $statusCode);\n $this->assertContains('Superbe! La tâche a bien été modifiée.', $crawler->filter('div.alert.alert-success')->text());\n }",
"public function update(Request $request, Task $task)\n {\n //\n }",
"public function update(Request $request, Task $task)\n {\n //\n }",
"public function update(Request $request, Task $task)\n {\n $request->validate([\n 'Description'=>'required|max:255|min:5',\n 'Due_Date'=>'required|after_or_equal:today',\n 'ServicePersonID'=>'required'\n ]);\n \n $data = task::find($request->input('TaskID'));\n $data->TaskID = $request->input('TaskID');\n $data->ServicePersonID = $request->input('ServicePersonID');\n $data->Due_Date = $request->input('Due_Date');\n $data->Status = $request->input('Status');\n $data->Description = $request->input('Description');\n \n $data->save();\n\n return redirect('View-Task')->with('success','Task Updated Successfully');\n }",
"public function edit(Task $task)\n {\n //Admin allow only \n abort_if(Gate::denies('user_access'), Response::HTTP_FORBIDDEN, '403 Forbidden');\n\n //Declaration of vars in order to use the same form template\n $update = true;\n $title = \"Actualizar Tarea\";\n $txtButton = \"Actualizar\";\n $route = route('tasks.update',['task' => $task]);\n $users = User::all();\n return view('tasks.edit', compact('task','title','txtButton','route','users','update'));\n }",
"public function update(Request $request, Task $task)\n {\n //Validate\n $request->validate([\n 'title' => 'required|min:3',\n 'description' => 'required',\n ]);\n $task = Task::find($request->id);\n $task->title = $request->title;\n $task->description = $request->description;\n $task->category_id = $request->category_id;\n $task->is_compleated = $request->is_compleated;\n\n $task->save();\n Session::flash('alert-success', 'Se ha Actualizado la tarea con éxito!');\n return redirect()->route('task_index_path');\n }",
"public function edit(Task $task)\n {\n\n if (auth()->user()->isApprover(auth()->user()->id)) {\n $chunck = array(\n 'task' => $task,\n 'task_site' => \\Tritiyo\\Task\\Models\\TaskSite::where('task_id', $task->id)->get()->toArray(),\n 'task_vehicle' => \\Tritiyo\\Task\\Models\\TaskVehicle::where('task_id', $task->id)->get()->toArray(),\n 'task_material' => \\Tritiyo\\Task\\Models\\TaskMaterial::where('task_id', $task->id)->get()->toArray(),\n 'task_proof' => \\Tritiyo\\Task\\Models\\TaskProof::where('task_id', $task->id)->get()->toArray(),\n 'task_status' => \\Tritiyo\\Task\\Models\\TaskStatus::where('task_id', $task->id)->get()->toArray(),\n );\n\n //$chunck_update = \\Tritiyo\\Task\\Models\\TaskChunck::update();\n $chunck = \\Tritiyo\\Task\\Models\\TaskChunck::updateOrCreate(\n array('task_id' => $task->id),\n array('manager_data' => json_encode($chunck))\n );\n }\n return view('task::edit', ['task' => $task]);\n }",
"public function update(Request $request, Task $task)\n {\n\n $this->authorize('update', $task);\n\n // Validation\n $this->validate($request, [\n 'title' => 'required|max:255',\n 'description' => 'required',\n 'priority' => 'required|max:5',\n ]);\n\n // Update\n $task->update([\n 'title' => $request->title,\n 'description' => $request->description,\n 'priority' => $request->priority,\n 'completed' => $request->completed,\n ]);\n\n return redirect ('/tasks');\n }",
"public function test_edit_task()\n {\n Task::create([\n 'name' => 'Task name', \n 'priority' => 'urgent', \n 'schedule_date' => '2020-12-12 12:22:00',\n 'project_id' => 1\n ]);\n $response = $this->post('/task/update', [\n 'task_id' => 1,\n 'name' => 'Updated task name', \n 'priority' => 'normal', \n 'schedule_date_date' => '2020-12-12',\n 'schedule_date_time' => '10:08',\n 'project_id' => '1',\n ]);\n $response->assertStatus(302);\n }",
"public function update(Request $request, Task $task)\n {\n //Admin allow only \n abort_if(Gate::denies('user_access'), Response::HTTP_FORBIDDEN, '403 Forbidden');\n\n $validated = $request->validate([\n 'name' => 'required|max:100|unique:tasks,name,' . $task->id,\n 'start_date' => 'required|date|after_or_equal:today',\n 'end_date' => 'required|date|after_or_equal:start_date',\n ]);\n\n //Create new task\n $task = Task::create($validated);\n \n //Save related users to task\n $assigned_user = User::find($request->assigned_user);\n $task->assigned_user()->associate($assigned_user);\n\n // $task->save();\n\n return redirect()->route('tasks.index');\n }",
"public function update(Request $request, Task $task)\n {\n $validator = Validator::make($request->all(),\n [\n 'task_title' => ['required', 'max:64'],\n 'task_comment' => ['required', 'max:512'],\n 'start_date' => ['required'],\n 'finish_date' => ['required'],\n ],\n [\n 'task_title.max' => 'Title text too long. Try with less than 64 characters',\n 'task_comment.max' => 'Comment text too long. Try with less than 512 characters',\n ]\n );\n\n if ($validator->fails()) {\n $request->flash();\n return redirect()->back()->withErrors($validator);\n }\n\n $task->title = $request->task_title;\n $task->comment = $request->task_comment;\n $task->start_time = $request->start_date;\n $task->finish_time = $request->finish_date;\n $task->user_id = $request->user()->id;\n $task->save();\n return redirect()->route('task.index')->with('success', 'Task updated successfully.');\n }",
"public function update(TaskRequest $request, Task $task)\n\t\t{\n\t $data = $request->only([\"task\", \"priority\"]);\n\t // create article with data and store in DB\n\t $task->fill($data)->save();\n\t // return the article along with a 201 status code\n\t return response($task, 201);\n\n\t\t}",
"public function testUpdateTask()\n {\n }",
"public function update(Request $request, Task $task)\n {\n $user = $request->user();\n $userTask = $user->tasks->find($task->id);\n\n if ($userTask) {\n $userTask->content = $request->content;\n $userTask->completed = $request->completed;\n $userTask->save();\n }\n }",
"public function update(TaskUpdateRequest $request, Task $task)\n {\n return (new CrudService())->update($request->all(), $task) ? \n view('web.pages.tasks')\n ->with('update_task',true)\n ->with('tasks',Task::with('project')->get())\n : Redirect::back()->withErrors(['msg'=>'An error ocurs while updating']);\n }",
"public function edit(Task $task)\n {\n try {\n return Task::findOrFail($task);\n }\n catch (\\Exception $error) {\n return response()->json([\"Cette tâche n'existe pas\"]);\n }\n }",
"public function updateTask(Task $task, Request $request)\n {\n $this->checkIfLoggedIn();\n\n $this->checkIfTaskBelongsToUSer($task);\n\n $task->updateTask(\n $request->input('title'),\n $request->input('body')\n );\n\n return redirect('/tasks');\n }",
"public function update(Request $request, Task $task)\n {\n //echo 'hello'; \n $this->authorize('update', $task);\n \n $this->validate($request, [\n 'name' => 'required|max:255',\n ]);\n \n $request->user()->tasks()->update([\n 'name' => $request->name,\n ]);\n \n $landing = 'edit/'.$task->id;\n return redirect($landing);\n \n //echo '<pre>'; print_r($request);\n die;\n //return redirect('update/'.$id)->withMessage($message);\n }",
"public function show_edit_form_task()\n {\n $user = factory(User::class)->create();\n $user->assignRole('task-manager');\n $this->actingAs($user);\n View::share('user', $user);\n $task = factory(Task::class)->create();\n\n factory(User::class, 5)->create();\n\n $users = User::all();\n\n $response = $this->get('/tasks_php/edit/'.$task->id);\n $response->assertSuccessful();\n $response->assertViewIs('tasks.edit_task');\n $task = Task::findOrFail($task->id);\n $response->assertViewHas('task', $task);\n $response->assertViewHas('users', $users);\n\n $response->assertSeeText('Edit Task:');\n\n $response->assertSee($task->name);\n $response->assertSee($task->user->name);\n }",
"public function editTask() {\n return $this->render('enterprise/task/task_form.html.twig');\n }",
"public function update(StoreTaskRequest $request, Task $task)\n {\n $task->category_id = $request->categoryId;\n $task->name = $request->name;\n $task->is_complete = $request->isComplete;\n $task->save();\n\n $redirect = Redirect::route('task.index');\n return $redirect->with('success', 'Task updated successfully.');\n }",
"public function update(TaskFormRequest $request, $id)\n {\n $data = [\n 'task_title'=>$request->get('task_title'),\n 'project_id'=>$request->get('project_id'),\n 'content_start_id' =>$request->get('content_start'),\n 'description' =>$request->get('description') \n ];\n\n $task = $this->tasks->updateById($id,$data);\n }",
"public function update(Request $request, Task $task)\n {\n\n // Start applying requested changes before potential execution.\n if ($request->request_details)\n {\n $task->request_details = json_encode($request->request_details, JSON_FORCE_OBJECT);\n }\n if ($request->status === 'ready')\n {\n // User is requesting to execute the current task.\n $function_name = 'task_' . $task->taskType->name;\n $result = $this->$function_name($task);\n $task->status = $result['status'];\n $task->response_details = $result['response_details'];\n }\n\n // Update the model.\n $task->save();\n\n // Return the updated task as a collection.\n\treturn response()->json(['status' => 'success', 'message' => 'Resource Updated', 'payload' => [$task]], 200);\n }",
"public function update(Request $request, Task $task)\n {\n if ($task->user_id !== Auth::user()->id) {\n return \"You are not authorized\";\n } else {\n $validated = $request->validate([\n 'title' => 'required|max:255',\n 'detail' => 'required|max:255',\n ]);\n\n $task->title = $request->title;\n $task->detail = $request->detail;\n $task->save();\n\n return redirect(route('projects.show', $task->project_id))->with('status', 'Your new task has been updated succesfully!');\n }\n\n }",
"public function update(TaskRequest $request, Task $task)\n {\n $this->authorize('update', $task);\n if ($request->done) {\n $task->update([\n 'done' => ($task->done == 0) ? 1 : 0,\n ]);\n return $task;\n }\n }",
"public function update(Request $request, Task $task)\n {\n try\n\t\t{\n $data = $request->all()['param'];\n $today = date('Y-m-d');\n\n $t = Task::find($data['id']);\n if(array_key_exists('status', $data))\n {\n $t->status = $data['status'];\n }\n if(array_key_exists('description', $data))\n {\n $t->description = $data['description'];\n }\n\n $t->finished = $today;\n $t->update();\n return response()->json(['data' => $t,\n 'message' => 'Tarefa concluída com sucesso.'], 201);\n\t\t}\n\t\tcatch (\\Exception $e)\n\t\t{\n if(config('app.debug'))\n {\n \t\t\treturn response()->json($e->getMessage(), 400);\n \t\t}\n\t\t\treturn response()->json('Houve um erro ao atualizar a tarefa.', 400);\n\t\t}\n }",
"public function update(Task $task, TaskRequest $request)\n {\n $task->title = $request->get('title', $request->title);\n $task->notes = $request->get('notes', $request->notes);\n $task->priority = $request->get('priority ', $request->priority);\n $task->due_date = $request->get('due_date ', $request->due_date);\n\n $task->save();\n\n return new TaskResource($task);\n }",
"public function edit($parent_id, $id)\n\t{\n $list = $this->service->findByOwnerAndId(\\Auth::user(), $parent_id);\n\n $task = $list->tasks()->find($id);\n\n if (!$task)\n {\n \\App::abort(404);\n }\n\n $task->fill(Input::get());\n $task->validate();\n\n if (!$task->save())\n {\n \\App::abort(500, 'Task was not updated');\n }\n\n }",
"public function update(Request $request, Task $task)\n {\n if ($request['name']) {\n $task->name = $request['name'];\n $task->update();\n\n return redirect()->route('tasks.index')->with('message', 'Task edit');\n }\n\n if (!$request['status']) {\n $task->statusCompleted();\n $task->update();\n return back()->with('message', 'Status complete');\n }\n\n\n }",
"public function update(Request $request, Task $task)\n {\n $userId = $request->user()->id;\n $data = $this->validate($request, UserTask::updateRules());\n $userTask = UserTask::query()\n ->where([\n ['user_id', '=', $userId ],\n ['task_id', '=', $task->id ]\n ])->first();\n\n if ( !$userTask ) {\n $model = new UserTask();\n $model->user_id = $userId;\n $model->task_id = $task->id;\n $model->isCompleted = $data['isCompleted'];\n $model->save();\n\n } else {\n $userTask->update( $data );\n }\n\n return response()->json(null, Response::HTTP_OK);\n }",
"public function update(Request $request, TodoTask $todotask): TaskResource\n {\n //validate the requests\n $request->validate([\n 'name' => 'required',\n 'todo_list_id' => 'required',\n ]);\n //update a user\n $todotask->update($request->all());\n return new TaskResource($todotask);\n }",
"public function update(Request $request) {\n\n // Validate the request actually has a description.\n $this->validate($request, [\n 'description' => 'required|min:1',\n ]);\n\n // Pull the original task.\n $task = Task::find($request->id);\n\n // Verify it was pulled.\n if(is_null($task)) {\n Session::flash('flash_message', 'Unable to locate task');\n return redirect('/tasks');\n }\n\n // Set the description on the new task object.\n $task->description = $request->description;\n\n // Set complete if necessary.\n if($request->complete) {\n $task->complete = 1;\n }\n\n // Save new task to old.\n $task->save();\n\n // Return to taks list, let the user know.\n Session::flash('flash_message', 'Updated Task!');\n return redirect('/tasks');\n\n }",
"public function edit($id=null) {\n\n $Task = $this->Task->find('first', array(\n 'contain' => array(),\n 'conditions' => array(\n 'Task.id' => $id\n )\n ));\n\n if(empty($Task))\n return $this->redirect('/tasks');\n\n if($this->request->is('post')){\n\n $this->Task->id = $id;\n $result = $this->Task->save($this->request->data);\n if($result){\n $this->_setFlash('Task updated successfully.', 'success');\n $this->redirect('/tasks');\n }\n else {\n $valError = $this->Task->validationErrorsAsString();\n $this->_setFlash(\"Unable to update task. ${valError}\");\n }\n }\n else {\n $this->request->data = $Task;\n }\n\n $this->set('medId', $id);\n $this->set('add', false);\n $this->render('add-edit');\n }",
"public function updateTask(TaskInterface $task) {\n\n return $this->request('tasks/' . $task->getId(), 'PUT', [], json_encode($task->getProperties()));\n }",
"public function update(TaskRequest $request, Task $task)\n {\n Gate::authorize('update', $task);\n\n $task->update($request->validated());\n\n if ($request->input('as_subtask', false)) {\n if ($task->isSubtask()) {\n return Redirect::route('tasks.show', $task->parent_id);\n }\n\n return Redirect::route('tasks.index');\n }\n\n return Redirect::route('tasks.show', $task->id);\n }",
"public function edit($task_id)\n {\n $this->form_validation->set_rules($this->rules['update']);\n\n // Get task ID\n $task_id = ($this->form_validation->run() === TRUE) ? $this->input->post('task_id') : intval($task_id);\n\n // Look for the task\n $task = $this->task_model->get_task($task_id);\n\n if ($task === FALSE) {\n $this->postal->add('There is no task with that ID', 'error');\n redirect();\n }\n\n $this->data['task'] = $task;\n\n // Find out the role of the user\n $this->load->model('project_user_model');\n $role = $this->project_user_model->get_role($task->project_id, $this->user_id);\n if (!in_array($role, array('admin', 'edit'))) {\n $this->postal->add('You are not allowed to change the tasks in this project', 'error');\n redirect('projects/index/' . $task->project_id);\n }\n $this->data['role'] = $role;\n\n // Get the available statuses\n $this->load->model('task_status_model');\n $statuses = $this->task_status_model->as_dropdown('title')->order_by('order', 'ASC')->get_all();\n\n $admin_statuses = array('1','2','3','4','5','6','7');\n $edit_statuses = array('2','3','4');\n $the_statuses = array();\n\n foreach($statuses as $id => $the_status)\n {\n if(in_array($id,$admin_statuses)) $the_statuses['admin'][$id] = $the_status;\n if(in_array($id,$edit_statuses)) $the_statuses['edit'][$id] = $the_status;\n }\n $this->data['statuses'] = $the_statuses;\n\n // Get the priorities\n $this->load->model('task_priority_model');\n $priorities = $this->task_priority_model->as_dropdown('title')->order_by('order', 'DESC')->get_all();\n $this->data['priorities'] = $priorities;\n\n // Get the project\n $project = $this->project_model->with_members('fields:email,id')->get($task->project_id);\n\n // Get the members of the project if the $role is admin (only admin has the right to assign to other people)\n $members = array();\n if (!empty($project->members)) {\n foreach ($project->members as $member) {\n $members[$member->id] = $member->email;\n }\n }\n $this->data['members'] = $members;\n\n if ($this->form_validation->run() === FALSE)\n {\n $this->render('tasks/edit_view');\n }\n else\n {\n echo $role;\n\n $old_task = $task;\n\n\n $update_data = array();\n $history_data = array();\n $changes = array();\n if($role == 'admin')\n {\n if(strcmp($old_task->title,$this->input->post('title'))!=0)\n {\n $update_data['title'] = $this->input->post('title');\n $history_data['title'] = $old_task->title;\n $changes[] = '<strong>Title</strong> was changed from <span class=\"text-danger\">'.$history_data['title'].'</span> to <span class=\"text-success\">'.$update_data['title'].'</span>.';\n }\n\n\n if(strcmp($old_task->summary,$this->input->post('summary'))!=0)\n {\n $update_data['summary'] = $this->input->post('summary');\n $history_data['summary'] = $old_task->summary;\n $changes[] = '<strong>Summary</strong> was changed from <span class=\"text-danger\">'.$history_data['summary'].'</span> to <span class=\"text-success\">'.$update_data['summary'].'</span>.';\n }\n\n if($old_task->assignee_id!=$this->input->post('assigned_to'))\n {\n $update_data['assigned_to'] = $this->input->post('assigned_to');\n $history_data['assigned_to'] = $old_task->assignee_id;\n $changes[] = '<strong>The assignee</strong> was changed from <span class=\"text-danger\">'.$members[$history_data['assigned_to']].'</span> to <span class=\"text-success\">'.$members[$update_data['assigned_to']].'</span>.';\n }\n\n if($old_task->priority!=$this->input->post('priority'))\n {\n $update_data['priority'] = $this->input->post('priority');\n $history_data['priority'] = $old_task->priority;\n $changes[] = '<strong>The priority</strong> was changed from <span class=\"text-danger\">'.$priorities[$history_data['priority']].'</span> to <span class=\"text-success\">'.$priorities[$update_data['priority']].'</span>.';\n }\n\n if(strcmp($old_task->due_date,$this->input->post('due_date'))!=0)\n {\n $update_data['due_date'] = $this->input->post('due_date');\n $history_data['due_date'] = $old_task->due_date;\n $changes[] = '<strong>The due date</strong> was changed from <span class=\"text-danger\">'.$history_data['due_date'].'</span> to <span class=\"text-success\">'.$update_data['due_date'].'</span>.';\n }\n }\n\n if(in_array($role,array('admin','edit')))\n {\n if(($old_task->assignee_id!=$this->input->post('assigned_to')) && $role=='admin')\n {\n $status = '1';\n }\n\n else\n {\n $status = $this->input->post('status');\n }\n\n if(($old_task->status_id!=$status) && array_key_exists($status, $the_statuses[$role]))\n {\n $update_data['status'] = $status;\n $history_data['status'] = $old_task->status_id;\n $changes[] = '<strong>Status</strong> was changed from <span class=\"text-danger\">'.$statuses[$history_data['status']].'</span> to <span class=\"text-success\">'.$statuses[$update_data['status']].'</span>.';\n if($status=='4' || $status=='5')\n {\n $new_progress = 100;\n }\n }\n\n if(isset($new_progress))\n {\n $update_data['progress'] = $new_progress;\n $history_data['progress'] = $old_task->progress;\n $changes[] = '<strong>The progress</strong> of the task was changed from <span class=\"text-danger\">'.$history_data['progress'].'%</span> to <span class=\"text-success\">'.$update_data['progress'].'%</span> because status was changed to \"Completed\".';\n\n }\n elseif($old_task->progress!=$this->input->post('progress'))\n {\n $update_data['progress'] = $this->input->post('progress');\n $history_data['progress'] = $old_task->progress;\n $changes[] = '<strong>The progress</strong> of the task was changed from <span class=\"text-danger\">'.$history_data['progress'].'%</span> to <span class=\"text-success\">'.$update_data['progress'].'%</span>.';\n }\n }\n\n if(!empty($update_data))\n {\n $update_data['updated_by'] = $this->user_id;\n $update_data['updated_at'] = date('Y-m-d H:i:s');\n $the_intro = 'The following changes were made by <strong><span class=\"text-success\">'.$members[$this->user_id].'</span></strong>:';\n array_unshift($changes,$the_intro);\n\n $history_data['task_id'] = $old_task->id;\n $history_data['created_by'] = $this->user_id;\n $history_data['created_at'] = date('Y-m-d H:i:s');\n $history_data['changes'] = implode('<br />',$changes);\n\n\n $history_id = $this->task_history_model->insert($history_data);\n if( $history_id !== FALSE)\n {\n if($this->task_model->where('id',$task_id)->update($update_data) !== FALSE)\n {\n $this->postal->add('The changes were made successfully.','success');\n }\n else\n {\n $this->task_history_model->delete($history_id);\n $this->postal->add('There was a problem in updating the task. Sit tight and wait for the rescue team... Or you could write them an email with a print screen.');\n }\n }\n\n redirect('tasks/index/'.$task_id);\n }\n /*\n echo '<pre>';\n print_r($update_data);\n print_r($history_data);\n print_r($changes);\n echo '</pre>';\n dd($old_task);\n /*\n $title = $this->input->post('title');\n $assigned_to = ($role === 'admin') ? $this->input->post('assigned_to') : $this->user_id;\n $status = $this->input->post('status');\n $priority = $this->input->post('priority');\n $due_date = $this->input->post('due_date');\n $description = $this->input->post('description');\n $summary = $this->input->post('summary');\n $notes = $this->input->post('notes');\n\n\n $verify_assigned_to = $this->project_user_model->get_role($project_id, $assigned_to);\n\n if (!in_array($verify_assigned_to, array('admin', 'edit'))) {\n $this->postal->add('You are not allowed to add the task to that user. You must first add him/her to the project as admin or edit');\n redirect('projects/index/' . $project->id);\n exit;\n }\n\n $insert_data = array(\n 'project_id' => $project_id,\n 'title' => $title,\n 'assigned_to' => $assigned_to,\n 'status' => $status,\n 'priority' => $priority,\n 'due_date' => $due_date,\n 'description' => $description,\n 'summary' => $summary,\n 'notes' => $notes,\n 'created_by' => $this->user_id\n );\n\n if ($this->task_model->insert($insert_data)) {\n $this->postal->add('The task was created successfully', 'success');\n } else {\n $this->postal->add('Couldn\\'t create the task', 'error');\n }\n redirect('projects/index/' . $project->id);\n */\n\n }\n }",
"public function update(Request $request, Task $task)\n {\n $task->update($request->all());\n\n\t\t\t\tevent(new TaskToggled($task));\n\n\t\t\t\treturn $task;\n }",
"public function update(TaskUpdateRequest $request, Task $task)\n {\n DB::beginTransaction();\n try {\n $task->update($request->all());\n DB::commit();\n } catch (\\Exception $ex) {\n DB::rollBack();\n return redirect()->back()->with('error', 'Sorry ! Error occurred during the transaction.');\n }\n\n return redirect()->route('home')->with(\"success\", \"Task updated successfully !\");\n }",
"public function update(Request $request, Task $task)\n {\n $task->title=$request->title;\n $task->project_id= $request->project_id;\n $task->save();\n\n return redirect()->route('tasks.index');\n }",
"public function update(Request $request,Task $task)\n {\n //\n //dd($request->all());\n $task->update(['nametask' => $request->nametask]);\n return redirect()->back()->with('message', 'отредактировано');\n }",
"public function edit(Task $task)\n {\n return view('teacher/edittask',\n [ 'task' =>$task ]\n );\n }",
"public function update() {\n\n //GETS TASK, DEPENDING ON TASK ID (ID)\n $data=Tasks::find(request('task_id'));\n\n //GETS REQUEST AND REPLACES TASK TITLE & DESCRIPTION\n $data->task=request('task');\n $data->description=request('description');\n\n //SAVES DB\n $data->save();\n\n //REDIRECTS TO TASK VIEW WITH NOTEPADID AS PARAMETER\n return redirect (\"/task/$data->NotepadID\");\n }",
"public function update(Request $request, Task $task)\n {\n $task->state = $request['done'] ? 'done' : 'pending';\n $task->description = $request['description'] ?? $task->description;\n\n try {\n $task->validate();\n $task->save();\n } catch (ValidationException $e) {\n return new JsonResponse([ 'error' => $e->errors() ], 400);\n } catch (PDOException $e) {\n return new JsonResponse([ 'error' => ['error conecting to database'] ], 500);\n }\n\n return new JsonResponse([\n 'data' => new TaskResource($task),\n 'error' => false,\n ]);\n }",
"public function update(Task $task, StoreTaskRequest $request)\n {\n $request->validated();\n\n $task->update($request->all());\n return redirect()->route('dashboard.tasks');\n }",
"public function update(Request $request, Task $task)\n {\n $validatedData = $request->validate([\n 'body' => 'required|min:2',\n 'status' => Rule::in(0, 1, 2),\n ]);\n\n $task->body = array_key_exists('body', $validatedData) ?\n $validatedData['body'] : $task->body;\n $task->status = array_key_exists('status', $validatedData) ?\n $validatedData['status'] : $task->status;\n\n $task->save();\n\n return response()->json($task->toJson(), 200);\n }",
"public function update(UpdateTaskRequest $request, Task $task)\n {\n $inputs = $request->all();\n $inputs['completed_at'] = $request->completed ? now() : null;\n unset($inputs['completed']);\n\n $task->update($inputs);\n\n return response('Task Updated Successfully');\n }",
"public function editTask($id)\n\t{\n\t\tif ( \\App\\is_admin() ) {\n\t\t\t$task = Task::whereId( (int)$id )->first();\n\t\t\techo twig()->render('edit.html', ['task' => $task]);\n\t\t} else {\n\t\t\theader('Location: /?err=auth');\n\t\t}\n\t}",
"public function testUpdate()\n {\n $this->actingAs(User::factory()->make());\n $task = new Task();\n $task->title = 'refined_task';\n $task->completed = false;\n $task->save();\n\n $response = $this->put('/tasks/' . $task->id);\n\n $updated = Task::where('title', '=', 'refined_task')->first();\n\n $response->assertStatus(200);\n $this->assertEquals(true, $updated->completed);\n }",
"public function update(Request $request, Task $task)\n {\n $this->validate($request, [\n 'name' => 'max:128',\n 'status' => 'boolean',\n 'order' => 'numeric',\n ], [\n 'name.*' => 'Name is invalid!',\n 'status.*' => 'Status is invalid!',\n 'order.*' => 'Status is invalid!',\n ]);\n\n return response()->json([\n 'success' => (int) $task->update($request->all()),\n ]);\n }",
"public function edit(Task $task)\n {\n return view('web.pages.edit_task')\n ->with('task',$task)\n ->with('projects',Project::all());\n }",
"public function updateTask(){\n $input_data = $this->_cleanInputs($_POST);\n if(sizeof($input_data)){\n $this->response = verifyCSRFToken();\n if($this->response->status === false){\n return $this->sendResponse($this->response);\n }\n //{\"tasks_name\":\"\",\"tasks_description\":\"\",\"roles\":[\"1\",\"12\",\"2\",\"18\",\"3\"]}\n $this->response = $this->validateTask($input_data,\"update\");\n if($this->response->status === false){\n return $this->sendResponse($this->response);\n }\n \n $task = new Tasks();\n $task = $task->find($input_data['tasks_id']);\n $task->tasks_name = $input_data['tasks_name'];\n $task->tasks_description = $input_data['tasks_description'];\n $user_info = $_SESSION['user_info'];\n $task->user_id = $user_info['user_id'];\n $task::$conn->beginTransaction();\n $this->response = $task->save();\n if($this->response->status === true){\n //Map roles with the tasks\n $roles = isset($input_data['roles']) && is_array($input_data['roles'])?$input_data['roles']:array();\n $this->response = $task->mapTaskWithRoles($task::$conn,$task->tasks_id, $roles);\n if($this->response->status === false){\n $task::$conn->rollback();\n $this->response->msg = \"Failed to update.\";\n }\n else{\n $task::$conn->commit();\n $this->response->msg = \"Successfully updated.\";\n }\n }\n \n }\n else{\n $this->response->set([\n \"status\"=>false,\n \"msg\"=>\"No input parameter.\",\n \"status_code\"=>403\n ]);\n }\n return $this->sendResponse($this->response);\n }",
"public function update(Request $request, Task $task)\n {\n $task_id = $task->id;\n\n if (auth()->user()->isManager(auth()->user()->id)) {\n if ($request->finish_editing == 'Yes') {\n $put = Task::find($task_id);\n $put->override_status = 'Yes';\n $put->save();\n return redirect()->back()->with('message', 'semd to approver successfully')->with('status', 1);\n } else {\n /**\n * if manager edited any data during requisition after approver data\n * action delete this approver approved status from tasksstatus table\n */\n if($task->manager_override_chunck == null){\n TaskHelper::ManagerOverrideData($task_id);\n }\n }\n }\n\n //End\n\n $getResource = TaskSite::select('resource_id')->where('task_id', $task->id)->get();\n if (isset($getResource)) {\n $checkResource = TaskHelper::arrayExist($getResource, 'resource_id', $request->site_head);\n if ($checkResource == true) {\n return redirect()->back()->with('message', 'This person already assign as resource.please at first remove from resource')->with('status', 0);\n }\n }\n\n if($request->anonymousproof_details){\n if (auth()->user()->isManager(auth()->user()->id)) {\n /*\n && $request->anonymous_proof_details\n Task::where('id', $task->id)\n ->update(['anonymous_proof_details' => $request->anonymous_proof_details]);\n */\n\n\n $atts = Task::find($task->id);\n $atts->anonymous_proof_details = $request->anonymous_proof_details;\n $atts->save();\n\n }\n return redirect()->back()->with('message', 'Saved successfully')->with('status', 1);\n }\n\n if (auth()->user()->isManager(auth()->user()->id) && $request->task_assigned_to_head == 'Yes') {\n\n $atts = Task::find($task->id);\n $atts->task_assigned_to_head = $request->task_assigned_to_head;\n $atts->save();\n\n TaskHelper::statusUpdate([\n 'code' => TaskHelper::getStatusKey('task_assigned_to_head'),\n 'task_id' => $request->task_id,\n 'action_performed_by' => auth()->user()->id,\n 'performed_for' => null,\n 'requisition_id' => null,\n 'message' => TaskHelper::getStatusMessage('task_assigned_to_head')\n ]);\n return redirect()->back()->with('message', 'Saved successfully')->with('status', 1);\n }\n\n if (auth()->user()->isApprover(auth()->user()->id)) {\n TaskHelper::statusUpdateOrInsert([\n 'code' => TaskHelper::getStatusKey('task_approver_edited'),\n 'task_id' => $request->task->id,\n 'action_performed_by' => auth()->user()->id,\n 'performed_for' => null,\n 'requisition_id' => null,\n 'message' => TaskHelper::getStatusMessage('task_approver_edited')\n ]);\n }\n\n\n // store\n $attributes = [\n 'task_type' => $request->task_type,\n 'project_id' => $request->project_id,\n 'task_code' => $request->task_code ?? null,\n 'task_name' => $request->task_name,\n 'site_head' => $request->site_head,\n 'task_details' => $request->task_details,\n 'task_assigned_to_head' => $request->task_assigned_to_head,\n ];\n //return redirect()->back()->with('message', 'Edited Successfully')->with('status', 1);\n //dd($attributes);\n try {\n $task = $this->task->update($task->id, $attributes);\n\n return back()\n ->with('message', 'Successfully saved')\n ->with('status', 1)\n ->with('task', $task);\n } catch (\\Exception $e) {\n return view('task::edit', $task->id)->with(['status' => 0, 'message' => 'Error']);\n }\n }",
"public function updateTask(UpdateTaskRequest $request)\n {\n DB::beginTransaction();\n try {\n $repeat = $this->checkTask($request->task)->repeat;\n $user = Auth::user();\n $task = $this->addTask($request, $user, 'update');\n $task->save();\n\n if ($request->has('existingFiles')) {\n $requestCollectionObj = $this->getRequestCollectionObject($request->existingFiles);\n $this->deleteFiles($requestCollectionObj, $task, $request->org_slug);\n }\n\n if ($request->file) {\n $requestCollectionObj = $this->getRequestCollectionObject($request->file('file'));\n $taskFileArray = $this->taskFileUpload($requestCollectionObj, $task, $request->org_slug);\n TaskFile::insert($taskFileArray);\n }\n\n if ($request->checklist) {\n $requestCollectionObj = $this->getRequestCollectionObject($request->checklist);\n $this->updateCheckList($requestCollectionObj, $task, $user);\n }\n\n if ($request->participants) {\n $requestCollectionObj = $this->getRequestCollectionObject(array_unique($request->participants));\n $this->updateParticipants($requestCollectionObj, $task);\n }\n\n if ($request->to_all_participants) {\n DB::table(TaskParticipants::table)->where(TaskParticipants::task_id, $task->id)->delete();\n }\n\n/* if ($request->has('subtask')) {\n $requestCollectionObj = $this->getRequestCollectionObject($request->subtask);\n $this->addSubTask($requestCollectionObj, $task, $user);\n }*/\n\n if ($request->repeatable) {\n $requestCollectionObj = $this->getRequestCollectionObject($request->repeatable);\n\n if ($repeat)\n $this->updateRepeatable($requestCollectionObj, $task, $user);\n else\n $this->repeatable($requestCollectionObj, $task, $user);\n\n } else if ($repeat == true && $request->repeatable == false) {\n TaskRepeat::where(TaskRepeat::task_id, $task->id)\n ->where(TaskRepeat::user_id, $user->id)->delete();\n }\n\n $this->setDataForActivityStream($task, \"taskUpdated\");\n DB::commit();\n } catch (ModelNotFoundException $e) {\n DB::rollBack();\n $error = $e->getMessage();\n if ($e->getModel() === Task::class)\n $error = \"Invalid Task\";\n\n $this->content['error'] = $error;\n $this->content['code'] = 422;\n return $this->content;\n } catch (\\Exception $e) {\n DB::rollBack();\n $this->content['error'] = $e->getMessage();\n $this->content['code'] = 422;\n return $this->content;\n }\n\n $this->content['data'] = \"Task updated successfully\";\n $this->content['code'] = 200;\n return $this->content;\n\n }",
"public function updateTask(&$task)\r\n\t{\r\n\t\t$sql = sprintf('\r\n\t\t\tUPDATE\r\n\t\t\t\ttask\r\n\t\t\tSET\r\n\t\t\t\ttitle = \"%s\"\r\n\t\t\tWHERE\r\n\t\t\t\tid = %d\r\n\t\t', mysql_escape_string($task->title), $task->id);\t\t\r\n\r\n\t\tmysqli_query($this->db, $sql);\r\n\t}",
"public function editTask(){\n //Checks if the request is a post request\n if($_SERVER['REQUEST_METHOD'] == 'POST'){\n //Sanitize POST data\n $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n\n //Init Data\n $data = [\n 'edit_task_id'=> trim($_POST['taskId']),\n 'edit_task_name'=> trim($_POST['taskNameEdit']),\n 'edit_task_type'=> trim($_POST['taskTypeInput']),\n 'edit_task_start_time'=> trim($_POST['startTimeEdit']),\n 'edit_task_end_time' => trim($_POST['endTimeEdit']),\n 'edit_task_start_date' => trim($_POST['startDateInput']),\n 'edit_task_end_date' => trim($_POST['endDateInput']),\n 'edit_isComplete' => trim($_POST['isComplete']),\n 'edit_task_name_error' => '',\n 'edit_task_type_error' => '',\n 'edit_task_start_time_error'=> '',\n 'edit_task_end_time_error' => '',\n 'edit_task_start_date_error' => '',\n 'edit_task_end_date_error' => ''\n ];\n\n //Checks if the name is empty\n if(empty($data['edit_task_name'])){\n $data['edit_task_name_error'] = 'Please enter a name for the task';\n }\n //Checks if the type is empty\n if(empty($data['edit_task_type'])){\n $data['edit_task_type_error'] = 'Please select a task type';\n }\n //Checks if the start time is empty\n if(empty($data['edit_task_start_time'])){\n $data['edit_task_start_time_error'] = 'Please enter in a start time for the task';\n }\n //Checks if the end time is empty\n if(empty($data['edit_task_end_time'])){\n $data['edit_task_end_time_error'] = 'Please enter in a end time for the task';\n }\n //Checks if the start date is empty\n if(empty($data['edit_task_start_date'])){\n $data['edit_task_start_date_error'] = 'Please enter in a start date for the task';\n }\n //Checks if the end date is empty\n if(empty($data['edit_task_end_date'])){\n $data['edit_task_end_date_error'] = 'Please enter in a end date for the task';\n }\n //Checks if all the errors are empty\n if(empty($data['edit_task_name_error']) && empty($data['edit_task_type_error']) && empty($data['edit_task_start_time_error']) &&\n empty($data['edit_task_end_time_error']) && empty( $data['edit_task_start_date_error']) && empty( $data['edit_task_end_date_error'])){\n //Validate\n\n $validation = $this->taskHistoryModel->validateId($data['edit_task_id']);\n //Checks if the id inputed by the user was correct\n if(sizeof($validation) > 0){\n //Input New Task\n if($this->taskHistoryModel->editTask($data)){\n if($_SESSION['current_page'] == \"TaskHistory\"){\n redirect('TaskHistoryController/taskHistory');\n \n }elseif($_SESSION['current_page'] == \"IndividualProject\"){\n $link = 'IndividualProjectController/individualProject?projectId='. $_SESSION['current_project'];\n \n redirect($link);\n \n }else{\n $link = 'IndividualGroupController/individualGroup?groupId='. $_SESSION['current_group'];\n \n redirect($link);\n }\n\n }else{\n die('Something went Wrong');\n }\n\n }else{\n redirect('TaskHistoryController/taskHistory');\n }\n\n }else{\n //Load view with errors\n $_SESSION[\"taskEditErrors\"] = $data;\n redirect('TaskHistoryController/taskHistory');\n }\n\n }\n }",
"public function update(TasksTagsUpdate $request, Task $task)\n {\n $mappedTags = collect($request->tags)->map(function ($tag) {\n if (is_int($tag)) return $tag;\n else {\n return Tag::create([\n 'color' => 'grey',\n 'name' => $tag,\n 'description' => ''\n ])->id;\n }\n });\n $task->addTags(Tag::find($mappedTags));\n }",
"public function update(Task $task, Request $request)\n {\n $this->task->update($task, $request->all());\n\n flash()->success(trans('core::core.messages.resource updated', ['name' => trans('projectmanager::tasks.title.tasks')]));\n\n return redirect()->route('admin.projectmanager.task.index');\n }",
"public function update(UpdateTaskRequest $request, $id)\n {\n $task = Task::find($id);\n \n if (!$task) {\n throw new ItemNotFoundException($id);\n }\n\n $task->updated_at = Carbon::now();\n $task->updated_by = auth()->user()->id;\n\n $input = $request->validated();\n \n try {\n $updated = $task->fill($input)->save();\n } catch (\\Throwable $th) {\n throw new ItemNotUpdatedException('Task');\n }\n\n if (!$updated)\n throw new ItemNotUpdatedException('Task');\n \n return $this->sendResponse(new TaskResource($task), 'task updated successfully.'); \n }",
"public function update(TaskFormRequest $request, Task $task)\n {\n $validated_data= $request->validated();\n\n $task->update($validated_data);\n\n return redirect()->route('subject.tasks.list', [ 'subject' => $task->subject]);\n\n }",
"public function updateTask($id)\n\t{\n\t\tif ( \\App\\is_admin() ) {\n\t\t\t$task = Task::whereId( (int)$id )->first();\n\t\t\tif ( !$task ) {\n\t\t\t\theader('Location: /?err=tasl-undefined');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ( $this->taskValidate() ) {\n\t\t\t\t$task->update([\n\t\t\t\t\t\t'name' => htmlspecialchars($_POST['inputTaskName']),\n\t\t\t\t\t\t'email' => htmlspecialchars($_POST['inputTaskMail']),\n\t\t\t\t\t\t'text' => htmlspecialchars($_POST['inputTaskText'])\n\t\t\t\t\t]);\n\t\t\t\t// to index\n\t\t\t\theader('Location: /');\n\t\t\t}\n\t\t} else {\n\t\t\theader('Location: /?err=auth');\n\t\t}\n\t}",
"public function edit($id)\n\t{\n\t\tView::share('title', 'ThinkClosing - Task');\n\t\t$task = Task::find($id);\n\t\tif (!$task) {\n\t\t\treturn Redirect::route('tasks.index')\n \t->with('message', 'Task not found.')\n \t->with('alert-class', 'alert-error');\n\t\t} else if($task->user_id !== Auth::user()->id || !Auth::user()->isAdmin()) {\n\t\t\treturn Redirect::route('tasks.index')\n \t->with('message', \"You don't have permission to edit this task.\")\n \t->with('alert-class', 'alert-error');\n\t\t}\n\t\treturn View::make('tasks.edit')->with('task', $task);\n\t}",
"public function update(Request $request, Task $task)\n {\n $task->update([\n 'completed' => true\n ]);\n \n return back();\n }",
"public function edit(Task $task)\n {\n return view('task.edit', ['task' => $task]);\n }",
"public function update(Request $request, Board $board, Task $task)\n {\n $validatedData = $request->validate([\n 'title' => 'required|string|max:255', \n 'description' => 'max:4096', \n 'due_date' => 'required|date|after:today',\n 'state' => 'required|in:todo,ongoing,done',\n 'category_id' => 'nullable|integer|exists:categories,id',\n ]);\n // TODO : il faut vérifier que le board appartient bien à l'utilisateur :(\n $validatedData['board_id'] = $board->id; \n $task->update($validatedData); // Nouvelle méthode création, sans avoir à affecter propriété par propriété\n return redirect()->route('tasks.index', $board);\n }",
"public function update(Request $request, Task $task)\n {\n $task->done = !$task->done;\n $task->save();\n\n return redirect('/');\n }",
"public function update($id, Request $request)\n {\n DB::beginTransaction();\n\n // Get task with param $id\n $task = Task::find($id);\n\n // Get all the input from update.\n $inputs = $request->all();\n\n try {\n TaskTeam::where('project_time_task_id', $task->id)->delete();\n\n foreach($inputs as $input => $value) {\n if($task->{$input})\n $task->{$input} = $value;\n }\n\n if ($task->save()) {\n foreach ($inputs['teams'] as $team) {\n $data['team_id'] = $team;\n $data['project_time_task_id'] = $task->id;\n\n if (!TaskTeam::create( $data )) {\n DB::rollback();\n return redirect('tasks/create')->withInput()->with('return', GeneralController::createMessage('failed', Lang::get('general.' . $this->controller_name), 'create'));\n }\n }\n\n DB::commit();\n return redirect('tasks')->with('return', GeneralController::createMessage('success', Lang::get('general.' . $this->controller_name), 'update'));\n } else {\n DB::rollback();\n return redirect('tasks/' . $id . '/edit')->withInput()->with('return', GeneralController::createMessage('failed', Lang::get('general.' . $this->controller_name), 'update'));\n }\n } catch (Exception $e) {\n DB::rollback();\n return redirect('tasks/' . $id . '/edit')->withInput()->with('return', GeneralController::createMessage('failed', Lang::get('general.' . $this->controller_name), 'update'));\n }\n }",
"public function update(Request $request, $id)\n {\n //$this->validate(request(), [ ]);\n \n $task = Task::findOrFail($id);\n\n $task->name=request('name');\n $task->case_id=request('case_id');\n $task->user_id=request('user_id');\n $task->priority=request('priority');\n $task->stage_id=request('stage_id');\n $task->date=request('date');\n $task->description=request('description');\n\n $task->save();\n\n return redirect()\n ->route('task_edit', $task->id)\n ->with('success', __('global.edit_succees'));\n }",
"public function edit(Task $task)\n {\n $projects = Project::all();\n\n return view('editTask', ['task' => $task, 'projects' => $projects]);\n }",
"public\n function update(\n Request $request\n ) {\n $task = Task::firstOrNew(['id' => $request->input('id')]);\n if ($task instanceof Task) {\n $task->name = $request->input('name');\n $task->description = $request->input('description');\n $this->taskRepository->store($task);\n return back();\n }\n return abort(404);\n }",
"public function editTask($row=null)\n\t{\n\t\tif (!User::authorise('core.manage', $this->_option)\n\t\t && !User::authorise('core.admin', $this->_option)\n\t\t && !User::authorise('core.create', $this->_option)\n\t\t && !User::authorise('core.edit', $this->_option))\n\t\t{\n\t\t\tApp::abort(403, Lang::txt('JERROR_ALERTNOAUTHOR'));\n\t\t}\n\n\t\tRequest::setVar('hidemainmenu', 1);\n\n\t\tif (!$row)\n\t\t{\n\t\t\t// Incoming\n\t\t\t$id = Request::getArray('id', array());\n\n\t\t\t// Get the single ID we're working with\n\t\t\tif (is_array($id))\n\t\t\t{\n\t\t\t\t$id = (!empty($id)) ? $id[0] : 0;\n\t\t\t}\n\n\t\t\t$row = Blacklist::oneOrNew($id);\n\t\t}\n\n\t\t// Output the HTML\n\t\t$this->view\n\t\t\t->set('row', $row)\n\t\t\t->setErrors($this->getErrors())\n\t\t\t->setLayout('edit')\n\t\t\t->display();\n\t}",
"public function update(Request $request, Task $task)\n {\n $validateData = $request-> validate([\n 'title' => 'required',\n 'category_id'=> 'required',\n 'due_date'=> 'required|date|date_format:Y-m-d|after or equal:'.date('Y-m-d')\n ]);\n\n $category = Category::findOrFail($request->category_id);\n\n if($category->user_id != auth()->id()){\n return response()->json(['message'=>'You Don\\'n own this category!'], '401');\n }\n\n if($task->user_id != auth()->id()){\n return response()->json(['message'=>'You Don\\'n own this task!'], '401');\n }\n\n if($task->update($request->all())){\n return response()->json(['message'=>'Task successfully Updated!']);\n }\n\n\n return response()->json(['message'=>'Please Try later!'], 500);\n }",
"public function edit(Task $task)\n {\n $data['task'] = $task;\n $data['tags'] = Tag::orderBy('text')->get();\n\n return view('tasks.store', $data);\n }",
"public function actionUpdate($task_id)\n {\n /* $model = $this->findModel($id);\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n \n }*/\n $_wsTaskModel = $this->findWorksystemTask($task_id);\n return $this->renderAjax('update', [\n 'model' => $_wsTaskModel,\n 'infos' => $this->getWorksystemContentinfos($task_id),\n ]);\n }",
"public function edit($id) {\n\n // Recover the task.\n $task = Task::find($id);\n\n // Verify it's actually recovered\n if(is_null($task)) {\n Session::flash('flash_message', 'Unable to locate task');\n return redirect('/tasks');\n }\n\n // Return recovered task to view.\n return view('task.edit')->with([\n 'task' => $task,\n ]);\n }",
"public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\t\tif (!Yii::app()->user->hasRole($model->role_id) && !Yii::app()->user->isManagerForOrg($model->org->id)){\n\t\t\tthrow new CHttpException(403, \"You do not have permission to update this task.\");\n\t\t}\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Task']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Task'];\n\t\t\tif($model->save()){\n\t\t\t\t$this->taskNotify($model);\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"protected function updateTask($task)\n {\n $errors = $this->taskManager->validate($task);\n if (!empty($errors)) {\n throw new InvalidArgumentException(implode(\"\\n\", $errors));\n }\n\n return $task;\n }",
"public function testUpdatedTask()\n {\n $userId = User::first()->value('id');\n $taskId = Task::orderBy('id', 'desc')->first()->id;\n\n $response = $this->json('PUT', '/api/v1.0.0/users/'.$userId.'/tasks/'.$taskId, [\n 'description' => 'An updated task from PHPUnit',\n 'completed' => true,\n ]);\n\n $response\n ->assertStatus(200)\n ->assertJson([\n 'description' => 'An updated task from PHPUnit',\n 'completed' => true,\n ]);\n }",
"public function update(Request $request, Project $project, Task $task)\n {\n $request->validate([\n 'name' => 'required|max:255',\n 'group_id' => 'required|integer',\n 'from_date' => 'nullable|date',\n 'until_date' => 'nullable|date',\n 'description' => 'nullable|max:1000',\n 'order' => 'integer',\n 'done' => 'boolean'\n ]);\n\n Group::where('project_id',$task->group->project_id)->findOrFail($request->input('group_id'));\n\n $task->update(request([\n 'name',\n 'group_id',\n 'from_date',\n 'until_date',\n 'description',\n 'order',\n 'done',\n ]));\n\n $task->labels()->detach();\n foreach ($request->input(\"labels\") as $label) {\n $task->labels()->attach($label[\"id\"]);\n }\n\n $users = $request->input(\"users\");\n\n if($users)\n {\n $task->users()->detach();\n foreach ($users as $user)\n {\n $task->users()->attach($user[\"id\"]);\n }\n }\n\n $task->labels = $task->labels;\n $task->users = $task->users;\n return response()->json($task);\n }",
"public function edit(Task $task)\n {\n return view('tasks.edit', compact('task'));\n }",
"public function edit(Task $task)\n {\n return view('tasks.edit', compact('task'));\n }",
"public function task_edit($id)\n\t {\n\t \t$data = array();\n\t\t\n\t\t//Instance the model in which we're using methods\n\t\t$this->load->model('Task_model');\n\t\t\n if ($this->input->post() != false) {\n // validate input on required fields\n\t\t\t$config = array(\n array(\n 'field' => 'duration',\n 'label' => lang('lbl_duration'),\n 'rules' => 'trim|'\n ), array(\n 'field' => 'date_start',\n 'label' => lang('lbl_date_start'),\n 'rules' => 'trim|required'\n ), array(\n 'field' => 'comment',\n 'label' => lang('lbl_comment'),\n 'rules' => 'trim')\n );\n\t\t\t\n //Validate input fields\n $this->load->library('form_validation');\n $this->form_validation->set_rules($config);\n\n if ($this->form_validation->run() == false) {\n $data['notify'] = validation_errors();\n } else {\n // fetch data from form \n $task_data = array(\n 'duration' => $this->input->post('duration'),\n 'date_start' => $this->input->post('date_start'),\n 'comment' => $this->input->post('comment'),\n 'billable' => $this->input->post('billable'), \n\t\t\t\t);\n\t\t\t\t\n if ($this->Task_model->updateTask($id, $task_data) == true) {\n $data['notify'] = lang('msg_update_task_success');\n } else {\n $data['notify'] = lang('msg_update_task_fail');\n }\n }\t\t\t\n }\n\n //Get info of the task\n\t\t$data['task'] = $this->Task_model->getInfo($id);\n \t//Load the associated view\n\t \t$this->load->view('header', $data);\n $this->load->view('nav', $data);\n $this->load->view('task/add', $data);\n $this->load->view('footer', $data);\n\t }",
"public function update(Request $request, $id)\n {\n if(Module::hasAccess(\"Tasks\", \"edit\")) {\n\n $rules = Module::validateRules(\"Tasks\", $request, true);\n\n $validator = Validator::make($request->all(), $rules);\n\n if ($validator->fails()) {\n return redirect()->back()->withErrors($validator)->withInput();;\n }\n\n $params = [\n 'title' => $request->title,\n 'run_time' => $request->run_time,\n \"product_id\" => $request->product_id\n ];\n\n if ($request->work_id == 'exchange') {\n $params['time_point'] = $request->time_point;\n $params['code'] = $request->code;\n $params['prize_number'] = $request->prize_number ?? 1;\n $params['is_wait_sjk'] = $request->is_wait_sjk ?? 0;\n } else if ($request->work_id == 'order') {\n $params['time_point'] = $request->time_point;\n $params['money'] = $request->money ?? 1000;\n $params['voucher_id'] = $request->voucher_id ?? 0;\n $params['is_kdb_pay'] = $request->is_kdb_pay ?? 0;\n $params['is_wait_sjk'] = $request->is_wait_sjk ?? 0;\n $params['order_number'] = $request->order_number ?? 1;\n } else if ($request->work_id == 'transfer') {\n $params['money'] = $request->money ?? 1000;\n } else if ($request->work_id == 'abcGift' || $request->work_id == 'icbcGift') {\n $params['code'] = $request->code;\n $params['time_point'] = $request->time_point;\n $params['is_kdb_pay'] = $request->is_kdb_pay ?? 0;\n }\n\n if (isset($request->status)) {\n $params['status'] = $request->status;\n }\n\n Task::where('id', $id)->update($params);\n\n// Module::updateRow(\"Tasks\", $request, $id);\n\n return redirect()->route(config('laraadmin.adminRoute') . '.tasks.index');\n\n } else {\n return redirect(config('laraadmin.adminRoute').\"/\");\n }\n }",
"public function editTask($entry = null)\n {\n if (User::isGuest())\n {\n $rtrn = Request::getVar('REQUEST_URI', Route::url('index.php?option=' . $this->_option . '&task=' . $this->_task, false, true), 'server');\n App::redirect(\n Route::url('index.php?option=com_users&view=login&return=' . base64_encode($rtrn)),\n Lang::txt('COM_RADIAM_LOGIN_NOTICE'),\n 'warning'\n );\n return;\n }\n\n if (!$this->config->get('access-create-entry')\n && !$this->config->get('access-edit-entry')\n && !$this->config->get('access-manage-entry'))\n {\n App::abort(403, Lang::txt('COM_RADIAM_NOT_AUTH'));\n }\n\n if (!is_object($entry))\n {\n $entry = Entry::oneOrNew(Request::getInt('entry', 0));\n }\n\n if ($entry->isNew())\n {\n $entry->set('allow_comments', 1);\n $entry->set('state', Entry::STATE_PUBLISHED);\n $entry->set('scope', 'site');\n $entry->set('created_by', User::get('id'));\n }\n\n foreach ($this->getErrors() as $error)\n {\n $this->view->setError($error);\n }\n\n $this->view\n ->set('config', $this->config)\n ->set('entry', $entry)\n ->setLayout('edit')\n ->display();\n }",
"public function actionEdit($info){\n \n $infoedit = Task::getInfo($info);\n\n $result = false;\n \n if(isset($_POST['submit'])){\n \n $error = false;\n \n $title = $_POST['title'];\n $tasktext = $_POST['task'];\n \n if(!Task::checkTitle($title)){\n $error_title = \"Enter title for you task!\";\n $error = true;\n }\n \n if(!Task::checkTask($tasktext)){\n $error_task = \"You must write a task!\";\n $error = true;\n }\n \n if($error == false){\n $result = $var = Task::editTask($info, $title, $tasktext);\n } \n }\n \n require_once(ROOT.'/views/task/edit.php');\n return true;\n }",
"public function update($id)\n\t{\n\t\t$task = $this->task->find($id);\n\t\tif (!$task)\n\t\t\treturn $this->error('resource not found', self::NOT_FOUND);\n\n\t\tif (Input::has('title'))\n\t\t\t$task->title = Input::get('title');\n\t\tif (Input::has('description'))\n\t\t\t$task->description = Input::get('description');\n\t\tif (Input::has('status')){\n\t\t\t$rules = array(\n\t\t\t\t'status' => 'in:Open,In Progress,Fixed,Verified',\n\t\t\t);\n\t\t\t$validator = Validator::make(Input::all(), $rules);\n\t\t\tif ($validator->fails())\n\t\t\t\treturn $this->error($validator->messages(), self::BAD_REQUEST);\n\t\t\t$task->status = Input::get('status');\n\t\t}\n\t\t$task->save();\n\t\treturn $this->response($task, self::OK);\n\n\t}",
"public function updated(Task $task)\n {\n broadcast(new Updated($task))->toOthers();\n }",
"public function edit(Request $request, Task $task)\n {\n TaskResource::withoutWrapping();\n TaskCategoryResource::withoutWrapping();\n\n $taskCategories = TaskCategory::where('user_id', $request->user()->id)->where('status', 1)->get();\n\n return Inertia::render('Task/Edit', [\n 'task' => new TaskCategoryResource($task),\n 'taskCategories' => new TaskCategoryResource($taskCategories)\n ]);\n }"
] | [
"0.8051509",
"0.8051509",
"0.8051509",
"0.8051509",
"0.8051509",
"0.8051509",
"0.8051509",
"0.8046078",
"0.80115926",
"0.79953337",
"0.7825352",
"0.77335507",
"0.7406206",
"0.73659635",
"0.7301462",
"0.7221654",
"0.7221654",
"0.7112165",
"0.7081905",
"0.7077656",
"0.7062367",
"0.70094615",
"0.7007226",
"0.69835883",
"0.69834346",
"0.68764865",
"0.68728185",
"0.6848384",
"0.6846239",
"0.6836587",
"0.68305236",
"0.6792969",
"0.67868936",
"0.6774103",
"0.6766064",
"0.67291224",
"0.6694667",
"0.66908216",
"0.6681044",
"0.6674326",
"0.66703874",
"0.6660658",
"0.66599196",
"0.66596526",
"0.6636014",
"0.6635337",
"0.6634767",
"0.6633023",
"0.66063577",
"0.6595506",
"0.6592345",
"0.65693855",
"0.6568523",
"0.65629125",
"0.6555794",
"0.65531456",
"0.65503204",
"0.6507354",
"0.6489393",
"0.648539",
"0.64769644",
"0.6462991",
"0.6461153",
"0.6444342",
"0.64241326",
"0.6418137",
"0.6413249",
"0.64089483",
"0.63582385",
"0.63568854",
"0.63498324",
"0.6349702",
"0.6349174",
"0.6348595",
"0.63325155",
"0.6321273",
"0.6311248",
"0.6306431",
"0.6300604",
"0.6292941",
"0.6287431",
"0.62852407",
"0.62844837",
"0.6278374",
"0.6276829",
"0.6271609",
"0.6265681",
"0.62625545",
"0.6258953",
"0.6250603",
"0.6243024",
"0.62362313",
"0.6232788",
"0.6232788",
"0.6206705",
"0.6190455",
"0.6177747",
"0.616984",
"0.6163836",
"0.6162077",
"0.6152001"
] | 0.0 | -1 |
Deletes a Task entity. | public function deleteAction(Request $request, $id)
{
$em = $this->getDoctrine()->getManager();
$task = $em->getRepository('STMSBundle:Task')->find($id);
if (!$task) {
return new JsonResponse(array(
"result" => "error",
"message" => "No task found for the given ID."));
}
$user = $this->get('security.context')->getToken()->getUser();
if($user != $task->getUser()) {
return new JsonResponse(array(
"result" => "error",
"message" => "You are not authorized to perform this action."));
}
$em->remove($task);
$em->flush();
return new JsonResponse(array("result" => "success"));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete($task);",
"public function deleteById($taskId);",
"public function deleteTaskAction(Task $task)\n {\n // If not found will return 404 exception automatically\n\n $entityManager = $this->getDoctrine()->getManager();\n\n $entityManager->remove($task);\n $entityManager->flush();\n\n // Return success\n return $this->handleView($this->view(\n [\n \"status_code\"=> Response::HTTP_ACCEPTED,\n 'reason_phrase' => 'Successfully deleted',\n ],\n Response::HTTP_ACCEPTED)\n );\n }",
"public function deleteTask(Request $request, Task $task){\n $task->delete();\n return redirect('/tasks');\n }",
"public function delete(){\n $this->delete_from('task');\n }",
"private function deleteTask($task) {\r\n $arr = array(\r\n 'idtask' => $task,\r\n 'iduser' => $this->getUser()->getId(),\r\n );\r\n\r\n dibi::query('DELETE FROM `tasks` WHERE %and', $arr);\r\n }",
"protected function deleteTask() {}",
"public function deleted(Task $task)\n {\n broadcast(new Deleted($task))->toOthers();\n }",
"public function destroy(Task $task)\n {\n return (new CrudService())->delete($task);\n }",
"public function destroy(Task $task)\n {\n //\n }",
"public function deleteTask(Task $task)\n {\n $this->checkIfLoggedIn();\n\n $this->checkIfTaskBelongsToUSer($task);\n\n $task->delete();\n\n return redirect(\"/tasks\");\n }",
"public function destroy(DeleteTaskRequest $request, $id)\n {\n $task = Task::find($id);\n\n if (is_null($task)) {\n throw new ItemNotFoundException($id);\n }\n\n if($task->tracking_history->isNotEmpty()) {\n throw new InvalidDataException([\n 'tracking_history' => $task->tracking_history->toArray()\n ],\n 'Can\\'t delete!, someone work in this task.');\n }\n\n try {\n $task->delete();\n } catch (\\Throwable $th) {\n throw new ItemNotDeletedException('Task');\n }\n\n return $this->sendResponse(new TaskResource($task), 'Task deleted successfully.');\n }",
"public function deleteTask($taskId){\n \n if(is_int($taskId)) {\n $this->db->query(\"DELETE FROM tasks WHERE task_id = :taskid\");\n $this->db->bind(':taskid', $taskId);\n $this->db->execute();\n \n } else {\n throw new \\Exception(\"Task ID must be a number.\");\n }\n \n }",
"public function destroy(Request $request, Task $task)\n {\n $this->authorize('destroy', $task);\n \n $task->delete();\n \n return redirect('/tasks');\n \n }",
"public function destroy(Task $task)\n {\n $task->delete();\n\n return redirect('tasks');\n }",
"public function deleteTask(TaskInterface $task) {\n\n return $this->request('tasks/' . $task->getId(), 'DELETE');\n }",
"public function destroy(Task $task)\n {\n $this->authorize('delete', $task);\n $task->delete();\n\n return response('Task Deleted Successfully');\n }",
"public function destroy(Task $task)\n {\n $this->authorize('forceDelete', $task);\n if ($task->delete()) {\n return response(['message' => 'deleted'], 200);\n }\n return response(['message' => 'delete error'], 400);\n }",
"public function destroy(Task $task, Request $request)\n {\n $user = $request->user();\n $userTask = $user->tasks->find($task->id);\n\n if ($userTask) {\n $userTask->delete();\n }\n }",
"public function destroy(Request $request, Task $task)\n {\n $this->authorize('destroy', $task);\n\n $task->delete();\n\n return redirect('/tasks');\n }",
"public function destroy(Request $request, Task $task)\n {\n $this->authorize('destroy', $task);\n\n $task->delete();\n\n return redirect('/tasks');\n }",
"public function destroy(Request $request, Task $task)\n {\n $this->authorize('destroy', $task);\n\n $task->delete();\n\n return redirect('/tasks');\n }",
"public function destroy(Task $task)\n {\n $task->delete();\n return redirect()->route('dashboard.tasks');\n }",
"public function delete($entity);",
"public function execute(Request $request, Task $task)\n {\n $this->authorize('destroy', $task);\n\n $task->delete();\n\n return redirect('/');\n }",
"public function destroy(Task $task)\n {\n $task->delete();\n return redirect()->route('task.index')->with('success', 'Task deleted successfully.');\n }",
"public function destroy(Task $task)\n {\n $task->delete();\n\n\t\t\t\tevent(new TaskDeleted($task->id));\n\n }",
"public function destroy(Request $request, Task $task)\n {\n\n $this->authorize('destroy', $task);\n\n $task->delete();\n\n notify()->flash(\"$task->title, is now deleted\", 'success', [\n 'timer' => 3000,\n ]);\n\n return redirect('/tasks');\n }",
"public function deleted($task)\n {\n $task->notifyMembers('Deleted');\n }",
"public function delete($entity) {\n $this->deleteRecord([\n 'id' => $entity->getId(),\n ]);\n }",
"public function destroy(Task $task)\n {\n $task->delete();\n\n return redirect()->route('tasks.index');\n }",
"public\n function destroy(\n Task $task\n ) {\n //\n }",
"public function destroy(DeleteTaskRequest $request)\n {\n $task = $this->execute(DeleteTaskCommand::class);\n\n Flash::message('Task has been deleted');\n\n return redirect()->route('assigned.tasks', $attributes = ['username' => $task->assignee->username]);\n }",
"public function testDeleteTask()\n {\n $userId = User::first()->value('id');\n $taskId = Task::orderBy('id', 'desc')->first()->id;\n\n echo '/api/v1.0.0/users/'.$userId.'/tasks/'.$taskId;\n\n $response = $this->json('DELETE', '/api/v1.0.0/users/'.$userId.'/tasks/'.$taskId);\n $response->assertStatus(200);\n }",
"public function deleteTask($task_id){\n $bdd = $this->connectDB();\n\n //delete task\n $req=$bdd->prepare('DELETE FROM task WHERE id=?');\n $req->execute(array($task_id));\n\n $bdd=null;\n\n return true;\n\t}",
"protected function entityDelete(){\n // TODO: deal with errors\n // delete from api\n $deleted = $this->resourceService()->delete($this->getId());\n }",
"public function deleteEntity($entity)\n {\n return $this->model->destroy($entity->id);\n\n }",
"public function destroy(Request $request, Task $task)\n {\n // Set param like => https://laravel-api.local/api/tasks/13?d=hard for hard deletion \n // Set no param like => https://laravel-api.local/api/tasks/13 for soft deletion\n\n // Check if user if authorized to change this record\n if ($task->user_id != $this->user->id) {\n return response()->json([\n 'status' => false,\n 'message' => 'Failure! You are not authorized to delete this task.'\n ]);\n }\n\n // Hard-Deletion\n if ($request->d == 'hard') {\n if ($task->forceDelete()) {\n return response()->json(\n [\n 'status' => true,\n 'task_deleted' => $task,\n 'action' => 'hard deletion'\n ]\n );\n } else {\n return response()->json(\n [\n 'status' => false,\n 'message' => 'Oops, the task could not be deleted.',\n ]\n );\n }\n }\n\n // Soft-Deletion\n if ($task->delete()) {\n return response()->json(\n [\n 'status' => true,\n 'task_deleted' => $task,\n 'action' => 'soft deletion'\n ]\n );\n } else {\n return response()->json(\n [\n 'status' => false,\n 'message' => 'Oops, the task could not be deleted.',\n ]\n );\n }\n\n }",
"public function deleteTask ($taskId) {\r\n\t\t$db = new DB();\r\n\t\t$db->connect();\r\n\t\t\r\n\t\t$taskId = $db->esc($taskId);\r\n\t\t\r\n\t\t$sql = \"UPDATE `task` SET `active`='0' WHERE `id`=\".$taskId;\r\n\t\t$db->query($sql);\r\n\t}",
"public function test_delete_task()\n {\n Project::create([\n 'id' => 1,\n 'name' => 'Project nae', \n 'description' => 'Project description'\n ]);\n Task::create([\n 'id' => 200,\n 'name' => 'Task ndfame', \n 'priority' => 'high', \n 'schedule_date' => '2020-12-12 12:22:00',\n 'project_id' => 200\n ]);\n $response = $this->delete('/task/200');\n $response->assertStatus(302);\n }",
"public function destroy(Task $task)\n {\n $task->delete();\n\n return response()->json(['deleted' => true], 200);\n }",
"public function destroy(Task $task)\n {\n $this->task->destroy($task);\n\n flash()->success(trans('core::core.messages.resource deleted', ['name' => trans('projectmanager::tasks.title.tasks')]));\n\n return redirect()->route('admin.projectmanager.task.index');\n }",
"public function destroy(Task $task)\n {\n \t$task->delete();\n\n \treturn redirect('/');\n }",
"public function delete($id=null) {\n\n $Task = $this->Task->find('first', array(\n 'contain' => array(),\n 'conditions' => array(\n 'Task.id' => $id\n )\n ));\n\n if(empty($Task))\n return $this->redirect('/tasks');\n\n $result = $this->Task->delete($id); \n if($result){\n $this->_setFlash('Task deleted successfully.', 'success');\n $this->redirect('/tasks');\n }\n else {\n $this->_setFlash('Unabled to delete Task.', 'error');\n $this->redirect(\"/tasks/edit/${id}\");\n }\n }",
"public function delete($entity){ \n //TODO: Implement remove record.\n }",
"public function delete(Request $request, Task $task)\n {\n $task->delete();\n\n // Return an empty collection.\n return response()->json(['status' => 'success', 'message' => 'Resource Deleted', 'payload' => []], 204);\n }",
"public function destroy(Task $task)\n {\n if ($task->user_id !== Auth::user()->id) {\n return \"You are not authorized\";\n } else {\n $pid = $task->project_id;\n $task->delete();\n\n return redirect(route('projects.show', $pid))->with('status', 'Task deleted successfully!');\n }\n }",
"public function destroy(Request $request, Task $task)\n {\n if ($request->ajax()) {\n\n DB::beginTransaction();\n try {\n $task->delete();\n DB::commit();\n } catch (\\Exception $ex) {\n dd($ex);\n DB::rollBack();\n return response()->json(['message' => 'Sorry ! Error occurred during the transaction.'], 500);\n }\n\n return response()->json([\"message\" => \"Task deleted successfully !\"], 200);\n }\n }",
"public function destroy(Task $task)\n {\n try\n\t\t{\n $task = Task::find($task->id);\n $task->delete();\n\n return response()->json(['message' => 'Tarefa deletada com sucesso.'], 201);\n\t\t}\n\t\tcatch (\\Exception $e)\n\t\t{\n if(config('app.debug'))\n {\n \t\t\treturn response()->json($e->getMessage(), 400);\n \t\t}\n\t\t\treturn response()->json('Houve um erro ao deletar a tarefa.', 400);\n\t\t}\n }",
"public function destroy(Task $task)\n {\n $task->delete();\n\n return Redirect::back()->with('success', 'Task deleted successfully.');\n }",
"public static function delete($entity)\n {\n return static::mapper()->delete($entity);\n }",
"public function delete(DimeEntityInterface $entity);",
"public function destroy($task)\n {\n try {\n Task::findOrFail($task)->delete();\n return response()->json(\"Task deleted\");\n }\n catch (\\Exception $ex){\n return response()->json(\"Error\");\n }\n }",
"public function deleteTask(){\n //checks to see if the request method is a post\n if($_SERVER['REQUEST_METHOD'] == 'POST'){\n\n //Sanitize POST data\n $_POST = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n //Grabs and trims the delete Id\n $taskId = trim($_POST['deleteId']);\n //Deletes the task\n if($this->taskHistoryModel->deleteTask($taskId)){\n\n if($_SESSION['current_page'] == \"TaskHistory\"){\n redirect('TaskHistoryController/taskHistory');\n\n }elseif($_SESSION['current_page'] == \"IndividualProject\"){\n $link = 'IndividualProjectController/individualProject?projectId='. $_SESSION['current_project'];\n\n redirect($link);\n\n }else{\n $link = 'IndividualGroupController/individualGroup?groupId='. $_SESSION['current_group'];\n\n redirect($link);\n }\n\n \n \n }else{\n //For testing\n die('something went wrong');\n }\n\n }else{\n //redirects\n redirect('TaskHistoryController/taskHistory');\n }\n\n \n }",
"public function deleteWithTasks() {\n \t$this->tasks()->delete();\n \t$this->delete();\n }",
"public function delete()\n {\n $user = new Task();\n $attributes = $this->request->body();\n\n if( $user->setAttributes($attributes)->delete() ) {\n // return ['status' => 'success']; // for ajax\n header(\"Location: /task/index\");\n exit;\n }\n\n return ['status' => 'cannot delete'];\n }",
"public function delete($entity)\n {\n $this->getObjectManager()->remove($entity);\n $this->getObjectManager()->flush();\n }",
"function delete_by_task($task_id)\n {\n return $this->db->delete('rel_tasks_project',array('task_id'=>$task_id));\n }",
"public function destroy(Task $task)\n {\n //Admin allow only \n abort_if(Gate::denies('user_access'), Response::HTTP_FORBIDDEN, '403 Forbidden');\n\n $task->delete();\n\n return back();\n }",
"public function destroy(DeleteRequest $request, Task $task)\n {\n if ($task->id == $request->get('task_id')) {\n $task->delete();\n flash(__('task.deleted'), 'success');\n } else {\n flash(__('task.undeleted'), 'danger');\n }\n\n return redirect()->route('jobs.show', $task->job_id);\n }",
"public function destroy(Task $task)\n {\n if($task != null)\n {\n $task->delete();\n }\n return redirect()->route('subject.tasks.list',[ 'subject' => $task->subject]);\n }",
"public function delete($entity)\n {\n \n }",
"public function delete($entity) : bool;",
"public function deleteTask($TaskID)\n {\n $data=task::find($TaskID);\n $data->delete();\n return redirect('View-Task')->with('success','Task Deleted Successfully');\n }",
"public function removeTask()\n\t{\n\t\t// Check for request forgeries\n\t\tRequest::checkToken(['get', 'post']);\n\n\t\t// Incoming\n\t\t$ids = Request::getArray('id', array());\n\n\t\tif (count($ids) > 0)\n\t\t{\n\t\t\t// Loop through each ID\n\t\t\tforeach ($ids as $id)\n\t\t\t{\n\t\t\t\t$row = new Middleware\\Location(intval($id));\n\n\t\t\t\tif (!$row->delete())\n\t\t\t\t{\n\t\t\t\t\tthrow new \\Exception($row->getError(), 500);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tApp::redirect(\n\t\t\tRoute::url('index.php?option=' . $this->_option . '&controller=' . $this->_controller, false),\n\t\t\tLang::txt('COM_TOOLS_ITEM_DELETED'),\n\t\t\t'message'\n\t\t);\n\t}",
"public function destroy(Task $task)\n {\n if ($task->delete()) {\n return response()->json([\n 'success' => true,\n 'message' => \"Task has been delated with success\"\n ], 200);\n }\n\n }",
"public function deleteById($entityId);",
"public function deleteById($entityId);",
"public function destroy(Request $request, int $idTask)\n {\n $this->getUser()->hasPermission(['delete'], 'auto_tasks');\n\n if ($idTask !== 0) {\n $task = new AutoTask();\n $task->setConnection($this->getUser()->getRole->name);\n $task = $task->findOrFail($idTask);\n\n if ($task->delete()) {\n return redirect()->route('autotasks.index')->with('success', 'Auto task successfully deleted');\n } else {\n return back()->with('errors', 'An error occurred while deleting the task');\n }\n } else {\n $tasksToDelete = $request->input('list');\n $result = true;\n\n foreach ($tasksToDelete as $key => $taskId) {\n $task = new AutoTask();\n $task->setConnection($this->getUser()->getRole->name);\n $task = $task->findOrFail($taskId);\n\n if ($task->delete()) {\n continue;\n } else {\n $result = false;\n break;\n }\n }\n\n if ($result) {\n $request->session()->flash('success', 'The selected tasks were successfully deleted');\n } else {\n $request->session()->flash('errors', 'An error occurred while deleting the selected tasks');\n }\n\n return 'autotasks';\n }\n }",
"public function destroy($task)\n {\n $task_to_be_deleted = Task::findOrFail($task);\n $task_to_be_deleted->delete();\n return response()->json([\n 'message' => 'task deleted successfully'\n ], 410);\n }",
"public function destroy(Task $task)\n {\n return response()->json([\n 'success' => (int) $task->delete(),\n ]);\n }",
"public function deleted(TaskComment $taskComment)\n {\n $taskComment->creator;\n $taskComment->updater;\n\n $ticket_id = null;\n if ($taskComment->task->ticket) {\n $ticket_id = $taskComment->task->ticket->id;\n }\n\n $this->activityLog->addToLog('Delete Comment on Task: '.$taskComment->task->name, null, $taskComment->task->project->id, $ticket_id, $taskComment->task->id);\n }",
"public function destroy($task)\n {\n Task::destroy($task);\n Session::flash('alert-success', 'Se ha Eliminado la tarea con éxito');\n return redirect()->route('task_index_path');\n }",
"public function destroy(Task $task)\n {\n Task::where('id', $task->id)->delete();\n return response()->json([], 200);\n }",
"public function destroy(Task $task)\n {\n $task->delete();\n\n return back();\n }",
"public function destroy(Task $task)\n {\n $task->delete();\n\n return response()->json('Destroyed', 200);\n }",
"public function delete($entity)\n {\n $this->getEventDispatcher()->dispatch(\n TrackingHistoryEvents::PRE_DELETE,\n new TrackingHistoryEvent($entity)\n );\n\n parent::delete($entity);\n\n $this->getEventDispatcher()->dispatch(\n TrackingHistoryEvents::POST_DELETE,\n new TrackingHistoryEvent($entity)\n );\n }",
"public function destroy(Task $task)\n {\n $task->forceDelete();\n\n return back();\n }",
"public function delete($entity) {\r\n\t\tif($entity instanceof Model_Abstract) {\r\n\t\t\t$id = $entity->getIdentityValue();\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$id = $entity;\r\n\t\t}\r\n\t\t// Need to unset the entity in the identity map if it exists\r\n\t\t$this->_unsetIdentity($id);\r\n\t\t \r\n\t\t$rowset = $this->_getGateway()->find($id);\r\n\t\tif($rowset->count() > 0) {\r\n\t\t\t$row = $rowset->current();\r\n\t\t\t$result = $row->delete();\r\n\t\t}\r\n\t}",
"public function destroy(Request $request, Group $group, Task $task)\n {\n $this->authorize('change', $task);\n\n $task->delete();\n\n return redirect()->back()->withSuccess('Task deleted successfully');\n }",
"public function delete(PhpORM_Entity $entity)\n {\n $table = $this->getTable();\n return $table->delete($table->getAdapter()->quoteInto('id = ?',$entity->id));\n }",
"function deleteTaskByID($id){\r\n return $this->exec( 'DELETE FROM Task WHERE \"ID\"='.$id.';');\r\n }",
"public function deleteTask()\n {\n if (User::isGuest())\n {\n $rtrn = Request::getVar('REQUEST_URI', Route::url('index.php?option=' . $this->_option, false, true), 'server');\n App::redirect(\n Route::url('index.php?option=com_users&view=login&return=' . base64_encode($rtrn)),\n Lang::txt('COM_RADIAM_LOGIN_NOTICE'),\n 'warning'\n );\n return;\n }\n\n if (!$this->config->get('access-delete-entry')\n && !$this->config->get('access-manage-entry'))\n {\n App::abort(403, Lang::txt('COM_RADIAM_NOT_AUTH'));\n }\n\n // Incoming\n $id = Request::getInt('entry', 0);\n\n if (!$id)\n {\n return $this->displayTask();\n }\n\n $process = Request::getVar('process', '');\n $confirmdel = Request::getVar('confirmdel', '');\n\n // Initiate a blog entry object\n $entry = Entry::oneOrFail($id);\n\n // Did they confirm delete?\n if (!$process || !$confirmdel)\n {\n if ($process && !$confirmdel)\n {\n $this->setError(Lang::txt('COM_RADIAM_ERROR_CONFIRM_DELETION'));\n }\n\n foreach ($this->getErrors() as $error)\n {\n $this->view->setError($error);\n }\n\n $this->view\n ->set('config', $this->config)\n ->set('entry', $entry)\n ->display();\n return;\n }\n\n // Check for request forgeries\n Request::checkToken();\n\n // Delete the entry itself\n $entry->set('state', 2);\n\n if (!$entry->save())\n {\n Notify::error($entry->getError());\n }\n\n // Log the activity\n Event::trigger('system.logActivity', [\n 'activity' => [\n 'action' => 'deleted',\n 'scope' => 'radiam.entry',\n 'scope_id' => $id,\n 'description' => Lang::txt('COM_RADIAM_ACTIVITY_ENTRY_DELETED', '<a href=\"' . Route::url($entry->link()) . '\">' . $entry->get('title') . '</a>'),\n 'details' => array(\n 'title' => $entry->get('title'),\n 'url' => Route::url($entry->link())\n )\n ],\n 'recipients' => [\n $entry->get('created_by')\n ]\n ]);\n\n // Return the entries lsit\n App::redirect(\n Route::url('index.php?option=' . $this->_option)\n );\n }",
"public function destroy(Task $task)\n {\n\n if($task->user_id != auth()->id()){\n return response()->json(['message'=>'You Don\\'n own this task!'], '401');\n }\n\n if($task->delete()){\n return response()->json(['message'=>'task successfully Deleted!']);\n }\n\n return response()->json(['message'=>'Please Try later!'], 500);\n\n }",
"public function delete($entity)\n {\n $statement = \"DELETE FROM contact WHERE id = :id\";\n $prepare = $this->db->prepare($statement);\n $prepare->bindValue(\":id\", $entity->getId());\n $prepare->execute();\n }",
"public function Delete($entity) {\n }",
"public function deleteTask($id)\r\n\t{\r\n\t\t$sql = sprintf('\r\n\t\t\tDELETE\r\n\t\t\tFROM\r\n\t\t\t\ttask\r\n\t\t\tWHERE\r\n\t\t\t\tid = %d\r\n\t\t', $id);\r\n\r\n\t\tmysqli_query($this->db, $sql);\r\n\t}",
"public function delete($id){\n\n $task = Task::find($id);\n\n $task->delete();\n\n return redirect()->back();\n }",
"public function delete(string $entityId): void;",
"public function delete(Request $request)\n {\n $task = Task::find($request->idTask);\n $task->delete();\n\n return redirect()->route('todo', ['id' => $request->fkTodo]);\n }",
"public function delete(IndexableEntity $entity);",
"function delete(IContract $entity);",
"public function delete($entity)\n {\n if (!$this->isRepositoryDeletable()) {\n throw $this->createNotDeletableException();\n }\n\n return $this->trigger(__FUNCTION__, [\n 'entity' => $entity,\n ]);\n }",
"public function delete($id){\n\t\t$sql = 'DELETE FROM tbl_task WHERE id = ?';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\t$sqlQuery->setNumber($id);\n\t\treturn $this->executeUpdate($sqlQuery);\n\t}",
"public function destroy(ProjectTaskDestroyRequest $request, Project $project, ProjectTask $task)\n {\n $this->authorize('destroy', $task, $project);\n $task->delete();\n return redirect('/employer/project/'.$project->uuid.'/task')\n ->with('success', 'Task has been deleted');\n }",
"public function forceDelete($taskId){\n\n $task = Task::withTrashed()->findOrFail($taskId);\n\n if(Auth::id() != $task->user_id){\n return response()->json(['message'=>'You Don\\'n own this task!'], '401');\n }\n\n if ($task->forceDelete()){\n Storage::deleteDirectory('public/tasks/'.$task->id);\n\n $userEmail = $task->user->email;\n $taskTitle = $task->title;\n\n Mail::send([],[], function ($message) use ($task, $userEmail, $taskTitle){\n $message->subject('Task was deleted!');\n $message->to($userEmail);\n $message->setBody('<h4>Task Title: '. $taskTitle . '</h4><p>This Task was deleted!</p>', 'text/html');\n });\n\n return response()->json(['message'=>'Resource force-deleted successfully!']);\n }\n\n return response()->json(['message'=>'Please Try later!'], 500);\n }",
"function time_tracker_activity_delete($entity) {\n entity_get_controller('time_tracker_activity')->delete($entity);\n}",
"public function delete(EntityInterface $Entity);",
"public function deleteEntity()\n {\n $listId = [];\n while ($bunch = $this->_dataSourceModel->getNextBunch()) {\n foreach ($bunch as $rowNum => $rowData) {\n $this->validateRow($rowData, $rowNum);\n if (!$this->getErrorAggregator()->isRowInvalid($rowNum)) {\n $rowId = $rowData[self::TASK_ID];\n $listId[] = $rowId;\n }\n if ($this->getErrorAggregator()->hasToBeTerminated()) {\n $this->getErrorAggregator()->addRowToSkip($rowNum);\n }\n }\n }\n\n if ($listId) {\n $this->deleteEntityFinish(array_unique($listId), self::TABLE_ENTITY);\n }\n\n return $this;\n }",
"public function taskDelete(): void\n {\n $directory = $this->getDirectory();\n if (!$directory) {\n throw new RuntimeException('Not Found', 404);\n }\n\n $object = null;\n try {\n $object = $this->getObject();\n if ($object && $object->exists()) {\n $authorized = $object instanceof FlexAuthorizeInterface\n ? $object->isAuthorized('delete', 'admin', $this->user)\n : $directory->isAuthorized('delete', 'admin', $this->user);\n\n if (!$authorized) {\n throw new RuntimeException($this->admin::translate('PLUGIN_ADMIN.INSUFFICIENT_PERMISSIONS_FOR_TASK') . ' delete.', 403);\n }\n\n $object->delete();\n\n $this->admin->setMessage($this->admin::translate('PLUGIN_FLEX_OBJECTS.CONTROLLER.TASK_DELETE_SUCCESS'));\n if ($this->currentRoute->withoutGravParams()->getRoute() === $this->referrerRoute->getRoute()) {\n $redirect = dirname($this->currentRoute->withoutGravParams()->toString(true));\n } else {\n $redirect = $this->referrerRoute->toString(true);\n }\n\n $this->setRedirect($redirect);\n\n $this->grav->fireEvent('onFlexAfterDelete', new Event(['type' => 'flex', 'object' => $object]));\n }\n } catch (RuntimeException $e) {\n $this->admin->setMessage($this->admin::translate(['PLUGIN_FLEX_OBJECTS.CONTROLLER.TASK_DELETE_FAILURE', $e->getMessage()]), 'error');\n\n $this->setRedirect($this->referrerRoute->toString(true), 302);\n }\n }",
"public function deleteEntity($entity): void\n {\n /** @var EntityRepository $repository */\n $repository = Prime::repository($entity);\n $mapper = $repository->mapper();\n\n $isReadOnly = $mapper->isReadOnly();\n $mapper->setReadOnly(false);\n\n $repository->disableEventNotifier();\n $repository->delete($entity);\n $repository->enableEventNotifier();\n\n $mapper->setReadOnly($isReadOnly);\n }"
] | [
"0.77664924",
"0.7688035",
"0.75470996",
"0.7385555",
"0.73668087",
"0.72874135",
"0.7219806",
"0.719944",
"0.70611995",
"0.69736665",
"0.6969099",
"0.69644713",
"0.6935417",
"0.693109",
"0.6908545",
"0.690113",
"0.6867672",
"0.6862067",
"0.68427396",
"0.68416846",
"0.68416846",
"0.68416846",
"0.68176985",
"0.6778198",
"0.67742324",
"0.67693555",
"0.6759724",
"0.6757746",
"0.6749562",
"0.66934735",
"0.6656702",
"0.6641369",
"0.6618506",
"0.6597227",
"0.6591508",
"0.65816635",
"0.6565774",
"0.65633535",
"0.6546929",
"0.65407276",
"0.6523719",
"0.65208584",
"0.6517174",
"0.6512955",
"0.65110964",
"0.6501805",
"0.6493303",
"0.6492113",
"0.64885956",
"0.64781845",
"0.6476059",
"0.6455718",
"0.64459705",
"0.6437907",
"0.64304376",
"0.64226145",
"0.6420763",
"0.6419379",
"0.64164174",
"0.6411758",
"0.6393867",
"0.63845",
"0.63806707",
"0.6365341",
"0.6362384",
"0.63597304",
"0.63546205",
"0.63546205",
"0.63511324",
"0.63488126",
"0.6340757",
"0.6337642",
"0.63281363",
"0.6312942",
"0.6304694",
"0.6300238",
"0.62914443",
"0.62886065",
"0.62460697",
"0.62457025",
"0.6243999",
"0.62411106",
"0.62356114",
"0.6225112",
"0.62165636",
"0.61880416",
"0.6182711",
"0.6174797",
"0.61716616",
"0.6167028",
"0.61585885",
"0.6152652",
"0.6120415",
"0.6117568",
"0.60724086",
"0.6071489",
"0.60596895",
"0.60580534",
"0.6054922",
"0.6046124",
"0.60427624"
] | 0.0 | -1 |
Creates a form to create a Task entity. | private function createAddForm(Task $entity)
{
$form = $this->createForm(new TaskType(), $entity, array(
'action' => $this->generateUrl('task_add'),
'method' => 'POST',
));
return $form;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function createCreateForm(Task $entity)\n {\n //$form = $this->createForm(new TaskType(), $entity, array( \n //pero para Symfony3.4.15 ahora es:\n $form = $this->createForm(TaskType::class, $entity, array( \n 'action' => $this->generateUrl('infunisa_task_create'),\n 'method' => 'POST'\n ));\n \n return $form;\n }",
"public function show_create_form_task()\n {\n $user = factory(User::class)->create();\n $user->assignRole('task-manager');\n $this->actingAs($user);\n View::share('user', $user);\n\n factory(User::class, 5)->create();\n\n $response = $this->get('/tasks_php/create');\n $response->assertSuccessful();\n $response->assertViewIs('tasks.create_task');\n\n $users = User::all();\n $response->assertViewHas('users', $users);\n\n $response->assertSeeText('Create Task:');\n }",
"public function createTask()\n\t{\n\t\tif ( $this->taskValidate() ) {\n\t\t\tTask::create([\n\t\t\t\t\t'name' => htmlspecialchars($_POST['inputTaskName']),\n\t\t\t\t\t'email' => htmlspecialchars($_POST['inputTaskMail']),\n\t\t\t\t\t'text' => htmlspecialchars($_POST['inputTaskText'])\n\t\t\t\t]);\n\t\t}\n\t\t// to index\n\t\t\theader('Location: /');\n\t}",
"private function createCreateForm(UserToTask $entity)\n {\n $form = $this->createForm(new UserToTaskType(), $entity, array(\n 'action' => $this->generateUrl('usertotask_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }",
"public function create(TaskFormBuilder $form)\n {\n return $form->render();\n }",
"public function create()\n {\n return view('tasks.form_Create');\n }",
"public function create() // create task page\n {\n\n // tasks form\n\n return view('todo.create');\n }",
"public function createComponentAddTaskForm() {\r\n $form = new UI\\Form;\r\n\r\n $form->getElementPrototype()->novalidate = 'novalidate';\r\n\r\n $form->addText('name', 'Task name:')\r\n ->setRequired('Please provide a task name.');\r\n\r\n $form->addTextArea('description', 'Description:');\r\n\r\n $form->addText('date', 'Deadline')->setOption('description', 'Use format: YYYY-MM-DD')\r\n ->addCondition(UI\\Form::FILLED)\r\n ->addRule(UI\\Form::PATTERN, 'Může být v rozmezí 2011-01-01 až 2019-12-31', '^(20)\\d\\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$');\r\n\r\n\r\n\r\n $form->addRadioList('priority', 'Priority', array(\r\n '1' => '1',\r\n '2' => '2',\r\n '3' => '3',\r\n ));\r\n\r\n $result = dibi::query('SELECT idcategory, name FROM `categories` WHERE iduser = %i', $this->getUser()->getId())->fetchPairs('idcategory', 'name');\r\n\r\n $form->addRadioList('category', 'Category', $result)\r\n ->setRequired('Please select category.')\r\n ->setDefaultValue($this->getParam('id'));\r\n\r\n $form->addSubmit('addtask', 'Add Task');\r\n\r\n $form->onSuccess[] = callback($this, 'AddTaskFormSubmitted');\r\n return $form;\r\n }",
"public function addTaskForm()\n {\n $this->checkIfLoggedIn();\n\n return view('new-task', [\n 'titlePart' => '| Add a task',\n 'user' => session()->get('user')\n ]);\n }",
"public function create()\n {\n return view('task.add-task');\n }",
"public function create()\n {\n return view(('tasks.create'));\n }",
"public function create()\n {\n //Declaration of vars in order to use the same form template\n $task = new Task;\n $title = \"Nueva Tarea\";\n $txtButton = \"Agregar\";\n $route = route('tasks.store');\n $users = User::all();\n return view('tasks.create', compact('task','title','txtButton','route','users'));\n }",
"public function create()\n {\n $cases = Casee::all();\n $users = User::all();\n $stages = Stage::all();\n\n return $this->view_('task.update',[\n 'object'=> new Task(),\n 'cases'=> $cases,\n 'users'=> $users,\n 'stages'=> $stages,\n ]);\n }",
"public function createAction(Request $request)\n {\n $task = new Task(); \n $form = $this->createCreateForm($task);\n $form->handleRequest($request);\n \n if($form->isValid())\n {\n //esto para que nuestras tareas no sean procedas por el momento o inicialmente, por eso lo establecemos a cero. Cuando el ususario en la GUI finalice una tarea entonces dentro de la BD a ese campo se fija 1, que indica que la tarea está completada:\n $task->setStatus(0);\n $em = $this->getDoctrine()->getManager();\n $em->persist($task);\n $em->flush(); //para la persistencia de los datos\n \n //así era antes de aplicar la traducción\n //$this->addFlash('mensaje', 'The task has been created.');\n \n //y con aplicar traducción es:\n $successMessage = $this->get('translator')->trans('The task has been created.');\n $this->addFlash('mensaje', $successMessage);\n \n return $this->redirectToRoute('infunisa_task_index'); \n }\n \n return $this->render('INFUNISAUserBundle:Task:add.html.twig', array('form' => $form->createView()));\n }",
"public function create()\n {\n $project_id = request()->get('project_id');\n $project_members = ProjectMember::projectMembersDropdown($project_id);\n $priorities = ProjectTask::prioritiesDropdown();\n $statuses = ProjectTask::taskStatuses();\n\n return view('project::task.create')\n ->with(compact('project_members', 'priorities', 'project_id', 'statuses'));\n }",
"public function create()\n {\n return view('task-create');\n }",
"protected function createComponentEditTaskForm() {\r\n\r\n $form = new UI\\Form;\r\n\r\n $form->getElementPrototype()->novalidate = 'novalidate';\r\n\r\n $form->addText('name', 'Task name:')\r\n ->setRequired('Please provide a task name.');\r\n\r\n $form->addTextArea('description', 'Description:');\r\n\r\n $form->addText('deadline', 'Deadline')->setOption('description', 'Use format: YYYY-MM-DD')\r\n ->addCondition(UI\\Form::FILLED)\r\n ->addRule(UI\\Form::PATTERN, 'Může být v rozmezí 2011-01-01 až 2019-12-31', '^(20)\\d\\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$');\r\n\r\n $form->addRadioList('priority', 'Priority', array(\r\n '1' => '1',\r\n '2' => '2',\r\n '3' => '3',\r\n '0' => 'bez priority'\r\n ));\r\n\r\n $result = dibi::query('SELECT idcategory, name FROM `categories` WHERE iduser = %i', $this->getUser()->getId())->fetchPairs('idcategory', 'name');\r\n\r\n $form->addRadioList('idcategory', 'Category', $result)\r\n ->setRequired('Please select category.');\r\n\r\n $status = array(\r\n 'nedokončeno' => 'nedokončeno',\r\n 'odloženo' => 'odloženo',\r\n 'dokončeno' => 'dokončeno',\r\n );\r\n $form->addRadioList('status', 'Status', $status)\r\n ->setRequired('Please select status.');\r\n\r\n $form->addHidden('idtask');\r\n\r\n $form->addSubmit('editTask', 'Edit Task');\r\n\r\n $form->onSuccess[] = callback($this, 'EditTaskFormSubmitted');\r\n\r\n $task = dibi::query('SELECT * FROM `tasks` WHERE idtask = %i', $this->getParam('id'))->fetch();\r\n\r\n if ($task->deadline == \"0000-00-00\")\r\n $task->deadline = \"\";\r\n\r\n $form->setDefaults(array(\r\n 'name' => $task->name,\r\n 'description' => $task->description,\r\n 'deadline' => $task->deadline,\r\n 'status' => $task->status,\r\n 'priority' => $task->priority,\r\n 'idcategory' => $task->idcategory,\r\n 'idtask' => $task->idtask,\r\n ));\r\n\r\n return $form;\r\n }",
"public function create()\n {\n return view('projectmanager::admin.tasks.create');\n }",
"public function create()\n {\n return view('tasks.create');\n }",
"public function create()\n {\n return view('tasks.create');\n }",
"public function create()\n {\n return view('tasks.create');\n }",
"public function create()\n {\n return view('createTasks');\n }",
"public function getCreationFormTemplate()\n {\n return 'GithubFrontend:task/creation';\n }",
"public function create(Task $task)\n {\n return view('task.create', ['task' => $task]);\n }",
"public function actionCreate()\n\t{\n\n\t\t$model=new Templetstandardtask;\n\t\tif(isset($_POST['Templetstandardtask']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Templetstandardtask'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->fTaskNo));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function create()\n {\n return view('task');\n }",
"public function create()\n {\n return view('WorkFlow.WorkTask.add');\n }",
"public function create()\n {\n $task_types = TaskType::all();\n return view('partner/task/task-create', compact('task_types'));\n }",
"public function create()\n {\n return view('task::create');\n }",
"public function create()\n {\n return view('employee_task.create');\n }",
"private function createEditForm(Task $entity) //recibiendo nuestra entidad de tarea\n {\n //$form = $this->createForm(new TaskType, $entity, array( \n //pero para Symfony3.4.15 ahora es: \n $form = $this->createForm(TaskType::class, $entity, array(\n 'action' => $this->generateUrl('infunisa_task_update', array('id' => $entity->getId())),\n 'method' => 'PUT' //como estamos editando la tarea usamos PUT\n ));\n \n return $form;\n }",
"public function store(TaskFormRequest $request)\n {\n $data = [\n 'task_title'=>$request->get('task_title'),\n 'project_id'=>$request->get('project_id'),\n 'content_start_id' =>$request->get('content_start'),\n 'description' =>$request->get('description') \n ];\n\n $task = $this->tasks->create($data);\n\n if($task){\n $users = null;\n }\n }",
"public function create() : bool\n {\n if( ! User::isLoggedIn()) {\n header(\"Location: /user/login\");\n }\n\n $model = new Task();\n $attributes = $this->request->body();\n $user_id = User::getLoggedInUserId();\n $attributes['user_id'] = $user_id;\n\n if($this->request->isPost() && $model->setAttributes($attributes)->validate() && $model->create() ) {\n\n header(\"Location: /task/index\");\n exit;\n }\n\n return $this->render('create', $model);\n }",
"public function create()\n {\n return view('web.pages.new_tasks')\n ->with('projects',Project::all());\n }",
"public function actionCreate()\n {\n $model = new CompleteTask();\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(): void {\n\t\t$rawdata = array(\n\t\t\t'datetime' => $this->request->request->get('datetime', null),\n\t\t\t'priority' => $this->request->request->getInt('priority', 1),\n\t\t\t'description' => $this->request->request->get('description'),\n\t\t);\n\n\t\t$rawdata['datetime'] ??= new DateTime();\n\n\t\tif ($rawdata['description'] !== '') {\n\t\t\tpreg_match('/^(.+?) ?(?:\\\\[(\\\\d+)\\\\]|)$/', strip_tags($rawdata['description'] ?? ''), $matches);\n\t\t\t$rawdata['description'] = $matches[1];\n\t\t}\n\n\t\t$data = array(\n\t\t\t'name' => $rawdata['description'],\n\t\t\t'donereward' => $matches[2] ?? 0,\n\t\t\t'priority' => $rawdata['priority'],\n\t\t\t'duedate' => $rawdata['datetime'],\n\t\t\t'user' => $this->user\n\t\t);\n\n\t\t$task = $this->di_repo->new(TaskModel::class, $data);\n\n\t\tif (($validResult = $task->valid()) === true) {\n\t\t\tif (!$task->save()) {\n\t\t\t\tthrow new RuntimeException('Could not save new task valid?:'.var_export($task->valid(), true));\n\t\t\t}\n\n\t\t\t$this->view->set('errors', false);\n\t\t} else {\n\t\t\t$this->view->set('errors', $validResult->getAll());\n\t\t}\n\n\t\t$this->respondTo('json');\n\t}",
"protected function form()\n {\n $form = new Form(new Task);\n\n $form->text('eid', 'Eid');\n $form->text('store', 'Store');\n $form->text('etype', 'Etype');\n $form->text('uid', 'Uid');\n $form->text('uname', 'Uname');\n $form->text('qq', 'Qq');\n $form->number('qtype', 'Qtype');\n $form->number('times', 'Times')->default(1);\n $form->textarea('content', 'Content');\n $form->text('deadline', 'Deadline');\n $form->file('file', 'File');\n $form->number('isok', 'Isok');\n $form->number('istag', 'Istag');\n $form->text('sid', 'Sid');\n $form->text('sname', 'Sname');\n $form->text('score', 'Score');\n\n return $form;\n }",
"public function create()\n {\n $this->getUser()->hasPermission(['insert'], 'auto_tasks');\n\n return view('autotasks.create');\n }",
"public function create()\n {\n // Get all projects\n $projects = Project::all();\n $data['projects'] = $projects;\n\n // Get all projects\n $teams = Team::all();\n $data['teams'] = $teams;\n\n // Return the task view.\n return view('task.create')->with('data', $data);\n }",
"public function CreateTask()\n {\n\n $data = $this->GetParamsFromRequestBody('create');\n\n if (!isset($data['status'])) {\n $data['status'] = \"open\";\n }\n\n $data['createdby'] = $this->loggedUser->getId();\n\n $this->insertArrayIntoDatabase('todo_task', $data);\n $id = mysql_insert_id();\n\n $this->response = array(\n \"status\" => 0,\n \"id\" => $id\n );\n $this->responseStatus = 201;\n }",
"public function newAction()\n {\n $entity = new UserToTask();\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }",
"public function create()\n {\n if (! Gate::allows('tasks_manage')) {\n return abort(401);\n// return response('Permission Denied.', 403);\n }\n\n $projects = Project::select('id', 'name')->get();\n $users = User::select('id', 'name')->get();\n\n return view('admin.tasks.create', compact('projects', 'users'));\n }",
"public function create()\n {\n //selectProject\n $users = $this->users->selectUser();\n $project = $this->projects->selectProject();\n return view('tasks.create',compact('project','users'));\n }",
"public function testCreateTask()\n {\n $this->logInUserObject();\n $crawler = $this->client->request('GET', '/tasks/create');\n $form = $crawler->selectButton('Ajouter')->form();\n $form['task[title]'] = 'Titre test';\n $form['task[content]'] = 'Contenu de test pour la création d\\'une tâche';\n $this->task = $this->client->submit($form);\n\n $crawler = $this->client->followRedirect();\n $response = $this->client->getResponse();\n $statusCode = $response->getStatusCode();\n\n $this->assertEquals(200, $statusCode);\n $this->assertContains('Superbe! La tâche a été bien été ajoutée.', $crawler->filter('div.alert.alert-success')->text());\n }",
"public function create(Request $request){\n $tache = new Tache();\n $form = $this->createForm(TaskType::class, $tache); \n $form->handleRequest($request); \n if($form->isSubmitted() && $form->isValid()){\n $manager= $this->getDoctrine()->getManager();\n $manager->persist($tache);\n $manager->flush();\n //POUR CREER LES MSG POUR LA CONFIRAMTION DE CREATION DU FORM\n //POUR LA REDIRECTION VERSL'ANNONCE CRéER\n $this->addFlash(\n 'success',\n \"l'annonce <strong>{$tache->getTitre()}</strong> a bien étais enregistrée !\"\n\n );\n //POUR LA REDIRECTION VERSL'ANNONCE CRéER\n return $this->redirectToRoute('task_show',[\n 'slug' => $tache->getSlug()\n ]);\n\n }\n \n\n\n\n return $this->render('tasks/newtask.html.twig',[\n 'form' => $form->createView()\n ]);\n}",
"public function createAction()\n {\n// $this->view->form = $form;\n }",
"private function createCreateForm(Todoitems $entity)\n {\n \n $form = $this->createForm(new TodoitemsType(), $entity, array(\n 'action' => $this->generateUrl('todoitems_create'),\n 'method' => 'POST',\n 'id' => $this->getUser()->getId()\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }",
"public function create() // метод для создания\n {\n\n return view('project.create',\n [\n \"tasks\" => $this->tasks->all()\n ]\n );\n }",
"public function create()\n {\n //\n return view('tasks.write');\n }",
"public function create(TodomFormBuilder $form)\n {\n $this->breadcrumbs->add('Home', '/');\n $this->breadcrumbs->add('Todoms', 'todoms');\n\n $this->template->set('meta_title', 'Add Todo');\n\n $form->skipField('owner');\n\n $form->setOption('redirect', 'todoms');\n\n return $form->render();\n }",
"public function create()\n\t{\n\t\treturn View::make('roletasks.create');\n\t}",
"public function create()\n {\n return view(\"thread.form\");\n }",
"public function create()\n {\n if (!isset($_POST['name']) || !isset($_POST['creator'])) {\n call('pages', 'error');\n return;\n }\n $id = Project::insert($_POST['name'], $_POST['creator']);\n\n $project = Project::find($id);\n $tasks = Task::getAllForProject($_GET['id']);\n require_once('views/projects/show.php');\n }",
"public function create()\n\t{\n\t\t$sysflowStep = $this->sysFlowStepRepo->all();\n\t\treturn View::make('dynaflow::flowmanager.form', compact('sysflowStep'));\n\t}",
"private function createCreateForm(Endroit $entity)\n {\n $form = $this->createForm(new EndroitType(), $entity, array(\n 'action' => $this->generateUrl('endroit_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }",
"protected function Create() {\n // Assignment: Generate unique id for the new task\n $this->TaskId = $this->getUniqueId();\n $this->TaskName = 'New Task';\n $this->TaskDescription = 'New Description';\n }",
"public function create()\n {\n return view(\"request_form.form\");\n }",
"private function createCreateForm(AdTiposComision $entity)\n {\n $form = $this->createForm(new AdTiposComisionType(), $entity, array(\n 'action' => $this->generateUrl('adtiposcomision_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }",
"public function create(Request $request) {\n // post da so se di vs form\n $task = new Task(); // tao ra mot instance cua Task ( mot mau cua Task )\n $task->name = $request->name; // lay du lieu name cua nguoi dung nhap len de chuan bi luu vao database\n // name dau la cua truong database name sau la cua nguoi dung nhap len dinh nghia trong form\n $task->description = $request->description;\n $task->user_id = Auth::user()->id;\n $request->validate([\n 'description'=>'required|min:6',\n 'name'=>'required|min:5',\n 'tags'=>'required'\n\n ]);\n\n $task->save();\n\n $task->tags()->sync($request->get('tags'));\n return redirect('/task');\n }",
"private function createEditForm(Task $entity)\n {\n $form = $this->createForm(new TaskType(), $entity, array(\n 'action' => $this->generateUrl('task_edit', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n return $form;\n }",
"public function create()\n {\n $tasks = Task::all();\n $data = compact('tasks');\n return view('labels.create',$data);\n }",
"public function create()\n {\n $tasklist = new Tasklist;\n\n return view('tasklists.create', [\n 'tasklist' => $tasklist,\n ]);\n }",
"public function newAction(Request $request) : Response\n {\n $task = new Task();\n $task->setTask('Learn forms in Symfony 3');\n $task->setDueDate(new \\DateTime());\n\n $form = $this->createForm(TaskType::class, $task);\n\n $form->handleRequest($request);\n if ($form->isSubmitted() && $form->isValid()) {\n $task = $form->getData();\n die(var_dump($task));\n }\n\n return $this->render('task/new.html.twig', [\n 'form' => $form->createView(),\n ]);\n }",
"public function create()\n {\n return view ('forms.create');\n }",
"public function AddTaskFormSubmitted($form) {\r\n try {\r\n $values = $form->getValues();\r\n\r\n dibi::begin();\r\n\r\n $arr = array(\r\n 'name' => $values->name,\r\n 'description' => $values->description,\r\n 'deadline' => $values->date,\r\n 'priority' => $values->priority,\r\n 'iduser' => $this->getUser()->getId(),\r\n 'idcategory' => $values->category,\r\n );\r\n\r\n dibi::query('INSERT INTO tasks', $arr);\r\n\r\n dibi::commit();\r\n\r\n $this->redirect('Homepage:');\r\n } catch (NS\\AuthenticationException $e) {\r\n $form->addError($e->getMessage());\r\n }\r\n }",
"private function createCreateForm(Thread $entity)\n {\n $form = $this->createForm(new ThreadType(), $entity, array(\n 'action' => $this->generateUrl('thread_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }",
"public function create()\n {\n $tasks = Task::all()->sortBy('priority');\n $least_priority = $tasks->count() > 0 ? $tasks->last()->priority : 0;\n return view('tasks.create', compact('least_priority'));\n }",
"public function create()\n\t{\n $plan_id = Input::get('plan_id');\n $plan = $this->plan->find($plan_id);\n\t\treturn View::make('admin.plan_tasks.create',compact('plan'));\n\t}",
"public function actionCreateForm()\n\t{\n\t\t$model=new TProducto;\n\t\t$modelInventario=new TInventario;\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['TProducto']))\n\t\t{\n\t\t\t$model->attributes=$_POST['TProducto'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id_almacen));\n\t\t}\n\t\tYii::app()->theme = 'admin';\n\t\t$this->layout ='//layouts/portalAdmin';\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,'modelInventario'=>$modelInventario\n\t\t));\n\t}",
"protected function form()\n {\n $form = new Form(new TaskOrder);\n\n $form->display('ID');\n $form->text('eid',\"快递单号\");\n $form->text('sname','客服名称');\n $form->select('store','快递网点')->options(storedatas(1));\n $form->select('etype','快递公司')->options(edatas());\n $form->display('Created at');\n $form->display('Updated at');\n\n return $form;\n }",
"public function createForm()\n {\n }",
"private function createCreateForm(Fileops $entity)\n {\n $form = $this->createForm(new FileopsType(), $entity, array(\n 'action' => $this->generateUrl('fileops_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }",
"public function createNewTask($request) \n\t{\n\t\ttry {\n\t\t\t$data = [\n\t\t\t\t'user_id'\t\t=> $request->user_id,\n\t\t\t\t'title'\t\t\t=> $request->title,\n\t\t\t\t'body'\t\t\t=> $request->body,\n\t\t\t\t'type'\t\t\t=> $request->type,\n\t\t\t\t'deadline'\t\t=> $request->deadline,\n\t\t\t\t'isactive'\t\t=> $request->isactive,\n\t\t\t\t'settings'\t\t=> $request->settings\n\t\t\t];\n\t\t\t$task = Task::create($data);\n\t\t\t$this->setTask($task);\n\t\t} catch (\\Exception $e) {\n\t\t\tthrow new \\App\\Exceptions\\ModelException($e->getMessage());\n\t\t}\n\t}",
"public function createForm();",
"public function createForm();",
"private function createCreateForm()\n {\n $form = $this->createForm(\n new NewEventForm(),\n null,\n array(\n 'action' => $this->generateUrl('fel_admin_events_create'),\n 'method' => 'POST',\n )\n );\n\n $form->add('submit', 'submit', array('label' => 'Create', \"attr\" => array(\"class\" => \"btn-success\")));\n\n return $form;\n }",
"private function createCreateForm(Bien $entity)\n {\n $form = $this->createForm(new BienType(), $entity, array(\n 'action' => $this->generateUrl('bien_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Crear','attr' => array('class' => 'btn btn-success'),));\n return $form;\n }",
"private function createCreateForm(Testimonial $entity)\n {\n $form = $this->createForm(new TestimonialType(), $entity, array(\n 'action' => $this->generateUrl('config_testimonial_create'),\n 'attr' => array('enctype' => 'multipart/form-data'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Guardar'));\n\n return $form;\n }",
"public function create()\n {\n $this->validateAccess();\n\n return view('general.form', ['setup' => [\n 'title' => __('New process'),\n 'action_link' => route('admin.landing.processes.index'),\n 'action_name' => __('Back'),\n 'iscontent' => true,\n 'action' => route('admin.landing.processes.store'),\n 'breadcrumbs' => [\n [__('Landing Page'), route('admin.landing')],\n [__('Processes'), route('admin.landing.processes.index')],\n [__('New'), null],\n ],\n ],\n 'fields'=>$this->getFields(), ]);\n }",
"private function createCreateForm(IntrestConfig $entity) {\n\t\t$form = $this->createForm(new IntrestConfigType(), $entity, array(\n\t\t\t'action' => $this->generateUrl('member_intrestconfig_create'),\n\t\t\t'method' => 'POST',\n\t\t));\n\n\t\t$form->add('submit', 'submit', array('label' => 'Create'));\n\n\t\treturn $form;\n\t}",
"private function createCreateForm(Feriado $entity)\n {\n $form = $this->createForm(new FeriadoType(), $entity, array(\n 'action' => $this->generateUrl('feriado_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }",
"public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }",
"public function actionCreate() {\n\t\t$request = Yii::app()->request;\n $form = new PersonaForm(\"new\");\n if($request->isPostRequest) {\n $form->attributes = $request->getPost('PersonaForm');\n if($form->validate()) {\n PersonaManager::savePersona($form);\n Yii::app()->user->setFlash('general-success', \"$form->nombre $form->apellido ha sido creado.\");\n $this->redirect('admin');\n }\n }\n $this->render('create', array('model'=>$form));\n }",
"public function createTask(TaskInterface $task) {\n\n return $this->request('tasks', 'POST', [], json_encode($task->getProperties()));\n }",
"private function createCreateForm(Utente $entity)\n {\n $form = $this->createForm(new UtenteType(), $entity, array(\n 'action' => $this->generateUrl('utente_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }",
"public function create(Project $project)\n {\n //\n return view('tasks.create',compact('project'));\n }",
"public function createAction(Request $request)\n {\n $entity = new UserToTask();\n $form = $this->createCreateForm($entity);\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('usertotask_show', array('id' => $entity->getId())));\n }\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }",
"public function createTaskRequest($task_dto = null)\n {\n\n $resourcePath = '/task/create';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($task_dto)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($task_dto));\n } else {\n $httpBody = $task_dto;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function create ()\n {\n return view('forms.create');\n }",
"private function createDeleteForm(TaskEvent $taskEvent)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('taskevent_delete', array('id' => $taskEvent->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }",
"public function createTask()\n {\n return factory($this->model)->create();\n }",
"private function createCreateForm(TipoCamera $entity)\n {\n $form = $this->createForm(new TipoCameraType(), $entity, array(\n 'action' => $this->generateUrl('tipocamera_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Inserisci'));\n\n return $form;\n }",
"private function createCreateForm(Fluidite $entity)\n {\n $form = $this->createForm(new FluiditeType(), $entity, array(\n 'action' => $this->generateUrl('fluidite_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }",
"public function create()\n {\n return $this->showForm('create');\n }",
"public function create()\n {\n return $this->showForm('create');\n }",
"private function createCreateForm(Compte $entity)\n {\n $form = $this->createForm(new CompteType(), $entity, array(\n 'action' => $this->generateUrl('compte_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Créer'));\n\n return $form;\n }",
"private function createCreateForm(Servicio $entity)\n {\n $securityContext = $this->container->get('security.context');\n $form = $this->createForm(new ServicioType($securityContext), $entity, array(\n 'action' => $this->generateUrl('administracion_servicio_create'),\n 'method' => 'POST',\n ));\n\n //$form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }",
"private function createCreateForm(Timerecord $entity)\n {\n $form = $this->createForm(new TimerecordType(), $entity, array(\n 'action' => $this->generateUrl('timerecord_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'timein', 'attr' => array('class' => 'click_timein')));\n\n return $form;\n }",
"public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }",
"private function createCreateForm(Project $entity)\n {\n $form = $this->createForm(new ProjectType(), $entity);\n $form->add('submit', 'submit', array('label' => 'Create'));\n return $form;\n }"
] | [
"0.8109409",
"0.77208406",
"0.766652",
"0.7633825",
"0.76330984",
"0.75076604",
"0.7477722",
"0.74071205",
"0.73013157",
"0.72923034",
"0.7206672",
"0.71646214",
"0.71495295",
"0.7137175",
"0.7115695",
"0.70809865",
"0.7066614",
"0.70665544",
"0.7057834",
"0.7057834",
"0.70446664",
"0.7034423",
"0.7004153",
"0.6980371",
"0.69684076",
"0.6963248",
"0.6961518",
"0.694543",
"0.69333345",
"0.6882193",
"0.68562156",
"0.6838448",
"0.67987925",
"0.6788118",
"0.67445934",
"0.6742643",
"0.6725294",
"0.6716598",
"0.67015946",
"0.6699688",
"0.668246",
"0.6664981",
"0.66548574",
"0.66099924",
"0.6559116",
"0.65590185",
"0.6526524",
"0.6494789",
"0.64649105",
"0.64561373",
"0.6454785",
"0.64326704",
"0.64317834",
"0.64076686",
"0.63999754",
"0.6376519",
"0.6368646",
"0.6361897",
"0.63559735",
"0.6345086",
"0.6342484",
"0.63405335",
"0.6332392",
"0.63318825",
"0.63212174",
"0.63179296",
"0.6290279",
"0.6287159",
"0.6284771",
"0.6283194",
"0.6278359",
"0.6274594",
"0.6273717",
"0.62732846",
"0.62732846",
"0.62637043",
"0.6254245",
"0.6247936",
"0.62449735",
"0.62352973",
"0.62314343",
"0.6230719",
"0.6223737",
"0.6222525",
"0.6222248",
"0.6217127",
"0.6206302",
"0.6205475",
"0.620012",
"0.6196263",
"0.61948615",
"0.61931026",
"0.6187134",
"0.61859304",
"0.61859304",
"0.6185513",
"0.61794424",
"0.6172614",
"0.61646485",
"0.61627394"
] | 0.72620016 | 10 |
Creates a form to edit a Task entity. | private function createEditForm(Task $entity)
{
$form = $this->createForm(new TaskType(), $entity, array(
'action' => $this->generateUrl('task_edit', array('id' => $entity->getId())),
'method' => 'PUT',
));
return $form;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function createEditForm(Task $entity) //recibiendo nuestra entidad de tarea\n {\n //$form = $this->createForm(new TaskType, $entity, array( \n //pero para Symfony3.4.15 ahora es: \n $form = $this->createForm(TaskType::class, $entity, array(\n 'action' => $this->generateUrl('infunisa_task_update', array('id' => $entity->getId())),\n 'method' => 'PUT' //como estamos editando la tarea usamos PUT\n ));\n \n return $form;\n }",
"public function editTask() {\n return $this->render('enterprise/task/task_form.html.twig');\n }",
"public function show_edit_form_task()\n {\n $user = factory(User::class)->create();\n $user->assignRole('task-manager');\n $this->actingAs($user);\n View::share('user', $user);\n $task = factory(Task::class)->create();\n\n factory(User::class, 5)->create();\n\n $users = User::all();\n\n $response = $this->get('/tasks_php/edit/'.$task->id);\n $response->assertSuccessful();\n $response->assertViewIs('tasks.edit_task');\n $task = Task::findOrFail($task->id);\n $response->assertViewHas('task', $task);\n $response->assertViewHas('users', $users);\n\n $response->assertSeeText('Edit Task:');\n\n $response->assertSee($task->name);\n $response->assertSee($task->user->name);\n }",
"protected function createComponentEditTaskForm() {\r\n\r\n $form = new UI\\Form;\r\n\r\n $form->getElementPrototype()->novalidate = 'novalidate';\r\n\r\n $form->addText('name', 'Task name:')\r\n ->setRequired('Please provide a task name.');\r\n\r\n $form->addTextArea('description', 'Description:');\r\n\r\n $form->addText('deadline', 'Deadline')->setOption('description', 'Use format: YYYY-MM-DD')\r\n ->addCondition(UI\\Form::FILLED)\r\n ->addRule(UI\\Form::PATTERN, 'Může být v rozmezí 2011-01-01 až 2019-12-31', '^(20)\\d\\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$');\r\n\r\n $form->addRadioList('priority', 'Priority', array(\r\n '1' => '1',\r\n '2' => '2',\r\n '3' => '3',\r\n '0' => 'bez priority'\r\n ));\r\n\r\n $result = dibi::query('SELECT idcategory, name FROM `categories` WHERE iduser = %i', $this->getUser()->getId())->fetchPairs('idcategory', 'name');\r\n\r\n $form->addRadioList('idcategory', 'Category', $result)\r\n ->setRequired('Please select category.');\r\n\r\n $status = array(\r\n 'nedokončeno' => 'nedokončeno',\r\n 'odloženo' => 'odloženo',\r\n 'dokončeno' => 'dokončeno',\r\n );\r\n $form->addRadioList('status', 'Status', $status)\r\n ->setRequired('Please select status.');\r\n\r\n $form->addHidden('idtask');\r\n\r\n $form->addSubmit('editTask', 'Edit Task');\r\n\r\n $form->onSuccess[] = callback($this, 'EditTaskFormSubmitted');\r\n\r\n $task = dibi::query('SELECT * FROM `tasks` WHERE idtask = %i', $this->getParam('id'))->fetch();\r\n\r\n if ($task->deadline == \"0000-00-00\")\r\n $task->deadline = \"\";\r\n\r\n $form->setDefaults(array(\r\n 'name' => $task->name,\r\n 'description' => $task->description,\r\n 'deadline' => $task->deadline,\r\n 'status' => $task->status,\r\n 'priority' => $task->priority,\r\n 'idcategory' => $task->idcategory,\r\n 'idtask' => $task->idtask,\r\n ));\r\n\r\n return $form;\r\n }",
"private function createEditForm(UserToTask $entity)\n {\n $form = $this->createForm(new UserToTaskType(), $entity, array(\n 'action' => $this->generateUrl('usertotask_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"public function edit(Task $task)\n {\n //Admin allow only \n abort_if(Gate::denies('user_access'), Response::HTTP_FORBIDDEN, '403 Forbidden');\n\n //Declaration of vars in order to use the same form template\n $update = true;\n $title = \"Actualizar Tarea\";\n $txtButton = \"Actualizar\";\n $route = route('tasks.update',['task' => $task]);\n $users = User::all();\n return view('tasks.edit', compact('task','title','txtButton','route','users','update'));\n }",
"public function edit(TaskFormBuilder $form, $id)\n {\n return $form->render($id);\n }",
"public function edit(Task $task)\r\n {\r\n //\r\n }",
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n //\n }",
"public function edit(Task $task)\n {\n\n }",
"public\n function edit(\n Task $task\n ) {\n //\n }",
"public function edit(Task $task)\n {\n //var_dump($task);\n }",
"public function edit(Task $task)\n {\n return view('web.pages.edit_task')\n ->with('task',$task)\n ->with('projects',Project::all());\n }",
"protected function editTaskAction() {}",
"public function edit(Task $task)\n {\n return view('teacher/edittask',\n [ 'task' =>$task ]\n );\n }",
"public function edit(Task $task)\n {\n return view('projectmanager::admin.tasks.edit', compact('task'));\n }",
"public function updateTaskForm(Task $task)\n {\n $this->checkIfLoggedIn();\n\n $this->checkIfTaskBelongsToUSer($task);\n\n return view('update-task', [\n 'titlePart' => '| Update a task',\n 'user' => session()->get('user'),\n 'task' => $task,\n ]);\n }",
"public function edit($id)\n {\n $task = Task::find($id);\n return view('tasks.form_edit',[\n 'task' => $task,\n ]);\n }",
"public function edit(Task $task)\n {\n return view('task.edit', ['task' => $task]);\n }",
"public function edit(Task $task)\n {\n return view('tasks.edit', compact('task'));\n }",
"public function edit(Task $task)\n {\n return view('tasks.edit', compact('task'));\n }",
"public function edit(Task $task)\n {\n $projects = Project::all();\n\n return view('editTask', ['task' => $task, 'projects' => $projects]);\n }",
"public function edit(Task $task)\n {\n $data['task'] = $task;\n $data['tags'] = Tag::orderBy('text')->get();\n\n return view('tasks.store', $data);\n }",
"private function createEditForm(Endroit $entity)\n {\n $form = $this->createForm(new EndroitType(), $entity, array(\n 'action' => $this->generateUrl('endroit_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"private function createEditForm(Estadofondo $entity)\n {\n $form = $this->createForm(new EstadofondoType(), $entity, array(\n 'action' => $this->generateUrl('estadofondo_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"public function editTask()\n\t{\n\t\t$jwt = Auth::isValidToken($_COOKIE['SSID']);\n \n if (!$jwt) {\n View::jsonResponse(['status' => 401, 'message' => 'Access denied for you!']);\n }\n\n $update = [ 'task' => $_POST['etask'], 'id' => $_POST['taskid']];\n $update = Validator::cleanData($update);\n\n if (Validator::isEmpty($update)) {\n View::jsonResponse(['status' => 401, 'message' => 'There are empty fields!']);\n }\n\n (new Task())->update($update)->execute();\n\n View::jsonResponse(['status' => 200, 'message' => 'Task edited successful!']); \n \n\t}",
"public function edit(Project $project, Task $task)\n {\n //\n return view('tasks.edit',compact('project','task'));\n }",
"private function createCreateForm(Task $entity)\n {\n //$form = $this->createForm(new TaskType(), $entity, array( \n //pero para Symfony3.4.15 ahora es:\n $form = $this->createForm(TaskType::class, $entity, array( \n 'action' => $this->generateUrl('infunisa_task_create'),\n 'method' => 'POST'\n ));\n \n return $form;\n }",
"private function createEditForm(SolMantenimientoIdentificacion $entity)\n {\n $form = $this->createForm(new SolMantenimientoType(), $entity, array(\n 'action' => $this->generateUrl('solmantenimientoidentificacion_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Actualizar', 'attr'=>array('class'=>'btn btn-primary btn-lg btn-block')));\n\n return $form;\n }",
"private function createEditForm(Todoitems $entity)\n {\n $form = $this->createForm(new TodoitemsType(), $entity, array(\n 'action' => $this->generateUrl('todoitems_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n 'id' => $this->getUser()->getId(),\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"public function addTaskForm()\n {\n $this->checkIfLoggedIn();\n\n return view('new-task', [\n 'titlePart' => '| Add a task',\n 'user' => session()->get('user')\n ]);\n }",
"public function editTask($id)\n\t{\n\t\tif ( \\App\\is_admin() ) {\n\t\t\t$task = Task::whereId( (int)$id )->first();\n\t\t\techo twig()->render('edit.html', ['task' => $task]);\n\t\t} else {\n\t\t\theader('Location: /?err=auth');\n\t\t}\n\t}",
"private function createEditForm(SesionVentaTratamiento $entity)\n {\n $form = $this->createForm(new SesionVentaTratamientoType(), $entity, array(\n 'action' => $this->generateUrl('admin_sesionventatratamiento_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"public function edit(int $idTask)\n {\n $this->getUser()->hasPermission(['select'], 'auto_tasks');\n\n $task = new AutoTask();\n $task->setConnection($this->getUser()->getRole->name);\n\n $task = $task->findOrFail($idTask);\n\n return view('autotasks.edit', array(\n 'autoTask' => $task\n ));\n }",
"private function createEditForm(Timerecord $entity)\n {\n $form = $this->createForm(new TimerecordType(), $entity, array(\n 'action' => $this->generateUrl('timerecord_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'TimeOut'));\n\n return $form;\n }",
"public function edit(Task $task)\n {\n\n if (auth()->user()->isApprover(auth()->user()->id)) {\n $chunck = array(\n 'task' => $task,\n 'task_site' => \\Tritiyo\\Task\\Models\\TaskSite::where('task_id', $task->id)->get()->toArray(),\n 'task_vehicle' => \\Tritiyo\\Task\\Models\\TaskVehicle::where('task_id', $task->id)->get()->toArray(),\n 'task_material' => \\Tritiyo\\Task\\Models\\TaskMaterial::where('task_id', $task->id)->get()->toArray(),\n 'task_proof' => \\Tritiyo\\Task\\Models\\TaskProof::where('task_id', $task->id)->get()->toArray(),\n 'task_status' => \\Tritiyo\\Task\\Models\\TaskStatus::where('task_id', $task->id)->get()->toArray(),\n );\n\n //$chunck_update = \\Tritiyo\\Task\\Models\\TaskChunck::update();\n $chunck = \\Tritiyo\\Task\\Models\\TaskChunck::updateOrCreate(\n array('task_id' => $task->id),\n array('manager_data' => json_encode($chunck))\n );\n }\n return view('task::edit', ['task' => $task]);\n }",
"public function edit(int $taskId)\n {\n $task = $this->taskService->getTask($taskId);\n\n return view('Tasks.edit_task', [\n 'task' => $task,\n ]);\n }",
"public function edit($id=null) {\n\n $Task = $this->Task->find('first', array(\n 'contain' => array(),\n 'conditions' => array(\n 'Task.id' => $id\n )\n ));\n\n if(empty($Task))\n return $this->redirect('/tasks');\n\n if($this->request->is('post')){\n\n $this->Task->id = $id;\n $result = $this->Task->save($this->request->data);\n if($result){\n $this->_setFlash('Task updated successfully.', 'success');\n $this->redirect('/tasks');\n }\n else {\n $valError = $this->Task->validationErrorsAsString();\n $this->_setFlash(\"Unable to update task. ${valError}\");\n }\n }\n else {\n $this->request->data = $Task;\n }\n\n $this->set('medId', $id);\n $this->set('add', false);\n $this->render('add-edit');\n }",
"private function createEditForm(Project $entity)\n {\n $form = $this->createForm(new ProjectType(), $entity);\n $form->add('submit', 'submit', array('label' => 'Update'));\n return $form;\n }",
"private function createEditForm(IntrestConfig $entity) {\n\t\t$form = $this->createForm(new IntrestConfigType(), $entity, array(\n\t\t\t'action' => $this->generateUrl('member_intrestconfig_update', array('id' => $entity->getId())),\n\t\t\t'method' => 'PUT',\n\t\t));\n\n\t\t$form->add('submit', 'submit', array('label' => 'Update'));\n\n\t\treturn $form;\n\t}",
"public function edit($id)\n {\n $task = Task::find($id);\n\n\n return view('tasks.edit')->withTask($task);\n }",
"private function createEditForm(Empleado $entity)\n {\n $form = $this->createForm(new EmpleadoType(), $entity, array(\n 'action' => $this->generateUrl('empleado_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"public function edit(Form $form)\n {\n //\n }",
"public function edit($task_id)\n {\n $this->form_validation->set_rules($this->rules['update']);\n\n // Get task ID\n $task_id = ($this->form_validation->run() === TRUE) ? $this->input->post('task_id') : intval($task_id);\n\n // Look for the task\n $task = $this->task_model->get_task($task_id);\n\n if ($task === FALSE) {\n $this->postal->add('There is no task with that ID', 'error');\n redirect();\n }\n\n $this->data['task'] = $task;\n\n // Find out the role of the user\n $this->load->model('project_user_model');\n $role = $this->project_user_model->get_role($task->project_id, $this->user_id);\n if (!in_array($role, array('admin', 'edit'))) {\n $this->postal->add('You are not allowed to change the tasks in this project', 'error');\n redirect('projects/index/' . $task->project_id);\n }\n $this->data['role'] = $role;\n\n // Get the available statuses\n $this->load->model('task_status_model');\n $statuses = $this->task_status_model->as_dropdown('title')->order_by('order', 'ASC')->get_all();\n\n $admin_statuses = array('1','2','3','4','5','6','7');\n $edit_statuses = array('2','3','4');\n $the_statuses = array();\n\n foreach($statuses as $id => $the_status)\n {\n if(in_array($id,$admin_statuses)) $the_statuses['admin'][$id] = $the_status;\n if(in_array($id,$edit_statuses)) $the_statuses['edit'][$id] = $the_status;\n }\n $this->data['statuses'] = $the_statuses;\n\n // Get the priorities\n $this->load->model('task_priority_model');\n $priorities = $this->task_priority_model->as_dropdown('title')->order_by('order', 'DESC')->get_all();\n $this->data['priorities'] = $priorities;\n\n // Get the project\n $project = $this->project_model->with_members('fields:email,id')->get($task->project_id);\n\n // Get the members of the project if the $role is admin (only admin has the right to assign to other people)\n $members = array();\n if (!empty($project->members)) {\n foreach ($project->members as $member) {\n $members[$member->id] = $member->email;\n }\n }\n $this->data['members'] = $members;\n\n if ($this->form_validation->run() === FALSE)\n {\n $this->render('tasks/edit_view');\n }\n else\n {\n echo $role;\n\n $old_task = $task;\n\n\n $update_data = array();\n $history_data = array();\n $changes = array();\n if($role == 'admin')\n {\n if(strcmp($old_task->title,$this->input->post('title'))!=0)\n {\n $update_data['title'] = $this->input->post('title');\n $history_data['title'] = $old_task->title;\n $changes[] = '<strong>Title</strong> was changed from <span class=\"text-danger\">'.$history_data['title'].'</span> to <span class=\"text-success\">'.$update_data['title'].'</span>.';\n }\n\n\n if(strcmp($old_task->summary,$this->input->post('summary'))!=0)\n {\n $update_data['summary'] = $this->input->post('summary');\n $history_data['summary'] = $old_task->summary;\n $changes[] = '<strong>Summary</strong> was changed from <span class=\"text-danger\">'.$history_data['summary'].'</span> to <span class=\"text-success\">'.$update_data['summary'].'</span>.';\n }\n\n if($old_task->assignee_id!=$this->input->post('assigned_to'))\n {\n $update_data['assigned_to'] = $this->input->post('assigned_to');\n $history_data['assigned_to'] = $old_task->assignee_id;\n $changes[] = '<strong>The assignee</strong> was changed from <span class=\"text-danger\">'.$members[$history_data['assigned_to']].'</span> to <span class=\"text-success\">'.$members[$update_data['assigned_to']].'</span>.';\n }\n\n if($old_task->priority!=$this->input->post('priority'))\n {\n $update_data['priority'] = $this->input->post('priority');\n $history_data['priority'] = $old_task->priority;\n $changes[] = '<strong>The priority</strong> was changed from <span class=\"text-danger\">'.$priorities[$history_data['priority']].'</span> to <span class=\"text-success\">'.$priorities[$update_data['priority']].'</span>.';\n }\n\n if(strcmp($old_task->due_date,$this->input->post('due_date'))!=0)\n {\n $update_data['due_date'] = $this->input->post('due_date');\n $history_data['due_date'] = $old_task->due_date;\n $changes[] = '<strong>The due date</strong> was changed from <span class=\"text-danger\">'.$history_data['due_date'].'</span> to <span class=\"text-success\">'.$update_data['due_date'].'</span>.';\n }\n }\n\n if(in_array($role,array('admin','edit')))\n {\n if(($old_task->assignee_id!=$this->input->post('assigned_to')) && $role=='admin')\n {\n $status = '1';\n }\n\n else\n {\n $status = $this->input->post('status');\n }\n\n if(($old_task->status_id!=$status) && array_key_exists($status, $the_statuses[$role]))\n {\n $update_data['status'] = $status;\n $history_data['status'] = $old_task->status_id;\n $changes[] = '<strong>Status</strong> was changed from <span class=\"text-danger\">'.$statuses[$history_data['status']].'</span> to <span class=\"text-success\">'.$statuses[$update_data['status']].'</span>.';\n if($status=='4' || $status=='5')\n {\n $new_progress = 100;\n }\n }\n\n if(isset($new_progress))\n {\n $update_data['progress'] = $new_progress;\n $history_data['progress'] = $old_task->progress;\n $changes[] = '<strong>The progress</strong> of the task was changed from <span class=\"text-danger\">'.$history_data['progress'].'%</span> to <span class=\"text-success\">'.$update_data['progress'].'%</span> because status was changed to \"Completed\".';\n\n }\n elseif($old_task->progress!=$this->input->post('progress'))\n {\n $update_data['progress'] = $this->input->post('progress');\n $history_data['progress'] = $old_task->progress;\n $changes[] = '<strong>The progress</strong> of the task was changed from <span class=\"text-danger\">'.$history_data['progress'].'%</span> to <span class=\"text-success\">'.$update_data['progress'].'%</span>.';\n }\n }\n\n if(!empty($update_data))\n {\n $update_data['updated_by'] = $this->user_id;\n $update_data['updated_at'] = date('Y-m-d H:i:s');\n $the_intro = 'The following changes were made by <strong><span class=\"text-success\">'.$members[$this->user_id].'</span></strong>:';\n array_unshift($changes,$the_intro);\n\n $history_data['task_id'] = $old_task->id;\n $history_data['created_by'] = $this->user_id;\n $history_data['created_at'] = date('Y-m-d H:i:s');\n $history_data['changes'] = implode('<br />',$changes);\n\n\n $history_id = $this->task_history_model->insert($history_data);\n if( $history_id !== FALSE)\n {\n if($this->task_model->where('id',$task_id)->update($update_data) !== FALSE)\n {\n $this->postal->add('The changes were made successfully.','success');\n }\n else\n {\n $this->task_history_model->delete($history_id);\n $this->postal->add('There was a problem in updating the task. Sit tight and wait for the rescue team... Or you could write them an email with a print screen.');\n }\n }\n\n redirect('tasks/index/'.$task_id);\n }\n /*\n echo '<pre>';\n print_r($update_data);\n print_r($history_data);\n print_r($changes);\n echo '</pre>';\n dd($old_task);\n /*\n $title = $this->input->post('title');\n $assigned_to = ($role === 'admin') ? $this->input->post('assigned_to') : $this->user_id;\n $status = $this->input->post('status');\n $priority = $this->input->post('priority');\n $due_date = $this->input->post('due_date');\n $description = $this->input->post('description');\n $summary = $this->input->post('summary');\n $notes = $this->input->post('notes');\n\n\n $verify_assigned_to = $this->project_user_model->get_role($project_id, $assigned_to);\n\n if (!in_array($verify_assigned_to, array('admin', 'edit'))) {\n $this->postal->add('You are not allowed to add the task to that user. You must first add him/her to the project as admin or edit');\n redirect('projects/index/' . $project->id);\n exit;\n }\n\n $insert_data = array(\n 'project_id' => $project_id,\n 'title' => $title,\n 'assigned_to' => $assigned_to,\n 'status' => $status,\n 'priority' => $priority,\n 'due_date' => $due_date,\n 'description' => $description,\n 'summary' => $summary,\n 'notes' => $notes,\n 'created_by' => $this->user_id\n );\n\n if ($this->task_model->insert($insert_data)) {\n $this->postal->add('The task was created successfully', 'success');\n } else {\n $this->postal->add('Couldn\\'t create the task', 'error');\n }\n redirect('projects/index/' . $project->id);\n */\n\n }\n }",
"private function createEditForm(Fileops $entity)\n {\n $form = $this->createForm(new FileopsType(), $entity, array(\n 'action' => $this->generateUrl('fileops_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"public function edit($id)\n\t{\n\t\tView::share('title', 'ThinkClosing - Task');\n\t\t$task = Task::find($id);\n\t\tif (!$task) {\n\t\t\treturn Redirect::route('tasks.index')\n \t->with('message', 'Task not found.')\n \t->with('alert-class', 'alert-error');\n\t\t} else if($task->user_id !== Auth::user()->id || !Auth::user()->isAdmin()) {\n\t\t\treturn Redirect::route('tasks.index')\n \t->with('message', \"You don't have permission to edit this task.\")\n \t->with('alert-class', 'alert-error');\n\t\t}\n\t\treturn View::make('tasks.edit')->with('task', $task);\n\t}",
"private function createEditForm(Feriado $entity)\n {\n $form = $this->createForm(new FeriadoType(), $entity, array(\n 'action' => $this->generateUrl('feriado_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"private function createEditForm(PeriodoDeInscricao $entity)\n {\n $form = $this->createForm(new PeriodoDeInscricaoType(), $entity, array(\n 'action' => $this->generateUrl('periododeinscricao_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"private function createEditForm(AdmTipoAporte $entity)\r\n {\r\n $form = $this->createForm(new AdmTipoAporteType(), $entity, array(\r\n 'action' => $this->generateUrl('admtipoaporte_update', array('id' => $entity->getId())),\r\n 'method' => 'PUT',\r\n ));\r\n\r\n $form->add('submit', 'submit', array('label' => 'Actualizar','attr'=>array('class'=>'btn btn-success btn-sm')));\r\n\r\n return $form;\r\n }",
"public function edit($id)\n {\n $task = Task::find($id);\n return view('tasks.edit', compact('task'));\n }",
"public function editAction() {\n\t\t$request = $this->getRequest();\n\t\t$id = (int)$request->getParam('id');\n\t\tPageTitle::setTitle($this->view, $request, array($id));\n\t\t\n\t\t$taFinder = new TeachingActivities();\n\t\t$ta = $taFinder->getTa($id);\n\n\t\tif (($result = $ta->isEditable()) !== true) {\n\t\t\tthrow new Exception($result);\n\t\t}\n\n\t\tif (($result = UserAcl::checkTaPermission($ta, UserAcl::$EDIT)) !== true) {\n\t\t\tthrow new Exception($result);\n\t\t}\n\n\t\t$fp = new FormProcessor_TeachingActivity($id);\n\t\tif ($request->isPost()) {\n\t\t\tif ($id = $fp->process($request)) {\n\t\t\t\t$session = new Zend_Session_Namespace('taeditcomplete');\n\t\t\t\t$session->ta_id = $id;\n\t\t\t\t$this->_redirect('/teachingactivity/editcomplete');\n\t\t\t}\n\t\t}\n\t\t$this->view->fp = $fp;\n\t}",
"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(Fluidite $entity)\n {\n $form = $this->createForm(new FluiditeType(), $entity, array(\n 'action' => $this->generateUrl('fluidite_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array(\n 'label' => 'Update',\n 'attr' => array(\n 'class' => 'btn ')\n \n ));\n\n return $form;\n }",
"public function edit(Task $task)\n {\n return view('views.tasks.progress.edit', [\n 'task' => $task\n ]);\n }",
"private function createEditForm(AdTiposComision $entity)\n {\n $form = $this->createForm(new AdTiposComisionType(), $entity, array(\n 'action' => $this->generateUrl('adtiposcomision_update', array('id' => $entity->getIdTipoComision())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"private function createEditForm(Utente $entity)\n {\n $form = $this->createForm(new UtenteType(), $entity, array(\n 'action' => $this->generateUrl('utente_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"private function createAddForm(Task $entity)\n {\n $form = $this->createForm(new TaskType(), $entity, array(\n 'action' => $this->generateUrl('task_add'),\n 'method' => 'POST',\n ));\n\n return $form;\n }",
"private function createEditForm(Bien $entity)\n {\n $form = $this->createForm(new BienType(), $entity, array(\n 'action' => $this->generateUrl('bien_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"public function edit($project_id, $task_id)\n\t{\n\t\t// Get basic task info\n\t\t$task = new Task;\n\t\t$taskInfo = $task->getInfo($task_id);\n\n\t\t// Get related users\n\t\t$related_users = $task->getRelatedUsers($task_id);\n\n\t\t// Fetch all the users\n\t\t$all_users = $this->redmineUser->getAllWithPaginations(9999);\n\t\t$all_users_selectable = User::convertToSelectable($all_users['users']);\n\n\t\t// Get user roles\n\t\t$user_roles = UserRole::allForSelect();\n\n\t\t// Get roles with percents (we will ban them if frontend)\n\t\t$persentable_roles = array();\n\n\t\tforeach (UserRole::all() as $role)\n\t\t{\n\t\t\tif ($role->percents)\n\t\t\t{\n\t\t\t\t$persentable_roles[] = $role->id;\n\t\t\t}\n\t\t}\n\n\t\treturn View::make('tasks.edit')\n\t\t\t->with('project_id', $project_id)\n\t\t\t->with('users', $all_users_selectable)\n\t\t\t->with('related_users', $related_users)\n\t\t\t->with('user_roles', $user_roles)\n\t\t\t->with('persentable_roles', $persentable_roles)\n\t\t\t->with('task_id', $task_id)\n\t\t\t->with('task', $taskInfo);\n\t}",
"function edit() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultViewForm();\n\n\t\tif (!$view) {\n\t\t\tthrow new Exception('Edit task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t// Hint the view that it's not a listing, but a form (KenedoView::display() uses it to set the right template file)\n\t\t$view->listing = false;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}",
"public function edit($id)\n {\n $task = Task::find($id);\n return view('tasks.edit')->with('task', $task);\n }",
"public function EditTaskFormSubmitted($form) {\r\n $values = $form->getValues();\r\n\r\n $result = dibi::query('SELECT count(*) FROM `tasks` WHERE %and', array(\r\n array('iduser = %i', $this->getUser()->getId()),\r\n array('idtask = %i', $values->idtask),\r\n ))->fetchSingle();\r\n\r\n if ($result == \"1\") {\r\n if ($values->priority == \"0\")\r\n $values->priority = \"\";\r\n\r\n $arr = array(\r\n 'name' => $values->name,\r\n 'description' => $values->description,\r\n 'deadline' => $values->deadline,\r\n 'status' => $values->status,\r\n 'priority' => $values->priority,\r\n 'idcategory' => $values->idcategory,\r\n );\r\n\r\n dibi::query('UPDATE `tasks` SET ', $arr, 'WHERE `idtask`=%i', $values->idtask);\r\n }\r\n $this->redirect('Homepage:default');\r\n }",
"public function edit(form $form)\n {\n //\n }",
"private function createEditForm(Event $entity)\n {\n $form = $this->createForm(new EventType(), $entity, array(\n 'action' => $this->generateUrl('event_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"private function createEditForm(Testimonial $entity)\n {\n $form = $this->createForm(new TestimonialType(), $entity, array(\n 'action' => $this->generateUrl('config_testimonial_update', array('id' => $entity->getId())),\n 'attr' => array('enctype' => 'multipart/form-data'),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Actualizar'));\n\n return $form;\n }",
"public function getEditForm();",
"public function create()\n {\n $cases = Casee::all();\n $users = User::all();\n $stages = Stage::all();\n\n return $this->view_('task.update',[\n 'object'=> new Task(),\n 'cases'=> $cases,\n 'users'=> $users,\n 'stages'=> $stages,\n ]);\n }",
"private function createDeleteForm(TaskEvent $taskEvent)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('taskevent_delete', array('id' => $taskEvent->getId())))\n ->setMethod('DELETE')\n ->getForm();\n }",
"private function createEditForm(Propietario $entity)\n {\n $form = $this->createForm(\n new PropietarioType(),\n $entity,\n array(\n 'action' => $this->generateUrl('propietario_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n )\n );\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"public function renderEditTask($id) {\r\n $this->template->title = \"ToDo-list / Edit Task\";\r\n\r\n $session = $this->getSession('session');\r\n\r\n if ($this->getUser()->isLoggedIn()) { // přihlášení uživatelé\r\n $this->template->loggedAs = \"Přihlášen jako \" . $this->getUser()->identity->data[0] . \" (\" . $this->getUser()->identity->data[1] . \")\";\r\n } else {\r\n $this->redirect('Homepage:');\r\n }\r\n $this->makeMenu($this->getUser()->isLoggedIn());\r\n }",
"private function createEditForm(PosgradoLineas $entity)\n {\n $form = $this->createForm(new PosgradoLineasType(), $entity, array(\n 'action' => $this->generateUrl('posgradolineas_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Actualizar'));\n\n return $form;\n }",
"public function edit($id)\n {\n if(Module::hasAccess(\"Tasks\", \"edit\")) {\n\n $task = Task::find($id);\n if(isset($task->id)) {\n $module = Module::get('Tasks');\n\n $module->row = $task;\n\n $work_list = DB::table('worklists')\n ->lists('name', 'work_id');\n $user_list = DB::table('userinfos')\n ->lists('user_key', 'user_key');\n\n return view('la.tasks.edit', [\n 'module' => $module,\n 'view_col' => $this->view_col,\n 'work_list' => $work_list,\n 'user_list' => $user_list,\n 'status_list' => Task::$statusText,\n ])->with('task', $task);\n } else {\n return view('errors.404', [\n 'record_id' => $id,\n 'record_name' => ucfirst(\"task\"),\n ]);\n }\n } else {\n return redirect(config('laraadmin.adminRoute').\"/\");\n }\n }",
"private function createEditForm(Servicio $entity)\n {\n $securityContext = $this->container->get('security.context');\n $form = $this->createForm(new ServicioType($securityContext), $entity, array(\n 'action' => $this->generateUrl('administracion_servicio_update', array('id' => $entity->getId())),\n 'method' => 'POST',\n ));\n\n //$form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"public function edit(Task $card)\n { \n return view('cards.edit',compact('card'));\n }",
"private function createEditForm(TipoCamera $entity)\n {\n $form = $this->createForm(new TipoCameraType(), $entity, array(\n 'action' => $this->generateUrl('tipocamera_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Modifica'));\n\n return $form;\n }",
"private function createEditForm(Thread $entity)\n {\n $form = $this->createForm(new ThreadType(), $entity, array(\n 'action' => $this->generateUrl('thread_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"protected function form()\n {\n $form = new Form(new Task);\n\n $form->text('eid', 'Eid');\n $form->text('store', 'Store');\n $form->text('etype', 'Etype');\n $form->text('uid', 'Uid');\n $form->text('uname', 'Uname');\n $form->text('qq', 'Qq');\n $form->number('qtype', 'Qtype');\n $form->number('times', 'Times')->default(1);\n $form->textarea('content', 'Content');\n $form->text('deadline', 'Deadline');\n $form->file('file', 'File');\n $form->number('isok', 'Isok');\n $form->number('istag', 'Istag');\n $form->text('sid', 'Sid');\n $form->text('sname', 'Sname');\n $form->text('score', 'Score');\n\n return $form;\n }",
"public function edit($id)\n {\n $task = Task::find($id);\n\n return view('tasks.edit', compact('task'));\n }",
"private function createEditForm(EntradaDetalles $entity)\n {\n $form = $this->createForm(new EntradaDetallesType(), $entity, array(\n 'action' => '',\n 'method' => 'PUT',\n 'mostrar_campo_articulo' => false,\n ));\n\n $form->add('submit', 'submit', array('label' => 'Actualizar', 'icon' => 'floppy-disk', 'attr' => array('class' => 'btn-primary')));\n\n return $form;\n }",
"public function edit($id) {\n $tasks=Tasks::find($id);\n return view('edit_task', ['task' => $tasks]);\n }",
"private function createEditForm(EnvaseIngreso $entity)\n {\n $form = $this->createForm(new EnvaseIngresoType(), $entity, array(\n 'action' => $this->generateUrl('envase_ingreso_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Guardar', 'attr' => array('class' => \"btn btn-success\")));\n\n return $form;\n }",
"public function edit($id)\n {\n // Retrive the task with param $id\n $task = Task::find($id);\n\n if ($task) {\n $data['task'] = $task;\n\n // Get all projects\n $projects = Project::all();\n $data['projects'] = $projects;\n\n // Get the project_time\n $project_times = ProjectTime::where('project_id', $task->project_id)->get();\n $data['project_times'] = $project_times;\n\n // Get all projects\n $teams = Team::all();\n $data['teams'] = $teams;\n\n // Get all task teams\n $task_teams = TaskTeam::where('project_time_task_id', $id)->get();\n $data['task_teams'] = $task_teams;\n\n // Return the dashboard view.\n return view('task.create')->with('data', $data);\n } else {\n abort(404);\n }\n }",
"private function createEditForm(FuncionarioEmpresa $entity)\n {\n $form = $this->createForm(new FuncionarioEmpresaType(), $entity, array(\n 'action' => $this->generateUrl('funcionarioempresa_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"private function createEditForm(Ligne $entity)\n {\n $form = $this->createForm(new LigneType(), $entity, array(\n 'action' => $this->generateUrl('ligne_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"public function edit($id)\n {\n $types = Type::orderBy('id','ASC')->pluck('name','id');\n $task = Task::find($id);\n return view('tasks.editTask',compact('task','types'));\n }",
"public function edit($model, $form);",
"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 $todo = Task::find($id);\n\n return view('todo/edit', compact('todo'));\n }",
"private function createEditForm(Compte $entity)\n {\n $form = $this->createForm(new CompteType(), $entity, array(\n 'action' => $this->generateUrl('compte_update', array('id' => $entity->getId())),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Mettre à jour'));\n\n return $form;\n }",
"public function edit()\n {\n return view('timetable::edit');\n }",
"public function edit(CaretakerForm $caretakerForm)\n {\n //\n }",
"private function createEditForm(Dzialy $entity) {\n $form = $this->createForm(new DzialyType(true), $entity, array(\n 'action' => $this->generateUrl('dzialy_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n \n\n return $form;\n }",
"private function createEditForm(Timelog $entity)\n {\n $form = $this->createForm(new TimelogType(), $entity, array(\n 'action' => $this->generateUrl('timelog_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }",
"public function edit(Tiempo $tiempo)\n {\n //\n }"
] | [
"0.8199526",
"0.8038785",
"0.796802",
"0.7860531",
"0.74990076",
"0.7479222",
"0.73306453",
"0.73083943",
"0.7301221",
"0.7301221",
"0.7301221",
"0.7301221",
"0.7301221",
"0.7301221",
"0.7301221",
"0.7206884",
"0.7198411",
"0.71002233",
"0.7062614",
"0.703974",
"0.70169103",
"0.6975154",
"0.6972841",
"0.6959682",
"0.6929577",
"0.69106025",
"0.69106025",
"0.68623227",
"0.6710196",
"0.6640431",
"0.6635826",
"0.6628289",
"0.66170233",
"0.66094023",
"0.6605978",
"0.65788954",
"0.65516305",
"0.65414536",
"0.65406644",
"0.6529007",
"0.65259004",
"0.6520664",
"0.64833826",
"0.6482964",
"0.6477078",
"0.6470671",
"0.6466778",
"0.6457823",
"0.64556736",
"0.64538604",
"0.6453035",
"0.6435111",
"0.6430138",
"0.64284766",
"0.6426435",
"0.64254475",
"0.64042413",
"0.639851",
"0.63959855",
"0.6389875",
"0.6389236",
"0.6387819",
"0.63652927",
"0.6365289",
"0.6363853",
"0.63454515",
"0.6344491",
"0.63410455",
"0.63360375",
"0.63348925",
"0.63315445",
"0.6328671",
"0.6324739",
"0.63247305",
"0.6304774",
"0.62984264",
"0.62983567",
"0.62820286",
"0.6276942",
"0.6269887",
"0.62681973",
"0.6267286",
"0.6267078",
"0.62632376",
"0.6259128",
"0.6255416",
"0.62544376",
"0.6253311",
"0.62526363",
"0.62414694",
"0.6237463",
"0.6233793",
"0.62320405",
"0.6227052",
"0.6225827",
"0.62219685",
"0.6217625",
"0.621541",
"0.62153745",
"0.6210515"
] | 0.7950519 | 3 |
retrieve the keys of the array (column titles) | function dbRowInsert($table_name, $form_data, $conn)
{
$fields = array_keys($form_data);
// build the query
$sql = "INSERT INTO ".$table_name."
(`".implode('`,`', $fields)."`)
VALUES('".implode("','", $form_data)."')";
// run and return the query result resource
return mysqli_query($conn, $sql);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getKeys() {\n\t\treturn array_keys( $this->array );\n\t}",
"public static function getColumnTitles()\n {\n return array_keys(self::$columns);\n }",
"public function keys() {\n\t\treturn array_keys($this->toArray());\n\t}",
"public static function keys(): array;",
"public function getKeys() {\n return array_keys($this->data);\n }",
"public function keys()\n {\n return array_keys($this->data);\n }",
"public function getArrayKeyEdit()\n {\n return array_keys($this->getShowColumn());\n }",
"public function keys()\n {\n return array_keys($this->_data);\n }",
"public function keys()\n {\n return array_keys($this->_data);\n }",
"public function keys(): array;",
"public function keys(): array;",
"public function keys(): array;",
"public function chiavi($array){\n\t\treturn array_keys($array);\n\t}",
"public function keys()\n {\n return array_keys($this->getArrayCopy());\n }",
"public function getArrayCampos()\n {\n $array = $this->get();\n $array = $array[ 0 ];\n\n return array_keys($array);\n }",
"public function keys() : array {\n return array_keys($this->getArrayCopy());\n }",
"private static function getColKeys($cols)\n\t{\n\t\treturn array_filter(array_map(function($v){return $v['key'];}, $cols), 'strlen');\n\t}",
"public function getColumnNames(): array\r\n {\r\n return array_keys($this->columns);\r\n }",
"public function keys() : array\n {\n return array_keys($this->entries);\n }",
"public function getKeys()\n\t{\n\t\treturn array_keys($this->_d);\n\t}",
"public function keys(): array\n {\n\t\treturn array_keys($this->values);\n\t}",
"public function keys() : array;",
"public function keys() : array;",
"public function getKeys(): array;",
"public function getArrayKeyCreate()\n {\n return array_keys($this->getShowColumnCreateModal());\n }",
"function print_titles($row){\n echo implode(array_keys($row), \",\") . \"\\n\";\n}",
"public function getKeys(): array\n {\n $keys = [];\n $arr = $this->items;\n foreach ($arr as $key=>$value) {\n $keys[] = $key;\n }\n return $keys;\n }",
"public function get_keys() {\n try{\n return array_keys($this->Items);\n }catch(Exception $e){\n throw $e;\n }\n }",
"public function getKeys () {\n\n return array_keys($this->values);\n\n }",
"public function getFieldNames() {\n\t\treturn array_keys($this->tca['columns']);\n\t}",
"public function getKeys() {\n $keys = array();\n foreach($this->mapping as $key => $value) {\n array_push($keys, $value);\n }\n return $keys;\n }",
"public function keys() {\n\t\treturn array_keys($this->_value);\n\t}",
"public function keys()\n {\n return array_keys($this->values);\n }",
"public function getColumnNames()\n {\n return array_keys($this->columns);\n }",
"public function keys(): array {\n return array_keys($this->items);\n }",
"public function getMetaForignKeys(){\n $stmt = $this->query(self::META_FKEYS_SQL);\n if ($stmt === false){\n return array();\n }\n\n $keys = array();\n foreach ($stmt as $row){\n $keys[$row[0] . '.' . $row[1]] = $row[2] . '.' . $row[3];\n }\n\n return $keys;\n }",
"public function keys() {\n return array_keys($this->values);\n }",
"final public static function getKeys(): array\n {\n return array_keys(static::getValues());\n }",
"public function keys() \r\n {\r\n return array_keys($this->elements);\r\n }",
"public function getArrayKeys()\n {\n $arrayKeys = [];\n foreach ($this->getOptionArray() as $key => $value) {\n $arrayKeys[] = $key;\n }\n return $arrayKeys;\n }",
"public function keys(): array\n {\n return array_keys($this->items);\n }",
"public function getIndexableMetaKeys(){\n\t\treturn array_keys( $this->keys );\n\t}",
"public function getKeys()\n {\n\t\tforeach ($this->_source as $key => $value)\n\t\t{\n\t\t\t$dummy[] = $key;\n\t\t}\n\t\treturn $dummy;\n }",
"public function keys()\n {\n return array_keys($this->collection);\n }",
"public function fieldNames()\n {\n $query = $this->_manager->createQuery('SELECT e FROM ' . $this->_entityName . ' e');\n //It will probably also fail with an empty table\n $query->setMaxResults(1);\n $results = $query->getArrayResult();\n $row = reset($results);\n return array_keys($row);\n }",
"public function keys()\n {\n return array_keys($this->_db);\n }",
"public function keys()\n {\n return array_keys($this->_db);\n }",
"public function getKeys()\n {\n return array_keys($this->elements);\n }",
"public function getRowKeys()\n {\n return $this->row_keys;\n }",
"abstract protected function getColumnsHeader(): array;",
"public function getColumnNamesOutKey()\r\n\t\t{\r\n\t\t\t$nameColumns = $this->getColumnsArray();\r\n\t\t\t$key = array_search($this->getTableKeyName(), $nameColumns);// Buscando a chave do ID\r\n\t\t\tunset($nameColumns[$key]); // Excluindo o ID do array\r\n\r\n\t\t\treturn implode(\",\", $nameColumns);// Retornando uma lista de colunas separadas por vígula sem o ID\t\t\r\n\t\t}",
"public function getKeys()\n {\n $keys = array();\n\n foreach ($this->items as $item) {\n $keys[] = $item['key'];\n }\n\n return $keys;\n }",
"public function keys()\n {\n return array_keys($this->list);\n }",
"public static function keys()\n {\n return array_keys(static::values());\n }",
"function keys()\n {\n return array_keys($this->keyTypes());\n }",
"function keys()\n {\n return array_keys($this->keyTypes());\n }",
"public function getTableKeys()\n\t{\n\t\treturn array_keys($this->tableObjects);\n\t}",
"public function getKeys();",
"public function metaKeys(): array\n {\n /** @var HasMetadataInterface $this */\n return Meta::metable(static::class, $this->id)\n ->pluck('key')\n ->toArray();\n }",
"public function valueKeys(): array;",
"public static function getHeadersArray() {\r\n\t\t$table = $_REQUEST[ self::$KEY_TABLE ];\r\n\t\t$array = Config::$TABLE_COLUMN_MAP[ $table ];\r\n\t\treturn $array;\r\n\t}",
"public static function getKeys(): array\n {\n return array_keys(self::getConstants());\n }",
"function getNameKeys($row) {\n\n\t$names = array();\n\t$key = \"\";\n\t$n = 0;\n\tforeach (array_keys($row) as $key) {\n\t\t// Test for odd number.\n\t\t// http://ca.php.net/manual/en/function.array-filter.php\n\t\t// Also works:\n\t\t//if ( ($n % 2) != 0 ) {}\n\t\tif ($n & 1) {\n\t\t\t$names[] = $key;\n\t\t\t//echo \"$n odd: $key\\n\";\n\t\t} else {\n\t\t\t1;\n\t\t\t//echo \"$n not-odd: $key\\n\";\n\t\t}\n\t\t$n++;\n\t}\n\n\treturn($names);\n\n//getNameKeys\n}",
"public function get_field_names(): array {\n\t\treturn array_keys( $this->data );\n\t}",
"function GetDBTableKeys()\n\t{\n\t\tglobal $dal_info;\n\t\tif( !array_key_exists($this->infoKey, $dal_info) || !is_array($dal_info[ $this->infoKey ]) )\n\t\t\treturn array();\n\t\t\n\t\t$ret = array();\n\t\tforeach($dal_info[ $this->infoKey ] as $fname=>$f)\n\t\t{\n\t\t\tif( @$f[\"key\"] )\n\t\t\t\t$ret[] = $fname;\n\t\t}\n\t\treturn $ret;\n\t}",
"public static function keys()\n {\n $container = static::getInstance();\n\n return array_keys($container->values);\n }",
"function getTableKeys(&$table) {\n $keys = array();\n for ($i = 0; $i < count($table); $i++) $keys = array_unique(array_merge($keys, array_keys($table[$i])));\n return $keys;\n}",
"function getTableKeys(&$table) {\n $keys = array();\n for ($i = 0; $i < count($table); $i++) $keys = array_unique(array_merge($keys, array_keys($table[$i])));\n return $keys;\n}",
"public function modelKeys()\n\t{\n\t\treturn array_map( function ( $m )\n\t\t{\n\t\t\treturn $m->getKey();\n\t\t}, $this->items );\n\t}",
"public function toArray() {\n return array_keys($this->elements);\n }",
"public function getPrimaryKeys()\n\t{\n\t\treturn array_keys($this->getArrayCopy());\n\t}",
"abstract public function getKeys();",
"public function keys()\n\t{\n\t\treturn $this->toBase()->keys();\n\t}",
"static function getKeys();",
"public function getColnames()\n {\n $res = [];\n foreach($this->columns as $colname => $col) $res[] = $colname;\n return $res;\n }",
"public function getColumnNames();",
"public function getKeys()\n {\n return $this->getNames();\n }",
"function isi_key($dataset)\n {\n global $ATRIBUT;\n $keys = array_keys($ATRIBUT);\n $arr = array();\n foreach ($dataset as $key => $val) {\n foreach ($val as $k => $v) {\n $arr[$key][$keys[$k - 1]] = strtolower($v);\n }\n }\n\n //echo '<pre>'.print_r($arr, 1).'</pre>'; \n return $arr;\n }",
"function show_keys($ar) {\r\n $temp = array();\r\n foreach ($ar as $k => $v ) {\r\n $temp[] = $k;\r\n if (is_array($v)) {\r\n $temp = array_merge($temp, $this->show_keys($v));\r\n }\r\n }\r\n return $temp;\r\n }",
"private function getLabelsArray()\n{\n \n $returnArray=array();\n \n //set up labels array.\n if (isset($this->tableStructure)) {\n foreach ($this->tableStructure as $ind => $fieldArray) {\n $returnArray[$fieldArray['columnName']]=isset($fieldArray['label']) ? $fieldArray['label'] : $fieldArray['columnName'];\n }\n }\n \n return $returnArray; \n}",
"abstract public function getColNames();",
"private static function getTitles($cols)\n\t{\n\t\treturn array_filter(array_map(function($v){return $v['title'];}, $cols));\n\t}",
"function key(){ \r\n\t return key($this->array); \r\n\t }",
"public static function getColumnLabels(): array {\n return array_values(self::attributeLabels());\n }",
"public function keys() {\n return array_keys($this->_hash);\n }",
"public function keys()\n {\n return array_keys($this->parameters);\n }",
"function &keys(){\n\t\tif ( isset($this->_cache[__FUNCTION__]) ) return $this->_cache[__FUNCTION__];\n\t\t$tables =& $this->tables();\n\t\t$out = array();\n\t\tforeach ( array_keys($tables) as $tablename){\n\t\t\t$keys =& $tables[$tablename]->keys();\n\t\t\tforeach ( array_keys($keys) as $fieldname){\n\t\t\t\t$out[$fieldname] =& $keys[$fieldname];\n\t\t\t}\n\t\t}\n\t\t$this->_cache[__FUNCTION__] =& $out;\n\t\treturn $out;\n\t\t\n\t}",
"public function getKeys(): array\n {\n return $this->keys;\n }",
"final protected function getKeysProperty(): ArrObject\n {\n return arr(array_keys($this->items));\n }",
"protected function getNonVersionArrayKeys()\n {\n return array('description', 'alternative');\n }",
"public static function listOfKeys()\n {\n return array_keys((new static)->_all);\n }",
"public function keys() {\n\t\treturn array_keys($this->store);\n\t}",
"function GetPrimaryKeys($fields) {\r\n \t$keys = array();\r\n for ($i = 0; $i < count($fields); $i++) {\r\n \tif ($fields[$i]['key'] == 'PRI') {\r\n\t \t$keys[] = $fields[$i]['name'];\r\n }\r\n }\r\n\r\n return $keys;\r\n }",
"public function getKeys() {}",
"public function keys()\n {\n return array_keys($this->stack);\n }",
"public function key() {\n\t\treturn key($this->array);\n\t}",
"public function arrayKeysValues()\n {\n return array(\n\t\t\t\"FirstName\" => $this->firstName,\n\t\t\t\"LastName\" => $this->lastName,\n\t\t\t\"Gender\" => $this->gender,\n\t\t\t\"YearOfBirth\" => $this->yearOfBirth,\n \"IdGenre\" => $this->genre,\n \"IsInGroup\" => $this->group\n\t\t);\n }",
"public function\n\t\tget_key_fields()\n\t{\n\t\tif (!isset($this->key_fields)) {\n\t\t\t$this->key_fields = array();\n\t\t\t\n\t\t\t$sxe = $this->get_simple_xml_element();\n\t\t\t\n\t\t\tforeach ($sxe->table->{'key-fields'}->field as $field) {\n\t\t\t\t#print_r($field);\n\t\t\t\t\n\t\t\t\t$this->key_fields[] = (string)$field['name'];\n\t\t\t}\n\t\t\t\n\t\t\t/*\n\t\t\t * If the key_fields array hasn't been set, use the default\n\t\t\t * values.\n\t\t\t */\n\t\t\tif (count($this->key_fields) < 1) {\n\t\t\t\t$this->key_fields = array('id');\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $this->key_fields;\n\t}",
"public function keys()\n {\n return array('id');\n }",
"public function keys()\n {\n return array('id');\n }",
"abstract public function keys(): Seq;"
] | [
"0.7494375",
"0.74094254",
"0.73938173",
"0.73215437",
"0.727407",
"0.72642845",
"0.7256036",
"0.723994",
"0.723994",
"0.7221871",
"0.7221871",
"0.7221871",
"0.7189188",
"0.7184829",
"0.7181903",
"0.71320975",
"0.71284986",
"0.7103097",
"0.70736206",
"0.70566213",
"0.70388794",
"0.70230377",
"0.70230377",
"0.7008926",
"0.6957545",
"0.6956061",
"0.69270366",
"0.691918",
"0.6903663",
"0.68891466",
"0.68825907",
"0.6877758",
"0.68712723",
"0.6856852",
"0.6853933",
"0.6849641",
"0.6845142",
"0.68163145",
"0.6810901",
"0.680865",
"0.68006563",
"0.6780461",
"0.67788374",
"0.67684215",
"0.6741417",
"0.67374474",
"0.67374474",
"0.67255056",
"0.67227954",
"0.67172515",
"0.6706797",
"0.67023814",
"0.66913",
"0.66838753",
"0.6681512",
"0.6681512",
"0.66287065",
"0.66238374",
"0.66237724",
"0.66156554",
"0.6605503",
"0.65511703",
"0.653767",
"0.65225136",
"0.65175223",
"0.648472",
"0.645536",
"0.645536",
"0.6452285",
"0.64383525",
"0.6433863",
"0.6433662",
"0.64296865",
"0.6417598",
"0.6408069",
"0.6406792",
"0.6396092",
"0.6391595",
"0.6384908",
"0.6378673",
"0.6367323",
"0.6345433",
"0.6336759",
"0.6335908",
"0.6333994",
"0.63119113",
"0.6303423",
"0.62988955",
"0.6296576",
"0.629232",
"0.6285489",
"0.6285051",
"0.62742555",
"0.6269771",
"0.6264075",
"0.62625086",
"0.6247435",
"0.62458265",
"0.62283677",
"0.62283677",
"0.62085253"
] | 0.0 | -1 |