query
stringlengths 9
43.3k
| document
stringlengths 17
1.17M
| metadata
dict | negatives
sequencelengths 0
30
| negative_scores
sequencelengths 0
30
| document_score
stringlengths 5
10
| document_rank
stringclasses 2
values |
---|---|---|---|---|---|---|
Save points for player1 (points is 0 from the beginning) from the game round and validate that the correct points were saved | public function testSavePointsPlayer1()
{
$game = new Game();
$game->roll();
$totalPoints = $game->sumCurrentGameRound();
$game->savePoints("Spelare1");
$savedPointsPlayer1 = $game->getPointsPlayer1();
$this->assertEquals($totalPoints, $savedPointsPlayer1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testSavePointsComputer()\n {\n $game = new Game();\n $game->roll();\n\n $totalPoints = $game->sumCurrentGameRound();\n $game->savePoints(\"Dator\");\n $savedPointsComputer = $game->getPointsComputer();\n\n $this->assertEquals($totalPoints, $savedPointsComputer);\n }",
"public function testGetPointsPlayer1()\n {\n $game = new Game();\n $res = $game->getPointsPlayer1();\n $exp = 0;\n $this->assertEquals($exp, $res);\n }",
"public function savePoints(string $currentPlayer)\n {\n $sumCurrentGameRound = $this->sumCurrentGameRound();\n\n if ($currentPlayer === \"Spelare1\") {\n $this->pointsPlayer1 += $sumCurrentGameRound;\n } elseif ($currentPlayer === \"Dator\") {\n $this->pointsComputer += $sumCurrentGameRound;\n }\n }",
"public function getPointsPlayer1() : int\n {\n return $this->pointsPlayer1;\n }",
"public function supportsSavepoints();",
"public function playerAnswer ($questionId , $answer , $timerClock) {\n\n // the main variables that will be used in the method\n $question = Question::find($questionId) ;\n $game = RunningGame::find(1) ;\n $timerClock = intval($timerClock) ;\n\n ///////////////// Calculating the points ////////////////////////////\n // the maximum points that you can get from a question is 25\n $questionPoints = 10 ;\n $timerFactor = intval ($timerClock * ( 5 / 15 ) ) ;\n if ( isset($question) ) {\n $difficultyFactor = $question->dif * 3 ;\n } else {\n $difficultyFactor = 0 ;\n }\n\n\n $totalPoints = $questionPoints + $timerFactor + $difficultyFactor ;\n\n //////////////////////////////////////////////////////////////////////\n\n // the time finished for the player\n // todo: i should make sure that when the timer finishes and both players already answered that i don't count that as a loss\n if ( $questionId == 0 ) {\n if (session()->get('player_number') == 1 ) {\n $game->user_1_answer = 2 ;\n $game->save() ;\n event(new GameEvent($game));\n } else {\n $game->user_2_answer = 2 ;\n $game->save() ;\n event(new GameEvent($game));\n }\n } else {\n\n\n if ( $answer == $question->answer ) {\n if (session()->get('player_number') == 1 ) {\n $game->user_1_answer = 1 ;\n $game->user_1_points = $game->user_1_points + $totalPoints ; // adding the points\n $game->save() ;\n event(new GameEvent($game));\n } else {\n $game->user_2_answer = 1 ;\n $game->user_2_points = $game->user_2_points + $totalPoints; // adding the points\n $game->save() ;\n event(new GameEvent($game));\n }\n $answer = 'correct';\n } else {\n if (session()->get('player_number') == 1 ) {\n $game->user_1_answer = 2 ;\n $game->save() ;\n event(new GameEvent($game));\n } else {\n $game->user_2_answer = 2 ;\n $game->save() ;\n event(new GameEvent($game));\n }\n $answer = 'wrong' ;\n }\n\n }\n\n if ( $game->user_1_answer != 0 && $game->user_2_answer != 0 ) {\n $game->user_1_answer = 0 ;\n $game->user_2_answer = 0 ;\n $game->question_id = $game->question_id + 1 ;\n $game->save() ;\n event(new NextQuesiton($game->question_id)) ;\n }\n\n return $answer ;\n }",
"public function a_point_has_correct_points()\n {\n $points = 100;\n\n $point = factory(Point::class)->create(['name' => 'Green', 'key' => 'green', 'points' => $points]);\n\n $this->assertEquals($points, $point->points);\n }",
"public function playerSaveScore()\n {\n $this->player->addScore($this->getRoundScore());\n $this->setRoundTurn(\"computer\");\n $this->resetRoundScore();\n }",
"public function save_production_point($form) {\n //unless it's the first time\n $form = (object)$form;\n if ($form->id_good == 0) return -4;\n \n //get the current state of the production point\n $ppoint = $this->db->select(\"id_player, id_good, pptype_id, active, plevel\")\n ->from(\"productionpoints\")\n ->where(\"id\",$form->row_id)\n ->get()->result()[0];\n //get the production point info\n $ppcost = $this->db->select(\"conv_cost as cost\")\n ->from(\"prodpoint_types\")\n ->where(\"id\", $ppoint->pptype_id)\n ->get()->result()[0]->cost;\n \n $this->db->trans_begin();\n if (($ppoint->id_good != $form->id_good) && ($ppoint->id_good != 0)) {\n //pay the conversion if changing the production \n $cost = $ppcost * $ppoint->plevel;\n $this->db->set(\"gold\",\"gold - $cost\",false)\n ->where(\"id\", $ppoint->id_player)\n ->where(\"gold >\", $cost)\n ->update(\"players\");\n if ($this->db->affected_rows() != 1) {\n $this->db->trans_rollback();\n return -1;\n } \n }\n $ppoint->id_good = $form->id_good;\n \n if ($ppoint->plevel < $form->plevel) {\n //pay the cost of the increased level\n $cost = $ppcost * ($form->plevel - $ppoint->plevel);\n $this->db->set(\"gold\",\"gold - $cost\",false)\n ->where(\"id\", $ppoint->id_player)\n ->where(\"gold >\", $cost)\n ->update(\"players\");\n if ($this->db->affected_rows() != 1) {\n $this->db->trans_rollback();\n return -2;\n } \n }\n $ppoint->plevel = $form->plevel;\n \n $ppoint->active = $form->active;\n unset($ppoint->id_player, $ppoint->pptype_id);\n $this->db->where(\"id\", $form->row_id)\n ->update(\"productionpoints\", $ppoint);\n if ($this->db->affected_rows() != 1) {\n $this->db->trans_rollback();\n return -3;\n } \n $this->db->trans_commit();\n return 1;\n }",
"public function supportsSavePoints(): bool\n {\n return true;\n }",
"public function save()\n {\n $thePlayer = $this->players[$this->currentPlayerIndex];\n $thePlayer->addResult($this->roundSum);\n $this->roundSum = 0;\n if ($thePlayer->getResult() >= GAMEGOAL) {\n return \"Winner\";\n } else {\n return \"\";\n }\n }",
"public function user_has_correct_amount_of_points()\n {\n $user = factory(User::class)->create();\n\n $subscriber = new Subscriber();\n\n $this->assertCount(0, $user->pointsRelation()->where('key', $subscriber->key())->get());\n\n $user->givePoints($subscriber);\n\n $this->assertCount(1, $user->pointsRelation()->where('key', $subscriber->key())->get());\n\n $this->assertEquals($subscriber->getModel()->points, $user->points()->number());\n }",
"public function saveScore()\n {\n if (!($this->gameOver())) {\n $this->players[$this->activePlayer]->saveScore();\n $this->nextPlayer();\n }\n }",
"public function testGameStatusPointsPlayer1Over100()\n {\n $game = new Game(101, 0);\n $res = $game->checkGameStatus();\n $exp = true;\n $this->assertEquals($exp, $res);\n }",
"public function testSetPoints()\n {\n $dice = new Dice2();\n $this->assertInstanceOf(\"\\Alfs\\Dice2\\Dice2\", $dice);\n\n $dice->setPoints(10);\n $res = $dice->getPoints();\n $exp = 10;\n $this->assertEquals($exp, $res);\n }",
"public function testWinningPoint()\n {\n $diceGame = new DiceGame();\n $this->assertInstanceOf(\"\\Chai17\\Dice\\DiceGame\", $diceGame);\n $diceGame->setWinningPoint(50);\n $res = $diceGame->getWinningPoint();\n $exp = 50;\n $this->assertEquals($exp, $res);\n }",
"public function testGetPointsComputer()\n {\n $game = new Game();\n $res = $game->getPointsComputer();\n $exp = 0;\n $this->assertEquals($exp, $res);\n }",
"public function calculateAndSavePointsOfPlis(){\r\n\t\tif($this->getIdDonne()<1) return;\r\n\t\t$plis = Pli::getPlisDonne($this->getIdDonne());\r\n\t\tif(empty($plis)) return;\r\n\t\t$result = array(1 => 0,0);\r\n\t\tforeach ($plis as $pli){\r\n\t\t\t$winnerPlayer = $pli->getWinner();\r\n\t\t\tif($winnerPlayer > 0 || $winnerPlayer < 5){\r\n\t\t\t\t$winnerTeam = Player::getNrTeamByNrPlayer($winnerPlayer);\r\n\t\t\t\t$result[$winnerTeam] += $pli->getResult();\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->setResult($result);\r\n\t\t$this->save();\r\n\t}",
"function calculatePoints($quiz_id, $quiz_publish_status, $achievement_array){\n\t\tinclude(\"quizrooDB.php\");\n\t\tinclude(\"variables.php\");\n\t\t\n\t\t// check if user has already taken this quiz\n\t\t$timesTaken = $this->timesTaken($quiz_id);\n\t\t\n\t\t// we follow through only if retakes are allowed and the quiz is published\n\t\tif(($timesTaken == 1 || $GAME_REWARD_RETAKES) && $quiz_publish_status){\n\t\t\t// The following factors should be fulfilled before points are awarded\n\t\t\t// - first time taking this question OR always reward flag on\n\t\t\t// - quiz is published\n\t\n\t\t\t// get the multiplier value\n\t\t\t$multiplier = $this->getMultiplier();\n\t\t\t\n\t\t\t// calculate the points by multiplier\n\t\t\t$points = $GAME_BASE_POINT + ($multiplier - 1) * ($GAME_MULTIPLIER);\n\t\t\t\n\t\t\t// check the current member stats (for level up calculation later)\n\t\t\t$old_level = $this->level;\n\t\t\t$old_score = $this->quiztaker_score;\n\t\t\t\n\t\t\t// check if the there is a levelup:\n\t\t\t///////////////////////////////////////\n\t\t\t\n\t\t\t// check the level table \n\t\t\t$queryCheck = sprintf(\"SELECT id FROM `g_levels` WHERE points <= (SELECT `quiztaker_score`+`quizcreator_score` FROM s_members WHERE member_id = %s)+%s ORDER BY points DESC LIMIT 0, 1\", $this->id, $points);\n\t\t\t$getResults = mysql_query($queryCheck, $quizroo) or die(mysql_error());\n\t\t\t$row_getResults = mysql_fetch_assoc($getResults);\n\t\t\t$new_level = $row_getResults['id'];\n\t\t\tmysql_free_result($getResults);\n\t\t\t\n\t\t\tif($new_level > $old_level){\n\t\t\t\t// a levelup has occurred\n\t\t\t\t$achievement_array[] = $new_level;\t// provide the ID of the level acheievement\n\t\t\t\t\n\t\t\t\t// update the member table to reflect the new level\n\t\t\t\t$queryUpdate = sprintf(\"UPDATE s_members SET quiztaker_score = quiztaker_score + %s, quiztaker_score_today = quiztaker_score_today + %s, level = %d WHERE member_id = %s\", $points, $points, $new_level, $this->id);\n\t\t\t}else{\n\t\t\t\t// just update the member table to reflect the points\n\t\t\t\t$queryUpdate = sprintf(\"UPDATE s_members SET quiztaker_score = quiztaker_score + %s, quiztaker_score_today = quiztaker_score_today + %s WHERE member_id = %s\", $points, $points, $this->id);\n\t\t\t}\n\t\t\t// execute the update statement\n\t\t\tmysql_query($queryUpdate, $quizroo) or die(mysql_error());\t\n\t\t}\n\t\t// return the array\n\t\treturn $achievement_array;\n\t}",
"function main(){\n session_start();\n // check if is made session with player\n if(!is_player_logged()){\n http_response_code(403);\n return false;\n }\n // check if can throw cube\n if (!can_throw_cube()){\n http_response_code(403);\n return false;\n }\n\n $player_id = $_SESSION['player_id'];\n // random number\n $points = rand(1, 6);\n // set result to game\n $game_id = $_SESSION['game_id'];\n DbManager::make_no_result_querry(\n \"UPDATE games SET last_throw_points = $points WHERE id = $game_id\");\n DbManager::make_no_result_querry(\n \"UPDATE games SET throwed_cube = 1 WHERE id = $game_id\");\n // set to player status 4 so they can move pawns\n DbManager::make_no_result_querry(\n \"UPDATE players SET status = 4 WHERE id = $player_id\");\n // change if pawns can be moved in game\n BoardManager::load_move_status_for_pawns($game_id);\n\n set_public_action_made();\n\n echo json_encode([\"points\" => $points]);\n return true;\n}",
"public function checkGameStatus() : bool\n {\n if ($this->pointsPlayer1 >= 100 || $this->pointsComputer >= 100) {\n return true;\n } else {\n return false;\n }\n }",
"public function automaticPayOutPlayer1($player1Id, $player2, $myGameId, $prizeId) {\n\t\t\t\n\t\t$alias2 = $post['alias2'];\n\t\t$fname1 = $post['fname1'];\n\t\t$email = stripslashes($_POST['player_email']);\n\t\t$mnt =$email.\" has been awarded by admin as winner\";\n\t\t//$prizeId = $post['prizeId'];\n\t\t$sta =\"Won\";\n\t\t$sta1 =\"Lose\";\n\t\t$winstatus ='awarded';\n\t\t$gcount='1';\n\t\t//update game award status\n\t\t$sql = new MYSQL;\n\t\t$query = $sql->update(' game g ');\n\t\t$query .= $sql->set(\" g.win_status ='\". $winstatus .\"', g.game_count ='\". $gcount .\"' \");\n\t\t$query .= $sql->where( 'g.id=' . $myGameId);\n\t\t$rows = DBASE::mysqlUpdate($query);\n\t\t\n\t\t$sql = new MYSQL;\n\t\t$query = $sql->update(' gaming_player1 gp1 ');\n\t\t$query .= $sql->set(\" gp1.win_status ='\". $sta .\"' \");\n\t\t$query .= $sql->where( \" gp1.gameId = \" . $myGameId . \" AND gp1.player_1 = \" . $player1Id . \" \" );\n\t\t$rows = DBASE::mysqlUpdate($query); \n\t\t\n\t\t//update winner\n\t\t$sql = new MYSQL;\n\t\t$query = $sql->update(' gaming_player2 gp1');\n\t\t$query .= $sql->set(\" gp1.win_status ='\". $sta1 .\"' \");\n\t\t$query .= $sql->where( \" gp1.gameId = \" . $myGameId . \" AND gp1.player_2 = \" . $player2 . \" \" );\n\t\t$rows = DBASE::mysqlUpdate($query);\n\t\t\n\t\t$sql = new MYSQL;\n\t\t$query = $sql->update(' gaming_wallet ');\n\t\t$query .= $sql->set(\" balance = balance-$prizeId\");\n\t\t$rows = DBASE::mysqlUpdate($query);\n\t\t\n\t\t$sql = new MYSQL;\n\t\t$query = $sql->update('gaming_player1 gb, balance b ');\n\t\t$query .= $sql->set(\" b.balance = balance+$prizeId\");\n\t\t$query .= $sql->where( ' b.uid = gb.player_1 and gb.gameId=' . $myGameId);\n\t\t$rows = DBASE::mysqlUpdate($query);\n\t\t\n\t\t//sent email\n\t\t\n\t\t$to = $email;\n\t\t$cc = SYSTEM_EMAIL;\n\t\t$bcc = \"[email protected]\";\n\t\t$from = SYSTEM_EMAIL;\n\t\t$subject = SITE_NAME_SHORT .' - Gaming Kitchen WON Game';\n\t\t\n\t\t$body = '\n\t\t\t\t<p>Dear '.$fname1.'</p>\n\t\t\t\t<p>Congratulations, you have WON the game '.$myGameId.' vs. '.$alias2.' and received Ksh '.$prizeId.'</p>\n\t\t\t\t<p>Regards,<br>'.SITE_NAME_SHORT.'</p>\n\t\t\t\t\t\t\n\t\t\t\t';\n\t\t\n\t\t$sent = baseModel::sendmail( $from, $to, $cc, $bcc, $subject, $body ) ;\n\t\t\n\t\n\t\t\n\t}",
"function save_player_data()\n\t{\n\t\tglobal $database;\n\t\t$database->update_where('lg_game_players',\n\t\t\t\"game_id = '\".$database->escape($this->player_data['game_id']).\"' \n\t\t\tAND player_id = '\".$this->player_data['player_id'].\"'\"\n\t\t\t,$this->player_data);\t\n\t}",
"private function calculateUserPoints(){\n $mytipsRepository = new MytipsRepository();\n $encounterRepository = new EncounterRepository();\n $userRepository = new UserRepository();\n $tips = $mytipsRepository->readAll();\n $encounters = $encounterRepository->getEncountersAlreadyPlayed(date(\"Y-m-d\"));\n foreach($tips as $tip){\n foreach($encounters as $encounter){\n if($encounter->id == $tip->begegnung_id){\n $user = $userRepository->readById($tip->benutzer_id);\n if($encounter->homegoals == $tip->homegoals){\n $user->punkte = $user->punkte + 1;\n }\n \n if($encounter->awaygoals == $tip->awaygoals){\n $user->punkte = $user->punkte + 1;\n }\n\n if($tip->homegoals > $tip->awaygoals && $encounter->homegoals > $encounter->awaygoals){\n $user->punkte = $user->punkte + 1;\n }\n\n if($tip->homegoals < $tip->awaygoals && $encounter->homegoals < $encounter->awaygoals){\n $user->punkte = $user->punkte + 1;\n }\n $userRepository->updateUserPoints($user->id, $user->punkte);\n $mytipsRepository->deleteById($tip->id);\n }\n }\n }\n }",
"public function generationPlayer() {\n if ($this->isUserConnected()) {\n $session = $this->request->session();\n $idPlayer = $session->read('playerId');\n $isFree = false;\n\n// While we don't find a free square\n while ($isFree == false) {\n $x = rand(0, self::LENGTH - 1);\n $y = rand(0, self::WIDTH - 1);\n $isFree = $this->findFreeSquare($x, $y);\n }\n\n $fighter = $this->Fighters->getFighter($idPlayer);\n $fighter->coordinate_x = $x;\n $fighter->coordinate_y = $y;\n\n $this->Fighters->save($fighter);\n }\n }",
"public function update(Player $player, $game, $points, Party $party = null)\n {\n /**\n * Initialize variables\n */\n $gameVariant = $this->asGameVariant($game);\n $scoreData = $this->getScoreData($player, $gameVariant);\n \n /**\n * Update points\n */\n $scoreData->setPoints($points);\n \n /**\n * Add a points value in time\n */\n $stat = $this->createStatistic($player, $points, $gameVariant, $party);\n \n /**\n * Save in database\n */\n $this->em->persist($stat);\n \n return $scoreData;\n }",
"public function checkPoint($choices = array()) {\n\t\t$points = false;\n\t\tforeach ($choices as $key => $choice) {\n\t\t\tif ($choice['points'] != '0.00') {\n\t\t\t\t$points = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $points;\n\t}",
"public function testGetPoints()\n {\n $dice = new Dice2();\n $this->assertInstanceOf(\"\\Alfs\\Dice2\\Dice2\", $dice);\n\n $res = $dice->getPoints();\n $exp = 0;\n $this->assertEquals($exp, $res);\n }",
"public function saveplayer($player)\n\t{\n\t\t$error = false;\n\n\t\tforeach($player AS $var => $value)\n\t\t{\n\t\t\t$player[$var] = trim($value);\n\t\t}\n\t\t\n\t\tif (empty($player['handicap']) OR $player['handicap'] < 0 OR $player['handicap'] > 40)\n\t\t{\n\t\t\t$msg = '<div class=\"output\" style=\"color:red;\">Invalid Handicap</div>';\n\t\t\t$error = true;\n\t\t}\n\n\t\tif (empty($player['msisdn']) OR $player['msisdn'][0] !== '0' OR strlen($player['msisdn']) <> 10)\n\t\t{\n\t\t\t$msg = '<div class=\"output\" style=\"color:red;\">Invalid Phone Number</div>';\n\t\t\t$error = true;\n\t\t}\t\t\n\n\t\tif(empty($player['email']) OR !filter_var($player['email'], FILTER_VALIDATE_EMAIL))\n\t\t{\n\t\t\t$msg = '<div class=\"output\" style=\"color:red;\">Invalid Email Address</div>';\n\t\t\t$error = true;\n\t\t}\t\t\n\n\t\tif (empty($player['name']) OR strlen($player['name']) < 5)\n\t\t{\n\t\t\t$msg = '<div class=\"output\" style=\"color:red;\">Invalid Player Name</div>';\n\t\t\t$error = true;\n\t\t}\n\n\t\tif (empty($player['club']) OR strlen($player['club']) < 5)\n\t\t{\n\t\t\t$msg = '<div class=\"output\" style=\"color:red;\">Invalid Club Name</div>';\n\t\t\t$error = true;\n\t\t}\n\n\t\tif ( !isset($player['terms']) OR $player['terms'] !== 'yes' )\n\t\t{\n\t\t\t$msg = '<div class=\"output\" style=\"color:red;\">You have to accept the T&C\\'s to participate</div>';\n\t\t\t$error = true;\n\t\t}\n\n\t\tif (!$error)\n\t\t{\t\t\n\t\t\t\t\t\t\t$player['sex'] = ($player['sex'] == 'male') ? 1 : 0;\n\t\t\t\t\t\t\t$player['club'] = ucwords($player['club']);\n\t\t\t\t\t\t\t$player['name'] = ucwords($player['name']);\n\n\t\t\t\t\t\t\t$Model = new Model($this->config);\n\t\t\t\t\t\t\t$result = $Model->savePlayer($player);\n\t\t\t\t\t\t\tif (!$result) return false;\n\t\t} else {\n\t\t\t\t\t\t\t$contact = '<div class=\"form-labels\"><input type=\"text\" name=\"msisdn\" size=\"15\" maxlength=\"10\" value = \"' . $player['msisdn'] . '\"/>Cellphone Number</div>\n\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"form-labels\"><input type=\"text\" name=\"email\" size=\"25\" maxlength=\"30\" value = \"' . $player['email'] . '\"/>Email Address</div>';\n\t\t\t\t\t\t\t$sex = '<div class=\"form-labels\"><input type=\"radio\" name=\"sex\" ';\n\t\t\t\t\t\t\tif ($player['sex'] == 'male') $sex .= 'checked=\"checked\" ';\n\t\t\t\t\t\t\t$sex .= 'value=\"male\">Male <input type=\"radio\" name=\"sex\" ';\n\t\t\t\t\t\t\tif ($player['sex'] == 'female') $sex .= 'checked=\"checked\" ';\n\t\t\t\t\t\t\t$sex .= 'value=\"female\">Female</div>';\n\t\t\t\t\t\t\t$handicap = '<div class=\"form-labels\"><input type=\"text\" name=\"handicap\" size=\"5\" maxlength=\"2\" value = \"' . $player['handicap'] . '\"/>Handicap</div>'; \n\t\t\t\t\t\t\t$name = '<div class=\"form-labels\"><input type=\"text\" name=\"name\" size=\"25\" maxlength=\"30\" value = \"' . $player['name'] . '\"/>Player Name</div>';\n\t\t\t\t\t\t\t$club = '<div class=\"form-labels\"><input type=\"text\" name=\"club\" size=\"25\" maxlength=\"30\" value = \"' . $player['club'] . '\"/>Home Club</div>';\n\t\t\t\t\t\t\t$terms = '<div class=\"form-labels\">I have read and accept the competition<br>rules, terms and conditions ';\n\t\t\t\t\t\t\t$terms .= '<input type=\"radio\" name=\"terms\" value=\"yes\" ';\n\t\t\t\t\t\t\tif (isset($player['terms']) AND $player['terms'] == 'yes') $terms .= 'checked=\"checked\"';\n\t\t\t\t\t\t\t$terms .= '>Yes <input type=\"radio\" name=\"terms\" value=\"no\" ';\n\t\t\t\t\t\t\tif (isset($player['terms']) AND $player['terms'] == 'no') $terms .= 'checked=\"checked\"';\n\t\t\t\t\t\t\t$terms .= '>No<br></div>';\n\t\t\t\t\t\t\t$saga = '<input type=\"hidden\" name=\"id\" value=\"' . $player['id'] . '\">';\n\t\t\t\t\t\t\t$output = $msg . $sex . $handicap . $contact . $name . $club . $terms . $saga;\n\t\t\t\n\t\t\t\t\t\t\treturn $output;\t\t\t\t\n\t\t}\n\t\treturn true;\n\t}",
"public function saveGame(){\n\t\t$dbObject = new DatabaseHelper();\n\t\t$query = \"INSERT INTO gametracker (ai_score, player_score, difficulty, rounds, initial_hand_score) VALUES (\".$this->ai_score.\", \".$this->player_score.\", \".$this->difficulty.\", \".$this->rounds.\", \".$this->hand_improvement.\")\";\n\t\t$dbObject->executeInsert($query);\n\t}"
] | [
"0.70431256",
"0.65421045",
"0.6446942",
"0.6087142",
"0.6086933",
"0.6062781",
"0.5943241",
"0.5893213",
"0.5886318",
"0.5813997",
"0.5813924",
"0.58057326",
"0.57739985",
"0.5764869",
"0.574732",
"0.5710844",
"0.5664254",
"0.562979",
"0.5627954",
"0.5625009",
"0.5589625",
"0.5529712",
"0.5522055",
"0.5514101",
"0.5505902",
"0.5470622",
"0.5460491",
"0.54448515",
"0.54411286",
"0.5441098"
] | 0.8201525 | 0 |
Sets driver native error message. | public function setNativeError($msg)
{
$this->nativeError = $msg;
$this->message .= " [Native Error: " .$this->nativeError . "]";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setError($msg);",
"public function setAppMsgError ($v)\n {\n\n // Since the native PHP type for this column is string,\n // we will cast the input to a string (if it is not).\n if ( $v !== null && !is_string ($v) )\n {\n $v = (string) $v;\n }\n\n if ( $this->app_msg_error !== $v )\n {\n $this->app_msg_error = $v;\n }\n }",
"public function setError(\n /*# string */ $message = '',\n /*# int */ $code = 0\n );",
"function setErrorMessage($msg){\n $this->_errormessage = $msg;\n }",
"public function set_error($message)\n\t{\n\t\t$this->_error = $message;\n\t}",
"function SetError($msg) {\r\n $this->error_count++;\r\n $this->ErrorInfo = $msg;\r\n }",
"protected function setError ($message) {\r\n $this->errorMessage[]=$messge;\r\n }",
"function SetError($msg) {\n $this->error_count++;\n $this->ErrorInfo = $msg;\n }",
"protected function setErrorMessage($message) {\n\t\t$this->message = $message;\n\t}",
"public static function setMessegeError($msg){\n\n\t\t$_SESSION[Message::MESSAGEM_ERRO] = $msg;\n\n\t}",
"function errorSet($msg)\n {\n $GLOBALS['_Common_Errors'][] = array('set', $msg);\n }",
"public function error(string $message) {}",
"protected function SetError($msg) {\n $this->error_count++;\n $this->ErrorInfo = $msg;\n }",
"static function error($message = \"\") {\n\t\t$JS_message = Convert::raw2js($message);\n\t\tself::$status_messages['bad'] = $JS_message;\n\t}",
"public function error($message){}",
"abstract protected function _getErrorString();",
"public function setMessage($msg){\n $this->_warning_message = $msg;\n }",
"protected function setMessage()\n {\n $this->message = sprintf($this->message, $this->providedValue, $this->currentDomain);\n }",
"public function setError($message)\n\t{\n\t\t$this->message[\"error\"] = $message; \n\t\t$this->message[\"alert\"]\t= \"error\";\t\n\t}",
"protected function SetError($msg)\n\t {\n\t $this->error_count++;\n\t $this->errorInfo = $msg;\n\t }",
"public static function setError($msg)\n\t{\n\t\t$_SESSION[Order::ERROR] = $msg;\n }",
"protected static function SET_ERROR($msg)\n {\n ++self::$error_count;\n if ('smtp' === self::$Mailer && null !== self::$smtp) {\n $lasterror = self::$smtp::GET_ERROR();\n // if (!empty($lasterror['error'])) {\n\n // $msg .= self::$lang('smtp_error') . $lasterror['error'];\n // if (!empty($lasterror['detail'])) {\n // $msg .= ' ' . self::$lang('smtp_detail') . $lasterror['detail'];\n // }\n // if (!empty($lasterror['smtp_code'])) {\n // $msg .= ' ' . self::$lang('smtp_code') . $lasterror['smtp_code'];\n // }\n // if (!empty($lasterror['smtp_code_ex'])) {\n // $msg .= ' ' . self::$lang('smtp_code_ex') . $lasterror['smtp_code_ex'];\n // }\n // }\n }\n self::$ErrorInfo = $msg;\n }",
"public function setError($msg) {\n $this->errors[] = $msg;\n }",
"public function defaultErrorMessage(){\n $this->type_sms = MessageType::ERROR;\n return \"Ocurrió un error al generar los archivos del \".$this->classNameToLower($this->typeOfFile());\n }",
"public static function setMsgError($msg)\n {\n $_SESSION[Cart::SESSION_ERROR] = $msg;\n }",
"public function setErrorMessage( $pValue )\n {\n $this->strErrorMessage = $pValue;\n }",
"public function error($message){ }",
"protected function setError($msg) {\r\n $this->errors[] = $msg;\r\n }",
"public function setError($errmsg) {\n $this->status = 'error';\n $this->errmsg .= StrUtil::exConcat($this->errmsg, ' - ', $errmsg);\n }",
"private function error($sMessage) {\n\n\t\tfwrite($this->rStdErr, \"\\033[0;31mERROR: \\033[0m\" . $sMessage);\n\t}"
] | [
"0.68964577",
"0.6877075",
"0.67709756",
"0.6543579",
"0.63718134",
"0.6282723",
"0.6240796",
"0.6220877",
"0.6173503",
"0.61676246",
"0.61107206",
"0.6090308",
"0.6054322",
"0.60466903",
"0.59965026",
"0.5979854",
"0.5961685",
"0.59610516",
"0.59572595",
"0.59566265",
"0.59240294",
"0.5912658",
"0.58675396",
"0.58669114",
"0.586689",
"0.5853928",
"0.58357835",
"0.5830331",
"0.58134",
"0.58089834"
] | 0.7609742 | 0 |
Gets driver native error message. | public function getNativeError()
{
return $this->nativeError;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getError(): string\n {\n $error_array = self::$statement->errorInfo();\n if (!is_array($error_array) || count($error_array) < 3) {\n return 'Generic error in PdoMySql::getError';\n }\n return $error_array[2];\n }",
"function get_error_message()\n\t{\n\t\treturn $this->error;\n\t}",
"function get_error_message() {\n\t\treturn $this->error;\n\t }",
"function getErrorMsg() {\n\t\treturn $this->error_msg;\n\t}",
"public function getMessage(): string\n {\n return $this->database->getMessage();\n }",
"public function getErrorMsg()\r\n\t{\r\n\t\tif($this->getConnection() == null)\r\n\t\t{\r\n\t\t\tthrow new Lumine_Dialect_Exception('Conexão não setada');\r\n\t\t}\r\n\t\treturn $this->getConnection()->getErrorMsg();\r\n\t}",
"public function get_error_message()\n {\n return $this->error_message;\n }",
"public function getMessage()\n {\n if (isset($this->data['errors'])) {\n foreach ($this->data['errors'] as $error) {\n if(isset($error['errorMessage'])) {\n return $error['errorMessage'];\n }\n }\n } else if(isset($this->data['errorMessage'])) {\n return $this->data['errorMessage'];\n }\n\n return null;\n }",
"public function message()\n {\n return $this->errorMessage;\n }",
"public function message()\n {\n return __($this->error_message);\n }",
"public function getErrorDesc() {\r\n\t\tif ($this->pdo !== null) {\r\n\t\t\t$errorInfoArray = $this->pdo->errorInfo();\r\n\t\t\tif (isset($errorInfoArray[2])) return $errorInfoArray[2];\r\n\t\t}\r\n\t\treturn '';\r\n\t}",
"public function message(): string\n {\n return $this->lastError;\n }",
"public function get_error_message() {\n\n\n }",
"public function get_error_message() {\r\n\t\treturn $this->last_error;\r\n\t}",
"public function error_message()\n {\n return $this->_error_message;\n }",
"public function getLastError()\r\n\t{\r\n\t\treturn \"\";\r\n\t}",
"public function getErrorDesc() {\n\t\treturn @sqlite_error_string($this->getErrorNumber());\n\t}",
"abstract public function getMsgError();",
"public function getMessage()\n {\n if (isset($this->data->error)) {\n return (string) $this->data->error;\n }\n\n return '';\n }",
"public function error_message(){\n\t\treturn $this->_errormsg;\n\t}",
"public function message()\n {\n return $this->error_message;\n }",
"public function getErrorMessage() : string\n {\n return $this->error_message;\n }",
"abstract protected function _getErrorString();",
"public function getDiagnosticMessage();",
"public function error(): string\n {\n return $this->message;\n }",
"public function getErrorMessage() {\n\t\treturn $this->getMessage();\n\t}",
"public function errorMessage() {\n if ( !$this->isOK() ) {\n $errors = $this->body->Message();\n return (string)$errors[0];\n }\n }",
"public function getErrorMessage(): string\n {\n if (!$this->errorMessage) {\n return $this->getMessage();\n }\n\n return $this->errorMessage;\n }",
"public function getErrorDesc() {\n\t\tif($this->pdoStatement !== null) {\n\t\t\tif(isset($this->pdoStatement->errorInfo()[2])) {\n\t\t\t\treturn $this->pdoStatement->errorInfo()[2];\n\t\t\t}\n\t\t}\n\t\treturn '';\n\t}",
"public static function getErrorMessage()\r\n\t{ \r\n\t\treturn\r\n\t\t\tHybrid_Auth::storage()->get( \"hauth_session.error.message\" );\r\n\t}"
] | [
"0.720846",
"0.701186",
"0.7002615",
"0.6894363",
"0.6879486",
"0.6851615",
"0.68099946",
"0.67957735",
"0.6789043",
"0.6776118",
"0.6755763",
"0.67546934",
"0.6751401",
"0.67495453",
"0.6714537",
"0.6713801",
"0.6709786",
"0.6699812",
"0.66848385",
"0.6673141",
"0.6672276",
"0.6654395",
"0.66507566",
"0.66474503",
"0.66452295",
"0.66432685",
"0.66417515",
"0.66399497",
"0.6638264",
"0.6632019"
] | 0.73039186 | 0 |
Set the layout id for this tab. | public function setLayout($layout); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setLayoutId($layoutId) {\n\t\treturn $this->setData('layoutId', $layoutId);\n\t}",
"public function set_layout($layout)\n {\n $this->layout = $layout;\n }",
"protected function setLayout($layout) {\n \t$this->layout = $layout;\n }",
"public function setLayout($layout) {\n $this->layout= $layout;\n }",
"public function setLayout($layout){\n $this->_layout=$layout;\n }",
"public function set_layout($name) {\n $this->layout = $name;\n }",
"protected function setLayout($layout)\n {\n }",
"public function setLayout($layout){\n\t\t$this->_layout=$layout;\n\t\t\n\t\t\n\t}",
"public function setLayout($layout)\n {\n $this->layout= $layout;\n }",
"public function setLayout($layout) {\n\t\t$this->layout = $layout;\n\t}",
"public function setLayout($layout)\n {\n $this->layout = $layout;\n\n }",
"function getLayoutId() {\n\t\treturn $this->getData('layoutId');\n\t}",
"protected function setLayout($layout)\n {\n $this->layout = $layout;\n }",
"protected function setLayout ($layout)\n {\n $this->_layout = $layout;\n }",
"public function setLayout(string $layout) : void\n {\n $this->layout = $layout;\n }",
"protected function setLayout () {\n\t\tif ($this->_getParam('catalog')) {\n\t\t\t$config = Zend_Registry::getInstance()->config;\n\t\t\tif (count($config->catalog->layouts)) {\n\t\t\t\t$catalogId = $this->_helper->osidId->fromString($this->_getParam('catalog'));\n\t\t\t\tforeach ($config->catalog->layouts as $layoutConfig) {\n\t\t\t\t\tif ($catalogId->isEqual(new phpkit_id_URNInetId($layoutConfig->catalog_id))) {\n\t\t\t\t\t\t$this->_helper->layout()->setLayout($layoutConfig->layout);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function setSelectedLayout($layout)\n {\n $this->selected_layout = $layout;\n }",
"function setLayout($layout)\n {\n // override me\n }",
"function set_layout($layout) {\r\n $this->layout = $layout;\r\n $this->load_area_array = $this->_get_load_area();\r\n }",
"public function set_default_layout()\n\t{\n\t\t$layout_id = $this->EE->input->get('layout_id');\n\n\t\tif($this->_super_admin AND $layout_id != '' AND is_numeric($layout_id))\n\t\t{\n\t\t\t$this->_model->set_default_layout($layout_id);\n\n\t\t\t$this->EE->session->set_flashdata('dashee_msg', lang('flash_layout_updated'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->EE->session->set_flashdata('dashee_msg', lang('flash_layout_not_updated'));\n\t\t}\n\n\t\t$this->EE->functions->redirect(cp_url('cp/addons_modules/show_module_cp', array('module' => 'dashee', 'method' => 'settings')));\n\t}",
"public function setLayout()\n {\n if($this->template != false && isset($this->template['layout_id']) && $this->template['layout_id'] != 0)\n {\n $record = NotificationDAO::getLayout($this->template['layout_id'], $this->language);\n if($record != false)\n {\n $this->layout = $record['content'];\n }\n }\n }",
"function setLayout(AbstractLayout $layout)\n {\n $this->layout = $layout;\n }",
"function setLayoutFileId($layoutFileId) {\n\t\treturn $this->setData('layoutFileId', $layoutFileId);\n\t}",
"function setLayoutFileId($layoutFileId) {\n\t\treturn $this->setData('layoutFileId', $layoutFileId);\n\t}",
"public function set_default_layout()\n\t{\n\t\t$layout_id = $this->_EE->input->get('layout_id');\n\t\t\n\t\tif($this->_super_admin AND $layout_id != '' AND is_numeric($layout_id))\n\t\t{\n\t\t\t$this->_model->set_default_layout($layout_id);\n\t\t\t\n\t\t\t$this->_EE->session->set_flashdata('dashee_msg', lang('flashLayoutUpdated'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_EE->session->set_flashdata('dashee_msg', lang('flashLayoutNotUpdated'));\n\t\t}\n\t\t\n\t\t$this->_EE->functions->redirect($this->_base_url.AMP.'method=settings');\n\t}",
"public function setLayout($path)\n {\n $this->_layout = $path;\n }",
"public function getLayoutUid()\n {\n return null !== $this->getLayout() ? $this->getLayout()->getUid() : '';\n }",
"public function setLayout ( array $layout )\n\t{\n\t\t$this->_layout = $layout;\n\t}",
"public function setLayout($name)\n\t{\n\t\t$path = WEB_PATH . DS . 'layout' . DS . $name . '.php';\n\n\t\tif(file_exists($path))\n\t\t{\n\t\t\t$this->_path['layout'] = $path;\n\t\t}\n\t}",
"public function setLayout($layoutName)\n {\n $this->_layout = empty($layoutName) ? null : $layoutName.$this->_suffix;\n }"
] | [
"0.6377642",
"0.6197518",
"0.6184002",
"0.61718094",
"0.61670434",
"0.61407876",
"0.6130218",
"0.6126867",
"0.6121253",
"0.60726905",
"0.60573757",
"0.6045073",
"0.60284054",
"0.5999015",
"0.5996035",
"0.59059155",
"0.5824264",
"0.58224213",
"0.580214",
"0.57290477",
"0.5710869",
"0.5654295",
"0.56214404",
"0.56214404",
"0.5587026",
"0.55434006",
"0.5533587",
"0.5523326",
"0.5518423",
"0.5508254"
] | 0.6241722 | 1 |
Get the relationship definitions. | public function getRelationships(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function getRelations();",
"public function getRelationships() {\n return $this->relationships;\n }",
"function getRelationshipList ()\n {\n return $this->implementation->getRelationshipList () ;\n }",
"public function getRelationships()\n {\n return $this->relationships;\n }",
"public function definitions()\n {\n return $this->hasMany('App\\Definition');\n }",
"public function definitions()\n {\n return $this->hasMany('App\\Definition');\n }",
"abstract protected function getRelations();",
"public function getRelationships(): array;",
"public function getRelations()\n {\n return $this->relations;\n }",
"public function getRelations(): array\n {\n return $this->relations;\n }",
"public function getRelations(): array\n {\n return $this->relations;\n }",
"public function getRelations()\n {\n return $this->relations;\n }",
"public function getRelations()\n {\n return $this->configuration['relations'];\n }",
"public function getRelations()\n\t{\n\t\treturn $this->relations;\n\t}",
"public function relations(){\r\n\t\treturn $this->relations;\r\n\t}",
"public function relations() {\n return array();\n }",
"public function relations();",
"public function getRelations()\n {\n $relations = $columns = [];\n\n foreach ($this->builder->fields() as $field) {\n $columns[] = $field->column();\n }\n\n foreach (array_flatten($columns) as $column) {\n if (str_contains($column, '.')) {\n list($relation) = explode('.', $column);\n if ((method_exists($this->model, $relation) || is_callable([$this->model, $relation])) &&\n $this->model->$relation() instanceof Relation\n ) {\n $relations[] = $relation;\n }\n } elseif ((method_exists($this->model, $column) && !method_exists(Model::class, $column)) ||\n (is_callable([$this->model, $column]) && explode('2',$column.'2')[0]=='hasmany')\n ) {\n $relations[] = $column;\n }\n }\n\n return array_unique($relations);\n }",
"public function relations()\n\t{\n\t\t// class name for the relations automatically generated below.\n\t\treturn array(\n\t\t\t'organization' => array(self::BELONGS_TO, 'Organization', 'organization_id'),\n\t\t\t'proofs' => array(self::HAS_MANY, 'Proof', 'ref_id',\n\t\t\t\t'condition' => 'proofs.ref_table=:refTable',\n\t\t\t\t'params' => array(':refTable' => 'organization_status'),\n\t\t\t\t'order' => 'proofs.date_modified DESC',\n\t\t\t),\n\t\t);\n\t}",
"protected function defineRelationships()\n {\n parent::defineRelationships();\n\n $this->declareOneToManyRelationships(\n [\n \"Organisation\" =>\n [\n \"Contacts\" => \"Contact.OrganisationID\"\n ]\n ]\n );\n }",
"public function getRelationshipTypes()\n {\n return $this->relationship_types;\n }",
"public function getAllHasMany()\n {\n $hasmany = array();\n foreach ($this->phclass->getHasManyDeclarations() as $attr=>$rel)\n {\n $hasmany[$attr] = $this->get($attr); // value is a collection\n }\n return $hasmany;\n }",
"public function relations() {\n // class name for the relations automatically generated below.\n return array(\n );\n }",
"public function relations()\n {\n // class name for the relations automatically generated below.\n return array();\n }",
"public function getRelations()\n {\n $class = ucfirst('App\\\\'.ucfirst(Str::singular($this->name)));\n $query = call_user_func([$class, 'ordered']);\n\n if ($this->scope) {\n call_user_func($this->scope, $query);\n }\n\n return $query->get();\n }",
"public function getRelations() {\n\t\tif(empty($this->relations)) {\n\t\t\treturn Vtiger_Relation_Model::getAllRelations($this);\n\t\t}\n\t\treturn $this->relations;\n\t}",
"public function relationships()\n {\n return $this->fields->reject(function ($field) {\n return is_null($field->type()->getRelationship());\n });\n }",
"public function getRelations()\n {\n $relations = $columns = [];\n\n foreach ($this->builder->fields() as $field) {\n $columns[] = $field->column();\n }\n\n foreach (array_flatten($columns) as $column) {\n if (str_contains($column, '.')) {\n list($relation) = explode('.', $column);\n\n if (method_exists($this->model, $relation) &&\n $this->model->$relation() instanceof Relation\n ) {\n $relations[] = $relation;\n }\n } elseif (method_exists($this->model, $column) &&\n !method_exists(Model::class, $column)\n ) {\n $relations[] = $column;\n }\n }\n\n return array_unique($relations);\n }",
"protected function getRelations()\n\t{\n\t\treturn ['menuItems'];\n\t}",
"public function getRelationships(): CypherList\n {\n return $this->relationships;\n }"
] | [
"0.71404684",
"0.70752066",
"0.7074748",
"0.70588833",
"0.7048602",
"0.7048602",
"0.6957935",
"0.6953065",
"0.691488",
"0.687752",
"0.687752",
"0.68565476",
"0.6803447",
"0.6766033",
"0.67052716",
"0.66934633",
"0.66695404",
"0.6567975",
"0.6463686",
"0.6434522",
"0.640786",
"0.6397273",
"0.6372652",
"0.6355075",
"0.63488764",
"0.63209575",
"0.6276875",
"0.6245777",
"0.6232617",
"0.62216926"
] | 0.7418399 | 0 |
Set the relationships definitions. | public function setRelationships(array $relationships); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function defineRelationships()\n {\n parent::defineRelationships();\n\n $this->declareOneToManyRelationships(\n [\n \"Organisation\" =>\n [\n \"Contacts\" => \"Contact.OrganisationID\"\n ]\n ]\n );\n }",
"private function set_relationships()\n {\n if (empty($this->relationships)) {\n $options = ['has_one', 'has_many', 'has_many_pivot'];\n foreach ($options as $option) {\n if (isset($this->{$option}) && !empty($this->{$option})) {\n foreach ($this->{$option} as $key => $relation) {\n $single_query = false;\n if (!is_array($relation)) {\n $foreign_model = $relation;\n $model = $this->parse_model_dir($foreign_model);\n $foreign_model = $model['foreign_model'];\n $foreign_model_name = $model['foreign_model_name'];\n\n $this->load->model($foreign_model, $foreign_model_name);\n $foreign_table = $this->{$foreign_model_name}->table;\n $foreign_key = $this->{$foreign_model_name}->primary_key;\n $local_key = $this->primary_key;\n $pivot_local_key = $this->table.'_'.$local_key;\n $pivot_foreign_key = $foreign_table.'_'.$foreign_key;\n $get_relate = false;\n } else {\n if ($this->is_assoc($relation)) {\n $foreign_model = $relation['foreign_model'];\n $model = $this->parse_model_dir($foreign_model);\n $foreign_model = $model['model_dir'].$model['foreign_model'];\n $foreign_model_name = $model['foreign_model_name'];\n\n if (array_key_exists('foreign_table', $relation)) {\n $foreign_table = $relation['foreign_table'];\n } else {\n $this->load->model($foreign_model, $foreign_model_name);\n $foreign_table = $this->{$foreign_model_name}->table;\n }\n\n $foreign_key = $relation['foreign_key'];\n $local_key = $relation['local_key'];\n if ($option == 'has_many_pivot') {\n $pivot_table = $relation['pivot_table'];\n $pivot_local_key = (array_key_exists('pivot_local_key', $relation)) ? $relation['pivot_local_key'] : $this->table.'_'.$this->primary_key;\n $pivot_foreign_key = (array_key_exists('pivot_foreign_key', $relation)) ? $relation['pivot_foreign_key'] : $foreign_table.'_'.$foreign_key;\n $get_relate = (array_key_exists('get_relate', $relation) && ($relation['get_relate'] === true)) ? true : false;\n }\n if ($option=='has_one' && isset($relation['join']) && $relation['join'] === true) {\n $single_query = true;\n }\n } else {\n $foreign_model = $relation[0];\n $model = $this->parse_model_dir($foreign_model);\n $foreign_model = $model['model_dir'].$model['foreign_model'];\n $foreign_model_name = $model['foreign_model_name'];\n $this->load->model($foreign_model);\n $foreign_table = $this->{$foreign_model}->table;\n $foreign_key = $relation[1];\n $local_key = $relation[2];\n if ($option=='has_many_pivot') {\n $pivot_local_key = $this->table.'_'.$this->primary_key;\n $pivot_foreign_key = $foreign_table.'_'.$foreign_key;\n $get_relate = (isset($relation[3]) && ($relation[3] === true)) ? true : false;\n }\n }\n }\n\n if ($option=='has_many_pivot' && !isset($pivot_table)) {\n $tables = [$this->table, $foreign_table];\n sort($tables);\n $pivot_table = $tables[0].'_'.$tables[1];\n }\n\n $this->relationships[$key] = [\n 'relation' => $option,\n 'relation_key' => $key,\n 'foreign_model' => strtolower($foreign_model),\n 'foreign_model_name' => strtolower($foreign_model_name),\n 'foreign_table' => $foreign_table,\n 'foreign_key' => $foreign_key,\n 'local_key' => $local_key\n ];\n\n if ($option == 'has_many_pivot') {\n $this->relationships[$key]['pivot_table'] = $pivot_table;\n $this->relationships[$key]['pivot_local_key'] = $pivot_local_key;\n $this->relationships[$key]['pivot_foreign_key'] = $pivot_foreign_key;\n $this->relationships[$key]['get_relate'] = $get_relate;\n }\n\n if ($single_query === true) {\n $this->relationships[$key]['joined'] = true;\n }\n }\n }\n }\n }\n }",
"public function setRelationships($relationships) {\n $this->relationships = $relationships;\n }",
"public function testSetRelations()\n {\n $this->_object->setRelations($this->_crmId['model'], $this->_crmId['backend'], $this->_crmId['id'], $this->_relationData);\n }",
"private function prepRelations() : self\n {\n\n // Lvd.\n $maxRId = 0;\n $relationships = [];\n\n // Add Tables of this Sheet.\n foreach ($this->sheet->getTables() as $table) {\n\n // Add next relation to Table of this Sheet.\n $relationships[] = [\n '@Id' => 'rId' . $table->getId(),\n '@Type' => 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/table',\n '@Target' => '../tables/table' . $table->getId() . '.xml',\n ];\n\n // Count max ID.\n $maxRId = max($maxRId, $table->getId());\n }\n\n // Save.\n $this->array['Relationships']['@@']['Relationship'] = $relationships;\n\n return $this;\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n }",
"public function buildRelations()\n {\n $this->addRelation('Enquiry', '\\\\Wedding\\\\Enquiry', RelationMap::MANY_TO_ONE, array (\n 0 =>\n array (\n 0 => ':enquiry_id',\n 1 => ':entity_id',\n ),\n), 'CASCADE', 'CASCADE', null, false);\n $this->addRelation('QuoteItem', '\\\\Wedding\\\\QuoteItem', RelationMap::ONE_TO_MANY, array (\n 0 =>\n array (\n 0 => ':quote_id',\n 1 => ':entity_id',\n ),\n), 'CASCADE', 'CASCADE', 'QuoteItems', false);\n }",
"public function buildRelations()\n\t{\n\t}",
"public function buildRelations()\n\t{\n\t}",
"public function buildRelations()\n\t{\n\t}",
"public function buildRelations()\n\t{\n\t}",
"private function updateRelationshipVariable ()\n {\n foreach ( $this->implementation->getRelationshipList () as $relationshipName )\n {\n $rel = $this->implementation->getOldFormat ( $relationshipName ) ;\n $this->relationships [ $relationshipName ] = $rel ;\n }\n }",
"public function buildRelations()\n {\n $this->addRelation('RCoutsNature', 'RCoutsNature', RelationMap::MANY_TO_ONE, array('r_couts_nature_id' => 'r_couts_nature_id', ), null, null);\n $this->addRelation('OperationPrestations', 'OperationPrestations', RelationMap::ONE_TO_ONE, array('op_prest_id' => 'op_prest_id', ), null, null);\n }",
"public function buildRelations()\n {\n $this->addRelation('RbTreatment', 'Webmis\\\\Models\\\\RbTreatment', RelationMap::MANY_TO_ONE, array('treatment_id' => 'id', ), null, null);\n $this->addRelation('RbPacientModel', 'Webmis\\\\Models\\\\RbPacientModel', RelationMap::MANY_TO_ONE, array('pacientModel_id' => 'id', ), null, null);\n $this->addRelation('QuotaType', 'Webmis\\\\Models\\\\QuotaType', RelationMap::MANY_TO_ONE, array('quotaType_id' => 'id', ), null, null);\n }"
] | [
"0.75069106",
"0.708817",
"0.70304567",
"0.6742711",
"0.656163",
"0.64325666",
"0.64325666",
"0.64325666",
"0.64325666",
"0.64325666",
"0.64325666",
"0.64325666",
"0.64325666",
"0.64325666",
"0.64325666",
"0.64325666",
"0.64325666",
"0.64325666",
"0.64325666",
"0.64325666",
"0.64325666",
"0.64325666",
"0.6292967",
"0.6238227",
"0.6238227",
"0.6238227",
"0.6238227",
"0.6047435",
"0.60321134",
"0.6027999"
] | 0.7213895 | 1 |
Set the block settings for all blocks. | public function setBlocks(array $blocks); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setBlocks($newVal) {\n $this->blocks=$newVal;\n }",
"public function settings_block()\n {\n }",
"public static function initBlocks () {\n \n $blocks = conf::getMainIni('blocks_all');\n if (!isset($blocks)) { \n return;\n }\n \n $blocks = explode(',', $blocks);\n foreach ($blocks as $val) {\n self::$blocksContent[$val] = self::parseBlock($val);\n } \n }",
"public function setBlockPlugins(array $blocks);",
"function execute() {\n\t\t// Save the block plugin layout settings.\n\t\t$blockVars = array('blockSelectLeft', 'blockUnselected', 'blockSelectRight');\n\t\tforeach ($blockVars as $varName) {\n\t\t\t$$varName = split(' ', Request::getUserVar($varName));\n\t\t}\n\n\t\t$plugins =& PluginRegistry::loadCategory('blocks');\n\t\tforeach ($plugins as $key => $junk) {\n\t\t\t$plugin =& $plugins[$key]; // Ref hack\n\t\t\t$plugin->setEnabled(!in_array($plugin->getName(), $blockUnselected));\n\t\t\tif (in_array($plugin->getName(), $blockSelectLeft)) {\n\t\t\t\t$plugin->setBlockContext(BLOCK_CONTEXT_LEFT_SIDEBAR);\n\t\t\t\t$plugin->setSeq(array_search($key, $blockSelectLeft));\n\t\t\t} else if (in_array($plugin->getName(), $blockSelectRight)) {\n\t\t\t\t$plugin->setBlockContext(BLOCK_CONTEXT_RIGHT_SIDEBAR);\n\t\t\t\t$plugin->setSeq(array_search($key, $blockSelectRight));\n\t\t\t}\n\t\t\tunset($plugin);\n\t\t}\n\n\t\t$site =& Request::getSite();\n\t\t$siteSettingsDao =& DAORegistry::getDAO('SiteSettingsDAO');\n\n\t\t$settings = array('theme');\n\n\t\tforeach ($this->_data as $name => $value) {\n\t\t\tif (isset($settings[$name])) {\n\t\t\t\t$isLocalized = in_array($name, $this->getLocaleFieldNames());\n\t\t\t\t$siteSettingsDao->updateSetting(\n\t\t\t\t\t$name,\n\t\t\t\t\t$value,\n\t\t\t\t\t$this->settings[$name],\n\t\t\t\t\t$isLocalized\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}",
"public function setBlocks($blocks)\n {\n $this->_blocks = $blocks;\n return $this;\n }",
"public function setBlock($name, array $configuration);",
"abstract public function get_settings(block_base $block);",
"function _{PROFILE_CODE}_setup_blocks() {\n $admin_theme = variable_get('admin_theme', 'seven');\n $default_theme = variable_get('theme_default', 'bartik');\n\n $blocks = array(\n array(\n 'module' => 'system',\n 'delta' => 'help',\n 'theme' => $admin_theme,\n 'status' => 1,\n 'weight' => 0,\n 'region' => 'help',\n 'pages' => '',\n 'cache' => DRUPAL_NO_CACHE,\n ),\n array(\n 'module' => 'system',\n 'delta' => 'help',\n 'theme' => $default_theme,\n 'status' => 1,\n 'weight' => 0,\n 'region' => 'preface_first',\n 'pages' => '',\n 'cache' => DRUPAL_NO_CACHE,\n ),\n array(\n 'module' => 'system',\n 'delta' => 'main',\n 'theme' => $default_theme,\n 'status' => 1,\n 'weight' => 0,\n 'region' => 'content',\n 'pages' => '<front>', // Do not show the block on front.\n 'visibility' => 0,\n 'cache' => DRUPAL_NO_CACHE,\n ),\n // Connector.\n array(\n 'module' => 'connector',\n 'delta' => 'one_click_block',\n 'theme' => $default_theme,\n 'status' => 1,\n 'weight' => 1,\n 'region' => 'content',\n 'pages' => \"user\\r\\nuser/login\",\n 'visibility' => BLOCK_VISIBILITY_LISTED,\n 'cache' => DRUPAL_NO_CACHE,\n ),\n // Search sorting.\n array(\n 'module' => 'search_api_sorts',\n 'delta' => 'search-sorts',\n 'theme' => $default_theme,\n 'status' => 1,\n 'weight' => -30,\n 'region' => 'content',\n 'pages' => 'products',\n 'visibility' => BLOCK_VISIBILITY_LISTED,\n 'cache' => DRUPAL_NO_CACHE,\n ),\n );\n\n drupal_static_reset();\n _block_rehash($admin_theme);\n _block_rehash($default_theme);\n foreach ($blocks as $record) {\n $module = array_shift($record);\n $delta = array_shift($record);\n $theme = array_shift($record);\n db_update('block')\n ->fields($record)\n ->condition('module', $module)\n ->condition('delta', $delta)\n ->condition('theme', $theme)\n ->execute();\n }\n}",
"public function setBlock($block)\n {\n $this->block = ($block) ? $block : self::UNBLOCK;\n }",
"public function block($name, $settings = []) {\n $this->blocks[$name] = (array) $settings + $this->blockDefaults;\n\n $this->replaceAssetBlock($name, $this->createBlock($this->blocks[$name]));\n }",
"function init()\n {\n global $CFG;\n\n\n\n $this->title = get_string('block_title', self::BLOCK_NAME);\n $this->version = self::BLOCK_VERSION;\n\n $this->blockConfigs = get_config(self::BLOCK_NAME);\n\n\n $this->blockDir = \"{$CFG->dirroot}/\" . self::BLOCK_PATH . \"/\";\n $this->blockUrl = \"{$CFG->wwwroot}/\" . self::BLOCK_PATH . \"/\";\n\n $this->forgotUrl = empty($CFG->forgottenpasswordurl)\n ? ''\n : $CFG->forgottenpasswordurl;\n\n }",
"public function setBlockWidth(): void\n {\n ?>\n <style>.editor-styles-wrapper .wp-block, .editor-post-title .wp-block {max-width: calc(30px + var(--content-width));}</style>\n <?php\n }",
"function get_block_editor_server_block_settings() {\n\t$block_registry = WP_Block_Type_Registry::get_instance();\n\t$blocks = array();\n\t$fields_to_pick = array(\n\t\t'title' => 'title',\n\t\t'description' => 'description',\n\t\t'icon' => 'icon',\n\t\t'category' => 'category',\n\t\t'keywords' => 'keywords',\n\t\t'parent' => 'parent',\n\t\t'supports' => 'supports',\n\t\t'attributes' => 'attributes',\n\t\t'provides_context' => 'providesContext',\n\t\t'uses_context' => 'usesContext',\n\t\t'styles' => 'styles',\n\t\t'textdomain' => 'textdomain',\n\t\t'example' => 'example',\n\t);\n\n\tforeach ( $block_registry->get_all_registered() as $block_name => $block_type ) {\n\t\tforeach ( $fields_to_pick as $field => $key ) {\n\t\t\tif ( ! isset( $block_type->{ $field } ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( ! isset( $blocks[ $block_name ] ) ) {\n\t\t\t\t$blocks[ $block_name ] = array();\n\t\t\t}\n\n\t\t\t$blocks[ $block_name ][ $key ] = $block_type->{ $field };\n\t\t}\n\t}\n\n\treturn $blocks;\n}",
"function twentytwenty_block_editor_settings() {\n\n\t// Block Editor Palette.\n\t$editor_color_palette = array(\n\t\tarray(\n\t\t\t'name' => __( 'Accent Color', 'twentytwenty' ),\n\t\t\t'slug' => 'accent',\n\t\t\t'color' => twentytwenty_get_color_for_area( 'content', 'accent' ),\n\t\t),\n\t\tarray(\n\t\t\t'name' => __( 'Primary', 'twentytwenty' ),\n\t\t\t'slug' => 'primary',\n\t\t\t'color' => twentytwenty_get_color_for_area( 'content', 'text' ),\n\t\t),\n\t\tarray(\n\t\t\t'name' => __( 'Secondary', 'twentytwenty' ),\n\t\t\t'slug' => 'secondary',\n\t\t\t'color' => twentytwenty_get_color_for_area( 'content', 'secondary' ),\n\t\t),\n\t\tarray(\n\t\t\t'name' => __( 'Subtle Background', 'twentytwenty' ),\n\t\t\t'slug' => 'subtle-background',\n\t\t\t'color' => twentytwenty_get_color_for_area( 'content', 'borders' ),\n\t\t),\n\t);\n\n\t// Add the background option.\n\t$background_color = get_theme_mod( 'background_color' );\n\tif ( ! $background_color ) {\n\t\t$background_color_arr = get_theme_support( 'custom-background' );\n\t\t$background_color = $background_color_arr[0]['default-color'];\n\t}\n\t$editor_color_palette[] = array(\n\t\t'name' => __( 'Background Color', 'twentytwenty' ),\n\t\t'slug' => 'background',\n\t\t'color' => '#' . $background_color,\n\t);\n\n\t// If we have accent colors, add them to the block editor palette.\n\tif ( $editor_color_palette ) {\n\t\tadd_theme_support( 'editor-color-palette', $editor_color_palette );\n\t}\n\n\t// Block Editor Font Sizes.\n\tadd_theme_support(\n\t\t'editor-font-sizes',\n\t\tarray(\n\t\t\tarray(\n\t\t\t\t'name' => _x( 'Small', 'Name of the small font size in the block editor', 'twentytwenty' ),\n\t\t\t\t'shortName' => _x( 'S', 'Short name of the small font size in the block editor.', 'twentytwenty' ),\n\t\t\t\t'size' => 18,\n\t\t\t\t'slug' => 'small',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => _x( 'Regular', 'Name of the regular font size in the block editor', 'twentytwenty' ),\n\t\t\t\t'shortName' => _x( 'M', 'Short name of the regular font size in the block editor.', 'twentytwenty' ),\n\t\t\t\t'size' => 21,\n\t\t\t\t'slug' => 'normal',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => _x( 'Large', 'Name of the large font size in the block editor', 'twentytwenty' ),\n\t\t\t\t'shortName' => _x( 'L', 'Short name of the large font size in the block editor.', 'twentytwenty' ),\n\t\t\t\t'size' => 26.25,\n\t\t\t\t'slug' => 'large',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'name' => _x( 'Larger', 'Name of the larger font size in the block editor', 'twentytwenty' ),\n\t\t\t\t'shortName' => _x( 'XL', 'Short name of the larger font size in the block editor.', 'twentytwenty' ),\n\t\t\t\t'size' => 32,\n\t\t\t\t'slug' => 'larger',\n\t\t\t),\n\t\t)\n\t);\n\n\tadd_theme_support( 'editor-styles' );\n\n\t// If we have a dark background color then add support for dark editor style.\n\t// We can determine if the background color is dark by checking if the text-color is white.\n\tif ( '#ffffff' === strtolower( twentytwenty_get_color_for_area( 'content', 'text' ) ) ) {\n\t\tadd_theme_support( 'dark-editor-style' );\n\t}\n\n}",
"public function setBlockinfo($blockinfo) {\n\t\t$this->blockinfo = $blockinfo;\n\t}",
"function load_blocks() {\r\n\r\n require_once LIBRARY_DIR . \"Module.php\";\r\n require_once LIBRARY_DIR . \"Block.php\";\r\n\r\n // load blocks\r\n $this->block_list = Content::get_block_list($this->layout_id, $this->type_id, $this->content_id);\r\n if ( $this->block_list ) {\r\n foreach ( $this->block_list as $block) {\r\n // if selected is true the block can read the parameters\r\n $this->block( $block );\r\n }\r\n }\r\n \r\n }",
"public function setSettings(array $data, array $settings)\n {\n if (count($this->blockType->getSettings())) {\n foreach ($this->blockType->getSettings() as $setting) {\n /* @var SettingInterface $setting */\n if (method_exists($setting, 'filterData')) {\n $settings = $setting->filterData($data, $settings, $this->id, $this->objectId, $this->blocks);\n }\n }\n }\n\n $this->settings = $settings;\n }",
"public function __construct($blocks)\n {\n $this->blocks = $blocks;\n }",
"public function blocks()\n {\n $regions = $this->Block->Regions->find('active')->cache('regions', 'layoutData')->combine('id', 'alias')->toArray();\n \n foreach ($regions as $regionId => $regionAlias) {\n $this->blocksForLayout[$regionAlias] = array();\n\n $blocks = Cache::read('blocks_' . $regionAlias, 'layoutData');\n if ($blocks === false) {\n $blocks = $this->Block->find('active', array(\n 'regionId' => $regionId\n ))->toArray();\n Cache::write('blocks_' . $regionAlias, $blocks, 'layoutData');\n }\n $this->processBlocksData($blocks);\n $this->blocksForLayout[$regionAlias] = $blocks;\n }\n }",
"public function register_block() {\r\n\r\n\t\twp_register_style(\r\n\t\t\t'sbi-blocks-styles',\r\n\t\t\ttrailingslashit( SBI_PLUGIN_URL ) . 'css/sb-blocks.css',\r\n\t\t\tarray( 'wp-edit-blocks' ),\r\n\t\t\tSBIVER\r\n\t\t);\r\n\r\n\t\t$attributes = array(\r\n\t\t\t'shortcodeSettings' => array(\r\n\t\t\t\t'type' => 'string',\r\n\t\t\t),\r\n\t\t\t'noNewChanges' => array(\r\n\t\t\t\t'type' => 'boolean',\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t\tregister_block_type(\r\n\t\t\t'sbi/sbi-feed-block',\r\n\t\t\tarray(\r\n\t\t\t\t'attributes' => $attributes,\r\n\t\t\t\t'render_callback' => array( $this, 'get_feed_html' ),\r\n\t\t\t)\r\n\t\t);\r\n\t}",
"public static function initBlocks() \n\t{\n\t\t\n\t\t$block_paths = apply_filters('mb-block-paths', array(MB()->get_plugin_path() . \"blocks/\") );\n\t\t \n\t\t//global $blockClass; // load requires only onc\n\n\t\t$newBlocks = array();\n\t\t$templates = array(); \n\t\t\n\t\t\n\t\tforeach($block_paths as $block_path)\n\t\t{\n\t\t\t$dir_iterator = new RecursiveDirectoryIterator($block_path, FilesystemIterator::SKIP_DOTS);\n\t\t\t$iterator = new RecursiveIteratorIterator($dir_iterator, RecursiveIteratorIterator::SELF_FIRST);\n\n\t\t\tforeach ($iterator as $fileinfo)\n\t\t\t{\n\n\t\t\t\t$path = $fileinfo->getRealPath(); \n\t\t\t\t// THIS IS PHP > 5.3.6\n\t\t\t\t//$extension = $fileinfo->getExtension(); \n\t\t\t\t$extension = pathinfo($path, PATHINFO_EXTENSION);\n\t\t\t\n\t\t\t\tif ($fileinfo->isFile() )\n\t\t\t\t{\n\t\t\t\t\tif ($extension == 'php') \n\t\t\t\t\t{\n\t\t\t\t\t \trequire_once($path);\n\t\t\t\t\t}\n\t\t\t\t\telseif($extension == 'tpl') \n\t\t\t\t\t{\t\n\t\t\t\t\t\t$filename = $fileinfo->getBasename('.tpl');\n\t\t\t\t\t\t$templates[$filename] = array('path' => $path); \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\t\tksort($blockOrder);\n\t\t\tforeach($blockOrder as $prio => $blockArray)\n\t\t\t{\n\t\t\t\tforeach($blockArray as $block)\n\t\t\t\t{\n\t\t\t\t\tif (isset($blockClass[$block]))\n\t\t\t\t\t\t$newBlocks[$block] = $blockClass[$block]; \n\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t$blockClass = $newBlocks;\n\t\t\tif (is_admin())\n\t\t\t{\n\t\t\t\t// possible issue with some hosters faking is_admin flag. \n\t\t\t\tif (class_exists( maxUtils::namespaceit('maxBlocks') ) && class_exists( maxUtils::namespaceit('maxBlocks') ) )\n\t\t\t\t{\n\t\t\t\t\tmaxField::setTemplates($templates); \n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\terror_log('[MaxButtons] - MaxField class is not set within admin context. This can cause issues when using button editor'); \n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t//$this->loadBlockClasses($blockClass); \n\t\t\n\t\tstatic::$block_classes = array_values($blockClass);\n\t}",
"function facebook_connect_admin_settings_submit() {\n $result = db_query(\"SELECT * FROM {blocks} WHERE module = '%s'\", 'facebook_connect');\n \n // For each block, clear the block's cache\n while ($block = db_fetch_object($result)) {\n $cid = _block_get_cache_id($block);\n \n if (!empty($cid)) {\n cache_clear_all($cid, 'cache_block');\n }\n }\n}",
"protected function setSettings() {\n\t\t$this->settings = array(\n\t\t\t'combine_pdf_labels'\t=> Mage::getStoreConfig('carriers/smartsend/combinepdf'),\n\t\t\t'change_order_status'\t=> Mage::getStoreConfig('carriers/smartsend/status'),\n\t\t\t'send_shipment_mail'\t=> Mage::getStoreConfig('sales_email/shipment/enabled')\n\t\t\t);\n\t}",
"function block($block) {\r\n\r\n // get the settings and the parameters\r\n $params = Content::get_block_settings( $block[\"block_id\"] );\r\n $this->load_module($block['module'], $action = \"draw\", $params, $block['load_area'], $selected = false, $block, BLOCK_EXTENSION, BLOCK_CLASS_NAME, $page_not_found_on_error = false );\r\n\r\n }",
"public function swami_blocks_register()\n {\n /**\n * Registra il block nel front end\n */\n wp_register_script(\n 'swami_block_script_editor',\n plugins_url($this->assets_dir . '/js/editor-bundle.js', __FILE__),\n array('wp-blocks','wp-block-editor','wp-i18n', 'wp-element'),\n time()\n );\n\n wp_register_style(\n 'swami_block_style',\n plugins_url($this->assets_dir . '/css/style-bundle.css', __FILE__)\n );\n\n $this->swami_register_blocktype('swami-startblock');\n\n }",
"private function setBlocks(Page $page)\n {\n if (!isset($this->blocks[$page->getId()]) || empty($this->blocks[$page->getId()])) {\n $all_blocks = $page->getBlocks();\n // records all blocks\n foreach ($all_blocks as $block) {\n $this->blocks[$page->getId()][$block->getId()] = $block;\n }\n }\n }",
"public function loadBlocks(): self\n {\n // Get info file path\n $infoFilePath = $this->getPath('info.php');\n\n // Fetch info data\n $info = $this->fetchInfoFile($infoFilePath);\n\n if (is_array($info)) {\n $blocks = BlockModel::findAll();\n $index = 0;\n foreach ($blocks as $block) {\n if (isset($info['blocks'][$index][0]) && isset($info['blocks'][$index][1])) {\n $block->block_key = $info['blocks'][$index][0];\n $block->title = $info['blocks'][$index][1];\n $block->validate();\n $block->save();\n } else {\n $block->delete();\n }\n ++$index;\n }\n\n $numberOfBlocks = count($info['blocks']);\n for ($index; $index <= $numberOfBlocks; ++$index) {\n if (isset($info['blocks'][$index][0]) && isset($info['blocks'][$index][1])) {\n BlockModel::create([\n 'block_key' => $info['blocks'][$index][0],\n 'title' => $info['blocks'][$index][1],\n ])->save();\n }\n }\n }\n\n return $this;\n }",
"public function setData(array $data, array $settings)\n {\n // Add ID to the block's data\n // DEPRECATED: remove in v2\n if (!isset($data['block_id'])) {\n $data['block_id'] = $this->id;\n }\n \n // Pass data through registered callbacks\n // This allows comfortably overriding data if the block type is defined procedurally\n if (is_array($this->blockType->getCallbacks()) && count($this->blockType->getCallbacks())) {\n foreach ($this->blockType->getCallbacks() as $callback) {\n if (is_callable($callback)) {\n $data = call_user_func($callback, $data, $settings, $this->id, $this->objectId, $this->blocks);\n } else {\n trigger_error(\"A callback registered to {$this->getBlockTypeName()} is not callable.\", E_USER_WARNING);\n }\n }\n }\n\n // If a data filtering function is defined, pass data through it\n // This allows comfortably overriding data if the block type is defined as a child class\n if (method_exists($this->blockType, 'filterData')) {\n $data = $this->blockType->filterData($data, $settings, $this->id, $this->objectId, $this->blocks);\n }\n\n $this->data = $data;\n }",
"public static function method_export_block_settings() {\n\n\t\t\t\tHeadway::load('data/data-portability');\n\n\t\t\t\treturn HeadwayDataPortability::export_block_settings(headway_get('block-id'));\n\n\t\t\t}"
] | [
"0.67917645",
"0.65555686",
"0.64671224",
"0.6440335",
"0.6367746",
"0.630184",
"0.6212836",
"0.61966467",
"0.61139005",
"0.60856026",
"0.6030569",
"0.5885386",
"0.58816904",
"0.58770365",
"0.5840533",
"0.58227473",
"0.5815495",
"0.57961744",
"0.57930386",
"0.5752161",
"0.5740781",
"0.57287234",
"0.57072955",
"0.5602616",
"0.55431503",
"0.5517845",
"0.5516669",
"0.5514084",
"0.55096424",
"0.5482081"
] | 0.7028271 | 0 |
Get all the block plugins for the tab. | public function getBlockPlugins(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPlugins();",
"public function get_all_plugins() {\r\n\t\t$registered = $this->get( array( 'plugins' ) );\r\n\t\treturn $registered;\r\n\t}",
"public function getAllPluginWidget(){\n $return = array();\n $all_plugin = $this->Cms_model->getValueArray('*', 'plugin_manager', 'plugin_active', '1');\n if($all_plugin !== FALSE){\n foreach ($all_plugin as $value) {\n $plugin_widget_viewtable = $this->Cms_model->getPluginConfig($value['plugin_config_filename'], 'plugin_widget_viewtable');\n if($plugin_widget_viewtable && $plugin_widget_viewtable !== FALSE){\n $return[] = $value['plugin_config_filename'];\n }\n }\n }\n return $return;\n }",
"public function getInstalledPlugins();",
"public function getRegisteredPlugins();",
"public function getAvailablePlugins();",
"public function getPluginList()\n {\n return $this->plugins;\n }",
"public function getPlugins()\n {\n return $this->plugins;\n }",
"public function getPlugins()\n {\n return $this->plugins;\n }",
"public function getPlugins()\n {\n return $this->plugins;\n }",
"protected function getPluginBag() {\n if (!$this->pluginBag) {\n $this->pluginBag = new BlockPluginBag(\\Drupal::service('plugin.manager.block'), $this->plugin, $this->get('settings'), $this->id());\n }\n return $this->pluginBag;\n }",
"public function getPlugins() {\n return $this->plugins;\n }",
"public function getAll() {\n // Retrieve all available user protection plugin definitions.\n if (!$this->definitions) {\n $this->definitions = $this->manager->getDefinitions();\n }\n\n // Ensure that there is an instance of all available plugins.\n foreach ($this->definitions as $plugin_id => $definition) {\n if (!isset($this->pluginInstances[$plugin_id])) {\n $this->initializePlugin($plugin_id);\n }\n }\n\n // Sort plugins.\n uasort($this->pluginInstances, array($this, 'pluginInstancesSort'));\n\n return $this->pluginInstances;\n }",
"public function getExtraPlugins();",
"public function getDisabledPlugins();",
"public function getRegisteredPlugins() {\r\n\t return $this->registeredPlugins;\r\n }",
"public function get_plugins_config() {\n\n\t\t$active_plugins = get_option( 'active_plugins' );\n\t\t$all_plugins = get_plugins();\n\t\t$result = array();\n\n\t\tforeach ( $active_plugins as $plugin_file ) {\n\n\t\t\tif ( ! isset( $all_plugins[ $plugin_file ] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$slug = dirname( $plugin_file );\n\n\t\t\tif ( 'crocoblock-wizard' === $slug ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$plugin = array();\n\t\t\t$data = $all_plugins[ $plugin_file ];\n\t\t\t$plugin['slug'] = $slug;\n\t\t\t$plugin['name'] = $data['Name'];\n\t\t\t$plugin['description'] = $data['Description'];\n\t\t\t$result[] = $plugin;\n\t\t}\n\n\t\treturn $result;\n\n\t}",
"public function getPluginAll(){\n $this->db->select(\"*\");\n $this->db->where(\"plugin_active\", 1);\n $this->db->order_by(\"plugin_config_filename\", \"asc\");\n $query = $this->db->get('plugin_manager');\n if(!empty($query) && $query->num_rows() !== 0){\n return $query->result_array();\n }\n return array();\n }",
"public function getSubPlugins();",
"function PMA_getServerPlugins()\n{\n $sql = PMA_getServerPluginModuleSQL();\n $res = $GLOBALS['dbi']->query($sql);\n $plugins = array();\n while ($row = $GLOBALS['dbi']->fetchAssoc($res)) {\n $plugins[$row['plugin_type']][] = $row;\n }\n $GLOBALS['dbi']->freeResult($res);\n ksort($plugins);\n return $plugins;\n}",
"function plg()\n {\n if (!$this->_plugins)\n $this->_plugins = new PluginsInvokable(\n $this->getPluginManager()\n );\n\n return $this->_plugins;\n }",
"public function pluginsSorted(): array {\n $plugins = $this->plugins();\n usort($plugins, function (HiddenTabPluginBase $a, HiddenTabPluginBase $b) {\n return $a->weight() > $b->weight();\n });\n return $plugins;\n }",
"public static function getAuthPlugins()\n\t{\n\t\t$pls = $GLOBALS['ilPluginAdmin']->getActivePluginsForSlot(\n\t\t\t\tIL_COMP_SERVICE,\n\t\t\t\t'Authentication',\n\t\t\t\t'authhk'\n\t\t);\n\t\t$pl_objs = array();\n\t\tforeach($pls as $pl)\n\t\t{\n\t\t\t$pl_objs[] = $GLOBALS['ilPluginAdmin']->getPluginObject(\n\t\t\t\t\tIL_COMP_SERVICE,\n\t\t\t\t\t'Authentication',\n\t\t\t\t\t'authhk',\n\t\t\t\t\t$pl\n\t\t\t);\n\t\t}\n\t\treturn $pl_objs;\n\t}",
"protected static function plugins()\n {\n if (self::$plugins) {\n return self::$plugins;\n }\n\n $path = self::basePath(self::PLUGINS_JSON);\n\n if (!file_exists($path)) {\n return self::$plugins = [];\n }\n\n self::$plugins = json_decode(file_get_contents($path));\n\n if (!self::$plugins) {\n return self::$plugins = [];\n }\n\n return self::$plugins;\n }",
"public function plugins ()\n {\n }",
"public function getDamFrontendPlugins()\n {\n return array(\n self::DAM_FE_PI_1 => $this->getTtContentElements(\"list_type='\" . self::DAM_FE_PI_1 . \"'\"),\n self::DAM_FE_PI_2 => $this->getTtContentElements(\"list_type='\" . self::DAM_FE_PI_2 . \"'\"),\n //@TODO: convert dam_frontend_pi3\n self::DAM_FE_PI_3 . ' (currently not supported)'\n => $this->getTtContentElements(\"list_type='\" . self::DAM_FE_PI_3 . \"'\"),\n );\n }",
"public function getCKEditorPlugins(\\Zikula_Event $event)\n {\n // intended is using the add() method to add a plugin like below\n $plugins = $event->getSubject();\n \n $plugins->add(\n [\n 'name' => 'muyourcitymodule',\n 'path' => 'modules/MU/YourCityModule/Resources/docs/scribite/plugins/CKEditor/vendor/ckeditor/plugins/muyourcitymodule/',\n 'file' => 'plugin.js',\n 'img' => 'ed_muyourcitymodule.gif'\n ]\n );\n }",
"public static function load_blocks() {\r\n\t\tif ( ! self::is_gutenberg_available() ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif ( ! self::should_load_blocks() ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Filter the list of blocks that are available through jetpack.\r\n\t\t *\r\n\t\t * This filter is populated by Jetpack_Gutenberg::jetpack_set_available_blocks\r\n\t\t *\r\n\t\t * @since 6.8.0\r\n\t\t *\r\n\t\t * @param array\r\n\t\t */\r\n\t\tself::$blocks_index = apply_filters( 'jetpack_set_available_blocks', array() );\r\n\r\n\t\tforeach ( self::$jetpack_blocks as $type => $args ) {\r\n\t\t\tif ( 'publicize' === $type ) {\r\n\t\t\t\t// publicize is not actually a block, it's a gutenberg plugin.\r\n\t\t\t\t// We will handle it's registration on the client-side.\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif ( isset( $args['availability']['available'] ) && $args['availability']['available'] && in_array( $type, self::$blocks_index ) ) {\r\n\t\t\t\tregister_block_type( 'jetpack/' . $type, $args['args'] );\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"private function _plugin_list() {\n\t\t$plugins = $this->get_plugins( $_GET );\n\n\t\techo format_table( $plugins, $_GET['host'], 'plugins' );\n\t}",
"function GamiPress_Gutenberg_Blocks() {\n return GamiPress_Gutenberg_Blocks::instance();\n}"
] | [
"0.7284994",
"0.67190975",
"0.6712547",
"0.66972154",
"0.6650211",
"0.66261256",
"0.6623498",
"0.6599283",
"0.6599283",
"0.6599283",
"0.65765214",
"0.6550962",
"0.64402217",
"0.6327505",
"0.62145156",
"0.6201796",
"0.60902363",
"0.6085123",
"0.6025741",
"0.60174155",
"0.59971434",
"0.5949709",
"0.5949526",
"0.5949474",
"0.590287",
"0.5889241",
"0.5884473",
"0.58844",
"0.5871318",
"0.5867805"
] | 0.7708514 | 0 |
Store all the block plugins for the tab. | public function setBlockPlugins(array $blocks); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getBlockPlugins();",
"public static function register_assets() {\n\t\tself::register_style( 'wc-block-editor', plugins_url( 'build/editor.css', __DIR__ ), array( 'wp-edit-blocks' ) );\n\t\tself::register_style( 'wc-block-style', plugins_url( 'build/style.css', __DIR__ ), array() );\n\n\t\t// Shared libraries and components across all blocks.\n\t\tself::register_script( 'wc-blocks', plugins_url( 'build/blocks.js', __DIR__ ), array(), false );\n\t\tself::register_script( 'wc-vendors', plugins_url( 'build/vendors.js', __DIR__ ), array(), false );\n\n\t\t// Individual blocks.\n\t\tself::register_script( 'wc-handpicked-products', plugins_url( 'build/handpicked-products.js', __DIR__ ), array( 'wc-vendors', 'wc-blocks' ) );\n\t\tself::register_script( 'wc-product-best-sellers', plugins_url( 'build/product-best-sellers.js', __DIR__ ), array( 'wc-vendors', 'wc-blocks' ) );\n\t\tself::register_script( 'wc-product-category', plugins_url( 'build/product-category.js', __DIR__ ), array( 'wc-vendors', 'wc-blocks' ) );\n\t\tself::register_script( 'wc-product-new', plugins_url( 'build/product-new.js', __DIR__ ), array( 'wc-vendors', 'wc-blocks' ) );\n\t\tself::register_script( 'wc-product-on-sale', plugins_url( 'build/product-on-sale.js', __DIR__ ), array( 'wc-vendors', 'wc-blocks' ) );\n\t\tself::register_script( 'wc-product-top-rated', plugins_url( 'build/product-top-rated.js', __DIR__ ), array( 'wc-vendors', 'wc-blocks' ) );\n\t\tself::register_script( 'wc-products-by-attribute', plugins_url( 'build/products-by-attribute.js', __DIR__ ), array( 'wc-vendors', 'wc-blocks' ) );\n\t\tself::register_script( 'wc-featured-product', plugins_url( 'build/featured-product.js', __DIR__ ), array( 'wc-vendors', 'wc-blocks' ) );\n\t\tself::register_script( 'wc-featured-category', plugins_url( 'build/featured-category.js', __DIR__ ), array( 'wc-vendors', 'wc-blocks' ) );\n\t\tself::register_script( 'wc-product-categories', plugins_url( 'build/product-categories.js', __DIR__ ), array( 'wc-vendors', 'wc-blocks' ) );\n\t\tself::register_script( 'wc-product-tag', plugins_url( 'build/product-tag.js', __DIR__ ), array( 'wc-vendors', 'wc-blocks' ) );\n\t}",
"public function swami_blocks_register()\n {\n /**\n * Registra il block nel front end\n */\n wp_register_script(\n 'swami_block_script_editor',\n plugins_url($this->assets_dir . '/js/editor-bundle.js', __FILE__),\n array('wp-blocks','wp-block-editor','wp-i18n', 'wp-element'),\n time()\n );\n\n wp_register_style(\n 'swami_block_style',\n plugins_url($this->assets_dir . '/css/style-bundle.css', __FILE__)\n );\n\n $this->swami_register_blocktype('swami-startblock');\n\n }",
"function register_block_assets() {\n wp_register_script(\n 'block-js',\n plugins_url( '/build/index.js' , __FILE__ ),\n ['wp-blocks', 'wp-data']\n );\n\n // register our block styles\n wp_register_style(\n 'block-style',\n plugins_url( '/style.css' , __FILE__ ),\n [] \n );\n\n // register our editor styles\n wp_register_style(\n 'block-editor-style',\n plugins_url( '/editor.css' , __FILE__ ),\n []\n );\n\n // register our block\n register_block_type( 'jsadvancers/data-api-examples', array(\n 'editor_script' => 'block-js',\n 'editor_style' => 'block-editor-style',\n 'style' => 'block-style'\n ));\n\n\n}",
"function matrix_chat_plugin_block_init() {\n // automatically load dependencies and version\n\t$asset_file = include( plugin_dir_path( __FILE__ ) . 'build/index.asset.php');\n wp_register_script(\n 'matrix-chat-plugin-editor', \n plugins_url('build/index.js', __FILE__),\n $asset_file['dependencies'],\n $asset_file['version']\n );\n\n wp_register_style(\n 'matrix-chat-plugin-editor',\n plugins_url('style/editor.css', __FILE__),\n array(),\n filemtime(plugin_dir_path(__FILE__) . 'style/editor.css')\n );\n\n wp_register_style(\n 'matrix-chat-plugin',\n plugins_url('style/main.css', __FILE__),\n array(),\n filemtime(plugin_dir_path(__FILE__) . 'style/main.css')\n );\n\n register_block_type('matrix-chat-plugin/matrix-chat-plugin-block', array(\n 'editor_script' => 'matrix-chat-plugin-editor',\n 'editor_style' => 'matrix-chat-plugin-editor',\n 'style' => 'matrix-chat-plugin'\n ) );\n}",
"function register_blocks(){\n\n //Si gutenberg no existe, salir\n if(!function_exists('register_block_type')){\n return;\n }\n\n //Registrar los bloques\n wp_register_script(\n 'jg-editor-script',\n plugins_url('build/index.js', __FILE__ ),\n array('wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor'),\n filemtime( plugin_dir_path( __FILE__ ) . 'build/index.js')\n );\n\n //Estilos editor\n wp_register_style(\n 'jg-editor-styles',\n plugins_url('build/editor.css', __FILE__ ),\n array('wp-edit-blocks'),\n //filemtime( plugin_dir_path( __FILE__ ) . 'build/editor.css')\n );\n //Estilos bloques\n wp_register_style(\n 'jg-front-styles',\n plugins_url('build/styles.css', __FILE__ ),\n array(),\n //filemtime( plugin_dir_path( __FILE__ ) . 'build/styles.css')\n );\n\n //Arreglo bloques\n $blocks = [\n 'jg/formularios'\n ];\n\n //Recorrer bloques y añadimos scripts y styles\n foreach($blocks as $block) {\n register_block_type($block, array(\n 'editor_script' => 'jg-editor-script', \n 'editor_style' => 'jg-editor-styles',\n 'style' => 'jg-front-styles'\n ));\n }\n\n}",
"private function load_plugins() {\r\n\t\t$base = realpath(dirname(__FILE__)) . \"/plugins\";\r\n\t\t$this->plugins = glob($base . \"/*.php\");\r\n\t\tforeach($this->plugins as $plugin) {\r\n\t\t\t//include the plugin php file and define the class name\r\n\t\t\t\tinclude_once $plugin;\r\n\t\t\t\t$plugin_name = basename($plugin, \".php\");\r\n\t\t\t\t$class_name = \"plugin_\".$plugin_name;\r\n\r\n\t\t\t//create the plugin object so that it can be stored and called later\r\n\t\t\t\t$obj = new $class_name();\r\n\t\t\t\t$this->plugins[$plugin_name] = $obj;\r\n\r\n\t\t\t//store all methods found in the plugin\r\n\t\t\t\tforeach (get_class_methods($obj) as $method ) {\r\n\t\t\t\t\t$this->methods[$method] = $plugin_name;\r\n\t\t\t\t}\r\n\r\n\t\t}\r\n\t}",
"function services_block(){\n wp_register_script(\n 'services-script',\n get_template_directory_uri() . '/js/block-services.js',\n array( 'wp-blocks', 'wp-element', 'wp-editor', 'wp-components' )\n );\n\n wp_register_style(\n 'services-editor-style',\n get_template_directory_uri() . '/css/block-services-editor-style.css',\n array( 'wp-edit-blocks' )\n );\n\n wp_register_style(\n 'services-style',\n get_template_directory_uri() . '/css/block-services-style.css',\n array( 'wp-edit-blocks' )\n );\n\n register_block_type('childress/services', array(\n 'editor_script' => 'services-script',\n 'editor_style' => 'services-editor-style',\n 'style' => 'services-style',\n ) );\n}",
"function pizza_registro_bloque() {\n\n // Si Gutenberge no existe, salir\n if(!function_exists('register_block_type')) {\n return;\n }\n \n // Llamado al archivo index.asset.php\n $assets = include_once plugin_dir_path(__FILE__).'blocks/build/index.asset.php';\n\n // Registro de lo bloques en el editor\n wp_register_script(\n 'pg-block',\n plugins_url('/blocks/build/index.js', __FILE__),\n $assets['dependencies'],\n $assets['version']\n );\n\n // Estilos para el editor\n wp_register_style(\n 'pg-editor-styles',\n plugins_url('/blocks/build/editor.css', __FILE__),\n array('wp-edit-blocks'),\n filemtime( plugin_dir_path( __FILE__ ).'blocks/build/editor.css')\n );\n\n // Estilos para los bloques\n wp_register_style(\n 'pg-frontend-styles',\n plugins_url('/blocks/build/styles.css', __FILE__),\n array(),\n filemtime( plugin_dir_path( __FILE__ ).'blocks/build/styles.css')\n );\n\n // Arreglo de bloques\n $blocks = [\n 'pg/basic'\n ];\n // Recorrer bloques\n foreach($blocks as $block){\n register_block_type(\n $block,\n array(\n 'editor_script' => 'pg-block',\n 'editor_style' => 'pg-editor-styles',\n 'style' => 'pg-frontend-styles'\n )\n );\n }\n\n // Registrando un bloque dinimico\n register_block_type(\n 'pg/menu',\n array(\n 'editor_script' => 'pg-block',\n 'editor_style' => 'pg-editor-styles',\n 'style' => 'pg-frontend-styles',\n 'render_callback' => 'sitio_especialidades_front_end'\n )\n );\n\n}",
"function execute() {\n\t\t// Save the block plugin layout settings.\n\t\t$blockVars = array('blockSelectLeft', 'blockUnselected', 'blockSelectRight');\n\t\tforeach ($blockVars as $varName) {\n\t\t\t$$varName = split(' ', Request::getUserVar($varName));\n\t\t}\n\n\t\t$plugins =& PluginRegistry::loadCategory('blocks');\n\t\tforeach ($plugins as $key => $junk) {\n\t\t\t$plugin =& $plugins[$key]; // Ref hack\n\t\t\t$plugin->setEnabled(!in_array($plugin->getName(), $blockUnselected));\n\t\t\tif (in_array($plugin->getName(), $blockSelectLeft)) {\n\t\t\t\t$plugin->setBlockContext(BLOCK_CONTEXT_LEFT_SIDEBAR);\n\t\t\t\t$plugin->setSeq(array_search($key, $blockSelectLeft));\n\t\t\t} else if (in_array($plugin->getName(), $blockSelectRight)) {\n\t\t\t\t$plugin->setBlockContext(BLOCK_CONTEXT_RIGHT_SIDEBAR);\n\t\t\t\t$plugin->setSeq(array_search($key, $blockSelectRight));\n\t\t\t}\n\t\t\tunset($plugin);\n\t\t}\n\n\t\t$site =& Request::getSite();\n\t\t$siteSettingsDao =& DAORegistry::getDAO('SiteSettingsDAO');\n\n\t\t$settings = array('theme');\n\n\t\tforeach ($this->_data as $name => $value) {\n\t\t\tif (isset($settings[$name])) {\n\t\t\t\t$isLocalized = in_array($name, $this->getLocaleFieldNames());\n\t\t\t\t$siteSettingsDao->updateSetting(\n\t\t\t\t\t$name,\n\t\t\t\t\t$value,\n\t\t\t\t\t$this->settings[$name],\n\t\t\t\t\t$isLocalized\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}",
"public static function store_dashboard_plugins($plugin_paths)\n {\n $tbl_block = Database :: get_main_table(TABLE_MAIN_BLOCK);\n $affected_rows = 0;\n\n // get all plugins path inside plugin directory\n $dashboard_pluginpath = api_get_path(SYS_PLUGIN_PATH).'dashboard/';\n $possibleplugins = self::getPossibleDashboardPluginsPath();\n\n if (count($possibleplugins) > 0) {\n\n $selected_plugins = array_intersect(array_keys($plugin_paths), $possibleplugins);\n $not_selected_plugins = array_diff($possibleplugins, array_keys($plugin_paths));\n\n // get blocks id from not selected path\n $not_selected_blocks_id = array();\n foreach ($not_selected_plugins as $plugin) {\n $block_data = self::get_enabled_dashboard_blocks($plugin);\n if (!empty($block_data[$plugin])) {\n $not_selected_blocks_id[] = $block_data[$plugin]['id'];\n }\n }\n\n /* clean not selected plugins for extra user data and block data */\n // clean from extra user data\n $field_variable = 'dashboard';\n $extra_user_data = UserManager::get_extra_user_data_by_field_variable($field_variable);\n if (!empty($extra_user_data) && count($extra_user_data) > 0) {\n foreach ($extra_user_data as $key => $user_data) {\n $user_id = $key;\n $user_block_data = self::get_user_block_data($user_id);\n $user_block_id = array_keys($user_block_data);\n\n // clean disabled block data\n foreach ($user_block_id as $block_id) {\n if (in_array($block_id, $not_selected_blocks_id)) {\n unset($user_block_data[$block_id]);\n }\n }\n\n // get columns and blocks id for updating extra user data\n $columns = array();\n $user_blocks_id = array();\n foreach ($user_block_data as $data) {\n $user_blocks_id[$data['block_id']] = true;\n $columns[$data['block_id']] = $data['column'];\n }\n\n // update extra user blocks data\n self::store_user_blocks($user_id, $user_blocks_id, $columns);\n }\n }\n // clean from block data\n if (!empty($not_selected_blocks_id)) {\n $sql_check = \"SELECT id FROM $tbl_block \n WHERE id IN(\".implode(',',$not_selected_blocks_id).\")\";\n $rs_check = Database::query($sql_check);\n if (Database::num_rows($rs_check) > 0) {\n $del = \"DELETE FROM $tbl_block WHERE id IN(\".implode(',',$not_selected_blocks_id).\")\";\n Database::query($del);\n }\n }\n\n // store selected plugins\n if (!empty($selected_plugins) && count($selected_plugins) > 0) {\n foreach ($selected_plugins as $testplugin) {\n $selected_path = Database::escape_string($testplugin);\n\n // check if the path already stored inside block table for updating or adding it\n $sql = \"SELECT path FROM $tbl_block WHERE path = '$selected_path'\";\n $rs = Database::query($sql);\n if (Database::num_rows($rs) > 0) {\n // update\n $upd = \"UPDATE $tbl_block SET active = 1 WHERE path = '$selected_path'\";\n $result = Database::query($upd);\n $affected_rows = Database::affected_rows($result);\n } else {\n // insert\n $plugin_info_file = $dashboard_pluginpath . $testplugin . \"/$testplugin.info\";\n $plugin_info = array();\n if (file_exists($plugin_info_file)) {\n $plugin_info = api_parse_info_file($plugin_info_file);\n }\n\n // change keys to lower case\n $plugin_info = array_change_key_case($plugin_info);\n\n // setting variables\n $plugin_name = $testplugin;\n $plugin_description = '';\n $plugin_controller = '';\n $plugin_path = $testplugin;\n\n if (isset($plugin_info['name'])) {\n $plugin_name = Database::escape_string($plugin_info['name']);\n }\n if (isset($plugin_info['description'])) {\n $plugin_description = Database::escape_string($plugin_info['description']);\n }\n if (isset($plugin_info['controller'])) {\n $plugin_controller = Database::escape_string($plugin_info['controller']);\n }\n\n $ins = \"INSERT INTO $tbl_block(name, description, path, controller)\n VALUES ('$plugin_name', '$plugin_description', '$plugin_path', '$plugin_controller')\";\n $result = Database::query($ins);\n $affected_rows = Database::affected_rows($result);\n }\n }\n }\n }\n\n return $affected_rows;\n }",
"public function onInit() {\n wp_register_script('sptv-blocks', plugins_url( 'js/sptv-blocks.js', __FILE__ ), ['wp-blocks', 'wp-element', 'wp-i18n']); \n wp_set_script_translations(\"sptv-blocks\", \"sptv\", dirname(__FILE__) . '/lang/');\n add_filter(\"block_categories\", [ $this, \"blockCategoriesFilter\"], 10, 2);\n\n $electronicServiceChannelComponents = apply_filters(\"sptv_electronic_service_channel_components\", [\n [\n \"slug\" => \"default-all\",\n \"name\" => __(\"Default template\", \"sptv\")\n ],\n [\n \"slug\" => \"name\",\n \"name\" => __(\"Name\", \"sptv\")\n ],\n [\n \"slug\" => \"description\",\n \"name\" => __(\"Description\", \"sptv\")\n ],\n [\n \"slug\" => \"webpages\",\n \"name\" => __(\"Url\", \"sptv\")\n ],\n [\n \"slug\" => \"description-and-url\",\n \"name\" => __(\"Description and url\", \"sptv\")\n ]\n ]);\n\n $webpageServiceChannelComponents = apply_filters(\"sptv_webpage_service_channel_components\", [\n [\n \"slug\" => \"default-all\",\n \"name\" => __(\"Default template\", \"sptv\")\n ],\n [\n \"slug\" => \"name\",\n \"name\" => __(\"Name\", \"sptv\")\n ],\n [\n \"slug\" => \"description\",\n \"name\" => __(\"Description\", \"sptv\")\n ],\n [\n \"slug\" => \"webpages\",\n \"name\" => __(\"Web pages\", \"sptv\")\n ]\n ]);\n\n $printableFormServiceChannelComponents = apply_filters(\"sptv_printable_form_service_channel_components\", [\n [\n \"slug\" => \"default-all\",\n \"name\" => __(\"Default template\", \"sptv\")\n ],\n [\n \"slug\" => \"name\",\n \"name\" => __(\"Name\", \"sptv\")\n ],\n [\n \"slug\" => \"description\",\n \"name\" => __(\"Description\", \"sptv\")\n ],\n [\n \"slug\" => \"channelurls\",\n \"name\" => __(\"Channel urls\", \"sptv\")\n ],\n [\n \"slug\" => \"attachmenturls\",\n \"name\" => __(\"Attachment urls\", \"sptv\")\n ], \n [\n \"slug\" => \"description-and-url\",\n \"name\" => __(\"Description and url\", \"sptv\")\n ]\n ]);\n\n $phoneServiceChannelComponents = apply_filters(\"sptv_phone_service_channel_components\", [\n [\n \"slug\" => \"default-all\",\n \"name\" => __(\"Default template\", \"sptv\")\n ],\n [\n \"slug\" => \"name\",\n \"name\" => __(\"Name\", \"sptv\")\n ],\n [\n \"slug\" => \"description\",\n \"name\" => __(\"Description\", \"sptv\")\n ],\n [\n \"slug\" => \"phone-numbers\",\n \"name\" => __(\"Phone numbers\", \"sptv\")\n ]\n ]);\n\n $serviceChannelComponents = apply_filters(\"sptv_service_location_service_channel_components\", [\n [\n \"slug\" => \"default-all\",\n \"name\" => __(\"Default template\", \"sptv\")\n ],\n [\n \"slug\" => \"name\",\n \"name\" => __(\"Name\", \"sptv\")\n ],\n [\n \"slug\" => \"description\",\n \"name\" => __(\"Description\", \"sptv\")\n ],\n [\n \"slug\" => \"addresses\",\n \"name\" => __(\"Addresses\", \"sptv\")\n ],\n [\n \"slug\" => \"email\",\n \"name\" => __(\"Email\", \"sptv\")\n ],\n [\n \"slug\" => \"webpage\",\n \"name\" => __(\"Website\", \"sptv\")\n ],\n [\n \"slug\" => \"phone-numbers\",\n \"name\" => __(\"Phone numbers\", \"sptv\")\n ],\n [\n \"slug\" => \"service-hours\",\n \"name\" => __(\"Service Hours\", \"sptv\")\n ],\n [\n \"slug\" => \"accessibility\",\n \"name\" => __(\"Accessibility information\", \"sptv\")\n ]\n ]);\n\n $serviceComponents = apply_filters(\"sptv_service_components\", [\n [\n \"slug\" => \"default-all\",\n \"name\" => __(\"Default (no service channels)\", \"sptv\")\n ],\n [\n \"slug\" => \"name\",\n \"name\" => __(\"Name\", \"sptv\")\n ],\n [\n \"slug\" => \"summary\",\n \"name\" => __(\"Summary\", \"sptv\")\n ],\n [\n \"slug\" => \"description\",\n \"name\" => __(\"Description\", \"sptv\")\n ],\n [\n \"slug\" => \"user-instruction\",\n \"name\" => __(\"User instruction\", \"sptv\")\n ],\n [\n \"slug\" => \"requirements\",\n \"name\" => __(\"Requirements\", \"sptv\")\n ],\n [\n \"slug\" => \"service-channels\",\n \"name\" => __(\"Service channels\", \"sptv\")\n ],\n [\n \"slug\" => \"electronic-service-list\",\n \"name\" => __(\"Electronic service list\", \"sptv\")\n ],\n [\n \"slug\" => \"service-location-list\",\n \"name\" => __(\"Service location list\", \"sptv\")\n ],\n [\n \"slug\" => \"phone-service-list\",\n \"name\" => __(\"Phone service list\", \"sptv\")\n ],\n [\n \"slug\" => \"webpage-service-list\",\n \"name\" => __(\"Webpage service list\", \"sptv\")\n ],\n [\n \"slug\" => \"printable-form-list\",\n \"name\" => __(\"Printable form list\", \"sptv\")\n ],\n [\n \"slug\" => \"languages\",\n \"name\" => __(\"Languages\", \"sptv\")\n ]\n ]);\n\n $organizationComponents = apply_filters(\"sptv_organization_components\", [\n [\n \"slug\" => \"default-all\",\n \"name\" => __(\"Default\", \"sptv\")\n ],\n [\n \"slug\" => \"name\",\n \"name\" => __(\"Name\", \"sptv\")\n ],\n [\n \"slug\" => \"description\",\n \"name\" => __(\"Description\", \"sptv\")\n ]\n ]);\n\n wp_localize_script('sptv-blocks', 'sptv', [ \n \"serviceLocationServiceChannelBlock\" => [\n \"components\" => $serviceChannelComponents\n ],\n \"electronicServiceChannelBlock\" => [\n \"components\" => $electronicServiceChannelComponents\n ],\n \"webpageServiceChannelBlock\" => [\n \"components\" => $webpageServiceChannelComponents\n ],\n \"printableFormServiceChannelBlock\" => [\n \"components\" => $printableFormServiceChannelComponents\n ],\n \"phoneServiceChannelBlock\" => [\n \"components\" => $phoneServiceChannelComponents\n ],\n \"serviceBlock\" => [\n \"components\" => $serviceComponents\n ],\n \"organizationBlock\" => [\n \"components\" => $organizationComponents,\n \"organizationIds\" => Settings::getOrganizationIds()\n ]\n ]);\n\n register_block_type('sptv/service-location-service-channel-block', [\n 'attributes' => [ \n \"id\" => [\n 'type' => 'string'\n ],\n \"component\" => [\n 'type' => 'string'\n ],\n \"language\" => [\n 'type' => 'string'\n ]\n ],\n 'editor_script' => 'sptv-blocks',\n 'render_callback' => [ $this, \"renderServiceLocationServiceChannelBlock\" ]\n ]);\n\n register_block_type('sptv/electronic-service-channel-block', [\n 'attributes' => [ \n \"id\" => [\n 'type' => 'string'\n ],\n \"component\" => [\n 'type' => 'string'\n ],\n \"language\" => [\n 'type' => 'string'\n ]\n ],\n 'editor_script' => 'sptv-blocks',\n 'render_callback' => [ $this, \"renderElectronicServiceChannelBlock\" ]\n ]);\n\n register_block_type('sptv/webpage-service-channel-block', [\n 'attributes' => [ \n \"id\" => [\n 'type' => 'string'\n ],\n \"component\" => [\n 'type' => 'string'\n ],\n \"language\" => [\n 'type' => 'string'\n ]\n ],\n 'editor_script' => 'sptv-blocks',\n 'render_callback' => [ $this, \"renderWebpageServiceChannelBlock\" ]\n ]);\n\n register_block_type('sptv/printable-form-service-channel-block', [\n 'attributes' => [ \n \"id\" => [\n 'type' => 'string'\n ],\n \"component\" => [\n 'type' => 'string'\n ],\n \"language\" => [\n 'type' => 'string'\n ]\n ],\n 'editor_script' => 'sptv-blocks',\n 'render_callback' => [ $this, \"renderPrintableFormServiceChannelBlock\" ]\n ]);\n\n register_block_type('sptv/phone-service-channel-block', [\n 'attributes' => [ \n \"id\" => [\n 'type' => 'string'\n ],\n \"component\" => [\n 'type' => 'string'\n ],\n \"language\" => [\n 'type' => 'string'\n ]\n ],\n 'editor_script' => 'sptv-blocks',\n 'render_callback' => [ $this, \"renderPhoneServiceChannelBlock\" ]\n ]);\n\n register_block_type('sptv/service-block', [\n 'attributes' => [ \n \"id\" => [\n 'type' => 'string'\n ],\n \"component\" => [\n 'type' => 'string'\n ],\n \"language\" => [\n 'type' => 'string'\n ]\n ],\n 'editor_script' => 'sptv-blocks',\n 'render_callback' => [ $this, \"renderServiceBlock\" ]\n ]);\n\n register_block_type('sptv/organization-block', [\n 'attributes' => [ \n \"id\" => [\n 'type' => 'string'\n ],\n \"component\" => [\n 'type' => 'string'\n ],\n \"language\" => [\n 'type' => 'string'\n ]\n ],\n 'editor_script' => 'sptv-blocks',\n 'render_callback' => [ $this, \"renderOrganizationBlock\" ]\n ]);\n }",
"private function updateCache() {\n\t\t\n\t\trequire_once ABSPATH.'wp-admin/includes/plugin.php';\n\n\t\t$this->auto_plugins = get_plugins($this->relative_path);\n\t\t$this->mu_plugins = get_mu_plugins();\n\t\t\n\t\t$plugins = array_diff_key($this->auto_plugins, $this->mu_plugins);\n\t\t\n\t\t$this->activated = is_array($this->cache['plugins']) \n\t\t\t? array_diff_key($plugins, $this->cache['plugins']) \n\t\t\t: $plugins;\n\t\t\n\t\t$this->cache = array(\n\t\t\t'plugins' => $plugins,\n\t\t\t'count' => $this->countPlugins()\n\t\t);\n\n\t\tupdate_site_option(self::OPTION_KEY, $this->cache);\n\t}",
"private function loadPlugins() {\n\t\tforeach ($this->cache['plugins'] as $filename => $info) {\n\t\t\t$this->autoloadPlugin($filename, $info);\n\t\t\t$this->includePlugin($filename);\n\t\t}\n\t}",
"private function loadPlugins()\n {\n $Plugins = Controller::model(\"Plugins\");\n $Plugins->where(\"is_active\", \"=\", 1)->fetchData();\n\n $GLOBALS[\"_PLUGINS_\"] = [];\n\n foreach ($Plugins->getDataAs(\"Plugin\") as $p) {\n $idname = $p->get(\"idname\");\n $config_path = PLUGINS_PATH . \"/\" . $idname . \"/config.php\"; \n if (!file_exists($config_path)) {\n continue;\n }\n\n $config = include $config_path;\n if (!isset($config[\"idname\"]) || $config[\"idname\"] != $idname) {\n continue;\n }\n\n $file = PLUGINS_PATH. \"/\" . $idname . \"/\" . $idname . \".php\";\n if (file_exists($file)) {\n require_once $file;\n }\n\n $GLOBALS[\"_PLUGINS_\"][$config[\"idname\"]] = [\n \"config\" => $config,\n \"model\" => $p\n ];\n Event::trigger(\"plugin.load\", $p);\n } \n\n $this->loadInt();\n }",
"function blocks_register_metaboxes() {\n\t\t\n\t$types = blocks_post_types();\n\n\tif( $types ) {\n\t\tforeach( $types as $type ) {\n\t\t\tadd_meta_box( 'blocks_save', __('Your Areas', 'blocks'), 'blocks_save_blocks', $type, 'normal', 'high' );\n\t\t}\n\t}\n}",
"public abstract function getPluginStore();",
"public static function initBlocks() \n\t{\n\t\t\n\t\t$block_paths = apply_filters('mb-block-paths', array(MB()->get_plugin_path() . \"blocks/\") );\n\t\t \n\t\t//global $blockClass; // load requires only onc\n\n\t\t$newBlocks = array();\n\t\t$templates = array(); \n\t\t\n\t\t\n\t\tforeach($block_paths as $block_path)\n\t\t{\n\t\t\t$dir_iterator = new RecursiveDirectoryIterator($block_path, FilesystemIterator::SKIP_DOTS);\n\t\t\t$iterator = new RecursiveIteratorIterator($dir_iterator, RecursiveIteratorIterator::SELF_FIRST);\n\n\t\t\tforeach ($iterator as $fileinfo)\n\t\t\t{\n\n\t\t\t\t$path = $fileinfo->getRealPath(); \n\t\t\t\t// THIS IS PHP > 5.3.6\n\t\t\t\t//$extension = $fileinfo->getExtension(); \n\t\t\t\t$extension = pathinfo($path, PATHINFO_EXTENSION);\n\t\t\t\n\t\t\t\tif ($fileinfo->isFile() )\n\t\t\t\t{\n\t\t\t\t\tif ($extension == 'php') \n\t\t\t\t\t{\n\t\t\t\t\t \trequire_once($path);\n\t\t\t\t\t}\n\t\t\t\t\telseif($extension == 'tpl') \n\t\t\t\t\t{\t\n\t\t\t\t\t\t$filename = $fileinfo->getBasename('.tpl');\n\t\t\t\t\t\t$templates[$filename] = array('path' => $path); \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\t\t\tksort($blockOrder);\n\t\t\tforeach($blockOrder as $prio => $blockArray)\n\t\t\t{\n\t\t\t\tforeach($blockArray as $block)\n\t\t\t\t{\n\t\t\t\t\tif (isset($blockClass[$block]))\n\t\t\t\t\t\t$newBlocks[$block] = $blockClass[$block]; \n\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t$blockClass = $newBlocks;\n\t\t\tif (is_admin())\n\t\t\t{\n\t\t\t\t// possible issue with some hosters faking is_admin flag. \n\t\t\t\tif (class_exists( maxUtils::namespaceit('maxBlocks') ) && class_exists( maxUtils::namespaceit('maxBlocks') ) )\n\t\t\t\t{\n\t\t\t\t\tmaxField::setTemplates($templates); \n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\terror_log('[MaxButtons] - MaxField class is not set within admin context. This can cause issues when using button editor'); \n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t//$this->loadBlockClasses($blockClass); \n\t\t\n\t\tstatic::$block_classes = array_values($blockClass);\n\t}",
"private function load()\n {\n $json = $this->getData();\n\n foreach ($json->plugins as $plugin) {\n $this->_plugins[] = new Plugin($plugin);\n }\n }",
"function capabilities_block(){\n wp_register_script(\n 'capabilities-script',\n get_template_directory_uri() . '/js/block-capabilities.js',\n array( 'wp-blocks', 'wp-element', 'wp-editor', 'wp-components' )\n );\n\n wp_register_style(\n 'capabilities-editor-style',\n get_template_directory_uri() . '/css/block-capabilities-editor-style.css',\n array( 'wp-edit-blocks' )\n );\n\n wp_register_style(\n 'capabilities-style',\n get_template_directory_uri() . '/css/block-capabilities-style.css',\n array( 'wp-edit-blocks' )\n );\n\n register_block_type('childress/capabilities', array(\n 'editor_script' => 'capabilities-script',\n 'editor_style' => 'capabilities-editor-style',\n 'style' => 'capabilities-style',\n ) );\n}",
"protected function getPluginBag() {\n if (!$this->pluginBag) {\n $this->pluginBag = new BlockPluginBag(\\Drupal::service('plugin.manager.block'), $this->plugin, $this->get('settings'), $this->id());\n }\n return $this->pluginBag;\n }",
"public function plugins ()\n {\n }",
"function process_pluginsused() {\r\n\tglobal $plugins_used, $pluginsused_hidden_plugins;\r\n\tif(empty($plugins_used)) {\r\n\t\t$plugins_used = array();\r\n\t\t$active_plugins = get_option('active_plugins');\r\n\t\t$plugins = get_pluginsused();\r\n\t\t$plugins_allowedtags = array('a' => array('href' => array(),'title' => array()),'abbr' => array('title' => array()),'acronym' => array('title' => array()),'code' => array(),'em' => array(),'strong' => array());\r\n\t\tforeach($plugins as $plugin_file => $plugin_data) {\r\n\t\t\tif(!in_array($plugin_data['Plugin_Name'], $pluginsused_hidden_plugins)) {\r\n\t\t\t\t$plugin_data['Plugin_Name'] = wp_kses($plugin_data['Plugin_Name'], $plugins_allowedtags);\r\n\t\t\t\t$plugin_data['Plugin_URI'] = wp_kses($plugin_data['Plugin_URI'], $plugins_allowedtags);\r\n\t\t\t\t$plugin_data['Description'] = wp_kses($plugin_data['Description'], $plugins_allowedtags);\r\n\t\t\t\t$plugin_data['Author'] = wp_kses($plugin_data['Author'], $plugins_allowedtags);\r\n\t\t\t\t$plugin_data['Author_URI'] = wp_kses($plugin_data['Author_URI'], $plugins_allowedtags);\r\n\t\t\t\tif(PLUGINSUSED_SHOW_VERSION) {\r\n\t\t\t\t\t$plugin_data['Version'] = wp_kses($plugin_data['Version'], $plugins_allowedtags);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$plugin_data['Version'] = '';\r\n\t\t\t\t}\r\n\t\t\t\tif (!empty($active_plugins) && in_array($plugin_file, $active_plugins)) {\r\n\t\t\t\t\t$plugins_used['active'][] = $plugin_data;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$plugins_used['inactive'][] = $plugin_data;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}",
"private function load_plugins() {\n\t\t$file = file_get_contents( CAF_DIR . 'addons.json' );\n\t\t$this->plugins = json_decode( $file );\n\t}",
"function services_example_block(){\n wp_register_script(\n 'services-example-script',\n get_template_directory_uri() . '/js/block-services-example.js',\n array( 'wp-blocks', 'wp-element', 'wp-editor', 'wp-components' )\n );\n\n wp_register_style(\n 'services-example-editor-style',\n get_template_directory_uri() . '/css/block-services-example-editor-style.css',\n array( 'wp-edit-blocks' )\n );\n\n wp_register_style(\n 'services-example-style',\n get_template_directory_uri() . '/css/block-services-example-style.css',\n array( 'wp-edit-blocks' )\n );\n\n register_block_type('childress/services-example', array(\n 'editor_script' => 'services-example-script',\n 'editor_style' => 'services-example-editor-style',\n 'style' => 'services-example-style',\n ) );\n}",
"public function plugins(?string $tagged = NULL): array {\n static $fast;\n if (!isset($fast)) {\n $fast['store'] = &drupal_static(static::class . __function__ . $this->id, []);\n }\n if (!isset($fast['store'][$this->id])) {\n $type = \\Drupal::service('plugin.manager.' . $this->id);\n foreach ($type->getDefinitions() as $def) {\n $fast['store'][$this->id][$def['id']] = $type->createInstance($def['id']);\n }\n }\n\n $ret = $fast['store'][$this->id];\n if ($tagged) {\n $ret = array_filter($ret, function (HiddenTabPluginInterfaceBase $plugin) use ($tagged) {\n return empty($plugin->tags()) || in_array($tagged, $plugin->tags());\n });\n }\n return $ret;\n }",
"public static function register_blocks() {\n\t\t$blocks = [\n\t\t\t'FeaturedCategory',\n\t\t\t'FeaturedProduct',\n\t\t\t'HandpickedProducts',\n\t\t\t'ProductBestSellers',\n\t\t\t'ProductCategories',\n\t\t\t'ProductCategory',\n\t\t\t'ProductNew',\n\t\t\t'ProductOnSale',\n\t\t\t'ProductsByAttribute',\n\t\t\t'ProductTopRated',\n\t\t\t'ProductTag',\n\t\t];\n\t\tforeach ( $blocks as $class ) {\n\t\t\t$class = __NAMESPACE__ . '\\\\BlockTypes\\\\' . $class;\n\t\t\t$instance = new $class();\n\t\t\t$instance->register_block_type();\n\t\t}\n\t}",
"protected function setPluginsJs()\n {\n $plugins = $this->plugins;\n if (!is_array($this->plugins)){\n $plugins = [];\n }\n\n foreach ($plugins as $plugin=>$item){\n if (in_array($plugin, $this->pluginsCss)){\n $this->css[] = \"plugins/{$plugin}/{$plugin}.css\";\n }\n $this->js[] = \"plugins/{$plugin}/{$plugin}.js\";\n }\n\n }",
"function contact_tabs_block(){\n wp_register_script(\n 'contact-tabs-script',\n get_template_directory_uri() . '/js/block-contact-tabs.js',\n array( 'wp-blocks', 'wp-element', 'wp-editor', 'wp-components' )\n );\n\n wp_register_style(\n 'contact-tabs-editor-style',\n get_template_directory_uri() . '/css/block-contact-tabs-editor-style.css',\n array( 'wp-edit-blocks' )\n );\n\n wp_register_style(\n 'contact-tabs-style',\n get_template_directory_uri() . '/css/block-contact-tabs-style.css',\n array( 'wp-edit-blocks' )\n );\n\n register_block_type('childress/contact-tabs', array(\n 'editor_script' => 'contact-tabs-script',\n 'editor_style' => 'contact-tabs-editor-style',\n 'style' => 'contact-tabs-style',\n 'render_callback' => 'contact_tabs_callback'\n ) );\n}",
"function add_plugin_tabGroup($plugin_array) {\n $plugin_array['tabGroup'] = get_template_directory_uri().'/js/tinymce-btns.js'; \n return $plugin_array; \n}"
] | [
"0.6598325",
"0.63528603",
"0.60490197",
"0.60320395",
"0.5888494",
"0.58750725",
"0.58291185",
"0.5817732",
"0.5814132",
"0.57606554",
"0.5741991",
"0.57381797",
"0.57260513",
"0.5697498",
"0.5661792",
"0.5599365",
"0.5596999",
"0.5595251",
"0.55664575",
"0.5566046",
"0.55625135",
"0.5557269",
"0.5530809",
"0.55188763",
"0.5508058",
"0.54871535",
"0.5462339",
"0.5458142",
"0.54554373",
"0.5449364"
] | 0.639878 | 1 |
/to show add package view | public function addpackageAction()
{
$this->view->data="";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addPaket()\n {\n return view ('admin/addPaket');\n }",
"public function addAction()\n\t{\n\t\t\n\t\t$insert_data['package_name']=$this->getRequest()->getPost('package_name', null);\n\t\t$insert_data['credit']=$this->getRequest()->getPost('credit', null);\n\t\t$insert_data['price']=$this->getRequest()->getPost('price', null);\n\t\t$insert_data['package_order']=$this->packages->get_max_package();\n\t\t$packa_id=$this->packages->add_package_details($insert_data);\n\t\t\n\t\tZend_Session::start();\n\t\t$add = new Zend_Session_Namespace('add');\n\t\t$add->addmessage = \"Package details has been saved Successfully\";\n\t\t//$this->_helper->redirector->gotoUrl(ADMIN_URL.'packages/addpackage');\n\t\t$this->_helper->redirector->gotoUrl(ADMIN_URL.'packages/index');\n\t}",
"public function create()\n {\n\t\t\treturn view('packages.create');\n }",
"public function packgeDetailAction() {\n $id = $this->_getParam('id');\n if (empty($id)) {\n return $this->_forward('notfound', 'error', 'core');\n }\n $this->view->package = Engine_Api::_()->getItem('sitestore_package', $id);\n }",
"public function show(Package $package)\n {\n //\n }",
"public function create()\n\t{\n\t\t$title = 'Create Package';\n\n\t\t$data = array('title'=>$title);\n\n\t\treturn View::make('admin.packages.create', compact('data'));\n\t}",
"public function showAction()\n {\n\t\t$package = $this->_helper->db->findById();\n \t\t$contents = array_map(function($o) {\n\t\t\t\t\t\treturn $o->item_id;\n\t\t\t\t\t}, $package->Contents);\n\t\t$this->view->package_manager_package = $package;\n\t\t$this->view->contents = $contents;\n\t\t$this->view->export_fields = unserialize(get_option('package_manager_export_fields'));\n\t\t$this->view->relations = $package->Relations;\n\t\t$output_type = $this->_helper->contextSwitch->getCurrentContext();\n\t\tif(in_array($output_type, array('csv','yaml','object'))){\n\t\t\tif(!get_option('package_manager_export_inline')){\n\t\t\t\tswitch($output_type){\n\t\t\t\t\tcase 'csv':\n\t\t\t\t\t\t$this->getResponse()->setHeader('Content-Type', 'text/csv; charset=utf-8', true);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'yaml':\n\t\t\t\t\t\t$this->getResponse()->setHeader('Content-Type', 'application/yaml; charset=utf-8', true);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'object': // Unable to set it as JSON (default Zend output type)\n\t\t\t\t\t\t$this->getResponse()->setHeader('Content-Type', 'application/json; charset=utf-8', true);\n\t\t\t\t\t\t$output_type = 'json';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$this->getResponse()->setHeader('Content-disposition', 'attachment; filename=\"'.metadata('package_manager_package', 'slug').'.'.$output_type.'\"', true);\n\t\t\t}\n\t\t}\n $requiredItemFileds = array(\n 'Dublin Core' => array('Title', 'Description', 'Creator', 'Language')\n );\n $results = array();\n $this->view->incompleteItems = array();\n foreach (array_keys($requiredItemFileds) as $scope) {\n foreach ($requiredItemFileds[$scope] as $field) {\n $results[$field] = $this->_findIncompleteItemsInPackage($package, $field, $scope);\n if( !empty($results[$field])){ $this->view->incompleteItems[$field] =$results[$field];}\n }\n }\n\t\t// parent::showAction();\n\t}",
"public function create()\n {\n return view('packages.create');\n }",
"public function create()\n {\n return view('packages.create');\n }",
"public function create()\n {\n return view('packages.create');\n }",
"public function create()\n {\n $places = Place::latest()->get();\n return view('admin.package.create', compact('places'));\n }",
"public function create()\n {\n $page_title = __('site.package.create');\n// $page_description = __('site.category.description');\n return \\view('dashboard.packages.create',compact('page_title'));\n }",
"public function getPackageform()\n {\n $packages = Packages::orderBy('type')->orderBy('name')->paginate(4);\n return view('admin.packages.packageform', compact('packages'));\n }",
"public function add()\n {\n $data = array();\n if(!UserHelper::isLoggedIn())\n UtilityHelper::redirectAndComeback(FALSE, \"Before you contribute, log in :)\");\n\n $this->load->library('form_validation');\n $this->load->helper('form_helper');\n\t\t$this->load->model('spark');\n\n if ($_POST)\n {\n if($this->form_validation->run('add-package'))\n {\n $post = $_POST;\n $post['contributor_id'] = UserHelper::getId();\n\n $insert = elements(array('contributor_id', 'name', 'summary', 'description', 'website', 'repository_type', 'base_location', 'fork_id', 'is_browse'), $post);\n\n $this->load->model('Spark');\n\n if(Spark::insert($insert))\n {\n UserHelper::setNotice(\"Woot, the spark's been added! Thanks for making CodeIgniter awesome!\");\n redirect(base_url() . 'packages/' . $insert['name'] . '/show');\n }\n else\n {\n UserHelper::setNotice(\"Whoops, erra.\", FALSE);\n }\n }\n else\n {\n UserHelper::setNotice(\"Whoops, there were some problems with your submission. Check below.\", FALSE);\n }\n }\n\n\n\t\t\t\t$data['sparkslist'] = Spark::get_index_list();\n $this->load->view('packages/add', $data);\n }",
"public function addAction ()\n { \n $this->model->add_products ($this->params ['codes']);\n $this->model->history ();\n echo $this->view->Tree ($this->model->get_provider_product_tree (), true);\n }",
"public function editpackageAction()\n {\n $modify = new Zend_Session_Namespace('add');\n \n if($this->_request->getParam('modify')!='') \n {\n\t\t\t$clientDetail = $this->packages->get_package_details($this->_request->getParam('modify'));\n\t\t\t$this->view->det=$clientDetail['rows'];\n\t\t\tunset($modify->successMessage);\n \t }\n\t}",
"public function create()\n {\n //\n $data['method'] = \"post\";\n $data['url'] = url('admin/package');\n return view('admin.package.create', $data);\n }",
"public function create()\n {\n return view('backend/bus_packages.create');\n }",
"public function packagesAction()\n {\n self::access('admin');\n if ($_SERVER['REQUEST_METHOD']=='POST' || isset($_GET['test'])) {\n new Package();\n return;\n }\n $search = htmlentities(Router::param('search', 2));\n $tab = Router::param('tab', 1);\n $packages = [];\n\n if ($tab == 'new' && FS_ACCESS) {\n $url = 'https://gilacms.com/packages/?search='.$search;\n $url .= Config::get('test')=='1' ? '&test=1' : '';\n if (!$contents = file_get_contents($url)) {\n View::alert('error', \"Could not connect to packages list. Please try later.\");\n } else {\n $packages = json_decode($contents);\n }\n } else {\n $packages = Package::scan();\n }\n if (!is_array($packages)) {\n View::alert('error', \"Something went wrong. Please try later.\");\n $packages = [];\n }\n View::set('packages', $packages);\n View::set('search', $search);\n View::renderAdmin('admin/package-list.php');\n }",
"public function actionCreate()\n\t{ \n\t\t$this->render('tourpackage_create');\n\t}",
"public function index()\n {\n //\n $objs = DB::table('packages')\n ->Orderby('id', 'desc')\n ->paginate(15);\n\n $data['objs'] = $objs;\n return view('admin.package.index', $data);\n }",
"public function create()\n {\n $subjects = Subject::where('is_deleted', '=', 0)->get();\n $datas['subjects'] = $subjects;\n return view('admin.views.add_packages',compact('datas'));\n\n }",
"public function create()\n\t{\t\n\t\t$services = Service::getActiveServices();\n\t\t$services = Util::removeEmpty($services);\n\t\t\n\t\t$data = array('package' => new Service(), 'services' => $services);\n\t\t\n\t\t\n\t\treturn view('package.create')->with($data);\n\t}",
"public function create()\n { \n $services=Service::All(); \n $packages=Package::All();\n return view('backend.packages.create',compact('packages','services'));\n }",
"public function create()\n { \n $package_category=DB::table('package_categories')->get();\n $subcategory=DB::table('subcategories')->get();\n return view('admin.package.create',compact('package_category','subcategory'));\n }",
"public function addPackage($request, $response)\n {\n if(empty($_SESSION))\n {\n return $response->withRedirect($this->router->pathFor('admin.login'));\n }elseif($_SESSION['user_type'] === 1){\n return $response->withRedirect($this->router->pathFor('admin.dash'));\n }\n\n /** Get Countries from the Database */\n $countries = Country::select('iso','nicename')->orderBy('nicename', 'asc')->get();\n \n /** Get Package Categories from Database */\n $package_categories = Package_category::select('id', 'name')->get();\n\n return $this->view->render($response,\n 'agents/add_package2.twig',\n [\n 'title' => 'Packages',\n 'type' => 'packages-form',\n 'name' => 'packages',\n 'nav' => 'packages',\n 'countries' => $countries,\n 'categories' => $package_categories \n ]\n );\n }",
"function showdirectory()\r\n\t{\r\n\t\t// Create the view\r\n\t\t$this->setViewName( 'List', 'com_jpackagedir', 'JPackageDirView' );\r\n\t\t$view = & $this->getView();\r\n\r\n\t\t// Get/Create the model\r\n\t\t$model = & $this->getModel('List', 'JPackageDirModel');\r\n\r\n\t\t// Push the model into the view (as default)\r\n\t\t$view->setModel($model, true);\r\n\r\n\t\t// Display the view\r\n\t\t$view->display();\r\n\t}",
"public function create()\n {\n return view('pages.admin.travel-package.create'); //untuk mengembalikaan view create\n }",
"public function add(){\n\n\t\t\t$this->view(\n\t\t\t\tarray(\"header\",\"navbar\",\"activity/add\",\"footer\"),\n\t\t\t\t$this->component()\n\t\t\t);\n\t\t}",
"public function show($id)\n {\n // $package=Package::find($id);\n // return view('backend.packages.index',compact('package'));\n }"
] | [
"0.7135357",
"0.70237887",
"0.6789844",
"0.671614",
"0.66964155",
"0.6663204",
"0.66524863",
"0.6604901",
"0.6604901",
"0.6604901",
"0.6596152",
"0.6589077",
"0.6560737",
"0.65525556",
"0.64577144",
"0.64320827",
"0.64093584",
"0.6384461",
"0.63786507",
"0.635739",
"0.6322622",
"0.6282996",
"0.6277632",
"0.62746906",
"0.627098",
"0.6260279",
"0.6259036",
"0.6252081",
"0.62306815",
"0.6223516"
] | 0.7222907 | 0 |
/ Metodo para mostrar los autores | public function mostrarAutores()
{
try {
$query = parent::$conexion->query("SELECT * FROM test.autor");
$query->setFetchMode(PDO::FETCH_CLASS,'Autor');
$i = 0;
while ( $autor = $query->fetch() ) {
$consulta[$i++] = $autor;
}
} catch (PDOException $e) {
echo 'Error en el query: '. $e->getMessage();
}
return $consulta;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function mostrarAuto($auto)\r\n {\r\n $show = \"\". $auto->_marca. \" - \".$auto->_color. \" - \". $auto->_precio;\r\n\r\n if($auto->_fecha !== null)\r\n {\r\n $show .= \" - \". date(\"D dS F o\",$auto->_fecha);\r\n }\r\n\r\n return $show;\r\n }",
"public function mostrarAlunos() {\r\n\t\tforeach($this->alunos as $aluno) {\r\n\t\t\techo $aluno->nome . '<br>';\r\n\t\t}\r\n\t}",
"public function autoresCbo();",
"public function show(Auto $auto)\n {\n //\n return $auto;\n }",
"public function listado() {\n $generos = Genero::all();\n foreach($generos as $genero) {\n echo $genero->descripcion.\"<br>\";\n }\n }",
"function agenda_autoriser() {\n}",
"function cinemalist_autoriser(){}",
"function aspirateur_autoriser(){}",
"function produits_autoriser() {\n}",
"public function index()\n {\n return DB::table('autores')\n ->select('libros.*', 'a.stock', 'autores.*')\n ->join('autor_escribe_libro as aut', 'aut.id_autor','=', 'autores.id_autor')\n ->join('libros', 'libros.id_libro', '=', 'aut.id_libro')\n ->join('almacen_almacena_libro as a', 'a.id_libro', '=', 'libros.id_libro')\n ->join('almacenes', 'almacenes.id_almacen', '=', 'a.id_almacen')\n ->get();\n }",
"public function altaAutomotoresAction()\n\t{\n\t\t$this->view->monedas = Domain_Helper::getHelperByDominio('moneda');\n\t\t$this->view->periodos = Domain_Helper::getHelperByDominio('periodo');\n\t\t$this->view->forma_pagos = Domain_Helper::getHelperByDominio('forma_pago');\n\t\t$this->view->cuotas = Domain_Helper::getHelperByDominio('cuota');\n\t\t$this->view->capacidad_automotores = Domain_Helper::getHelperByDominio('capacidad_automotores');\n\t\t$this->view->tipo_cobertura_automotores = Domain_Helper::getHelperByDominio('tipo_cobertura_automotores');\n\t\t$this->view->pasajeros_automotores = Domain_Helper::getHelperByDominio('pasajeros_automotores');\n\t\t$this->view->estado_vehiculo_automotores = Domain_Helper::getHelperByDominio('estado_vehiculo_automotores');\n\t\t$this->view->tipo_combustion_automotores = Domain_Helper::getHelperByDominio('tipo_combustion_automotores');\n\t\t$this->view->sistema_seguridad_automotores = Domain_Helper::getHelperByDominio('sistema_seguridad_automotores');\n\t\t$this->view->tipo_vehiculo_automotores = Domain_Helper::getHelperByDominio('tipo_vehiculo_automotores');\n\n\t\t$compania = new Domain_Compania();\n\t\t$this->view->companias= $compania->getModel()->getTable()->findAll()->toArray();\n\t\t$productor = new Domain_Productor();\n\t\t$this->view->productores= $productor->getModel()->getTable()->findAll()->toArray();\n\t\t$agente = new Domain_Agente();\n\t\t$this->view->agentes= $agente->getModel()->getTable()->findAll()->toArray();\n\t\t$cobrador = new Domain_Cobrador();\n\t\t$this->view->cobradores= $cobrador->getModel()->getTable()->findAll()->toArray();\n\n\t\t//Esto es un asco tengo que modificarlo cuando tenga tiempo\n\t\t$this->view->isAgente = false;\n\t\t$this->view->isOperador = false;\n\t\t$rol_usuario = $this->_t_usuario->getNombre();\n\t\tif($rol_usuario=='AGENTE'){\n\n\t\t\t$this->view->isAgente = true;\n\t\t\t$this->view->agente_id = $this->_usuario->getModel()->usuario_tipo_id;\n\t\t\t$this->view->agente_nombre = Domain_Agente::getNameById($this->_usuario->getModel()->usuario_tipo_id);\n\t\t\t////print_r($this->view->agente_nombre);\n\t\t}elseif($rol_usuario=='OPERADOR'){\n\t\t\t\t\n\t\t\t$this->view->isOperador = true;\n\t\t}\n\n\t\t//2. Traigo el POST\n\t\t$params = $this->_request->getParams();\n\t\t//echo \"<pre>\";\n\t\t////print_r($params);\n\t\t//Si viene con ID es para guardar y traigo la solicitud con los datos\n\t\tif(! empty($params['solicitud_id']) ){\n\t\t\t$solicitud = new Domain_Poliza($params['solicitud_id']);\n\n\t\t\t//echo \"<pre>\";\n\t\t\t//print_r($solicitud->getModelPoliza());\n\t\t\t//exit;\n\n\t\t\t$this->view->solicitud = $solicitud->getModelPoliza();\n\t\t\t$this->view->poliza_valores = $solicitud->getModelPolizaValores();\n\t\t\t$this->view->poliza_detalle = $solicitud->getModelDetalle();\n\t\t\t$this->view->detalle_pago = $solicitud->getModelDetallePago();\n\t\t\t$this->view->cantidad_cuotas = (int)Domain_DetallePago::getCantidadCuotas($solicitud->getModelDetallePago()->detalle_pago_id);\n\t\t\t$this->view->valor_cuotas = (float)Domain_DetallePago::getValorCuotas($solicitud->getModelDetallePago()->detalle_pago_id);\n\t\t\t$this->view->importe = $this->view->cantidad_cuotas * $this->view->valor_cuotas;\n\t\t\t$this->view->asegurado_nombre = Domain_Asegurado::getNameById($solicitud->getModelPoliza()->asegurado_id);\n\n\t\t}else{\n\t\t\t//Nueva solicitud\n\t\t\t$solicitud = $this->_solicitud;\n\t\t}\n\n\t\tif($params['save']){\n\t\t\t/*\n\t\t\t * Service_Poliza::saveSolicitud()\n\t\t\t * @param: Domain_Poliza,$params(datos del POST)\n\t\t\t */\n\n\t\t\t$solicitud = $this->_services_solicitud->saveSolicitudAutomotor($solicitud,$params);\n\t\t\t$solicitud = $this->_services_solicitud->saveDetallePago($solicitud,$params);\n\n\n\t\t\t$this->view->solicitud = $solicitud->getModelPoliza();\n\t\t\t$this->view->poliza_valores = $solicitud->getModelPolizaValores();\n\t\t\t$this->view->poliza_detalle = $solicitud->getModelDetalle();\n\n\t\t\t$this->view->detalle_pago = $solicitud->getModelDetallePago();\n\t\t\t//Por ahora es un metodo estatico, podria ponerlo dentro de la clase solicitud\n\t\t\t$this->view->cantidad_cuotas = (int) Domain_DetallePago::getCantidadCuotas($solicitud->getModelDetallePago()->detalle_pago_id);\n\t\t\t$this->view->valor_cuotas = (float)Domain_DetallePago::getValorCuotas($solicitud->getModelDetallePago()->detalle_pago_id);\n\t\t\t$this->view->importe = $this->view->cantidad_cuotas * $this->view->valor_cuotas;\n\t\t\t$this->view->asegurado_nombre = Domain_Asegurado::getNameById($solicitud->getModelPoliza()->asegurado_id);\n\t\t}\n\n\t}",
"public function mostrar()\n\t{\n\t\t$db = Db::conectar();\n\t\t$cuartarazon = null;\n\t\t$select = $db->query('SELECT * FROM cuartarazonbeca;');\n\t\tforeach ($select->fetchAll() as $cuartarazon) {\n\t\t\t$mycuartarazonBeca = new Cuartarazonbeca();\n\t\t\t$mycuartarazonBeca->setCuartaRazonBecaId($cuartarazon['cuartaRazonBecaId']);\n\t\t\t$mycuartarazonBeca->setCuartaRazonBeca($cuartarazon['cuartaRazonBeca']);\n\t\t\t$mycuartarazonBeca->setCuartarazonbecacodigo($cuartarazon['cuartarazonbecacodigo']);\n\t\t\t$mycuartarazonBeca->setCuartarazonbecaOculto($cuartarazon['cuartarazonbecaOculto']);\n\t\t\t$mycuartarazonBeca->setCuartarazonbecaAccion($cuartarazon['cuartarazonbecaAccion']);\n\t\t\t$mycuartarazonBeca->setCuartarazonbecafecha($cuartarazon['cuartarazonbecafecha']);\n\t\t\t$mycuartarazonBeca->setCuartarazonbecauser($cuartarazon['cuartarazonbecauser']);\n\t\t\t$mycuartarazonBeca->setCuartarazonbecabool($cuartarazon['cuartarazonbecabool']);\n\t\t\t$listacuartarazon[] = $mycuartarazonBeca;\n\t\t}\n\n\t\treturn $listacuartarazon;\n\t}",
"function _mostrar(){\n $html = $this->Cabecera();\n $html .= $this->contenido();\n $html .= $this->Pata();\n echo $html;\n }",
"public function listarXAutor()\n {\n $autor = $this->currentUser->getUsuario();\n\n $preguntas = $this->preguntaMapper->listarPreguntasAutor($autor);\n $this->view->setVariable(\"preguntas\", $preguntas);\n\n //Mandamos todas las etiquetas para poder visualizarlas\n $etiqTot = $this->preguntaMapper->listarEtiquetasTotales();\n $this->view->setVariable(\"etiqTot\", $etiqTot);\n $estado = true;\n $this->view->setVariable(\"autorMispreguntas\", $estado);\n\n //Creamos la vista\n $this->view->render(\"inicio\");\n }",
"function relecture_autoriser() {}",
"public function index_get(){\n $autores = $this->autores_model->get();\n\n // Comprobar que la respuesta no sea nulo\n if ( !is_null($autores) ) {\n $this->response( array( 'autores' => $autores), 200 );\n } else {\n $this->response( array('error' => 'No hay autores en la base de datos..'), 404 );\n }\n }",
"function lista(){\n $figuras = new Figuras();\n \n echo \n \"<h1>Listado de figuras</h1>\n <ul>\";\n \n foreach($figuras->getAll() as $figura) {\n echo \"<li>\" . \n $figura->ToString() . \n \" | <a href='verFigura/\" . $figura->getId() . \"'>VER </a>\" .\n \"</li>\";\n }\n \n echo \"\n </ul>\n <a href='./'>Volver</a>\";\n}",
"public function cadastrarMotorista ()\n {\n /*\n Controller faz a solicitação para a model enviar os dados do banco,\n mostrar dados recebidos ou a menssagem de erro vinda da model.\n */\n try {\n\n /*\n twig é uma api que permite mostrar conteudos na view sem a necessidade de escrever\n codigo php no html da view, assim o codigo não fica misturado.\n sintaxe:\n naview: {{conteudo}}\n na controller: array[conteudo] = nome\n\n o valores na view dentro de {{}} sao substituidos pela valor da chave no array\n\n */\n $loader = new \\Twig\\Loader\\FilesystemLoader('app/view');\n $twig = new \\Twig\\Environment($loader);\n $template = $twig->load('cadastrarMotorista.html');\n\n //array com chaver parametros para substituir na view\n $parametros = array();\n $conteudo = $template->render($parametros);\n\n echo $conteudo;\n\n } catch (PDOException $e) {\n echo $e->getMessage();\n }\n\n \n }",
"public function index()\n {\n $autos=Autos::all();\n return view('auto.index',compact('autos'));\n }",
"public function aseate() {\n echo \"Me estoy limpiando las escamas<br>\";\n }",
"public function mostrar(){\n echo \"<h1> Número de pessoas = $this->qtPessoas </h1>\";\n }",
"public function mostrar_carritos() {\n require 'model/ItemModel.php';\n $items = new ItemModel();\n\n $idCliente = $_SESSION['idCliente'];\n $data['listadoCarrito'] = $items->listarArticulosAgregadosCarrito($idCliente);\n $this->view->show(\"vistaClienteArticulosAgregadosCarrito.php\", $data);\n }",
"public function available() {\n echo \"\\nCOMANDOS DISPONÍVEIS\\n\";\n echo \"------------------------------------------------------------------------------\";\n echo \"\\n* help -- Exibe a ajuda deste utilitário\\n\";\n echo \"* version -- Exibe a versão deste utilitário\\n\";\n echo \"* /caminho/completo -- Copia os arquivos base para o diretório fornecido\\n\";\n echo \"------------------------------------------------------------------------------\\n\\n\";\n }",
"public function mostrarAlumnosController(){\n $alumnos = Datos::vista(\"alumno\");\n foreach($alumnos as $row => $item){\n echo'<option value ='.$item['matricula'].'>'.$item['nombres'].' '.$item['apellidos'].'</option>';\n }\n }",
"function get_lista_autores($mysqli){\r\n\t\t$sql=\"SELECT id,nombre,apellidos FROM Autor\";\r\n\t\tif ($resultado = $mysqli->query($sql))\r\n\t\t{\r\n\t\t\tif ($mysqli->error)\r\n\t\t\t{\r\n\t\t\t\techo \"Error al consultar: \" . $mysqli->error;\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\twhile ($fila = $resultado->fetch_assoc()) {\t\r\n\t\t\t\t\t$final[] = $fila;\r\n\t\t\t\t}\r\n\t\t\t\t$resultado->free();\r\n\t\t\t\treturn $final;\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function mostrar_historial() {\n $this->view->show(\"historialCliente.php\");\n }",
"public function altaAction()\n\t{\n\t\t//$rows = $this->_services_simple_crud->getAll($this->_solicitud->getModel());\n\t\t//$this->view->rows = $rows;\n\t}",
"function compositions_autoriser(){}",
"public function mostrarTeatros(){\n /**\n * @var object $objTeatro\n * @var array $colTeatro\n * @var string $strTeatros\n */\n $objTeatro=new Teatro();\n $colTeatro=$objTeatro->listar();\n $strTeatros=\"Teatros: \\n\";\n foreach($colTeatro as $teatro){\n $strTeatros.=\"* \\n\".$teatro;\n }\n return $strTeatros;\n }",
"function DibujeControlCronometro($Ancho){\r\n \r\n print('<div id=\"crono\" style=\"width: '.$Ancho.'%;\">\r\n\t\t\r\n\t\t<input type=\"button\" class=\"boton\" id=\"inicio\" value=\"Start ►\" onclick=\"inicio();\">\r\n\t\t<input type=\"button\" class=\"boton\" id=\"parar\" value=\"Stop ∎\" onclick=\"parar();\" disabled>\r\n\t\t<input type=\"button\" class=\"boton\" id=\"continuar\" value=\"Resume ↺\" onclick=\"inicio();\" disabled>\r\n\t\t<input type=\"button\" class=\"boton\" id=\"reinicio\" value=\"Reset ↻\" onclick=\"reinicio();\" disabled>\r\n\t</div>');\r\n\t}"
] | [
"0.6607243",
"0.6531169",
"0.63563687",
"0.6243174",
"0.60670793",
"0.6050315",
"0.60247034",
"0.59870946",
"0.5954511",
"0.5921235",
"0.59200716",
"0.59122044",
"0.5887",
"0.5886041",
"0.5879836",
"0.58490586",
"0.58470565",
"0.5829698",
"0.58161616",
"0.5807718",
"0.58060944",
"0.5797491",
"0.5792074",
"0.5786338",
"0.57835174",
"0.57566935",
"0.5753488",
"0.57465065",
"0.5732352",
"0.57318467"
] | 0.66366225 | 0 |
Metodo para insertar el libros en la BBDD | public function insertLibro($paramLibro)
{
try {
$stmt = parent::$conexion->prepare("INSERT INTO test.libro(libtitulo,libnumpag,autlid) VALUES (:libtitulo, :libnumpag, :autlid)");
$stmt->bindParam( ':libtitulo', $paramLibro->getTitulo() );
$stmt->bindParam( ':libnumpag', $paramLibro->getNumPag() );
$stmt->bindParam( ':autlid', $paramLibro->getAutID() );
$stmt->execute();
} catch (PDOException $e) {
echo 'Error en el query: '. $e->getMessage();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function agregar(){\n\t\t$sql = \"insert into libro (isbn,titulo,subtitulo,descripcion,num_pag,anho,id_categoria,id_editorial,id_autor) \";\n\t\t$sql .= \"value (\\\"$this->isbn\\\",\\\"$this->titulo\\\",\\\"$this->subtitulo\\\",\\\"$this->descripcion\\\",\\\"$this->num_pag\\\",\\\"$this->anho\\\",$this->id_categoria,$this->id_editorial,$this->id_autor)\";\n\t\treturn Executor::doit($sql);\n\t}",
"function install($upgrade_from=NULL,$upgrade_from_hack=NULL)\n\t{\n\t\t//first ensure there is 'buttons' banners category, and if it doesn't exist create it\n\t\t$id='buttons';\n\t\t$is_textual=0;\n\t\t$image_width=120;\n\t\t$image_height=60;\n\t\t$max_file_size=70;\n\t\t$comcode_inline=0;\n\n\t\t$test=$GLOBALS['SITE_DB']->query_value_null_ok('banner_types','id',array('id'=>$id));\n\t\tif (is_null($test))\n\t\t{\n\t\t\t$GLOBALS['SITE_DB']->query_insert('banner_types',array(\n\t\t\t\t'id'=>$id,\n\t\t\t\t't_is_textual'=>$is_textual,\n\t\t\t\t't_image_width'=>$image_width,\n\t\t\t\t't_image_height'=>$image_height,\n\t\t\t\t't_max_file_size'=>$max_file_size,\n\t\t\t\t't_comcode_inline'=>$comcode_inline\n\t\t\t));\n\n\t\t\tlog_it('ADD_BANNER_TYPE',$id);\n\t\t}\n\n\t\t$submitter=$GLOBALS['FORUM_DRIVER']->get_guest_id();\n\n\t\trequire_code('banners3');\n\t\t//create default banners, if they don't exist\n\t\tadd_banner_quiet('ocportal','data_custom/causes/ocportal.gif','ocPortal','ocPortal',0,'http://ocportal.com/',3,'',0,NULL,$submitter,1,'buttons',NULL,0,0,0,0,NULL);\n\n\t\tadd_banner_quiet('firefox','data_custom/causes/firefox.gif','Firefox','Firefox',0,'http://www.mozilla.com/firefox/',3,'',0,NULL,$submitter,1,'buttons',NULL,0,0,0,0,NULL);\n\n\t\tadd_banner_quiet('w3cxhtml','data_custom/causes/w3c-xhtml.gif','W3C XHTML','W3C XHTML',0,'http://www.w3.org/MarkUp/',3,'',0,NULL,$submitter,1,'buttons',NULL,0,0,0,0,NULL);\n\n\t\tadd_banner_quiet('w3ccss','data_custom/causes/w3c-css.gif','W3C CSS','W3C CSS',0,'http://www.w3.org/Style/CSS/',3,'',0,NULL,$submitter,1,'buttons',NULL,0,0,0,0,NULL);\n\n\t\t//no banner image\n\t\t//add_banner_quiet('w3cwcag','data_custom/causes/w3c-wcag.gif','W3C WCAG','W3C WCAG',0,'http://www.w3.org/TR/WCAG10/',3,'',0,NULL,$submitter,1,'buttons',NULL,0,0,0,0,NULL);\n\n\t\tadd_banner_quiet('cancerresearch','data_custom/causes/cancerresearch.gif','Cancer Research','Cancer Research',0,'http://www.cancerresearchuk.org/',3,'',0,NULL,$submitter,1,'buttons',NULL,0,0,0,0,NULL);\n\n\t\tadd_banner_quiet('rspca','data_custom/causes/rspca.gif','RSPCA','RSPCA',0,'http://www.rspca.org.uk/home',3,'',0,NULL,$submitter,1,'buttons',NULL,0,0,0,0,NULL);\n\n\t\tadd_banner_quiet('peta','data_custom/causes/peta.gif','PETA','PETA',0,'http://www.peta.org',3,'',0,NULL,$submitter,1,'buttons',NULL,0,0,0,0,NULL);\n\n\t\tadd_banner_quiet('Unicef','data_custom/causes/unicef.gif','Unicef','Unicef',0,'http://www.unicef.org',3,'',0,NULL,$submitter,1,'buttons',NULL,0,0,0,0,NULL);\n\n\t\tadd_banner_quiet('wwf','data_custom/causes/wwf.gif','WWF','WWF',0,'http://www.wwf.org/',3,'',0,NULL,$submitter,1,'buttons',NULL,0,0,0,0,NULL);\n\n\t\tadd_banner_quiet('greenpeace','data_custom/causes/greenpeace.gif','Greenpeace','Greenpeace',0,'http://www.greenpeace.com',3,'',0,NULL,$submitter,1,'buttons',NULL,0,0,0,0,NULL);\n\n\t\tadd_banner_quiet('helptheaged','data_custom/causes/helptheaged.gif','HelpTheAged','HelpTheAged',0,'http://www.helptheaged.org.uk/en-gb',3,'',0,NULL,$submitter,1,'buttons',NULL,0,0,0,0,NULL);\n\n\t\tadd_banner_quiet('nspcc','data_custom/causes/nspcc.gif','NSPCC','NSPCC',0,'http://www.nspcc.org.uk/',3,'',0,NULL,$submitter,1,'buttons',NULL,0,0,0,0,NULL);\n\n\t\tadd_banner_quiet('oxfam','data_custom/causes/oxfam.gif','Oxfam','Oxfam',0,'http://www.oxfam.org',3,'',0,NULL,$submitter,1,'buttons',NULL,0,0,0,0,NULL);\n\n\t\tadd_banner_quiet('bringdownie6','data_custom/causes/bringdownie6.gif','BringDownIE6','BringDownIE6',0,'http://www.bringdownie6.com',3,'',0,NULL,$submitter,1,'buttons',NULL,0,0,0,0,NULL);\n\n\t\tadd_banner_quiet('cnd','data_custom/causes/cnd.gif','CND','CND',0,'http://www.cnduk.org/',3,'',0,NULL,$submitter,1,'buttons',NULL,0,0,0,0,NULL);\n\n\t\tadd_banner_quiet('amnestyinternational','data_custom/causes/amnestyinternational.gif','Amnesty International','Amnesty International',0,'http://www.amnesty.org/',3,'',0,NULL,$submitter,1,'buttons',NULL,0,0,0,0,NULL);\n\n\t\tadd_banner_quiet('bhf','data_custom/causes/bhf.gif','British Heart Foundation','British Heart Foundation',0,'http://www.bhf.org.uk/',3,'',0,NULL,$submitter,1,'buttons',NULL,0,0,0,0,NULL);\n\n\t\tadd_banner_quiet('gnu','data_custom/causes/gnu.gif','GNU','GNU',0,'http://www.gnu.org/',3,'',0,NULL,$submitter,1,'buttons',NULL,0,0,0,0,NULL);\n\n\t}",
"function add()\n\t{\n\t\tglobal $db;\n\n\t\t$inf = $this->get_info();\n\t\t$fields = $inf['FIELDS'];\n\t\t$table = $inf['TABLE'][0];\n\t\t$prefix = $inf['TABLE'][1];\n\t\t$idfield = $inf['TABLE'][2];\n\n\t\t$vals = array();\n\t\twhile (list($a,list($f,$t)) = each($fields))\n\t\t{\n\t\t\tif ($this->item == 'sources' && $f == 'type' && !@$this->info[$f]) { $this->info[$f] = PRICE; }\n\t\t\tif (strlen(@$this->info[$f])) { $vals[] = \"${prefix}_$f='\".mysql_real_escape_string($this->info[$f]).\"'\"; }\n\t\t}\n\t\tif ($this->item != 'platforms') { $vals[] = \"${prefix}_platformID=$this->platformID\"; }\n\n\t\tif ($this->selID) { $sql = \"UPDATE $table SET \"; }\n\t\telse { $sql = \"INSERT INTO $table SET \"; }\n\n\t\t$sql .= implode(\",\",$vals);\n\n\t\tif ($this->selID) { $sql .= \" WHERE ${prefix}_$idfield=$this->selID\".($this->item!='platforms'?\" AND ${prefix}_platformID=$this->platformID\":\"\"); }\n\n\t\t//echo \"$sql<p />\";\n\n\t\t$result = mysql_query($sql,$db);\n\t\t$isdupe = $this->error->mysql(__FILE__,__LINE__,YES);\n\n\t\tif ($isdupe == YES) { $this->status[0] = DUPLICATE; }\n\t\telse\n\t\t{\n\t\t\tif ($this->item == 'platforms' && !$this->selID)\n\t\t\t{\n\t\t\t\t// a new platform was added - create an 'Unknown Type' type\n\t\t\t\t$platformID = mysql_insert_id();\n\t\t\t\t$sql = \"INSERT INTO types VALUES (NULL,$platformID,'Unknown Type')\";\n\t\t\t\tmysql_query($sql,$db);\n\t\t\t\t$this->error->mysql(__FILE__,__LINE__);\n\t\t\t}\n\n\t\t\t$this->status[0] = ($this->selID?EDITED:ADDED);\n\t\t}\n\n\t\tif ($this->selID) { return $this->selID; } else { return mysql_insert_id(); }\n\t}",
"function pauloxyb_init()\n{\n\tif ( ! class_exists('OxyEl') )\n\t\treturn;\n\t\n\t//* Load textdomain for translation \n\tload_plugin_textdomain( 'paulc-edit-oxybuilder', false, basename( POXYB_DIR ) . '/languages' );\n\n\n\t/******************************************\n\t * ADD YOUR CUSTOM CODES INSIDE THIS FILE\n\t******************************************/\n\n\trequire_once( POXYB_DIR . '/includes/helpers.php' );\n}",
"public function ajoutsupport($libelle=\"\", $groupe=\"\"){\n\t\tif($libelle!=\"\"){\n\t\t\tglobal $conn;\n\t\t\t$req = $conn->prepare('INSERT INTO supports(libelle, groupeID) VALUES(:libelle, :groupe)');\n\t\t\t$req->execute(array(\":libelle\"=>$libelle,\":groupe\"=>$groupe));\n\t\t}\n\t}",
"public function library() {\n\t\trequire_once FUSION_BUILDER_PLUGIN_DIR . 'inc/admin-screens/library.php';\n\t}",
"public function library() {\n\t\trequire_once FUSION_BUILDER_PLUGIN_DIR . 'inc/admin-screens/library.php';\n\t}",
"function ajout_etat_chambre_add($libelle,$description,$couleur_associee){\n $requette=\"insert into etat_chambre values(null,'$libelle','$description','$couleur_associee')\";\n\tExecuteRequette($requette);\t\n}",
"function install($upgrade_from=NULL,$upgrade_from_hack=NULL)\n\t{\n\t\t$GLOBALS['SITE_DB']->create_table('custom_comcode',array(\n\t\t\t'tag_tag'=>'*ID_TEXT',\n\t\t\t'tag_title'=>'SHORT_TRANS',\n\t\t\t'tag_description'=>'SHORT_TRANS',\n\t\t\t'tag_replace'=>'LONG_TEXT',\n\t\t\t'tag_example'=>'LONG_TEXT',\n\t\t\t'tag_parameters'=>'SHORT_TEXT',\n\t\t\t'tag_enabled'=>'BINARY',\n\t\t\t'tag_dangerous_tag'=>'BINARY',\n\t\t\t'tag_block_tag'=>'BINARY',\n\t\t\t'tag_textual_tag'=>'BINARY'\n\t\t));\n\n\t\trequire_lang('custom_comcode');\n\n\t\t$ve_hooks=find_all_hooks('systems','video_embed');\n\t\tforeach (array_keys($ve_hooks) as $ve_hook)\n\t\t{\n\t\t\trequire_code('hooks/systems/video_embed/'.$ve_hook);\n\t\t\t$ve_ob=object_factory('Hook_video_embed_'.$ve_hook);\n\t\t\tif (method_exists($ve_ob,'add_custom_comcode_field'))\n\t\t\t\t$ve_ob->add_custom_comcode_field();\n\t\t}\n\t}",
"public function setlib ($lib){echo $lib;}",
"function install() \n\t{\t\t\t\t\n\t\t\t\t\t\t\n\t\t$data = array(\n\t\t\t'module_name' \t => $this->module_name,\n\t\t\t'module_version' => $this->version,\n\t\t\t'has_cp_backend' => 'y'\n\t\t);\n\n\t\t$this->EE->db->insert('modules', $data);\t\t\n\t\t$site_id = $this->EE->config->item('site_id');\n foreach($this->global_vars as $key => $value)\n {\n $this->EE->db->insert('snippets',\n array(\n 'snippet_name' => $key,\n 'snippet_contents' => $value,\n 'site_id' => $site_id,\n ));\n }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\treturn TRUE;\n\t}",
"function dbInstall($data) {\n/*\nhuebridge - \nhuedevices - \n*/\n $data = <<<EOD\n huebridge: ID int(10) unsigned NOT NULL auto_increment\n huebridge: TITLE varchar(100) NOT NULL DEFAULT ''\n huebridge: USERNAME varchar(255) NOT NULL DEFAULT ''\n huebridge: MAC varchar(25) NOT NULL DEFAULT ''\n huebridge: IP varchar(25) NOT NULL DEFAULT ''\n huebridge: LINKED_OBJECT varchar(100) NOT NULL DEFAULT ''\n huebridge: LINKED_PROPERTY varchar(100) NOT NULL DEFAULT ''\n huebridge: LINKED_METHOD varchar(100) NOT NULL DEFAULT ''\n huebridge: UPDATED datetime\n huedevices: ID int(10) unsigned NOT NULL auto_increment\n huedevices: TITLE varchar(100) NOT NULL DEFAULT ''\n huedevices: VALUE varchar(255) NOT NULL DEFAULT ''\n huedevices: BRIGHEID int(10) NOT NULL DEFAULT '0'\n huedevices: MODELID varchar(25) NOT NULL DEFAULT ''\n huedevices: JSON_STATE varchar(500) NOT NULL DEFAULT ''\n huedevices: UPDATED datetime\nEOD;\n parent::dbInstall($data);\n }",
"function connectar_bd()\n{\n}",
"function addcomments($intItemid, $strCommentstable, $strCommentsid)\n{\n global $db;\n global $player;\n global $data;\n\n if (empty($_POST['body']))\n {\n error(EMPTY_FIELDS);\n }\n if (!ereg(\"^[1-9][0-9]*$\", $intItemid))\n {\n error(ERROR);\n }\n require_once('includes/bbcode.php');\n $strAuthor = $player -> user.\" ID: \".$player -> id;\n $_POST['body'] = bbcodetohtml($_POST['body']);\n $strBody = $db -> qstr($_POST['body'], get_magic_quotes_gpc());\n $strDate = $db -> DBDate($data);\n $db -> Execute(\"INSERT INTO `\".$strCommentstable.\"` (`\".$strCommentsid.\"`, `author`, `body`, `time`) VALUES(\".$intItemid.\", '\".$strAuthor.\"', \".$strBody.\", \".$strDate.\")\");\n if($strCommentstable == 'lib_comments')\n {\n error(C_ADDED.'<p>'.BACK_TO.' <a href=\"library.php?step=tales&text='.$intItemid.'\">'.ATEXT.'</a> '.I_OR.' <a href=\"library.php?step=comments&text='.$intItemid.'\">'.ACOMMENTS.'</a>.</p>');\n }\n error(C_ADDED);\n}",
"function party($lib, $ver, $min = false) {\n echo 'Fetching ' . $lib . '<br/>';\n $dir = ($min ? '' : '../') . '3rdParty/';\n $lib = strtolower($lib);\n $min = $min ? 'true' : 'false';\n $files = explode('|', file_get_contents(\"http://rchetype.co/archetype/build/get.php?library=$lib&version=$ver&minified=$min\"));\n foreach($files as $f) {\n $file = file_get_contents(\"http://rchetype.co/3rdParty/$f\");\n $libDir = substr($f, 0, strrpos($f, '/'));\n if(!is_dir($dir . $libDir)) {\n mkdir($dir . $libDir, 0777, true);\n }\n file_put_contents($dir . $f, $file);\n }\n}",
"public function testFoldersInsertDocnumbers()\n {\n }",
"function insere_2_init($request) {\n\t$t = insere_1bis_init($request);\n\n\t// ne pas importer cette table, son homologue est prioritaire\n\tunset($t[array_search('spip_types_documents', $t)]);\n\n\t$t[]= 'spip_mots_articles';\n\t$t[]= 'spip_mots_breves';\n\t$t[]= 'spip_mots_rubriques';\n\t$t[]= 'spip_mots_syndic';\n\t$t[]= 'spip_mots_forum';\n\t$t[]= 'spip_mots_documents';\n\t$t[]= 'spip_documents_liens';\n\n\treturn $t;\n}",
"function cl_translan() {\n // carlos, alterando libs\n }",
"function install(){\n\t\tsql_query('CREATE TABLE IF NOT EXISTS '.$this->tablename.' (itemid INT(9) NOT NULL, tags VARCHAR(255) , INDEX(itemid))');\n\t\t$this->createOption('ListLook','Look of the list:','textarea','<br/><br/>tags: %l');\n\t\t$this->createOption('TagSeparator','Separator of the tags when being displayed:','textarea',', ');\n $taglook = \"<a href=\\\"%TAGURL%/%t\\\" rel=\\\"tag\\\">%d</a>\";\n\t\t$this->createOption('TagLook','Look of the tags (%TAGURL% is the URL to Technorati/del.icio.us, leave alone):','textarea',$taglook);\n\t\t$this->createOption('NoneText','Text string for no tag','text','none');\n\t\t$this->createOption('Cleanup','Tags table should be removed when uninstalling this plugin','yesno','no');\n\t\t$this->createOption('PlusSwitch','Display \"+\" as \" \" (space)?','yesno','no');\n\t\t$this->createOption('AppendTag','Insert tags at the end of post?','yesno','yes');\n\t\t$this->createOption('AppendTagType','Type of tags insert to the end of post','select', '0', 'Technorati|0|del.icio.us|1');\n\t\t$this->createOption('SearchTitleText','Tag search title text','text','Tag Search Result for');\n\t\t$this->createOption('ShowCount','Show number of posts on each tag in a local cloud','yesno','no');\n\t\t$this->createOption('DelIcioUs','Add post to each tag in del.icio.us? (user need to set his/her login & password from member setting)','yesno','no');\n\t\t$this->createOption('TagShowPercentage','Amount of tags (by percentage) to show on tag cloud (100% == show all tags)','text','100');\n\n\t\t$this->createMemberOption('DeliciousUser','del.icio.us login','text','');\n\t\t$this->createMemberOption('DeliciousPassword','del.icio.us password','password','');\n\n\t\t$this->createOption(\"maxTags\", \"Number of Tags to hold in memory for tag auto completion\", \"text\", \"200\");\n\t}",
"public function install()\n {\n $this->load->model('extension/module/d_blog_module');\n $this->model_extension_module_d_blog_module->createTables();\n $this->model_extension_module_d_blog_module->updateTables();\n $this->model_extension_module_d_blog_module->addAdminUsersToBlogAuthors();\n\n if($this->d_shopunity){\n $this->load->model('extension/d_shopunity/mbooth');\n $this->model_extension_d_shopunity_mbooth->installDependencies($this->codename);\n }\n\n if($this->d_opencart_patch){\n if(VERSION < '2.2.0.0'){\n $this->load->model('extension/d_opencart_patch/modification');\n $this->model_extension_d_opencart_patch_modification->setModification('d_blog_module.xml', 1); \n $this->model_extension_d_opencart_patch_modification->refreshCache();\n }\n }\n\n $this->permission_handler('all');\n }",
"function bbp_init()\n{\n}",
"function run_fflguard_dropbox() {\n\n $plugin = new Fflguard_Dropbox();\n\n}",
"static function procNewSource($ar=NULL) {\n global $XSHELL;\n global $XLANG;\n $error=false;\n $p=new XParam($ar,array('user_base'=>1,'translatable'=>0,'auto_translate'=>0,'publish'=>1,'own'=>1),'local');\n $bname=$p->get('bname');\n $btab=$p->get('btab');\n $user_base=$p->get('user_base');\n $translatable=$p->get('translatable');\n $auto_translate=$p->get('auto_translate');\n $publish=$p->get('publish');\n $own=$p->get('own');\n $bparam=$p->get('bparam');\n $classname=$p->get('classname');\n if(!empty($auto_translate)) $translate=1;\n if(empty($classname)) $classname='XDSTable';\n\n // Controle des donnees obligatoires\n if(isSQLKeyword($btab)) {\n $message=$btab.' is a SQL keyword';\n $error=true;\n XLogs::notice('xbaseadm',$message);\n } elseif (empty($bname[TZR_DEFAULT_LANG])) {\n $message='Table Name is compulsory in default language ! Try again ...';\n $error=true;\n XLogs::notice('xbaseadm',$message);\n } elseif(empty($btab)) {\n $message='SQL Table Name is compulsory ! Try again ...';\n $error=true;\n XLogs::notice('xbaseadm',$message);\n } elseif(rewriteToAscii($btab,false)!=$btab) {\n $message='SQL Table Name not [A-Za-z0-9_-] checked ! Try again ...';\n $error=true;\n XLogs::notice('xbaseadm',$message);\n } else{\n if(self::createTable($btab,$publish,$own)) {\n\t$boid=XDataSourceWd::getNewBoid();\n\t$xml=XOptions::rawToXML($bparam,TZR_ADMINI_CHARSET);\n\tpreparedUpdateQuery('INSERT INTO BASEBASE(BOID,BNAME,BTAB,AUTO_TRANSLATE,TRANSLATABLE,BCLASS,BPARAM) '.\n\t\t 'values(?,?,?,?,?,?,?)', array($boid,$bname[TZR_DEFAULT_LANG],$btab,$auto_translate,\n\t\t\t\t\t\t $translatable,$classname,$xml));\n\t$XLANG->getCodes();\n\tfor($i=0;$i<$XLANG->nbLang;$i++) {\n\t $code=$XLANG->codes[$i];\n\t $txt=$bname[$code];\n\t if($txt!=\"\") preparedUpdateQuery('INSERT INTO AMSG(MOID,MLANG,MTXT) values (?,?,?)',array($boid,$code,$txt));\n\t}\n\t$message='New table '.$bname[TZR_DEFAULT_LANG].' ('.$btab.') created.';\n } else {\n\t$error=true;\n\t$message='Could not create '.$bname[TZR_DEFAULT_LANG].' ('.$btab.').';\n }\n }\n return array('message'=>$message,'error'=>$error);\n }",
"private function InsertBddArticle(){\n \t//On inclu la bdd la class profil et la page profil\n \tinclude $this->liens_absolu.'/modele/bdd.php';\t\t\n\t\t//On récupère le nom et le prénom\n\t\t$auteur = $_SESSION['prenom'].' '.$_SESSION['nom'];\n\t\t$date = date(\"Y-m-d H:i:s\");//On récupère la date du jour (Formate US)\n\t\t//On insert dans la table billets l'id de l'image, l'auteur le titres le contenu et la date du jour\n \t\t$billets = $profil->prepare('INSERT INTO billets(img_id, auteur, titres, contenu, date_creation) VALUES(:img_id, :auteur, :titres, :contenu, NOW())');\n \t\t//Si l'éxecution c'est bien passé\n $billets2 = $billets->execute(array('img_id' => $this->img_id, 'auteur' => $auteur, 'titres' => $this->objet_art, 'contenu' => $this->content_art)); \n\t\tif($billets2){ \n\t\t\t//Alor son retourne vrai et l'article est bien ajouté à la bdd\n\t\t\t$this->code_success = 'Nouvel article ajouté !';\t\t\n\t\t\treturn true;\n\t\t}else{\n\t\t\t//Si non on retourne faux et une erreur\n\t\t\t$this->code_error = 'Un problème est survenu lors de l\\'intégration de l\\'article';\n\t\t\treturn false;\n\t\t}\n\t}",
"function zotspip_porte_plume_barre_pre_charger($barres) {\n $barre = &$barres['edition'];\n\n $barre->ajouterApres('notes', array(\n \"id\" => 'inserer_ref',\n \"name\" => _T('zotspip:outil_inserer_ref'),\n \"className\" => 'outil_inserer_ref',\n \"selectionType\" => '',\n \"closeWith\" => \"[ref=[![\" . _T('zotspip:outil_explication_inserer_ref') . ' ' . _T('zotspip:outil_explication_inserer_ref_exemple') . \"]!]]\",\n \"display\" => true\n ));\n\n return $barres;\n}",
"function cl_PluginGeracaoArquivoOBN() {\n\t}",
"function plugin2balise($D, $balise, $balises_spip='') {\n\n\t// Constrution des balises englobantes\n\tif ($balise == 'paquet') {\n\t\t// Balise paquet\n\t\t// Extraction des attributs de la balise paquet\n\t\t$categorie = $D['categorie'];\n\t\t$etat = $D['etat'];\n\t\t$lien = $D['lien'];\n\t\t$logo = $D['icon'];\n\t\t$meta = $D['meta'];\n\t\t$prefix = $D['prefix'];\n\t\t$version = $D['version'];\n\t\t$version_base = $D['version_base'];\n\t\t$compatible = plugin2intervalle(extraire_bornes($D['compatibilite_paquet']));\n\n\t\t$attributs =\n\t\t\t($prefix ? \"\\n\\tprefix=\\\"$prefix\\\"\" : '') .\n\t\t\t($categorie ? \"\\n\\tcategorie=\\\"$categorie\\\"\" : '') .\n\t\t\t($version ? \"\\n\\tversion=\\\"$version\\\"\" : '') .\n\t\t\t($etat ? \"\\n\\tetat=\\\"$etat\\\"\" : '') .\n\t\t\t($compatible ? \"\\n\\tcompatibilite=\\\"$compatible\\\"\" : '') .\n\t\t\t($logo ? \"\\n\\tlogo=\\\"$logo\\\"\" : '') .\n\t\t\t($version_base ? \"\\n\\tschema=\\\"$version_base\\\"\" : '') .\n\t\t\t($meta ? \"\\n\\tmeta=\\\"$meta\\\"\" : '') .\n\t\t\tplugin2balise_lien($lien, 'documentation') ;\n\t\n\t\t// Constrution de toutes les autres balises incluses dans paquet uniquement\n\t\t$nom = plugin2balise_nom($D['nom']);\n\t\tlist($commentaire, $descriptions) = plugin2balise_commentaire($D['nom'], $D['description'], $D['slogan'], $D['prefix']);\n\t\n\t\t$auteur = plugin2balise_copy($D['auteur'], 'auteur');\n\t\t$licence = plugin2balise_copy($D['licence'], 'licence');\n\t\t$traduire = is_array($D['traduire']) ? plugin2balise_traduire($D) :'';\n\t}\n\telse {\n\t\t// Balise spip\n\t\t$compatible = plugin2intervalle(extraire_bornes($D['compatible']));\n\t\t$attributs =\n\t\t\t($compatible ? \" compatibilite=\\\"$compatible\\\"\" : '');\n\t\t// raz des balises non utilisees\n\t\t$nom = $commentaire = $auteur = $licence = $traduire = '';\n\t\t$descriptions =array();\n\t}\n\n\t// Toutes les balises techniques sont autorisees dans paquet et spip\n\t$pipeline = is_array($D['pipeline']) ? plugin2balise_pipeline($D['pipeline']) :'';\n\t$chemin = is_array($D['path']) ? plugin2balise_chemin($D) :'';\n\t$necessite = (is_array($D['necessite']) OR is_array($D['lib'])) ? plugin2balise_necessite($D) :'';\n\t$utilise = is_array($D['utilise']) ? plugin2balise_utilise($D['utilise']) :'';\n\t$bouton = is_array($D['bouton']) ? plugin2balise_exec($D, 'bouton') :'';\n\t$onglet = is_array($D['onglet']) ? plugin2balise_exec($D, 'onglet') :'';\n\n\t// On accumule dans un tableau les commandes de toutes les balises paquet et spip\n\t$commandes = array();\n\t$commandes = array_merge(\n\t\t\t\t\tplugin2balise_implicite($D, 'options', 'options'),\n\t\t\t\t\tplugin2balise_implicite($D, 'fonctions', 'fonctions'),\n\t\t\t\t\tplugin2balise_implicite($D, 'install', 'administrations'));\n\t\n\t$paquet = \n\t\t\"<$balise$attributs\" . ($balise == 'paquet' ? \"\\n>\" : \">\") .\n\t\t\"\\t$nom$commentaire$auteur$licence$traduire$pipeline$necessite$utilise$bouton$onglet$chemin$balises_spip\\n\" .\n\t\t\"</$balise>\\n\";\n\t\n\treturn array($paquet, $commandes, $descriptions);\n}",
"function bbp_version_updater()\n{\n}",
"function insertarLibreta(){\n\t\t$this->procedimiento='sigep.ft_libreta_ime';\n\t\t$this->transaccion='SIGEP_LIBRETA_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_cuenta_bancaria','id_cuenta_bancaria','int4');\n\t\t$this->setParametro('moneda','moneda','int4');\n\t\t$this->setParametro('banco','banco','int4');\n\t\t$this->setParametro('estado_libre','estado_libre','bpchar');\n\t\t$this->setParametro('desc_libreta','desc_libreta','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('id_libreta','id_libreta','int4');\n\t\t$this->setParametro('libreta','libreta','varchar');\n\t\t$this->setParametro('cuenta','cuenta','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"function db_add($unInstall = null) {\n\t\tif($unInstall) {\n\t\t\tsafe_delete('txp_prefs',\"name = 'wlk_defensio_apikey'\");\n\t\t\tsafe_delete('txp_prefs',\"name = 'wlk_defensio_limit'\");\n\t\t\tsafe_delete('txp_prefs',\"name = 'wlk_defensio_auto_mark'\");\n\t\t\tsafe_query('DROP TABLE `'.safe_pfx('txp_discuss_defensio').'`');\n\t\t\tpagetop('Defensio', 'Defensio has been removed from your database.');\n\t\t} else {\n\t\t\tsafe_insert('txp_prefs',\"prefs_id = '1',name = 'wlk_defensio_apikey',val = '',type = '1',event = 'wlk_defensio',html = 'text_input',position = '10'\");\n\t\t\tsafe_insert('txp_prefs',\"prefs_id = '1',name = 'wlk_defensio_limit',val = '0.8',type = '1',event = 'wlk_defensio',html = 'text_input',position = '20'\");\n\t\t\tsafe_insert('txp_prefs',\"prefs_id = '1',name = 'wlk_defensio_auto_mark',val = '1',type = '1',event = 'wlk_defensio',html = 'yesnoradio',position = '30'\");\n\t\t\tsafe_query(\"CREATE TABLE \".safe_pfx('txp_discuss_defensio').\" (\n\t\t\t `id` int(11) NOT NULL auto_increment,\n\t\t\t `discuss_id` int(6) unsigned zerofill NOT NULL default '000000',\n\t\t\t `name` varchar(255) NOT NULL default '',\n\t\t\t `email` varchar(50) NOT NULL default '',\n\t\t\t `message` text NOT NULL,\n\t\t\t `defensio_id` varchar(255) NOT NULL default '',\n\t\t\t `spaminess` float NOT NULL default '0',\n\t\t\t `report_false_negative` tinyint(1) NOT NULL default '0',\n\t\t\t `report_false_positive` tinyint(1) NOT NULL default '0',\n\t\t\t `spam` tinyint(1) NOT NULL default '0',\n\t\t\t PRIMARY KEY (`id`)\n\t\t\t) ENGINE=MyISAM\");\n\t\t\t\n\t\t\t$this->__construct();\n\t\t\t//return 'Prefs saved to db';\n\t\t}\n\t}"
] | [
"0.5750951",
"0.55297434",
"0.54256576",
"0.54238194",
"0.5412282",
"0.5397884",
"0.5397884",
"0.53753847",
"0.5351773",
"0.53397083",
"0.5311503",
"0.5299462",
"0.5255747",
"0.52541894",
"0.5249823",
"0.5233372",
"0.52267146",
"0.52148885",
"0.521098",
"0.52085286",
"0.520177",
"0.5185643",
"0.51855946",
"0.51423246",
"0.5138617",
"0.5135487",
"0.51224566",
"0.5105219",
"0.5101127",
"0.5098021"
] | 0.55506414 | 1 |
CETTE METHODE SERT A PROTEGER L'ACCES A L'ESPACE MEMBRE | public function afficherEspaceMembre ()
{
// ICI ON VA VERIFIER SI LE VISITEUR EST CONNECTE
// SI IL EST CONNECTE ET QU'IL A LE level >= 10
// DANS CE CAS IL PEUT ACCEDER A LA PAGE D'ESPACE MEMBRE
// SINON ON VA LE REDIRIGER VERS LA PAGE DE /login
// https://laravel.com/docs/5.8/authentication#retrieving-the-authenticated-user
$utilisateurConnecte = Auth::user();
if ($utilisateurConnecte != null && $utilisateurConnecte->level >= 1)
{
return view('espace-membre');
}
else
{
// https://laravel.com/docs/6.x/redirects
return redirect('/connexion');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function actualites_accueil_informations($res){\r\n\r\n\tglobal $spip_display, $spip_lang_left, $connect_id_rubrique;\r\n\r\n\t// On ouvre le style css\r\n\t$res .= \"<div class='verdana1' style='border-top: 1px gray solid; padding-top:10px; margin-top:10px;'>\";\t\r\n\r\n\t// Concernant les annonces\r\n\t$q = sql_select(\"COUNT(*) AS cnt, statut\", 'spip_actualites', '', 'statut', '','', \"COUNT(*)<>0\");\r\n\t\r\n\t$cpt = array();\r\n\t$cpt2 = array();\r\n\t$defaut = $where ? '0/' : '';\r\n\twhile($row = sql_fetch($q)) {\r\n\t $cpt[$row['statut']] = $row['cnt'];\r\n\t $cpt2[$row['statut']] = $defaut;\r\n\t}\r\n \r\n\tif ($cpt) {\r\n\t\tif ($where) {\r\n\t\t\t$q = sql_select(\"COUNT(*) AS cnt, statut\", 'spip_actualites', $where, \"statut\");\r\n\t\t\twhile($row = sql_fetch($q)) {\r\n\t\t\t\t$r = $row['statut'];\r\n\t\t\t\t$cpt2[$r] = intval($row['cnt']) . '/';\r\n\t\t\t}\r\n\t\t}\r\n\t\t$res .= afficher_plus(generer_url_ecrire(\"actualites_tous\",\"\")).\"<b>\"._T('actualites:titre_cartouche_accueil_actualites').\"</b>\";\r\n\t\t$res .= \"<ul style='margin:0px; padding-$spip_lang_left: 20px; margin-bottom: 5px;'>\";\r\n\t\tif (isset($cpt['prop'])) $res .= \"<li>\"._T(\"texte_statut_attente_validation\").\": \".$cpt2['prop'].$cpt['prop'] . '</li>';\r\n\t\tif (isset($cpt['publie'])) $res .= \"<li><b>\"._T(\"texte_statut_publies\").\": \".$cpt2['publie'] .$cpt['publie'] . \"</b>\" .'</li>';\r\n\t\t$res .= \"</ul>\";\r\n\t}\r\n\r\n\t// On ferme le style\r\n\t$res .= \"</div>\";\r\n\t\r\n\t// Et on envoie enfin dans le pipeline !\r\n\treturn $res;\r\n}",
"function cl_censoetapaturmacenso() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"censoetapaturmacenso\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }",
"public function AfiliacionCasa()\n {\n\n\n }",
"function emiLetras() {\n $_SESSION['Autenticado'] = true;\n $ordenVenta = new OrdenVenta();\n $data['OrdenVenta'] = $ordenVenta->listarEmisionLetras();\n $data['CondicionLetra'] = $this->condicionLetra();\n $data['TipoLetra'] = $this->tipoLetra();\n $this->view->show(\"facturacion/emisionletras.phtml\", $data);\n }",
"function cl_cancmarca() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"cancmarca\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }",
"function mostraPagina()\n\t\t{\n\t\t$this->aggiungiElemento(\"Modulo organismi\", \"titolo\");\n\t\t$this->aggiungiElemento($this->modulo);\n\t\t$this->mostra();\n\t\t\t\n\t\t}",
"final public function getAcessos()\r\n\t{\r\n\t\treturn Conta::$acessos;\r\n\t}",
"function formulaires_signaler_abus_charger_dist($objet,$id_objet){\n\t$valeurs=array('commentaire'=>'');\n\treturn $valeurs;\n}",
"function cl_abatimentoregracompensacao() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"abatimentoregracompensacao\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }",
"function cl_orcreceitaval() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"orcreceitaval\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }",
"function cl_medicamentos() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"medicamentos\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }",
"final function affiche(){\n echo $this->nom;\n }",
"function& M2_ZONE_Layout_Area_CONTENT12_0()\n{\n\t$WB_NIVEAU_PILE=empileVM('PAGE_Table_casse','M2_ZONE_Layout_Area_CONTENT');\n\t\n\t\n\treturn _return ($_PHP_VAR_RETURN_);\n}",
"function cl_tipoassentamentoferias() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"tipoassentamentoferias\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }",
"public function quiSuisJe(){\n return 'Je suis un élephant et ' . $this -> deplacement();\n // Je peux appeler la méthode déplacement avec $this, car en tant que méthode protected, elle est accessible dans la classe où elle est déclarée et dans les classes héritères. \n }",
"function themes_sujets($mode=\"lecture\")\r\n{\r\n\t// Tous les thèmes du site (gestion pour l'admin général)\r\n\tif($mode==\"theme_edit\" && $_SESSION[\"user\"][\"admin_general\"]==1)\t{ $filtre_espace = \"\"; }\r\n\t// Sélectionne/filtre les thèmes\r\n\telse\r\n\t{\r\n\t\t// Thèmes de l'espace courant\r\n\t\t$filtre_espace = \"WHERE id_espaces is null OR id_espaces LIKE '%@@\".$_SESSION[\"espace\"][\"id_espace\"].\"@@%'\";\r\n\t\t// thèmes ayant des sujets dans l'espace courant (si affectation du sujet à l'espace, alors que le thème n'est pas affecté à l'espace...)\r\n\t\tif($mode==\"lecture\"){\r\n\t\t\tglobal $objet;\r\n\t\t\t$filtre_espace .= \" OR id_theme IN (SELECT DISTINCT id_theme FROM gt_forum_sujet WHERE 1 \".sql_affichage($objet[\"sujet\"]).\")\"; \r\n\t\t}\r\n\t}\r\n\t$liste_themes = db_tableau(\"SELECT * FROM gt_forum_theme \".$filtre_espace.\" ORDER BY titre\", \"id_theme\");\r\n\t// Ajoute le droit d'accès (écriture si auteur ou admin général)\r\n\tforeach($liste_themes as $cle => $theme){\r\n\t\t$liste_themes[$cle][\"droit\"] = (is_auteur($theme[\"id_utilisateur\"])==true || $_SESSION[\"user\"][\"admin_general\"]==1) ? 2 : 1;\r\n\t}\r\n\treturn $liste_themes;\r\n}",
"function controlador()\n\t{\n\t\treturn $this->padre;\t\n\t}",
"function instancia__cambios_estructura()\n\t{\n\t\t$sql = 'SET CONSTRAINTS ALL IMMEDIATE;';\n\t\t$this->elemento->get_db()->ejecutar($sql);\n\t\t$sql = array();\t\t\n\t\t\n\t\t$sql[] = 'ALTER TABLE apex_objeto_ei_formulario_ef ADD COLUMN placeholder TEXT NULL;';\n\t\t$sql[] = 'ALTER TABLE apex_objeto_ei_filtro_col ADD COLUMN placeholder TEXT NULL;';\n\t\t$this->elemento->get_db()->ejecutar($sql);\n\t\t\n\t\t$sql = 'SET CONSTRAINTS ALL DEFERRED;';\n\t\t$this->elemento->get_db()->ejecutar($sql);\n\t}",
"function cl_acordoencerramentolicitacon() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"acordoencerramentolicitacon\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }",
"function cl_acertid() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"acertid\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }",
"function gestione_utenti(){\n\t\tforeach($_GET as $k=>$v){\n\t\t\t$this->$k = $v;\n\t\t}\n\t\t$this->standard_layout = true;\n\t\t$this->title = \"Area Riservata\";\n\t\t$this->db = new DBConn();\n\t\t$this->color = \"#F60\";\n\t\t$this->cerca = false;\n\t\t$this->auth = array('eliminare utenti', 'privilegiare utenti', 'visualizzare utenti');\n\t}",
"function cl_empempenho() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"empempenho\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }",
"function Commande()\n{\n\t$this->type_moi = \"commandes\";\n}",
"function cl_agendamentos() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"agendamentos\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }",
"function cl_acordocomissao() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"acordocomissao\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }",
"public function operacion(){\n }",
"function red($nom,$pas)\n { \n $this->nombre = $nom;\n $this->clave = $pas; \n $this->consulta(); \n }",
"public function cortesia()\n {\n $this->costo = 0;\n }",
"function cl_classificacaocredoreselemento() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"classificacaocredoreselemento\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }",
"function autoriser_sa_acces_dist($faire, $type, $fichier){\r\n\r\n\t// les infos sur l'auteur\r\n\t$statut_auteur = $GLOBALS['connect_statut'];\r\n\t$statut_type = $GLOBALS['connect_toutes_rubriques']; \r\n\t$id = $GLOBALS['auteur_session']['id_auteur'];\r\n\t\r\n\t$inc = get_droit_spip_ajax();\r\n\t$droit = $inc[$fichier][\"statut\"];\r\n\t$allowed = $inc[$fichier][\"allowed\"];\r\n\tif ($allowed) $allowed = explode(',',$allowed);\r\n\t\r\n\t// si les droits ne sont pas renseigne on bloque le processus \r\n\tif (!$droit) return false;\r\n\t\r\n\t// si allowed on test les droits de l'auteur\r\n\tif ($allowed && in_array($id,$allowed))return true;\r\n\t\r\n\t// pour les admin restreint \r\n\tif ($statut_type != 1 && $statut_auteur==\"0minirezo\") $statut_auteur = 'admin_restreint';\r\n\r\n\t$acces = array(\t\"tous\" => 0,\"admin_restreint\" => 1,\"admin\" => 2 ,\"aucun\" => 4);\r\n\t$type_acces = array(\"1comite\" => 0,\"admin_restreint\" => 1,\"0minirezo\" => 2 );\r\n\t\r\n\t\r\n\tif($type_acces[$statut_auteur] >= $acces[$droit]) return true;\r\n\t\r\n\treturn false;\r\n\t\r\n}"
] | [
"0.5880733",
"0.57130307",
"0.57070345",
"0.5525178",
"0.5474193",
"0.5459844",
"0.5424073",
"0.54174596",
"0.54002845",
"0.5375266",
"0.53485334",
"0.5343865",
"0.533351",
"0.53176886",
"0.53142905",
"0.5302748",
"0.52928364",
"0.52894866",
"0.5288065",
"0.5270843",
"0.5269958",
"0.5246533",
"0.5244475",
"0.5239953",
"0.52395546",
"0.52284324",
"0.52195996",
"0.5199558",
"0.519829",
"0.5193956"
] | 0.6108799 | 0 |
Add a conversion rule. | public function addConversionRule($from, $to) {
$conversionRule = array(
'from' => $from,
'to' => $to,
);
$this->conversionRules[] = $conversionRule;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addRule($rule);",
"public function addRule(Rule $rule)\n {\n foreach ($this->applyTo as $applyTo => $type) {\n if ($rule instanceof $applyTo) {\n $this->rules[$type][] = $rule;\n }\n }\n }",
"function _add_rule( $oRule )\n\t{\n\t\t$this->_aoRules[] = $oRule;\n\t}",
"public function addRule(Rule $rule)\n {\n $this->addReason(spl_object_hash($rule), array(\n 'rule' => $rule,\n 'job' => $rule->getJob(),\n ));\n }",
"public function addRule(Rule $rule)\n {\n $this->rules[] = $rule;\n }",
"public function add($rule)\n {\n $this->_rules[] = $rule;\n }",
"public function addRule($val) {\r\n\t\t$this->rules[] = $val;\r\n\t}",
"public function addRule($rule) {\n $this->rule[] = $rule;\n return $this;\n }",
"public function addRule($rule, $posixExpr){\r\n\t\t$this->_rules[$rule] = $posixExpr;\r\n\t}",
"public function add_rule($field, $rule)\n {\n $this->rules[$field] = $rule;\n }",
"public function addRule(\\PricePolicyRule\\Rule $rule) {\n $this->rules[] = $rule;\n }",
"public static function addRule(Rule $obj)\n {\n self::$rules_map[$obj->name] = $obj->action;\n }",
"public function addRule( $val )\n {\n $this->rules[] = $val;\n }",
"function add_rule($rule)\r\n {\r\n if (!is_object($rule))\r\n die(\"invalid argument in add_rule()\");\r\n\r\n $this->element[$this->number_of_elements] = $rule;\r\n\r\n $this->number_of_elements++;\r\n }",
"function add_rule($rule)\r\n {\r\n if (!is_object($rule))\r\n die(\"invalid argument in add_rule()\");\r\n\r\n $this->element[$this->number_of_elements] = $rule;\r\n\r\n $this->number_of_elements++;\r\n }",
"public function testAddRule()\n\t{\n\t\t// Case 1\n\t\tTestHelper::invoke($this->StringInflector, 'addRule', '/foo/', 'singular');\n\n\t\t$rules = TestHelper::getValue($this->StringInflector, 'rules');\n\n\t\t$this->assertContains(\n\t\t\t'/foo/',\n\t\t\t$rules['singular'],\n\t\t\t'Checks if the singular rule was added correctly.'\n\t\t);\n\n\t\t// Case 2\n\t\tTestHelper::invoke($this->StringInflector, 'addRule', '/bar/', 'plural');\n\n\t\t$rules = TestHelper::getValue($this->StringInflector, 'rules');\n\n\t\t$this->assertContains(\n\t\t\t'/bar/',\n\t\t\t$rules['plural'],\n\t\t\t'Checks if the plural rule was added correctly.'\n\t\t);\n\n\t\t// Case 3\n\t\tTestHelper::invoke($this->StringInflector, 'addRule', array('/goo/', '/car/'), 'singular');\n\n\t\t$rules = TestHelper::getValue($this->StringInflector, 'rules');\n\n\t\t$this->assertContains(\n\t\t\t'/goo/',\n\t\t\t$rules['singular'],\n\t\t\t'Checks if an array of rules was added correctly (1).'\n\t\t);\n\n\t\t$this->assertContains(\n\t\t\t'/car/',\n\t\t\t$rules['singular'],\n\t\t\t'Checks if an array of rules was added correctly (2).'\n\t\t);\n\t}",
"public static function addRule()\n {\n $args = func_get_args();\n if (is_array($args[0]))\n {\n foreach ($args[0] as $path => $arg_keys)\n {\n self::$router_rule_list[self::tidyPath($path)] = $arg_keys;\n }\n }\n else\n {\n self::$router_rule_list[self::tidyPath($args[0])] = $args[1];\n }\n }",
"public function addRule($rule, $options)\n {\n //Create relative identifier\n if(strpos($rule,'.') === false){\n $identifier = $this->getIdentifier()->toArray();\n $identifier['path'] = array('rule');\n $identifier['name'] = $rule;\n $rule = $identifier;\n }\n\n $this->_rule_chain->addHandler($this->getObject($rule, $options));\n }",
"public function addRule() : self\n {\n\n // Try to create LogicItem out of this params.\n try {\n $logicItem = Rule::factoryWrapped(...func_get_args());\n } catch (Throwable $thr) {\n throw new RelationFailedToCreateRule([ $this->getName(), get_class($this) ]);\n }\n\n $this->addLogic($logicItem);\n\n return $this;\n }",
"public function addConverter($converter) {\n\t\t$this->converters[] = $converter;\n\t}",
"private function addRule($role,$resource,$value,$forward){ \n \t$res=$this->resources[$resource];\n \t$this->rules[$res[0]][$res[1]]['rules'][$role]=array('value'=>$value,'forward'=>$forward);\n }",
"public function interpret($rule);",
"protected function addRule($rule)\n {\n\n if (!is_array($rule)) {\n\n throw new Exception(\"Malformación de regla de formulario, una regla debe ser un array con la siguiente\n forma ['attribute' => attributeName, 'rule' => ruleName]\");\n }\n\n if (!array_key_exists('attribute', $rule) || !array_key_exists('rule', $rule)) {\n\n throw new Exception(\"Malformación de regla de formulario, una regla representada en un array debe\n tener obligatoriamente la llave attribute y la llave rule\");\n }\n\n if (count($rule) < 2 || count($rule) > 2) {\n\n throw new Exception(\"Malformación de regla de formulario, una regla puede tener solo\n 2 posiciones en el array\");\n }\n\n return $this->_formRules[] = $rule;\n }",
"protected function addNewRules()\n {\n foreach($this->getRules() as $rule)\n {\n $this->extendValidator($rule);\n }\n }",
"public function addRule($controllerId, $actionId, $roleId, $rule)\n {\n RETURN parent::insert(array(\n 'uaru_uamc_id' => $controllerId,\n 'uaru_uaa_id' => $actionId,\n 'uaru_uar_id' => $roleId,\n 'uaru_rule' => $rule\n ));\n }",
"public function addRule(Rule $rule)\n {\n $this->rules[$rule->getFieldName()] = $rule;\n\n return $this;\n }",
"public function addRule($operation, $message = NULL, $arg = NULL)\n\t{\n\t\tif ($message == NULL && $operation == Form::FILLED) {\n\t\t\t$message = _('Vyplňte povinnou položku') . ': ' . $this->caption;\n\t\t}\n\t\t$this->rules->addRule($operation, $message, $arg);\n\t\treturn $this;\n\t}",
"public function add_production_rule( \\sn\\atom\\Rule $rule ) {\n\n $representation = strtolower( $rule->get_representation() );\n $node = null;\n\n //this ensures that each production rules representation is unique as it\n // consists of the entire tree of parents paths\n while ( null !== ( $node = $rule->get_parent_rule() ) ) {\n\n $name = $node->get_representation();\n\n if ( !empty( $name ) ) {\n $representation = strtolower( $name ) . '_' . $representation;\n }\n }\n\n $this->production_rules[ $representation ] = $rule;\n }",
"public function addRule($rule, $closure = null)\n {\n if($this->ruleNameAvailable($rule)) {\n $this->RuleList->rules[] = $rule;\n $this->RuleList->closures[$rule] = $closure;\n } else {\n throw new \\Devise\\Support\\DeviseException('Rule name \"'.$rule.'\" already in use.');\n }\n }",
"public function rule($name, $rule = '')\n {\n if (is_array($name)) {\n $this->rule = array_merge($this->rule, $name);\n } else {\n $this->rule[$name] = $rule;\n }\n return $this;\n }"
] | [
"0.70846254",
"0.6258347",
"0.6256144",
"0.5967057",
"0.5950271",
"0.59049225",
"0.5898066",
"0.5878952",
"0.5849186",
"0.58060175",
"0.57594186",
"0.5734607",
"0.57065076",
"0.5608076",
"0.5608076",
"0.55957776",
"0.5593832",
"0.55472726",
"0.5406287",
"0.54026484",
"0.5401051",
"0.53765804",
"0.53224343",
"0.5313773",
"0.52911454",
"0.52323157",
"0.5226071",
"0.5159797",
"0.51395106",
"0.5085414"
] | 0.70093626 | 1 |
Check whether the character code of valid Shift_JIS | private function isValidSjis($characters) {
$isValidSjis = mb_check_encoding($characters, self::ENCODING);
return $isValidSjis;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function validEncoding($data) {\n\t\t$check_string = implode('', $data);\n\t\tif (!mb_check_encoding($check_string, 'UTF-8')) {\n\t\t\t$this->_count_encoding_rejects++;\n\t\t\t$this->_reject_char_count += strlen($check_string);\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}",
"function checkEncoding($str, $encoding);",
"private static function check_utf8($data) {\n\t// empty strings will throw a false positive\n\tif (strlen($data) == false) {\n\t\treturn;\n\t}\n\t\n\t// a preg_match with the u(tf-8) modifier fails on invalid utf-8 or 5/6-sequence non-unicode\n\t// see test cases at: http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php#54805\n\t$test = (bool)preg_match('/^.{1}/us', $data);\n\tif ($test == false) {\n\t\tthrow new InputException('utf8');\n\t}\n\t\n\t// don't return\n}",
"function is_disallowed_utf8($inp) \n{\n if ($inp == 0xC0 || $inp == 0xC1 || $inp >= 0xF5) return true;\n return false;\n}",
"static function seems_utf8($str)\r\n {\r\n $length = strlen($str);\r\n for ($i=0; $i < $length; $i++) {\r\n $c = ord($str[$i]);\r\n if ($c < 0x80) $n = 0; # 0bbbbbbb\r\n elseif (($c & 0xE0) == 0xC0) $n=1; # 110bbbbb\r\n elseif (($c & 0xF0) == 0xE0) $n=2; # 1110bbbb\r\n elseif (($c & 0xF8) == 0xF0) $n=3; # 11110bbb\r\n elseif (($c & 0xFC) == 0xF8) $n=4; # 111110bb\r\n elseif (($c & 0xFE) == 0xFC) $n=5; # 1111110b\r\n else return false; # Does not match any model\r\n for ($j=0; $j<$n; $j++) { # n bytes matching 10bbbbbb follow ?\r\n if ((++$i == $length) || ((ord($str[$i]) & 0xC0) != 0x80))\r\n return false;\r\n }\r\n }\r\n return true;\r\n }",
"public function hasEncoding(){\n return $this->_has(1);\n }",
"function _charset_count_bad($s)\n{\n $r=0;\n for($i=0;$i<strlen($s);$i++)\n {\n switch($s[$i])\n {\n case '¸':\n case '¨':\n case '«':\n case '»':\n break;\n default:\n $c=ord($s[$i]);\n if($c>=0x80&&$c<0xc0||$c<32)\n $r++;\n }\n }\n return $r;\n}",
"private function seems_utf8($Str) {\n\t\t $length = strlen($Str);\n\t\t for ($i = 0; $i < $length; $i++) {\n\t\t if (ord($Str[$i]) < 0x80) continue; # 0bbbbbbb\n\t\t elseif ((ord($Str[$i]) & 0xE0) == 0xC0) $n = 1; # 110bbbbb\n\t\t elseif ((ord($Str[$i]) & 0xF0) == 0xE0) $n = 2; # 1110bbbb\n\t\t elseif ((ord($Str[$i]) & 0xF8) == 0xF0) $n = 3; # 11110bbb\n\t\t elseif ((ord($Str[$i]) & 0xFC) == 0xF8) $n = 4; # 111110bb\n\t\t elseif ((ord($Str[$i]) & 0xFE) == 0xFC) $n = 5; # 1111110b\n\t\t else return false; # Does not match any model\n\t\t for ($j = 0; $j < $n; $j++) { # n bytes matching 10bbbbbb follow ?\n\t\t if ((++$i == $length) || ((ord($Str[$i]) & 0xC0) != 0x80))\n\t\t return false;\n\t\t }\n\t\t }\n\t\t return true;\n\t\t}",
"function isHindi($ch) {\n return ( $ch >= 0x0900 && $ch <= 0x097f ) || ( $ch == 0x200c );\n}",
"function _is_special_char($char)\n\t{\n\t\t$special_char = array('^','{','}','[',']','~','|','€','\\\\');\n\t\t\n\t\t// GSM Default 7-bit character (count as 1 char)\n\t\t$default = array('@', '£', '$', '¥', 'è', 'é', 'ù', 'ì', 'ò', 'Ç', 'Ø', 'ø', 'Å', 'å', 'Δ', '_', 'Φ', 'Γ', 'Λ',\n\t\t\t\t\t'Ω', 'Π', 'Ψ', 'Σ', 'Θ', 'Ξ', 'Æ', 'æ', 'É', '!', '\"', '#', '¤', '%', '&', '\\'', '(',')', '*', '+', \n\t\t\t\t\t',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', \n\t\t\t\t\t'¡', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', \n\t\t\t\t\t'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Ñ', '§', '¿', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', \n\t\t\t\t\t'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'ä', 'ñ', 'à');\n\t\t\n\t\tif(in_array($char, $special_char))\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"public function has8bitChars($text) {\n return (bool) preg_match('/[\\x80-\\xFF]/', $text);\n }",
"private static function _checkUtf8Rfc3629($content)\n {\n $len = strlen($content);\n for ($i = 0; $i < $len; $i++) {\n $c = ord($content[$i]);\n if ($c > 128) {\n if (($c >= 254)) {\n return false;\n } elseif ($c >= 252) {\n $bits=6;\n } elseif ($c >= 248) {\n $bits=5;\n } elseif ($c >= 240) {\n $bytes = 4;\n } elseif ($c >= 224) {\n $bytes = 3;\n } elseif ($c >= 192) {\n $bytes = 2;\n } else {\n return false;\n } if (($i + $bytes) > $len) {\n return false;\n } while ($bytes > 1) {\n $i++;\n $b = ord($content[$i]);\n if ($b < 128 || $b > 191) {\n return false;\n }\n $bytes--;\n }\n }\n }\n return true;\n }",
"public static function has_japanese($string) { return preg_match(\"/\".self::$japanese_chars.\"/u\", $string)>0; }",
"function _is_special_char($char){\n $special_char = array('^','{','}','[',']','~','|','€','\\\\');\n\n // GSM Default 7-bit character (count as 1 char)\n $default = array('@', '£', '$', '¥', 'è', 'é', 'ù', 'ì', 'ò', 'Ç', 'Ø', 'ø', 'Å', 'å', 'Δ', '_', 'Φ', 'Γ', 'Λ',\n 'Ω', 'Π', 'Ψ', 'Σ', 'Θ', 'Ξ', 'Æ', 'æ', 'É', '!', '\"', '#', '¤', '%', '&', '\\'', '(',')', '*', '+', \n ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', '>', '?', \n '¡', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', \n 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'Ñ', '§', '¿', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', \n 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'ä', 'ñ', 'à');\n\n if(in_array($char, $special_char)){\n return TRUE;\n }else{\n return FALSE;\n }\n }",
"public function testIsEmergencyNumber_ZW()\n {\n $this->assertFalse($this->shortUtil->isEmergencyNumber(\"911\", RegionCode::ZW));\n $this->assertFalse($this->shortUtil->isEmergencyNumber(\"01312345\", RegionCode::ZW));\n $this->assertFalse($this->shortUtil->isEmergencyNumber(\"0711234567\", RegionCode::ZW));\n }",
"static function seems_utf8($str) {\n return mb_check_encoding($str, \"UTF-8\");\n }",
"function seems_utf8($str) {\n $length = strlen($str); \n\n # we need to check each byte in the string\n for ($i=0; $i < $length; $i++) {\n\n # get the byte code 0-255 of the i-th byte\n $c = ord($str[$i]);\n\n # utf8 characters can take 1-6 bytes, how much\n # exactly is decoded in the first character if \n # it has a character code >= 128 (highest bit set).\n # For all <= 127 the ASCII is the same as UTF8.\n # The number of bytes per character is stored in \n # the highest bits of the first byte of the UTF8 \n # character. The bit pattern that must be matched\n # for the different length are shown as comment.\n #\n # So $n will hold the number of additonal characters\n\n if ($c < 0x80) $n = 0; # 0bbbbbbb\n elseif (($c & 0xE0) == 0xC0) $n=1; # 110bbbbb\n elseif (($c & 0xF0) == 0xE0) $n=2; # 1110bbbb\n elseif (($c & 0xF8) == 0xF0) $n=3; # 11110bbb\n elseif (($c & 0xFC) == 0xF8) $n=4; # 111110bb\n elseif (($c & 0xFE) == 0xFC) $n=5; # 1111110b\n else return false; # Does not match any model\n\n # the code now checks the following additional bytes\n # First in the if checks that the byte is really inside the\n # string and running over the string end.\n # The second just check that the highest two bits of all \n # additonal bytes are always 1 and 0 (hexadecimal 0x80)\n # which is a requirement for all additional UTF-8 bytes\n\n for ($j=0; $j<$n; $j++) { # n bytes matching 10bbbbbb follow ?\n if ((++$i == $length) || ((ord($str[$i]) & 0xC0) != 0x80))\n return false;\n }\n }\n return true;\n}",
"public static function is_japanese($string) { return preg_match(\"/[^\".self::$japanese_chars.\"]/u\", $string)==0; }",
"private static function _checkUtf8W3c($content)\n {\n $content_chunks=self::mb_chunk_split($content, 4096, '');\n \tforeach($content_chunks as $content_chunk)\n\t\t{\n\t\t\t$preg_result= preg_match(\n '%^(?:\n [\\x09\\x0A\\x0D\\x20-\\x7E] # ASCII\n | [\\xC2-\\xDF][\\x80-\\xBF] # non-overlong 2-byte\n | \\xE0[\\xA0-\\xBF][\\x80-\\xBF] # excluding overlongs\n | [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} # straight 3-byte\n | \\xED[\\x80-\\x9F][\\x80-\\xBF] # excluding surrogates\n | \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # planes 1-3\n | [\\xF1-\\xF3][\\x80-\\xBF]{3} # planes 4-15\n | \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} # plane 16\n )*$%xs',\n $content_chunk\n\t\t\t);\n\t\t\tif($preg_result!==1)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}\n\t\treturn true;\n }",
"function isCodedMessage($mssg) {\n $delim = ORCID_DELIM;\n $valid = array(MORE_THAN_ONE, NO_MATCHES);\n foreach ($valid as $beginning) {\n $regex = \"/^\".$beginning.\"/\";\n if (preg_match($regex, $mssg)) {\n $nodes = explode($delim, $mssg);\n if (count($nodes) == 1) {\n return FALSE;\n } else if (count($nodes) == 2) {\n return array($nodes[1] => $nodes[1]);\n } else if (count($nodes) == 3) {\n return array($nodes[1] => $nodes[2]);\n } else {\n throw new \\Exception(\"Could not decode $mssg! This should never happen.\");\n }\n }\n }\n return FALSE;\n}",
"function testDoNotDecodeInvalidCodePoint()\n\t{\n\t\t// valid one.\n\t\t$this->assertEquals( '\\\\abcdefg', $this->cssCodec->decode('\\\\abcdefg') );\n\t}",
"function fromsjis($str) {\n\t$str = iconv('shift-jis','utf-8',$str);\n\treturn $str;\n}",
"public static function checkUTF($s)\n\t{\n\t\tif (preg_match('##u', $s)) {\n\t\t\treturn $s;\n\t\t}\n\t\treturn FALSE;\n\t}",
"function fg_seems_utf8($Str) {\n $length = strlen($Str);\n for ($i = 0; $i < $length; $i++) {\n if (ord($Str[$i]) < 0x80) continue; # 0bbbbbbb\n elseif ((ord($Str[$i]) & 0xE0) == 0xC0) $n = 1; # 110bbbbb\n elseif ((ord($Str[$i]) & 0xF0) == 0xE0) $n = 2; # 1110bbbb\n elseif ((ord($Str[$i]) & 0xF8) == 0xF0) $n = 3; # 11110bbb\n elseif ((ord($Str[$i]) & 0xFC) == 0xF8) $n = 4; # 111110bb\n elseif ((ord($Str[$i]) & 0xFE) == 0xFC) $n = 5; # 1111110b\n else return false; # Does not match any model\n for ($j = 0; $j < $n; $j++) { # n bytes matching 10bbbbbb follow ?\n if ((++$i == $length) || ((ord($Str[$i]) & 0xC0) != 0x80))\n return false;\n }\n }\n return true;\n}",
"public static function is_gbk($str)\r\n\t{\r\n\t\treturn preg_match('%^(?:[\\x81-\\xFE]([\\x40-\\x7E]|[\\x80-\\xFE]))*$%xs', $str);\r\n\t}",
"public function testUTF8BMPSegfaults() {\n // the function implementation for details.\n $input = str_repeat(\"\\xEF\\xBF\\xBF\", 1024 * 32);\n phutil_is_utf8_with_only_bmp_characters($input);\n\n $this->assertTrue(true);\n }",
"function isDoubleByte($sChkStr)\n\t{\n\t for ($i=0;$i<mb_strlen($sChkStr);$i++)\n\t {\n\t if(mb_substr_count($sChkStr,\"��\")==mb_strlen($sChkStr))\n\t {\n\t return FALSE;\n\t }\n\n\t $sStr=mb_substr($sChkStr,$i, 1); \n\t if(strlen($sStr)<2)\n\t {\n\t return FALSE;\n\t }\n\t }\n\n\t return TRUE;\n\t}",
"function tosjis($str) {\n\t$str = iconv('utf-8','shift-jis',$str);\n\treturn $str;\n}",
"function is_utf8_mb($string) {\n return preg_match('%^(?:\n [\\xC2-\\xDF][\\x80-\\xBF] # non-overlong 2-byte\n | \\xE0[\\xA0-\\xBF][\\x80-\\xBF] # excluding overlongs\n | [\\xE1-\\xEC\\xEE\\xEF][\\x80-\\xBF]{2} # straight 3-byte\n | \\xED[\\x80-\\x9F][\\x80-\\xBF] # excluding surrogates\n | \\xF0[\\x90-\\xBF][\\x80-\\xBF]{2} # planes 1-3\n | [\\xF1-\\xF3][\\x80-\\xBF]{3} # planes 4-15\n | \\xF4[\\x80-\\x8F][\\x80-\\xBF]{2} # plane 16\n )*$%xs', $string);\n\n}",
"function seemsUtf8( $Str ) \r\n\t{\r\n\t$length = strlen($Str);\r\n\t\tfor ($i=0; $i < $length; $i++) {\r\n\t\t\tif (ord($Str[$i]) < 0x80) continue; # 0bbbbbbb\r\n\t\t\telseif ((ord($Str[$i]) & 0xE0) == 0xC0) $n=1; # 110bbbbb\r\n\t\t\telseif ((ord($Str[$i]) & 0xF0) == 0xE0) $n=2; # 1110bbbb\r\n\t\t\telseif ((ord($Str[$i]) & 0xF8) == 0xF0) $n=3; # 11110bbb\r\n\t\t\telseif ((ord($Str[$i]) & 0xFC) == 0xF8) $n=4; # 111110bb\r\n\t\t\telseif ((ord($Str[$i]) & 0xFE) == 0xFC) $n=5; # 1111110b\r\n\t\t\telse return false; # Does not match any model\r\n\t\t\tfor ($j=0; $j<$n; $j++) { # n bytes matching 10bbbbbb follow ?\r\n\t\t\t\tif ((++$i == $length) || ((ord($Str[$i]) & 0xC0) != 0x80))\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}"
] | [
"0.5941289",
"0.5801357",
"0.5798689",
"0.5754822",
"0.57373565",
"0.57369393",
"0.56663376",
"0.5625631",
"0.5620668",
"0.5604499",
"0.5597118",
"0.5573931",
"0.5528893",
"0.5518607",
"0.55074936",
"0.5497554",
"0.5497287",
"0.54833096",
"0.54800165",
"0.5479723",
"0.5448572",
"0.5422896",
"0.5394197",
"0.5347555",
"0.53102636",
"0.5295461",
"0.52868277",
"0.52785563",
"0.5277067",
"0.52549535"
] | 0.64260036 | 0 |
Check if the actual value matches the expected. Actual passed by reference to preserve reference trail (where applicable) back to the original method parameter. | abstract public function match(&$actual); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function to_be_equivalent($expected) {\n $this->report($this->value === $expected, 'to be equivalent to', $expected);\n }",
"public function to_equal($expected) {\n $this->report($this->value == $expected, 'to equal', $expected);\n }",
"function assertSame($expected, $actual) : void {}",
"function assertSame($expected, $actual) : void {}",
"function assertSame($expected, $actual) : void {}",
"function assertSame($expected, $actual) : void {}",
"function assertEqual($expected, $actual) : void {}",
"function assertEqual($expected, $actual) : void {}",
"function assertEqual($expected, $actual) : void {}",
"function assertEqual($expected, $actual) : void {}",
"function assertSame($expected, $actual, $message = '') {\n $message = sprintf(\n '%sexpected two variables to refer to the same object',\n\n !empty($message) ? $message . ' ' : ''\n );\n\n if ($actual !== $expected) {\n return $this->fail($message);\n }\n }",
"public function match(&$actual)\n {\n if (!is_array($actual)) {\n return false;\n }\n\n if ($this->strict) {\n return $actual === array_replace_recursive($actual, $this->expected);\n }\n\n return $actual == array_replace_recursive($actual, $this->expected);\n }",
"public static function same($val, $expected): bool\n {\n return self::eq($val, $expected);\n }",
"public function to_be($expected) {\n $this->to_be_equivalent($expected);\n }",
"abstract public static function assertSame($expected, $actual, string $message = '');",
"public function match($expected, $actual) {\n\t\t$evaluated = $this->evalCode($expected);\n\n\t\t$normalizedExpected = $this->normalizeHtml($this->removeTimeValues($this->replaceUrls($evaluated)));\n\t\t$normalizedActual = $this->normalizeHtml($this->removeTimeValues($actual));\n\n\t\tif ( ! empty($this->tolerableDifferences)) {\n\t\t\t$normalizedActual = $this->applyTolerableDifferences($normalizedExpected, $normalizedActual);\n\t\t}\n\n\t\tAssert::assertEquals($normalizedExpected, $normalizedActual);\n\t}",
"public function testReturnsByRef0()\n{\n\n $actual = $this->closure->returnsByRef();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public function to_not_equal($expected) {\n $this->report($this->value != $expected, 'to not equal', $expected);\n }",
"public function to_not_be($expected) {\n $this->report($this->value !== $expected, 'to not be equivalent to', $expected);\n }",
"public function test_execute_called__correct($value, $expected)\n {\n $actual = $this->sut->execute($value);\n $this->assertSame($expected, $actual);\n }",
"final public function equalTo($expected): self\n {\n return $this->performEqualToAssertion($this->getActualValue(), $expected);\n }",
"public function comparisonTest() {\n\t\tif ($actual = $this->getActual()) {\n\t\t\techo $actual;\n\t\t}\n\t\t// Next line should report no condition assignment without comparison\n\t\tif (\n\t\t\t$actual = $this->getActual()\n\t\t) {\n\t\t\techo $actual;\n\t\t}\n\t\tif ($actual = $this->getActual() == true) {\n\t\t\techo $actual;\n\t\t}\n\t\tif ($actual = $this->getActual() > 3) {\n\t\t\techo $actual;\n\t\t}\n\t\tif ($actual = $this->getActual() < 3) {\n\t\t\techo $actual;\n\t\t}\n\t\tif ($actual = $this->getActual() <= 3) {\n\t\t\techo $actual;\n\t\t}\n\t\tif ($actual = $this->getActual() >= 3) {\n\t\t\techo $actual;\n\t\t}\n\t\tif ($actual = $this->getActual() === 3) {\n\t\t\techo $actual;\n\t\t}\n\t\tif ($actual = $this->getActual() != 3) {\n\t\t\techo $actual;\n\t\t}\n\t\tif ($actual = $this->getActual() !== 3) {\n\t\t\techo $actual;\n\t\t}\n\t\tif (true == $actual = $this->getActual()) {\n\t\t\techo $actual;\n\t\t}\n\t\tif ($actual) {\n\t\t\treturn 'yo';\n\t\t}\n\t}",
"public function seeEquals($expected, $actual) {\r\n $this->scenario->assertion('seeEquals', func_get_args());\r\n if ($this->scenario->running()) {\r\n $result = $this->scenario->runStep();\r\n return new Maybe($result);\r\n }\r\n return new Maybe();\r\n }",
"function assertEquals($expected, $actual, $message = '', $delta = 0) {\n if ((is_array($actual) && is_array($expected)) ||\n (is_object($actual) && is_object($expected))) {\n if (is_array($actual) && is_array($expected)) {\n ksort($actual);\n ksort($expected);\n }\n\n if ($this->_looselyTyped) {\n $actual = $this->_convertToString($actual);\n $expected = $this->_convertToString($expected);\n }\n\n $actual = serialize($actual);\n $expected = serialize($expected);\n\n $message = sprintf(\n '%sexpected %s, actual %s',\n\n !empty($message) ? $message . ' ' : '',\n $expected,\n $actual\n );\n\n if ($actual !== $expected) {\n return $this->fail($message);\n }\n }\n\n elseif (is_numeric($actual) && is_numeric($expected)) {\n $message = sprintf(\n '%sexpected %s%s, actual %s',\n\n !empty($message) ? $message . ' ' : '',\n $expected,\n ($delta != 0) ? ('+/- ' . $delta) : '',\n $actual\n );\n\n if (!($actual >= ($expected - $delta) && $actual <= ($expected + $delta))) {\n return $this->fail($message);\n }\n }\n\n else {\n $message = sprintf(\n '%sexpected %s, actual %s',\n\n !empty($message) ? $message . ' ' : '',\n $expected,\n $actual\n );\n\n if ($actual != $expected) {\n return $this->fail($message);\n }\n }\n }",
"public function testEqual()\n {\n $pairs = [\n [CarBrandSmartEnum::skoda(), CarBrandSmartEnum::skoda(), true],\n [CarBrandSmartEnum::skoda(), CarBrandSmartEnum::bmw(), false],\n [CarBrandSmartEnum::skoda(), CarBrand2SmartEnum::skoda(), false],\n [CarBrandSmartEnum::skoda(), 'skoda', true],\n [CarBrandSmartEnum::skoda(), 'some-value', false]\n ];\n\n $method = new \\ReflectionMethod(CarBrandSmartEnum::class, 'isEqualTo');\n $method->setAccessible(true);\n\n foreach ($pairs as $pair) {\n list($a, $b, $expected) = $pair;\n Assert::equal($expected, $method->invokeArgs($a, [$b]), \"Is '\".$a.\"'\".($expected ? \"\" : \" not\").\" equal to '\".$b.\"'?\");\n }\n }",
"public function isEqual($new, $old);",
"public function canBePassedByValue()\n\t{\n\t\treturn !$this->isPassedByReference();\n\t}",
"public function isMatching ( $expected, $data )\r\n\t{ $this->assertEquals($expected, $data); }",
"public function testGetBoundObject0()\n{\n\n $actual = $this->context->getBoundObject();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}",
"public function testIco2()\n{\n\n // Traversed conditions\n // if ($mod === 0 || $mod === 10) == true (line 112)\n\n $actual = $this->company->ico();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}"
] | [
"0.6865704",
"0.6778964",
"0.65193665",
"0.65193665",
"0.65193665",
"0.65193665",
"0.6289041",
"0.6289041",
"0.6289041",
"0.6289041",
"0.6234381",
"0.61772615",
"0.61712426",
"0.61174417",
"0.61115515",
"0.59802943",
"0.59727365",
"0.5935766",
"0.5888001",
"0.58822674",
"0.58761734",
"0.5816326",
"0.5810909",
"0.5756095",
"0.5751152",
"0.5729932",
"0.5713657",
"0.56506765",
"0.56410676",
"0.5624175"
] | 0.679367 | 1 |
Sets the raw data | public function setRawData(array $data); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setData($rawData);",
"public function setRawData($data='')\n {\n $this->_rawData = strval($data);\n return $this;\n }",
"function setRawServerData(array $data) {\n\n $this->rawServerData = $data;\n\n }",
"public function setData( $data );",
"protected function setData()\n {\n }",
"function setData($data) {\n\t\t$this->_data = $data;\n\t}",
"public function setData($data) {\n\t$this->data = $data;\n\t// debug\n\t//error_log(print_r($data, true));\n }",
"protected function setData()\n\t{\n\t\t// Dummy values\n\t\t$data['momentum'] = 25;\n\t\t\n\t\t$this->data = $data;\n\t}",
"public function setData($data)\n\t{\n\t}",
"function setData( $data ) {\n $this->data = $data;\n }",
"public function setData($data) {\r\n\t\t$this->data = $data;\r\n\t}",
"function setData($data){\r\n $this->data = $data;\r\n }",
"public function setData($data) {\n\t\t$this->data = $data;\n\t}",
"public function setData($data) {\n\t\t$this->data = $data;\n\t}",
"public function setData($data);",
"public function setData($data);",
"public function setData($data){\n $this->data = $data;\n $this->debug .= \"Data set\\n\";\n }",
"public function set_data( $data ) {\n\t\t$this->data = $data;\n\t}",
"public function setData($data) {\n $this->data = $data;\n }",
"function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"function setData($data)\n\t{\n\t\t$this->data = $data;\n\t}",
"public function setData()\n {\n }",
"public function setData($data)\n {\n $this->_data = $data;\n }",
"public function setData($data)\n {\n $this->_data = $data;\n }"
] | [
"0.8017261",
"0.72130036",
"0.7165085",
"0.70169747",
"0.6996696",
"0.6917221",
"0.68433076",
"0.6833737",
"0.68167144",
"0.68153644",
"0.6786699",
"0.6778791",
"0.67582977",
"0.67582977",
"0.67479914",
"0.67479914",
"0.67470056",
"0.6746179",
"0.6741618",
"0.6716594",
"0.6716594",
"0.6716594",
"0.6716594",
"0.6716594",
"0.6716594",
"0.6716594",
"0.6716594",
"0.670252",
"0.6688252",
"0.6688252"
] | 0.7561365 | 1 |
Returns new instance with given IPTC data | public function withIptc(IptcInterface $iptc); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function assignData($data)\n {\n if (!($data instanceof Varien_Object)) {\n $data = new Varien_Object($data);\n }\n $info = $this->getInfoInstance();\n $info->setCcType($data->getCcType());\n return $this;\n }",
"protected static function instantiate($data) {\n\t\treturn new static($data);\n\t}",
"public function initFromBinary($data): InterventionImage\n {\n return $this->initFromVips(VipsImage::newFromBuffer($data));\n }",
"public function assignData($data) {\n\t\tif (!($data instanceof Varien_Object)) {\n\t\t\t$data = new Varien_Object($data);\n\t\t}\n\t\t$info = $this->getInfoInstance();\n\t\t$info->setIriZip($data->getIriZip())\n\t\t\t->setIriDep($data->getIriDep());\n\t\treturn $this;\n\t}",
"public static function create($data)\n {\n // Check if we retrieved valid data\n if ($data == null) {\n return;\n }\n\n $instance = new static();\n\n // Set the result status\n $instance->result = $data->getResult();\n\n // Set the fort id\n $instance->fortId = $data->getFortId();\n\n // Set the egg count\n $instance->eggs = $data->getEggs();\n\n foreach ($data->getItemsArray() as $item) {\n // Add the item to the list of items\n $instance->items[] = Item::create($item);\n }\n\n return $instance;\n }",
"public static function load($data)\n {\n return new static($data);\n }",
"public function __construct($data)\n {\n $this->i3d = $data['id'];\n $this->s3key = $data['s3key'];\n\n }",
"public static function new($data): IncomeSourceData\n {\n return new self($data);\n }",
"public static function createFromArray(array $data): self\n {\n $instance = new self();\n\n foreach ($data as $field => $value) {\n switch ($field) {\n case 'id':\n $instance->setId($value);\n break;\n case 'ip_address':\n $instance->setIpAddress($value);\n break;\n case 'email':\n $instance->setEmail($value);\n break;\n case 'username':\n $instance->setUsername($value);\n break;\n case 'segment':\n $instance->setSegment($value);\n break;\n default:\n $instance->setMetadata($field, $value);\n break;\n }\n }\n\n return $instance;\n }",
"public function setIccid($iccid)\n {\n $this->iccid = $iccid;\n\n return $this;\n }",
"public function fromData($data = array())\n {\n $this->setID($data['id']);\n \n return $this;\n }",
"public function init($data)\n {\n $this->data = $data;\n return $this;\n }",
"function __construct(string $data)\n {\n list($type, $data) = explode(';', $data);\n list(, $data) = explode(',', $data);\n $this->decodeImg($data);\n }",
"public function instantiate ($raw_data) {\n\t\treturn $this->newInstance()->newFromBuilder(array_change_key_case($raw_data));\n\t}",
"function newDataObject() {\n\t\treturn new ArtworkFile();\n\t}",
"function __construct(array $data, $file, $extensao){\n $this->categorias_id = $data[\"categorias_id\"];\n $this->titulo = $data['titulo'];\n $this->imagem = $file;\n $this->extensao = $extensao;\n }",
"public function __construct($data = array()){\n\t\t$this->id = $data->id;\n\t\t$this->created = $data->created;\n\t\t$this->title = $data->title;\n\t\t$this->summary = $data->summary;\n\t\t$this->content = $data->content;\n\t\t$this->tags = $data->tags;\n\t\t$this->images = $data->images;\n\t}",
"public function getIptc();",
"public function __construct(ImageLibrary $data) \n {\n $this->data = $data; \n }",
"public static function fromFileById($id, UploadedFile $file, $data)\n {\n $asset = static::find($id);\n $asset->deleteFromCloud();\n $asset->file = $file;\n $asset->fill([\n 'name' => $asset->name($data['name']),\n 'description' => $asset->description($data['description']),\n 'original_name' => $asset->file->getClientOriginalName(),\n 'extension' => $asset->file->getClientOriginalExtension(),\n 'path' => $asset->filePath()\n ]);\n $asset->hash_name = $asset->fileName();\n return $asset;\n }",
"function newDataObject() {\n\t\treturn new Gift();\n\t}",
"public function __construct(array $data) {\n if(isset($data['id'])) {\n $this->id = $data['id'];\n }\n\n $this->content = $data['content'];\n $this->article = $data['article'];\n $this->numero = $data['numero'];\n $this->edit = $data['edit'];\n }",
"public function __construct($c, $idpCode)\n {\n $idp = $c->db->querySingle(\"select * from saml_entities where code = '{$idpCode}'\", true);\n $this->meta = $c->get('settings')['sso'];\n $this->meta['idp'] = [\n 'entityId' => $idp['entity_id'],\n 'singleSignOnService' => ['url' => $idp['sso']],\n 'singleLogoutService' => ['url' => $idp['slo']],\n 'x509cert' => $idp['cert'],\n ];\n array_walk_recursive($this->meta['sp'], function(&$v) use ($idpCode) {\n $v = sprintf($v, $idpCode);\n });\n }",
"public function __construct(string $data)\r\n {\r\n foreach ($this->protocolStructure() as $key=> $value){\r\n\r\n // Keep it readable, get values\r\n $start = 0;\r\n if (isset($value['offset'])) {\r\n $start = $value['offset'];\r\n }\r\n\r\n $end = $value['bytes'];\r\n\r\n // get substr and remove\r\n $this->$key = $this->substrPop($data,$start,$end);\r\n\r\n\r\n // Convert it to a object\r\n if (isset($value['to'])) {\r\n $this->$key = (new ReflectionClass($value['to']))->newInstance($this->$key);\r\n }\r\n }\r\n return $data;\r\n }",
"public function factory($data)\n {\n return new static($data);\n }",
"public function __construct($data, $cer, $key)\n {\n $this->comprobante = new Comprobante($data, $this->version);\n $this->cer = $cer;\n $this->key = $key;\n }",
"function __construct($data)\r\n {\r\n $this->id = $data['id'];\r\n $this->postId = $data['post_id'];\r\n $this->userId = $data['user_id'];\r\n $this->created = new \\DateTime($data['created_at']);\r\n $this->updated = new \\DateTime($data['updated_at']);\r\n $this->body = $data['body'];\r\n $this->isActive = !!$data['is_active'];\r\n $this->version = $data['version'];\r\n $this->x = $data['x'];\r\n $this->y = $data['y'];\r\n $this->width = $data['width'];\r\n $this->height = $data['height'];\r\n }",
"public function createFromData($data, $expirationInSeconds);",
"public static function initializeWithRawData($data)\n {\n $item = new Deal();\n\n foreach ($data as $key => $value) {\n switch ($key) {\n case substr($key, 0, 3) == 'cf_':\n $chunks = explode('_', $key);\n $id = end($chunks);\n $item->setCustomField($id, $value);\n break;\n\n case 'for_id':\n case 'language_name':\n break;\n\n case 'deleted':\n $item->setDeleted(($value == 1));\n break;\n\n case 'for':\n if ($value === 'company') {\n $item->setCompanyId($data['for_id']);\n } else {\n $item->setContactId($data['for_id']);\n }\n break;\n\n default:\n // Ignore empty values\n if ($value == '') {\n continue;\n }\n\n $methodName = 'set' . str_replace(' ', '', ucwords(str_replace('_', ' ', $key)));\n if (!method_exists(__CLASS__, $methodName)) {\n if (Teamleader::DEBUG) {\n var_dump($key, $value);\n throw new Exception('Unknown method (' . $methodName . ')');\n }\n } else {\n call_user_func(array($item, $methodName), $value);\n }\n }\n }\n\n return $item;\n }",
"public function load(string $image_data): self\n {\n $this->image_data = imagecreatefromstring($image_data);\n\n $this->height = @imagesy($this->image_data);\n $this->width = @imagesx($this->image_data);\n\n $this->new_height = $this->height;\n $this->new_width = $this->width;\n\n return $this;\n }"
] | [
"0.56050706",
"0.5552118",
"0.54192114",
"0.53439236",
"0.533885",
"0.5321266",
"0.53113234",
"0.5271585",
"0.52693367",
"0.5252651",
"0.52356666",
"0.5190699",
"0.51517487",
"0.5121406",
"0.50479126",
"0.5020518",
"0.50100356",
"0.4996334",
"0.49434644",
"0.49355385",
"0.49348533",
"0.49003208",
"0.48981616",
"0.48958406",
"0.48806024",
"0.48705813",
"0.48585436",
"0.48550016",
"0.4844077",
"0.4841694"
] | 0.571905 | 0 |
Returns the available EXIF data | public function getExif(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function read() {\n\t\t$exif = array();\n\n\t\t// Read raw EXIF data\n\t\t$exif_raw = read_exif_data_raw($this->filename, false);\n\t\t$this->exif_raw = $exif_raw;\n\t\tif (isset($exif_raw['ValidEXIFData'])) {\n\n\t\t\t// Parse only wanted data\n\t\t\tforeach ($this->exif_vars as $field => $exif_var) {\n\t\t\t\tif (isset($exif_raw[$exif_var[0]][$exif_var[1]]) && !empty($exif_raw[$exif_var[0]][$exif_var[1]])) {\n\n\t\t\t\t\t// Parse timestamp, just in case\n\t\t\t\t\tif ($field === 'taken') {\n\t\t\t\t\t\t$exif[$field] = Date::format(Date::TIME_SQL, $exif_raw[$exif_var[0]][$exif_var[1]]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$exif[$field] = $exif_raw[$exif_var[0]][$exif_var[1]];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t$this->exif = $exif;\n\t\treturn $exif;\n\t}",
"public function getExif() {\n\t\t\treturn $this->values;\n\t\t}",
"function readPhoto($src) {\n $exif = exif_read_data($src, \"EXIF\");\n $return = array( \"name\" => $exif['FileName']\n ,\"aperture\" => $exif['COMPUTED']['ApertureFNumber']\n ,\"iso\" => $exif['ISOSpeedRatings']\n ,\"exposure\" => $exif['ExposureTime']\n ,\"focal\" => $exif['FocalLength']\n ,\"resolution\" => $exif['COMPUTED']['Width'] .\" x \" . $exif['COMPUTED']['Height']\n ,\"date\" => $exif['DateTimeOriginal']\n ,\"model\" => $exif['Model']\n );\n /*echo \"<pre>\";\n var_dump($exif);\n var_dump($return);\n echo \"</pre\";*/\n return $return;\n}",
"static function exif($img = null) {\r\n\r\n ini_set('memory_limit', '1024M'); // or you could use 1G\r\n\r\n \r\n \r\n if ( $img->hasexif == '' ){\r\n\r\n $img->hasexif = 0; # No exif until proven otherwise below\r\n R::store( $img );\r\n\r\n if ( strlen($img->exif) < 3 ){\r\n\r\n\r\n $exif = exif_read_data($img->filename, 0, true);\r\n \r\n if (is_array($exif)){\r\n if ( count($exif) > 1 ){\r\n #echo \"OK\";\r\n $img->hasexif = 1;\r\n $img->exif = json_encode($exif);\r\n R::store($img);\r\n\r\n }else{\r\n $img->exif = '';\r\n R::store($img);\r\n }\r\n\r\n }else{\r\n $img->exif = '';\r\n R::store($img);\r\n }\r\n }else{\r\n $img->exif = '';\r\n R::store($img);\r\n }\r\n }\r\n\r\n\r\n // try {\r\n // Image::make($img->filename)->exif();\r\n // $exif = Image::make($img->filename)->exif();\r\n // $exif = json_encode($exif);\r\n // $img->exif = $exif;\r\n // R::store($img);\r\n // } catch (Exception $e) {\r\n // echo 'Caught exception: ', $e->getMessage(), \"\\n\";\r\n // } finally{\r\n // echo \"\\nfinally.. $img->filename\";\r\n // }\r\n\r\n\r\n\r\n // $g = new gps();\r\n // $gps = $g->getGpsPosition($filename);\r\n // if (empty($gps)) {\r\n // #die('Could not get GPS position' . PHP_EOL);\r\n // #echo \"no gps info\";\r\n // $gpsinfo = '';\r\n // }else{\r\n // #print_r($gps);\r\n // #echo \"<img src=\\\"$r->filename\\\" width=100 height=75>\";\r\n // #echo $gmap = $g->getGmap($gps['latitude'], $gps['longitude'], 600, 350);\r\n // $gpsinfo = json_encode($gps);\r\n // }\r\n }",
"function ajs_spb_get_exif_info() {\n\tif ( has_post_format( 'image' )) {\n\t\t$post_thumbnail_id = get_post_thumbnail_id( $post_id );\n\t\t$post_thumbnail_meta = wp_get_attachment_metadata ( $post_thumbnail_id );\n\n\t\tif($post_thumbnail_meta['image_meta']['camera']){\n\t\n\t// Start the markup.\n\t?>\n\t<ul class=\"image-exif-list\">\n\t\t<li class=\"camera\">Camera: <?php echo $post_thumbnail_meta['image_meta']['camera']; ?></li>\n\t\t<li class=\"iso\">ISO: <?php echo $post_thumbnail_meta['image_meta']['iso']; ?></li>\n\t\t<li class=\"aperture\">Aperture: <?php echo $post_thumbnail_meta['image_meta']['aperture']; ?></li>\n\t\t<li class=\"shutter\">Shutter: <?php echo ajs_spb_convert_decimal_to_fraction($post_thumbnail_meta); ?></li>\n\t\t<li class=\"focal-length\">Focal Length: <?php echo $post_thumbnail_meta['image_meta']['focal_length']; ?>mm</li>\n\t</ul> <!-- .image-exif-list -->\n\t<?php } }\n}",
"private function parseImageExif() {\n\t\t\t$exif = exif_read_data($this->filePath);\n\t\t\t\n\t\t\t// $file = fopen(time() . \"exif-export.txt\", \"w\") or die(\"Unable to open file!\");\n\t\t\t// fwrite($file, print_r($exif, true));\n\t\t\t// fclose($file);\n\n\t\t\tforeach($exif as $key => $value) {\n\t\t\t\tif(array_key_exists($key, self::$fieldNames)) {\n\t\t\t\t\tif($key == 'FNumber' || $key == 'FocalLength') {\n\t\t\t\t\t\t$value = $this->handleDividbleNumber($value);\n\t\t\t\t\t}\n\n\t\t\t\t\tif($key == 'GPSDateStamp') {\n\t\t\t\t\t\t$value = $this->handleDate($value . ' 00:00:00');\n\t\t\t\t\t}\n\t\t\t\t\tif($key == 'CreationDate' || $key == 'DateTimeOriginal') {\n\t\t\t\t\t\t$value = $this->handleDate($value);\n\t\t\t\t\t}\n\n\t\t\t\t\tif($key == 'GPSLongitude') {\n\t\t\t\t\t\t$value = $this->handleGPS($value, $exif['GPSLongitudeRef']);\n\t\t\t\t\t}\n\t\t\t\t\tif($key == 'GPSLatitude') {\n\t\t\t\t\t\t$value = $this->handleGPS($value, $exif['GPSLatitudeRef']);\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->values[$key] = $value;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// $this->values['JSONDump'] = json_encode($exif);\n\t\t}",
"public function getExif($photoId) {\r\n \r\n }",
"public function getImageInfo() {\n\t\tif (!$this->imageInfo) {\n\t\t\t$this->imageInfo = getimagesize($this->location);\n\t\t}\n\t\treturn $this->imageInfo;\n\t}",
"public function getAllExif($fname) {\n\n $exif = exif_read_data($fname, 0, true);\n\n $ret = \"\";\n foreach ($exif as $key => $section) {\n foreach ($section as $name => $val) {\n $ret = $ret . \"$key.$name:\\n\";\n }\n }\n\n return $ret;\n }",
"function getImageInfo( $image) {\n $imgInfo = array();\n \n if ( file_exists( $image)) {\n if ( $data = getimagesize( $image)) {\n $imgInfo = $data;\n }\n }\n \n return $imgInfo;\n }",
"public function getImageExtrema () {}",
"public function get_image_fileinfo() {\n return $this->imagefileinfo;\n }",
"public function exif()\n {\n if ($this->exif !== null) {\n return $this->exif;\n }\n $this->exif = new Exif($this);\n return $this->exif;\n }",
"protected function readImages() { return $this->_images; }",
"public function get_image_data()\n {\n if (null == ($json_response = $this->fetch_image_data())) :\n $output = \"<h1>Sorry, I couldn't find the api</h1>\";\n else :\n foreach ($json_response as $image) :\n $this->set_image_values($image);\n $output[] = array(\n 'id' => $image->id,\n 'album_id' => $image->albumId,\n 'title' => $image->title,\n 'url' => $image->url,\n 'thumbnail_url' => $image->thumbnailUrl,\n );\n endforeach;\n endif;\n return $output;\n }",
"public function getCameraInfo(): array {\r\n\r\n $data = [];\r\n\r\n if($headers = @exif_read_data($this -> file)) {\r\n\r\n $data['camera'] = [\r\n\r\n 'Make' \t\t\t\t=> $headers['Make'] ?? null,\r\n 'Model' \t\t\t=> $headers['Model'] ?? null,\r\n 'Orientation' \t\t=> $headers['Orientation'] ?? null,\r\n 'XResolution' \t\t=> $headers['XResolution'] ?? null,\r\n 'YResolution' \t\t=> $headers['YResolution'] ?? null,\r\n 'ResolutionUnit' \t=> $headers['ResolutionUnit'] ?? null,\r\n 'Software' \t\t\t=> $headers['Software'] ?? null,\r\n 'ExposureTime' \t\t=> $headers['ExposureTime'] ?? null,\r\n 'FNumber' \t\t\t=> $headers['FNumber'] ?? null,\r\n 'ISOSpeedRatings' \t=> $headers['ISOSpeedRatings'] ?? null,\r\n 'ShutterSpeedValue' => $headers['ShutterSpeedValue'] ?? null,\r\n 'ApertureValue' \t=> $headers['ApertureValue'] ?? null,\r\n 'BrightnessValue' \t=> $headers['BrightnessValue'] ?? null,\r\n 'ExposureBiasValue' => $headers['ExposureBiasValue'] ?? null,\r\n 'MaxApertureValue' \t=> $headers['MaxApertureValue'] ?? null,\r\n 'MeteringMode' \t\t=> $headers['MeteringMode'] ?? null,\r\n 'Flash' \t\t\t=> $headers['Flash'] ?? null\r\n ];\r\n\r\n $data['created'] = $headers['DateTime'] ?? null;\r\n $data['mime'] \t = $headers['MimeType'] ?? null;\r\n }\r\n\r\n return $data;\r\n }",
"public function getImageExtrema() {\n\t}",
"function fidaExif() {\n global $imagePath;\n\n $exif_ifd0 = read_exif_data($imagePath ,'IFD0' ,0); \n $exif_exif = read_exif_data($imagePath ,'EXIF' ,0); \n $notFound = \"Unavailable\";\n \n // Make\n if (@array_key_exists('Make', $exif_ifd0)) {\n $camMake = $exif_ifd0['Make'];\n } else { $camMake = $notFound; }\n \n // Model\n if (@array_key_exists('Model', $exif_ifd0)) {\n $camModel = $exif_ifd0['Model'];\n } else { $camModel = $notFound; }\n \n // Shutter Speed\n if (@array_key_exists('ExposureTime', $exif_ifd0)) {\n $camExposure = $exif_ifd0['ExposureTime']. ' s';\n } else { $camExposure = $notFound; }\n\n // Aperture\n if (@array_key_exists('ApertureFNumber', $exif_ifd0['COMPUTED'])) {\n $camAperture = $exif_ifd0['COMPUTED']['ApertureFNumber'];\n } else { $camAperture = $notFound; }\n \n // Date Taken\n if (@array_key_exists('DateTimeOriginal', $exif_ifd0)) {\n $camDate = $exif_ifd0['DateTimeOriginal'];\n } else { $camDate = $notFound; }\n $date = date_create($camDate);\n \n // ISO\n if (@array_key_exists('ISOSpeedRatings',$exif_exif)) {\n $camIso = $exif_exif['ISOSpeedRatings'];\n } else { $camIso = $notFound; }\n \n // Focal Length\n if (@array_key_exists('FocalLength',$exif_exif)) {\n $camFocalLength = $exif_exif['FocalLength'];\n } else { $camFocalLength = $notFound; }\n $focal = eval('return ' . $camFocalLength . ';'). ' mm';\n \n // 35mm Focal Length\n if (@array_key_exists('FocalLengthIn35mmFilm',$exif_exif)) {\n $cam35mmFocalLength = $exif_exif['FocalLengthIn35mmFilm']. ' mm';\n } else { $cam35mmFocalLength = $notFound; }\n \n // Lens\n if (@array_key_exists('UndefinedTag:0xA434',$exif_exif)) {\n $camLens = $exif_exif['UndefinedTag:0xA434'];\n } else { $camLens = $notFound; }\n \n // Metering Mode\n if (@array_key_exists('MeteringMode',$exif_exif)) {\n $camMeteringMode = $exif_exif['MeteringMode'];\n } else { $camMeteringMode = $notFound; }\n \n switch ($camMeteringMode) {\n case \"0\": $camMeteringModeName = 'Unknown'; break;\n case \"1\": $camMeteringModeName = 'Average'; break;\n case \"2\": $camMeteringModeName = 'Center Weighted Average'; break;\n case \"3\": $camMeteringModeName = 'Spot'; break;\n case \"4\": $camMeteringModeName = 'Multi Spot'; break;\n case \"5\": $camMeteringModeName = 'Pattern'; break;\n case \"6\": $camMeteringModeName = 'Partial'; break;\n case \"255\": $camMeteringModeName = 'Other'; break;\n default: $camMeteringModeName = 'Unavailable';\n }\n\n // Flash\n if (@array_key_exists('Flash',$exif_exif)) {\n $camFlash = dechex($exif_exif['Flash']);\n } else { $camFlash = $notFound; }\n \n switch ($camFlash) {\n case \"0\": $camFlashName = 'No Flash'; break;\n case \"1\": $camFlashName = 'Flash'; break;\n case \"5\": $camFlashName = 'Flash, No Strobe Return'; break;\n case \"7\": $camFlashName = 'Flash, Strobe Return'; break;\n case \"9\": $camFlashName = 'Flash, Compulsory'; break;\n case \"d\": $camFlashName = 'Flash, Compulsory, No Strobe Return'; break;\n case \"f\": $camFlashName = 'Flash, Compulsory, Strobe Return'; break;\n case \"10\": $camFlashName = 'No Flash, Compulsory'; break;\n case \"18\": $camFlashName = 'No Flash, Auto'; break;\n case \"19\": $camFlashName = 'Flash, Auto'; break;\n case \"1d\": $camFlashName = 'Flash, Auto, No Strobe Return'; break;\n case \"1f\": $camFlashName = 'Flash, Auto, Strobe Return'; break;\n case \"20\": $camFlashName = 'No Flash Function'; break;\n case \"41\": $camFlashName = 'Flash, Red-eye'; break;\n case \"45\": $camFlashName = 'Flash, Red-eye, No Strobe Return'; break;\n case \"47\": $camFlashName = 'Flash, Red-eye, Strobe Return'; break;\n case \"49\": $camFlashName = 'Flash, Compulsory, Red-eye'; break;\n case \"4d\": $camFlashName = 'Flash, Compulsory, Red-eye, No Strobe Return'; break;\n case \"4f\": $camFlashName = 'Flash, Compulsory, Red-eye, Strobe Return'; break;\n case \"59\": $camFlashName = 'Flash, Auto, Red-eye'; break;\n case \"5d\": $camFlashName = 'Flash, Auto, No Strobe Return, Red-eye'; break;\n case \"5f\": $camFlashName = 'Flash, Auto, Strobe Return, Red-eye'; break;\n default: $camFlashName = 'Unavailable';\n }\n \n \n $return = array();\n $return['make'] = $camMake;\n $return['model'] = $camModel;\n $return['shutter'] = $camExposure;\n $return['aperture'] = $camAperture;\n $return['date'] = date_format($date, 'j F, Y');\n $return['iso'] = $camIso;\n $return['focal'] = $focal;\n $return['35mmfocal'] = $cam35mmFocalLength;\n $return['lens'] = $camLens;\n $return['meteringmode'] = $camMeteringModeName;\n $return['flash'] = $camFlashName;\n return $return;\n}",
"public function testGetExifDataReturnsArray( $imagePath ) {\r\n\t\t$output = $this->exifReader->getExifData( $imagePath );\r\n\t\t$this->assertInternalType( 'array', $output );\r\n\t}",
"public function getFileInfo();",
"private function get_exif_types() {\n\n\t\t$exif_types = array(\n\t\t\t'aperture' => __( 'Aperture', 'codepress-admin-columns' ),\n\t\t\t'credit' => __( 'Credit', 'codepress-admin-columns' ),\n\t\t\t'camera' => __( 'Camera', 'codepress-admin-columns' ),\n\t\t\t'caption' => __( 'Caption', 'codepress-admin-columns' ),\n\t\t\t'created_timestamp' => __( 'Timestamp', 'codepress-admin-columns' ),\n\t\t\t'copyright' => __( 'Copyright EXIF', 'codepress-admin-columns' ),\n\t\t\t'focal_length' => __( 'Focal Length', 'codepress-admin-columns' ),\n\t\t\t'iso' => __( 'ISO', 'codepress-admin-columns' ),\n\t\t\t'shutter_speed' => __( 'Shutter Speed', 'codepress-admin-columns' ),\n\t\t\t'title' => __( 'Title', 'codepress-admin-columns' ),\n\t\t);\n\n\t\treturn $exif_types;\n\t}",
"public function getImagesBlob () {}",
"public function read()\n\t{\n\t\t$q_read = $this->db->get('mhs_tif')->result_array();\n\t\treturn $q_read;\n\t}",
"public function getExifInfo($file)\n {\n if ($this->isPossibleExif($file)) {\n $exif = @exif_read_data($file);\n if (!empty($exif)) {\n return $exif;\n }\n }\n\n return array();\n }",
"protected function readImageList() { return $this->_images; }",
"function get_images () {\n\t\t$image_array = array();\n\t\t$query = \"select image_name from imageinfo\";\n\t\t$val = $this->query($query, 1);\n\t\tfor ($i = 0; $i < count($val); $i++) {\n\t\t\tforeach ($val[$i] as $key => $image) {\n\t\t\t\tarray_push($image_array, $image);\n\t\t\t}\n\t\t}\n\t\treturn $image_array;\n\t}",
"function setexifvars() {\n\tglobal $_zp_exifvars;\n\t/*\n\t * Note: If fields are added or deleted, setup.php should be run or the new data won't be stored\n\t * (but existing fields will still work; nothing breaks).\n\t *\n\t * This array should be ordered by logical associations as it will be the order that EXIF information\n\t * is displayed\n\t */\n\t$_zp_exifvars = array(\n\t\t// Database Field \t\t=> array('IFDX', \t 'Metadata Key', \t\t\t'ZP Display Text', \t\t\t\t \t \t\t\t\t\t\t\t\t\tDisplay?\tsize)\n\t\t'EXIFMake' \t\t=> array('IFD0', 'Make', \t\tgettext('Camera Maker'), \t\t\t\t\t\t\t\t\t\ttrue,\t\t\t\t52),\n\t\t'EXIFModel' \t\t=> array('IFD0', 'Model', \t\tgettext('Camera Model'), \t\t\t\t\t\t\t\t\t\ttrue,\t\t\t\t52),\n\t\t'EXIFDescription' \t\t=> array('IFD0', 'ImageDescription', \t\tgettext('Image Title'), \t \t\t\t\t\t\t\t\t\t\tfalse,\t\t\t52),\n\t\t'IPTCObjectName'\t\t\t\t\t\t=> array('IPTC',\t 'ObjectName',\t\t\t\t\t\tgettext('Object name'),\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\t\t\t256),\n\t\t'IPTCImageHeadline' \t\t\t\t=> array('IPTC',\t 'ImageHeadline',\t\t\t\t\tgettext('Image headline'),\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\t\t\t256),\n\t\t'IPTCImageCaption' \t\t\t\t\t=> array('IPTC',\t 'ImageCaption',\t\t\t\t\tgettext('Image caption'),\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\t\t\t2000),\n\t\t'IPTCImageCaptionWriter' \t\t=> array('IPTC',\t 'ImageCaptionWriter',\t\tgettext('Image caption writer'),\t\t\t\t\t\t\t\t\t\t\tfalse,\t\t\t32),\n\t\t'EXIFDateTime' \t\t\t\t\t\t=> array('SubIFD', 'DateTime', \t\t\t\t \t\t\tgettext('Time Taken'), \t\t\t\t\t\t\t\t\t\ttrue,\t\t\t\t52),\n\t\t'EXIFDateTimeOriginal' \t\t=> array('SubIFD', 'DateTimeOriginal', \t\tgettext('Original Time Taken'), \t\t\t\t\t\t\t\ttrue,\t\t\t\t52),\n\t\t'EXIFDateTimeDigitized' \t\t=> array('SubIFD', 'DateTimeDigitized', \t\tgettext('Time Digitized'), \t\t\t\t\t\t\t\ttrue,\t\t\t\t52),\n\t\t'IPTCDateCreated'\t\t\t\t\t => array('IPTC',\t 'DateCreated',\t\t\t\t\t\tgettext('Date created'),\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\t\t\t8),\n\t\t'IPTCTimeCreated' \t\t\t\t\t=> array('IPTC',\t 'TimeCreated',\t\t\t\t\t\tgettext('Time created'),\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\t\t\t11),\n\t\t'IPTCDigitizeDate' \t\t\t\t\t=> array('IPTC',\t 'DigitizeDate',\t\t\t\t\tgettext('Digital Creation Date'),\t\t\t\t\t\t\t\t\t\t\tfalse,\t\t\t8),\n\t\t'IPTCDigitizeTime' \t\t\t\t\t=> array('IPTC',\t 'DigitizeTime',\t\t\t\t\tgettext('Digital Creation Time'),\t\t\t\t\t\t\t\t\t\t\tfalse,\t\t\t11),\n\t\t'EXIFArtist'\t\t\t \t\t=> array('IFD0', 'Artist', \t\t\t\t\t\t\t\tgettext('Artist'), \t \t\t\t\t\t \t\t\t\t\t\t\t\t\t\tfalse,\t\t\t52),\n\t\t'IPTCImageCredit'\t\t\t\t\t\t=> array('IPTC',\t 'ImageCredit',\t\t\t\t\t\tgettext('Image Credit'),\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\t\t\t32),\n\t\t'IPTCByLine' \t\t\t\t\t\t\t\t=> array('IPTC',\t 'ByLine',\t\t\t\t\t\t\t\tgettext('Byline'),\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\t\t\t32),\n\t\t'IPTCByLineTitle' \t\t\t\t\t=> array('IPTC',\t 'ByLineTitle',\t\t\t\t\t\tgettext('Byline Title'),\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\t\t\t32),\n\t\t'IPTCSource'\t\t\t\t\t\t\t\t=> array('IPTC',\t 'Source',\t\t\t\t\t\t\t\tgettext('Image source'),\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\t\t\t32),\n\t\t'IPTCContact' \t\t\t\t\t\t\t=> array('IPTC',\t 'Contact',\t\t\t\t\t\t\t\tgettext('Contact'),\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\t\t\t128),\n\t\t'EXIFCopyright'\t\t\t \t\t=> array('IFD0', 'Copyright', \t\t\t\t\t\tgettext('Copyright Holder'), \t\t\t \t\t\t\t\t\t\t\t\t\tfalse,\t\t\t128),\n\t\t'IPTCCopyright'\t\t\t\t\t\t\t=> array('IPTC',\t 'Copyright',\t\t\t\t\t\t\tgettext('Copyright Notice'),\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\t\t\t128),\n\t\t'EXIFExposureTime' \t\t=> array('SubIFD', 'ExposureTime', \t\tgettext('Shutter Speed'), \t\t\t\t\t\t\t\t\t\ttrue,\t\t\t\t52),\n\t\t'EXIFFNumber' \t\t=> array('SubIFD', 'FNumber', \t\tgettext('Aperture'), \t\t\t\t\t\t\t\t\t\ttrue,\t\t\t\t52),\n\t\t'EXIFISOSpeedRatings' \t\t=> array('SubIFD', 'ISOSpeedRatings', \t\tgettext('ISO Sensitivity'), \t\t\t\t\t\t\t\t\t\ttrue,\t\t\t\t52),\n\t\t'EXIFExposureBiasValue' \t\t=> array('SubIFD', 'ExposureBiasValue', \t\tgettext('Exposure Compensation'), \t\t\t\t\t\t\t\t\t\ttrue,\t\t\t\t52),\n\t\t'EXIFMeteringMode' \t\t=> array('SubIFD', 'MeteringMode', \t\tgettext('Metering Mode'), \t\t\t\t\t\t\t\t\t\ttrue,\t\t\t\t52),\n\t\t'EXIFFlash' \t\t=> array('SubIFD', 'Flash', \t\tgettext('Flash Fired'), \t\t\t\t\t\t\t\t\t\t\ttrue,\t\t\t\t52),\n\t\t'EXIFImageWidth' \t\t=> array('SubIFD', 'ExifImageWidth', \t\tgettext('Original Width'),\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\t\t\t52),\n\t\t'EXIFImageHeight' \t\t=> array('SubIFD', 'ExifImageHeight', \t\tgettext('Original Height'), \t\t\t\t\t\t\t\t\t\t\tfalse,\t\t\t52),\n\t\t'EXIFOrientation' \t\t=> array('IFD0', 'Orientation', \t\tgettext('Orientation'), \t\t\t\t\t\t\t\t\t\tfalse,\t\t\t52),\n\t\t'EXIFContrast' \t\t=> array('SubIFD', 'Contrast', \t\tgettext('Contrast Setting'), \t\t\t\t\t\t\t\t\t\tfalse,\t\t\t52),\n\t\t'EXIFSharpness' \t\t=> array('SubIFD', 'Sharpness', \t\tgettext('Sharpness Setting'), \t\t\t\t\t\t\t\t\t\tfalse,\t\t\t52),\n\t\t'EXIFSaturation' \t\t=> array('SubIFD', 'Saturation', \t\tgettext('Saturation Setting'), \t\t\t\t\t\t\t\t\t\tfalse,\t\t\t52),\n\t\t'EXIFWhiteBalance'\t\t\t\t\t=> array('SubIFD', 'WhiteBalance',\t\t\t\t\tgettext('White Balance'),\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\t\t\t52),\n\t\t'EXIFSubjectDistance'\t\t\t\t=> array('SubIFD', 'SubjectDistance',\t\t\t\tgettext('Subject Distance'),\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\t\t\t52),\n\t\t'EXIFFocalLength' \t\t=> array('SubIFD', 'FocalLength', \t\tgettext('Focal Length'), \t\t\t\t\t\t\t\t\t\ttrue,\t\t\t\t52),\n\t\t'EXIFLensType' \t\t\t\t=> array('SubIFD', 'LensType', \t\t\t\tgettext('Lens Type'), \t \t\t\t\t\t\t\t\t\t\tfalse,\t\t\t52),\n\t\t'EXIFLensInfo' \t\t\t\t=> array('SubIFD', 'LensInfo', \t\t \t\tgettext('Lens Info'), \t\t\t\t\t\t\t\t\t\t\tfalse,\t\t\t52),\n\t\t'EXIFFocalLengthIn35mmFilm'\t=> array('SubIFD', 'FocalLengthIn35mmFilm',\tgettext('Focal Length Equivalent in 35mm Film'),\t\t\tfalse,\t\t\t52),\n\t\t'IPTCCity' \t\t\t\t\t\t\t\t\t=> array('IPTC',\t 'City',\t\t\t\t\t\t\t\t\tgettext('City'),\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\t\t\t32),\n\t\t'IPTCSubLocation' \t\t\t\t\t=> array('IPTC',\t 'SubLocation',\t\t\t\t\t\tgettext('Sub-location'),\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\t\t\t32),\n\t\t'IPTCState' \t\t\t\t\t\t\t\t=> array('IPTC',\t 'State',\t\t\t\t\t\t\t\t\tgettext('Province/State'),\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\t\t\t32),\n\t\t'IPTCLocationCode' \t\t\t\t\t=> array('IPTC',\t 'LocationCode',\t\t\t\t\tgettext('Country/Primary Location Code'),\t\t\t\t\t\t\tfalse,\t\t\t3),\n\t\t'IPTCLocationName' \t\t\t\t\t=> array('IPTC',\t 'LocationName',\t\t\t\t\tgettext('Country/Primary Location Name'),\t\t\t\t\t\t\tfalse,\t\t\t64),\n\t\t'EXIFGPSLatitude' \t\t=> array('GPS', 'Latitude', \t\tgettext('Latitude'), \t\t\t\t\t\t\t\t\t\tfalse,\t\t\t52),\n\t\t'EXIFGPSLatitudeRef' \t\t=> array('GPS', 'Latitude Reference',\t\tgettext('Latitude Reference'), \t\t\t\t\t\t\t\t\t\tfalse,\t\t\t52),\n\t\t'EXIFGPSLongitude' \t\t=> array('GPS', 'Longitude', \t\tgettext('Longitude'), \t\t\t\t\t\t\t\t\t\tfalse,\t\t\t52),\n\t\t'EXIFGPSLongitudeRef' \t\t=> array('GPS', 'Longitude Reference',\t\tgettext('Longitude Reference'), \t\t\t\t\t\t\t\t\t\t\tfalse,\t\t\t52),\n\t\t'EXIFGPSAltitude' \t\t=> array('GPS', 'Altitude', \t\tgettext('Altitude'), \t\t\t\t\t\t\t\t\t\tfalse,\t\t\t52),\n\t\t'EXIFGPSAltitudeRef' \t\t=> array('GPS', 'Altitude Reference',\t\tgettext('Altitude Reference'), \t\t\t\t\t\t\t\t\t\t\tfalse,\t\t\t52),\n\t\t'IPTCOriginatingProgram'\t\t=> array('IPTC',\t 'OriginatingProgram',\t\tgettext('Originating Program '),\t\t\t\t\t\t\t\t\t\t\tfalse,\t\t\t32),\n\t\t'IPTCProgramVersion'\t\t\t \t=> array('IPTC',\t 'ProgramVersion',\t\t\t\tgettext('Program version'),\t\t\t\t\t\t\t\t\t\t\t\t\t\tfalse,\t\t\t10)\n\t\t);\n\tforeach ($_zp_exifvars as $key=>$item) {\n\t\t$_zp_exifvars[$key][3] = getOption($key);\n\t}\n}",
"public function getImage() {\n return $this->_data['image'];\n }",
"function getImageFile();",
"protected function getData( $filename )\n {\n\n $matches = [];\n\n $regex = '/(.+)-([0-9_]+)x([0-9_]+)(-resize)*(\\-\\[([\\-\\d\\.]+)x([\\-\\d\\.]+)\\])*\\.([A-z]+)$/';\n\n preg_match( $regex, $filename, $matches );\n\n\n $path = $matches[1];\n $extension = $matches[8];\n $imagePath = sprintf( '%s/%s.%s', dirname( $filename ), basename( $path ), $extension );\n\n $width = $matches[2];\n $height = $matches[3];\n\n $focusX = $matches[6];\n $focusY = $matches[7];\n\n return [\n 'filepath'=> $imagePath,\n 'resize'=> $matches[4] != '',\n\n 'width'=> $width != '_' ? $width : null,\n 'height'=> $height != '_' ? $height : null,\n\n 'focusX' => $focusX != '' ? $focusX : null,\n 'focusY' => $focusY != '' ? $focusY : null,\n ];\n\n }"
] | [
"0.71435344",
"0.70466924",
"0.6763035",
"0.6561977",
"0.6444935",
"0.64236504",
"0.62452537",
"0.61994094",
"0.6151414",
"0.6014994",
"0.5915217",
"0.5913321",
"0.5854693",
"0.5849967",
"0.582947",
"0.58210015",
"0.5812879",
"0.5799102",
"0.5793274",
"0.57246494",
"0.5720996",
"0.56938386",
"0.56780744",
"0.5663747",
"0.56633765",
"0.56581086",
"0.5657926",
"0.56202215",
"0.5587911",
"0.5556648"
] | 0.79378116 | 0 |
Returns the available IPTC data | public function getIptc(); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getImgIPTCData( $image, $tags) {\n\t $imageIPTCData = array();\n\t \n\t // Check if any IPTC tags have been specified or not. If not, then return.\n\t if ( is_array( $tags) && !empty( $tags)) {\n\n // Check for valid image file\n $imgInfo = $this->getImageInfo( $image);\n $validImageFile = ( is_array( $imgInfo) && !empty( $imgInfo))\n ? true\n : false;\n\t \n\t // Proceed if provided file is an existing image file\n \t if ( $validImageFile) {\n \t $embImgInfo = array(); // array to store embedded image information\n \t $IPTCData = new tx_bahag_photogallery_iptc( $image);\n \t \n foreach ( $tags as $key => $tag) {\n $data = trim( $IPTCData->getTag( $tag));\n \n if ( $data !== '') {\n $imageIPTCData[$tag] = $data;\n }\n\t }\n \t }\t \n \t}\n\t \n\t return $imageIPTCData;\n\t}",
"function getImgIPTCHeader( $IPTCTagValues) {\n $imgIPTCHeader = '';\n \n if ( is_array( $IPTCTagValues) && !empty( $IPTCTagValues)) {\n\n // Convert special characters in values to HTML entities\n foreach ( $IPTCTagValues as $key => $value) {\n $IPTCTagValues[$key] = htmlspecialchars( $value, ENT_QUOTES);\n }\n \n // Create IPTC header from recieved info\n $imgIPTCHeader = '8BIM#1028=\"IPTC\"'.\"\\n\";\n $imgIPTCHeader .= '2#5#Image Name=\"'.$IPTCTagValues['object_name'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#7#Edit Status=\"'.$IPTCTagValues['edit_status'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#10#Priority=\"'.$IPTCTagValues['priority'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#15#Category=\"'.$IPTCTagValues['category'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#20#Supplemental Category=\"'.$IPTCTagValues['supplementary_category'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#22#Fixture Identifier=\"'.$IPTCTagValues['fixture_identifier'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#25#Keyword=\"'.$IPTCTagValues['keywords'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#30#Release Date=\"'.$IPTCTagValues['release_date'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#35#Release Time=\"'.$IPTCTagValues['release_time'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#40#Special Instructions=\"'.$IPTCTagValues['special_instructions'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#45#Reference Service=\"'.$IPTCTagValues['reference_service'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#47#Reference Date=\"'.$IPTCTagValues['reference_date'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#50#Reference Number=\"'.$IPTCTagValues['reference_number'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#55#Created Date=\"'.$IPTCTagValues['created_date'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#64=\"'.$IPTCTagValues['originating_program'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#70#Program Version=\"'.$IPTCTagValues['program_version'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#75#Object Cycle=\"'.$IPTCTagValues['object_cycle'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#80#Byline=\"'.$IPTCTagValues['byline'].'\"\\n';\n $imgIPTCHeader .= '2#85#Byline Title=\"'.$IPTCTagValues['byline_title'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#90#City=\"'.$IPTCTagValues['city'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#95#Province State=\"'.$IPTCTagValues['province_state'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#100#Country Code=\"'.$IPTCTagValues['country_code'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#101#Country=\"'.$IPTCTagValues['country'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#103#Original Transmission Reference=\"'.$IPTCTagValues['original_transmission_reference'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#105#Headline=\"'.$IPTCTagValues['headline'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#110#Credit=\"'.$IPTCTagValues['credit'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#115#Source=\"'.$IPTCTagValues['source'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#116#Copyright String=\"'.$IPTCTagValues['copyright_string'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#120#Caption=\"'.$IPTCTagValues['caption'].'\"'.\"\\n\";\n $imgIPTCHeader .= '2#121#Image Orientation=\"'.$IPTCTagValues['local_caption'].'\"'.\"\\n\";\n }\n \n return $imgIPTCHeader;\n }",
"abstract protected function getAvailableMetadata();",
"public function getCacheData(): array;",
"public function getFromImages()\n {\n // Declare helper\n $sql = new SQLHelper();\n \n // Prepare query\n $sql->select('*');\n $sql->from('sc_countries');\n $sql->where('id IN (SELECT country_id FROM sc_images WHERE status = ' . IMAGE_PUBLISHED . ')');\n $sql->order('name');\n \n \n // Execute query\n if (! $sql->execute())\n {\n return false;\n }\n \n // Store\n $_countries = array();\n \n // Load\n while ($country = $sql->fetchArray())\n {\n array_push($_countries, $this->assign($country));\n }\n \n // Return\n return $_countries;\n }",
"function writeImgIPTCData( $image, $IPTCDataItems) {\n $status = false;\n \n $imgInfo = $this->getImageInfo( $image);\n\n // Flag to check whether provided file is a valid image file or not\n $isValidImgFile = ( is_array( $imgInfo) && !empty( $imgInfo))\n ? true\n : false;\n\n // Flag to check that provided $IPTCDataItems array holds data\n $iptcDataNotEmpty = ( is_array( $IPTCDataItems) && !empty( $IPTCDataItems))\n ? true\n : false;\n \n if ( $isValidImgFile && $iptcDataNotEmpty) {\n \n // Create and get image IPTC header from received APP13 tag values \n $IPTCDataHeader = $this->getImgIPTCHeader( $IPTCDataItems);\n \n // Create a temporary file to hold image IPTC header\n $tmpFileName = PATH_site.'typo3temp/bahag_photogallery/'.time();\n \n if ( $fp = @fopen( $tmpFileName, 'w')) {\n if ( fwrite( $fp, $IPTCDataHeader)) {\n fclose( $fp);\n chmod( $tmpFileName, 0777);\n \n // Invoke imagemagick commandline utility to write IPTC data to image\n $imPath = $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path'];\n $command = 'mogrify';\n $options = ' -profile 8BIMTEXT:';\n $cmd = $imPath.$command.$options.'\\''.$tmpFileName.'\\' '.$image;\n \n // Uncomment to debug\n // echo '<br>'.$cmd;\n\n if ( popen( $cmd, 'r')) {\n $status = true;\n }\n } else {\n fclose( $fp);\n }\n \n // remove above created temporary file\n @unlink( $tmpFileName);\n }\n }\n \n return $status;\n }",
"public function getCacheData();",
"public function read()\n\t{\n\t\t$q_read = $this->db->get('mhs_tif')->result_array();\n\t\treturn $q_read;\n\t}",
"private static function getMetadata()\n\t{\n\t\tstatic $failed = false;\n\t\tif ($failed)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$cacheTtl = 86400; // 24 hours\n\t\t$cacheId = 'sender_audiocall_metadata';\n\t\t$cachePath = '/sender/audiocall_metadata/';\n\t\t$cache = \\Bitrix\\Main\\Application::getInstance()->getCache();\n\t\tif($cache->initCache($cacheTtl, $cacheId, $cachePath))\n\t\t{\n\t\t\treturn $cache->getVars();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = false;\n\n\t\t\t$cache->startDataCache();\n\n\t\t\t$request = new HttpClient([\n\t\t\t\t\"socketTimeout\" => 5,\n\t\t\t\t\"streamTimeout\" => 5\n\t\t\t]);\n\t\t\t$request->get(static::METADATA_FILE);\n\t\t\tif($request->getStatus() == 200)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$result = Json::decode($request->getResult());\n\t\t\t\t}\n\t\t\t\tcatch (ArgumentException $e)\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (is_array($result))\n\t\t\t{\n\t\t\t\t$cache->endDataCache($result);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$failed = true;\n\t\t\t\t$cache->abortDataCache();\n\t\t\t}\n\t\t\treturn $result;\n\t\t}\n\t}",
"public function memData_get($aid){\n\t\t $this->load->library('memcached_library');\n\t\t $results = $this->memcached_library->get($aid);\n\t\t $this->response($results , 200);\t\n\t\t /*echo 'Data from cache server: <pre>'; \n\t\t print_r($results);\n\t\t echo '</pre>';\n\t\t */\n\t\t \n\t\t \n }",
"public function getRawData();",
"public function getRawData();",
"public function getRawData();",
"public function getRawData();",
"public static function readIfbaContainerData(){\r\n /* Get entity query object for entity type 'node' */\r\n $query = \\Drupal::entityQuery('node');\r\n\r\n /*Use query object with condition filters to execute query and return node ids array*/\r\n $node_ids = $query->condition('type',IFBATypes::IFBA_ARCHIVE_CONTAINER)\r\n ->condition('status',1)\r\n ->execute();\r\n\r\n /*Pass node ids array into loadMultiple to return all associated data/nodes*/\r\n $nodes_result = Node::loadMultiple($node_ids);\r\n\r\n return $nodes_result;\r\n }",
"function getData(){\n // tell me simply how to get data from what and where should i fetch the data from. \n return NULL;\n }",
"public function getIoiDiscountData(){\r\n\t\t$discountData\t=\tMage::getModel('ordergroove/ioi_discountdata');\r\n\t\tif($this->hasIoiItemDiscountData()){\r\n\t\t\t$discountData->setDiscountAsItemLevel();\r\n\t\t\t$data\t=\tjson_decode($_COOKIE[self::COOKIE_TAG_IOI_ITEM_DISCOUNT], true);\r\n\t\t\t$discountData->setIncentiveItems($data);\r\n\t\t}\r\n\t\t\r\n\t\tif($this->hasIoiOrderDiscountData()){\r\n\t\t\t$discountData->setDiscountAsOrderLevel();\r\n\t\t\t$discountData->setOrderIncentiveAmount($_COOKIE[self::COOKIE_TAG_IOI_ORDER_DISCOUNT]);\r\n\t\t}\r\n\t\treturn $discountData;\r\n\t}",
"public function getExif();",
"abstract public function get_data();",
"public function getPics($item_id)\n {\n $query = $this->db->get_where('T_PIC', array('ITEM_ID' => $item_id));\n $data[\"success\"] = true;\n $data[\"errorCode\"] = 0;\n $data[\"error\"] = 0;\n $data[\"message\"] = 'getPics succeeded!';\n $data['data'] = $query->result_array();\n return $data;\n }",
"function getLangInternalImages($item_id) {\r\n\t\t$this->langdb =& $this->load->database('langdb01', true);\r\n\t\t$this->langdb->where('item_id', $item_id);\r\n\t\t$this->langdb->from('image_lang');\r\n\t\t$query = $this->langdb->get(); //store data\r\n\t\t$this->langdb->close(); //close connection\r\n\r\n\t\t$data = array();\r\n\t\tif($query->num_rows() > 0) {\r\n\t\t\tforeach($query->result_array() as $row) {\r\n\t\t\t\t$row['image_class'] = 2; //internal\r\n\t\t\t\t$row['image_copy_location'] = $row['image_location'];\r\n\t\t\t\t$row['image_location'] = $this->config->item('image_url') . $row['image_location'];\r\n\t\t\t\t$data[] = $row;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $data;\r\n\t}",
"protected function readImages() { return $this->_images; }",
"public function getData();",
"public function getData();",
"public function getData();",
"public function getData();",
"public function getData();",
"public function getData();",
"public function getData();",
"public function getData();"
] | [
"0.65006626",
"0.56564474",
"0.5498989",
"0.543189",
"0.5392419",
"0.5362562",
"0.53138834",
"0.52558464",
"0.5249223",
"0.5159932",
"0.51481044",
"0.51481044",
"0.51481044",
"0.51481044",
"0.5106927",
"0.509902",
"0.5083108",
"0.5082271",
"0.5066823",
"0.5066429",
"0.50638056",
"0.50622964",
"0.5060355",
"0.5060355",
"0.5060355",
"0.5060355",
"0.5060355",
"0.5060355",
"0.5060355",
"0.5060355"
] | 0.66632503 | 0 |
Analyze a string literal statement during Phan's analysis phase. | public function analyzeStringLiteralStatement(
CodeBase $code_base,
Context $context,
string $statement
): bool; | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function tokenLiteral(): string\n {\n }",
"private function searchStrings(){\n\n $current = 0;\n $currentScriptName = \"\";\n while ($current < count($this->tokens)) {\n $token = $this->tokens[$current];\n\n switch(strtolower($token)){\n case 'script':\n case 'procedure':\n case 'function':\n $currentScriptName = $this->tokens[$current + 1];\n break;\n\n }\n\n if (substr($token, -1, 1) == \"'\"){\n $this->addString(substr($token, 1, -1), $currentScriptName);\n }\n\n $current++;\n }\n\n }",
"public function isLiteral()\n {\n return false;\n }",
"public function testCreateLiteral(): void\n {\n $this->assertEquals('\"\"', Util::createLiteral(''));\n\n // it converts the empty string with a language\n $this->assertEquals('\"\"@en-gb', Util::createLiteral('', 'en-GB'));\n\n // it converts the empty string with a type\n $this->assertEquals('\"\"^^http://ex.org/type', Util::createLiteral('', 'http://ex.org/type'));\n\n // it converts a non-empty string\n $this->assertEquals('\"abc\"', Util::createLiteral('abc'));\n\n // it converts a non-empty string with a language\n $this->assertEquals('\"abc\"@en-gb', Util::createLiteral('abc', 'en-GB'));\n\n // it converts a non-empty string with a type\n $this->assertEquals('\"abc\"^^http://ex.org/type', Util::createLiteral('abc', 'http://ex.org/type'));\n\n // it converts an integer\n $this->assertEquals('\"123\"^^http://www.w3.org/2001/XMLSchema#integer', Util::createLiteral(123));\n\n // it converts a decimal\n $this->assertEquals('\"2.3\"^^http://www.w3.org/2001/XMLSchema#double', Util::createLiteral(2.3));\n\n // it converts infinity\n $this->assertEquals('\"INF\"^^http://www.w3.org/2001/XMLSchema#double', Util::createLiteral(INF));\n\n // it converts false\n $this->assertEquals('\"false\"^^http://www.w3.org/2001/XMLSchema#boolean', Util::createLiteral(false));\n\n // it converts true\n $this->assertEquals('\"true\"^^http://www.w3.org/2001/XMLSchema#boolean', Util::createLiteral(true));\n }",
"function yy_r10(){ $this->_retvalue = yy('Literal', $this->yystack[$this->yyidx + 0]->minor); }",
"public function escapeLiteral(string $string): string|false\n {\n }",
"function yy_r33(){\n $val = yy('Literal', $this->yystack[$this->yyidx + 0]->minor);\n $this->_retvalue = $val;\n }",
"protected function compileString() {\n \n }",
"public function getLiteralPhase()\n {\n return $this->literal_phase;\n }",
"public function testSingleQuotedStringSyntax() {\n\n\t\t$lexer = new AnnotationLexer();\n\t\t$stream = $lexer->scan(\" 'key\\\\\\\\':va\\\\'l\\\\'ue\\\\'' \");\n\n\t\t$actual = $this->buildActualTokens($stream);\n\t\t$expected = array(\n\t\t\tarray(AnnotationLexer::T_VALUE => \"'key\\\\\\\\':va\\\\'l\\\\'ue\\\\''\")\n\t\t);\n\t\t$this->assertSame($expected, $actual);\n\t}",
"public function testGetLiteralValue(): void\n {\n $this->assertEquals('Mickey', Util::getLiteralValue('\"Mickey\"'));\n\n // it gets the value of a literal with a language\n $this->assertEquals('English', Util::getLiteralValue('\"English\"@en'));\n\n // it gets the value of a literal with a language that contains a number\n $this->assertEquals('English', Util::getLiteralValue('\"English\"@es-419'));\n\n // it gets the value of a literal with a type\n $this->assertEquals('3', Util::getLiteralValue('\"3\"^^http://www.w3.org/2001/XMLSchema#integer'));\n\n // it gets the value of a literal with a newline\n $this->assertEquals('Mickey\\nMouse', Util::getLiteralValue('\"Mickey\\nMouse\"'));\n\n // it gets the value of a literal with a cariage return\n $this->assertEquals('Mickey\\rMouse', Util::getLiteralValue('\"Mickey\\rMouse\"'));\n\n $this->assertEquals(\"foo\\nbar\", Util::getLiteralValue('\"' . \"foo\\nbar\" . '\"'));\n\n // it does not work with non-literals\n //TODO: Util::getLiteralValue.bind(null, 'http://ex.org/').should.throw('http://ex.org/ is not a literal');\n\n // it does not work with null\n //TODO: Util::getLiteralValue.bind(null, null).should.throw('null is not a literal');\n }",
"function yy_r32(){\n $val = yy('Literal', $this->yystack[$this->yyidx + 0]->minor);\n $val->is_undefined = true;\n $this->_retvalue = $val;\n }",
"function codeAdd(string $str): string {\n return $str . \" \" . \"codelex\";\n}",
"public function compileFromString($str) {}",
"public function StringLiteral_SingleQuotedStringLiteral(&$result, $sub)\n {\n $result['val'] = (string)str_replace(\"'\", \"'\", substr($sub['text'], 1, -1));\n }",
"public function testGetLiteralType(): void\n {\n $this->assertEquals('http://www.w3.org/2001/XMLSchema#string', Util::getLiteralType('\"Mickey\"'));\n\n // it gets the type of a literal with a language\n $this->assertEquals('http://www.w3.org/1999/02/22-rdf-syntax-ns#langString', Util::getLiteralType('\"English\"@en'));\n\n // it gets the type of a literal with a language that contains a number\n $this->assertEquals('http://www.w3.org/1999/02/22-rdf-syntax-ns#langString', Util::getLiteralType('\"English\"@es-419'));\n\n // it gets the type of a literal with a type\n $this->assertEquals('http://www.w3.org/2001/XMLSchema#integer', Util::getLiteralType('\"3\"^^http://www.w3.org/2001/XMLSchema#integer'));\n\n // it gets the type of a literal with a newline\n $this->assertEquals('abc', Util::getLiteralType('\"Mickey\\nMouse\"^^abc'));\n\n // it gets the type of a literal with a cariage return\n $this->assertEquals('abc', Util::getLiteralType('\"Mickey\\rMouse\"^^abc'));\n\n // it does not work with non-literals\n //TODO: Util::getLiteralType.bind(null, 'http://example.org/').should.throw('http://example.org/ is not a literal');\n\n // it does not work with null\n //TODO: Util::getLiteralType.bind(null, null).should.throw('null is not a literal');\n }",
"function geshi_sql_string (&$context)\n{\n $context->addDelimiters(array(\"'\", '\"'), array(\"'\", '\"'));\n\n // If a ' occurs it can escape. There's nothing else listed as escape\n // characters so it only escapes itself.\n $context->addEscapeGroup(array(\"'\"));\n\n // The backslash escape is not SQL standard but is used in many databases\n // regardless (e.g. mysql, postgresql)\n // This rule means that the backslash escapes the array given (inc. the regex)\n // As such, the definitions given here are perfectly in line with the new feature\n // The only other feature is that the escape char could actually be an array of them\n $context->addEscapeGroup(array('\\\\'), array('b', 'f', 'n', 'r', 't', \"'\",\n 'REGEX#[0-7]{3}#'));\n}",
"public function testGetLiteralTypeMultilineString(): void\n {\n $literal = '\"This document is published by the Provenance Working Group (http://www.w3.org/2011/prov/wiki/Main_Page).\n\nIf you wish to make comments regarding this document, please send them to [email protected] (subscribe [email protected], archives http://lists.w3.org/Archives/Public/public-prov-comments/). All feedback is welcome.\"^^<http://>';\n\n $this->assertEquals('<http://>', Util::getLiteralType($literal));\n }",
"public function testGetLiteralLanguage(): void\n {\n $this->assertEquals('', Util::getLiteralLanguage('\"Mickey\"'));\n\n // it gets the language of a literal with a language\n $this->assertEquals('en', Util::getLiteralLanguage('\"English\"@en'));\n\n // it gets the language of a literal with a language that contains a number\n $this->assertEquals('es-419', Util::getLiteralLanguage('\"English\"@es-419'));\n\n // it normalizes the language to lowercase\n $this->assertEquals('en-gb', Util::getLiteralLanguage('\"English\"@en-GB'));\n\n // it gets the language of a literal with a type\n $this->assertEquals('', Util::getLiteralLanguage('\"3\"^^http://www.w3.org/2001/XMLSchema#integer'));\n\n // it gets the language of a literal with a newline\n $this->assertEquals('en', Util::getLiteralLanguage('\"Mickey\\nMouse\"@en'));\n\n // it gets the language of a literal with a cariage return\n $this->assertEquals('en', Util::getLiteralLanguage('\"Mickey\\rMouse\"@en'));\n }",
"public function testCapturesStrings()\n {\n $this->assertEquals(['\"this is a string.\"'], Tokenizer::tokenize('\"this is a string.\"'));\n }",
"public function testTextDynamicStringCustomDelimeter()\n\t{\n\t\t$actual = PhTText::dynamic('(Hi|Hello), my name is a Bob!', '(', ')');\n\t\texpect($actual)->notContains('(');\n\t\texpect($actual)->notContains(')');\n\n\t\texpect(preg_match('/^(Hi|Hello), my name is a Bob!$/', $actual))->equals(1);\n\t}",
"function str($s):void\n {\n $this->init();\n $this->loadLines($s);\n $this->procLines();\n }",
"public function test_scanning_error_in_middle() {\r\n $lang = new block_formal_langs_language_c_language();\r\n $processedstring = $lang->create_from_string('asv \\'abc 1 + 1');\r\n $errors = $processedstring->stream->errors;\r\n $tokens = $processedstring->stream->tokens;\r\n $this->assertTrue(count($errors) == 1, 'There must be one error in errors');\r\n $this->assertTrue($errors[0]->tokenindex == 1);\r\n $this->assertTrue($tokens[1]->position()->colstart() == 4);\r\n $this->assertTrue($tokens[1]->position()->colend() == 4);\r\n $processedstring = $lang->create_from_string('asv \"abc 1 + 1');\r\n $errors = $processedstring->stream->errors;\r\n $tokens = $processedstring->stream->tokens;\r\n $this->assertTrue(count($errors) == 1, 'There must be one error in errors');\r\n $this->assertTrue($errors[0]->tokenindex == 1);\r\n $this->assertTrue($tokens[1]->position()->colstart() == 4);\r\n $this->assertTrue($tokens[1]->position()->colend() == 4);\r\n $processedstring = $lang->create_from_string('asv /*abc 1 + 1');\r\n $errors = $processedstring->stream->errors;\r\n $tokens = $processedstring->stream->tokens;\r\n $this->assertTrue(count($errors) == 1, 'There must be one error in errors');\r\n $this->assertTrue($errors[0]->tokenindex == 1);\r\n $this->assertTrue($tokens[1]->position()->colstart() == 4);\r\n $this->assertTrue($tokens[1]->position()->colend() == 5);\r\n //Multicharacter literal test\r\n $processedstring = $lang->create_from_string('asv \\'abc\\' asv');\r\n $errors = $processedstring->stream->errors;\r\n $tokens = $processedstring->stream->tokens;\r\n $this->assertTrue(count($errors) == 1, 'There must be one error in errors');\r\n $this->assertTrue($errors[0]->tokenindex == 1);\r\n $this->assertTrue($tokens[1]->position()->colstart() == 4, 'Error lexeme is at the end');\r\n $this->assertTrue($tokens[1]->position()->colend() == 8, 'Error lexeme must be five characters long');\r\n public function test_scanning_error_in_middle() {\r\n $lang = new block_formal_langs_language_c_language();\r\n $processedstring = $lang->create_from_string('asv \\'abc 1 + 1');\r\n $errors = $processedstring->stream->errors;\r\n $tokens = $processedstring->stream->tokens;\r\n $this->assertTrue(count($errors) == 1, 'There must be one error in errors');\r\n $this->assertTrue($errors[0]->tokenindex == 1);\r\n $this->assertTrue($tokens[1]->position()->colstart() == 4);\r\n $this->assertTrue($tokens[1]->position()->colend() == 4);\r\n $processedstring = $lang->create_from_string('asv \"abc 1 + 1');\r\n $errors = $processedstring->stream->errors;\r\n $tokens = $processedstring->stream->tokens;\r\n $this->assertTrue(count($errors) == 1, 'There must be one error in errors');\r\n $this->assertTrue($errors[0]->tokenindex == 1);\r\n $this->assertTrue($tokens[1]->position()->colstart() == 4);\r\n $this->assertTrue($tokens[1]->position()->colend() == 4);\r\n $processedstring = $lang->create_from_string('asv /*abc 1 + 1');\r\n $errors = $processedstring->stream->errors;\r\n $tokens = $processedstring->stream->tokens;\r\n $this->assertTrue(count($errors) == 1, 'There must be one error in errors');\r\n $this->assertTrue($errors[0]->tokenindex == 1);\r\n $this->assertTrue($tokens[1]->position()->colstart() == 4);\r\n $this->assertTrue($tokens[1]->position()->colend() == 5);\r\n //Multicharacter literal test\r\n $processedstring = $lang->create_from_string('asv \\'abc\\' asv');\r\n $errors = $processedstring->stream->errors;\r\n $tokens = $processedstring->stream->tokens;\r\n $this->assertTrue(count($errors) == 1, 'There must be one error in errors');\r\n $this->assertTrue($errors[0]->tokenindex == 1);\r\n $this->assertTrue($tokens[1]->position()->colstart() == 4, 'Error lexeme is at the end');\r\n $this->assertTrue($tokens[1]->position()->colend() == 8, 'Error lexeme must be five characters long');\r\n }\r\n\r\n // Tests keywords\r\n public function test_keywords() {\r\n // Keywords\r\n $kwds = array('auto', 'break', 'const', 'continue', 'case', 'default',\r\n 'do', 'else', 'enum', 'extern', 'for', 'goto', 'if',\r\n 'return', 'sizeof', 'static', 'struct', 'register',\r\n 'switch', 'typedef', 'union', 'volatile', 'while');\r\n $o = 'block_formal_langs_c_token_keyword';\r\n $this->utils->test_object($kwds, $o);\r\n }\r\n\r\n // Tests typename keywords\r\n public function test_typename_keywords() {\r\n // Keywords\r\n $kwds = array('char', 'double', 'float', 'int','long', 'signed', 'unsigned', 'void');\r\n $o = 'block_formal_langs_c_token_typename';\r\n $this->utils->test_object($kwds, $o);\r\n }\r\n\r\n // Tests identifiers\r\n public function test_identifiers() {\r\n $tests = array('a0_2', 'A__', '__AW1__A');\r\n $o = 'block_formal_langs_c_token_identifier';\r\n $this->utils->test_object($tests, $o);\r\n }\r\n\r\n // Tests integral numbers\r\n public function test_integral_numbers() {\r\n $tests = array('10','10u', '10U', '10L', '10l', '0777', '0777u', '0777U',\r\n '0777l', '0777L', '0xabcdef','0xABCDEF','0xABCDEFu',\r\n '0xABCDEFU', '0xABCDEFl', '0xABCDEFL','1e+1','1E+1u',\r\n '1e+1U', '1e+1l', '1e+1L');\r\n $o = 'block_formal_langs_c_token_numeric';\r\n $this->utils->test_object($tests, $o);\r\n }\r\n // Tests unmatched elements\r\n public function test_unmatched_elements() {\r\n $tests = array('/* unmatched comment', '\" unmatched quotes', '\\'u');\r\n $testsplits = array('/*', '\"', '\\'');\r\n $o = 'block_formal_langs_c_token_unknown';\r\n for($i = 0;$i < count($tests);$i++) {\r\n $lang = new block_formal_langs_language_c_language();\r\n $processedstring = $lang->create_from_string($tests[$i]);\r\n $result = $processedstring->stream->tokens;\r\n $this->assertTrue(count($result) == 2, count($result) . ' tokens given in test ');\r\n $this->assertTrue(is_a($result[0], $o), get_class($result[0]) . ' class object is given at position '. $i);\r\n $value = $result[0]->value();\r\n $this->assertTrue($value == $testsplits[$i], $value. ' is parsed in test ' . $i );\r\n $errors = $processedstring->stream->errors;\r\n $this->assertTrue(count($errors) == 1, count($errors) . ' is found instead of 1 in test ' . $i);\r\n }\r\n }\r\n // Tests operators lexemes\r\n public function test_operator_lexemes() {\r\n $tests = array('>>=', '<<=', '=', '+=', '-=', '*=', '/=', '%=', '&=',\r\n '^=', '|=', '>>', '<<', '++', '--', '->', '&&', '||',\r\n '<=', '>=', '==', '!=', '.', '&', '|', '^', '!', '~',\r\n '-', '+', '*', '/', '%', '<', '>', '~=');\r\n $o = 'block_formal_langs_c_token_operators';\r\n $this->utils->test_object($tests, $o);\r\n }\r\n\r\n // Tests various tokens\r\n public function test_various_tokens() {\r\n $tests = array('...' => array('...', 'ellipsis'),\r\n ';' => array(';', 'semicolon'),\r\n ',' => array(',', 'comma'),\r\n ':' => array(':', 'colon'),\r\n '(' => array('(', 'bracket'),\r\n ')' => array(')', 'bracket'),\r\n '{' => array('{', 'bracket'),\r\n '}' => array('}', 'bracket'),\r\n '<%' => array('{', 'bracket'),\r\n '%>' => array('}', 'bracket'),\r\n '[' => array('[', 'bracket'),\r\n ']' => array(']', 'bracket'),\r\n '<:' => array('[', 'bracket'),\r\n ':>' => array(']', 'bracket'),\r\n '?' => array('?', 'question_mark') );\r\n $keys = array_keys($tests);\r\n $lang = new block_formal_langs_language_c_language();\r\n $processedstring = $lang->create_from_string(implode(' ', $keys));\r\n $result = $processedstring->stream->tokens;\r\n $this->assertTrue(count($result) == count($tests), count($result) . ' tokens given in test ');\r\n for($i = 0; $i < count($result); $i++) {\r\n $object = 'block_formal_langs_c_token_' . $tests[$keys[$i]][1];\r\n $cvalue = $tests[$keys[$i]][0];\r\n $this->assertTrue(is_a($result[$i], $object), get_class($result[$i]) . ' class object is given at position '. $i);\r\n $value = $result[$i]->value();\r\n $this->assertTrue($value == $cvalue, $value. ' is given at position '. $i);\r\n }\r\n }\r\n\r\n // Tests floating point numbers\r\n public function test_fp_numbers() {\r\n $tests = array('22.22', '.22', '22.', '22.22E+1', '22.22E-1',\r\n '22.22f', '22.22F', '22.22l', '22.22L', '.22e-1f',\r\n '.22e-1F', '.22e-1l', '.22e-1L');\r\n $o = 'block_formal_langs_c_token_numeric';\r\n $this->utils->test_object($tests, $o);\r\n }\r\n // Tests preprocessor directives\r\n public function test_preprocessor() {\r\n $tests = array('#include <stdio.h>', '#include \"stdio.h\"', '#define',\r\n '#if', '#ifdef', '#elif', '#else', '#endif', '#', '##');\r\n $o = 'block_formal_langs_c_token_preprocessor';\r\n $this->utils->test_object($tests, $o);\r\n }\r\n\r\n // Tests singleline comments\r\n public function test_singleline_comment() {\r\n $lang = new block_formal_langs_language_c_language();\r\n $unixstring = \"// I love Linux!\\n\";\r\n $winstring = \"// I also use Windows! \\n\\r\";\r\n $macstring = \"// For MAC users \\r\";\r\n $endstring = \"// This is not error\";\r\n $strings = array($unixstring, $winstring, $macstring, $endstring);\r\n for ($i = 0; $i < count($strings); $i++) {\r\n $processedstring = $lang->create_from_string($strings[$i]);\r\n $result = $processedstring->stream->tokens;\r\n $this->assertTrue(count($result) == 1, count($result) . ' tokens given in test '. $i);\r\n $this->assertTrue($result[0]->value() == $strings[$i], $result[0]->value() . $strings[$i] . ' is parsed ');\r\n }\r\n }\r\n\r\n // Tests full character analysis\r\n public function test_character_analysis() {\r\n $lang = new block_formal_langs_language_c_language();\r\n $string = \"L'' 'a' 'A' '\\\\'' '\\\\a' '\\\\b' '\\\\f' '\\\\n' '\\\\r' '\\\\t' '\\\\v' '\\\\\\\"' '\\\\\\\\' '\\\\?' '\\\\1' '\\\\x1'\";\r\n $processedstring = $lang->create_from_string($string);\r\n $result = $processedstring->stream->tokens;\r\n $tokenvalues = array();\r\n for($i = 0; $i < count($result);$i++) {\r\n $tokenvalues[] = $result[$i]->value() . ' ' . get_class($result[$i]);\r\n }\r\n $this->assertTrue(count($result) == 16, count($result) . ' tokens given instead of 16: ' . implode(\"\\n\", $tokenvalues));\r\n $chars = array(\"L''\", \"'a'\", \"'A'\", \"'''\", \"'\\a'\", \"'\\b'\",\r\n \"'\\f'\", \"'\\n'\", \"'\\r'\", \"'\\t'\", \"'\\v'\", \"'\\\"'\",\r\n \"'\\\\'\", \"'?'\", \"'\\x1'\", \"'\\x1'\");\r\n for($i = 0; $i < count($result);$i++) {\r\n $token = $result[$i]->value();\r\n $char = $chars[$i];\r\n $this->assertTrue($token == $char, 'Incorrect parsed char at ' . $i . ': ' . $char );\r\n }\r\n }\r\n\r\n // Tests full string analysis\r\n public function test_string_analysis() {\r\n $lang = new block_formal_langs_language_c_language();\r\n $string = \"L\\\"\\\" \\\"aB\\\" \\\"A\\\" \\\"\\\\'\\\" \\\"\\\\a\\\" \\\"\\\\b\\\" \\\"\\\\f\\\" \\\"\\\\n\\\" \\\"\\\\r\\\" \\\"\\\\t\\\" \\\"\\\\v\\\" \\\"\\\\\\\"\\\" \\\"\\\\\\\\\\\" \\\"\\\\?\\\" \\\"\\\\1\\\" \\\"\\\\x1\\\"\";\r\n $processedstring = $lang->create_from_string($string);\r\n $result = $processedstring->stream->tokens;\r\n $tokenvalues = array();\r\n for($i = 0; $i < count($result);$i++) {\r\n $tokenvalues[] = $result[$i]->value() . ' ' . get_class($result[$i]);\r\n }\r\n $this->assertTrue(count($result) == 16, count($result) . ' tokens given instead of 16: ' . implode(\"\\n\", $tokenvalues));\r\n $chars = array(\"L\\\"\\\"\", \"\\\"aB\\\"\", \"\\\"A\\\"\", \"\\\"'\\\"\", \"\\\"\\a\\\"\", \"\\\"\\b\\\"\", \"\\\"\\f\\\"\",\r\n \"\\\"\\n\\\"\", \"\\\"\\r\\\"\", \"\\\"\\t\\\"\", \"\\\"\\v\\\"\", \"\\\"\\\"\\\"\",\r\n \"\\\"\\\\\\\"\", \"\\\"?\\\"\", \"\\\"\\x1\\\"\", \"\\\"\\x1\\\"\");\r\n\r\n for($i = 0; $i < count($result);$i++) {\r\n $token = $result[$i]->value();\r\n $char = $chars[$i];\r\n $this->assertTrue($token == $char, 'Incorrect parsed string at ' . $i . ': ' . $char );\r\n }\r\n }\r\n \r\n // Test a string and character analysis, when they happen in same string\r\n public function test_string_and_character() {\r\n $lang = new block_formal_langs_language_c_language();\r\n $processedstring = $lang->create_from_string('\"\\\"\" \\'\\\\\\'\\' ');\r\n $result = $processedstring->stream->tokens;\r\n $this->assertTrue( count($processedstring->stream->errors) == 0);\r\n $this->assertTrue(count($result) == 2, 'There must be two lexemes: string and char');\r\n $this->assertTrue($result[0]->value() == '\"\"\"',$result[0]->value());\r\n $this->assertTrue($result[1]->value() == '\\'\\'\\'',$result[1]->value() );\r\n }\r\n //Test numeric objects\r\n public function test_numeric() {\r\n $lang = new block_formal_langs_language_c_language();\r\n $processedstring = $lang->create_from_string(' .22 22. 22.22E+9 ');\r\n $result = $processedstring->stream->tokens;\r\n $this->assertTrue( count($processedstring->stream->errors) == 0);\r\n $this->assertTrue(count($result) == 3, 'There must be three lexemes');\r\n $this->assertTrue($result[0]->value() == '.22');\r\n $this->assertTrue($result[1]->value() == '22.');\r\n $this->assertTrue($result[2]->value() == '22.22E+9');\r\n }\r\n\r\n //Test comments. We wont use line comment, because in Moodle we can enter only one line\r\n public function test_comments() {\r\n $lang = new block_formal_langs_language_c_language();\r\n $processedstring = $lang->create_from_string('/* a comment */ ');\r\n $result = $processedstring->stream->tokens;\r\n $this->assertTrue( count($processedstring->stream->errors) == 0);\r\n $this->assertTrue(count($result) == 1, 'There must be one lexeme');\r\n $this->assertTrue($result[0]->value() == '/* a comment */');\r\n\r\n }\r\n\r\n public function test_multiline() {\r\n $lang = new block_formal_langs_language_c_language();\r\n $test = 'mad\r\n man\r\n ';\r\n $processedstring = $lang->create_from_string($test);\r\n $result = $processedstring->stream->tokens;\r\n $this->assertTrue(count($result) == 2);\r\n $this->assertTrue($result[0]->value() == 'mad');\r\n $this->assertTrue($result[1]->value() == 'man');\r\n }\r\n\r\n public function test_stringpos() {\r\n $lang = new block_formal_langs_language_c_language();\r\n $test = 'mad';\r\n $processedstring = $lang->create_from_string($test);\r\n $result = $processedstring->stream->tokens;\r\n $this->assertTrue(count($result) == 1);\r\n $this->assertTrue($result[0]->position()->stringstart() == 0);\r\n $this->assertTrue($result[0]->position()->stringend() == 2);\r\n }\r\n}",
"protected function processVariableInString(PHP_CodeSniffer_File $phpcsFile, $stackPtr)\n {\n //Do Nothing\n }",
"public function testGetLiteralLanguageMultilineString(): void\n {\n $literal = '\"This document is published by the Provenance Working Group (http://www.w3.org/2011/prov/wiki/Main_Page).\n\nIf you wish to make comments regarding this document, please send them to [email protected] (subscribe [email protected], archives http://lists.w3.org/Archives/Public/public-prov-comments/). All feedback is welcome.\"@en';\n\n $this->assertEquals('en', Util::getLiteralLanguage($literal));\n }",
"public function compileInsertString( $data );",
"public function testTextDynamicString()\n\t{\n\t\t$this->specify(\n\t\t\t\"dynamic do not return the correct string\",\n\t\t\tfunction () {\n\n\t\t\t\t$actual = PhTText::dynamic('{Hi|Hello}, my name is a Bob!');\n\t\t\t\texpect($actual)->notContains('{');\n\t\t\t\texpect($actual)->notContains('}');\n\n\t\t\t\texpect(preg_match('/^(Hi|Hello), my name is a Bob!$/', $actual))->equals(1);\n\t\t\t}\n\t\t);\n\t}",
"public function CheckIsLiteral($expression)\n\t {\n\t if(is_array($expression))\n\t {\n\t \tthrow new SpherusException(EXCEPTION_INVALID_ARGUMENT);\n\t }\n\t \n\t if(!is_a($expression, 'Spherus\\Components\\ORM\\Component\\SqlModel\\Base\\ORMEntity'))\n\t {\n\t return new ORMLiteral($expression);\n\t }\n\t else\n\t {\n\t return $expression;\n\t }\n\t }",
"function mSTRING(){\n try {\n $_type = GroupLexer::T_STRING;\n $_channel = GroupLexer::DEFAULT_TOKEN_CHANNEL;\n // ./src/php/Antlr/StringTemplate/Language/Group.g\n // ./src/php/Antlr/StringTemplate/Language/Group.g\n {\n $this->matchChar(34); \n // ./src/php/Antlr/StringTemplate/Language/Group.g\n //loop2:\n do {\n $alt2=5;\n $LA2_0 = $this->input->LA(1);\n\n if ( ($LA2_0==$this->getToken('92')) ) {\n $LA2_2 = $this->input->LA(2);\n\n if ( ($LA2_2==$this->getToken('34')) ) {\n $alt2=1;\n }\n else if ( (($LA2_2>=$this->getToken('0') && $LA2_2<=$this->getToken('33'))||($LA2_2>=$this->getToken('35') && $LA2_2<=$this->getToken('65535'))) ) {\n $alt2=2;\n }\n\n\n }\n else if ( ($LA2_0==$this->getToken('10')) ) {\n $alt2=3;\n }\n else if ( (($LA2_0>=$this->getToken('0') && $LA2_0<=$this->getToken('9'))||($LA2_0>=$this->getToken('11') && $LA2_0<=$this->getToken('33'))||($LA2_0>=$this->getToken('35') && $LA2_0<=$this->getToken('91'))||($LA2_0>=$this->getToken('93') && $LA2_0<=$this->getToken('65535'))) ) {\n $alt2=4;\n }\n\n\n switch ($alt2) {\n \tcase 1 :\n \t // ./src/php/Antlr/StringTemplate/Language/Group.g\n \t {\n \t $this->matchChar(92); \n \t $this->matchChar(34); \n\n \t }\n \t break;\n \tcase 2 :\n \t // ./src/php/Antlr/StringTemplate/Language/Group.g\n \t {\n \t $this->matchChar(92); \n \t if ( ($this->input->LA(1)>=$this->getToken('0') && $this->input->LA(1)<=$this->getToken('33'))||($this->input->LA(1)>=$this->getToken('35') && $this->input->LA(1)<=$this->getToken('65535')) ) {\n \t $this->input->consume();\n\n \t } else {\n \t $mse = new MismatchedSetException(null,$this->input);\n \t $this->recover($mse);\n \t throw $mse;}\n\n\n \t }\n \t break;\n \tcase 3 :\n \t // ./src/php/Antlr/StringTemplate/Language/Group.g\n \t {\n\n \t \t\t\t$msg = \"\\\\n in string\";\n \t \t\t$exception = new NoViableAltException(\"\", 0, 0, input);\n \t \t\t\tErrorManager::syntaxError(ErrorType::SYNTAX_ERROR, $this->getSourceName(), $exception, $msg);\n \t \t\t\t\n \t $this->matchChar(10); \n\n \t }\n \t break;\n \tcase 4 :\n \t // ./src/php/Antlr/StringTemplate/Language/Group.g\n \t {\n \t if ( ($this->input->LA(1)>=$this->getToken('0') && $this->input->LA(1)<=$this->getToken('9'))||($this->input->LA(1)>=$this->getToken('11') && $this->input->LA(1)<=$this->getToken('33'))||($this->input->LA(1)>=$this->getToken('35') && $this->input->LA(1)<=$this->getToken('91'))||($this->input->LA(1)>=$this->getToken('93') && $this->input->LA(1)<=$this->getToken('65535')) ) {\n \t $this->input->consume();\n\n \t } else {\n \t $mse = new MismatchedSetException(null,$this->input);\n \t $this->recover($mse);\n \t throw $mse;}\n\n\n \t }\n \t break;\n\n \tdefault :\n \t break 2;//loop2;\n }\n } while (true);\n\n $this->matchChar(34); \n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"public function testSingleQuotedStringSyntax() {\n\n\t\t$lexer = new Lexer();\n\t\t$stream = $lexer->scan(\" '\\\\'key\\\\\\\\' => va\\\\'l\\\\'ue\\\\'' \");\n\n\t\t$actual = $this->buildActualTokens($stream);\n\t\t$expected = array(\n\t\t\tarray(Lexer::T_VALUE => \"'\\\\'key\\\\\\\\' => va\\\\'l\\\\'ue\\\\''\")\n\t\t);\n\t\t$this->assertSame($expected, $actual);\n\t}"
] | [
"0.60626763",
"0.570541",
"0.5685181",
"0.5663224",
"0.55831784",
"0.5564544",
"0.55335176",
"0.53985167",
"0.53365564",
"0.5301772",
"0.5298888",
"0.52689594",
"0.5205698",
"0.52000284",
"0.5093595",
"0.50618094",
"0.5059298",
"0.5013198",
"0.50107557",
"0.5010705",
"0.50009954",
"0.49367377",
"0.49321324",
"0.49151587",
"0.49027383",
"0.4848647",
"0.48353285",
"0.48337054",
"0.48193276",
"0.4704144"
] | 0.68071693 | 0 |
Test setting api key scheme with apiKey type | public function testSetSchemeWithApiKeySchemeType()
{
$spec = file_get_contents(static::$swaggerUrlWithApiKeyAuth);
$decodedSpec = json_decode($spec);
$document = new Document($decodedSpec);
$scheme = $document->getSecuritySchemeOfType(SecurityScheme::TYPE_APIKEY);
$apiKey = new ApiKey('testApiKey', $scheme);
$this->assertEquals($apiKey->getScheme()->getType(), SecurityScheme::TYPE_APIKEY);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testSetSchemeWithNotApiKeySchemeType()\n {\n $this->setExpectedException(\\InvalidArgumentException::class);\n $spec = file_get_contents((static::$swaggerUrlWithBasicAuth));\n $decodedSpec = json_decode($spec);\n $document = new Document($decodedSpec);\n $scheme = $document->getSecuritySchemeOfType(SecurityScheme::TYPE_BASIC);\n new ApiKey('testApiKey', $scheme);\n }",
"public function testCreateApiKey()\n {\n $accept_language = 'es';\n $rq = new ApiKeyRequest();\n $result = self::$apiInstance->createApiKey($rq, $accept_language);\n $this->assertNotEmpty($result, 'expected not empty result');\n }",
"public function testInitLibWithKeyOption() {\n $key = 'fake.key:veryFake';\n $ably = new AblyRest( ['key' => $key ] );\n $this->assertTrue( $ably->auth->isUsingBasicAuth(), 'Expected basic auth to be used' );\n }",
"public function setApiKey($key);",
"public function testGetApiKey()\n {\n $accept_language = 'es';\n $result = self::$apiInstance->getApiKey('64625cc9f3e02c00163f5e4d', $accept_language);\n $this->assertNotEmpty($result, 'expected not empty result');\n }",
"function api_auth_key() {\n\tglobal $CONFIG;\n\n\t// check that an API key is present\n\t$api_key = get_input('api_key');\n\tif ($api_key == \"\") {\n\t\tthrow new APIException(elgg_echo('APIException:MissingAPIKey'));\n\t}\n\n\t// check that it is active\n\t$api_user = get_api_user($CONFIG->site_id, $api_key);\n\tif (!$api_user) {\n\t\t// key is not active or does not exist\n\t\tthrow new APIException(elgg_echo('APIException:BadAPIKey'));\n\t}\n\n\t// can be used for keeping stats\n\t// plugin can also return false to fail this authentication method\n\treturn elgg_trigger_plugin_hook('api_key', 'use', $api_key, true);\n}",
"public function getApikey();",
"public function setApiKeys($value);",
"protected function setApiKey() {\n\t\t$this->apikey = 'yL18TETUVQ7E9pgVb6JeV1erIYHAMcwe';\n\t}",
"public function getAPIKey(): string;",
"public function testApiKeyIsInferredFromTheEnvironment()\n {\n $this->assertSame(\n 'truthyvalue',\n $this->getPrivateProperty(new HerokuClient(), 'apiKey')\n );\n }",
"public function setApiKey( string $apiKey ): void;",
"public function testGetApiKeys()\n {\n $accept_language = 'es';\n $result = self::$apiInstance->getApiKeys($accept_language, null, 20);\n $this->assertNotEmpty($result, 'expected not empty result');\n }",
"static function setAPIKey($key) {\n self::$api_key = $key;\n }",
"public function testUpdateApiKey()\n {\n $accept_language = 'es';\n $rq = new ApiKeyUpdateRequest();\n $result = self::$apiInstance->updateApiKey('64625cc9f3e02c00163f5e4d', $accept_language, $rq);\n $this->assertNotEmpty($result, 'expected not empty result');\n }",
"private function check_valid_api() {\n\t\n\t\tglobal $fs_schema;\n\t\t\n\t\t$settings = $fs_schema->data->settings();\n\t\t\n\t\tswitch ( $settings[ 'fs_schema_integration' ] ) {\n\t\t\n\t\t\tcase 'BRP':\n\t\t\t\n\t\t\t\t// ..1.2..\n\t\t\t\tupdate_option( 'fs_schema_valid_key', strpos ( base64_decode ('Li5lYzY1YTVlNTZkZmQ0OTA4YjBhOTI4NDJkOThhMGRiYy4xYTA3ZmNlMWFjMjI0YTY2OWRjYWUwMjQxMmJjZDA4NC42YThhYTRjMWM2ZDg0ZTNmOWQxN2NlZDJhZTViZWM5My4zOTdmZGFlYzAwMGM0ZTMyODJiYzI1ODVkYjVmYTJiZS40OWY0YzhkNmI4OTg0NGEzYmJiMmEzYTgwMDg1NjE4Yi5lODVjMDYzYTI1MjQ0MmNjOTQ1MmIzMTA1MzM1NDkzZC4zZGI2NTQ4ODIxODM0NTEzYjc2MDZkZjBlYTIzZDQ2MS4u'), '.'.$settings[ 'fs_booking_bpi_api_key' ].'.' ) );\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\n\t\t\tcase 'PROFIT':\n\t\t\t\n\t\t\t\t// ..1.2..\n\t\t\t\tupdate_option( 'fs_schema_valid_key', strpos ( base64_decode ('Li4xNDM3LjEzODIuMTQ4MC4xMzQyLi4='), '.'.$settings[ 'fs_booking_profit_organization_unit' ].'.' ) );\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t}\t\n\t}",
"public function getApiKey(): string;",
"public function getApiKey(): string;",
"function xendit_for_give_get_api_key() {\n if (xendit_for_give_is_test_mode()) {\n return give_get_option('xendit_for_give_xendit_api_key_test');\n } else {\n return give_get_option('xendit_for_give_xendit_api_key_live');\n }\n}",
"public static function setAPIKey()\n {\n $sandbox_mode = (int)Configuration::get('PAYPLUG_SANDBOX_MODE');\n $valid_key = null;\n if ($sandbox_mode) {\n $valid_key = Configuration::get('PAYPLUG_TEST_API_KEY');\n } else {\n $valid_key = Configuration::get('PAYPLUG_LIVE_API_KEY');\n }\n\n return $valid_key;\n }",
"private function setApiKey()\n {\n $this->setQuery('api_key', $this->api_key);\n }",
"private function is_the_right_api_key_entered() {\n\t\t$api_used = apply_filters( 'toolset_maps_get_api_used', '' );\n\n\t\tif ( Toolset_Addon_Maps_Common::API_GOOGLE === $api_used ) {\n\t\t\t$key = apply_filters( 'toolset_filter_toolset_maps_get_api_key', '' );\n\t\t} else {\n\t\t\t$key = apply_filters( 'toolset_filter_toolset_maps_get_azure_api_key', '' );\n\t\t}\n\t\treturn !empty( $key );\n\t}",
"public function testInitLibWithKeyString() {\n $key = 'fake.key:veryFake';\n $ably = new AblyRest( $key );\n $this->assertTrue( $ably->auth->isUsingBasicAuth(), 'Expected basic auth to be used' );\n }",
"public function getApiKey();",
"public function getApiKey();",
"public function getApiKey();",
"public function verify_api_key() {\n\t\t// Get the API key sent\n\t\t$api_key = $_REQUEST['api_key'];\n\n\t\t// Fetch the service name for this API key\n\t\t$mysqli = $this->mysqli;\n\t\t$query = \"SELECT service FROM api_keys WHERE api_key = '$api_key';\";\n\t\t$result = $mysqli->query( $query );\n\t\t$row = $result->fetch_assoc();\n\n\t\t// Check the service which this API key belongs to with the service for which the current API call was made for\n\t\tif ( $this->service == $row['service'] )\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}",
"protected function verifyApiKey() {\n\t\tif (empty($this->apiKey)) {\n\t\t\treturn true;\n\t\t}\n\t\t// no key exists\n\t\tif (!isset($_REQUEST[$this->apiKeyParameter])) {\n\t\t\tthrow new UnknownException();\n\t\t}\n\t\t// key not valid\n\t\tif ($this->apiKey != $_REQUEST[$this->apiKeyParameter]) {\n\t\t\tthrow new UnknownException();\n\t\t}\n\t\treturn true;\n\t}",
"public function testAuthenticatedUserApiKeys()\n {\n TestUtil::setupCassette('users/authenticatedUserApiKeys.yml');\n\n $user = self::$client->user->retrieveMe();\n\n $apiKeys = self::$client->user->apiKeys($user->id);\n\n $this->assertContainsOnlyInstancesOf(ApiKey::class, $apiKeys);\n }",
"public function setapi_key($value)\n {\n // TODO: Implement setapi_key() method.\n }"
] | [
"0.6921923",
"0.6789623",
"0.6696798",
"0.6685925",
"0.66560143",
"0.658097",
"0.6557031",
"0.65450716",
"0.6540478",
"0.64701205",
"0.64389926",
"0.6428919",
"0.6417293",
"0.6394044",
"0.63836163",
"0.6367772",
"0.6359979",
"0.6359979",
"0.6309733",
"0.6306554",
"0.6304698",
"0.62941754",
"0.6277263",
"0.6260935",
"0.6260935",
"0.6260935",
"0.615062",
"0.6133485",
"0.6109576",
"0.61034226"
] | 0.76926845 | 0 |
Test setting api key scheme with not apiKey type | public function testSetSchemeWithNotApiKeySchemeType()
{
$this->setExpectedException(\InvalidArgumentException::class);
$spec = file_get_contents((static::$swaggerUrlWithBasicAuth));
$decodedSpec = json_decode($spec);
$document = new Document($decodedSpec);
$scheme = $document->getSecuritySchemeOfType(SecurityScheme::TYPE_BASIC);
new ApiKey('testApiKey', $scheme);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testSetSchemeWithApiKeySchemeType()\n {\n $spec = file_get_contents(static::$swaggerUrlWithApiKeyAuth);\n $decodedSpec = json_decode($spec);\n $document = new Document($decodedSpec);\n $scheme = $document->getSecuritySchemeOfType(SecurityScheme::TYPE_APIKEY);\n $apiKey = new ApiKey('testApiKey', $scheme);\n\n $this->assertEquals($apiKey->getScheme()->getType(), SecurityScheme::TYPE_APIKEY);\n }",
"private function is_the_right_api_key_entered() {\n\t\t$api_used = apply_filters( 'toolset_maps_get_api_used', '' );\n\n\t\tif ( Toolset_Addon_Maps_Common::API_GOOGLE === $api_used ) {\n\t\t\t$key = apply_filters( 'toolset_filter_toolset_maps_get_api_key', '' );\n\t\t} else {\n\t\t\t$key = apply_filters( 'toolset_filter_toolset_maps_get_azure_api_key', '' );\n\t\t}\n\t\treturn !empty( $key );\n\t}",
"private function check_valid_api() {\n\t\n\t\tglobal $fs_schema;\n\t\t\n\t\t$settings = $fs_schema->data->settings();\n\t\t\n\t\tswitch ( $settings[ 'fs_schema_integration' ] ) {\n\t\t\n\t\t\tcase 'BRP':\n\t\t\t\n\t\t\t\t// ..1.2..\n\t\t\t\tupdate_option( 'fs_schema_valid_key', strpos ( base64_decode ('Li5lYzY1YTVlNTZkZmQ0OTA4YjBhOTI4NDJkOThhMGRiYy4xYTA3ZmNlMWFjMjI0YTY2OWRjYWUwMjQxMmJjZDA4NC42YThhYTRjMWM2ZDg0ZTNmOWQxN2NlZDJhZTViZWM5My4zOTdmZGFlYzAwMGM0ZTMyODJiYzI1ODVkYjVmYTJiZS40OWY0YzhkNmI4OTg0NGEzYmJiMmEzYTgwMDg1NjE4Yi5lODVjMDYzYTI1MjQ0MmNjOTQ1MmIzMTA1MzM1NDkzZC4zZGI2NTQ4ODIxODM0NTEzYjc2MDZkZjBlYTIzZDQ2MS4u'), '.'.$settings[ 'fs_booking_bpi_api_key' ].'.' ) );\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\n\t\t\tcase 'PROFIT':\n\t\t\t\n\t\t\t\t// ..1.2..\n\t\t\t\tupdate_option( 'fs_schema_valid_key', strpos ( base64_decode ('Li4xNDM3LjEzODIuMTQ4MC4xMzQyLi4='), '.'.$settings[ 'fs_booking_profit_organization_unit' ].'.' ) );\n\t\t\t\t\n\t\t\t\tbreak;\n\t\t}\t\n\t}",
"public function testInitLibWithKeyOption() {\n $key = 'fake.key:veryFake';\n $ably = new AblyRest( ['key' => $key ] );\n $this->assertTrue( $ably->auth->isUsingBasicAuth(), 'Expected basic auth to be used' );\n }",
"public function testApiKeyIsInferredFromTheEnvironment()\n {\n $this->assertSame(\n 'truthyvalue',\n $this->getPrivateProperty(new HerokuClient(), 'apiKey')\n );\n }",
"function api_auth_key() {\n\tglobal $CONFIG;\n\n\t// check that an API key is present\n\t$api_key = get_input('api_key');\n\tif ($api_key == \"\") {\n\t\tthrow new APIException(elgg_echo('APIException:MissingAPIKey'));\n\t}\n\n\t// check that it is active\n\t$api_user = get_api_user($CONFIG->site_id, $api_key);\n\tif (!$api_user) {\n\t\t// key is not active or does not exist\n\t\tthrow new APIException(elgg_echo('APIException:BadAPIKey'));\n\t}\n\n\t// can be used for keeping stats\n\t// plugin can also return false to fail this authentication method\n\treturn elgg_trigger_plugin_hook('api_key', 'use', $api_key, true);\n}",
"public function testGetApiKey()\n {\n $accept_language = 'es';\n $result = self::$apiInstance->getApiKey('64625cc9f3e02c00163f5e4d', $accept_language);\n $this->assertNotEmpty($result, 'expected not empty result');\n }",
"public function testCreateApiKey()\n {\n $accept_language = 'es';\n $rq = new ApiKeyRequest();\n $result = self::$apiInstance->createApiKey($rq, $accept_language);\n $this->assertNotEmpty($result, 'expected not empty result');\n }",
"protected function verifyApiKey() {\n\t\tif (empty($this->apiKey)) {\n\t\t\treturn true;\n\t\t}\n\t\t// no key exists\n\t\tif (!isset($_REQUEST[$this->apiKeyParameter])) {\n\t\t\tthrow new UnknownException();\n\t\t}\n\t\t// key not valid\n\t\tif ($this->apiKey != $_REQUEST[$this->apiKeyParameter]) {\n\t\t\tthrow new UnknownException();\n\t\t}\n\t\treturn true;\n\t}",
"public static function setAPIKey()\n {\n $sandbox_mode = (int)Configuration::get('PAYPLUG_SANDBOX_MODE');\n $valid_key = null;\n if ($sandbox_mode) {\n $valid_key = Configuration::get('PAYPLUG_TEST_API_KEY');\n } else {\n $valid_key = Configuration::get('PAYPLUG_LIVE_API_KEY');\n }\n\n return $valid_key;\n }",
"public function verify_api_key() {\n\t\t// Get the API key sent\n\t\t$api_key = $_REQUEST['api_key'];\n\n\t\t// Fetch the service name for this API key\n\t\t$mysqli = $this->mysqli;\n\t\t$query = \"SELECT service FROM api_keys WHERE api_key = '$api_key';\";\n\t\t$result = $mysqli->query( $query );\n\t\t$row = $result->fetch_assoc();\n\n\t\t// Check the service which this API key belongs to with the service for which the current API call was made for\n\t\tif ( $this->service == $row['service'] )\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}",
"public function getApikey();",
"public function getAPIKey(): string;",
"private function validateApiKey(): bool\n {\n if (!$this->apiKey) {\n throw new AcoustException(\n 'AcoustException: You have not provided your AcoustID.org application API key<br>\n You can do so by calling <b><i><u>acoust::setApiKey($key)</u></i></b>\n or by adding it as the second argument to the constructor<br>\n You can get an application API key from\n <a href=\\'https://acoustid.org\\' target=\\'_blank\\'>acoustid.org</a><br>'\n );\n } else {\n return true;\n }\n }",
"public function it_returns_null_if_no_api_key_is_set()\n {\n\n }",
"public function setApiKeys($value);",
"function xendit_for_give_get_api_key() {\n if (xendit_for_give_is_test_mode()) {\n return give_get_option('xendit_for_give_xendit_api_key_test');\n } else {\n return give_get_option('xendit_for_give_xendit_api_key_live');\n }\n}",
"public function testGetApiKeys()\n {\n $accept_language = 'es';\n $result = self::$apiInstance->getApiKeys($accept_language, null, 20);\n $this->assertNotEmpty($result, 'expected not empty result');\n }",
"public function getApiKey(): string;",
"public function getApiKey(): string;",
"public function setApiKey($key);",
"public function validateAdapterApiKey(string $api_key): bool\n {\n return hash_equals($api_key, $this->adapter_api_key ?? '');\n }",
"public function validateAdapterApiKey(string $api_key): bool\n {\n return hash_equals($api_key, $this->adapter_api_key ?? '');\n }",
"public function testInitLibWithKeyString() {\n $key = 'fake.key:veryFake';\n $ably = new AblyRest( $key );\n $this->assertTrue( $ably->auth->isUsingBasicAuth(), 'Expected basic auth to be used' );\n }",
"protected function setApiKey() {\n\t\t$this->apikey = 'yL18TETUVQ7E9pgVb6JeV1erIYHAMcwe';\n\t}",
"public function setApiKey( string $apiKey ): void;",
"static function setAPIKey($key) {\n self::$api_key = $key;\n }",
"private static function _set_api_key(&$data) {\r\n\t\tif(array_key_exists('key',$data)) self::$api_key = $data['key'];\r\n\t\tif((count($data) == 0 || is_null(self::$api_key))&& defined('MANDRILL_API_KEY')) self::$api_key = MANDRILL_API_KEY;\r\n\t\t\r\n\t\tif(!isset(self::$api_key)) throw new Exception('API Key must be set.');\r\n\t}",
"public function efs_check_apikey() {\n\t\tunset($this->last_error, $this->org_name, $this->org_id);\n\t\tif ($this->apikey == null || empty($this->apikey))\n\t\t\treturn false;\n\n\t\ttry {\n\t\t\t$res = $this->request_efs('checkapikey');\n\t\t\t// parse response\n\t\t\tif ($res->status == 'OK') {\n\t\t\t\t$this->org_name = $res->orga;\n\t\t\t\t$this->org_id = $res->hiorg_org_id;\n\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\t$this->last_error = $res->fehler;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch (\\Exception $ex) {\n\t\t\t$this->last_error = $ex->getMessage();\n\t\t\treturn false;\n\t\t}\n\t}",
"static function add_issuu_api_key(): void {\r\n\t\tself::add_acf_field(self::issuu_api_key, [\r\n\t\t\t'label' => 'Issuu API key',\r\n\t\t\t'type' => 'text',\r\n\t\t\t'instructions' => 'N.B. At the moment this appears to be unused.',\r\n\t\t\t'conditional_logic' => '',\r\n\t\t\t'wrapper' => [\r\n\t\t\t\t'width' => '50',\r\n\t\t\t\t'class' => '',\r\n\t\t\t\t'id' => '',\r\n\t\t\t],\r\n\t\t\t'readonly' => 0\r\n\t\t]);\r\n\t}"
] | [
"0.73095006",
"0.68533814",
"0.66767526",
"0.656975",
"0.6559345",
"0.64799297",
"0.64755857",
"0.6449747",
"0.6437173",
"0.6402419",
"0.63542914",
"0.6303133",
"0.6297845",
"0.6287774",
"0.6278571",
"0.62502766",
"0.6228574",
"0.62168515",
"0.6196773",
"0.6196773",
"0.6187202",
"0.618311",
"0.618311",
"0.6136658",
"0.61117727",
"0.6029001",
"0.5994061",
"0.59913397",
"0.59718394",
"0.5964392"
] | 0.70732564 | 1 |
Removes all global middleware defined for the App, if possible. Note that this requires the addition of a removeGlobalMiddleware() method on the App\Http\Kernel class. | protected function removeGlobalMiddleware()
{
if (method_exists($this->kernel, 'removeGlobalMiddleware')) {
$this->kernel->removeGlobalMiddleware();
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getGlobalMiddleware()\n {\n $middleware = $this->global ?: array_values(array_filter([\n $this->trustHosts ? \\Illuminate\\Http\\Middleware\\TrustHosts::class : null,\n \\Illuminate\\Http\\Middleware\\TrustProxies::class,\n \\Illuminate\\Http\\Middleware\\HandleCors::class,\n \\Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance::class,\n \\Illuminate\\Http\\Middleware\\ValidatePostSize::class,\n \\Illuminate\\Foundation\\Http\\Middleware\\TrimStrings::class,\n \\Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull::class,\n ]));\n\n $middleware = array_map(function ($middleware) {\n return isset($this->replacements[$middleware])\n ? $this->replacements[$middleware]\n : $middleware;\n }, $middleware);\n\n return array_values(array_filter(\n array_diff(\n array_unique(array_merge($this->prepends, $middleware, $this->appends)),\n $this->removals\n )\n ));\n }",
"protected function clearGlobals()\n {\n if (false === config('app.globals',false))\n {\n $_SERVER = [];\n $_ENV = [];\n }\n }",
"protected function getGlobalApiMiddleware()\n {\n return $this->filterMiddlewareForGlobal($this->getConfiguredApiMiddleware());\n }",
"protected function getGlobalWebMiddleware()\n {\n return $this->filterMiddlewareForGlobal($this->getConfiguredWebMiddleware());\n }",
"public function unregisterPreRequestMiddleware(IPreRequestMiddleware $middleware): self;",
"protected function destroyApplication(): void\n {\n $_SERVER['HTTP_USER_AGENT'] = null;\n $_SERVER['REQUEST_METHOD'] = 'GET';\n\n Yii::$app = null;\n }",
"public function removeApplicationTweaks(): void\n {\n static::$server->stash(['class' => static::class]);\n }",
"public function boot()\n {\n /**\n * Remove one or more '@' if they're at the\n * beginning of the parameter.\n */\n Route::bind('channel', function($channel) {\n return $this->removeAtSigns($channel);\n });\n\n Route::bind('user', function($user) {\n return $this->removeAtSigns($user);\n });\n\n $this->routes(function () {\n Route::middleware('web')\n ->namespace($this->namespace)\n ->group(base_path('routes/web.php'));\n\n Route::prefix('api')\n ->middleware('api')\n ->namespace($this->namespace)\n ->group(base_path('routes/api.php'));\n });\n\n parent::boot();\n }",
"protected function filterMiddlewareForGlobal(array $middleware)\n {\n return array_filter(\n $middleware,\n function () {\n $key = func_get_arg(1);\n return is_int($key);\n },\n ARRAY_FILTER_USE_BOTH\n );\n }",
"public static function clearApiRoutes() {\n\t\tstatic::$apiRoutes = [];\n\t}",
"protected function destroyApplication()\n {\n Yii::$app = null;\n }",
"public static function resetGlobalState()\n {\n foreach (self::$module_loggers as $logger)\n $logger->removeLogWriters();\n self::$module_loggers = [];\n self::$accept_mode = self::MODE_ACCEPT_MOST_SPECIFIC;\n }",
"protected function cleanGlobals(): void\n {\n $commonGlobals = [\n 'post',\n 'wp_query',\n ];\n\n foreach ($commonGlobals as $var) {\n if (isset($GLOBALS[$var])) {\n unset($GLOBALS[$var]);\n }\n }\n }",
"protected function registerRouteMiddleware()\n {\n // register global middleware\n// foreach ($this->routeMiddleware as $middleware) {\n// app(\\Illuminate\\Contracts\\Http\\Kernel::class)->pushMiddleware($middleware);\n// }\n\n // register route middleware.\n foreach ($this->routeMiddleware as $key => $middleware) {\n app('router')->aliasMiddleware($key, $middleware);\n }\n\n foreach ($this->middlewareGroups as $key => $middleware) {\n app('router')->middlewareGroup($key, $middleware);\n }\n }",
"function clean_up_global_scope() {\n\t\tglobal $wp_scripts, $wp_styles;\n\t\tparent::clean_up_global_scope();\n\t\t$wp_scripts = null;\n\t\t$wp_styles = null;\n\t}",
"protected function resetGlobalSettings()\n {\n if (Yii::$app instanceof \\yii\\web\\Application) {\n Yii::$app->assetManager->bundles = [];\n }\n }",
"public function boot()\n {\n parent::boot();\n\n $decorator = new RequestMiddleware($this->app);\n $decorator->addRequestMiddlewareToBeginning();\n\n // Because Lumen sets the route resolver at a very weird point we're going to\n // have to use reflection whenever the request instance is rebound to\n // set the route resolver to get the current route.\n $this->app->rebinding(IlluminateRequest::class, static function ($app, $request) {\n $request->setRouteResolver(static function () use ($app) {\n $reflection = new ReflectionClass($app);\n\n $property = $reflection->getProperty('currentRoute');\n $property->setAccessible(true);\n\n return $property->getValue($app);\n });\n\n $request->setUserResolver(static function () use ($app) {\n $app->make('api.auth')->user();\n });\n });\n\n $this->app->afterResolving(ValidatesWhenResolved::class, static function ($resolved) {\n $resolved->validateResolved();\n });\n\n $this->app->resolving(FormRequest::class, function (FormRequest $request, Application $app) {\n $this->initializeRequest($request, $app['request']);\n\n $request->setContainer($app)->setRedirector($app->make(Redirector::class));\n });\n\n $this->app->routeMiddleware([\n 'api.auth' => Auth::class,\n 'api.throttle' => RateLimit::class,\n 'api.controllers' => PrepareController::class,\n ]);\n }",
"protected static function middleware()\n {\n return config('apidoc.laravel.middleware', []);\n }",
"protected function destroyApplication()\n {\n if (Yii::$app && Yii::$app->has('session', true)) {\n Yii::$app->session->destroy();\n Yii::$app->session->close();\n }\n\n Yii::$app = null;\n }",
"protected function destroyWebApplication()\n {\n if (\\Yii::$app && \\Yii::$app->has('session', true)) {\n \\Yii::$app->session->close();\n }\n \\Yii::$app = null;\n }",
"public static function destroy()\n {\n Loader::tracer('destroy global arrays', debug_backtrace(), '004396');\n\n unset($_GET);\n unset($_POST);\n\n $_COOKIE = [];\n $_SESSION = [];\n\n unset($_FILES);\n unset($_REQUEST);\n }",
"function clean_up_global_scope() {\n\t\tglobal $wp_customize;\n\t\t$wp_customize = null;\n\t\tparent::clean_up_global_scope();\n\t}",
"protected function resetGlobalSettings()\n\t{\n\t\tif (Yii::$app instanceof \\yii\\web\\Application) {\n\t\t\tYii::$app->assetManager->bundles = [];\n\t\t}\n}",
"public function gatherMiddleware()\n {\n if (! is_null($this->computedMiddleware)) {\n return $this->computedMiddleware;\n }\n\n $this->computedMiddleware = [];\n\n return $this->computedMiddleware = Router::uniqueMiddleware(array_merge(\n $this->middleware(), $this->controllerMiddleware()\n ));\n }",
"public function boot()\n {\n if ($this->isLumen()) {\n $this->app->middleware([HandleCheck::class]);\n } else {\n //$this->generateKey();\n\n $this->publishes([$this->configPath() => config_path('api-secret.php')]);\n\n /** @var \\Illuminate\\Foundation\\Http\\Kernel $kernel */\n $kernel = $this->app->make(Kernel::class);\n\n $kernel->pushMiddleware(HandleApiSecret::class);\n\n // When the HandleCors middleware is not attached globally, add the PreflightCheck\n //if ( !$kernel->hasMiddleware(HandleApiSecret::class)) {\n // $kernel->prependMiddleware(HandleCheck::class);\n //}\n }\n }",
"public function boot()\n {\n if (! $this->routesAreCached()) {\n Route::prefix('api')\n ->middleware(config('catch.middleware_group'))\n ->group(function ($router) {\n $routerRegister = new RouteFileRegistrar($router);\n foreach (Module::all() as $module) {\n if ($module['enable'] ?? false) {\n if (CatchAdmin::isModulePathExist($module['name']) && File::exists(CatchAdmin::getModuleRoutePath($module['name']))) {\n $routerRegister->register(CatchAdmin::getModuleRoutePath($module['name']));\n }\n }\n }\n });\n }\n }",
"public function boot()\n {\n Route::bind('category', function ($value) {\n if (Route::currentRouteName() === 'api.category.restore' || Route::currentRouteName() === 'api.category.delete-permanently') {\n return Category::onlyTrashed()->find($value);\n }\n\n return Category::find($value);\n });\n\n Route::bind('education', function ($value) {\n if (Route::currentRouteName() === 'api.education.restore' || Route::currentRouteName() === 'api.education.delete-permanently') {\n return Education::onlyTrashed()->find($value);\n }\n\n return Education::find($value);\n });\n\n Route::bind('experience', function ($value) {\n if (Route::currentRouteName() === 'api.experience.restore' || Route::currentRouteName() === 'api.experience.delete-permanently') {\n return Experience::onlyTrashed()->find($value);\n }\n\n return Experience::find($value);\n });\n\n Route::bind('project', function ($value) {\n if (Route::currentRouteName() === 'api.project.restore' || Route::currentRouteName() === 'api.project.delete-permanently') {\n return Project::onlyTrashed()->find($value);\n }\n\n return Project::find($value);\n });\n\n Route::bind('tag', function ($value) {\n if (Route::currentRouteName() === 'api.tag.restore' || Route::currentRouteName() === 'api.tag.delete-permanently') {\n return Tag::onlyTrashed()->find($value);\n }\n\n return Tag::find($value);\n });\n\n $this->configureRateLimiting();\n\n $this->routes(function () {\n Route::middleware('api')\n ->namespace($this->namespace)\n ->group(base_path('routes/api.php'));\n });\n }",
"public function removeHandlerGroups(){\n foreach($this->getHandlerGroups() as $handlerKey){\n $this->removeHandlerGroup($handlerKey);\n }\n }",
"public function boot()\n {\n $this->app[Kernel::class]->prependMiddleware(ApiRequest::class);\n\n $this->registerPublishing();\n\n $this->registerRequestMacros();\n\n $this->registerResponseMacros();\n }",
"protected function destroyApplication()\n {\n \\Yii::$app = null;\n \\Yii::$container = new Container();\n }"
] | [
"0.6720589",
"0.5945541",
"0.5929122",
"0.57899344",
"0.5610797",
"0.5563191",
"0.5524616",
"0.5379324",
"0.5272111",
"0.5261032",
"0.5216953",
"0.51740295",
"0.51648057",
"0.5136093",
"0.508267",
"0.5073964",
"0.5066923",
"0.50577414",
"0.5046199",
"0.5022302",
"0.5019353",
"0.50190103",
"0.49979118",
"0.4980234",
"0.49765152",
"0.49558547",
"0.49539268",
"0.49518213",
"0.49462184",
"0.49346122"
] | 0.73002005 | 0 |
API Registers global middleware for the CMS API. | protected function registerCmsApiGroupMiddleware()
{
$this->router->middlewareGroup($this->getConfiguredApiGroupName(), []);
foreach ($this->getGlobalApiMiddleware() as $middleware) {
// Don't add if the middleware is already globally enabled in the kernel
if ($this->kernel->hasMiddleware($middleware)) {
// @codeCoverageIgnoreStart
continue;
// @codeCoverageIgnoreEnd
}
$this->router->pushMiddlewareToGroup($this->getConfiguredApiGroupName(), $middleware);
}
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function middleware()\n {\n // TODO: Implement middleware() method.\n }",
"abstract protected function addAppMiddleware();",
"protected function getGlobalApiMiddleware()\n {\n return $this->filterMiddlewareForGlobal($this->getConfiguredApiMiddleware());\n }",
"public function addMiddleware()\n {\n //$this->middlewareQueue->addMiddleware('AuthMiddleware', '\\Lib\\Framework\\Http\\Middleware\\\\');\n }",
"protected function registerMiddleware()\n\t{\n\t\t$kernel = $this->app->make('Illuminate\\Contracts\\Http\\Kernel');\t\n\t\t$middlewares = config('radan.middleware');\n\t\tforeach($middlewares as $middleware)\n\t\t{\n\t\t\t$kernel->pushMiddleware($middleware);\n\t\t}\t\t\n\t}",
"public function registerMiddleware()\n {\n if (config('core.types.enable')) {\n $themeTypes = config('core.types.middleware');\n foreach ($themeTypes as $middleware => $themeName) {\n $this->app['router']->aliasMiddleware($middleware, '\\Modules\\Core\\Http\\Middleware\\RouteMiddleware:'.$themeName);\n }\n }\n }",
"protected static function middleware()\n {\n return config('apidoc.laravel.middleware', []);\n }",
"public function add(string $middleware): void;",
"protected function getConfiguredApiMiddleware()\n {\n return $this->core->apiConfig('middleware.load', []);\n }",
"public function middlewares()\n {\n }",
"protected function registerMiddleware()\n {\n foreach ($this->routeMiddleware as $key => $middleware) {\n $this->router->middleware($key, $middleware);\n }\n }",
"protected static function middleware(){\r\n\r\n if (self::$middleware == null){\r\n self::$middleware = self::$controller->middleware;\r\n }\r\n\r\n return Kernel::middleware(self::$middleware)->handle();\r\n \r\n }",
"public function __construct()\n {\n $this->middleware('cms');\n }",
"public function __construct()\n {\n $this->middleware('cms');\n }",
"public function setupMiddleware()\n {\n $this->middleware('antares.auth');\n $this->middleware('antares.can:antares/ui-components::ui-component-update', ['only' => ['update', 'edit'],]);\n }",
"private function addMiddleware()\n\t{\n\t\t$kernel = file_get_contents(getcwd() . '/app/Http/Kernel.php');\n\n\t\tif(strstr($kernel, \"'language' => \\\\deArgonauten\\\\TransLaravel\\\\Http\\\\Middleware\\\\LanguageURL::class,\")) {\n\t\t\t$this->warn(\"Middleware is already installed.\");\n\t\t\treturn;\n\t\t}\n\n\t\t$regex = '/protected \\$routeMiddleware[\\S|\\s]*\\[([\\S|\\s]*)^[\\s]*\\]\\;$/m';\n\t\t$return = preg_replace($regex, \"protected \\$routeMiddleWare = [\\n\\t$1\\t\\t'language' => \\\\deArgonauten\\\\TransLaravel\\\\Http\\\\Middleware\\\\LanguageURL::class,\\n\\t];\", $kernel);\n\t\t\n\t\tfile_put_contents(getcwd() . '/app/Http/Kernel.php', $return);\n\t}",
"protected function registerMiddlewareGroups()\n {\n if (property_exists($this, 'middlewareGroups')) {\n foreach ($this->middlewareGroups as $key => $middleware) {\n $this->router->middlewareGroup($key, $middleware);\n }\n }\n }",
"public function __construct()\n {\n $this->middleware('api');\n }",
"public function __construct()\n {\n $this->middleware('api');\n }",
"public function __construct()\n {\n $this->middleware('api');\n }",
"public function __construct()\n {\n $this->middleware('api');\n }",
"public function __construct()\n {\n $this->middleware(['api']);\n }",
"function authMiddleware(){\n echo \"Middleware on action\";\n}",
"public static function middleware(): array\n {\n return [];\n }",
"private function middlewareHandler()\n {\n if ($this->getDI()->has('middleware_aliases') === false) {\n return;\n }\n\n # get all the middlewares in the config/app.php\n $middleware = new Middleware(config()->app->middlewares);\n\n $instances = [];\n $aliases = $this->getDI()->get('middleware_aliases')->toArray();\n\n foreach ($aliases as $alias) {\n $class = $middleware->get($alias);\n $instances[] = new $class;\n }\n\n # register all the middlewares\n $command_bus = new CommandBus($instances);\n $command_bus->handle($this->request);\n }",
"protected function registerApiRouteMiddleware()\n {\n foreach ($this->getApiRouteMiddleware() as $key => $middleware) {\n $this->router->aliasMiddleware($key, $middleware);\n }\n\n return $this;\n }",
"protected function middleware()\n\t{\n\t\treturn ['auth'];\n\t}",
"protected function registerRouteMiddleware()\n {\n // register global middleware\n// foreach ($this->routeMiddleware as $middleware) {\n// app(\\Illuminate\\Contracts\\Http\\Kernel::class)->pushMiddleware($middleware);\n// }\n\n // register route middleware.\n foreach ($this->routeMiddleware as $key => $middleware) {\n app('router')->aliasMiddleware($key, $middleware);\n }\n\n foreach ($this->middlewareGroups as $key => $middleware) {\n app('router')->middlewareGroup($key, $middleware);\n }\n }",
"protected function middleware()\n {\n return [];\n }",
"protected function registerMiddleware()\n {\n $router = $this->app['router'];\n $router->middleware('jwt', JwtMiddleware::class);\n }"
] | [
"0.6492493",
"0.63585913",
"0.635613",
"0.6251112",
"0.6236013",
"0.62014204",
"0.6132753",
"0.6094779",
"0.6075893",
"0.6049306",
"0.60252357",
"0.60153574",
"0.5989407",
"0.5989407",
"0.5978226",
"0.5955223",
"0.5939231",
"0.5919336",
"0.5919336",
"0.5919336",
"0.5919336",
"0.59101623",
"0.58856416",
"0.5855749",
"0.58529747",
"0.5852281",
"0.58391607",
"0.5809346",
"0.57863533",
"0.57812816"
] | 0.6969136 | 0 |
Returns API middleware defined as either keyvalue pairs or strings. | protected function getConfiguredApiMiddleware()
{
return $this->core->apiConfig('middleware.load', []);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getMiddleware(): ?array;",
"protected function getApiRouteMiddleware()\n {\n return $this->filterMiddlewareForRoute($this->getConfiguredApiMiddleware());\n }",
"protected static function middleware()\n {\n return config('apidoc.laravel.middleware', []);\n }",
"protected function middleware()\n\t{\n\t\treturn ['auth'];\n\t}",
"public function middleware()\n {\n return $this->_middleware;\n }",
"function getMiddlewareName()\n {\n return 'Middleware';\n }",
"public function getMiddleware()\n {\n return $this->middleware;\n }",
"public function getMiddleware()\n {\n return $this->middleware;\n }",
"public function getMiddleware()\n {\n return $this->middleware;\n }",
"public static function middleware(): array\n {\n return [];\n }",
"protected static function middleware(){\r\n\r\n if (self::$middleware == null){\r\n self::$middleware = self::$controller->middleware;\r\n }\r\n\r\n return Kernel::middleware(self::$middleware)->handle();\r\n \r\n }",
"public function firstMiddleware();",
"protected function getGlobalApiMiddleware()\n {\n return $this->filterMiddlewareForGlobal($this->getConfiguredApiMiddleware());\n }",
"public function gatherMiddleware(): array\n {\n return $this->middleware;\n }",
"protected function middleware()\n {\n return [];\n }",
"protected function getGroupMiddleware()\n\t{\n\t\treturn Arr::get($this->currentGroup(), 'middleware', []);\n\t}",
"abstract protected function getMiddlewareLayerKeyVal();",
"#[ArrayShape(['LoginRequired' => \"string\", 'AdminAuthentication' => \"string\", 'AuthorizedIsNull' => \"string\", 'SessionExpires' => \"string\"])] protected function callBeforeMiddlewares(): array\n {\n return [\n 'LoginRequired' => LoginRequired::class,\n 'AdminAuthentication' => AdminAuthentication::class,\n 'AuthorizedIsNull' => AuthorizedIsNull::class,\n 'SessionExpires' => SessionExpires::class,\n ];\n }",
"public function getMiddleware()\n {\n return new JwtAuthentication($this->options);\n }",
"public function middlewares()\n {\n }",
"function getGeneratedMiddlewareName()\n {\n return isset($this->getConsole()->arguments()['class']) ? ucwords($this->sanitize($this->getConsole()->argument('class'))) : 'Middleware';\n }",
"public function action($middlewareDefinition): self;",
"public function getControllerMiddleware(): array\n {\n return $this->middleware;\n }",
"protected function getConfiguredWebMiddleware()\n {\n return $this->core->config('middleware.load', []);\n }",
"protected function getAuthMiddleware(): string\n {\n return ($guard = $this->getGuard()) ? 'auth:'.$guard : 'auth';\n }",
"public function getCodeMiddlewarePhp() {\n $config = $this->get_ini_section(\"MIDDLEWARES\");\n \n $code = \"<?php\\r\\n\";\n foreach ($config as $middleware_name => $middleware_config) {\n if (isset($middleware_config[\"routes\"]) && $middleware_config[\"routes\"] == \"ALL\") {\n $mClassName = 'WebApp\\\\Middleware\\\\' . ucfirst(strtolower($middleware_name)) . 'Middleware';\n $code .= \"\\$app->add('$mClassName');\\r\\n\"; \n }\n }\n return $code;\n }",
"private function createDefaultMiddleware()\n {\n return [\n new NestedResponseExtractorMiddleware(),\n new InvalidClientIdMiddleware(),\n new WebServicesExceptionMiddleware(),\n new SoapFaultMiddleware(),\n new GeneralErrorsMiddleware(),\n ];\n }",
"protected function parseMiddleware( $middleware )\n\t{\n\t\tlist( $name, $parameters ) = array_pad( explode( ':', $middleware, 2 ), 2, [] );\n\n\t\tif ( is_string( $parameters ) )\n\t\t\t$parameters = explode( ',', $parameters );\n\n\t\treturn [$name, $parameters];\n\t}",
"public function middleware($middlewareDefinition): self;",
"public function gatherMiddleware()\n {\n if (! is_null($this->computedMiddleware)) {\n return $this->computedMiddleware;\n }\n\n $this->computedMiddleware = [];\n\n return $this->computedMiddleware = Router::uniqueMiddleware(array_merge(\n $this->middleware(), $this->controllerMiddleware()\n ));\n }"
] | [
"0.6385148",
"0.6135726",
"0.5960514",
"0.5955211",
"0.5866723",
"0.57989734",
"0.5775769",
"0.5775769",
"0.5775769",
"0.56367815",
"0.5622713",
"0.5486343",
"0.54804945",
"0.5390902",
"0.5371358",
"0.5356246",
"0.5330243",
"0.5284634",
"0.5280307",
"0.5257529",
"0.52512956",
"0.524115",
"0.5229876",
"0.52246696",
"0.51919013",
"0.5186478",
"0.51446646",
"0.51431274",
"0.5135473",
"0.510025"
] | 0.6494061 | 0 |
Filters out any nonglobal middleware from an array of middleware definitions. | protected function filterMiddlewareForGlobal(array $middleware)
{
return array_filter(
$middleware,
function () {
$key = func_get_arg(1);
return is_int($key);
},
ARRAY_FILTER_USE_BOTH
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getGlobalMiddleware()\n {\n $middleware = $this->global ?: array_values(array_filter([\n $this->trustHosts ? \\Illuminate\\Http\\Middleware\\TrustHosts::class : null,\n \\Illuminate\\Http\\Middleware\\TrustProxies::class,\n \\Illuminate\\Http\\Middleware\\HandleCors::class,\n \\Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance::class,\n \\Illuminate\\Http\\Middleware\\ValidatePostSize::class,\n \\Illuminate\\Foundation\\Http\\Middleware\\TrimStrings::class,\n \\Illuminate\\Foundation\\Http\\Middleware\\ConvertEmptyStringsToNull::class,\n ]));\n\n $middleware = array_map(function ($middleware) {\n return isset($this->replacements[$middleware])\n ? $this->replacements[$middleware]\n : $middleware;\n }, $middleware);\n\n return array_values(array_filter(\n array_diff(\n array_unique(array_merge($this->prepends, $middleware, $this->appends)),\n $this->removals\n )\n ));\n }",
"protected function filterMiddlewareForRoute(array $middleware)\n {\n return array_filter(\n $middleware,\n function () {\n $key = func_get_arg(1);\n return ! is_int($key);\n },\n ARRAY_FILTER_USE_BOTH\n );\n }",
"public static function middleware(): array\n {\n return [];\n }",
"public function excludedMiddleware()\n {\n return (array) ($this->action['excluded_middleware'] ?? []);\n }",
"static function setGlobalMiddlewares($middlewares)\r\n {\r\n $GLOBALS[\"mxRMid\"] = $middlewares;\r\n }",
"protected function middelwares()\n {\n $tapMiddleware = Middleware::tap(function ($request, $options) {\n $this->interceptedMethod = $request->getMethod();\n $this->interceptedHeaders = $request->getHeaders();\n });\n\n return [$tapMiddleware];\n }",
"protected function middleware()\n {\n return [];\n }",
"private function getInternalMiddlewares(): array\n {\n return [\n FileUploadErrorDetectionMiddleware::class,\n RequestParametersCustomsMiddleware::class,\n ErrorMiddlewareFactory::make($this->getContainer())\n ];\n }",
"public function middlewares()\n {\n }",
"private function createDefaultMiddleware()\n {\n return [\n new NestedResponseExtractorMiddleware(),\n new InvalidClientIdMiddleware(),\n new WebServicesExceptionMiddleware(),\n new SoapFaultMiddleware(),\n new GeneralErrorsMiddleware(),\n ];\n }",
"protected function middlewares(): array\n {\n return [];\n }",
"public function gatherDisabledMiddleware(): array\n {\n return $this->bypassedMiddleware;\n }",
"public function disableMiddleware($middlewareDefinition): self;",
"public function getMiddlewareGroups()\n {\n $middleware = [\n 'web' => [\n \\Illuminate\\Cookie\\Middleware\\EncryptCookies::class,\n \\Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse::class,\n \\Illuminate\\Session\\Middleware\\StartSession::class,\n \\Illuminate\\View\\Middleware\\ShareErrorsFromSession::class,\n \\Illuminate\\Foundation\\Http\\Middleware\\ValidateCsrfToken::class,\n \\Illuminate\\Routing\\Middleware\\SubstituteBindings::class,\n ],\n\n 'api' => array_values(array_filter([\n $this->statefulApi ? \\Laravel\\Sanctum\\Http\\Middleware\\EnsureFrontendRequestsAreStateful::class : null,\n $this->apiLimiter ? 'throttle:'.$this->apiLimiter : null,\n \\Illuminate\\Routing\\Middleware\\SubstituteBindings::class,\n ])),\n ];\n\n $middleware = array_merge($middleware, $this->groups);\n\n foreach ($middleware as $group => $groupedMiddleware) {\n foreach ($groupedMiddleware as $index => $groupMiddleware) {\n if (isset($this->groupReplacements[$group][$groupMiddleware])) {\n $middleware[$group][$index] = $this->groupReplacements[$group][$groupMiddleware];\n }\n }\n }\n\n foreach ($this->groupRemovals as $group => $removals) {\n $middleware[$group] = array_values(array_filter(\n array_diff(isset($middleware[$group]) ? $middleware[$group] : [], $removals)\n ));\n }\n\n foreach ($this->groupPrepends as $group => $prepends) {\n $middleware[$group] = array_values(array_filter(\n array_unique(array_merge($prepends, isset($middleware[$group]) ? $middleware[$group] : []))\n ));\n }\n\n foreach ($this->groupAppends as $group => $appends) {\n $middleware[$group] = array_values(array_filter(\n array_unique(array_merge(isset($middleware[$group]) ? $middleware[$group] : [], $appends))\n ));\n }\n\n return $middleware;\n }",
"public function getActivityTrackerIgnoreMiddlewares()\n {\n return config(\"devpilot.activity_tracker.ignore_middlewares\");\n }",
"protected function registerMiddlewareGroups()\n\t{\n\t\t$middlewareGroups = config('radan.middlewareGroups');\n\t\tforeach($middlewareGroups as $group => $middlewares)\n\t\t{\n\t\t\tforeach($middlewares as $middleware)\n\t\t\t{\t\t\t\t\n\t\t\t\t$this->app['router']->pushMiddlewareToGroup($group,$middleware);\n\t\t\t}\t\t\t\n\t\t}\t\t\t\t\t\n\t}",
"public function shouldSkipMiddleware()\n {\n }",
"private function bindAuthorizationMiddlewares() {\n $this->middleware('can:draft,posts', ['only' => 'draft']);\n $this->middleware('can:publish,posts', ['only' => 'publish']);\n $this->middleware('can:destroy,posts', ['only' => 'destroy']);\n $this->middleware('can:restore,posts', ['only' => 'restore']);\n $this->middleware('can:unpublish,posts', ['only' => 'unpublish']);\n $this->middleware('can:update,posts', ['only' => ['edit', 'update']]);\n $this->middleware('can:contentready,posts', ['only' => 'contentready']);\n $this->middleware('can:create,App\\Models\\Post', ['only' => ['create', 'store']]);\n $this->middleware('can:viewDeletedList,App\\Models\\Post', ['only' => 'trashed']);\n $this->middleware('can:viewListInBackend,App\\Models\\Post', ['only' => 'indexAll']);\n }",
"public function middleware()\n {\n return [(new WithoutOverlapping($this->user->id))->dontRelease()];\n }",
"public function getMiddlewareStack();",
"protected function callAfterMiddlewares(): array\n {\n return [];\n }",
"public function shouldSkipMiddleware()\n {\n return true;\n }",
"public function getMiddlewares()\n {\n return $this->route->getMiddlewares();\n// return $this->middlewares;\n }",
"protected function registerMiddlewareGroups()\n {\n if (property_exists($this, 'middlewareGroups')) {\n foreach ($this->middlewareGroups as $key => $middleware) {\n $this->router->middlewareGroup($key, $middleware);\n }\n }\n }",
"protected function middleware($middlewares = [])\n {\n foreach ($middlewares as $key => $midl) {\n if (is_numeric($key))\n $key = $midl;\n $Midl = ucfirst($key) . \"Middleware\";\n if (!file_exists(\"./middleware/$Midl.php\"))\n throw new Exception(\"Middleware '$key' not exist, if your calling this class for __construct, you should consider using start method insead.\");\n require_once(\"middleware/$Midl.php\");\n if (!is_numeric($key)) {\n if (is_array($midl))\n foreach ($midl as $route) {\n if (strtolower($route) == strtolower($this->request->function))\n return;\n } else \n if (strtolower($midl) == strtolower($this->request->function))\n return;\n }\n $inst = new $Midl($this->request);\n }\n }",
"public function gatherMiddleware(): array\n {\n return $this->middleware;\n }",
"protected function middleware()\n\t{\n\t\treturn ['auth'];\n\t}",
"public function gatherMiddleware()\n {\n if (! is_null($this->computedMiddleware)) {\n return $this->computedMiddleware;\n }\n\n $this->computedMiddleware = [];\n\n return $this->computedMiddleware = Router::uniqueMiddleware(array_merge(\n $this->middleware(), $this->controllerMiddleware()\n ));\n }",
"public function getMiddlewares()\n {\n return $this->middlewares;\n }",
"public static function middleware($names)\n {\n $names = (array) $names;\n $locals = AppHttpKernel::$localMiddlewareGroups;\n\n foreach ($names as $name) {\n if (!isset($locals[$name])) {\n throw new RuntimeException(\n \"No local middleware found with this name: {$name}\"\n );\n }\n\n $classes = $locals[$name];\n $classes = Arr::wrap($classes);\n\n foreach ($classes as $class) {\n if (!class_exists($class)) {\n throw new RuntimeException(\n \"Local middleware class not found for '{$name}': {$class}\"\n );\n }\n\n static::addMiddleware($name, $class);\n }\n }\n\n return new static();\n }"
] | [
"0.5874373",
"0.57593864",
"0.5698209",
"0.5620023",
"0.554687",
"0.5528461",
"0.55092853",
"0.5472086",
"0.54374546",
"0.5436182",
"0.5415549",
"0.5324663",
"0.532167",
"0.53123784",
"0.5305308",
"0.5305219",
"0.52632046",
"0.5244911",
"0.5225951",
"0.51486343",
"0.5095373",
"0.50901586",
"0.5065307",
"0.5063842",
"0.50553316",
"0.50313354",
"0.50305235",
"0.5005618",
"0.49937847",
"0.49856663"
] | 0.6852228 | 0 |
Filters out any nonroute middleware from an array of middleware definitions. | protected function filterMiddlewareForRoute(array $middleware)
{
return array_filter(
$middleware,
function () {
$key = func_get_arg(1);
return ! is_int($key);
},
ARRAY_FILTER_USE_BOTH
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function filterMiddlewareForGlobal(array $middleware)\n {\n return array_filter(\n $middleware,\n function () {\n $key = func_get_arg(1);\n return is_int($key);\n },\n ARRAY_FILTER_USE_BOTH\n );\n }",
"public function excludedMiddleware()\n {\n return (array) ($this->action['excluded_middleware'] ?? []);\n }",
"public function gatherDisabledMiddleware(): array\n {\n return $this->bypassedMiddleware;\n }",
"public function disableMiddleware($middlewareDefinition): self;",
"public function shouldSkipMiddleware()\n {\n }",
"protected function middelwares()\n {\n $tapMiddleware = Middleware::tap(function ($request, $options) {\n $this->interceptedMethod = $request->getMethod();\n $this->interceptedHeaders = $request->getHeaders();\n });\n\n return [$tapMiddleware];\n }",
"private function getInternalMiddlewares(): array\n {\n return [\n FileUploadErrorDetectionMiddleware::class,\n RequestParametersCustomsMiddleware::class,\n ErrorMiddlewareFactory::make($this->getContainer())\n ];\n }",
"public function shouldSkipMiddleware()\n {\n return true;\n }",
"public static function middleware(): array\n {\n return [];\n }",
"private function createDefaultMiddleware()\n {\n return [\n new NestedResponseExtractorMiddleware(),\n new InvalidClientIdMiddleware(),\n new WebServicesExceptionMiddleware(),\n new SoapFaultMiddleware(),\n new GeneralErrorsMiddleware(),\n ];\n }",
"protected function middlewares(): array\n {\n return [];\n }",
"public function shouldSkipMiddleware(): bool\n {\n return true;\n }",
"protected function middleware($middlewares = [])\n {\n foreach ($middlewares as $key => $midl) {\n if (is_numeric($key))\n $key = $midl;\n $Midl = ucfirst($key) . \"Middleware\";\n if (!file_exists(\"./middleware/$Midl.php\"))\n throw new Exception(\"Middleware '$key' not exist, if your calling this class for __construct, you should consider using start method insead.\");\n require_once(\"middleware/$Midl.php\");\n if (!is_numeric($key)) {\n if (is_array($midl))\n foreach ($midl as $route) {\n if (strtolower($route) == strtolower($this->request->function))\n return;\n } else \n if (strtolower($midl) == strtolower($this->request->function))\n return;\n }\n $inst = new $Midl($this->request);\n }\n }",
"public function getActivityTrackerIgnoreMiddlewares()\n {\n return config(\"devpilot.activity_tracker.ignore_middlewares\");\n }",
"protected function middleware()\n {\n return [];\n }",
"public function middleware($middlewares)\n {\n $middlewares = (array) $middlewares;\n\n $this->middlewares = [];\n\n foreach ($middlewares as $middleware) {\n if (is_callable($middleware)) {\n $this->middlewares[] = $middleware;\n } elseif (class_exists($middleware, true)) {\n $this->middlewares[] = [new $middleware, 'process'];\n } else {\n $this->middlewares[] = $middleware;\n }\n }\n\n return $this;\n }",
"public function withoutMiddleware($middleware)\n {\n $this->action['excluded_middleware'] = array_merge(\n (array) ($this->action['excluded_middleware'] ?? []), Arr::wrap($middleware)\n );\n\n return $this;\n }",
"private function validateMiddleware($middleware): array\n {\n $valid_middleware = $middleware;\n if ((is_array($middleware) && count($middleware) == 2 && is_string($middleware[0]) && is_string($middleware[1])) || is_callable($middleware)) {\n $valid_middleware = [$middleware];\n }\n return $valid_middleware;\n }",
"protected function callAfterMiddlewares(): array\n {\n return [];\n }",
"private function applyMiddleware(array $middleware): void\n {\n foreach ($middleware as $middleware) {\n if (is_string($middleware) && strpos($middleware, '@') !== false) {\n [$class, $method] = explode('@', $middleware);\n $middlewareInstance = new $class();\n call_user_func([$middlewareInstance, $method]);\n } else {\n call_user_func($middleware);\n }\n }\n }",
"public function remove(/*array|string */$middleware)\n {\n $middleware = backport_type_check('array|string', $middleware);\n\n $this->removals = array_merge(\n $this->removals,\n Arr::wrap($middleware)\n );\n\n return $this;\n }",
"public function middlewares()\n {\n }",
"public function shouldSkipMiddleware()\n {\n return $this->bound('middleware.disable') &&\n $this->make('middleware.disable') === true;\n }",
"public function middleware()\n {\n return [(new WithoutOverlapping($this->user->id))->dontRelease()];\n }",
"public function getMiddlewares()\n {\n return $this->route->getMiddlewares();\n// return $this->middlewares;\n }",
"protected function wrapInMiddleware($routes)\n\t{\n\t\t$routesByMiddleware = [];\n\n\t\tforeach ($routes as $key => $value) {\n\t\t\tif (isset($value['middleware'])) {\n\t\t\t\t$middlewareKeys = implode('|', $value['middleware']);\n\n\t\t\t\tif (!isset($routesByMiddleware[$middlewareKeys])) {\n\t\t\t\t\t$routesByMiddleware[$middlewareKeys] = [];\n\t\t\t\t}\n\n\t\t\t\t$routesByMiddleware[$middlewareKeys][$key] = $value;\n\t\t\t} else {\n\t\t\t\t$routesByMiddleware['no-middleware'][$key] = $value;\n\t\t\t}\n\t\t}\n\n\t\treturn $routesByMiddleware;\n\t}",
"#[ArrayShape(['LoginRequired' => \"string\", 'AdminAuthentication' => \"string\", 'AuthorizedIsNull' => \"string\", 'SessionExpires' => \"string\"])] protected function callBeforeMiddlewares(): array\n {\n return [\n 'LoginRequired' => LoginRequired::class,\n 'AdminAuthentication' => AdminAuthentication::class,\n 'AuthorizedIsNull' => AuthorizedIsNull::class,\n 'SessionExpires' => SessionExpires::class,\n ];\n }",
"private function bindAuthorizationMiddlewares() {\n $this->middleware('can:draft,posts', ['only' => 'draft']);\n $this->middleware('can:publish,posts', ['only' => 'publish']);\n $this->middleware('can:destroy,posts', ['only' => 'destroy']);\n $this->middleware('can:restore,posts', ['only' => 'restore']);\n $this->middleware('can:unpublish,posts', ['only' => 'unpublish']);\n $this->middleware('can:update,posts', ['only' => ['edit', 'update']]);\n $this->middleware('can:contentready,posts', ['only' => 'contentready']);\n $this->middleware('can:create,App\\Models\\Post', ['only' => ['create', 'store']]);\n $this->middleware('can:viewDeletedList,App\\Models\\Post', ['only' => 'trashed']);\n $this->middleware('can:viewListInBackend,App\\Models\\Post', ['only' => 'indexAll']);\n }",
"public function getMiddlewares()\n {\n return $this->middlewares;\n }",
"function filter_sanitizers( $sanitizers ) {\n\trequire_once __DIR__ . '/class-sanitizer.php';\n\t$sanitizers[ __NAMESPACE__ . '\\Sanitizer' ] = [];\n\treturn $sanitizers;\n}"
] | [
"0.6074022",
"0.60657793",
"0.57939786",
"0.5764573",
"0.5731393",
"0.56845504",
"0.5576806",
"0.55230415",
"0.551962",
"0.5479819",
"0.5465483",
"0.54008096",
"0.53568244",
"0.5354297",
"0.5340395",
"0.5301194",
"0.5292517",
"0.52571523",
"0.5220659",
"0.5211235",
"0.5176772",
"0.5175722",
"0.51028126",
"0.5076266",
"0.50743514",
"0.5016768",
"0.49984062",
"0.4997161",
"0.495463",
"0.49281892"
] | 0.65828055 | 0 |
Get all of the schedules for the Event | public function schedules()
{
return $this->hasMany(Schedule::class, 'event_id', 'id');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSchedules() {\n\n\t\t$schedules = new HMBKP_Schedules();\n\t\t$array = array();\n\n\t\tforeach ( $schedules->get_schedules() as $schedule )\n\t\t\t$array[] = array( 'id' => $schedule->get_id(), 'next_run_date' => $schedule->get_next_occurrence() );\n\n\t\treturn $array;\n\t}",
"public static function getSchedules() {\n $client = self::getClient();\n $session = Session::get('session');\n // $rootSession = $client->getRoot\n $contact = Session::get('contact');\n\n $params = array(\n 'session' => $session->root_session_id,\n 'student_id' => $contact->id,\n );\n\n $result = $client->call(SugarMethod::GET_SCHEDULES, $params);\n\n return $result;\n }",
"public function getScheduledEvents()\r\n {\r\n $schedule = app(Schedule::class);\r\n\r\n $events = array_map(function ($event) {\r\n $e = $this->convertEvent($event);\r\n return [\r\n 'cron' => $e->expression,\r\n 'command' => $e->command,\r\n 'timezone' => $e->timezone,\r\n 'mutex' => $e->mutexName(),\r\n 'background' => $e->runInBackground,\r\n 'overlapping' => $e->withoutOverlapping];\r\n }, $schedule->events());\r\n\r\n return $events;\r\n }",
"public function schedules()\n {\n return $this->morphMany(Schedule::class, 'scheduleable');\n }",
"public function getScheduledEvents()\r\n {\r\n $schedule = app(Schedule::class);\r\n\r\n $events = array_map(function ($event) {\r\n return [\r\n 'cron' => $event->expression,\r\n 'command' => $event->command,\r\n 'timezone' => $event->timezone,\r\n ];\r\n }, $schedule->events());\r\n\r\n return $events;\r\n }",
"public function schedules()\n {\n return $this->hasMany(TimetableSchedule::class, 'timetable_id');\n }",
"public function getAllSchedules()\n {\n return json_encode(Schedule::all());\n }",
"public function schedules()\n {\n return $this->hasMany(\\App\\Models\\Schedule::class);\n }",
"function fetch_all_schedule()\n {\n //$this->join('contacts', 'docs.contact_id = contacts.id');\n return $this->arrayWithKeyFromValue($this->findAll());\n }",
"public function getScheduleTimes();",
"function getSchedules() {\n\t\t$sql = \"SELECT schedules.* \".\n\t\t\t\"FROM schedules, schedules_groups \".\n\t\t\t\"WHERE schedules_groups.group_id = {$this->id} \".\n\t\t\t\"AND schedules_groups.schedule_id = schedules.id \".\n\t\t\t\"ORDER BY schedules.name ASC\";\n\t\t$schedules = new DO_Schedules();\n\t\t$schedules->query($sql);\n\t\t$sArr =& $schedules->fetchArray();\n\t\treturn $sArr;\n\t}",
"public function allSchedules($entity_id = null)\n {\n if (!empty($entity_id)) {\n $a = $this->schedule()->get();\n $b = $this->relatedSchedules($entity_id)->get();\n return $a->merge($b);\n } else {\n return $this->schedule;\n }\n }",
"public function schedules()\n {\n return $this->hasMany('App\\Schedule');\n }",
"public function getSchedule() { }",
"public function schedules(): HasMany\n {\n return $this->hasMany(Schedule::class);\n }",
"function getSchedule(){\n\t\t\t$sqlQuery = \"SELECT * FROM bus_schedule\";\n\n\t\t\t$schedule = $this->db->executeQuery($sqlQuery, $this->Functions->paramsIsZero(), \"select\");\n\n\t\t\treturn $schedule;\n\t\t}",
"private function get_employee_schedule() {\n\n $date = new \\DateTime($this->date);\n $employeeSchedule = ScheduleModel::with(array('periods.weekdays'))->where('employee_id', $this->employeeId)->get();\n\n foreach ($employeeSchedule as $schedule) {\n\n $chairID = $schedule['chair_id'];\n\n foreach ($schedule['periods'] as $period) {\n\n $periodStart = new \\DateTime($period['start_date']);\n $periodEnd = new \\DateTime($period['end_date']);\n\n if ($date >= $periodStart && $date <= $periodEnd) {\n\n $day = $period['weekdays']->where('day', formatS($date));\n $dayScheduleColl[] = array('chairID' => $chairID, 'dayArray' => $day);\n\n }\n\n }\n\n }\n\n if (isset($dayScheduleColl)) {\n\n $this->make_day_schedule_array($dayScheduleColl);\n\n }\n }",
"public function employeeSchedules() \n\t{\n\t\t$this->db->query(\"SELECT employees.id, employees.employee_id, employees.firstname, employees.lastname, schedules.id as sid, schedules.in_time, schedules.out_time FROM employees INNER JOIN schedules ON employees.schedule_id=schedules.id\"); \n\t\t$rows = $this->db->get();\n\t\treturn $rows; \n\t}",
"protected static function get_schedules() {\n\t\t$schedules = wp_get_schedules();\n\t\tif ( ! empty( $schedules ) ) {\n\t\t\tuasort( $schedules, 'Cron_Schedule_Command::sort' );\n\t\t\t$schedules = array_map( 'Cron_Schedule_Command::format_schedule', $schedules, array_keys( $schedules ) );\n\t\t}\n\t\treturn $schedules;\n\t}",
"public function schedules()\n {\n return $this->hasMany(PlannedSchedule::class);\n }",
"public function getSchedule() : array\n {\n $scheduleConfig = [];\n $userSchedule = $this->config->item('schedule');\n $userSchedule = is_array($userSchedule) ? $userSchedule : [];\n\n if ($userSchedule) {\n $scheduleConfig['user'] = $userSchedule;\n }\n\n $providerSchedule = array_map(\n static function (Addon $addOn) {\n $provider = $addOn->getProvider();\n $schedule = $provider->get('schedule');\n $schedule = is_array($schedule) ? $schedule : [];\n\n if (! $schedule) {\n return false;\n }\n\n return $schedule;\n },\n $this->addOnFactory->installed()\n );\n\n $providerSchedule = array_filter($providerSchedule, static function ($i) {\n return $i !== false;\n });\n\n $scheduleConfig = array_merge($scheduleConfig, $providerSchedule);\n\n $commandGroups = $this->commandsService->getCommandGroups();\n\n $namesToQuery = [];\n $scheduleModels = [];\n\n foreach ($scheduleConfig as $sourceName => $config) {\n foreach ($config as $scheduleConfigItem) {\n $groupName = $scheduleConfigItem['group'] ?? '';\n $command = $scheduleConfigItem['command'] ?? '';\n $group = $commandGroups[$groupName] ?? '';\n\n /** @var CommandModel $commandModel */\n $commandModel = $group[$command] ?? null;\n\n if (! $commandModel) {\n continue;\n }\n\n $arguments = [\n 'ee',\n $groupName,\n $command,\n ];\n\n foreach ($scheduleConfigItem['arguments'] ?? [] as $key => $val) {\n $arguments[] = '--' . $key . '=' . $val;\n }\n\n $commandModel->setCustomCliArgumentsModel(\n $this->cliArgumentsModelFactory->make($arguments)\n );\n\n $model = $this->scheduleItemModelFactory->make();\n\n $model->setSource($sourceName);\n $model->setGroup($groupName);\n $model->setCommand($command);\n $model->setRunEvery($scheduleConfigItem['runEvery'] ?? 'Always');\n $model->setCommandModel($commandModel);\n\n $namesToQuery[] = $model->getName();\n $scheduleModels[$model->getName()] = $model;\n }\n }\n\n if ($namesToQuery) {\n $query = $this->queryBuilderFactory->make()\n ->where_in('name', $namesToQuery)\n ->get('executive_schedule_tracking')\n ->result();\n\n foreach ($query as $item) {\n /** @var ScheduleItemModel $model */\n $model = $scheduleModels[$item->name] ?? null;\n\n if (! $model) {\n continue;\n }\n\n $model->setId($item->id);\n $model->setRunning($item->isRunning);\n $model->setLastRunStartTime($item->lastRunStartTime);\n $model->setLastRunEndTime($item->lastRunEndTime);\n }\n }\n\n return array_values($scheduleModels);\n }",
"function schedules_get()\n\t{\n $search = array();\n $response = FALSE; \n \n $cache = Cache::get_instance();\n $response = $cache::get('schedules' . serialize($this->_args));\n\n if (!$response) {\n $response['_count'] = $this->model->count_results($this->_args);\n\n if ($response['_count'] > 0)\n {\n $response['data'] = $this->model->fetch($this->_args, TRUE)->result();\n } \n $response['l'] = $this->db->last_query(); \n //$cache::save('schedule_h' . serialize($this->_args), $response);\n }\n\n $this->response($response);\n\t}",
"function getAllEventsForScheduler() {\n\n\tglobal $dbh;\n\t\n\t$eventQuery = $dbh->prepare(\"\n\t\tSELECT \n\t\t\te.id,\n\t\t\te.show_name,\n\t\t\te.comments,\n\t\t\te.show_status,\n\t\t\te.from_date,\n\t\t\te.to_date,\n\t\t\te.administrator,\n\t\t\te.venue_id\n\t\tFROM EVENT e\n\t\");\n\n $eventQuery->execute();\n\n $eventsArray = $eventQuery->fetchAll(PDO::FETCH_ASSOC);\n\n\tforeach($eventsArray as &$event){\n\n\t\t$event[\"show_name\"] = stripslashes($event[\"show_name\"]);\n\n\t\tif($event[\"show_status\"] == \"Cancelled\"){\n\t\t\tcontinue;\n\t\t} \n\n\t\t$colorStatusQuery = $dbh->prepare(\"\n\t\t\tSELECT * \n\t\t\tFROM EVENT_ROLE_USER er\n\t\t\tWHERE er.event_id = :event_id AND (er.status = 0 OR er.status = -1)\n\t\t\");\n\n\t\t$colorStatusQuery->bindParam(\"event_id\", $event[\"id\"]);\n\t\t$colorStatusQuery->execute();\n\t\t$colorStatusArr = $colorStatusQuery->fetchAll(PDO::FETCH_ASSOC);\n\n\t\tif(count($colorStatusArr) === 0){\n\t\t\t$event[\"show_status\"] = \"Scheduled\";\n\t\t} else {\n\t\t\t$event[\"show_status\"] = \"Deferred\";\n\t\t}\n\n\t}\n\n\n $statusArray = array(\n \tarray(\n \"id\" => -3,\n \"show_name\" => \"Scheduled\",\n \"comments\" => \"...\",\n \"show_status\" => \"Scheduled\",\n \"from_date\" => \"2011-03-16 17:00:00\",\n \"to_date\" => \"2011-03-16 17:00:00\",\n \"administrator\" => 1,\n \"venue_id\" => 1\n ),\n \tarray(\n \"id\" => -2,\n \"show_name\" => \"Deferred\",\n \"comments\" => \"...\",\n \"show_status\" => \"Deferred\",\n \"from_date\" => \"2011-03-16 18:00:00\",\n \"to_date\" => \"2011-03-16 18:00:00\",\n \"administrator\" => 1,\n \"venue_id\" => 1\n ), \t\n array(\n \"id\" => -1,\n \"show_name\" => \"Cancelled\",\n \"comments\" => \"...\",\n \"show_status\" => \"Cancelled\",\n \"from_date\" => \"2011-03-16 19:00:00\",\n \"to_date\" => \"2011-03-16 19:00:00\",\n \"administrator\" => 1,\n \"venue_id\" => 1\n ) \t\n );\n\n return array_merge($statusArray, $eventsArray); \n}",
"public function getSchedulesAttribute() {\n\t\treturn $this->schedules();\n\t}",
"public function get_event_schedule($param1 = \"\"){\n if ($param1 != \"\") {\n $this->db->where('id', $param1);\n }\n return $this->db->get('event_schedule');\n }",
"public function schedule()\n {\n return $this->morphMany('App\\Models\\CronJob', 'entity');\n }",
"function retrieveSchedulers() {\n\t\t$GLOBALS['log']->info('Gathering Schedulers');\n\t\t$executeJobs = array();\n\t\t$query \t= \"SELECT id \" .\n\t\t\t\t\"FROM schedulers \" .\n\t\t\t\t\"WHERE deleted=0 \" .\n\t\t\t\t\"AND status = 'Active' \" .\n\t\t\t\t\"AND date_time_start < \".db_convert(\"'\".TimeDate::getInstance()->nowDb().\"'\",'datetime').\" \" .\n\t\t\t\t\"AND (date_time_end > \".db_convert(\"'\".TimeDate::getInstance()->nowDb().\"'\",'datetime').\" OR date_time_end IS NULL)\";\n\t\t\t\t\n\t\t$result\t= $this->db->query($query);\n\t\t$rows=0;\n\t\t$executeTimes = array();\n\t\t$executeIds = array();\n\t\t$executeJobTimes = array();\n\t\twhile(($arr = $this->db->fetchByAssoc($result)) != null) {\n\t\t\t$focus = BeanFactory::getBean('Schedulers', $arr['id']);\n\t\t\t$executeTimes[$rows] = $this->deriveDBDateTimes($focus);\n\t\t\tif(count($executeTimes) > 0) {\n\t\t\t\tforeach($executeTimes as $k => $time) {\n\t\t\t\t$executeIds[$rows] = $focus->id;\n\t\t\t\t\t$executeJobTimes[$rows] = $time;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$rows++;\n\t\t}\n\t\t$executeJobs['ids'] = $executeIds;\n\t\t$executeJobs['times'] = $executeJobTimes;\n\t\treturn $executeJobs;\n\t}",
"public function findAllEvents() {\n\t\treturn $this->db->exec_SELECTgetRows('*', 'tx_cal_event', '');\n\t}",
"public function getSchedule()\n {\n return $this->schedule;\n }",
"public function getSchedules()\n {\n return view('schedules.admin.schedules');\n }"
] | [
"0.7809418",
"0.750569",
"0.72742116",
"0.7253558",
"0.7210182",
"0.719043",
"0.7144438",
"0.7141937",
"0.7132557",
"0.7064349",
"0.7052898",
"0.7030379",
"0.70081574",
"0.69569355",
"0.6943082",
"0.67631006",
"0.6757926",
"0.6751466",
"0.6729659",
"0.67219555",
"0.6697888",
"0.668926",
"0.6614506",
"0.66133875",
"0.6589232",
"0.6565837",
"0.64125764",
"0.64058703",
"0.6383882",
"0.63640296"
] | 0.7898549 | 0 |
self::$logger>debug ( "En insertBasicInfoPlayer para: ". $playerObject['id'] . " y teamId" . $team_goalface_id); | private function insertBasicInfoPlayer($playerObject,$team_goalface_id) {
$date = new Zend_Date ();
$today = $date->toString ( 'Y-MM-dd H:mm:ss' );
$teamplayer = new TeamPlayer ();
$player = new Player ();
$team = new Team();
$teamPlayer = new TeamPlayer();
$country = new Country ();
$playerPosition = null;
if ($playerObject['pos'] == "G") {
$playerPosition = "Goalkeeper";
}else if($playerObject['pos'] == "D"){
$playerPosition = "Defender";
}else if($playerObject['pos'] == "M"){
$playerPosition = "Midfielder";
}else if($playerObject['pos'] == "F"){
$playerPosition = "Forward";
}
//<player number="4" name="Luis�o" pos="D" id="147700"/>
$dataPlayer = array ('player_id' => $playerObject['id'], //1
'player_firstname' => $playerObject['name'], //2
'player_middlename' => '',
'player_lastname' => $playerObject['name'], //3
'player_common_name' => $playerObject['name'],
'player_name_short' => $playerObject['name'],
'PLAYER_DOB' => null, //4
'player_dob_city' => null,
'player_type' => 'player', //5
'player_country' => null, //5
'player_nationality' => null, //5
'player_position' => $playerPosition, //5
'player_creation' => $today,
'player_height' => null,
'player_weight' => null );
$dataTeamPlayer = array ('player_id' => $playerObject['id'],
'team_id' => $team_goalface_id,
'actual_team' => '1',
'jersey_number' => '',
'start_date' => '',
'end_date' => '' );
$player->insert($dataPlayer);
$teamPlayer->insert($dataTeamPlayer);
//self::$logger->debug ( "Player Basic Inserted Ok and updated teamPlayer: ". $playerObject['id'] . " y teamId" . $team_goalface_id);
//find the new player and return it
$player = new Player();
$playerid = $player->fetchRow ( 'player_id = ' . $playerObject['id'] );
return $playerid;
//Zend_Debug::dump($dataPlayer);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function insertNewPlayer($playerid,$team_goalface_id) {\n\t\t$date = new Zend_Date ();\n\t\t$today = $date->toString ( 'Y-MM-dd H:mm:ss' );\n\t\t$teamplayer = new TeamPlayer ();\n\t\t$player = new Player ();\n\t\t$team = new Team();\n\t\t$teamPlayer = new TeamPlayer();\n\t\t$country = new Country ();\n\n\t\t//USER when LIVE\n\t\t$xml_player = $this->getgsfeed('soccerstats/player/'.$playerid);\n\n\t\t//USE when Testing LOCALHOST\n\t\t//$xml_player = $this->getdirectfeed('http://www.goalserve.com/getfeed/4ddbf5f84af0486b9958389cd0a68718/soccerstats/player/'.$playerid);\n\n\n\t\tif ($xml_player != null || $xml_player != '') {\n\t\t\tforeach ( $xml_player->player as $xmlPlayer ) {\n\t\t\t\t$rowBirthCountry = $country->fetchRow ( 'country_name = \"' . $xmlPlayer->birthcountry . '\"' );\n\t\t\t\t$rowNationalityCountry = $country->fetchRow ( 'country_name = \"' . $xmlPlayer->nationality . '\"' );\n\t\t\t\t$mytempdate = str_replace('/', '-', $xmlPlayer->birthdate);\n\t\t\t\t$mydate = date('Y-m-d', strtotime($mytempdate));\n\t\t\t\t$arr_height = explode ( \" \", $xmlPlayer->height, 2 );\n\t\t\t\t$arr_weight = explode ( \" \", $xmlPlayer->weight, 2 );\n\t\t\t\t$player_height = $arr_height [0];\n\t\t\t\t$player_weight = $arr_weight [0];\n\t\t\t\tif ($xmlPlayer->position == \"Attacker\") {\n\t\t\t\t\t$xmlPlayer->position = \"Forward\";\n\t\t\t\t}\n\n\t\t\t\t$dataPlayer = array ('player_id' => $playerid, //1\n\t\t\t\t\t\t'player_firstname' => $xmlPlayer->firstname, //2\n\t\t\t\t\t\t'player_middlename' => '',\n\t\t\t\t\t\t'player_lastname' => $xmlPlayer->lastname, //3\n\t\t\t\t\t\t'player_common_name' => $xmlPlayer->name,\n\t\t\t\t\t\t'player_name_short' => (substr ( $xmlPlayer->firstname, 0, 1 ) . \".\" . \" \" . $xmlPlayer->lastname),\n\t\t\t\t\t\t'player_dob' => $mydate, //4\n\t\t\t\t\t\t'player_dob_city' => $xmlPlayer->birtplace,\n\t\t\t\t\t\t'player_type' => 'player', //5\n\t\t\t\t\t\t'player_country' => $rowBirthCountry ['country_id'], //5\n\t\t\t\t\t\t'player_nationality' => $rowNationalityCountry ['country_id'], //5\n\t\t\t\t\t\t'player_position' => $xmlPlayer->position, //5\n\t\t\t\t\t\t'player_creation' => $today,\n\t\t\t\t\t\t'player_height' => $player_height,\n\t\t\t\t\t\t'player_weight' => $player_weight );\n\n\n\t\t\t\t$dataTeamPlayer = array ('player_id' => $playerid,\n\t\t\t\t\t\t 'team_id' => $team_goalface_id,\n\t\t\t\t\t \t 'actual_team' => '1',);\n\t\t\t\t\t \t \n\t\t\t}\n\t\t\t$player->insert($dataPlayer);\n\t\t\t$teamPlayer->insert($dataTeamPlayer);\n\t\t\t//self::$logger->debug ( \"Player Inserted Ok and updated teamPlayer: \". $playerid . \" y teamId\" . $team_goalface_id);\n\t\t\t//find the new player and return it\n\t\t\t$player = new Player();\n\t\t\t$playerid = $player->fetchRow ( 'player_id = ' . $playerid );\n\t\t\treturn $playerid;\n\t\t}\n\t\treturn null;\n\t\t//Zend_Debug::dump($dataPlayer);\n\n\t}",
"function log($msg=\"\"){ if($this->debug){ echo $msg.\"\\n\"; } }",
"function debug($name=''){\n\t echo \"<br><b>$name</b>====================== SOTF DEBUG ===========================<br>\";\n\t echo \"<b>Object ID:</b> \" . $this->id . \"<br>\";\n\t echo \"<b>Object Data:</b> <pre>\"; print_r($this->data); echo \"</pre>\";\n\t echo \"<b>Object Changed:</b> \"; if($this->changed){ echo \"TRUE\"; }else{ echo \"FALSE\";} echo \"<br>\";\n\t echo \"<b>Object Database Handle:</b> <pre>\"; print_r($db->dsn) . \"</pre>\";\n }",
"public function debugAction() : string\n {\n // Deal with the action and return a response.\n // return __METHOD__ . \", \\$db is {$this->db}\";\n return \"Debug my game!!\";\n }",
"public function get_playerid(){return $this->_playerid;}",
"function debug()\n {\n core::stack();\n dbug::{'test'}(func_get_args(), SDL);\n }",
"function debug()\r\n {\r\n }",
"function debugMessage($obj) {\n\techo \"<br />\";\n\tprint_r($obj);\n\techo \"<br /><br />\";\n}",
"function debug($texto,$obj){\n\t\tif($this->DEBUG){\n\t\t\t$this->oDebug->debugVar($texto,$obj);\n\t\t}\n\t}",
"function save_player_data()\n\t{\n\t\tglobal $database;\n\t\t$database->update_where('lg_game_players',\n\t\t\t\"game_id = '\".$database->escape($this->player_data['game_id']).\"' \n\t\t\tAND player_id = '\".$this->player_data['player_id'].\"'\"\n\t\t\t,$this->player_data);\t\n\t}",
"function playerTest() {\n global $page_id, $plyr, $error_msgs;\n dbg(\"+\".__FUNCTION__.\"\");\n #post_dump();\n\n# initialize the player form\nrequire(BASE_URI . \"modules/player/player.form.init.php\");\n\n # create a test player\n $plyr->testMember();\n $error_msgs['errorDiv'] = \"Test player created. Press \\\"Add/Update\\\" to add the player.\";\n\n# Show the player form\nrequire(BASE_URI . \"modules/player/player.form.php\");\n\n dbg(\"-\".__FUNCTION__.\"={$plyr->get_member_id()}\");\n\n}",
"function lk_log_debug($message){\n $log = new DebugLog($message);\n $log ->save();\n}",
"static function debug ($msg) {\n file_put_contents(\"/tmp/overlay.log\", $msg . \"\\n\", FILE_APPEND);\n return;\n }",
"public function debug_dump()\n {\n \n }",
"function debug()\r\n\t{\r\n\t\techo \"<p></p><br> DEBUG PARA EL OBJETO BASE DE DATOS </br>\";\r\n\t\techo \"<br> bd_host --> \".$this->bd_host.\" </br>\";\r\n\t\techo \"<br> bd_user --> \".$this->bd_user.\" </br>\";\r\n\t\techo \"<br> bd_pass --> \".$this->bd_pass.\" </br>\";\r\n\t\techo \"<br> bd --> \".$this->bd.\" </br>\";\r\n\t\techo \"<br> bd_link --> \".$this->bd_link.\" </br>\";\r\n\t}",
"function insertIntoDB()\n {\n if ($this->debug) echo \"<b>Warning:</b> DataObject::insertIntoDB called!<br>\";\n }",
"private function _debug($o) {\n\t\tif($this->enableDebug) {\n\t\t\t$ds = str_repeat('-', 4);\n\t\t\terror_log(implode(\"\\n\", array(\n\t\t\t\t'Begin debug output... ', \n\t\t\t\t\"{$ds}Var Export{$ds}\",\n\t\t\t\tDebugger::exportVar($o),\n\t\t\t\t\"{$ds}Stack Trace{$ds}\",\n\t\t\t\tDebugger::trace()\n\t\t\t)));\n\t\t}\n\t}",
"public function insertmatchesAction() {\n\n $date = new Zend_Date ();\n $matchObject = new Matchh ();\n\t\t$matchEventObject = new MatchEvent ();\n $league = new LeagueCompetition ();\n \t\t$team = new Team ();\n \t\t$player = new Player();\n\t\t$urlGen = new SeoUrlGen ();\n\n\t\t$comp_country = $this->_request->getParam ( 'country', null );\n\t\t$comp_gs_fix_name = $this->_request->getParam ( 'fixture', null );\n\t\t$stageid = $this->_request->getParam ( 'stage', null );\n\t\t$weeknumber = $this->_request->getParam ( 'week', null );\n\t\t$matchid = $this->_request->getParam ( 'matchid', null );\n\t\t$history = $this->_request->getParam ( 'history', null );\n\n\t\tif ($history == null) {\n\t\t\t$xml = $this->getgsfeed('soccerfixtures/'.$comp_country.'/'.$comp_gs_fix_name);\n\t\t} else {\n\t\t\t$xml = $this->getgsfeed('soccerhistory/'.$comp_country.'/'.$comp_gs_fix_name);\n\t\t}\n\n\t\tforeach ( $xml->tournament as $competition ) {\n\n\t\t\techo '<br><br>-><b>Competition :</b> ' . $competition ['id'] . \"<BR>\";\n\n\t\t\t$row = $league->findCompetitionByGoalserveId ( $competition ['id'] );\n\n\t\t\tif ($row != null) {\n\n\t\t\t\t$allmatches = self::getMatches($xml,$comp_country,$comp_gs_fix_name,$stageid,$weeknumber,$matchid,$competition ['stage_id']);\n\n\t\t\t\tforeach ($allmatches as $match) {\n\n\t\t\t\t\t\t//Does match exist on GoalFace DB\n\t\t\t\t\t\tself::$logger->debug ( \"Match Id Processing:\" .$match ['id']);\n\n\t\t\t\t\t\t$matchExist = $matchObject->fetchRow ( 'match_id_goalserve = ' .$match ['id'] );\n\n\t\t\t\t\t\t$match_id = 'G'. $match ['id'];\n\t\t\t\t\t\t$rowTeamA = $team->fetchRow ( 'team_gs_id = ' . $match->localteam ['id'] );\n\t\t\t\t\t\t$rowTeamB = $team->fetchRow ( 'team_gs_id = ' . $match->visitorteam ['id'] );\n\t\t\t\t\t\t$matchTeams = $rowTeamA [\"team_name\"] . \" vs \" . $rowTeamB [\"team_name\"] ;\n\t\t\t\t\t\t$matchUrl = $urlGen->getMatchPageUrl ( $row [\"competition_name\"], $rowTeamA [\"team_name\"], $rowTeamB [\"team_name\"], $match_id, true );\n\n\t\t\t\t\t\tif ((int)$match->localteam ['score'] > (int)$match->visitorteam ['score']) {\n\t\t\t\t\t\t\t$team_id_winner = $rowTeamA ['team_id'];\n\t\t\t\t\t\t} elseif ((int)$match->visitorteam ['score'] > (int)$match->localteam ['score']) {\n\t\t\t\t\t\t\t$team_id_winner = $rowTeamB ['team_id'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$team_id_winner = '999';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($match ['time'] == 'TBA') {\n\t\t\t\t\t\t\t$timefeed = '16:00';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$timefeed = $match ['time'];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($match->localteam ['score'] != \"\" and $match->visitorteam ['score'] != \"\"){\n\t\t\t\t\t\t \t$mstatus = 'Played';\n\t\t\t\t\t\t } else {\n\t\t\t\t\t\t \t$mstatus = 'Fixture';\n\t\t\t\t\t\t }\n\n\n\t\t\t\t\t\t// convert feed date and time to format Y-m-d H:i:s to be used on creating zend date\n\t\t\t\t\t\t$mydate = date ( \"Y-m-d H:i:s\", strtotime ( $match ['date'] . \" \" . $timefeed ) );\n\t\t\t\t\t\t//get zend date based on feed date\n\t\t\t\t\t\t$zf_date = new Zend_Date ( $mydate, Zend_Date::ISO_8601 );\n\t\t\t\t\t\t//add 2 hrs to get the gmt +2 like enetpulse\n\t\t\t\t\t\t$gf_date = $zf_date->addHour ( 0 );\n\t\t\t\t\t\t//get new date and time\n\t\t\t\t\t\t$new_gf_date = $gf_date->toString ( 'yyyy-MM-dd' );\n\t\t\t\t\t\t$new_gf_time = $gf_date->toString ( 'HH:mm:ss' );\n\t\t\t\t\t\t// concatenate date + time for datetime field\n\t\t\t\t\t\t$datetime = strftime ( '%Y%m%d%H%M%S', strtotime ( $new_gf_date . ' ' . $new_gf_time ) );\n\t\t\t\t\t\t// remove / from 2011/2012 and also remove 20 to get 1112 and concatenate with competition id\n\t\t\t\t\t\t$season = str_replace ( '20', '', str_replace ( '/', '', $competition ['season'] ) ) . '' . $competition ['id'];\n\n\n\t\t\t\t\t\t//match doesn't exist on GoalFace DB insert it\n\t\t\t\t\t\tif ($matchExist == null ) {\n\t\t\t\t\t\t\t$datamatch = array (\n\t\t\t\t\t\t\t\t'match_id' => $match_id,\n\t\t\t\t\t\t\t\t'match_id_goalserve' => $match ['id'],\n\t\t\t\t\t\t\t\t'country_id' => $row ['country_id'],\n\t\t\t\t\t\t\t\t'competition_id' => $row ['competition_id'],\n\t\t\t\t\t\t\t\t'match_date' => $new_gf_date, //1\n\t\t\t\t\t\t\t\t'match_time' => $new_gf_time, //2\n\t\t\t\t\t\t\t\t'match_date_time' => $datetime,\n\t\t\t\t\t\t\t\t'match_status' => $mstatus,\n\t\t\t\t\t\t\t\t'match_winner' => $team_id_winner, //3\n\t\t\t\t\t\t\t\t'team_a' => $rowTeamA ['team_id'],\n\t\t\t\t\t\t\t\t'team_b' => $rowTeamB ['team_id'], //4\n\t\t\t\t\t\t\t\t'fs_team_a' => $match->localteam ['ft_score'],\n\t\t\t\t\t\t\t\t'fs_team_b' => $match->visitorteam ['ft_score'],\n\t\t\t\t\t\t\t\t'season_id' => $season,\n\t\t\t\t\t\t\t\t'round_id' => $match ['stageid'],\n\t\t\t\t\t\t\t\t'venue_id' => $match ['venue_id'],\n\t\t\t\t\t\t\t\t'week' => $match['week'],\n\t\t\t\t\t\t\t\t'aggrid' => $match['aggregate'],\n\t\t\t\t\t\t\t\t'static_id' => $match ['static_id'],\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$matchObject->insert ( $datamatch );\n\t\t\t\t\t\t\techo 'Inserting Match: <strong>' . $match_id . '</strong> - Date:'.$new_gf_date.' - Time: '.$new_gf_time.'<br>';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$datamatch = array (\n\t\t\t\t\t\t\t\t'match_date' => $new_gf_date, //1\n\t\t\t\t\t\t\t\t'match_time' => $new_gf_time, //2\n\t\t\t\t\t\t\t\t'match_date_time' => $datetime,\n\t\t\t\t\t\t\t\t'match_status' => $mstatus,\n\t\t\t\t\t\t\t\t'match_winner' => $team_id_winner, //3\n\t\t\t\t\t\t\t\t'fs_team_a' => $match->localteam ['ft_score'],\n\t\t\t\t\t\t\t\t'fs_team_b' => $match->visitorteam ['ft_score'],\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$matchObject->updateMatch( $match_id,$datamatch );\n\t\t\t\t\t\t\techo 'Updating Match: <strong>' . $match_id . '</strong> - Date:'.$new_gf_date.' - Time: '.$new_gf_time.'<br>';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Insert Events\n\t\t\t\t\t\tif ($match->halftime ['score'] != \"\" ) {\n\t\t\t\t\t\t\t// Insert Goal events\n\t\t\t\t\t\t\t$i = 1;\n\t\t\t\t\t\t\tforeach ($match->goals->goal as $goal) {\n\n\t\t\t\t\t\t\t\tif ($goal['playerid'] != \"\") {\n\t\t\t\t\t\t\t\t\tif ($goal['team'] == 'localteam') {\n\t\t\t\t\t\t\t\t\t\t$team_id_event = $rowTeamA ['team_id'];\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$team_id_event = $rowTeamB ['team_id'];\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Goals (G), Own Goals (OG), penalty goals (PG)\n\t\t\t\t\t\t\t\t\t$goaltype = array();\n\t\t\t\t\t\t\t\t\tpreg_match('/\\((.*?)\\)/',$goal['player'], $result);\n\t\t\t\t\t\t\t\t\tif(empty($result)) {\n\t\t\t\t\t\t\t\t\t\t$goalevent = 'G';\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$goalevent = $result[1];\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$dataevent = array (\n\t\t\t\t\t\t\t\t\t\t'event_id' => 'E' . $match ['id'] . $i,\n\t\t\t\t\t\t\t\t\t\t'player_id' => $goal['playerid'],\n\t\t\t\t\t\t\t\t\t\t'event_type_id'=> $goalevent, // G, OG or PG\n\t\t\t\t\t\t\t\t\t\t'match_id' => 'G' . $match ['id'],\n\t\t\t\t\t\t\t\t\t\t'team_id' => $team_id_event,\n\t\t\t\t\t\t\t\t\t\t'event_minute' => $goal['minute'],\n\t\t\t\t\t\t\t\t\t\t'time' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\techo '---->Inserting Matchevent: <strong>' . 'E' . $match ['id'] . $i . '</strong> Event: <b>G</b> - Player: '. $goal['playerid'] .'<br>';\n\t\t\t\t\t\t\t\t\t$matchEventObject->insert ( $dataevent );\n\n\n\t\t\t\t\t\t\t\t\t//Activiy Goal\n\t\t\t\t\t\t\t\t\t$event = null;\n\t\t\t\t\t\t\t\t\t$event = array (\n\t\t\t\t\t\t\t\t\t\t'id' => 'E' . $match ['id'] . $i,\n\t\t\t\t\t\t\t\t\t\t'eventtype' => $goalevent, // G, OG or PG\n\t\t\t\t\t\t\t\t\t\t'player_id' => $goal['playerid'],\n\t\t\t\t\t\t\t\t\t\t'game_minute' =>$goal['minute'],\n\t\t\t\t\t\t\t\t\t\t'date_event' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t$playerid = $player->fetchRow ( 'player_id = ' . $goal['playerid'] );\n\n\t\t\t\t\t\t\t\t\t$player_name_seo = $urlGen->getPlayerMasterProfileUrl ( $playerid [\"player_nickname\"], $playerid [\"player_firstname\"], $playerid [\"player_lastname\"], $playerid [\"player_id\"], true, $playerid [\"player_common_name\"] );\n\t\t\t\t\t\t\t\t\t$player_shortname = $playerid ['player_name_short'];\n\t\t\t\t\t\t\t\t\t$matchscore = $goal['score'];\n\t\t\t\t\t\t\t\t\t$playersPathName = $this->getplayerimage($goal['playerid']);\n\n\t\t\t\t\t\t\t\t\tself::insertGoalScoredActivity ( $event, $player_name_seo, $player_shortname, $matchTeams, $matchUrl, $matchscore, $playersPathName, $match_id,null );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tself::$logger->debug ( \"Inserting Player Id missing for event Goal on match:\" .$match ['id'] .\" - \". $match->localteam ['name'] .\"vs. \".$match->visitorteam ['name'] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$i++;}\n\n\t\t\t\t\t\t\t// Insert Lineups events\n\t\t\t\t\t\t\t// localteam\n\t\t\t\t\t\t\t$j = $i;\n\t\t\t\t\t\t\tforeach($match->lineups->localteam->player as $lineuplocal) {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tif ($lineuplocal['id'] != \"\") {\n\t\t\t\t\t\t\t\t\t\t$datalineuplocal = array (\n\t\t\t\t\t\t\t\t\t\t\t'event_id' => 'E' . $match ['id'] . $j,\n\t\t\t\t\t\t\t\t\t\t\t'player_id' => $lineuplocal['id'],\n\t\t\t\t\t\t\t\t\t\t\t'event_type_id'=>'L',\n\t\t\t\t\t\t\t\t\t\t\t'match_id' => 'G' . $match ['id'],\n\t\t\t\t\t\t\t\t\t\t\t'team_id' => $rowTeamA ['team_id'],\n\t\t\t\t\t\t\t\t\t\t\t'time' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t\t'jersey_number' => $lineuplocal['number'],\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\techo '---->Inserting Matchevent: <strong>' . 'E' . $match ['id'] . $j . '</strong> Event: <b>L</b> - Team: '. $rowTeamA ['team_id'] .' - Player: '. $lineuplocal['id'] .'<br>';\n\t\t\t\t\t\t\t\t\t\t//Zend_Debug::dump($datalineuplocal).\"<BR>\";\n\t\t\t\t\t\t\t\t\t\t$matchEventObject->insert ( $datalineuplocal );\n\n\t\t\t\t\t\t\t\t\t\t//Activity Lineup Local\n\t\t\t\t\t\t\t\t\t\t$playerid = $player->fetchRow ( 'player_id = ' . $lineuplocal['id'] );\n\n\t\t\t\t\t\t\t\t\t\t// Added 5-5-13\n\t\t\t\t\t\t\t\t\t\tif ($playerid == null) {\n\t\t\t\t\t\t\t\t\t\t\tself::$logger->debug ( 'Lineup Local Player NOT FOUND on DB - playerId: ' .$lineuplocal['id'] );\n\t\t\t\t\t\t\t\t\t\t\t$playerid = self::insertNewPlayer($lineuplocal['id'] ,$rowTeamA ['team_id']);\n\t\t\t\t\t\t\t\t\t\t\tif($playerid == null){\n\t\t\t\t\t\t\t\t\t\t\t\t//insert a player with minimal data\n\t\t\t\t\t\t\t\t\t\t\t\t$playerid = self::insertBasicInfoPlayer($lineuplocal['id'], $rowTeamA ['team_id']);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t$player_name_seo = $urlGen->getPlayerMasterProfileUrl ( $playerid [\"player_nickname\"], $playerid [\"player_firstname\"], $playerid [\"player_lastname\"], $playerid [\"player_id\"], true, $playerid [\"player_common_name\"] );\n\t\t\t\t\t\t\t\t\t\t$player_shortname = $playerid ['player_name_short'];\n\t\t\t\t\t\t\t\t\t\t$matchscore = null;\n\t\t\t\t\t\t\t\t\t\t$playersPathName = $this->getplayerimage($lineuplocal['playerid']);\n\t\t\t\t\t\t\t\t\t\t$event = null;\n\t\t\t\t\t\t\t\t\t\t$event = array(\n\t\t\t\t\t\t\t\t\t\t\t'id' => 'E' . $match ['id'] . $j,\n\t\t\t\t\t\t\t\t\t\t\t'eventtype' => 'L',\n\t\t\t\t\t\t\t\t\t\t\t'player_id' => $lineuplocal['id'],\n\t\t\t\t\t\t\t\t\t\t\t'date_event' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\tself::insertLineUpActivity ( $event, $player_name_seo, $player_shortname, $matchTeams, $matchUrl, $matchscore, $playersPathName, $match_id,null );\n\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tself::$logger->debug ( \"Player Id missing for event Lineup on match:\" .$match ['id'] .\" for team: \". $rowTeamA ['team_id']);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t} catch ( Exception $e ) {\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\tself::$logger->err ( \"Caught LINEUP LOCAL exception: \" . get_class ( $e ) . \" ->\" . $e->getMessage () );\n\t\t\t\t\t\t\t\t\tself::$logger->err ( $e->getTraceAsString () . \"\\n-----------------------------\" );\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$j++;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// visitorteam\n\t\t\t\t\t\t\t$k = $j;\n\t\t\t\t\t\t\tforeach($match->lineups->visitorteam->player as $lineupvisitor) {\n\t\t\t\t\t\t\t\ttry{\n\n\t\t\t\t\t\t\t\t\tif ($lineupvisitor['id'] != \"\") {\n\t\t\t\t\t\t\t\t\t\t$datalineupvisitor = array (\n\t\t\t\t\t\t\t\t\t\t\t'event_id' => 'E' . $match ['id'] . $k,\n\t\t\t\t\t\t\t\t\t\t\t'player_id' => $lineupvisitor['id'],\n\t\t\t\t\t\t\t\t\t\t\t'event_type_id'=>'L',\n\t\t\t\t\t\t\t\t\t\t\t'match_id' => 'G' . $match ['id'],\n\t\t\t\t\t\t\t\t\t\t\t'team_id' => $rowTeamB ['team_id'],\n\t\t\t\t\t\t\t\t\t\t\t'time' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t\t'jersey_number' => $lineupvisitor['number'],\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\techo '---->Inserting Matchevent: <strong>' . 'E' . $match ['id'] . $k . '</strong> Event: <b>L</b> - Team: '. $rowTeamB ['team_id'] .' - Player: '. $lineupvisitor['id'] .'<br>';\n\t\t\t\t\t\t\t\t\t\t//Zend_Debug::dump($datalineupvisitor).\"<BR>\";\n\t\t\t\t\t\t\t\t\t\t$matchEventObject->insert ( $datalineupvisitor );\n\n\t\t\t\t\t\t\t\t\t\t//Activity Lineup Visitor\n\t\t\t\t\t\t\t\t\t\t$playerid = $player->fetchRow ( 'player_id = ' . $lineupvisitor['id'] );\n\n\t\t\t\t\t\t\t\t\t\t// Added 5-5-13\n\t\t\t\t\t\t\t\t\t\tif ($playerid == null) {\n\t\t\t\t\t\t\t\t\t\t\tself::$logger->debug ( 'Lineup Visitor Player NOT FOUND on DB - playerId: ' .$lineupvisitor['id'] );\n\t\t\t\t\t\t\t\t\t\t\t$playerid = self::insertNewPlayer($lineupvisitor['id'] ,$rowTeamB ['team_id']);\n\t\t\t\t\t\t\t\t\t\t\tif($playerid == null){\n\t\t\t\t\t\t\t\t\t\t\t\t//insert a player with minimal data\n\t\t\t\t\t\t\t\t\t\t\t\t$playerid = self::insertBasicInfoPlayer($lineupvisitor['id'], $rowTeamB ['team_id']);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t\t$player_name_seo = $urlGen->getPlayerMasterProfileUrl ( $playerid [\"player_nickname\"], $playerid [\"player_firstname\"], $playerid [\"player_lastname\"], $playerid [\"player_id\"], true, $playerid [\"player_common_name\"] );\n\t\t\t\t\t\t\t\t\t\t$player_shortname = $playerid ['player_name_short'];\n\t\t\t\t\t\t\t\t\t\t$matchscore = null;\n\t\t\t\t\t\t\t\t\t\t$playersPathName = $this->getplayerimage($lineupvisitor['playerid']);\n\t\t\t\t\t\t\t\t\t\t$event = null;\n\t\t\t\t\t\t\t\t\t\t$event = array(\n\t\t\t\t\t\t\t\t\t\t\t'id' => 'E' . $match ['id'] . $j,\n\t\t\t\t\t\t\t\t\t\t\t'eventtype' => 'L',\n\t\t\t\t\t\t\t\t\t\t\t'player_id' => $lineupvisitor['id'],\n\t\t\t\t\t\t\t\t\t\t\t'date_event' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\tself::insertLineUpActivity ( $event, $player_name_seo, $player_shortname, $matchTeams, $matchUrl, $matchscore, $playersPathName, $match_id,null );\n\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tself::$logger->debug ( \"Player Id missing for event Lineup on match:\" .$match ['id'] .\" for team: \". $rowTeamB ['team_id']);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t} catch ( Exception $e ) {\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\tself::$logger->err ( \"Caught LINEUP VISITOR exception: \" . get_class ( $e ) . \" ->\" . $e->getMessage () );\n\t\t\t\t\t\t\t\t\tself::$logger->err ( $e->getTraceAsString () . \"\\n-----------------------------\" );\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$k++;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//localteam subs\n\t\t\t\t\t\t\t$l = $k;\n\t\t\t\t\t\t \t$ll = $k +1;\n\t\t\t\t\t\t\tforeach($match->substitutions->localteam->substitution as $sublocal){\n\t\t\t\t\t\t\t\tif ($sublocal['minute'] != \"\") {\n\t\t\t\t\t\t\t\t\t//Event Sub Local In\n\t\t\t\t\t\t\t\t\t$datasublocalIn = array(\n\t\t\t\t\t\t\t\t\t\t'event_id' => 'E' . $match ['id'] . $l,\n\t\t\t\t\t\t\t\t\t\t'player_id' => $sublocal['player_in_id'],\n\t\t\t\t\t\t\t\t\t\t'event_type_id'=>'SI',\n\t\t\t\t\t\t\t\t\t\t'match_id' => 'G' . $match ['id'],\n\t\t\t\t\t\t\t\t\t\t'event_minute' => $sublocal['minute'],\n\t\t\t\t\t\t\t\t\t\t'team_id' => $rowTeamA ['team_id'],\n\t\t\t\t\t\t\t\t\t\t'time' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t'jersey_number' => $sublocal['player_in_number'],\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\techo '---->Inserting Matchevent: <strong>' . 'E' . $match ['id'] . $l . '</strong> Event: <b>SI</b> - Team: '. $rowTeamA ['team_id'] .' - Player: '. $sublocal['player_in_id'] .'<br>';\n\t\t\t\t\t\t\t\t\t//Zend_Debug::dump($datasublocalIn).\"<BR>\";\n\t\t\t\t\t\t\t\t\t$matchEventObject->insert ( $datasublocalIn );\n\n\t\t\t\t\t\t\t\t\t//activity Sub Local In\n\t\t\t\t\t\t\t\t\t$playerid = $player->fetchRow ( 'player_id = ' . $sublocal['player_in_id'] );\n\n\t\t\t\t\t\t\t\t\t//Insert New PLayer HERE - Added 5-5-13\n\t\t\t\t\t\t\t\t\tif ($playerid == null) {\n\t\t\t\t\t\t\t\t\t\tself::$logger->debug ( 'Sub in Local Player NOT FOUND on DB - playerId: ' .$sublocal['player_in_id'] );\n\t\t\t\t\t\t\t\t\t\t$playerid = self::insertNewPlayer($sublocal['player_in_id'] ,$rowTeamA ['team_id']);\n\t\t\t\t\t\t\t\t\t\tif($playerid == null){\n\t\t\t\t\t\t\t\t\t\t\t//insert a player with minimal data\n\t\t\t\t\t\t\t\t\t\t\t$playerid = self::insertBasicInfoPlayer($sublocal['player_in_id'], $rowTeamA ['team_id']);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$player_name_seo = $urlGen->getPlayerMasterProfileUrl ( $playerid [\"player_nickname\"], $playerid [\"player_firstname\"], $playerid [\"player_lastname\"], $playerid [\"player_id\"], true, $playerid [\"player_common_name\"] );\n\t\t\t\t\t\t\t\t\t$player_shortname = $playerid ['player_name_short'];\n\t\t\t\t\t\t\t\t\t$matchscore = null;\n\t\t\t\t\t\t\t\t\t$playersPathNameIn = $this->getplayerimage($sublocal['player_in_id']);\n\t\t\t\t\t\t\t\t\t$event = null;\n\t\t\t\t\t\t\t\t\t$eventIn = array(\n\t\t\t\t\t\t\t\t\t\t'id' => 'E' . $match ['id'] . $l,\n\t\t\t\t\t\t\t\t\t\t'eventtype' => 'SI',\n\t\t\t\t\t\t\t\t\t\t'player_id' => $sublocal['player_in_id'],\n\t\t\t\t\t\t\t\t\t\t'date_event' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t'game_minute'=> $sublocal['minute']\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\tself::insertSubstitutionActivity ( $eventIn, $player_name_seo, $player_shortname, $matchTeams, $matchUrl, $matchscore, $playersPathNameIn,$match_id,null );\n\n\t\t\t\t\t\t\t\t\t//Event Sub Local Out\n\t\t\t\t\t\t\t\t\t$datasublocalOut = array(\n\t\t\t\t\t\t\t\t\t\t'event_id' => 'E' . $match ['id'] . $ll,\n\t\t\t\t\t\t\t\t\t\t'player_id' => $sublocal['player_out_id'],\n\t\t\t\t\t\t\t\t\t\t'event_type_id'=>'SO',\n\t\t\t\t\t\t\t\t\t\t'match_id' => 'G' . $match ['id'],\n\t\t\t\t\t\t\t\t\t\t'event_minute' => $sublocal['minute'],\n\t\t\t\t\t\t\t\t\t\t'team_id' => $rowTeamA ['team_id'],\n\t\t\t\t\t\t\t\t\t\t'time' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\techo '---->Inserting Matchevent: <strong>' . 'E' . $match ['id'] . $ll . '</strong> Event: <b>SO</b> - Team: '. $rowTeamA ['team_id'] .' - Player: '. $sublocal['player_out_id'] .'<br>';\n\t\t\t\t\t\t\t\t\t//Zend_Debug::dump($datasublocalOut).\"<BR>\";\n\t\t\t\t\t\t\t\t\t$matchEventObject->insert ( $datasublocalOut );\n\n\t\t\t\t\t\t\t\t\t//activity Sub Local Out\n\t\t\t\t\t\t\t\t\t$playerid = $player->fetchRow ( 'player_id = ' . $sublocal['player_out_id'] );\n\t\t\t\t\t\t\t\t\t$player_name_seo = $urlGen->getPlayerMasterProfileUrl ( $playerid [\"player_nickname\"], $playerid [\"player_firstname\"], $playerid [\"player_lastname\"], $playerid [\"player_id\"], true, $playerid [\"player_common_name\"] );\n\t\t\t\t\t\t\t\t\t$player_shortname = $playerid ['player_name_short'];\n\t\t\t\t\t\t\t\t\t$matchscore = null;\n\t\t\t\t\t\t\t\t\t$playersPathNameOut = $this->getplayerimage($sublocal['player_out_id']);\n\t\t\t\t\t\t\t\t\t$event = null;\n\t\t\t\t\t\t\t\t\t$eventOut = array(\n\t\t\t\t\t\t\t\t\t\t'id' => 'E' . $match ['id'] . $ll,\n\t\t\t\t\t\t\t\t\t\t'eventtype' => 'SO',\n\t\t\t\t\t\t\t\t\t\t'player_id' => $sublocal['player_out_id'],\n\t\t\t\t\t\t\t\t\t\t'date_event' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t'game_minute'=> $sublocal['minute']\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tself::insertSubstitutionActivity ( $eventOut, $player_name_seo, $player_shortname, $matchTeams, $matchUrl, $matchscore, $playersPathNameOut,$match_id,null );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$l = $l+2;$ll=$ll+2;}\n\n\t\t\t\t\t\t\t//visitorteam subs\n\t\t\t\t\t\t\t$m = $l;\n\t\t\t\t\t\t\t$n = $ll;\n\t\t\t\t\t\t\tforeach($match->substitutions->visitorteam->substitution as $subvisitor){\n\t\t\t\t\t\t\t\tif ($subvisitor['minute'] != \"\") {\n\t\t\t\t\t\t\t\t\t$datasubvisitorIn = array(\n\t\t\t\t\t\t\t\t\t\t'event_id' => 'E' . $match ['id'] . $m,\n\t\t\t\t\t\t\t\t\t\t'player_id' => $subvisitor['player_in_id'],\n\t\t\t\t\t\t\t\t\t\t'event_type_id'=>'SI',\n\t\t\t\t\t\t\t\t\t\t'match_id' => 'G' . $match ['id'],\n\t\t\t\t\t\t\t\t\t\t'event_minute' => $subvisitor['minute'],\n\t\t\t\t\t\t\t\t\t\t'team_id' => $rowTeamB ['team_id'],\n\t\t\t\t\t\t\t\t\t\t'time' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t'jersey_number' => $subvisitor['player_in_number'],\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\techo '---->Inserting Matchevent: <strong>' . 'E' . $match ['id'] . $m . '</strong> Event: <b>SI</b> - Team: '. $rowTeamB ['team_id'] .' - Player: '. $subvisitor['player_in_id'] .'<br>';\n\t\t\t\t\t\t\t\t\t//Zend_Debug::dump($datasubvisitorIn).\"<BR>\";\n\t\t\t\t\t\t\t\t\t$matchEventObject->insert ( $datasubvisitorIn );\n\n\t\t\t\t\t\t\t\t\t//activity Sub Visitor In\n\t\t\t\t\t\t\t\t\t$playerid = $player->fetchRow ( 'player_id = ' . $subvisitor['player_in_id'] );\n\n\t\t\t\t\t\t\t\t\t//Insert New PLayer HERE - Added 5-5-13\n\t\t\t\t\t\t\t\t\tif ($playerid == null) {\n\t\t\t\t\t\t\t\t\t\tself::$logger->debug ( 'Sub in Visitor Player NOT FOUND on DB - playerId: ' .$subvisitor['player_in_id'] );\n\t\t\t\t\t\t\t\t\t\t$playerid = self::insertNewPlayer($subvisitor['player_in_id'] ,$rowTeamB ['team_id']);\n\t\t\t\t\t\t\t\t\t\tif($playerid == null){\n\t\t\t\t\t\t\t\t\t\t\t//insert a player with minimal data\n\t\t\t\t\t\t\t\t\t\t\t$playerid = self::insertBasicInfoPlayer($subvisitor['player_in_id'], $rowTeamB ['team_id']);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$player_name_seo = $urlGen->getPlayerMasterProfileUrl ( $playerid [\"player_nickname\"], $playerid [\"player_firstname\"], $playerid [\"player_lastname\"], $playerid [\"player_id\"], true, $playerid [\"player_common_name\"] );\n\t\t\t\t\t\t\t\t\t$player_shortname = $playerid ['player_name_short'];\n\t\t\t\t\t\t\t\t\t$matchscore = null;\n\t\t\t\t\t\t\t\t\t$playersPathNameIn = $this->getplayerimage($subvisitor['player_in_id']);\n\t\t\t\t\t\t\t\t\t$eventIn = null;\n\t\t\t\t\t\t\t\t\t$eventIn = array(\n\t\t\t\t\t\t\t\t\t\t'id' => 'E' . $match ['id'] . $m,\n\t\t\t\t\t\t\t\t\t\t'eventtype' => 'SI',\n\t\t\t\t\t\t\t\t\t\t'player_id' => $subvisitor['player_in_id'],\n\t\t\t\t\t\t\t\t\t\t'date_event' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t'game_minute'=> $subvisitor['minute']\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tself::insertSubstitutionActivity ( $eventIn, $player_name_seo, $player_shortname, $matchTeams, $matchUrl, $matchscore, $playersPathNameIn,$match_id,null );\n\n\t\t\t\t\t\t\t\t\t$datasubvisitorOut = array(\n\t\t\t\t\t\t\t\t\t\t'event_id' => 'E' . $match ['id'] . $n,\n\t\t\t\t\t\t\t\t\t\t'player_id' => $subvisitor['player_out_id'],\n\t\t\t\t\t\t\t\t\t\t'event_type_id'=>'SO',\n\t\t\t\t\t\t\t\t\t\t'match_id' => 'G' . $match ['id'],\n\t\t\t\t\t\t\t\t\t\t'event_minute' => $subvisitor['minute'],\n\t\t\t\t\t\t\t\t\t\t'team_id' => $rowTeamB ['team_id'],\n\t\t\t\t\t\t\t\t\t\t'time' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\techo '---->Inserting Matchevent: <strong>' . 'E' . $match ['id'] . $n . '</strong> Event: <b>SO</b> - Team: '. $rowTeamB ['team_id'] .' - Player: '. $subvisitor['player_out_id'] .'<br>';\n\t\t\t\t\t\t\t\t\t//Zend_Debug::dump($datasubvisitorOut).\"<BR>\";\n\t\t\t\t\t\t\t\t\t$matchEventObject->insert ( $datasubvisitorOut );\n\n\t\t\t\t\t\t\t\t\t//activity Sub Visitor Out\n\t\t\t\t\t\t\t\t\t$playerid = $player->fetchRow ( 'player_id = ' . $subvisitor['player_out_id'] );\n\t\t\t\t\t\t\t\t\t$player_name_seo = $urlGen->getPlayerMasterProfileUrl ( $playerid [\"player_nickname\"], $playerid [\"player_firstname\"], $playerid [\"player_lastname\"], $playerid [\"player_id\"], true, $playerid [\"player_common_name\"] );\n\t\t\t\t\t\t\t\t\t$player_shortname = $playerid ['player_name_short'];\n\t\t\t\t\t\t\t\t\t$matchscore = null;\n\t\t\t\t\t\t\t\t\t$playersPathNameOut = $this->getplayerimage($subvisitor['player_out_id']);\n\t\t\t\t\t\t\t\t\t$eventOut = null;\n\t\t\t\t\t\t\t\t\t$eventOut = array(\n\t\t\t\t\t\t\t\t\t\t'id' => 'E' . $match ['id'] . $n,\n\t\t\t\t\t\t\t\t\t\t'eventtype' => 'SO',\n\t\t\t\t\t\t\t\t\t\t'player_id' => $subvisitor['player_out_id'],\n\t\t\t\t\t\t\t\t\t\t'date_event' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t'game_minute'=> $subvisitor['minute']\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tself::insertSubstitutionActivity ( $eventOut, $player_name_seo, $player_shortname, $matchTeams, $matchUrl, $matchscore, $playersPathNameOut,$match_id,null );\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$m=$m+2;$n=$n+2;}\n\n\t\t\t\t\t\t\t// localteam cards\n\t\t\t\t\t\t\t$p = $m;\n\t\t\t\t\t\t\tforeach($match->lineups->localteam->player as $lineuplocal) {\n\t\t\t\t\t\t\t\tif($lineuplocal['booking'] != \"\") {\n\t\t\t\t\t\t\t\t\tif ($lineuplocal['id'] != \"\") {\n\t\t\t\t\t\t\t\t\t\t$event_card_local = explode(\" \",$lineuplocal['booking']);\n\t\t\t\t\t\t\t\t\t\t// lineup local cards event\n\t\t\t\t\t\t\t\t\t\t$datacardlocal = array (\n\t\t\t\t\t\t\t\t\t\t\t'event_id' => 'E' . $match ['id'] . $p,\n\t\t\t\t\t\t\t\t\t\t\t'player_id' => $lineuplocal['id'],\n\t\t\t\t\t\t\t\t\t\t\t'event_type_id'=>$event_card_local[0],\n\t\t\t\t\t\t\t\t\t\t\t'match_id' => 'G' . $match ['id'],\n\t\t\t\t\t\t\t\t\t\t\t'team_id' => $rowTeamA ['team_id'],\n\t\t\t\t\t\t\t\t\t\t\t'event_minute' => $event_card_local[1],\n\t\t\t\t\t\t\t\t\t\t\t'time' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\techo '---->Inserting Matchevent: <strong>' . 'E' . $match ['id'] . $p. '</strong> Event: <b>'.$event_card_local[0].'</b> - Team: '. $rowTeamA ['team_id'] .' - Player: '. $lineuplocal['id'] .'<br>';\n\t\t\t\t\t\t\t\t\t\t$matchEventObject->insert ( $datacardlocal );\n\n\t\t\t\t\t\t\t\t\t\t// lineup local cards activity\n\t\t\t\t\t\t\t\t\t\t$playerid = $player->fetchRow ( 'player_id = ' . $lineuplocal['id'] );\n\t\t\t\t\t\t\t\t\t\t$player_name_seo = $urlGen->getPlayerMasterProfileUrl ( $playerid [\"player_nickname\"], $playerid [\"player_firstname\"], $playerid [\"player_lastname\"], $playerid [\"player_id\"], true, $playerid [\"player_common_name\"] );\n\t\t\t\t\t\t\t\t\t\t$player_shortname = $playerid ['player_name_short'];\n\t\t\t\t\t\t\t\t\t\t$matchscore = null;\n\t\t\t\t\t\t\t\t\t\t$playersPathName = $this->getplayerimage($lineuplocal['id']);\n\t\t\t\t\t\t\t\t\t\t$event = array(\n\t\t\t\t\t\t\t\t\t\t'id' => 'E' . $match ['id'] . $p,\n\t\t\t\t\t\t\t\t\t\t'eventtype' => $event_card_local[0],\n\t\t\t\t\t\t\t\t\t\t'player_id' => $lineuplocal['id'],\n\t\t\t\t\t\t\t\t\t\t'date_event' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t'game_minute'=> $event_card_local[1]\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tself::insertCardsActivity ( $event, $player_name_seo, $player_shortname, $matchTeams, $matchUrl, $matchscore, $playersPathName, $match_id,null);\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$p++;}\n\n\t\t\t\t\t\t\t// visitor team cards\n\t\t\t\t\t\t\t$q=$p;\n\t\t\t\t\t\t\tforeach($match->lineups->visitorteam->player as $lineupvisitor) {\n\t\t\t\t\t\t\t\tif($lineupvisitor['booking'] != \"\") {\n\t\t\t\t\t\t\t\t\tif ($lineupvisitor['id'] != \"\") {\n\t\t\t\t\t\t\t\t\t\t$event_card_visitor = explode(\" \",$lineupvisitor['booking']);\n\t\t\t\t\t\t\t\t\t\t// lineup visitor cards event\n\t\t\t\t\t\t\t\t\t\t$datacardvisitor = array (\n\t\t\t\t\t\t\t\t\t\t\t'event_id' => 'E' . $match ['id'] . $q,\n\t\t\t\t\t\t\t\t\t\t\t'player_id' => $lineupvisitor['id'],\n\t\t\t\t\t\t\t\t\t\t\t'event_type_id'=>$event_card_visitor[0],\n\t\t\t\t\t\t\t\t\t\t\t'match_id' => 'G' . $match ['id'],\n\t\t\t\t\t\t\t\t\t\t\t'team_id' => $rowTeamB ['team_id'],\n\t\t\t\t\t\t\t\t\t\t\t'event_minute' => $event_card_visitor[1],\n\t\t\t\t\t\t\t\t\t\t\t'time' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\techo '---->Inserting Matchevent: <strong>' . 'E' . $match ['id'] . $q. '</strong> Event: <b>'.$event_card_visitor[0].'</b> - Team: '. $rowTeamB ['team_id'] .' - Player: '. $lineupvisitor['id'] .'<br>';\n\t\t\t\t\t\t\t\t\t\t$matchEventObject->insert ( $datacardvisitor );\n\n\t\t\t\t\t\t\t\t\t\t// lineup visitor cards activity\n\t\t\t\t\t\t\t\t\t\t$playerid = $player->fetchRow ( 'player_id = ' . $lineupvisitor['id'] );\n\t\t\t\t\t\t\t\t\t\t$player_name_seo = $urlGen->getPlayerMasterProfileUrl ( $playerid [\"player_nickname\"], $playerid [\"player_firstname\"], $playerid [\"player_lastname\"], $playerid [\"player_id\"], true, $playerid [\"player_common_name\"] );\n\t\t\t\t\t\t\t\t\t\t$player_shortname = $playerid ['player_name_short'];\n\t\t\t\t\t\t\t\t\t\t$matchscore = null;\n\t\t\t\t\t\t\t\t\t\t$playersPathName = $this->getplayerimage($lineupvisitor['id']);\n\t\t\t\t\t\t\t\t\t\t$event = array(\n\t\t\t\t\t\t\t\t\t\t'id' => 'E' . $match ['id'] . $q,\n\t\t\t\t\t\t\t\t\t\t'eventtype' => $event_card_local[0],\n\t\t\t\t\t\t\t\t\t\t'player_id' => $lineupvisitor['id'],\n\t\t\t\t\t\t\t\t\t\t'date_event' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t'game_minute'=> $event_card_local[1]\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tself::insertCardsActivity ( $event, $player_name_seo, $player_shortname, $matchTeams, $matchUrl, $matchscore, $playersPathName, $match_id,null);\n\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$q++;}\n\n\t\t\t\t\t\t\t//localteam sub cards\n\t\t\t\t\t\t\t$r = $q;\n\t\t\t\t\t\t\tforeach($match->substitutions->localteam->substitution as $sublocal){\n\n\t\t\t\t\t\t\t\tif ($sublocal['player_in_booking'] != \"\") {\n\t\t\t\t\t\t\t\t\t\t$event_card_sublocal = explode(\" \",$sublocal['player_in_booking']);\n\t\t\t\t\t\t\t\t\t\t$datacardlocalsub = array (\n\t\t\t\t\t\t\t\t\t\t\t'event_id' => 'E' . $match ['id'] . $r,\n\t\t\t\t\t\t\t\t\t\t\t'player_id' => $sublocal['player_in_id'],\n\t\t\t\t\t\t\t\t\t\t\t'event_type_id'=>$event_card_sublocal[0],\n\t\t\t\t\t\t\t\t\t\t\t'match_id' => 'G' . $match ['id'],\n\t\t\t\t\t\t\t\t\t\t\t'team_id' => $rowTeamA ['team_id'],\n\t\t\t\t\t\t\t\t\t\t\t'event_minute' => $event_card_sublocal[1],\n\t\t\t\t\t\t\t\t\t\t\t'time' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\techo '---->Inserting Matchevent: <strong>' . 'E' . $match ['id'] . $r. '</strong> Event: <b>'.$event_card_sublocal[0].'</b> - Team: '. $rowTeamA ['team_id'] .' - Player: '. $sublocal['player_in_id'] .'<br>';\n\t\t\t\t\t\t\t\t\t\t$matchEventObject->insert ( $datacardlocalsub );\n\n\t\t\t\t\t\t\t\t\t\t//subs In localteam cards activity\n\t\t\t\t\t\t\t\t\t\t$playerid = $player->fetchRow ( 'player_id = ' . $sublocal['player_in_id'] );\n\t\t\t\t\t\t\t\t\t\t$player_name_seo = $urlGen->getPlayerMasterProfileUrl ( $playerid [\"player_nickname\"], $playerid [\"player_firstname\"], $playerid [\"player_lastname\"], $playerid [\"player_id\"], true, $playerid [\"player_common_name\"] );\n\t\t\t\t\t\t\t\t\t\t$player_shortname = $playerid ['player_name_short'];\n\t\t\t\t\t\t\t\t\t\t$matchscore = null;\n\t\t\t\t\t\t\t\t\t\t$playersPathName = $this->getplayerimage($sublocal['player_in_id']);\n\t\t\t\t\t\t\t\t\t\t$event = array(\n\t\t\t\t\t\t\t\t\t\t'id' => 'E' . $match ['id'] . $q,\n\t\t\t\t\t\t\t\t\t\t'eventtype' => $event_card_local[0],\n\t\t\t\t\t\t\t\t\t\t'player_id' => $sublocal['player_in_id'],\n\t\t\t\t\t\t\t\t\t\t'date_event' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t'game_minute'=> $event_card_local[1]\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tself::insertCardsActivity ( $event, $player_name_seo, $player_shortname, $matchTeams, $matchUrl, $matchscore, $playersPathName, $match_id,null);\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$q++;}\n\n\t\t\t\t\t\t\t//visitorteam sub cards\n\t\t\t\t\t\t\t$s = $r;\n\t\t\t\t\t\t\tforeach($match->substitutions->visitorteam->substitution as $subvisitor){\n\t\t\t\t\t\t\t\tif ($subvisitor['player_in_booking'] != \"\") {\n\t\t\t\t\t\t\t\t\t\t$event_card_subvisitor = explode(\" \",$subvisitor['player_in_booking']);\n\t\t\t\t\t\t\t\t\t\t$datacardlocalvisitor = array (\n\t\t\t\t\t\t\t\t\t\t\t'event_id' => 'E' . $match ['id'] . $s,\n\t\t\t\t\t\t\t\t\t\t\t'player_id' => $subvisitor['player_in_id'],\n\t\t\t\t\t\t\t\t\t\t\t'event_type_id'=>$event_card_subvisitor[0],\n\t\t\t\t\t\t\t\t\t\t\t'match_id' => 'G' . $match ['id'],\n\t\t\t\t\t\t\t\t\t\t\t'team_id' => $rowTeamB ['team_id'],\n\t\t\t\t\t\t\t\t\t\t\t'event_minute' => $event_card_subvisitor[1],\n\t\t\t\t\t\t\t\t\t\t\t'time' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\techo '---->Inserting Matchevent: <strong>' . 'E' . $match ['id'] . $s. '</strong> Event: <b>'.$event_card_subvisitor[0].'</b> - Team: '. $rowTeamB ['team_id'] .' - Player: '. $subvisitor['player_in_id'] .'<br>';\n\t\t\t\t\t\t\t\t\t\t$matchEventObject->insert ( $datacardlocalvisitor );\n\n\t\t\t\t\t\t\t\t\t\t//subs In visitor cards activity\n\n\t\t\t\t\t\t\t\t\t\t$playerid = $player->fetchRow ( 'player_id = ' . $subvisitor['player_in_id'] );\n\t\t\t\t\t\t\t\t\t\t$player_name_seo = $urlGen->getPlayerMasterProfileUrl ( $playerid [\"player_nickname\"], $playerid [\"player_firstname\"], $playerid [\"player_lastname\"], $playerid [\"player_id\"], true, $playerid [\"player_common_name\"] );\n\t\t\t\t\t\t\t\t\t\t$player_shortname = $playerid ['player_name_short'];\n\t\t\t\t\t\t\t\t\t\t$matchscore = null;\n\t\t\t\t\t\t\t\t\t\t$playersPathName = $this->getplayerimage($subvisitor['player_in_id']);\n\t\t\t\t\t\t\t\t\t\t$event = array(\n\t\t\t\t\t\t\t\t\t\t'id' => 'E' . $match ['id'] . $q,\n\t\t\t\t\t\t\t\t\t\t'eventtype' => $event_card_local[0],\n\t\t\t\t\t\t\t\t\t\t'player_id' => $subvisitor['player_in_id'],\n\t\t\t\t\t\t\t\t\t\t'date_event' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t'game_minute'=> $event_card_local[1]\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tself::insertCardsActivity ( $event, $player_name_seo, $player_shortname, $matchTeams, $matchUrl, $matchscore, $playersPathName, $match_id,null);\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$s++;}\n\n\n\t\t\t\t\t\t} // Loop only when game status playing and halftime score not null\n\n\t\t\t\t} // End of foreach All Matches Loop\n\n\t\t\t} // End if row is !- null\n\n\t\t} // End of foreach Tournament\n\n }",
"function log_object($object)\n {\n info(print_r($object, true));\n }",
"function warquest_db_alliance_insert($pid1, $pid2, $approved) { \r\n\t\r\n\t/* Create alliance connection $pid1 -> $pid2 */\r\n\t$query = 'insert into player_player (pid1, pid2, approved, invite_date) values ';\r\n\t$query .= '('.$pid1.','.$pid2.','.$approved.',\"'.date(\"Y-m-d H:i:s\", time()).'\")';\r\n\t\r\n\treturn warquest_db_query($query);\r\n}",
"function clbase_log($name, $obj){\n\tif(WP_DEBUG===true){\n\t\tif(is_object($obj) || is_array($obj)){\n\t\t\t$obj_str = print_r($obj, true);\n\t\t\t$obj_str = $name . ': ' .str_replace(\"\\n\", '', $obj_str);\n\t\t}else{\n\t\t\t$obj_str = $name . ': ' .$obj;\n\t\t}\n\t\terror_log($obj_str);\n\t}\n}",
"public function debug();",
"function kb_debug() {\n\tstatic $kdb;\n\tif ( !isset( $kdb ) ) $kdb = new KB_Debug();\n\n\t$kdb->log( func_get_args() );\n}",
"function printDebug()\n {\n global $g_debuginfo, $config;\n \n // $ip = $this->getClientIP();\n // if($ip == \"62.238.226.167\")\n // {\n // if($config['debug']==2)\n // {\n echo \"<br><br>\";\n echo '<b>platform debug: </b>'.implode(\"<b><br>\\nplatform debug: </b>\",$g_debuginfo);\n echo \"<p>\";\n // } \n // }\n }",
"static public function debug() {\n\t\t\t$arrDebug = func_get_args();\n\t\t\t$strDebug = implode(': ', $arrDebug);\n\t\t\tself::getInstance()->handleDebug($strDebug);\n\t\t}",
"public function __debug();",
"public function debugDumpParams(){\r\n $this->stmt->debugDumpParams();\r\n }",
"function debugOut(){\n print $this->stat;\n print $this->req;\n }",
"public function log()\r\n {\r\n $this->log->debug($this->toString());\r\n }",
"protected function debug() {\n if ($this->debugFlag === true) {\n $arg_list = func_get_args();\n foreach ($arg_list as $v) {\n Mage::Log('[Sheepla][' . date('Y-m-d H:i:s') . ']' . print_r($v, true));\n if ($this->forceDebugFlag) {\n echo date('Y-m-d H:i:s') . ' : <pre>' . htmlentities(print_r($v, true)) . \"</pre> <br />\\n\\r\";\n }\n }\n }\n }"
] | [
"0.65935254",
"0.61047524",
"0.6067563",
"0.5956432",
"0.5915474",
"0.5683728",
"0.5641171",
"0.5598305",
"0.55886495",
"0.5585776",
"0.55690986",
"0.5545332",
"0.5537193",
"0.5534588",
"0.55210185",
"0.5494052",
"0.5484808",
"0.544324",
"0.5425847",
"0.54198635",
"0.5410797",
"0.54077595",
"0.53845924",
"0.5383139",
"0.5367311",
"0.5336625",
"0.53288615",
"0.5320091",
"0.53195524",
"0.5315565"
] | 0.7213842 | 0 |
self::$logger>debug ( "En insertNewPlayer para: ". $playerid . " y teamId" . $team_goalface_id); | private function insertNewPlayer($playerid,$team_goalface_id) {
$date = new Zend_Date ();
$today = $date->toString ( 'Y-MM-dd H:mm:ss' );
$teamplayer = new TeamPlayer ();
$player = new Player ();
$team = new Team();
$teamPlayer = new TeamPlayer();
$country = new Country ();
//USER when LIVE
$xml_player = $this->getgsfeed('soccerstats/player/'.$playerid);
//USE when Testing LOCALHOST
//$xml_player = $this->getdirectfeed('http://www.goalserve.com/getfeed/4ddbf5f84af0486b9958389cd0a68718/soccerstats/player/'.$playerid);
if ($xml_player != null || $xml_player != '') {
foreach ( $xml_player->player as $xmlPlayer ) {
$rowBirthCountry = $country->fetchRow ( 'country_name = "' . $xmlPlayer->birthcountry . '"' );
$rowNationalityCountry = $country->fetchRow ( 'country_name = "' . $xmlPlayer->nationality . '"' );
$mytempdate = str_replace('/', '-', $xmlPlayer->birthdate);
$mydate = date('Y-m-d', strtotime($mytempdate));
$arr_height = explode ( " ", $xmlPlayer->height, 2 );
$arr_weight = explode ( " ", $xmlPlayer->weight, 2 );
$player_height = $arr_height [0];
$player_weight = $arr_weight [0];
if ($xmlPlayer->position == "Attacker") {
$xmlPlayer->position = "Forward";
}
$dataPlayer = array ('player_id' => $playerid, //1
'player_firstname' => $xmlPlayer->firstname, //2
'player_middlename' => '',
'player_lastname' => $xmlPlayer->lastname, //3
'player_common_name' => $xmlPlayer->name,
'player_name_short' => (substr ( $xmlPlayer->firstname, 0, 1 ) . "." . " " . $xmlPlayer->lastname),
'player_dob' => $mydate, //4
'player_dob_city' => $xmlPlayer->birtplace,
'player_type' => 'player', //5
'player_country' => $rowBirthCountry ['country_id'], //5
'player_nationality' => $rowNationalityCountry ['country_id'], //5
'player_position' => $xmlPlayer->position, //5
'player_creation' => $today,
'player_height' => $player_height,
'player_weight' => $player_weight );
$dataTeamPlayer = array ('player_id' => $playerid,
'team_id' => $team_goalface_id,
'actual_team' => '1',);
}
$player->insert($dataPlayer);
$teamPlayer->insert($dataTeamPlayer);
//self::$logger->debug ( "Player Inserted Ok and updated teamPlayer: ". $playerid . " y teamId" . $team_goalface_id);
//find the new player and return it
$player = new Player();
$playerid = $player->fetchRow ( 'player_id = ' . $playerid );
return $playerid;
}
return null;
//Zend_Debug::dump($dataPlayer);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function insertBasicInfoPlayer($playerObject,$team_goalface_id) {\n\t\t$date = new Zend_Date ();\n\t\t$today = $date->toString ( 'Y-MM-dd H:mm:ss' );\n\t\t$teamplayer = new TeamPlayer ();\n\t\t$player = new Player ();\n\t\t$team = new Team();\n\t\t$teamPlayer = new TeamPlayer();\n\t\t$country = new Country ();\n\n\t\t$playerPosition = null;\n\t\tif ($playerObject['pos'] == \"G\") {\n\t\t\t$playerPosition = \"Goalkeeper\";\n\t\t}else if($playerObject['pos'] == \"D\"){\n\t\t\t$playerPosition = \"Defender\";\n\t\t}else if($playerObject['pos'] == \"M\"){\n\t\t\t$playerPosition = \"Midfielder\";\n\t\t}else if($playerObject['pos'] == \"F\"){\n\t\t\t$playerPosition = \"Forward\";\n\t\t}\n\n\t\t//<player number=\"4\" name=\"Luis�o\" pos=\"D\" id=\"147700\"/>\n\t\t$dataPlayer = array ('player_id' => $playerObject['id'], //1\n\t\t\t\t\t\t'player_firstname' => $playerObject['name'], //2\n\t\t\t\t\t\t'player_middlename' => '',\n\t\t\t\t\t\t'player_lastname' => $playerObject['name'], //3\n\t\t\t\t\t\t'player_common_name' => $playerObject['name'],\n\t\t\t\t\t\t'player_name_short' => $playerObject['name'],\n\t\t\t\t\t\t'PLAYER_DOB' => null, //4\n\t\t\t\t\t\t'player_dob_city' => null,\n\t\t\t\t\t\t'player_type' => 'player', //5\n\t\t\t\t\t\t'player_country' => null, //5\n\t\t\t\t\t\t'player_nationality' => null, //5\n\t\t\t\t\t\t'player_position' => $playerPosition, //5\n\t\t\t\t\t\t'player_creation' => $today,\n\t\t\t\t\t\t'player_height' => null,\n\t\t\t\t\t\t'player_weight' => null );\n\n\n\t\t\t\t$dataTeamPlayer = array ('player_id' => $playerObject['id'],\n\t\t\t\t\t\t'team_id' => $team_goalface_id,\n\t\t\t\t\t\t'actual_team' => '1',\n\t\t\t\t\t\t'jersey_number' => '',\n\t\t\t\t\t\t'start_date' => '',\n\t\t\t\t\t\t'end_date' => '' );\n\n\n\t\t\t$player->insert($dataPlayer);\n\t\t\t$teamPlayer->insert($dataTeamPlayer);\n\t\t\t//self::$logger->debug ( \"Player Basic Inserted Ok and updated teamPlayer: \". $playerObject['id'] . \" y teamId\" . $team_goalface_id);\n\t\t\t//find the new player and return it\n\t\t\t$player = new Player();\n\t\t\t$playerid = $player->fetchRow ( 'player_id = ' . $playerObject['id'] );\n\t\t\treturn $playerid;\n\n\t\t//Zend_Debug::dump($dataPlayer);\n\n\t}",
"function log($msg=\"\"){ if($this->debug){ echo $msg.\"\\n\"; } }",
"function warquest_db_alliance_insert($pid1, $pid2, $approved) { \r\n\t\r\n\t/* Create alliance connection $pid1 -> $pid2 */\r\n\t$query = 'insert into player_player (pid1, pid2, approved, invite_date) values ';\r\n\t$query .= '('.$pid1.','.$pid2.','.$approved.',\"'.date(\"Y-m-d H:i:s\", time()).'\")';\r\n\t\r\n\treturn warquest_db_query($query);\r\n}",
"public function get_playerid(){return $this->_playerid;}",
"public function debugAction() : string\n {\n // Deal with the action and return a response.\n // return __METHOD__ . \", \\$db is {$this->db}\";\n return \"Debug my game!!\";\n }",
"function lk_log_debug($message){\n $log = new DebugLog($message);\n $log ->save();\n}",
"function save_player_data()\n\t{\n\t\tglobal $database;\n\t\t$database->update_where('lg_game_players',\n\t\t\t\"game_id = '\".$database->escape($this->player_data['game_id']).\"' \n\t\t\tAND player_id = '\".$this->player_data['player_id'].\"'\"\n\t\t\t,$this->player_data);\t\n\t}",
"function warquest_db_player_insert($name, $pid) {\r\n\r\n\t/* input */\r\n\tglobal $config;\r\n\t\r\n\t/* Create user account */\r\n\t$query = 'insert into player (';\r\n\t$query .= 'pid, name, language, ';\r\n\t$query .= 'ammo, ammo_step, ammo_date, ';\r\n\t$query .= 'health, health_step, health_date, ';\r\n\t$query .= 'energy, energy_step, energy_date, ';\r\n\t$query .= 'money, money_step, money_date, ';\r\n\t$query .= 'bonus_date, ';\r\n\t$query .= 'restore_health, restore_energy, restore_ammo, cease_fire_date, holiday_date, ';\r\n\t$query .= 'bank1, bank2, bank3, ';\t\r\n\t$query .= 'lid, alliance, won_level, default_amount, bounty_level, rebel_level, mission_level,';\r\n\t$query .= 'request, request_date, last_battle, background, pattern, ';\r\n\t$query .= 'country, gold, planet, premium_date) ';\r\n\t$query .= 'values (';\t\r\n\t$query .= $pid.', \"'.warquest_db_escape($name).'\", \"en\", ';\r\n\t$query .= $config[\"init_ammo_max\"].', '.$config[\"init_ammo_step\"].', \"'.date(\"Y-m-d H:i:s\", (time()+$config[\"init_ammo_timer\"])).'\", ';\r\n\t$query .= $config[\"init_health_max\"].', '.$config[\"init_health_step\"].', \"'.date(\"Y-m-d H:i:s\", (time()+$config[\"init_health_timer\"])).'\", ';\t\r\n\t$query .= $config[\"init_energy_max\"].', '.$config[\"init_energy_step\"].', \"'.date(\"Y-m-d H:i:s\", (time()+$config[\"init_energy_timer\"])).'\", ';\r\n\t$query .= $config[\"init_money\"].', '.$config[\"init_money_step\"].', \"'.date(\"Y-m-d H:i:s\", (time()+$config[\"init_money_timer\"])).'\", ';\t\r\n\t$query .= '\"'.date(\"Y-m-d H:i:s\", time()-10).'\", ';\r\n\t$query .= '\"'.date(\"Y-m-d H:i:s\", time()-10).'\", \"'.date(\"Y-m-d H:i:s\", time()-10).'\", \"'.date(\"Y-m-d H:i:s\", time()-10).'\", \"'.date(\"Y-m-d H:i:s\", time()-10).'\", \"'.date(\"Y-m-d H:i:s\", time()-10).'\", ';\r\n\t$query .= $config[\"init_money_bank1\"].','.$config[\"init_money_bank2\"].','.$config[\"init_money_bank3\"].',';\r\n\t$query .= $config[\"init_level\"].', 1, 1, 1, 1, 1, 1, ';\r\n\t$query .= '1,\"'.date(\"Y-m-d H:i:s\", time()).'\", \"'.date(\"Y-m-d H:i:s\", time()).'\",2,\"0010000000000000\", ';\r\n\t$query .= '\"'.warquest_getlocation($_SERVER[\"REMOTE_ADDR\"]).'\", 0, '.PLANET_EARTH.',\"'.date(\"Y-m-d H:i:s\", time()).'\")'; \r\n\t\t\r\n\t$result = warquest_db_query($query);\r\n\t\r\n\t/* Initial bank balance */\r\n\tif ($config[\"init_money_bank1\"]>0) {\r\n\t\twarquest_db_bank_insert($pid, 0, 1, $config[\"init_money_bank1\"], $config[\"init_money_bank1\"], 4);\t\r\n\t}\r\n\tif ($config[\"init_money_bank2\"]>0) {\r\n\t\twarquest_db_bank_insert($pid, 0, 2, $config[\"init_money_bank2\"], $config[\"init_money_bank2\"], 4);\t\r\n\t}\r\n\tif ($config[\"init_money_bank3\"]>0) {\r\n\t\twarquest_db_bank_insert($pid, 0, 3, $config[\"init_money_bank3\"], $config[\"init_money_bank3\"], 4);\t\r\n\t}\t\r\n\t\r\n\treturn $result;\r\n}",
"function insertIntoDB()\n {\n if ($this->debug) echo \"<b>Warning:</b> DataObject::insertIntoDB called!<br>\";\n }",
"public function insertmatchesAction() {\n\n $date = new Zend_Date ();\n $matchObject = new Matchh ();\n\t\t$matchEventObject = new MatchEvent ();\n $league = new LeagueCompetition ();\n \t\t$team = new Team ();\n \t\t$player = new Player();\n\t\t$urlGen = new SeoUrlGen ();\n\n\t\t$comp_country = $this->_request->getParam ( 'country', null );\n\t\t$comp_gs_fix_name = $this->_request->getParam ( 'fixture', null );\n\t\t$stageid = $this->_request->getParam ( 'stage', null );\n\t\t$weeknumber = $this->_request->getParam ( 'week', null );\n\t\t$matchid = $this->_request->getParam ( 'matchid', null );\n\t\t$history = $this->_request->getParam ( 'history', null );\n\n\t\tif ($history == null) {\n\t\t\t$xml = $this->getgsfeed('soccerfixtures/'.$comp_country.'/'.$comp_gs_fix_name);\n\t\t} else {\n\t\t\t$xml = $this->getgsfeed('soccerhistory/'.$comp_country.'/'.$comp_gs_fix_name);\n\t\t}\n\n\t\tforeach ( $xml->tournament as $competition ) {\n\n\t\t\techo '<br><br>-><b>Competition :</b> ' . $competition ['id'] . \"<BR>\";\n\n\t\t\t$row = $league->findCompetitionByGoalserveId ( $competition ['id'] );\n\n\t\t\tif ($row != null) {\n\n\t\t\t\t$allmatches = self::getMatches($xml,$comp_country,$comp_gs_fix_name,$stageid,$weeknumber,$matchid,$competition ['stage_id']);\n\n\t\t\t\tforeach ($allmatches as $match) {\n\n\t\t\t\t\t\t//Does match exist on GoalFace DB\n\t\t\t\t\t\tself::$logger->debug ( \"Match Id Processing:\" .$match ['id']);\n\n\t\t\t\t\t\t$matchExist = $matchObject->fetchRow ( 'match_id_goalserve = ' .$match ['id'] );\n\n\t\t\t\t\t\t$match_id = 'G'. $match ['id'];\n\t\t\t\t\t\t$rowTeamA = $team->fetchRow ( 'team_gs_id = ' . $match->localteam ['id'] );\n\t\t\t\t\t\t$rowTeamB = $team->fetchRow ( 'team_gs_id = ' . $match->visitorteam ['id'] );\n\t\t\t\t\t\t$matchTeams = $rowTeamA [\"team_name\"] . \" vs \" . $rowTeamB [\"team_name\"] ;\n\t\t\t\t\t\t$matchUrl = $urlGen->getMatchPageUrl ( $row [\"competition_name\"], $rowTeamA [\"team_name\"], $rowTeamB [\"team_name\"], $match_id, true );\n\n\t\t\t\t\t\tif ((int)$match->localteam ['score'] > (int)$match->visitorteam ['score']) {\n\t\t\t\t\t\t\t$team_id_winner = $rowTeamA ['team_id'];\n\t\t\t\t\t\t} elseif ((int)$match->visitorteam ['score'] > (int)$match->localteam ['score']) {\n\t\t\t\t\t\t\t$team_id_winner = $rowTeamB ['team_id'];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$team_id_winner = '999';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($match ['time'] == 'TBA') {\n\t\t\t\t\t\t\t$timefeed = '16:00';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$timefeed = $match ['time'];\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ($match->localteam ['score'] != \"\" and $match->visitorteam ['score'] != \"\"){\n\t\t\t\t\t\t \t$mstatus = 'Played';\n\t\t\t\t\t\t } else {\n\t\t\t\t\t\t \t$mstatus = 'Fixture';\n\t\t\t\t\t\t }\n\n\n\t\t\t\t\t\t// convert feed date and time to format Y-m-d H:i:s to be used on creating zend date\n\t\t\t\t\t\t$mydate = date ( \"Y-m-d H:i:s\", strtotime ( $match ['date'] . \" \" . $timefeed ) );\n\t\t\t\t\t\t//get zend date based on feed date\n\t\t\t\t\t\t$zf_date = new Zend_Date ( $mydate, Zend_Date::ISO_8601 );\n\t\t\t\t\t\t//add 2 hrs to get the gmt +2 like enetpulse\n\t\t\t\t\t\t$gf_date = $zf_date->addHour ( 0 );\n\t\t\t\t\t\t//get new date and time\n\t\t\t\t\t\t$new_gf_date = $gf_date->toString ( 'yyyy-MM-dd' );\n\t\t\t\t\t\t$new_gf_time = $gf_date->toString ( 'HH:mm:ss' );\n\t\t\t\t\t\t// concatenate date + time for datetime field\n\t\t\t\t\t\t$datetime = strftime ( '%Y%m%d%H%M%S', strtotime ( $new_gf_date . ' ' . $new_gf_time ) );\n\t\t\t\t\t\t// remove / from 2011/2012 and also remove 20 to get 1112 and concatenate with competition id\n\t\t\t\t\t\t$season = str_replace ( '20', '', str_replace ( '/', '', $competition ['season'] ) ) . '' . $competition ['id'];\n\n\n\t\t\t\t\t\t//match doesn't exist on GoalFace DB insert it\n\t\t\t\t\t\tif ($matchExist == null ) {\n\t\t\t\t\t\t\t$datamatch = array (\n\t\t\t\t\t\t\t\t'match_id' => $match_id,\n\t\t\t\t\t\t\t\t'match_id_goalserve' => $match ['id'],\n\t\t\t\t\t\t\t\t'country_id' => $row ['country_id'],\n\t\t\t\t\t\t\t\t'competition_id' => $row ['competition_id'],\n\t\t\t\t\t\t\t\t'match_date' => $new_gf_date, //1\n\t\t\t\t\t\t\t\t'match_time' => $new_gf_time, //2\n\t\t\t\t\t\t\t\t'match_date_time' => $datetime,\n\t\t\t\t\t\t\t\t'match_status' => $mstatus,\n\t\t\t\t\t\t\t\t'match_winner' => $team_id_winner, //3\n\t\t\t\t\t\t\t\t'team_a' => $rowTeamA ['team_id'],\n\t\t\t\t\t\t\t\t'team_b' => $rowTeamB ['team_id'], //4\n\t\t\t\t\t\t\t\t'fs_team_a' => $match->localteam ['ft_score'],\n\t\t\t\t\t\t\t\t'fs_team_b' => $match->visitorteam ['ft_score'],\n\t\t\t\t\t\t\t\t'season_id' => $season,\n\t\t\t\t\t\t\t\t'round_id' => $match ['stageid'],\n\t\t\t\t\t\t\t\t'venue_id' => $match ['venue_id'],\n\t\t\t\t\t\t\t\t'week' => $match['week'],\n\t\t\t\t\t\t\t\t'aggrid' => $match['aggregate'],\n\t\t\t\t\t\t\t\t'static_id' => $match ['static_id'],\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$matchObject->insert ( $datamatch );\n\t\t\t\t\t\t\techo 'Inserting Match: <strong>' . $match_id . '</strong> - Date:'.$new_gf_date.' - Time: '.$new_gf_time.'<br>';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$datamatch = array (\n\t\t\t\t\t\t\t\t'match_date' => $new_gf_date, //1\n\t\t\t\t\t\t\t\t'match_time' => $new_gf_time, //2\n\t\t\t\t\t\t\t\t'match_date_time' => $datetime,\n\t\t\t\t\t\t\t\t'match_status' => $mstatus,\n\t\t\t\t\t\t\t\t'match_winner' => $team_id_winner, //3\n\t\t\t\t\t\t\t\t'fs_team_a' => $match->localteam ['ft_score'],\n\t\t\t\t\t\t\t\t'fs_team_b' => $match->visitorteam ['ft_score'],\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$matchObject->updateMatch( $match_id,$datamatch );\n\t\t\t\t\t\t\techo 'Updating Match: <strong>' . $match_id . '</strong> - Date:'.$new_gf_date.' - Time: '.$new_gf_time.'<br>';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Insert Events\n\t\t\t\t\t\tif ($match->halftime ['score'] != \"\" ) {\n\t\t\t\t\t\t\t// Insert Goal events\n\t\t\t\t\t\t\t$i = 1;\n\t\t\t\t\t\t\tforeach ($match->goals->goal as $goal) {\n\n\t\t\t\t\t\t\t\tif ($goal['playerid'] != \"\") {\n\t\t\t\t\t\t\t\t\tif ($goal['team'] == 'localteam') {\n\t\t\t\t\t\t\t\t\t\t$team_id_event = $rowTeamA ['team_id'];\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$team_id_event = $rowTeamB ['team_id'];\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Goals (G), Own Goals (OG), penalty goals (PG)\n\t\t\t\t\t\t\t\t\t$goaltype = array();\n\t\t\t\t\t\t\t\t\tpreg_match('/\\((.*?)\\)/',$goal['player'], $result);\n\t\t\t\t\t\t\t\t\tif(empty($result)) {\n\t\t\t\t\t\t\t\t\t\t$goalevent = 'G';\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$goalevent = $result[1];\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$dataevent = array (\n\t\t\t\t\t\t\t\t\t\t'event_id' => 'E' . $match ['id'] . $i,\n\t\t\t\t\t\t\t\t\t\t'player_id' => $goal['playerid'],\n\t\t\t\t\t\t\t\t\t\t'event_type_id'=> $goalevent, // G, OG or PG\n\t\t\t\t\t\t\t\t\t\t'match_id' => 'G' . $match ['id'],\n\t\t\t\t\t\t\t\t\t\t'team_id' => $team_id_event,\n\t\t\t\t\t\t\t\t\t\t'event_minute' => $goal['minute'],\n\t\t\t\t\t\t\t\t\t\t'time' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\techo '---->Inserting Matchevent: <strong>' . 'E' . $match ['id'] . $i . '</strong> Event: <b>G</b> - Player: '. $goal['playerid'] .'<br>';\n\t\t\t\t\t\t\t\t\t$matchEventObject->insert ( $dataevent );\n\n\n\t\t\t\t\t\t\t\t\t//Activiy Goal\n\t\t\t\t\t\t\t\t\t$event = null;\n\t\t\t\t\t\t\t\t\t$event = array (\n\t\t\t\t\t\t\t\t\t\t'id' => 'E' . $match ['id'] . $i,\n\t\t\t\t\t\t\t\t\t\t'eventtype' => $goalevent, // G, OG or PG\n\t\t\t\t\t\t\t\t\t\t'player_id' => $goal['playerid'],\n\t\t\t\t\t\t\t\t\t\t'game_minute' =>$goal['minute'],\n\t\t\t\t\t\t\t\t\t\t'date_event' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t$playerid = $player->fetchRow ( 'player_id = ' . $goal['playerid'] );\n\n\t\t\t\t\t\t\t\t\t$player_name_seo = $urlGen->getPlayerMasterProfileUrl ( $playerid [\"player_nickname\"], $playerid [\"player_firstname\"], $playerid [\"player_lastname\"], $playerid [\"player_id\"], true, $playerid [\"player_common_name\"] );\n\t\t\t\t\t\t\t\t\t$player_shortname = $playerid ['player_name_short'];\n\t\t\t\t\t\t\t\t\t$matchscore = $goal['score'];\n\t\t\t\t\t\t\t\t\t$playersPathName = $this->getplayerimage($goal['playerid']);\n\n\t\t\t\t\t\t\t\t\tself::insertGoalScoredActivity ( $event, $player_name_seo, $player_shortname, $matchTeams, $matchUrl, $matchscore, $playersPathName, $match_id,null );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tself::$logger->debug ( \"Inserting Player Id missing for event Goal on match:\" .$match ['id'] .\" - \". $match->localteam ['name'] .\"vs. \".$match->visitorteam ['name'] );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$i++;}\n\n\t\t\t\t\t\t\t// Insert Lineups events\n\t\t\t\t\t\t\t// localteam\n\t\t\t\t\t\t\t$j = $i;\n\t\t\t\t\t\t\tforeach($match->lineups->localteam->player as $lineuplocal) {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tif ($lineuplocal['id'] != \"\") {\n\t\t\t\t\t\t\t\t\t\t$datalineuplocal = array (\n\t\t\t\t\t\t\t\t\t\t\t'event_id' => 'E' . $match ['id'] . $j,\n\t\t\t\t\t\t\t\t\t\t\t'player_id' => $lineuplocal['id'],\n\t\t\t\t\t\t\t\t\t\t\t'event_type_id'=>'L',\n\t\t\t\t\t\t\t\t\t\t\t'match_id' => 'G' . $match ['id'],\n\t\t\t\t\t\t\t\t\t\t\t'team_id' => $rowTeamA ['team_id'],\n\t\t\t\t\t\t\t\t\t\t\t'time' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t\t'jersey_number' => $lineuplocal['number'],\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\techo '---->Inserting Matchevent: <strong>' . 'E' . $match ['id'] . $j . '</strong> Event: <b>L</b> - Team: '. $rowTeamA ['team_id'] .' - Player: '. $lineuplocal['id'] .'<br>';\n\t\t\t\t\t\t\t\t\t\t//Zend_Debug::dump($datalineuplocal).\"<BR>\";\n\t\t\t\t\t\t\t\t\t\t$matchEventObject->insert ( $datalineuplocal );\n\n\t\t\t\t\t\t\t\t\t\t//Activity Lineup Local\n\t\t\t\t\t\t\t\t\t\t$playerid = $player->fetchRow ( 'player_id = ' . $lineuplocal['id'] );\n\n\t\t\t\t\t\t\t\t\t\t// Added 5-5-13\n\t\t\t\t\t\t\t\t\t\tif ($playerid == null) {\n\t\t\t\t\t\t\t\t\t\t\tself::$logger->debug ( 'Lineup Local Player NOT FOUND on DB - playerId: ' .$lineuplocal['id'] );\n\t\t\t\t\t\t\t\t\t\t\t$playerid = self::insertNewPlayer($lineuplocal['id'] ,$rowTeamA ['team_id']);\n\t\t\t\t\t\t\t\t\t\t\tif($playerid == null){\n\t\t\t\t\t\t\t\t\t\t\t\t//insert a player with minimal data\n\t\t\t\t\t\t\t\t\t\t\t\t$playerid = self::insertBasicInfoPlayer($lineuplocal['id'], $rowTeamA ['team_id']);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t$player_name_seo = $urlGen->getPlayerMasterProfileUrl ( $playerid [\"player_nickname\"], $playerid [\"player_firstname\"], $playerid [\"player_lastname\"], $playerid [\"player_id\"], true, $playerid [\"player_common_name\"] );\n\t\t\t\t\t\t\t\t\t\t$player_shortname = $playerid ['player_name_short'];\n\t\t\t\t\t\t\t\t\t\t$matchscore = null;\n\t\t\t\t\t\t\t\t\t\t$playersPathName = $this->getplayerimage($lineuplocal['playerid']);\n\t\t\t\t\t\t\t\t\t\t$event = null;\n\t\t\t\t\t\t\t\t\t\t$event = array(\n\t\t\t\t\t\t\t\t\t\t\t'id' => 'E' . $match ['id'] . $j,\n\t\t\t\t\t\t\t\t\t\t\t'eventtype' => 'L',\n\t\t\t\t\t\t\t\t\t\t\t'player_id' => $lineuplocal['id'],\n\t\t\t\t\t\t\t\t\t\t\t'date_event' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\tself::insertLineUpActivity ( $event, $player_name_seo, $player_shortname, $matchTeams, $matchUrl, $matchscore, $playersPathName, $match_id,null );\n\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tself::$logger->debug ( \"Player Id missing for event Lineup on match:\" .$match ['id'] .\" for team: \". $rowTeamA ['team_id']);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t} catch ( Exception $e ) {\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\tself::$logger->err ( \"Caught LINEUP LOCAL exception: \" . get_class ( $e ) . \" ->\" . $e->getMessage () );\n\t\t\t\t\t\t\t\t\tself::$logger->err ( $e->getTraceAsString () . \"\\n-----------------------------\" );\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$j++;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// visitorteam\n\t\t\t\t\t\t\t$k = $j;\n\t\t\t\t\t\t\tforeach($match->lineups->visitorteam->player as $lineupvisitor) {\n\t\t\t\t\t\t\t\ttry{\n\n\t\t\t\t\t\t\t\t\tif ($lineupvisitor['id'] != \"\") {\n\t\t\t\t\t\t\t\t\t\t$datalineupvisitor = array (\n\t\t\t\t\t\t\t\t\t\t\t'event_id' => 'E' . $match ['id'] . $k,\n\t\t\t\t\t\t\t\t\t\t\t'player_id' => $lineupvisitor['id'],\n\t\t\t\t\t\t\t\t\t\t\t'event_type_id'=>'L',\n\t\t\t\t\t\t\t\t\t\t\t'match_id' => 'G' . $match ['id'],\n\t\t\t\t\t\t\t\t\t\t\t'team_id' => $rowTeamB ['team_id'],\n\t\t\t\t\t\t\t\t\t\t\t'time' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t\t'jersey_number' => $lineupvisitor['number'],\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\techo '---->Inserting Matchevent: <strong>' . 'E' . $match ['id'] . $k . '</strong> Event: <b>L</b> - Team: '. $rowTeamB ['team_id'] .' - Player: '. $lineupvisitor['id'] .'<br>';\n\t\t\t\t\t\t\t\t\t\t//Zend_Debug::dump($datalineupvisitor).\"<BR>\";\n\t\t\t\t\t\t\t\t\t\t$matchEventObject->insert ( $datalineupvisitor );\n\n\t\t\t\t\t\t\t\t\t\t//Activity Lineup Visitor\n\t\t\t\t\t\t\t\t\t\t$playerid = $player->fetchRow ( 'player_id = ' . $lineupvisitor['id'] );\n\n\t\t\t\t\t\t\t\t\t\t// Added 5-5-13\n\t\t\t\t\t\t\t\t\t\tif ($playerid == null) {\n\t\t\t\t\t\t\t\t\t\t\tself::$logger->debug ( 'Lineup Visitor Player NOT FOUND on DB - playerId: ' .$lineupvisitor['id'] );\n\t\t\t\t\t\t\t\t\t\t\t$playerid = self::insertNewPlayer($lineupvisitor['id'] ,$rowTeamB ['team_id']);\n\t\t\t\t\t\t\t\t\t\t\tif($playerid == null){\n\t\t\t\t\t\t\t\t\t\t\t\t//insert a player with minimal data\n\t\t\t\t\t\t\t\t\t\t\t\t$playerid = self::insertBasicInfoPlayer($lineupvisitor['id'], $rowTeamB ['team_id']);\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t\t$player_name_seo = $urlGen->getPlayerMasterProfileUrl ( $playerid [\"player_nickname\"], $playerid [\"player_firstname\"], $playerid [\"player_lastname\"], $playerid [\"player_id\"], true, $playerid [\"player_common_name\"] );\n\t\t\t\t\t\t\t\t\t\t$player_shortname = $playerid ['player_name_short'];\n\t\t\t\t\t\t\t\t\t\t$matchscore = null;\n\t\t\t\t\t\t\t\t\t\t$playersPathName = $this->getplayerimage($lineupvisitor['playerid']);\n\t\t\t\t\t\t\t\t\t\t$event = null;\n\t\t\t\t\t\t\t\t\t\t$event = array(\n\t\t\t\t\t\t\t\t\t\t\t'id' => 'E' . $match ['id'] . $j,\n\t\t\t\t\t\t\t\t\t\t\t'eventtype' => 'L',\n\t\t\t\t\t\t\t\t\t\t\t'player_id' => $lineupvisitor['id'],\n\t\t\t\t\t\t\t\t\t\t\t'date_event' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\t\tself::insertLineUpActivity ( $event, $player_name_seo, $player_shortname, $matchTeams, $matchUrl, $matchscore, $playersPathName, $match_id,null );\n\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tself::$logger->debug ( \"Player Id missing for event Lineup on match:\" .$match ['id'] .\" for team: \". $rowTeamB ['team_id']);\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t} catch ( Exception $e ) {\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\tself::$logger->err ( \"Caught LINEUP VISITOR exception: \" . get_class ( $e ) . \" ->\" . $e->getMessage () );\n\t\t\t\t\t\t\t\t\tself::$logger->err ( $e->getTraceAsString () . \"\\n-----------------------------\" );\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$k++;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//localteam subs\n\t\t\t\t\t\t\t$l = $k;\n\t\t\t\t\t\t \t$ll = $k +1;\n\t\t\t\t\t\t\tforeach($match->substitutions->localteam->substitution as $sublocal){\n\t\t\t\t\t\t\t\tif ($sublocal['minute'] != \"\") {\n\t\t\t\t\t\t\t\t\t//Event Sub Local In\n\t\t\t\t\t\t\t\t\t$datasublocalIn = array(\n\t\t\t\t\t\t\t\t\t\t'event_id' => 'E' . $match ['id'] . $l,\n\t\t\t\t\t\t\t\t\t\t'player_id' => $sublocal['player_in_id'],\n\t\t\t\t\t\t\t\t\t\t'event_type_id'=>'SI',\n\t\t\t\t\t\t\t\t\t\t'match_id' => 'G' . $match ['id'],\n\t\t\t\t\t\t\t\t\t\t'event_minute' => $sublocal['minute'],\n\t\t\t\t\t\t\t\t\t\t'team_id' => $rowTeamA ['team_id'],\n\t\t\t\t\t\t\t\t\t\t'time' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t'jersey_number' => $sublocal['player_in_number'],\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\techo '---->Inserting Matchevent: <strong>' . 'E' . $match ['id'] . $l . '</strong> Event: <b>SI</b> - Team: '. $rowTeamA ['team_id'] .' - Player: '. $sublocal['player_in_id'] .'<br>';\n\t\t\t\t\t\t\t\t\t//Zend_Debug::dump($datasublocalIn).\"<BR>\";\n\t\t\t\t\t\t\t\t\t$matchEventObject->insert ( $datasublocalIn );\n\n\t\t\t\t\t\t\t\t\t//activity Sub Local In\n\t\t\t\t\t\t\t\t\t$playerid = $player->fetchRow ( 'player_id = ' . $sublocal['player_in_id'] );\n\n\t\t\t\t\t\t\t\t\t//Insert New PLayer HERE - Added 5-5-13\n\t\t\t\t\t\t\t\t\tif ($playerid == null) {\n\t\t\t\t\t\t\t\t\t\tself::$logger->debug ( 'Sub in Local Player NOT FOUND on DB - playerId: ' .$sublocal['player_in_id'] );\n\t\t\t\t\t\t\t\t\t\t$playerid = self::insertNewPlayer($sublocal['player_in_id'] ,$rowTeamA ['team_id']);\n\t\t\t\t\t\t\t\t\t\tif($playerid == null){\n\t\t\t\t\t\t\t\t\t\t\t//insert a player with minimal data\n\t\t\t\t\t\t\t\t\t\t\t$playerid = self::insertBasicInfoPlayer($sublocal['player_in_id'], $rowTeamA ['team_id']);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$player_name_seo = $urlGen->getPlayerMasterProfileUrl ( $playerid [\"player_nickname\"], $playerid [\"player_firstname\"], $playerid [\"player_lastname\"], $playerid [\"player_id\"], true, $playerid [\"player_common_name\"] );\n\t\t\t\t\t\t\t\t\t$player_shortname = $playerid ['player_name_short'];\n\t\t\t\t\t\t\t\t\t$matchscore = null;\n\t\t\t\t\t\t\t\t\t$playersPathNameIn = $this->getplayerimage($sublocal['player_in_id']);\n\t\t\t\t\t\t\t\t\t$event = null;\n\t\t\t\t\t\t\t\t\t$eventIn = array(\n\t\t\t\t\t\t\t\t\t\t'id' => 'E' . $match ['id'] . $l,\n\t\t\t\t\t\t\t\t\t\t'eventtype' => 'SI',\n\t\t\t\t\t\t\t\t\t\t'player_id' => $sublocal['player_in_id'],\n\t\t\t\t\t\t\t\t\t\t'date_event' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t'game_minute'=> $sublocal['minute']\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\t\tself::insertSubstitutionActivity ( $eventIn, $player_name_seo, $player_shortname, $matchTeams, $matchUrl, $matchscore, $playersPathNameIn,$match_id,null );\n\n\t\t\t\t\t\t\t\t\t//Event Sub Local Out\n\t\t\t\t\t\t\t\t\t$datasublocalOut = array(\n\t\t\t\t\t\t\t\t\t\t'event_id' => 'E' . $match ['id'] . $ll,\n\t\t\t\t\t\t\t\t\t\t'player_id' => $sublocal['player_out_id'],\n\t\t\t\t\t\t\t\t\t\t'event_type_id'=>'SO',\n\t\t\t\t\t\t\t\t\t\t'match_id' => 'G' . $match ['id'],\n\t\t\t\t\t\t\t\t\t\t'event_minute' => $sublocal['minute'],\n\t\t\t\t\t\t\t\t\t\t'team_id' => $rowTeamA ['team_id'],\n\t\t\t\t\t\t\t\t\t\t'time' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\techo '---->Inserting Matchevent: <strong>' . 'E' . $match ['id'] . $ll . '</strong> Event: <b>SO</b> - Team: '. $rowTeamA ['team_id'] .' - Player: '. $sublocal['player_out_id'] .'<br>';\n\t\t\t\t\t\t\t\t\t//Zend_Debug::dump($datasublocalOut).\"<BR>\";\n\t\t\t\t\t\t\t\t\t$matchEventObject->insert ( $datasublocalOut );\n\n\t\t\t\t\t\t\t\t\t//activity Sub Local Out\n\t\t\t\t\t\t\t\t\t$playerid = $player->fetchRow ( 'player_id = ' . $sublocal['player_out_id'] );\n\t\t\t\t\t\t\t\t\t$player_name_seo = $urlGen->getPlayerMasterProfileUrl ( $playerid [\"player_nickname\"], $playerid [\"player_firstname\"], $playerid [\"player_lastname\"], $playerid [\"player_id\"], true, $playerid [\"player_common_name\"] );\n\t\t\t\t\t\t\t\t\t$player_shortname = $playerid ['player_name_short'];\n\t\t\t\t\t\t\t\t\t$matchscore = null;\n\t\t\t\t\t\t\t\t\t$playersPathNameOut = $this->getplayerimage($sublocal['player_out_id']);\n\t\t\t\t\t\t\t\t\t$event = null;\n\t\t\t\t\t\t\t\t\t$eventOut = array(\n\t\t\t\t\t\t\t\t\t\t'id' => 'E' . $match ['id'] . $ll,\n\t\t\t\t\t\t\t\t\t\t'eventtype' => 'SO',\n\t\t\t\t\t\t\t\t\t\t'player_id' => $sublocal['player_out_id'],\n\t\t\t\t\t\t\t\t\t\t'date_event' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t'game_minute'=> $sublocal['minute']\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tself::insertSubstitutionActivity ( $eventOut, $player_name_seo, $player_shortname, $matchTeams, $matchUrl, $matchscore, $playersPathNameOut,$match_id,null );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$l = $l+2;$ll=$ll+2;}\n\n\t\t\t\t\t\t\t//visitorteam subs\n\t\t\t\t\t\t\t$m = $l;\n\t\t\t\t\t\t\t$n = $ll;\n\t\t\t\t\t\t\tforeach($match->substitutions->visitorteam->substitution as $subvisitor){\n\t\t\t\t\t\t\t\tif ($subvisitor['minute'] != \"\") {\n\t\t\t\t\t\t\t\t\t$datasubvisitorIn = array(\n\t\t\t\t\t\t\t\t\t\t'event_id' => 'E' . $match ['id'] . $m,\n\t\t\t\t\t\t\t\t\t\t'player_id' => $subvisitor['player_in_id'],\n\t\t\t\t\t\t\t\t\t\t'event_type_id'=>'SI',\n\t\t\t\t\t\t\t\t\t\t'match_id' => 'G' . $match ['id'],\n\t\t\t\t\t\t\t\t\t\t'event_minute' => $subvisitor['minute'],\n\t\t\t\t\t\t\t\t\t\t'team_id' => $rowTeamB ['team_id'],\n\t\t\t\t\t\t\t\t\t\t'time' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t'jersey_number' => $subvisitor['player_in_number'],\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\techo '---->Inserting Matchevent: <strong>' . 'E' . $match ['id'] . $m . '</strong> Event: <b>SI</b> - Team: '. $rowTeamB ['team_id'] .' - Player: '. $subvisitor['player_in_id'] .'<br>';\n\t\t\t\t\t\t\t\t\t//Zend_Debug::dump($datasubvisitorIn).\"<BR>\";\n\t\t\t\t\t\t\t\t\t$matchEventObject->insert ( $datasubvisitorIn );\n\n\t\t\t\t\t\t\t\t\t//activity Sub Visitor In\n\t\t\t\t\t\t\t\t\t$playerid = $player->fetchRow ( 'player_id = ' . $subvisitor['player_in_id'] );\n\n\t\t\t\t\t\t\t\t\t//Insert New PLayer HERE - Added 5-5-13\n\t\t\t\t\t\t\t\t\tif ($playerid == null) {\n\t\t\t\t\t\t\t\t\t\tself::$logger->debug ( 'Sub in Visitor Player NOT FOUND on DB - playerId: ' .$subvisitor['player_in_id'] );\n\t\t\t\t\t\t\t\t\t\t$playerid = self::insertNewPlayer($subvisitor['player_in_id'] ,$rowTeamB ['team_id']);\n\t\t\t\t\t\t\t\t\t\tif($playerid == null){\n\t\t\t\t\t\t\t\t\t\t\t//insert a player with minimal data\n\t\t\t\t\t\t\t\t\t\t\t$playerid = self::insertBasicInfoPlayer($subvisitor['player_in_id'], $rowTeamB ['team_id']);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t$player_name_seo = $urlGen->getPlayerMasterProfileUrl ( $playerid [\"player_nickname\"], $playerid [\"player_firstname\"], $playerid [\"player_lastname\"], $playerid [\"player_id\"], true, $playerid [\"player_common_name\"] );\n\t\t\t\t\t\t\t\t\t$player_shortname = $playerid ['player_name_short'];\n\t\t\t\t\t\t\t\t\t$matchscore = null;\n\t\t\t\t\t\t\t\t\t$playersPathNameIn = $this->getplayerimage($subvisitor['player_in_id']);\n\t\t\t\t\t\t\t\t\t$eventIn = null;\n\t\t\t\t\t\t\t\t\t$eventIn = array(\n\t\t\t\t\t\t\t\t\t\t'id' => 'E' . $match ['id'] . $m,\n\t\t\t\t\t\t\t\t\t\t'eventtype' => 'SI',\n\t\t\t\t\t\t\t\t\t\t'player_id' => $subvisitor['player_in_id'],\n\t\t\t\t\t\t\t\t\t\t'date_event' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t'game_minute'=> $subvisitor['minute']\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tself::insertSubstitutionActivity ( $eventIn, $player_name_seo, $player_shortname, $matchTeams, $matchUrl, $matchscore, $playersPathNameIn,$match_id,null );\n\n\t\t\t\t\t\t\t\t\t$datasubvisitorOut = array(\n\t\t\t\t\t\t\t\t\t\t'event_id' => 'E' . $match ['id'] . $n,\n\t\t\t\t\t\t\t\t\t\t'player_id' => $subvisitor['player_out_id'],\n\t\t\t\t\t\t\t\t\t\t'event_type_id'=>'SO',\n\t\t\t\t\t\t\t\t\t\t'match_id' => 'G' . $match ['id'],\n\t\t\t\t\t\t\t\t\t\t'event_minute' => $subvisitor['minute'],\n\t\t\t\t\t\t\t\t\t\t'team_id' => $rowTeamB ['team_id'],\n\t\t\t\t\t\t\t\t\t\t'time' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\techo '---->Inserting Matchevent: <strong>' . 'E' . $match ['id'] . $n . '</strong> Event: <b>SO</b> - Team: '. $rowTeamB ['team_id'] .' - Player: '. $subvisitor['player_out_id'] .'<br>';\n\t\t\t\t\t\t\t\t\t//Zend_Debug::dump($datasubvisitorOut).\"<BR>\";\n\t\t\t\t\t\t\t\t\t$matchEventObject->insert ( $datasubvisitorOut );\n\n\t\t\t\t\t\t\t\t\t//activity Sub Visitor Out\n\t\t\t\t\t\t\t\t\t$playerid = $player->fetchRow ( 'player_id = ' . $subvisitor['player_out_id'] );\n\t\t\t\t\t\t\t\t\t$player_name_seo = $urlGen->getPlayerMasterProfileUrl ( $playerid [\"player_nickname\"], $playerid [\"player_firstname\"], $playerid [\"player_lastname\"], $playerid [\"player_id\"], true, $playerid [\"player_common_name\"] );\n\t\t\t\t\t\t\t\t\t$player_shortname = $playerid ['player_name_short'];\n\t\t\t\t\t\t\t\t\t$matchscore = null;\n\t\t\t\t\t\t\t\t\t$playersPathNameOut = $this->getplayerimage($subvisitor['player_out_id']);\n\t\t\t\t\t\t\t\t\t$eventOut = null;\n\t\t\t\t\t\t\t\t\t$eventOut = array(\n\t\t\t\t\t\t\t\t\t\t'id' => 'E' . $match ['id'] . $n,\n\t\t\t\t\t\t\t\t\t\t'eventtype' => 'SO',\n\t\t\t\t\t\t\t\t\t\t'player_id' => $subvisitor['player_out_id'],\n\t\t\t\t\t\t\t\t\t\t'date_event' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t'game_minute'=> $subvisitor['minute']\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tself::insertSubstitutionActivity ( $eventOut, $player_name_seo, $player_shortname, $matchTeams, $matchUrl, $matchscore, $playersPathNameOut,$match_id,null );\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$m=$m+2;$n=$n+2;}\n\n\t\t\t\t\t\t\t// localteam cards\n\t\t\t\t\t\t\t$p = $m;\n\t\t\t\t\t\t\tforeach($match->lineups->localteam->player as $lineuplocal) {\n\t\t\t\t\t\t\t\tif($lineuplocal['booking'] != \"\") {\n\t\t\t\t\t\t\t\t\tif ($lineuplocal['id'] != \"\") {\n\t\t\t\t\t\t\t\t\t\t$event_card_local = explode(\" \",$lineuplocal['booking']);\n\t\t\t\t\t\t\t\t\t\t// lineup local cards event\n\t\t\t\t\t\t\t\t\t\t$datacardlocal = array (\n\t\t\t\t\t\t\t\t\t\t\t'event_id' => 'E' . $match ['id'] . $p,\n\t\t\t\t\t\t\t\t\t\t\t'player_id' => $lineuplocal['id'],\n\t\t\t\t\t\t\t\t\t\t\t'event_type_id'=>$event_card_local[0],\n\t\t\t\t\t\t\t\t\t\t\t'match_id' => 'G' . $match ['id'],\n\t\t\t\t\t\t\t\t\t\t\t'team_id' => $rowTeamA ['team_id'],\n\t\t\t\t\t\t\t\t\t\t\t'event_minute' => $event_card_local[1],\n\t\t\t\t\t\t\t\t\t\t\t'time' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\techo '---->Inserting Matchevent: <strong>' . 'E' . $match ['id'] . $p. '</strong> Event: <b>'.$event_card_local[0].'</b> - Team: '. $rowTeamA ['team_id'] .' - Player: '. $lineuplocal['id'] .'<br>';\n\t\t\t\t\t\t\t\t\t\t$matchEventObject->insert ( $datacardlocal );\n\n\t\t\t\t\t\t\t\t\t\t// lineup local cards activity\n\t\t\t\t\t\t\t\t\t\t$playerid = $player->fetchRow ( 'player_id = ' . $lineuplocal['id'] );\n\t\t\t\t\t\t\t\t\t\t$player_name_seo = $urlGen->getPlayerMasterProfileUrl ( $playerid [\"player_nickname\"], $playerid [\"player_firstname\"], $playerid [\"player_lastname\"], $playerid [\"player_id\"], true, $playerid [\"player_common_name\"] );\n\t\t\t\t\t\t\t\t\t\t$player_shortname = $playerid ['player_name_short'];\n\t\t\t\t\t\t\t\t\t\t$matchscore = null;\n\t\t\t\t\t\t\t\t\t\t$playersPathName = $this->getplayerimage($lineuplocal['id']);\n\t\t\t\t\t\t\t\t\t\t$event = array(\n\t\t\t\t\t\t\t\t\t\t'id' => 'E' . $match ['id'] . $p,\n\t\t\t\t\t\t\t\t\t\t'eventtype' => $event_card_local[0],\n\t\t\t\t\t\t\t\t\t\t'player_id' => $lineuplocal['id'],\n\t\t\t\t\t\t\t\t\t\t'date_event' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t'game_minute'=> $event_card_local[1]\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tself::insertCardsActivity ( $event, $player_name_seo, $player_shortname, $matchTeams, $matchUrl, $matchscore, $playersPathName, $match_id,null);\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$p++;}\n\n\t\t\t\t\t\t\t// visitor team cards\n\t\t\t\t\t\t\t$q=$p;\n\t\t\t\t\t\t\tforeach($match->lineups->visitorteam->player as $lineupvisitor) {\n\t\t\t\t\t\t\t\tif($lineupvisitor['booking'] != \"\") {\n\t\t\t\t\t\t\t\t\tif ($lineupvisitor['id'] != \"\") {\n\t\t\t\t\t\t\t\t\t\t$event_card_visitor = explode(\" \",$lineupvisitor['booking']);\n\t\t\t\t\t\t\t\t\t\t// lineup visitor cards event\n\t\t\t\t\t\t\t\t\t\t$datacardvisitor = array (\n\t\t\t\t\t\t\t\t\t\t\t'event_id' => 'E' . $match ['id'] . $q,\n\t\t\t\t\t\t\t\t\t\t\t'player_id' => $lineupvisitor['id'],\n\t\t\t\t\t\t\t\t\t\t\t'event_type_id'=>$event_card_visitor[0],\n\t\t\t\t\t\t\t\t\t\t\t'match_id' => 'G' . $match ['id'],\n\t\t\t\t\t\t\t\t\t\t\t'team_id' => $rowTeamB ['team_id'],\n\t\t\t\t\t\t\t\t\t\t\t'event_minute' => $event_card_visitor[1],\n\t\t\t\t\t\t\t\t\t\t\t'time' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\techo '---->Inserting Matchevent: <strong>' . 'E' . $match ['id'] . $q. '</strong> Event: <b>'.$event_card_visitor[0].'</b> - Team: '. $rowTeamB ['team_id'] .' - Player: '. $lineupvisitor['id'] .'<br>';\n\t\t\t\t\t\t\t\t\t\t$matchEventObject->insert ( $datacardvisitor );\n\n\t\t\t\t\t\t\t\t\t\t// lineup visitor cards activity\n\t\t\t\t\t\t\t\t\t\t$playerid = $player->fetchRow ( 'player_id = ' . $lineupvisitor['id'] );\n\t\t\t\t\t\t\t\t\t\t$player_name_seo = $urlGen->getPlayerMasterProfileUrl ( $playerid [\"player_nickname\"], $playerid [\"player_firstname\"], $playerid [\"player_lastname\"], $playerid [\"player_id\"], true, $playerid [\"player_common_name\"] );\n\t\t\t\t\t\t\t\t\t\t$player_shortname = $playerid ['player_name_short'];\n\t\t\t\t\t\t\t\t\t\t$matchscore = null;\n\t\t\t\t\t\t\t\t\t\t$playersPathName = $this->getplayerimage($lineupvisitor['id']);\n\t\t\t\t\t\t\t\t\t\t$event = array(\n\t\t\t\t\t\t\t\t\t\t'id' => 'E' . $match ['id'] . $q,\n\t\t\t\t\t\t\t\t\t\t'eventtype' => $event_card_local[0],\n\t\t\t\t\t\t\t\t\t\t'player_id' => $lineupvisitor['id'],\n\t\t\t\t\t\t\t\t\t\t'date_event' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t'game_minute'=> $event_card_local[1]\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tself::insertCardsActivity ( $event, $player_name_seo, $player_shortname, $matchTeams, $matchUrl, $matchscore, $playersPathName, $match_id,null);\n\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$q++;}\n\n\t\t\t\t\t\t\t//localteam sub cards\n\t\t\t\t\t\t\t$r = $q;\n\t\t\t\t\t\t\tforeach($match->substitutions->localteam->substitution as $sublocal){\n\n\t\t\t\t\t\t\t\tif ($sublocal['player_in_booking'] != \"\") {\n\t\t\t\t\t\t\t\t\t\t$event_card_sublocal = explode(\" \",$sublocal['player_in_booking']);\n\t\t\t\t\t\t\t\t\t\t$datacardlocalsub = array (\n\t\t\t\t\t\t\t\t\t\t\t'event_id' => 'E' . $match ['id'] . $r,\n\t\t\t\t\t\t\t\t\t\t\t'player_id' => $sublocal['player_in_id'],\n\t\t\t\t\t\t\t\t\t\t\t'event_type_id'=>$event_card_sublocal[0],\n\t\t\t\t\t\t\t\t\t\t\t'match_id' => 'G' . $match ['id'],\n\t\t\t\t\t\t\t\t\t\t\t'team_id' => $rowTeamA ['team_id'],\n\t\t\t\t\t\t\t\t\t\t\t'event_minute' => $event_card_sublocal[1],\n\t\t\t\t\t\t\t\t\t\t\t'time' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\techo '---->Inserting Matchevent: <strong>' . 'E' . $match ['id'] . $r. '</strong> Event: <b>'.$event_card_sublocal[0].'</b> - Team: '. $rowTeamA ['team_id'] .' - Player: '. $sublocal['player_in_id'] .'<br>';\n\t\t\t\t\t\t\t\t\t\t$matchEventObject->insert ( $datacardlocalsub );\n\n\t\t\t\t\t\t\t\t\t\t//subs In localteam cards activity\n\t\t\t\t\t\t\t\t\t\t$playerid = $player->fetchRow ( 'player_id = ' . $sublocal['player_in_id'] );\n\t\t\t\t\t\t\t\t\t\t$player_name_seo = $urlGen->getPlayerMasterProfileUrl ( $playerid [\"player_nickname\"], $playerid [\"player_firstname\"], $playerid [\"player_lastname\"], $playerid [\"player_id\"], true, $playerid [\"player_common_name\"] );\n\t\t\t\t\t\t\t\t\t\t$player_shortname = $playerid ['player_name_short'];\n\t\t\t\t\t\t\t\t\t\t$matchscore = null;\n\t\t\t\t\t\t\t\t\t\t$playersPathName = $this->getplayerimage($sublocal['player_in_id']);\n\t\t\t\t\t\t\t\t\t\t$event = array(\n\t\t\t\t\t\t\t\t\t\t'id' => 'E' . $match ['id'] . $q,\n\t\t\t\t\t\t\t\t\t\t'eventtype' => $event_card_local[0],\n\t\t\t\t\t\t\t\t\t\t'player_id' => $sublocal['player_in_id'],\n\t\t\t\t\t\t\t\t\t\t'date_event' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t'game_minute'=> $event_card_local[1]\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tself::insertCardsActivity ( $event, $player_name_seo, $player_shortname, $matchTeams, $matchUrl, $matchscore, $playersPathName, $match_id,null);\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$q++;}\n\n\t\t\t\t\t\t\t//visitorteam sub cards\n\t\t\t\t\t\t\t$s = $r;\n\t\t\t\t\t\t\tforeach($match->substitutions->visitorteam->substitution as $subvisitor){\n\t\t\t\t\t\t\t\tif ($subvisitor['player_in_booking'] != \"\") {\n\t\t\t\t\t\t\t\t\t\t$event_card_subvisitor = explode(\" \",$subvisitor['player_in_booking']);\n\t\t\t\t\t\t\t\t\t\t$datacardlocalvisitor = array (\n\t\t\t\t\t\t\t\t\t\t\t'event_id' => 'E' . $match ['id'] . $s,\n\t\t\t\t\t\t\t\t\t\t\t'player_id' => $subvisitor['player_in_id'],\n\t\t\t\t\t\t\t\t\t\t\t'event_type_id'=>$event_card_subvisitor[0],\n\t\t\t\t\t\t\t\t\t\t\t'match_id' => 'G' . $match ['id'],\n\t\t\t\t\t\t\t\t\t\t\t'team_id' => $rowTeamB ['team_id'],\n\t\t\t\t\t\t\t\t\t\t\t'event_minute' => $event_card_subvisitor[1],\n\t\t\t\t\t\t\t\t\t\t\t'time' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\techo '---->Inserting Matchevent: <strong>' . 'E' . $match ['id'] . $s. '</strong> Event: <b>'.$event_card_subvisitor[0].'</b> - Team: '. $rowTeamB ['team_id'] .' - Player: '. $subvisitor['player_in_id'] .'<br>';\n\t\t\t\t\t\t\t\t\t\t$matchEventObject->insert ( $datacardlocalvisitor );\n\n\t\t\t\t\t\t\t\t\t\t//subs In visitor cards activity\n\n\t\t\t\t\t\t\t\t\t\t$playerid = $player->fetchRow ( 'player_id = ' . $subvisitor['player_in_id'] );\n\t\t\t\t\t\t\t\t\t\t$player_name_seo = $urlGen->getPlayerMasterProfileUrl ( $playerid [\"player_nickname\"], $playerid [\"player_firstname\"], $playerid [\"player_lastname\"], $playerid [\"player_id\"], true, $playerid [\"player_common_name\"] );\n\t\t\t\t\t\t\t\t\t\t$player_shortname = $playerid ['player_name_short'];\n\t\t\t\t\t\t\t\t\t\t$matchscore = null;\n\t\t\t\t\t\t\t\t\t\t$playersPathName = $this->getplayerimage($subvisitor['player_in_id']);\n\t\t\t\t\t\t\t\t\t\t$event = array(\n\t\t\t\t\t\t\t\t\t\t'id' => 'E' . $match ['id'] . $q,\n\t\t\t\t\t\t\t\t\t\t'eventtype' => $event_card_local[0],\n\t\t\t\t\t\t\t\t\t\t'player_id' => $subvisitor['player_in_id'],\n\t\t\t\t\t\t\t\t\t\t'date_event' => $new_gf_date .\" \". $new_gf_time,\n\t\t\t\t\t\t\t\t\t\t'game_minute'=> $event_card_local[1]\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\tself::insertCardsActivity ( $event, $player_name_seo, $player_shortname, $matchTeams, $matchUrl, $matchscore, $playersPathName, $match_id,null);\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$s++;}\n\n\n\t\t\t\t\t\t} // Loop only when game status playing and halftime score not null\n\n\t\t\t\t} // End of foreach All Matches Loop\n\n\t\t\t} // End if row is !- null\n\n\t\t} // End of foreach Tournament\n\n }",
"function debug($name=''){\n\t echo \"<br><b>$name</b>====================== SOTF DEBUG ===========================<br>\";\n\t echo \"<b>Object ID:</b> \" . $this->id . \"<br>\";\n\t echo \"<b>Object Data:</b> <pre>\"; print_r($this->data); echo \"</pre>\";\n\t echo \"<b>Object Changed:</b> \"; if($this->changed){ echo \"TRUE\"; }else{ echo \"FALSE\";} echo \"<br>\";\n\t echo \"<b>Object Database Handle:</b> <pre>\"; print_r($db->dsn) . \"</pre>\";\n }",
"public function saveGame(){\n\t\t$dbObject = new DatabaseHelper();\n\t\t$query = \"INSERT INTO gametracker (ai_score, player_score, difficulty, rounds, initial_hand_score) VALUES (\".$this->ai_score.\", \".$this->player_score.\", \".$this->difficulty.\", \".$this->rounds.\", \".$this->hand_improvement.\")\";\n\t\t$dbObject->executeInsert($query);\n\t}",
"private function logToDB()\n {\n\n //insert the info into the database, don't allow logging of any error\n $this->DB->insert(\"logger.logs\",$this->logData,null,1);\n \n }",
"function log911Action($action) {\n global $pdo;\n global $time;\n global $us_date;\n global $user_id;\n\n $sql_callLogger = \"INSERT INTO 911call_log (call_id, user_id, dispatcher, action, timestamp) VALUES (?,?,?,?,?)\";\n $stmt_callLogger = $pdo->prepare($sql_callLogger);\n $result_callLogger = $stmt_callLogger->execute([$_SESSION['viewingCallID'], $user_id, $_SESSION['identity_name'], $action, $us_date . ' ' . $time]);\n}",
"static function debug ($msg) {\n file_put_contents(\"/tmp/overlay.log\", $msg . \"\\n\", FILE_APPEND);\n return;\n }",
"function playerTest() {\n global $page_id, $plyr, $error_msgs;\n dbg(\"+\".__FUNCTION__.\"\");\n #post_dump();\n\n# initialize the player form\nrequire(BASE_URI . \"modules/player/player.form.init.php\");\n\n # create a test player\n $plyr->testMember();\n $error_msgs['errorDiv'] = \"Test player created. Press \\\"Add/Update\\\" to add the player.\";\n\n# Show the player form\nrequire(BASE_URI . \"modules/player/player.form.php\");\n\n dbg(\"-\".__FUNCTION__.\"={$plyr->get_member_id()}\");\n\n}",
"protected function prlog() {\n //$log = $this->->getDataSource()->getLog(false, false);\n //debug($log);\n $db = & ConnectionManager::getDataSource('default');\n $db->showLog();\n die;\n }",
"function add_player2($teamID,$playerID){\n\t//set-up\t\n\tinclude('confi/confi_info.php');\t\n\t\n\t//variables used\n\t$date=date(\"y/d/m\");\n\t$error1 = array(\"err\" => \"Couldn't add player: \".$playerID.\" to team: \".$teamID);\n\t$error2 = array(\"err\" => \"The player \".$playerID.\" is already into the team \".$teamID);\n\n\t//code\n\t$exist = mysql_num_rows(mysql_query(\"SELECT * FROM $team_player_table WHERE '$playerID'=playerid AND '$teamID'=teamid\"));\n\tif($exist)\t\t//we check first if the player is already into the team\n\t\treturn true;\n\t\t\n\t$insert= mysql_query(\"INSERT INTO $team_player_table (teamid,playerid,Joineddate,Membertype) VALUES ('$teamID','$playerID','$date','0')\");\n\tif(!$insert)\t//we insert the user into the team\n\t\treturn false;\n\telse\n\t\treturn true;\n}",
"public function _insertTime($idPlayer){\n return $this->timeDAO->insertTime($idPlayer);\n }",
"function log()\r\n {\r\n }",
"function debug()\r\n {\r\n }",
"function debug()\n {\n core::stack();\n dbug::{'test'}(func_get_args(), SDL);\n }",
"function warquest_db_player_clan_insert($pid, $cid, $approved, $role) {\r\n\r\n\t$now = date('Y-m-d H:i:s');\r\n\t\r\n\t$query = 'insert into player_clan (pid, cid, joined, approved, role) values (';\r\n\t$query .= $pid.','.$cid.',\"'.$now.'\",'.$approved.','.$role.')';\t\r\n\t\r\n\treturn warquest_db_query($query);\r\n}",
"function save()\n\t\t{\n\t\t\t$GLOBALS['DB']->exec(\"INSERT INTO leagues (league_name, sport_id, price, skill_level, description, location, website, email, org_id) VALUES ('{$this->getLeagueName()}', {$this->getSportId()}, {$this->getPrice()}, '{$this->getSkillLevel()}', '{$this->getDescription()}', '{$this->getLocation()}', '{$this->getWebsite()}', '{$this->getEmail()}', {$this->getOrgId()});\");\n\t\t\t$this->id = $GLOBALS['DB']->lastInsertId();\n\t\t}",
"function kb_debug() {\n\tstatic $kdb;\n\tif ( !isset( $kdb ) ) $kdb = new KB_Debug();\n\n\t$kdb->log( func_get_args() );\n}",
"function add($id,$nombre,$posicion,$carrera,$email,$id_type){\n\t\tglobal $pdo;\n\t\t$stmt = $pdo->prepare(\"INSERT INTO sport_team(id,nombre,posicion,carrera,email,id_type)\n\t\t\t\t\tVALUES('$id', '$nombre', '$posicion', '$carrera', '$email', '$id_type')\");\n\t\treturn $stmt->execute();\n\t}",
"function log_update($sql){\n db(\"insert into partner_updates (upd_sql) values('\".db_escape($sql).\"')\");\n}",
"function debug()\r\n\t{\r\n\t\techo \"<p></p><br> DEBUG PARA EL OBJETO BASE DE DATOS </br>\";\r\n\t\techo \"<br> bd_host --> \".$this->bd_host.\" </br>\";\r\n\t\techo \"<br> bd_user --> \".$this->bd_user.\" </br>\";\r\n\t\techo \"<br> bd_pass --> \".$this->bd_pass.\" </br>\";\r\n\t\techo \"<br> bd --> \".$this->bd.\" </br>\";\r\n\t\techo \"<br> bd_link --> \".$this->bd_link.\" </br>\";\r\n\t}",
"function dbg_db($msg){\n global $debug_db,$debug_log;\n\n if($debug_db){\n if(!$debug_log) print(\"<p><b>query:</b><br/>\".$msg.\"</p>\"); \n else accum_file($debug_log,$msg.\"\\n\");\n }\n }",
"private function insert() {\n // use prepared statements\n // save an insert id\n }"
] | [
"0.6601709",
"0.6188599",
"0.58614767",
"0.58276325",
"0.5818274",
"0.58046126",
"0.5782846",
"0.57194304",
"0.5711437",
"0.5690045",
"0.56800467",
"0.5650687",
"0.5637286",
"0.5627986",
"0.5624828",
"0.55796754",
"0.5549069",
"0.5516813",
"0.5516661",
"0.5474909",
"0.54650044",
"0.5433794",
"0.54269177",
"0.53994244",
"0.5387095",
"0.5370998",
"0.53516835",
"0.53322726",
"0.5322419",
"0.5315661"
] | 0.6777882 | 0 |
Return true if the two factor can be set. | public function canSaveTwoFactorKey()
{
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasEnabledTwoFa()\n {\n return ! is_null($this->enabled_two_fa);\n }",
"public function isValid()\n {\n return $this->getSidecode() != false;\n }",
"public function check() : bool\n {\n if (!$this->property->isOfType(Type::NUMERIC)) {\n return false;\n }\n\n return $this->property->hasOption(Option::MULTIPLE_OF);\n }",
"public function hasPassword2()\n {\n return $this->get(self::PASSWORD2) !== null;\n }",
"public function valid()\n\t{\n\t\treturn !$this->faking;\n\t}",
"public function canChange()\n {\n return $this->state == self::STATE_DISABLED || $this->state == self::STATE_DISABLED_HIDDEN || $this->state == self::STATE_ENABLED;\n }",
"public static function isValid()\n {\n return (isset($_SESSION['client_user']) || isset($_SESSION['support_user']));\n }",
"private function isTwoFactorAuthenticationRequired(): bool\n\t{\n\t\t$user = Factory::getUser();\n\n\t\tif ($user->guest)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check session if user has set up 2fa\n\t\tif ($this->app->getUserState('has2fa', false))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// If the user is not allowed to view the output then end here.\n\t\t$forced2faGroups = (array) $this->params->get('force2fausergroups', []);\n\n\t\tif (!empty($forced2faGroups))\n\t\t{\n\t\t\t$userGroups = (array) $user->get('groups', []);\n\n\t\t\tif (!array_intersect($forced2faGroups, $userGroups))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\tif (!PluginHelper::isEnabled('twofactorauth'))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn !$this->hasUserConfiguredTwoFactorAuthentication();\n\t}",
"public function check()\n\t{\n\t\treturn ($this->user()->power > 0);\n\t}",
"public function hasValidData(){\n return ($this->hasEmergencyCase() && $this->hasDistraction() && $this->hasMaxim()); \n }",
"private function hasUserConfiguredTwoFactorAuthentication(): bool\n\t{\n\t\t$user = Factory::getUser();\n\n\t\t// Check whether there is a 2FA setup for that user\n\t\tif (empty($user->otpKey) || empty($user->otep))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Set session to user has configured 2fa\n\t\t$this->app->setUserState('has2fa', true);\n\n\t\treturn true;\n\t}",
"function check_permit_level()\n\t{\n\t\t$fPM\t= true;\n\t\t//check class permit\n\t\t$cls\t= $this->check_class_name();\n\t\tif(empty($cls))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t//check function permit\n\t\t$func\t= $this->check_function_name();\n\t\tif(empty($func))\n\t\t\treturn false;\n\t\t//neu co loi thi thong bao\n\t\treturn $fPM;\n\t}",
"function isValid() {\n\t\treturn( @BitBase::verifyId( $this->mTicketId ) && @BitBase::verifyId( $this->mContentId ));\n\t}",
"public function allowMultiple(): bool\n {\n return true;\n }",
"public function secretIsValid()\n {\n $player = new WordShuffle_Model_Player();\n $player->Mapper->find($this->_model->id);\n\n // set the challenges in preparation for return to frontend\n $this->_model->challenges = $player->challenges;\n\n // compare entered secret to database\n return $this->_scrubClean($player->secret) == $this->_scrubClean($this->_model->secret);\n\n }",
"public function testIsValid()\n {\n $this->assertEquals($this->abuse->check(), false);\n $this->assertEquals($this->abuse->check(), false);\n $this->assertEquals($this->abuse->check(), false);\n $this->assertEquals($this->abuse->check(), true);\n }",
"private function checkLimitations()\n {\n// @todo : build this out into a service\n if ($this->checkLocomotion()) {\n return true;\n }\n return false;\n }",
"function isValid() {\n\t\treturn true;\n\t}",
"public function check_rights(): bool\n {\n return True;\n }",
"function canSolve() {\n\n return ((Session::haveRight(self::$rightname, UPDATE)\n || $this->isUser(CommonITILActor::ASSIGN, Session::getLoginUserID())\n || (isset($_SESSION[\"glpigroups\"])\n && $this->haveAGroup(CommonITILActor::ASSIGN, $_SESSION[\"glpigroups\"])))\n && self::isAllowedStatus($this->fields['status'], self::SOLVED)\n // No edition on closed status\n && !in_array($this->fields['status'], $this->getClosedStatusArray()));\n }",
"public function hasSecret1()\n {\n return $this->secret_1 !== null;\n }",
"public function twofa_required () {\n return isset($_SESSION['2fa_required']) ? true : false;\n }",
"function isValid(): bool\n {\n if ($this->utentePrenotazione->getId() != $this->utentePrenotazione->getId())\n {\n if (is_a($this->getUtentePrenotazione(), e_utente::class))\n {\n if(is_a($this->getUtentePrenotazione(), e_visitatore::class))\n return false;\n else\n return true;\n }\n else\n return false;\n } \n else\n return false;\n }",
"public function verifySettings()\n {\n if(count($this->settings)>0)return true;else return false;\n }",
"function isValid ()\n\t{\n\t\treturn true;\n\t}",
"public function isValidM($val)\n {\n return isset($val);\n }",
"public function is_set() {\n return isset($this->{$this->_}) && count($this->{$this->_}) > 0;\n }",
"private function isValid()\n\t{\n $blnIsValid = true;\n return $blnIsValid;\n \n }",
"public function valid()\n {\n\n if ($this->container['auto_scale_formula'] === null) {\n return false;\n }\n return true;\n }",
"public function valid()\n {\n if ($this->container['activity_id'] === null) {\n return false;\n }\n $allowed_values = [\"Billable\", \"DoNotBill\", \"NoCharge\", \"NoDefault\"];\n if (!in_array($this->container['billable_option'], $allowed_values)) {\n return false;\n }\n if ($this->container['member'] === null) {\n return false;\n }\n if (strlen($this->container['notes']) > 4000) {\n return false;\n }\n if ($this->container['status'] === null) {\n return false;\n }\n $allowed_values = [\"Reset\", \"Running\", \"Paused\", \"Stopped\"];\n if (!in_array($this->container['status'], $allowed_values)) {\n return false;\n }\n return true;\n }"
] | [
"0.5976538",
"0.5949199",
"0.59197944",
"0.5888494",
"0.5771611",
"0.5742665",
"0.56775355",
"0.56552255",
"0.5643287",
"0.5640316",
"0.56360435",
"0.56308156",
"0.56178033",
"0.5615932",
"0.5607228",
"0.55983657",
"0.55837166",
"0.55733323",
"0.55705976",
"0.55699754",
"0.5535555",
"0.5510726",
"0.550017",
"0.5500055",
"0.549388",
"0.5485847",
"0.54687405",
"0.5465522",
"0.5454869",
"0.5452791"
] | 0.59774196 | 0 |
Return true if the password can be set. Returns the setting for the definition whan no user is passed, otherwise returns the answer for this specific user. | public function canSetPassword(\Gems_User_User $user = null)
{
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPassword()\n {\n return false;\n }",
"protected function getUsePassword()\n\t{\n\t\treturn $this->theTable === 'fe_users' && isset($this->conf['create.']['evalValues.']['password']);\n\t}",
"public function needPassword($user = null)\n {\n return false;\n }",
"public function hasPassword()\n {\n return (bool) $this->password;\n }",
"public function CheckPassword(){\r\n\r\n\t\t\tif($this->data[$this->alias]['password'] == Security::hash($this->data[$this->alias]['pass'],null,true)){\r\n\r\n\t\t\t\treturn true;\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn false;\r\n\r\n\t\t}",
"protected function readIsPassword() { return $this->_ispassword; }",
"public function hasPassword()\n {\n return is_string($this->get('password'));\n }",
"public function hasPassword1()\n {\n return $this->get(self::PASSWORD1) !== null;\n }",
"public function allowUserPasswordReset() {\n global $config;\n $newinfo = array('pwdReset' => 'TRUE');\n if (@ldap_modify($this->ldap,$this->dn,$newinfo)) {\n return true;\n } else {\n $this->_addMsg( sprintf( _(\"Could not set pwdReset flag: %s\"), ldap_error($this->ldap)) );\n return false;\n }\n }",
"public function hasPassword()\n {\n return isset($this->password);\n }",
"protected function getUsePasswordAgain()\n\t{\n\t\treturn $this->getUsePassword() && GeneralUtility::inList($this->conf['create.']['evalValues.']['password'], 'twice');\n\t}",
"public function validatePasswordRes()\n {\n if ($this->validate()) {\n return true;\n } else {\n return false;\n }\n }",
"public function hasPassword() {\n return !empty($this->password);\n }",
"public function hasPassword()\n {\n return $this->password !== null;\n }",
"public function isPasswordProtected() {\n\t\tif (is_null($this->getPassword()))\n\t\t\treturn false;\n\t\t\n\t\treturn true;\n\t}",
"public function setPasswordRequired($val)\n {\n $this->_propDict[\"passwordRequired\"] = boolval($val);\n return $this;\n }",
"public function isPassword()\n {\n return $this->is(FieldTypeCollection::TYPE_PASSWORD);\n }",
"public function getPassword() {\n if (isset($_REQUEST['password']))\n return $_REQUEST['password'];\n else\n return false;\n }",
"public function getPwd() {\n if (isset($_REQUEST['pwd']))\n return $_REQUEST['pwd'];\n else\n return false;\n }",
"public function authenthicate() {\n $data_auth_check_password = $this->checkPassword();\n if ($this->authAdmin() && $this->checkPassword()) {\n return TRUE;\n } else\n return false;\n }",
"public function getHasPasswordAttribute()\n {\n return isset($this->attributes['password']) && $this->attributes['password'];\n }",
"public function getRealPassword($password = false)\n {\n if ($password !== false) {\n return $password;\n }\n if (is_string(WingedConfig::$config->db()->PASSWORD)) {\n return WingedConfig::$config->db()->PASSWORD;\n }\n return false;\n }",
"public function getPwdAttuale() {\n if (isset($_REQUEST['pwdattuale']))\n return $_REQUEST['pwdattuale'];\n else\n return false;\n }",
"protected function checkPassword()\n {\n $result = true;\n $data = $this->getRequestData();\n\n /** @var \\XLite\\Model\\Profile $model */\n $model = $this->getModelObject();\n\n if ($model\n && $model->getProfileId() === \\XLite\\Core\\Auth::getInstance()->getProfile()->getProfileId()\n ) {\n $result = true;\n } elseif (isset($this->sections[self::SECTION_MAIN])\n && (!empty($data['password']) || !empty($data['password_conf']))\n ) {\n if ($data['password'] != $data['password_conf']) {\n $result = false;\n $formFields = $this->getFormFields();\n $this->addErrorMessage(\n 'password',\n 'Password and its confirmation do not match',\n $formFields[self::SECTION_MAIN]\n );\n }\n\n } else {\n $this->excludeField('password');\n $this->excludeField('password_conf');\n }\n\n return $result;\n }",
"public function pwdExists(){\n $sql = \"SELECT * FROM admin WHERE password = '\".md5($this->passWord).\"' AND id = $this->id LIMIT 1 \";\n $result = $this->dbObj->fetchAssoc($sql);\n if($result != false){ return true; }\n else{ return false; }\n }",
"public function isValidPasscode(){\r\n return ( $this->getPassword() === Config::PASS_CODE ? true : false );\r\n }",
"function _sfs_is_password_set($fid) {\n $password = db_query(\"SELECT password FROM {sfs_files} WHERE sfs_id = :fid\", array(':fid' => $fid))->fetchField();\n if (!empty($password)) {\n return TRUE;\n }\n return FALSE;\n}",
"public function getPasswordConfirmacion()\n {\n return $this->passwordConfirmacion;\n }",
"protected function checkCurrentPassword()\n\t{\n\t\t$credentials = [\n\t\t\t$this->superuser->getKeyName() => $this->superuser->getKey(),\n\t\t\t'password' => $this->secret('Enter superuser CURRENT password: ')\n\t\t];\n\n\t\treturn auth()->validate($credentials);\n\t}",
"public function getPassword(): ? string;"
] | [
"0.6547222",
"0.64990944",
"0.64892703",
"0.6467677",
"0.6383339",
"0.6364346",
"0.6255943",
"0.615264",
"0.6151953",
"0.6100911",
"0.60835856",
"0.6081826",
"0.60789114",
"0.6036141",
"0.60012895",
"0.5973172",
"0.59369755",
"0.5924884",
"0.5890244",
"0.5887808",
"0.5885964",
"0.5852091",
"0.58430845",
"0.58426934",
"0.583491",
"0.5809833",
"0.5800549",
"0.5786212",
"0.5744905",
"0.5722679"
] | 0.658958 | 0 |
get the credential validation callback function for the callback check adapter | public function getCredentialValidationCallback()
{
if ($this->checkOldHashes) {
$credentialValidationCallback = function($dbCredential, $requestCredential) {
if (password_verify($requestCredential, $dbCredential)) {
return true;
} elseif ($dbCredential == $this->hashOldPassword($requestCredential)) {
return true;
}
return false;
};
} else {
$credentialValidationCallback = function($dbCredential, $requestCredential) {
if (password_verify($requestCredential, $dbCredential)) {
return true;
}
return false;
};
}
return $credentialValidationCallback;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDirectoryValidationCallback()\n {\n return $this->directory_validation_callback;\n }",
"public function getFileValidationCallback()\n {\n return $this->file_validation_callback;\n }",
"public function getValidationCallback(): ?callable\n {\n\n return $this->_validationCallback;\n\n }",
"public function getCallback();",
"public function beforeCheckCallback($callback);",
"public function getAuthorizationCheckFunction()\n {\n return $this->authorization_check_function;\n }",
"abstract protected function getCallbackCase(): callable;",
"public function customValidate($name, $callback);",
"public function get_validation_callback($name) {\n if (isset($this->validation_callback_map[$name])) {\n return $this->validation_callback_map[$name];\n }\n return FALSE;\n }",
"public function getCallbackValidator() {\n if ($this->callbackValidator === null) {\n if (!isset($this->configuration['projectId'])) {\n throw new WebToPay_Exception_Configuration('You have to provide project ID');\n }\n $this->callbackValidator = new WebToPay_CallbackValidator(\n $this->configuration['projectId'],\n $this->getSigner(),\n $this->getUtil()\n );\n }\n return $this->callbackValidator;\n }",
"public function get_callback() {\n\t\treturn $this->callback;\n\t}",
"public function addValidator(){\n Validator::extend('check_password',function ($attribute,$value,$parameters,$validator){\n return Hash::check($value,Auth::guard('admin')->user()->password);\n });\n }",
"public static function getCallback() {\n\t\treturn self::$callback;\n\t}",
"function setValidationCallback($callback_func) {\n\t\t\t$this->validation_callback = $callback_func;\n\t\t}",
"public function getApiCallback();",
"function getCallback()\n {\n return $this->getFieldValue('callback');\n }",
"public function getValidationFactory(): callable {\n return $this->validationFactory;\n }",
"private function validate_function(&$field, &$data) {\n if (!isset($field[\"callback\"])) {\n return FALSE;\n }\n if (is_callable($data[\"callback\"])) {\n if (!isset($data[\"params\"])) {\n $data[\"params\"] = array();\n }\n return call_user_func_array($data[\"callback\"], $data[\"params\"]);\n } else {\n return FALSE;\n }\n }",
"public function afterCheckCallback($callback);",
"public function getCallback() {\n\t\treturn $this->callback;\n\t}",
"protected function _validate($callback)\n {\n if (empty($callback) || !$this->valid()) {\n return;\n }\n\n/*\n if (!is_null($callback) && (!function_exists($callback) && !is_callable($callback))) {\n throw new \\LogicException(\n sprintf('Function named \"%s\" used as callback does not exist or is not callable!', $callback)\n );\n }\n\n if (!is_null($callback) && !is_dir($this->getRealPath())) {\n try {\n $result = call_user_func($callback, $this->getRealPath());\n if (false===$result) {\n $this->next();\n }\n } catch(Exception $e) {\n throw new \\BadFunctionCallException(\n sprintf('Function named \"%s\" used as callback sent an exception with argument \"%s\"!', $callback, $entry),\n 0, $e\n );\n }\n }\n*/\n if (!is_null($callback) && (@function_exists($callback) || @is_callable($callback))) {\n try {\n $result = call_user_func($callback, $this->getRealPath());\n if (false===$result) {\n $this->next();\n }\n } catch (\\Exception $e) {\n throw new \\BadFunctionCallException(\n sprintf('Function named \"%s\" used as callback sent an exception with argument \"%s\"!', $callback, $entry),\n 0, $e\n );\n }\n } else {\n throw new \\LogicException(\n sprintf('Function named \"%s\" used as callback does not exist or is not callable!', $callback)\n );\n }\n }",
"public function getFailureCallback()\n {\n return $this->failure_callback;\n }",
"public function getOauthCallback();",
"public function getCallback()\n {\n return $this->callback;\n }",
"public function getCallback()\n {\n return $this->callback;\n }",
"public function getCallback()\n {\n return $this->callback;\n }",
"public function getPermissionCallback()\n {\n return $this->permissionCallback;\n }",
"public function validateCallbackWithGlobals() {\n $requestBody = file_get_contents('php://input');\n $requestQuery = $_SERVER['REQUEST_URI'];\n if (!empty($_SERVER['HTTP_DATE'])) {\n $dateHeader = $_SERVER['HTTP_DATE'];\n } elseif (!empty($_SERVER['HTTP_X_DATE'])) {\n $dateHeader = $_SERVER['HTTP_X_DATE'];\n } else {\n $dateHeader = null;\n }\n\n //new JSON validation\n $signature = null;\n if (!empty($_SERVER['HTTP_X_SIGNATURE'])) {\n $signature = $_SERVER['HTTP_X_SIGNATURE'];\n } elseif (!empty($_SERVER['X_SIGNATURE'])) {\n $signature = $_SERVER['X_SIGNATURE'];\n }\n if ($signature) {\n return $this->validateCallback($requestBody, $requestQuery, $dateHeader, $signature);\n }\n\n //old XML validation\n if (!empty($_SERVER['HTTP_AUTHORIZATION'])) {\n $authorizationHeader = $_SERVER['HTTP_AUTHORIZATION'];\n } elseif (!empty($_SERVER['HTTP_X_AUTHORIZATION'])) {\n $authorizationHeader = $_SERVER['HTTP_X_AUTHORIZATION'];\n } else {\n $authorizationHeader = null;\n }\n\n\n return $this->validateCallback($requestBody, $requestQuery, $dateHeader, $authorizationHeader);\n }",
"public function getValidatorConfig();",
"protected static function configValidator($validator)\n {}"
] | [
"0.6362004",
"0.63483983",
"0.63152635",
"0.6085261",
"0.6020656",
"0.59540606",
"0.585279",
"0.5809177",
"0.57659465",
"0.5730103",
"0.5679874",
"0.5654896",
"0.5615506",
"0.55831736",
"0.5580193",
"0.55731505",
"0.5528437",
"0.55225855",
"0.5519813",
"0.551952",
"0.55190384",
"0.5511547",
"0.5488678",
"0.54347235",
"0.54347235",
"0.54347235",
"0.5425555",
"0.54132324",
"0.5412064",
"0.5405201"
] | 0.74845964 | 0 |
Get the current password hash algorithm Currently defaults to BCRYPT in PHP 5.57.2 | public function getHashAlgorithm()
{
return $this->hashAlgorithm;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function passwordHashAlgorithm(): string\n {\n return $this->passwordHashAlgorithm;\n }",
"public function getHashAlgorithm();",
"public function getHashAlgo(): string\n {\n return $this->hashAlgo;\n }",
"public function getHash()\n {\n switch ($this->alg) {\n\n case 'RSA-SHA256':\n return 'sha256';\n }\n }",
"public function getPassword()\n {\n return password_hash($this->db->real_escape_string($this->password), PASSWORD_BCRYPT, ['cost' => 4]);\n }",
"function hashCrypt ($chaine)\n{\n\tglobal $options;\n\treturn password_hash($chaine, PASSWORD_BCRYPT, $options);\n}",
"public function hash()\n\t{\n\t\tif ($this->hash === null) {\n\t\t\tswitch ($this->algorithm) {\n\t\t\t\tcase Hash::BLOWFISH:\n\t\t\t\tcase Hash::SHA256:\n\t\t\t\tcase Hash::SHA512:\n\t\t\t\t\t$this->hash = \\crypt($this->string, $this->salt);\n\t\t\t\t\t$this->hash = \\substr($this->hash, strlen($this->salt));\n\t\t\t\t\tbreak;\n\t\t\t\tcase Hash::SHA1:\n\t\t\t\t\t$this->hash = \\sha1($this->salt . $this->string);\n\t\t\t\t\tbreak;\n\t\t\t\tcase Hash::MD5:\n\t\t\t\t\t$this->hash = \\md5($this->salt . $this->string);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $this->hash;\n\t}",
"abstract public function getHashingAlgorithm();",
"public function getPasswordHash()\n {\n return $this->_password;\n }",
"protected function algorithm(): int|string\n {\n return PASSWORD_ARGON2I;\n }",
"protected function getHasher(): HasherInterface\n\t{\n\t\treturn new Bcrypt;\n\t}",
"function hashPassword() {\n\t\t$this->passwordHash = password_hash($this->password, PASSWORD_DEFAULT);\n\t\treturn $this->passwordHash;\n\t}",
"public static function hash($password, $algo = 1, array $options = array()) {\n\t\t// 1=PASSWORD_BCRYPT\n\t\tif(!function_exists('crypt')) {\n\t\t\t//Log::w(\"Crypt must be loaded for password_hash to function\");\n\t\t\treturn NULL;\n\t\t}\n\t\tif(!is_string($password)) {\n\t\t\t//Log::w(\"password_hash(): Password must be a string\");\n\t\t\treturn NULL;\n\t\t}\n\t\tif(!is_int($algo)) {\n\t\t\t//Log::w(\"password_hash() expects parameter 2 to be long, \" . gettype($algo) . \" given\");\n\t\t\treturn NULL;\n\t\t}\n\n\t\t$password = trim($password);\n\t\tswitch ($algo) {\n\t\t\tcase PASSWORD_BCRYPT:\n\t\t\t\t// Note that this is a C constant, but not exposed to PHP, so we don't define it here.\n\t\t\t\t$cost = 10;\n\t\t\t\tif (isset($options['cost'])) {\n\t\t\t\t\t$cost = $options['cost'];\n\t\t\t\t\tif ($cost < 4 || $cost > 31) {\n\t\t\t\t\t\ttrigger_error(sprintf(\"password_hash(): Invalid bcrypt cost parameter specified: %d\", $cost), E_USER_WARNING);\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// The length of salt to generate\n\t\t\t\t$raw_salt_len = 16;\n\t\t\t\t// The length required in the final serialization\n\t\t\t\t$required_salt_len = 22;\n\t\t\t\t$hash_format = sprintf(\"$2y$%02d$\", $cost);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ttrigger_error(sprintf(\"password_hash(): Unknown password hashing algorithm: %s\", $algo), E_USER_WARNING);\n\t\t\t\treturn null;\n\t\t}\n\t\tif(isset($options['salt'])) {\n\t\t\tswitch (gettype($options['salt'])) {\n\t\t\t\tcase 'NULL':\n\t\t\t\tcase 'boolean':\n\t\t\t\tcase 'integer':\n\t\t\t\tcase 'double':\n\t\t\t\tcase 'string':\n\t\t\t\t\t$salt = (string) $options['salt'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'object':\n\t\t\t\t\tif (method_exists($options['salt'], '__tostring')) {\n\t\t\t\t\t\t$salt = (string) $options['salt'];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\tcase 'array':\n\t\t\t\tcase 'resource':\n\t\t\t\tdefault:\n\t\t\t\t\ttrigger_error('password_hash(): Non-string salt parameter supplied', E_USER_WARNING);\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t\tif (strlen($salt) < $required_salt_len) {\n\t\t\t\ttrigger_error(sprintf(\"password_hash(): Provided salt is too short: %d expecting %d\", strlen($salt), $required_salt_len), E_USER_WARNING);\n\t\t\t\treturn null;\n\t\t\t} elseif (0 == preg_match('#^[a-zA-Z0-9./]+$#D', $salt)) {\n\t\t\t\t$salt = str_replace('+', '.', base64_encode($salt));\n\t\t\t}\n\t\t} else {\n\t\t\t$buffer = '';\n\t\t\t$buffer_valid = false;\n\t\t\tif (function_exists('mcrypt_create_iv') && !defined('PHALANGER')) {\n\t\t\t\t$buffer = mcrypt_create_iv($raw_salt_len, MCRYPT_DEV_URANDOM);\n\t\t\t\tif ($buffer) {\n\t\t\t\t\t$buffer_valid = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!$buffer_valid && function_exists('openssl_random_pseudo_bytes')) {\n\t\t\t\t$buffer = openssl_random_pseudo_bytes($raw_salt_len);\n\t\t\t\tif ($buffer) {\n\t\t\t\t\t$buffer_valid = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!$buffer_valid && is_readable('/dev/urandom')) {\n\t\t\t\t$f = fopen('/dev/urandom', 'r');\n\t\t\t\t$read = strlen($buffer);\n\t\t\t\twhile ($read < $raw_salt_len) {\n\t\t\t\t\t$buffer .= fread($f, $raw_salt_len - $read);\n\t\t\t\t\t$read = strlen($buffer);\n\t\t\t\t}\n\t\t\t\tfclose($f);\n\t\t\t\tif ($read >= $raw_salt_len) {\n\t\t\t\t\t$buffer_valid = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!$buffer_valid || strlen($buffer) < $raw_salt_len) {\n\t\t\t\t$bl = strlen($buffer);\n\t\t\t\tfor ($i = 0; $i < $raw_salt_len; $i++) {\n\t\t\t\t\tif ($i < $bl) {\n\t\t\t\t\t\t$buffer[$i] = $buffer[$i] ^ chr(mt_rand(0, 255));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$buffer .= chr(mt_rand(0, 255));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$salt = str_replace('+', '.', base64_encode($buffer));\n\t\t}\n\t\t$salt = substr($salt, 0, $required_salt_len);\n\n\t\t$hash = $hash_format . $salt;\n\n\t\t$ret = crypt($password, $hash);\n\n\t\tif (!is_string($ret) || strlen($ret) <= 13) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $ret;\n\t}",
"public function getPassword()\n\t{\n\t\treturn $this->hash;\n\t}",
"public function getPasswordHash()\n\t{\n\t\treturn $this->passwordHash;\n\t}",
"function cobalt_password_methods()\n{\n return array('blowfish','sha512','sha256','sha1','ripemd256','ripemd320','whirlpool');\n}",
"public static function getPasswordHached($password){\n return password_hash($password, PASSWORD_BCRYPT );\n }",
"public function getAlgorithm()\n {\n return $this->algorithm . $this->keysize;\n }",
"public function getPasswordHash() : ?string\n {\n $rtn = $this->data['password_hash'];\n\n return $rtn;\n }",
"public function getPasswordHasher()\n {\n return new DefaultPasswordHasher();\n }",
"public function getAuthPassword()\n {\n return $this->pw_hash;\n }",
"public static function getHash($password)\n {\n $optionsForHash = [ \"salt\" => static::BCRYPT_SALT];\n return password_hash($password, PASSWORD_BCRYPT, $optionsForHash);\n }",
"public static function passwordHash($password, $salt) {\n $PEPPER = \"__PEPPER2__\";\n \n $CIPHER = $PEPPER . $password . $salt;\n $options = array('cost' => 12);\n $CIPHER = password_hash($CIPHER, PASSWORD_BCRYPT, $options);\n return $CIPHER;\n }",
"public function hasher() {\r\n\t\r\n if (!Zend_Registry::isRegistered('my_hasher')) {\r\n Zend_Registry::set('my_hasher', new My_Auth_PasswordHash(8, false));\r\n }\r\n return Zend_Registry::get('my_hasher');\r\n }",
"static public function password($password='',$salt='random_salt',$algorithm='ripemd160') {\r\n\t\t\tif(!is_string($password) || !$password) return $password;\r\n\t\t\telse $password = password.$salt;\r\n\r\n\t\t\tif(in_array($algorithm,hash_algos())) return hash($algorithm,$password,false);\r\n\t\t\telse return '';\r\n\t\t}",
"public function getKeyAlgorithm()\n {\n return $this->key_algorithm;\n }",
"function getPassword()\n\t {\n\t \treturn $this->_hashword;\n\t }",
"public static function getHashType($password)\r\n\t{\r\n\t\t// If the password in the db is 65 characters long, we have an sha1-hashed password\r\n\t\tif (strlen($password) === 65) {\r\n\t\t\treturn 'sha1';\r\n\t\t} elseif (substr($password, 0, 7) === '$2y$12$') {\r\n\t\t\treturn 'legacy';\r\n\t\t}\r\n\r\n\t\treturn 'modern';\r\n\t}",
"function passwordHash($password) {\n $options = [\n 'cost' => 11,\n 'salt' => openssl_random_pseudo_bytes(22, $cstrong),\n ];\n\n return $hash = password_hash($password, PASSWORD_BCRYPT, $options);\n }",
"function blowfish_hash($password) {\n return password_hash($password, PASSWORD_BCRYPT);\n }"
] | [
"0.7901152",
"0.7039449",
"0.68077844",
"0.67255324",
"0.6703222",
"0.6614524",
"0.6582256",
"0.65579575",
"0.6317603",
"0.62999123",
"0.6267123",
"0.62383646",
"0.62248117",
"0.62219596",
"0.62115467",
"0.61991155",
"0.6179494",
"0.61763126",
"0.6169328",
"0.6165932",
"0.6151732",
"0.6113906",
"0.6113155",
"0.6110869",
"0.6109237",
"0.6102208",
"0.6097786",
"0.60594577",
"0.6038728",
"0.60382223"
] | 0.73351526 | 1 |
Get the current hash options Default: cost => 10 // higher numbers will make the hash slower but stronger. | public function getHashOptions()
{
return [];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function getHashCost()\n {\n\n $cost = 8; // Start cost, we will go up form here (8 is just below recommended default).\n $timeTarget = 0.5; // Calculation time cost in seconds, we want to determine how long hashing takes. Higher is more secure but slower.\n\n do {\n $cost++;\n $start = microtime(true);\n $salt = strtr(base64_encode(mcrypt_create_iv(16, MCRYPT_DEV_URANDOM)), '+', '.'); // Generate random salt for this user.\n $salt = sprintf(\"$2a$%02d$\", $cost) . $salt; // Specify the salt algorithm ($2a$ = blowfish), includes cost.\n $hash = crypt($password, $salt); // This is the backwards compatible (if php 5.5+ password_hash() condenses).\n $end = microtime(true);\n } while (($end - $start) < $timeTarget);\n\n return $cost;\n }",
"public function getHashOption()\n {\n return isset($this->options['hash']) ? $this->options['hash'] : true;\n }",
"public static function getBestCost()\n\t{\n\t\t$timeTarget = 0.05;\n\n\t\t$cost = 8;\n\t\tdo {\n\t\t\t$cost++;\n\t\t\t$start = microtime(true);\n\t\t\tpassword_hash(\"test\", PASSWORD_BCRYPT, [\"cost\" => $cost]);\n\t\t\t$end = microtime(true);\n\t\t} while (($end - $start) < $timeTarget);\n\n\t\techo \"Best cost for this server is : \" . $cost . \"\\n\";\n\t}",
"public static function hash_cost(){\n $timeTarget = 0.05;\n $cost = 8;\n do{\n $cost++;\n $start = microtime(true);\n password_hash(\"diyframeworktest\", PASSWORD_BCRYPT, [\"cost\" => $cost]);\n $end = microtime(true);\n } while(($end - $start) < $timeTarget);\n\n return $cost;\n }",
"public function getHashAlgo(): string\n {\n return $this->hashAlgo;\n }",
"public function getHashAlgorithm();",
"function options($newOptions=null) {\n static $options;\n if (!isset($options) || isset($newOptions))\n $options = $newOptions ?: new Hash();\n return $options;\n}",
"abstract public function getHashingAlgorithm();",
"public function getHashAlgorithmSize();",
"function getExtraHashOptions() {\n\t\treturn '';\n\t}",
"static public function algos()\n {\n return hash_algos();\n }",
"function getHash()\n\t{\n\t\tif( $this->cached_hash != 0 )\n\t\t\treturn $this->cached_hash;\n\n\t\t$h = 1777;\n\t\tfor($i = count($this->bits) - 1; $i >= 0; $i--)\n\t\t\t$h ^= $this->bits[$i];\n\t\t$this->cached_hash = $h;\n\t\treturn $h;\n\t}",
"public function getHashAlgorithm()\n {\n return $this->hashAlgorithm;\n }",
"private function generateHash($password, $cost=12){\n $salt=substr(base64_encode(openssl_random_pseudo_bytes(17)),0,22);\n /* As blowfish takes a salt with the alphabet ./A-Za-z0-9 we have to\n * replace any '+' in the base64 string with '.'. We don't have to do\n * anything about the '=', as this only occurs when the b64 string is\n * padded, which is always after the first 22 characters.\n */\n $salt=str_replace(\"+\",\".\",$salt);\n /* Next, create a string that will be passed to crypt, containing all\n * of the settings, separated by dollar signs\n */\n $param='$'.implode('$',array(\n \"2y\", //select the most secure version of blowfish (>=PHP 5.3.7)\n str_pad($cost,2,\"0\",STR_PAD_LEFT), //add the cost in two digits\n $salt //add the salt\n ));\n\n //now do the actual hashing\n return crypt($password,$param);\n }",
"public static function get_info($hash) {\n\t\t$return = array(\n\t\t\t'algo' => 0,\n\t\t\t'algoName' => 'unknown',\n\t\t\t'options' => array(),\n\t\t);\n\t\tif (substr($hash, 0, 4) == '$2y$' && strlen($hash) == 60) {\n\t\t\t$return['algo'] = PASSWORD_BCRYPT;\n\t\t\t$return['algoName'] = 'bcrypt';\n\t\t\tlist($cost) = sscanf($hash, \"$2y$%d$\");\n\t\t\t$return['options']['cost'] = $cost;\n\t\t}\n\t\treturn $return;\n\t}",
"public static function key(array $options = []) {\n\t\treturn Password::hash(static::get($options));\n\t}",
"public function getBestBlockHash()\n {\n return $this->__call('getbestblockhash');\n }",
"private function getBcryptCost() {\n // \"12\" in about 300ms. Since server hardware is often virtualized or old,\n // just split the difference.\n return 11;\n }",
"public function getInfo($hash)\r\n {\r\n $return = array(\r\n 'algo' => 0,\r\n 'algoName' => 'unknown',\r\n 'options' => array(),\r\n );\r\n if (substr($hash, 0, 4) == '$2y$' && strlen($hash) == 60) {\r\n $return['algo'] = PASSWORD_BCRYPT;\r\n $return['algoName'] = 'bcrypt';\r\n list($cost) = sscanf($hash, \"$2y$%d$\");\r\n $return['options']['cost'] = $cost;\r\n }\r\n return $return;\r\n }",
"public function hash(string $string, array $options = []): string;",
"public static function getHashSize()\n\t\t{\n\t\t\treturn Utils::$expectedHashSize;\n\t\t}",
"public function hash();",
"public function hash();",
"public function getHash()\n {\n switch ($this->alg) {\n\n case 'RSA-SHA256':\n return 'sha256';\n }\n }",
"public function ShowAlgorithms() {\n\t\t$ShowHashAlgorithms = hash_algos();\n\t\treturn $ShowHashAlgorithms;\n\t}",
"public function getHash(): string\n {\n $h = hash_init($this->hashAlgo);\n foreach ($this->keys as &$v) {\n hash_update($h, $v);\n }\n $r = hash_final($h, true);\n unset($h);\n\n return $r;\n }",
"public static function getHashLength()\n {\n return self::$HASH_LENGTH;\n }",
"public function getHashGenerator();",
"private function gatherHash() {\n\t\t}",
"public function getInitialConfigHash();"
] | [
"0.6695242",
"0.64953095",
"0.6489914",
"0.6355274",
"0.6315937",
"0.6261077",
"0.61216617",
"0.6080804",
"0.59351474",
"0.5845891",
"0.5792556",
"0.578648",
"0.5775273",
"0.5745201",
"0.5733182",
"0.5606098",
"0.55750763",
"0.5544635",
"0.5541744",
"0.5517734",
"0.54896647",
"0.5486779",
"0.5486779",
"0.54463714",
"0.5425838",
"0.5415526",
"0.5411283",
"0.5403814",
"0.53917444",
"0.5345477"
] | 0.6521476 | 1 |
Adds or edits a student workshop submission. | public function i_add_a_submission_in_workshop_as($workshopname, $table) {
$workshopname = $this->escape($workshopname);
$savechanges = $this->escape(get_string('savechanges'));
$xpath = "//div[contains(concat(' ', normalize-space(@class), ' '), ' ownsubmission ')]/descendant::*[@type='submit']";
$this->execute('behat_general::click_link', $workshopname);
$this->execute("behat_general::i_click_on", array($xpath, "xpath_element"));
$this->execute("behat_forms::i_set_the_following_fields_to_these_values", $table);
$this->execute("behat_forms::press_button", $savechanges);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function i_assess_submission_in_workshop_as($submission, $workshopname, TableNode $table) {\n $workshopname = $this->escape($workshopname);\n $submissionliteral = behat_context_helper::escape($submission);\n $xpath = \"//div[contains(concat(' ', normalize-space(@class), ' '), ' assessment-summary ') \".\n \"and contains(.,$submissionliteral)]\";\n $assess = $this->escape(get_string('assess', 'workshop'));\n $saveandclose = $this->escape(get_string('saveandclose', 'workshop'));\n\n $this->execute('behat_general::click_link', $workshopname);\n\n $this->execute('behat_general::i_click_on_in_the',\n array($assess, \"button\", $xpath, \"xpath_element\")\n );\n\n $this->execute(\"behat_forms::i_set_the_following_fields_to_these_values\", $table);\n\n $this->execute(\"behat_forms::press_button\", $saveandclose);\n }",
"protected function add_submission($student, $review, $onlinetext = null, $changeuser = true) {\n // Add a submission.\n if ($changeuser) {\n $this->setUser($student);\n }\n\n if ($onlinetext === null) {\n $onlinetext = 'Submission text';\n }\n\n $data = (object) [\n 'userid' => $student->id,\n\n 'onlinetext_editor' => [\n 'itemid' => file_get_unused_draft_itemid(),\n 'text' => $onlinetext,\n 'format' => FORMAT_HTML,\n ]\n ];\n\n $review->save_submission($data, $notices);\n }",
"public function saving(WorkShift $workShift)\n {\n\n }",
"public function store(Request $request)\n {\n\n if (auth()->user()->hasRole('Student')){\n $this->validate($request, [\n 'assignment_id' => 'min:1|max:255|',\n 'solution' => 'required||min:1|max:255',\n ]);\n $student = Students::where('student_email', Auth::user()->email)->first();\n $student_id = $student->student_id;\n\n $assignment_id = $request->input(\"assignment_id\");\n $solution = $request->input(\"solution_id\");\n\n $course_code = $request->input(\"course_code\");\n $course_id = $request->input(\"course_id\");\n\n if(AssignmentSolutions::where([\n \"assignment_id\" => $assignment_id,\n \"solution\" => $solution,\n \"student_id\" => $student_id]\n\n )->exists()){\n return redirect()->back()->with(\"error\", \"You Have Subnitted Your Solution for $course_code Before \");\n }else{\n $data =([\n \"staff\" => new AssignmentSolutions,\n \"assignment_id\" => $request->input(\"assignment_id\"),\n \"solution\" => $request->input(\"solution\"),\n \"student_id\" => $student_id,\n ]);\n }\n\n if($this->model->create($data)){\n\n return redirect()->route(\"submissions.index\")->with(\"success\", \"You Have Submitted Your Assignment for $course_code Successfully\");\n }else{\n return redirect()->back()->with(\"error\", \"Network Failure\");\n }\n } else{\n return redirect()->back()->with([\n 'error' => \"You Dont have Access To Submit An Assignment\",\n ]);\n }\n\n }",
"public function store(Request $request) {\n $this->validate($request, [\n 'workshop_title' => 'required',\n 'workshop_author' => 'required'\n ]);\n $requestData = $request->all();\n \n $requestData['workshop_startdate'] = Carbon::createFromFormat('d/m/Y H.i', $requestData['workshop_startdate'])->format('Y-m-d H:i:s');\n $requestData['workshop_enddate'] = Carbon::createFromFormat('d/m/Y H.i', $requestData['workshop_enddate'])->format('Y-m-d H:i:s'); \n\n Workshop::create($requestData);\n\n Session::flash('flash_message', 'Workshop added!');\n\n return redirect('admin/workshops');\n }",
"public function actionCreate()\n {\n $model = new Workshops();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->Id_workshop]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"public function manager_edit($workshopId = null) {\n\t\tif(is_null($workshopId)) $this->redirect(array('action' => 'index'));\t\t\t\n\t\t\n\t\t$this->Workshop->id = $workshopId;\n\t\t$workshop = $this->Workshop->read();\n\t\t\n\t\tif(empty($workshop)) {\n\t\t\t$this->Session->setFlash(__(\"Workshop wurde nicht gefunden!\"),'/flash/error');\n\t\t\t$this->redirect(array('action' => 'index'));\t\t\t\n\t\t}\n\t\t\t\t\n\t\t$workshop['Workshop']['speakers'] = array_combine($workshop['Workshop']['speakers'],array_fill(0,count($workshop['Workshop']['speakers']),'1'));\t\t\t\t\n\t\t\n\t\tif($this->request->is('post')) {\n\t\t\t$this->Workshop->set($this->data);\n\t\t\tif($this->Workshop->save($this->data)) {\n\t\t\t\t\t$this->Session->setFlash(__(\"Workshop angelegt!\"),'/flash/success');\n\t\t\t\t\t$this->redirect(array('action' => 'index'));\t\t\t\t\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__(\"Workshop konnte nicht angelegt werden!\"),'/flash/error');\n\t\t\t\t\n\t\t\t\t$this->set('topics',$this->_formatTopics());\n\t\t\t\n\t\t\t\t$this->_setEventsAndSpeakers();\n\t\t\t}\t\t\t\n\t\t} else {\t\t\n\t\t\t\n\t\t\t//$this->set('topics',$this->_formatTopics());\n\t\t\t\n\t\t\t$this->_setEventsAndSpeakers();\n\t\t\t\n\t\t\t$this->request->data = $workshop;\n\t\t}\n\t}",
"public function i_edit_assessment_form_in_workshop_as($workshopname, $table) {\n $this->execute('behat_general::click_link', $workshopname);\n\n $this->execute('behat_navigation::i_navigate_to_in_current_page_administration',\n get_string('editassessmentform', 'workshop'));\n\n $this->execute(\"behat_forms::i_set_the_following_fields_to_these_values\", $table);\n\n $this->execute(\"behat_forms::press_button\", get_string('saveandclose', 'workshop'));\n }",
"public function addReviewByStudent_post()\n {\n /* code goes here */\n }",
"public function researchersave() {\n\t\t$r = new Researcher;\n\t\t$rid = $_SESSION['user']['researcher_id'];\n\t\t$r->upd( $rid, $_POST );\n\t\t$_SESSION['user'] = $r->getone($rid);\n\t\treturn 'researcher.tpl';\n\t}",
"public function addingscore($stuid, $hwid)\n\t{\n\t\t$this->load->model('resource/datamodel');\n\t\t//validation\n\t\tif (!$this->datamodel->is_teacher_has_homework($this->id, $hwid)){\n\t\t\t$this->output->set_output(\"error\");\n\t\t\treturn;\n\t\t}\n\t\tif (!$this->datamodel->is_student_has_homework($stuid, $hwid)){\n\t\t\t$this->output->set_output(\"error\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$comment = $this->input->post(\"comment\");\n\t\t$score = $this->input->post(\"score\");\n\t\t$hwid = $this->input->post(\"homeworkid\");\n\t\t$stuid = $this->input->post(\"studentid\");\n\t\t$stuhwinfo = $this->datamodel->get_homework_student($stuid, $hwid);\n\t\t$res = $this->datamodel->update_homework_student($stuid, $hwid, $stuhwinfo[0][\"fileid\"], $stuhwinfo[0][\"filename\"], $stuhwinfo[0][\"uploadtime\"], $score, $comment, $stuhwinfo[0][\"known\"]);\n\t\t$this->output->set_output(\"success\");\n\t}",
"function edit_school_review($req, $con){\r\n\t$user_id = $_REQUEST['user_id'];\r\n\t$review_id = $_REQUEST['review_id'];\r\n\r\n\t$strengths = $_REQUEST['strengths']; \r\n\t$improvements_needed = $_REQUEST['improvements_needed']; \r\n\t$suggestions = $_REQUEST['suggestions'];\r\n\t$assistance_requested = $_REQUEST['assistance_requested'];\r\n\t$qualification = $_REQUEST['qualification'];\r\n\r\n\tif($user_id != '' && $review_id != '')\r\n\t{\t\t\r\n\t\t if($_REQUEST['comments']!='')\r\n\t\t{\r\n\t\t $comments = $_REQUEST['comments'];\r\n\t\t$updatesql1 = mysqli_query($con, \"UPDATE `athlete_school_review` set \r\n\t\t`comments`='$comments', \r\n\t\t`strengths`='$strengths',\r\n\t\t`improvements_needed`='$improvements_needed',\r\n\t\t`suggestions`='$suggestions',\r\n\t\t`assistance_requested`='$assistance_requested' ,\r\n\t\t`qualification` = '$qualification'\t\r\n\t\twhere `id`='$review_id'\");\t\t\r\n\t\t}else{\r\n\t\t\techo \" \";\r\n\t\t}\r\n\t\t\r\n\t\tif($_REQUEST['add_subject']!='')\r\n\t\t{\r\n\t $count_add_subject=count($_REQUEST['add_subject']);\r\n\t \tfor($i=0;$i<$count_add_subject;$i++){\r\n\t\t$add_subject=$_REQUEST['add_subject'][$i];\r\n\t\t$add_grade=$_REQUEST['add_grade'][$i];\r\n\t\t\t\r\n\t $res=mysqli_query($con,\"INSERT INTO `athlete_school_review_details` (`review_id`, `subject`,`grade`) \r\n\t\t\t\tVALUES('$review_id','$add_subject','$add_grade')\");\r\n\t }\r\n\t\t}else\r\n\t\t{\r\n\t\t\techo \" \";\r\n\t\t}\r\n\t\t if($_REQUEST['edit_subject_id']!='')\r\n\t\t{\r\n\t\t $edit_subject_id_count=count($_REQUEST['edit_subject_id']);\r\n\t\tfor($i=0;$i<$edit_subject_id_count;$i++) \r\n\t\t{\r\n\t\t$edit_subject_id=$_REQUEST['edit_subject_id'];\r\n\t\t$sub=$_REQUEST['edit_subject'][$i];\t\t\r\n\t\t$grade=$_REQUEST['edit_grade'][$i];\t\t\r\n\r\n\t\t\t$updatesql2 = mysqli_query($con, \"UPDATE `athlete_school_review_details` set `subject`='$sub', `grade`='$grade' where `id`='$edit_subject_id[$i]'\");\r\n }\r\n\t\t\t\r\n\t }else\r\n\t\t{\r\n\t\t\techo \" \";\r\n\t\t}\r\n if($updatesql2)\r\n\t\t\t{\r\n\t\t\t\t$data['success'] = \"1\";\r\n\t\t\t\t$data['message'] = \"School Review Updated Successfully\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$data['success'] = \"0\";\r\n\t\t\t\t$data['message'] = \"There is some error\";\r\n\t\t\t} \r\n\t}\r\n\telse \r\n\t{\r\n\t\t$data['success'] = \"0\";\r\n\t\t$data['message'] = \"Please enter all required fields.\";\r\n\t}\r\n\techo json_encode($data);\r\n}",
"public function update(Request $request, Submission $submission)\n {\n\n }",
"public function addWorkshop(Request $request)\n {\n $new_workshop_name = $request->input('input_workshop_name');\n $new_workshop_topics = $request->input('input_workshop_topics');\n $new_workshop_host = $request->input('input_workshop_host');\n $new_workshop_location = $request->input('input_workshop_location');\n $new_workshop_start_date = $request->input('input_workshop_start_date');\n $new_workshop_end_date = $request->input('input_workshop_end_date');\n $new_workshop_time = $request->input('input_workshop_time');\n $new_workshop_description = $request->input('input_workshop_description');\n $new_workshop_event_url = $request->input('input_workshop_event_url');\n\n // creates a new entry in the workshop database\n $workshop = new Workshop;\n\n // assigns the new entries to the given variables in the database\n $workshop->name = $new_workshop_name;\n $workshop->topics = $new_workshop_topics;\n $workshop->host = $new_workshop_host;\n $workshop->location = $new_workshop_location;\n $workshop->start_date = $new_workshop_start_date;\n $workshop->end_date = $new_workshop_end_date;\n $workshop->time = $new_workshop_time;\n $workshop->description = $new_workshop_description;\n $workshop->event_url = $new_workshop_event_url;\n\n // validates if the file uploaded is an image\n $this->validate($request,\n [\n 'image' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',\n ]);\n\n // stores the image and creates a link to it\n if( $request->hasFile('image')) {\n $image = $request->file('image');\n $path = public_path(). '/images/workshop-images/';\n $filename = $workshop->name . '.' . $image->getClientOriginalExtension();\n $image->move($path, $filename);\n $workshop->image_url=$filename;\n }\n\n // saves the new entry\n $workshop->save();\n\n // returns to the edit page\n return redirect('/edit-workshops');\n\n }",
"public function update(Request $request, Workshop $workshop)\n {\n // $this->authorize('update', $workshop);\n $workshop->update($this->validateRequest($request));\n return redirect('/workshops/'.$workshop->id)\n ->with('success', 'You have edited the workshop '.$workshop->name.'!');\n }",
"public function manager_add() {\n\t\t\n\t\t//this->set('topics',$this->_formatTopics());\n\t\t\n\t\tif($this->request->is('post')) {\t\t\t\n\t\t\tif($this->Workshop->save($this->data)) {\n\t\t\t\t\t$this->Session->setFlash(__(\"Workshop angelegt!\"),'/flash/success');\n\t\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__(\"Workshop konnte nicht angelegt werden!\"),'/flash/success');\n\t\t\t\t$this->set('onErrors',true);\n\t\t\t\t$this->_setEventsAndSpeakers();\n\t\t\t}\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\t$this->_setEventsAndSpeakers();\n\t\t\t\n\t\t}\n\t}",
"public function submit_for_grading($student, $review, $data = [], $changeuser = true) {\n if ($changeuser) {\n $this->setUser($student);\n }\n\n $data = (object) array_merge($data, [\n 'userid' => $student->id,\n ]);\n\n $sink = $this->redirectMessages();\n $review->submit_for_grading($data, []);\n $sink->close();\n\n return $data;\n }",
"public function store(Request $request)\n {\n $this->validate($request, [\n 'exam_id' => 'required',\n 'student_id' => 'required',\n 'start_time' => 'required',\n 'end_time' => 'required',\n \n ]);\n\n \n $add = new exam_student;\n $add->exam_id = $request->exam_id;\n $add->user_id = $request->student_id;\n $add->start_time = $request->start_time;\n $add->end_time = $request->end_time;\n $add->remaining_time = isset($request->remaining_time) ? $request->remaining_time:null;\n $add->result = isset($request->result) ? $request->result:null;\n $add->node_number = isset($request->node_number) ? $request->node_number:null;\n $add->is_attend = isset($request->is_attend) ? $request->is_attend:0;\n $add->save();\n storeLog('exam_student',$add->id,date('Y-m-d H:i:s'),'create');\n storeReview('exam_student',$add->id,date('Y-m-d H:i:s'));\n\n return redirect()->route('exam_student.index')->with('success', 'Student Added Successfully.');\n }",
"public function store(StoreShiftRequest $shiftsRequest)\n {\n if(!$this->checkActionPermission('shifts','create'))\n return redirect()->route('401');\n $version_id = $this->getCurrentVersion();\n $shiftsRequest->request->add(['approval_status'=>'p','flag'=> 'a','version_id'=>$version_id]);\n $getInsertedId = $this->shifts->create($shiftsRequest);\n return redirect()->route('shifts.index'); \n }",
"function Submission_Assessors_Update(&$submission)\n {\n $key=$submission[ \"ID\" ].\"_Status\";\n $newvalue=$this->CGI_POSTint($key);\n\n if ($submission[ \"Status\" ]!=$newvalue)\n {\n $submission[ \"Status\" ]=$newvalue;\n $this->Sql_Update_Item_Values_Set(array(\"Status\"),$submission);\n }\n\n $assessor=$this->CGI_POSTint(\"Assessor_\".$submission[ \"ID\" ]);\n if ($assessor>0)\n {\n $where=$this->UnitEventWhere\n (\n array\n (\n \"Submission\" => $submission[ \"ID\" ],\n \"Friend\" => $assessor,\n )\n );\n \n $nitems=$this->AssessorsObj()->Sql_Select_NHashes($where);\n if ($nitems==0)\n {\n $assessor=$where;\n $this->AssessorsObj()->Sql_Insert_Item($assessor);\n }\n }\n }",
"function saveAssignmentSubmission(PeerReviewAssignment $assignment, Submission $document, $isNewSubmission)\n {\n //$sh = $this->prepareQuery(\"saveDocumentSubmissionQuery\", \"REPLACE INTO peer_review_assignment_document (submissionID, `document`) VALUES (?, ?);\");\n //$sh->execute(array($document->submissionID, $document->document));\n\n // This is more standard for this codebase.\n //$sh = $this->prepareQuery(\"saveDocumentSubmissionQuery\", \"INSERT INTO peer_review_assignment_document (submissionID, `document`) VALUES (?, ?) ON DUPLICATE KEY UPDATE document = ?;\");\n $saveDocumentSubmissionQuery = $this->prepareQuery(\"saveDocumentSubmissionQuery\", \"REPLACE INTO peer_review_assignment_document (submissionID, `document`, `partnerID`) VALUES (?, ?, ?);\");\n#\t$sh = $this->prepareQuery(\"savePartnerMapDocumentSubmissionQuery\", \"REPLACE INTO peer_review_partner_submission_map (submissionID, submissionOwnerID, submissionPartnerID) VALUES (?, ?, ?)\");\n //$sh->execute(array($document->submissionID, $document->document, $document->document));\n $saveDocumentSubmissionQuery->execute(array($document->submissionID, $document->document, $document->partnerID));\n\tif ($document->partnerID != 0) { \n\t\t$savePartnerMappingQuery = $this->prepareQuery(\"savePartnerMappingQuery\", \"REPLACE INTO peer_review_partner_submission_map (submissionID, submissionOwnerID, submissionPartnerID) VALUES (?,?,?);\");\n\t\t$savePartnerMappingQuery->execute(array($document->submissionID, $document->authorID, $document->partnerID));\n\t} else {\n\t\t$deletePartnerMapping = $this->prepareQuery(\"getPartnerMappingQuery\", \"DELETE from peer_review_partner_submission_map where submissionID = ?\");\n\t\t$deletePartnerMapping->execute(array($document->submissionID));\n\t}\n }",
"public function submit()\n\t{\n\t\tJRequest::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\n\t\t\n\t\t// Initialise variables.\n\t\t$app\t= JFactory::getApplication();\n\t\t$model\t= $this->getModel('editwar');\n\t\t\n\t\t// Get the data from the form POST\n\t\t$data = JRequest::getVar('jform', array(), 'post', 'array');\n\n\t\tif ($data['id'] != '')\t\t\n\t\t{\n\t\t\t$updated = $model->updateItem($data);\n\t\t\t\n\t\t\tif ($updated) \n\t\t\t{\n\t\t\t\t$this->setRedirect( JRoute::_('index.php?option=com_squadmanagement&view=editwar&id='. $data['id']),JText::_('COM_SQUADMANAGEMENT_FIELD_EDITWAR_SAVE_SUCCESS') );\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$added = $model->addItem($data);\n\t\t\t\n\t\t\tif ($added > 0) \n\t\t\t{\n\t\t\t\t$this->setRedirect( JRoute::_('index.php?option=com_squadmanagement&view=editwar&id='. $added),JText::_('COM_SQUADMANAGEMENT_FIELD_EDITWAR_SAVE_SUCCESS') );\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\t\t \n\t\t\n\t\t//$this->setRedirect( JRoute::_('index.php?option=com_squadmanagement&view=editwar&id='. $data['id']),JText::_('COM_SQUADMANAGEMENT_FIELD_EDITWAR_SAVE_FAIL') );\n\t\treturn false;\t\t\n\t}",
"function submit_union_note(Request $request){\n $student = Student::findOrFail($request->student_id);\n $student->is_submit = ($request->is_submit == \"true\") ? 1 : 0;\n $student->save();\n return;\n }",
"static function saveSectionSubmission($mysqli, $oSection)\n {\n if (JDRWH::dbInsert($mysqli, $oSection, 'wh_form_section_submissions')) return true;\n\n //If we got a unique key violation, then perform an update\n if ($mysqli->errno == 1062) //Unique key violation (Duplicate Entry)\n {\n $sql = 'UPDATE `wh_form_section_submissions` SET `dateSubmitted`=?, `rawBody`=?, `formSubmissionId`=? '.\n 'WHERE `internalName`=? AND `sectionName`=? AND `user_id`=?';\n $stmt = $mysqli->prepare($sql);\n $stmt->bind_param('ssissi', $oSection->dateSubmitted, $oSection->rawBody, $oSection->formSubmissionId,\n $oSection->internalName, $oSection->sectionName, $oSection->user_id);\n $stmt->execute();\n $stmt->close();\n return true;\n }\n\n return false;\n }",
"public function store(Request $request, Work $work)\n {\n $data = $request->except('_token');\n $response = $work->store($data, $this->user->teacher->id);\n if (is_array($response) && array_key_exists('errors', $response)) {\n return back()->withInput()->withErrors($response['errors']);\n }\n $new_work_id = $response->id;\n $message = 'Работа добавлена под номером ' . $new_work_id;\n return redirect('/teacher/works')->with('status', $message);\n }",
"public function work() {\n\t\t$this->load->language('user/tutors');\n\n\t\t$this->document->title = $this->language->get('heading_title');\n\n\t\t$this->load->model('user/tutors');\n\t\t$this->load->model('cms/essays');\n\n\t\tif(isset($this->request->get['user_id']) and !empty($this->request->get['user_id']))\n\t\t{\n\t\t\t$get_work_details = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$get_work_details = false;\n\t\t}\n\n\t\t// -------------------------------- Homework Assignment Code --------------------------------\n\t\tif($get_work_details){\n\n\t\t\tif (isset($this->request->get['page'])) {\n\t\t\t\t$page = $this->request->get['page'];\n\t\t\t} else {\n\t\t\t\t$page = 1;\n\t\t\t}\n\n\t\t\t//set filter variables\n\t\t\tif (isset($this->request->get['sort'])) {\n\t\t\t\t$sort = $this->request->get['sort'];\n\t\t\t} else {\n\t\t\t\t$sort = 'date_assinged';\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['order'])) {\n\t\t\t\t$order = $this->request->get['order'];\n\t\t\t} else {\n\t\t\t\t$order = 'ASC';\n\t\t\t}\n\n\t\t\t \n\t\t\tif (isset($this->request->get['filter_assignment_num'])) {\n\t\t\t\t$filter_assignment_num = $this->request->get['filter_assignment_num'];\n\t\t\t} else {\n\t\t\t\t$filter_assignment_num = NULL;\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_price_paid'])) {\n\t\t\t\t$filter_price_paid = $this->request->get['filter_price_paid'];\n\t\t\t} else {\n\t\t\t\t$filter_price_paid = NULL;\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_paid_to_tutor'])) {\n\t\t\t\t$filter_paid_to_tutor = $this->request->get['filter_paid_to_tutor'];\n\t\t\t} else {\n\t\t\t\t$filter_paid_to_tutor = NULL;\n\t\t\t}\n\t\t\t\t\n\n\t\t\tif (isset($this->request->get['filter_student_name'])) {\n\t\t\t\t$filter_student_name = $this->request->get['filter_student_name'];\n\t\t\t} else {\n\t\t\t\t$filter_student_name = NULL;\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_tutor_name'])) {\n\t\t\t\t$filter_tutor_name = $this->request->get['filter_tutor_name'];\n\t\t\t} else {\n\t\t\t\t$filter_tutor_name = NULL;\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_all'])) {\n\t\t\t\t$filter_all = $this->request->get['filter_all'];\n\t\t\t} else {\n\t\t\t\t$filter_all = NULL;\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_topic'])) {\n\t\t\t\t$filter_topic = $this->request->get['filter_topic'];\n\t\t\t} else {\n\t\t\t\t$filter_topic = NULL;\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_status'])) {\n\t\t\t\t$filter_status = $this->request->get['filter_status'];\n\t\t\t} else {\n\t\t\t\t$filter_status = NULL;\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_date_assigned'])) {\n\t\t\t\t$filter_date_assigned = $this->request->get['filter_date_assigned'];\n\t\t\t} else {\n\t\t\t\t$filter_date_assigned = NULL;\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_date_completed'])) {\n\t\t\t\t$filter_date_completed = $this->request->get['filter_date_completed'];\n\t\t\t} else {\n\t\t\t\t$filter_date_completed = NULL;\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_date_to_assigned'])) {\n\t\t\t\t$filter_date_to_assigned = $this->request->get['filter_date_to_assigned'];\n\t\t\t} else {\n\t\t\t\t$filter_date_to_assigned = NULL;\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_date_to_completed'])) {\n\t\t\t\t$filter_date_to_completed = $this->request->get['filter_date_to_completed'];\n\t\t\t} else {\n\t\t\t\t$filter_date_to_completed = NULL;\n\t\t\t}\n\n\t\t\t/* End of Code */\n\n\t\t\t// set default show only approved\n\t\t\t$filter_approved = '1';\n\n\t\t\tif (isset($this->request->get['filter_date_added'])) {\n\t\t\t\t$filter_date_added = $this->request->get['filter_date_added'];\n\t\t\t} else {\n\t\t\t\t$filter_date_added = NULL;\n\t\t\t}\n\t\t\t//end of set filter variables\n\n\n\t\t\t//set url variables\n\t\t\t$url = '';\n\n\t\t\tif (isset($this->request->get['filter_assignment_num'])) {\n\t\t\t\t$url .= '&filter_assignment_num=' . $this->request->get['filter_assignment_num'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_price_paid'])) {\n\t\t\t\t$url .= '&filter_price_paid=' . $this->request->get['filter_price_paid'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_paid_to_tutor'])) {\n\t\t\t\t$url .= '&filter_paid_to_tutor=' . $this->request->get['filter_paid_to_tutor'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_student_name'])) {\n\t\t\t\t$url .= '&filter_student_name=' . $this->request->get['filter_student_name'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_tutor_name'])) {\n\t\t\t\t$url .= '&filter_tutor_name=' . $this->request->get['filter_tutor_name'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_all'])) {\n\t\t\t\t$url .= '&filter_all=' . $this->request->get['filter_all'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_tutor_name'])) {\n\t\t\t\t$url .= '&filter_tutor_name=' . $this->request->get['filter_tutor_name'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_topic'])) {\n\t\t\t\t$url .= '&filter_topic=' . $this->request->get['filter_topic'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_subjects'])) {\n\t\t\t\t$url .= '&filter_subjects=' . $this->request->get['filter_subjects'];\n\t\t\t}\n\t\t\t\t\n\t\t\tif (isset($this->request->get['filter_status'])) {\n\t\t\t\t$url .= '&filter_status=' . $this->request->get['filter_status'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_approved'])) {\n\t\t\t\t$url .= '&filter_approved=' . $this->request->get['filter_approved'];\n\t\t\t}\n\t\t\t\t\n\t\t\tif (isset($this->request->get['filter_date_assigned'])) {\n\t\t\t\t$url .= '&filter_date_assigned=' . $this->request->get['filter_date_assigned'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_date_completed'])) {\n\t\t\t\t$url .= '&filter_date_completed=' . $this->request->get['filter_date_completed'];\n\t\t\t}\n\t\t\t\t\n\t\t\tif (isset($this->request->get['filter_date_to_assigned'])) {\n\t\t\t\t$url .= '&filter_date_to_assigned=' . $this->request->get['filter_date_to_assigned'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_date_to_completed'])) {\n\t\t\t\t$url .= '&filter_date_to_completed=' . $this->request->get['filter_date_to_completed'];\n\t\t\t}\n\t\t\t\t\n\t\t\tif (isset($this->request->get['page'])) {\n\t\t\t\t$url .= '&page=' . $this->request->get['page'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['sort'])) {\n\t\t\t\t$url .= '&sort=' . $this->request->get['sort'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['order'])) {\n\t\t\t\t$url .= '&order=' . $this->request->get['order'];\n\t\t\t}\n\n\t\t\t//end of set url variables\n\n\n\t\t\t$this->document->breadcrumbs = array();\n\n\t\t\t$this->document->breadcrumbs[] = array(\n \t\t'href' => HTTPS_SERVER . 'index.php?route=common/home&token=' . $this->session->data['token'],\n \t\t'text' => $this->language->get('text_home'),\n \t\t'separator' => FALSE\n\t\t\t);\n\n\t\t\t$this->document->breadcrumbs[] = array(\n \t\t'href' => HTTPS_SERVER . 'index.php?route=user/tutors/work&token=' . $this->session->data['token'] . $url,\n \t\t'text' => $this->language->get('heading_title'),\n \t\t'separator' => ' :: '\n \t\t);\n \t\t\t\n \t\t$this->data['insert'] = HTTPS_SERVER . 'index.php?route=user/tutors/work/insert&token=' . $this->session->data['token'] . $url;\n \t\t$this->data['delete'] = HTTPS_SERVER . 'index.php?route=user/tutors/work/delete&token=' . $this->session->data['token'] . $url;\n\n \t\t$this->data['informations'] = array();\n\n \t\t$data = array(\n\t\t\t'filter_assignment_num' => $filter_assignment_num, \n\t\t\t'filter_price_paid' => $filter_price_paid, \n\t\t\t'filter_paid_to_tutor' => $filter_paid_to_tutor, \n\t\t\t'filter_student_name' => $filter_student_name, \n\t\t\t'filter_tutor_name' => $filter_tutor_name, \n \t\t//'filter_all' => $filter_all,\n\t\t\t'filter_topic' => $filter_topic, \n\t\t\t'filter_status' => $filter_status,\n\t\t\t'filter_date_assigned' => $filter_date_assigned,\n\t\t\t'filter_date_completed' => $filter_date_completed,\n\t\t\t'filter_date_to_assigned' => $filter_date_to_assigned,\t\t\t\n\t\t\t'filter_date_to_completed' => $filter_date_to_completed,\n\t\t\t'sort' => $sort,\n\t\t\t'order' => $order,\n\t\t\t'start' => ($page - 1) * $this->config->get('config_admin_limit'),\n\t\t\t'limit' => $this->config->get('config_admin_limit'),\n\t\t\t'filter_tutor_id'\t\t => $this->request->get['user_id']\n \t\t);\n\n \t\t/*Softronikx Technologies */\n \t\t$assignment_status = $this->model_cms_essays->getAssignmentStatus();\n \t\t/*End of Code */\n\n \t\t$information_total = $this->model_cms_essays->getTotalInformations($data);\n\n \t\t$results = $this->model_cms_essays->getInformations($data);\n\n \t\tforeach ($results as $result) {\n \t\t\t$action = array();\n\n \t\t\t$action[] = array(\n\t\t\t\t'text' => $this->language->get('text_edit'),\n\t\t\t\t'href' => HTTPS_SERVER . 'index.php?route=user/tutors/work/update&token=' . $this->session->data['token'] . '&essay_id=' . $result['essay_id'] . $url\n \t\t\t);\n \t\t\t\t\n \t\t\tif($result['is_locked'])\n \t\t\t$action[] = array(\n\t\t\t\t'text' => 'Locked',\n\t\t\t\t'href' => 'javascript:void(0)'\n\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t$due_date = strtotime($result['date_completed']);\n\t\t\t\tif(!empty($due_date))\n\t\t\t\t$due_date = date('Y-m-d', strtotime($result['date_completed']));\n\t\t\t\telse\n\t\t\t\t$due_date = date('Y-m-d', strtotime($result['date_due'])).\" *\";\n\t\t\t\t//\n\n\t\t\t\t$this->data['informations'][] = array(\n\t\t\t\t'essay_id' => $result['essay_id'],\n\t\t\t\t'topic' => $result['topic'],\n\t\t\t\t'assignment_num' => \"A\".$result['assignment_num'],\n\t\t\t\t'student_name' => $result['student_name'],\n\t\t\t\t'tutor_name' => $result['tutor_name'],\n\t\t\t\t'status' => $result['curr_status'],\n\t\t\t\t'owed' => $result['owed'],\n\t\t\t\t'paid' => $result['paid'],\n\t\t\t\t'due_date' => $due_date,\n\t\t\t\t'date_assigned' => date('Y-m-d', strtotime($result['date_assigned'])),\n\t\t\t\t'selected' => isset($this->request->post['selected']) && in_array($result['essay_id'], $this->request->post['selected']),\n\t\t\t\t'action' => $action\n\t\t\t\t);\n \t\t}\n\n \t\t$this->data['heading_title'] = $this->language->get('heading_title_tutor_work_details');\n\n \t\t$this->data['text_enabled'] = $this->language->get('text_enabled');\n \t\t$this->data['text_disabled'] = $this->language->get('text_disabled');\n \t\t$this->data['text_yes'] = $this->language->get('text_yes');\n \t\t$this->data['text_no'] = $this->language->get('text_no');\n \t\t$this->data['text_no_results'] = $this->language->get('text_no_results');\n\n \t\t$this->data['column_assignment_num'] = $this->language->get('column_assignment_num');\n \t\t$this->data['column_student_name'] = $this->language->get('column_student_name');\n \t\t$this->data['column_topic'] = $this->language->get('column_topic');\n \t\t$this->data['column_date_assigned'] = $this->language->get('column_date_assigned');\n \t\t$this->data['column_due_date'] = $this->language->get('column_due_date');\n \t\t$this->data['column_status'] = $this->language->get('column_status');\n \t\t$this->data['column_action'] = $this->language->get('column_action');\n \t\t$this->data['column_homework_assignment'] = $this->language->get('column_homework_assignment');\n\n \t\t$this->data['button_approve'] = $this->language->get('button_approve');\n \t\t$this->data['button_insert'] = $this->language->get('button_insert');\n \t\t$this->data['button_delete'] = $this->language->get('button_delete');\n \t\t$this->data['button_filter'] = $this->language->get('button_filter');\n\n\n\n \t\t$this->data['token'] = $this->session->data['token'];\n\n \t\tif (isset($this->error['warning'])) {\n \t\t\t$this->data['error_warning'] = $this->error['warning'];\n \t\t} else {\n \t\t\t$this->data['error_warning'] = '';\n \t\t}\n\n \t\tif (isset($this->session->data['success'])) {\n \t\t\t$this->data['success'] = $this->session->data['success'];\n\n \t\t\tunset($this->session->data['success']);\n \t\t} else {\n \t\t\t$this->data['success'] = '';\n \t\t}\n\n \t\t//url for sorting\n \t\t$url = '';\n\n \t\tif (isset($this->request->get['filter_assignment_num'])) {\n \t\t\t$url .= '&filter_assignment_num=' . $this->request->get['filter_assignment_num'];\n \t\t}\n\n \t\tif (isset($this->request->get['filter_price_paid'])) {\n \t\t\t$url .= '&filter_price_paid=' . $this->request->get['filter_price_paid'];\n \t\t}\n\n \t\tif (isset($this->request->get['filter_paid_to_tutor'])) {\n \t\t\t$url .= '&filter_paid_to_tutor=' . $this->request->get['filter_paid_to_tutor'];\n \t\t}\n\n \t\tif (isset($this->request->get['filter_student_name'])) {\n \t\t\t$url .= '&filter_student_name=' . $this->request->get['filter_student_name'];\n \t\t}\n\n \t\tif (isset($this->request->get['filter_tutor_name'])) {\n \t\t\t$url .= '&filter_tutor_name=' . $this->request->get['filter_tutor_name'];\n \t\t}\n\n \t\tif (isset($this->request->get['filter_all'])) {\n \t\t\t$url .= '&filter_all=' . $this->request->get['filter_all'];\n \t\t}\n\n \t\tif (isset($this->request->get['filter_topic'])) {\n \t\t\t$url .= '&filter_topic=' . $this->request->get['filter_topic'];\n \t\t}\n\n \t\tif (isset($this->request->get['filter_status'])) {\n \t\t\t$url .= '&filter_status=' . $this->request->get['filter_status'];\n \t\t}\n\n \t\tif (isset($this->request->get['filter_date_assigned'])) {\n \t\t\t$url .= '&filter_date_assigned=' . $this->request->get['filter_date_assigned'];\n \t\t}\n\n \t\tif (isset($this->request->get['filter_date_completed'])) {\n \t\t\t$url .= '&filter_date_completed=' . $this->request->get['filter_date_completed'];\n \t\t}\n\n \t\tif (isset($this->request->get['filter_date_to_assigned'])) {\n \t\t\t$url .= '&filter_date_to_assigned=' . $this->request->get['filter_date_to_assigned'];\n \t\t}\n\n \t\tif (isset($this->request->get['filter_date_to_completed'])) {\n \t\t\t$url .= '&filter_date_to_completed=' . $this->request->get['filter_date_to_completed'];\n \t\t}\n\n \t\tif (isset($this->request->get['user_id'])) {\n \t\t\t$url .= '&user_id=' . $this->request->get['user_id'];\n \t\t}\n\n \t\tif ($order == 'ASC') {\n \t\t\t$url .= '&order=DESC';\n \t\t} else {\n \t\t\t$url .= '&order=ASC';\n \t\t}\n\n \t\tif (isset($this->request->get['page'])) {\n \t\t\t$url .= '&page=' . $this->request->get['page'];\n \t\t}\n\n \t\t$this->data['sort_assignment_num'] = HTTPS_SERVER . 'index.php?route=user/tutors/work&token=' . $this->session->data['token'] . '&sort=ea.assignment_num' . $url;\n \t\t$this->data['sort_student_name'] = HTTPS_SERVER . 'index.php?route=user/tutors/work&token=' . $this->session->data['token'] . '&sort=ea.student_name' . $url;\n \t\t$this->data['sort_tutor_name'] = HTTPS_SERVER . 'index.php?route=user/tutors/work&token=' . $this->session->data['token'] . '&sort=ea.tutor_id' . $url;\n \t\t$this->data['sort_topic'] = HTTPS_SERVER . 'index.php?route=user/tutors/work&token=' . $this->session->data['token'] . '&sort=ea.topic' . $url;\n \t\t$this->data['sort_status'] = HTTPS_SERVER . 'index.php?route=user/tutors/work&token=' . $this->session->data['token'] . '&sort=ea.status' . $url;\n \t\t$this->data['sort_date_assigned'] = HTTPS_SERVER . 'index.php?route=user/tutors/work&token=' . $this->session->data['token'] . '&sort=ea.date_assigned' . $url;;\n \t\t$this->data['sort_due_date'] = HTTPS_SERVER . 'index.php?route=user/tutors/work&token=' . $this->session->data['token'] . '&sort=ea.date_due' . $url;;\n \t\t$this->data['sort_price_paid'] = HTTPS_SERVER . 'index.php?route=user/tutors/work&token=' . $this->session->data['token'] . '&sort=ea.owed' . $url;;\n \t\t$this->data['paid_to_tutor'] = HTTPS_SERVER . 'index.php?route=user/tutors/work&token=' . $this->session->data['token'] . '&sort=ea.paid' . $url;;\n\n \t\t//url for pagination\n \t\t$url = '';\n\n \t\t$url = '';\n\n \t\tif (isset($this->request->get['filter_assignment_num'])) {\n \t\t\t$url .= '&filter_assignment_num=' . $this->request->get['filter_assignment_num'];\n \t\t}\n\n \t\tif (isset($this->request->get['filter_price_paid'])) {\n \t\t\t$url .= '&filter_price_paid=' . $this->request->get['filter_price_paid'];\n \t\t}\n\n \t\tif (isset($this->request->get['filter_paid_to_tutor'])) {\n \t\t\t$url .= '&filter_paid_to_tutor=' . $this->request->get['filter_paid_to_tutor'];\n \t\t}\n\n\n \t\tif (isset($this->request->get['filter_student_name'])) {\n \t\t\t$url .= '&filter_student_name=' . $this->request->get['filter_student_name'];\n \t\t}\n\n \t\tif (isset($this->request->get['filter_tutor_name'])) {\n \t\t\t$url .= '&filter_tutor_name=' . $this->request->get['filter_tutor_name'];\n \t\t}\n\n \t\tif (isset($this->request->get['filter_all'])) {\n \t\t\t$url .= '&filter_all=' . $this->request->get['filter_all'];\n \t\t}\n\n \t\tif (isset($this->request->get['filter_topic'])) {\n \t\t\t$url .= '&filter_topic=' . $this->request->get['filter_topic'];\n \t\t}\n\n \t\tif (isset($this->request->get['filter_status'])) {\n \t\t\t$url .= '&filter_status=' . $this->request->get['filter_status'];\n \t\t}\n\n \t\tif (isset($this->request->get['filter_date_assigned'])) {\n \t\t\t$url .= '&filter_date_assigned=' . $this->request->get['filter_date_assigned'];\n \t\t}\n\n \t\tif (isset($this->request->get['filter_date_completed'])) {\n \t\t\t$url .= '&filter_date_completed=' . $this->request->get['filter_date_completed'];\n \t\t}\n\n \t\tif (isset($this->request->get['filter_date_to_assigned'])) {\n \t\t\t$url .= '&filter_date_to_assigned=' . $this->request->get['filter_date_to_assigned'];\n \t\t}\n\n \t\tif (isset($this->request->get['filter_date_to_completed'])) {\n \t\t\t$url .= '&filter_date_to_assigned=' . $this->request->get['filter_date_to_assigned'];\n \t\t}\n\n \t\tif (isset($this->request->get['user_id'])) {\n \t\t\t$url .= '&user_id=' . $this->request->get['user_id'];\n \t\t}\n\n \t\tif (isset($this->request->get['sort'])) {\n \t\t\t$url .= '&sort=' . $this->request->get['sort'];\n \t\t}\n\n \t\tif (isset($this->request->get['order'])) {\n \t\t\t$url .= '&order=' . $this->request->get['order'];\n \t\t}\n\n \t\t$pagination = new Pagination();\n \t\t$pagination->total = $information_total;\n \t\t$pagination->page = $page;\n \t\t$pagination->limit = $this->config->get('config_admin_limit');\n \t\t$pagination->text = $this->language->get('text_pagination');\n \t\t$pagination->url = HTTPS_SERVER . 'index.php?route=user/tutors/work&token=' . $this->session->data['token'] . $url . '&page={page}';\n \t\t\t\n \t\t$this->data['pagination'] = $pagination->render();\n\n \t\t//get tutors name\n \t\t$tutor_details = $this->model_user_tutors->getTutor($this->request->get['user_id']);\n\n \t\t$this->data['tutor_name'] = $tutor_details['firstname'].' '.$tutor_details['lastname'];\n\n \t\t$this->data['filter_student_name'] = $filter_student_name;\n \t\t$this->data['filter_tutor_name'] = $filter_tutor_name;\n \t\t$this->data['filter_all'] = $filter_all;\n \t\t$this->data['filter_topic'] = $filter_topic;\n \t\t$this->data['filter_status'] = $filter_status;\n \t\t$this->data['filter_date_assigned'] = $filter_date_assigned;\n \t\t$this->data['filter_date_completed'] = $filter_date_completed;\n \t\t$this->data['filter_date_to_assigned'] = $filter_date_to_assigned;\n \t\t$this->data['filter_date_to_completed'] = $filter_date_to_completed;\n \t\t$this->data['assignment_status'] = $assignment_status;\n \t\t$this->data['filter_assignment_num'] = $filter_assignment_num;\n \t\t$this->data['filter_price_paid'] = $filter_price_paid;\n \t\t$this->data['filter_paid_to_tutor'] = $filter_paid_to_tutor;\n \t\t$this->data['user_id'] = $this->request->get['user_id'];\n \t\t$this->data['sort'] = $sort;\n \t\t$this->data['order'] = $order;\n\n\n \t\t// -------------------------------- End of Homework Assignment Code --------------------------------\n\n\t\t}\n\n\t\t// -------------------------------- Session Details Code ----------------------------------------\n\t\tif($get_work_details) {\n\n\t\t\t$this->load->model('user/sessions');\n\t\t\t$this->load->model('cms/payment');\n\n\t\t\tif (isset($this->request->get['page_s'])) {\n\t\t\t\t$page_s = $this->request->get['page_s'];\n\t\t\t} else {\n\t\t\t\t$page_s = 1;\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['sort_s'])) {\n\t\t\t\t$sort_s = $this->request->get['sort_s'];\n\t\t\t} else {\n\t\t\t\t$sort_s = 'name';\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['order_s'])) {\n\t\t\t\t$order_s = $this->request->get['order_s'];\n\t\t\t} else {\n\t\t\t\t$order_s = 'ASC';\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_session_date_s'])) {\n\t\t\t\t$filter_session_date_s = $this->request->get['filter_session_date_s'];\n\t\t\t} else {\n\t\t\t\t$filter_session_date_s = NULL;\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_tutor_name_s'])) {\n\t\t\t\t$filter_tutor_name_s = $this->request->get['filter_tutor_name_s'];\n\t\t\t} else {\n\t\t\t\t$filter_tutor_name_s = NULL;\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_student_name_s'])) {\n\t\t\t\t$filter_student_name_s = $this->request->get['filter_student_name_s'];\n\t\t\t} else {\n\t\t\t\t$filter_student_name_s = NULL;\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_session_duration_s'])) {\n\t\t\t\t$filter_session_duration_s = $this->request->get['filter_session_duration_s'];\n\t\t\t} else {\n\t\t\t\t$filter_session_duration_s = NULL;\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_session_notes_s'])) {\n\t\t\t\t$filter_session_notes_s = $this->request->get['filter_session_notes_s'];\n\t\t\t} else {\n\t\t\t\t$filter_session_notes_s = NULL;\n\t\t\t}\n\n\t\t\t$url = '';\n\n\t\t\tif (isset($this->request->get['filter_session_date_s'])) {\n\t\t\t\t$url .= '&filter_session_date_s=' . $this->request->get['filter_session_date_s'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_tutor_name_s'])) {\n\t\t\t\t$url .= '&filter_tutor_name_s=' . $this->request->get['filter_tutor_name_s'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_student_name_s'])) {\n\t\t\t\t$url .= '&filter_student_name_s=' . $this->request->get['filter_student_name_s'];\n\t\t\t}\n\t\t\t\t\n\t\t\tif (isset($this->request->get['filter_session_duration_s'])) {\n\t\t\t\t$url .= '&filter_session_duration_s=' . $this->request->get['filter_session_duration_s'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['filter_session_notes_s'])) {\n\t\t\t\t$url .= '&filter_session_notes_s=' . $this->request->get['filter_session_notes_s'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['page_s'])) {\n\t\t\t\t$url .= '&page_s=' . $this->request->get['page_s'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['sort_s'])) {\n\t\t\t\t$url .= '&sort_s=' . $this->request->get['sort_s'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['order_s'])) {\n\t\t\t\t$url .= '&order_s=' . $this->request->get['order_s'];\n\t\t\t}\n\n\t\t\tif (isset($this->request->get['user_id'])) {\n\t\t\t\t$url .= '&user_id=' . $this->request->get['user_id'];\n\t\t\t}\n\n\t\t\t$this->document->breadcrumbs = array();\n\n\t\t\t$this->document->breadcrumbs[] = array(\n \t\t'href' => HTTPS_SERVER . 'index.php?route=common/home&token=' . $this->session->data['token'],\n \t\t'text' => $this->language->get('text_home'),\n \t\t'separator' => FALSE\n\t\t\t);\n\n\t\t\t$this->document->breadcrumbs[] = array(\n \t\t'href' => HTTPS_SERVER . 'index.php?route=user/tutors/work&token=' . $this->session->data['token'] . $url,\n \t\t'text' => $this->language->get('heading_title'),\n \t\t'separator' => ' :: '\n \t\t);\n\n \t\t$this->data['insert'] = HTTPS_SERVER . 'index.php?route=user/tutors/work/insert&token=' . $this->session->data['token'] . $url;\n \t\t$this->data['delete'] = HTTPS_SERVER . 'index.php?route=user/tutors/work/delete&token=' . $this->session->data['token'] . $url;\n \t\t$this->data['lock_sessions'] = HTTPS_SERVER . 'index.php?route=user/tutors/work/lock&token=' . $this->session->data['token'] . $url;\n \t\t$this->data['unlock_sessions'] = HTTPS_SERVER . 'index.php?route=user/tutors/work/unlock&token=' . $this->session->data['token'] . $url;\n\n\n \t\tif($this->user->getUserGroupId() > 3)\n \t\t$this->data['sessions_controll'] = 1;\n \t\telse\n \t\t$this->data['sessions_controll'] = 0;\n\n \t\t$this->data['sessions'] = array();\n\n \t\t$data = array(\n\t\t\t'filter_session_date' => $filter_session_date_s, \n\t\t\t'filter_tutor_name' => $filter_tutor_name_s, \n\t\t\t'filter_student_name' => $filter_student_name_s, \n\t\t\t'filter_session_duration' => $filter_session_duration_s,\n\t\t\t'filter_session_notes' => $filter_session_notes_s,\n\t\t\t'sort' => $sort_s,\n\t\t\t'order' => $order_s,\n\t\t\t'start' => ($page_s - 1) * $this->config->get('config_admin_limit'),\n\t\t\t'limit' => $this->config->get('config_admin_limit'),\n\t\t\t'filter_tutor_id'\t\t=> $this->request->get['user_id'] //filter the data by tutor id here\n \t\t);\n\n \t\t$session_total = $this->model_user_sessions->getTotalSessions($data);\n \t\t$results = $this->model_user_sessions->getSessions($data);\n \t\t$duration_array = $this->model_user_sessions->getAllDurations();\n \t\tforeach ($results as $result) {\n \t\t\t$action = array();\n\n \t\t\t$action[] = array(\n\t\t\t\t'text' => $this->language->get('text_edit'),\n\t\t\t\t'href' => HTTPS_SERVER . 'index.php?route=user/tutors/work/update&token=' . $this->session->data['token'] . '&session_id=' . $result['session_id'] . $url\n \t\t\t);\n \t\t\t\t\n \t\t\tif($result['p_locked'])\n \t\t\t$action[] = array(\n\t\t\t\t'text' => 'P Locked',\n\t\t\t\t'href' => 'javascript:void(0)'\n\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\tif($result['i_locked'])\n\t\t\t\t$action[] = array(\n\t\t\t\t'text' => 'I Locked',\n\t\t\t\t'href' => 'javascript:void(0)'\n\t\t\t\t);\n\n\t\t\t\t\n\t\t\t\t$session_tutor_wage = $this->model_cms_payment->getTutorSessionRate($this->request->get['user_id'],$result['tutors_to_students_id'],$result['session_id']);\n\t\t\t\t\n\t\t\t\tif(empty($session_tutor_wage)) $session_tutor_wage = $result['base_wage'];\n\t\t\t\t\n\t\t\t\t$this->data['sessions'][] = array(\n\t\t\t 'session_id' => $result['session_id'],\n\t\t\t\t'tutors_to_students_id' => $result['tutors_to_students_id'],\n\t\t\t\t//'tutor_wage' => $result['base_wage'],\n\t\t\t\t'tutor_wage' => $session_tutor_wage,\n\t\t\t\t'base_invoice' => $result['base_invoice'],\t\t\t\t\n\t\t\t\t'tutor_name' => $result['tutor_name'],\n\t\t\t\t'student_name' => $result['student_name'],\n\t\t\t\t'session_date' => date($this->language->get('date_format_short'), strtotime($result['session_date'])),\n\t\t\t\t'session_duration' => $duration_array[$result['session_duration']],\n\t\t\t\t'date' => date($this->language->get('date_format_short'), strtotime($result['date_submission'])),\n\t\t\t\t'selected' => isset($this->request->post['selected']) && in_array($result['session_duration'], $this->request->post['selected']),\n\t\t\t\t'action' => $action\n\t\t\t\t);\n \t\t}\n \t\t$this->data['duration_array'] = \t$duration_array;\n \t\t$this->data['heading_title_s'] = $this->language->get('heading_title_session');\n \t\t$this->data['text_no_results'] = $this->language->get('text_no_results');\n\n \t\t$this->data['column_session_duration'] = $this->language->get('column_session_duration');\n \t\t$this->data['column_student_name'] = $this->language->get('column_student_name');\n \t\t$this->data['column_tutor_name'] = $this->language->get('column_tutor_name');\n \t\t$this->data['column_session_notes'] = $this->language->get('column_session_notes');\n \t\t$this->data['column_session_date'] = $this->language->get('column_session_date');\n \t\t$this->data['column_date'] = $this->language->get('column_date');\n \t\t$this->data['column_action'] = $this->language->get('column_action');\n \t\t$this->data['heading_title_session'] = $this->language->get('heading_title_session');\n \t\t$this->data['column_tutor_wage'] = $this->language->get('column_tutor_wage');\n \t\t$this->data['column_base_invoice'] = $this->language->get('column_base_invoice');\n\n\n \t\t$this->data['button_unassing'] = $this->language->get('button_unassing');\n \t\t$this->data['button_insert'] = $this->language->get('button_insert');\n \t\t$this->data['button_delete'] = $this->language->get('button_delete');\n \t\t$this->data['button_lock'] = $this->language->get('button_lock');\n \t\t$this->data['button_unlock'] = $this->language->get('button_unlock');\n \t\t$this->data['button_filter'] = $this->language->get('button_filter');\n\n \t\t$this->data['token'] = $this->session->data['token'];\n\n \t\tif (isset($this->session->data['error'])) {\n \t\t\t$this->data['error_warning'] = $this->session->data['error'];\n \t\t\t\t\n \t\t\tunset($this->session->data['error']);\n \t\t} elseif (isset($this->error['warning'])) {\n \t\t\t$this->data['error_warning'] = $this->error['warning'];\n \t\t} else {\n \t\t\t$this->data['error_warning'] = '';\n \t\t}\n\n \t\tif (isset($this->session->data['success'])) {\n \t\t\t$this->data['success'] = $this->session->data['success'];\n\n \t\t\tunset($this->session->data['success']);\n \t\t} else {\n \t\t\t$this->data['success'] = '';\n \t\t}\n\n \t\t$url = '';\n\n \t\tif (isset($this->request->get['filter_session_date_s'])) {\n \t\t\t$url .= '&filter_session_date_s=' . $this->request->get['filter_session_date_s'];\n \t\t}\n\n \t\tif (isset($this->request->get['filter_tutor_name'])) {\n \t\t\t$url .= '&filter_tutor_name=' . $this->request->get['filter_tutor_name'];\n \t\t}\n\n \t\tif (isset($this->request->get['filter_student_name_s'])) {\n \t\t\t$url .= '&filter_student_name_s=' . $this->request->get['filter_student_name_s'];\n \t\t}\n\n \t\tif (isset($this->request->get['filter_session_duration_s'])) {\n \t\t\t$url .= '&filter_session_duration_s=' . $this->request->get['filter_session_duration_s'];\n \t\t}\n\n \t\tif (isset($this->request->get['filter_session_notes_s'])) {\n \t\t\t$url .= '&filter_session_notes_s=' . $this->request->get['filter_session_notes_s'];\n \t\t}\n\n \t\tif (isset($this->request->get['user_id'])) {\n \t\t\t$url .= '&user_id=' . $this->request->get['user_id'];\n \t\t}\n\n \t\tif ($order_s == 'ASC') {\n \t\t\t$url .= '&order_s=DESC';\n \t\t} else {\n \t\t\t$url .= '&order_s=ASC';\n \t\t}\n\n \t\tif (isset($this->request->get['page'])) {\n \t\t\t$url .= '&page_s=' . $this->request->get['page'];\n \t\t}\n\n $this->data['sort_tutor_name'] = HTTPS_SERVER . 'index.php?route=user/tutors/work&token=' . $this->session->data['token'] . '&sort_s=tutor_name' . $url;\n $this->data['sort_student_name'] = HTTPS_SERVER . 'index.php?route=user/tutors/work&token=' . $this->session->data['token'] . '&sort_s=student_name' . $url;\n $this->data['sort_session_date'] = HTTPS_SERVER . 'index.php?route=user/tutors/work&token=' . $this->session->data['token'] . '&sort_s=session_date' . $url;\n $this->data['sort_session_duration'] = HTTPS_SERVER . 'index.php?route=user/tutors/work&token=' . $this->session->data['token'] . '&sort_s=session_duration' . $url;\n $this->data['sort_session_notes'] = HTTPS_SERVER . 'index.php?route=user/tutors/work&token=' . $this->session->data['token'] . '&sort_s=session_notes' . $url;\n\n\n $pagination_s = new Pagination();\n $pagination_s->total = $session_total;\n $pagination_s->page = $page;\n $pagination_s->limit = $this->config->get('config_admin_limit');\n $pagination_s->text = $this->language->get('text_pagination');\n $pagination_s->url = HTTPS_SERVER . 'index.php?route=user/tutors/work&token=' . $this->session->data['token'] . $url . '&page_s={page}';\n \t\n $this->data['pagination_s'] = $pagination_s->render();\n $this->data['filter_tutor_name_s'] = $filter_tutor_name_s;\n $this->data['filter_student_name_s'] = $filter_student_name_s;\n $this->data['filter_session_date_s'] = $filter_session_date_s;\n $this->data['filter_session_duration_s'] = $filter_session_duration_s;\n $this->data['filter_session_notes_s'] = $filter_session_notes_s;\n\n\n $this->data['sort_s'] = $sort_s;\n $this->data['order_s'] = $order_s;\n\n\t\t}\n\n\t\t// -------------------------------- End of Session Details Code -------------------------------\n\n\n\n\t\tif($get_work_details){\n\t\t\t$this->template = 'user/tutors_work_list.tpl';\n\t\t\t$this->children = array(\n\t\t\t'common/header',\t\n\t\t\t'common/footer'\t\n\t\t\t);\n\n\t\t\t$this->response->setOutput($this->render(TRUE), $this->config->get('config_compression'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"Invalid Tutor!\";\n\t\t}\n\t\t//$this->getForm(\"heading_title_update\");\n\t\t//code to load the work template and display the work\n\t}",
"public function add_marking_submissions() {\n global $CFG, $mid, $OUTPUT, $DB;\n $mform = & $this->_form;\n $mform->addElement('html', '<td class=\"marking-headB\">');\n if ($this->_customdata->submission->timemodified) {\n $icon = $CFG->wwwroot . '/pix/f/text.gif';\n $icon2 = $CFG->wwwroot . '/blocks/fn_marking/pix/fullscreen_maximize.gif';\n $icon3 = $CFG->wwwroot . '/blocks/fn_marking/pix/completed.gif';\n $mform->addElement('html', '<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\" width=\"100%\" class=\"resourse-tab\">');\n\n if (!isset($this->_customdata->submissions)) {\n $this->_customdata->submissions[] = $this->_customdata->submission;\n }\n $subcount = count($this->_customdata->submissions);\n $currcount = 0;\n foreach ($this->_customdata->submissions as $submission) {\n $currcount++;\n if ($submission->timemodified <= 0) {\n $mform->addElement('static', 'notsubmittedyet', '', print_string('notsubmittedyet', 'assignment'));\n } else if ($submission->timemarked <= 0) {\n // Saved section.\n $mform->addElement('html', '<tr><td valign=\"top\" align=\"left\">');\n if (($subcount > 1) && ($currcount == $subcount)) {\n $mform->addElement('hidden', 'sub_id', $submission->id);\n $mform->setType('sub_id', PARAM_INT);\n $mform->addElement('hidden', 'sesskey', sesskey());\n $mform->setType('sesskey', PARAM_ALPHANUM);\n $mform->addElement('hidden', 'offset', '2');\n $mform->setType('offset', PARAM_INT);\n }\n $this->add_submission_content();\n $mform->addElement('html', '</td></tr>');\n } else {\n // Marked section.\n $mform->addElement('html', '<tr>');\n $mform->addElement('html', '<td>');\n if (($subcount > 1) && ($currcount == $subcount)) {\n $mform->addElement('hidden', 'sub_id', $submission->id);\n }\n // Print student response files.\n $this->add_submission_content();\n $mform->addElement('html', '</td></tr>');\n }\n }\n $mform->addElement('html', '</table>');\n } else {\n $mform->addElement('static', 'notsubmitted', '', print_string('notsubmittedyet', 'assignment'));\n }\n\n $mform->addElement('html', '</td>');\n }",
"public function updateWorkshop(Request $request, $id)\n {\n $updated_workshop_name = $request->input('input_workshop_name');\n $updated_workshop_topics = $request->input('input_workshop_topics');\n $updated_workshop_host = $request->input('input_workshop_host');\n $updated_workshop_location = $request->input('input_workshop_location');\n $updated_workshop_start_date = $request->input('input_workshop_start_date');\n $updated_workshop_end_date = $request->input('input_workshop_end_date');\n $updated_workshop_time = $request->input('input_workshop_time');\n $updated_workshop_description = $request->input('input_workshop_description');\n $updated_workshop_event_url = $request->input('input_workshop_event_url');\n\n // looks for the specific entry to be updated\n $workshop = Workshop::find($id);\n\n // updates the data\n $workshop->name = $updated_workshop_name;\n $workshop->topics = $updated_workshop_topics;\n $workshop->host = $updated_workshop_host;\n $workshop->location = $updated_workshop_location;\n $workshop->start_date = $updated_workshop_start_date;\n $workshop->end_date = $updated_workshop_end_date;\n $workshop->time = $updated_workshop_time;\n $workshop->description = $updated_workshop_description;\n $workshop->event_url = $updated_workshop_event_url;\n\n $this->validate($request,\n [\n 'image' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048',\n ]);\n\n // stores the image and creates a link to it\n if( $request->hasFile('image')) {\n $image = $request->file('image');\n $path = public_path(). '/images/workshop-images/';\n $filename = $workshop->name . '.' . $image->getClientOriginalExtension();\n $image->move($path, $filename);\n $workshop->image_url = $filename;\n }\n\n // saves the entries in the database\n $workshop->save();\n\n // returns to the edit page\n return redirect('/edit-workshops');\n }",
"public function edit(work $work)\n {\n\n }",
"public function update(User $user, Submission $submission)\n {\n //\n }"
] | [
"0.60311323",
"0.5828844",
"0.5620395",
"0.5596155",
"0.5573516",
"0.5527856",
"0.54862976",
"0.5465021",
"0.53849214",
"0.530517",
"0.5287751",
"0.52526635",
"0.5198",
"0.5191166",
"0.51775265",
"0.5164655",
"0.5159816",
"0.5133136",
"0.5126686",
"0.512115",
"0.51084644",
"0.5105629",
"0.5085078",
"0.5082771",
"0.50778526",
"0.5050655",
"0.503706",
"0.5024025",
"0.5015475",
"0.5007943"
] | 0.6985237 | 0 |
Sets the workshop assessment form. | public function i_edit_assessment_form_in_workshop_as($workshopname, $table) {
$this->execute('behat_general::click_link', $workshopname);
$this->execute('behat_navigation::i_navigate_to_in_current_page_administration',
get_string('editassessmentform', 'workshop'));
$this->execute("behat_forms::i_set_the_following_fields_to_these_values", $table);
$this->execute("behat_forms::press_button", get_string('saveandclose', 'workshop'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function form()\n {\n /** @var GradesTable $gradesTable */\n $gradesTable = TableRegistry::getTableLocator()->get('Grades');\n $countiesTable = TableRegistry::getTableLocator()->get('Counties');\n $schoolTypesTable = TableRegistry::getTableLocator()->get('SchoolTypes');\n $this->set([\n 'counties' => $countiesTable->find()\n ->select(['Counties.id', 'Counties.name'])\n ->matching('States', function (Query $q) {\n return $q->where(['States.name' => 'Indiana']);\n })\n ->orderAsc('Counties.name')\n ->toArray(),\n 'gradeLevels' => array_values($gradesTable->getAll()),\n 'schoolTypes' => $schoolTypesTable->find()\n ->select(['id', 'name'])\n ->all()\n ->toArray(),\n 'titleForLayout' => 'Create a Ranking Formula',\n ]);\n }",
"abstract public function setForm(Form $form);",
"public function setForm(Form $form);",
"public function setForm($form)\n {\n $this->form = $form;\n }",
"public function setTeachingForm($teachingForm)\n\t{\n\t $this->teachingForm = $teachingForm;\n\t}",
"function setForm( &$object )\r\n {\r\n if( is_a( $object, \"eZForm\" ) )\r\n {\r\n $this->Form = $object;\r\n }\r\n }",
"protected function _prepareForm()\n {\n $helper = Mage::helper('oggetto_faq');\n $model = $this->getCurrentQuestionsModel();\n\n $form = new Varien_Data_Form([\n 'id' => 'edit_form',\n 'action' => $this->getUrl('*/*/save', [\n 'id' => $this->getRequest()->getParam('id')\n ]),\n 'method' => 'post',\n 'enctype' => 'multipart/form-data'\n ]);\n\n $this->setForm($form);\n\n\n $fieldset = $form->addFieldset('edit_form', ['legend' => $helper->__('Questions Information')]);\n\n $fieldset->addField('name', 'label', [\n 'label' => $helper->__('User name'),\n 'name' => 'name',\n ]);\n $fieldset->addField('email', 'label', [\n 'label' => $helper->__('User email'),\n 'name' => 'email',\n ]);\n $fieldset->addField('question_text', 'editor', [\n 'label' => $helper->__('Question text'),\n 'name' => 'question_text',\n ]);\n $fieldset->addField('answer_text', 'editor', [\n 'label' => $helper->__('Answer text'),\n 'name' => 'answer_text',\n ]);\n $fieldset->addField('created_at', 'label', [\n 'label' => $helper->__('Created'),\n 'name' => 'created_at',\n ]);\n $fieldset->addField('with_feedback', 'label', [\n 'label' => $helper->__('With feedback'),\n 'name' => 'with_feedback',\n ]);\n $fieldset->addField('was_notified', 'label', [\n 'label' => $helper->__('Was notified to user'),\n 'name' => 'was_notified',\n ]);\n\n $form->setUseContainer(true);\n\n $form->setValues($model->getData());\n\n return parent::_prepareForm();\n }",
"public function saveForm() {\n\n\t\tparent::saveForm();\n\n\t}",
"public function step_definition() {\n global $DB, $USER;\n $mform = $this->_form;\n $record = $this->workshop->get_record();\n // Summary container.\n $mform->addElement('html', \\html_writer::start_div('wizard-summary'));\n\n // Assessment type.\n if ($record->assessmenttype == \\workshop::PEER_ASSESSMENT) {\n $assessmenttype = get_string('peerassessment', 'udmworkshop');\n } else if ($record->assessmenttype == \\workshop::SELF_ASSESSMENT) {\n $assessmenttype = get_string('selfassessment', 'udmworkshop');\n } else if ($record->assessmenttype == \\workshop::SELF_AND_PEER_ASSESSMENT) {\n $assessmenttype = get_string('selfandpeerassessment', 'udmworkshop');\n }\n $mform->addElement('static', 'summary_assessmenttype', get_string('assessmenttype', 'udmworkshop'), $assessmenttype);\n\n // Grading method.\n $strategieslist = \\workshop::available_strategies_list();\n $gradingmethod = $strategieslist[$record->strategy];\n $mform->addElement('static', 'summary_strategy', get_string('strategy', 'udmworkshop'), $gradingmethod);\n\n // Allow submission.\n if ($record->allowsubmission == 1) {\n $mform->addElement('static',\n 'summary_allowsubmission', get_string('allowsubmission', 'udmworkshop'), get_string('yes'));\n }\n\n // Submission start.\n if ($record->submissionstart != 0) {\n $strdatestring = get_string('strftimerecentfull', 'langconfig');\n $date = userdate($record->submissionstart, $strdatestring);\n $mform->addElement('static', 'summary_submissionstart', get_string('submissionstart', 'udmworkshop'), $date);\n }\n\n // Submissions deadline.\n if ($record->submissionend != 0) {\n $strdatestring = get_string('strftimerecentfull', 'langconfig');\n $date = userdate($record->submissionend, $strdatestring);\n $mform->addElement('static', 'summary_submissionend', get_string('submissionend', 'udmworkshop'), $date);\n }\n\n // Phase switch assessment.\n if ($record->submissionend != 0 && $record->phaseswitchassessment != 0) {\n $mform->addElement('static',\n 'summary_switchassessment', get_string('submissionendswitch', 'udmworkshop'), get_string('yes'));\n }\n\n // Allow assessment after submission.\n if ($record->assessassoonsubmitted != 0) {\n $mform->addElement('static',\n 'summary_assessassoonsubmitted', get_string('assessassoonsubmitted', 'udmworkshop'), get_string('yes'));\n }\n\n // Peer allocation.\n $userplan = new \\workshop_user_plan($this->workshop, $USER->id);\n $phase = \\workshop::PHASE_SUBMISSION;\n if (!isset($userplan->phases[\\workshop::PHASE_SUBMISSION])) {\n $phase = \\workshop::PHASE_SETUP;\n }\n if (isset($userplan->phases[$phase])\n && isset($userplan->phases[$phase]->tasks)\n && isset($userplan->phases[$phase]->tasks['allocate'])) {\n $details = $userplan->phases[$phase]->tasks['allocate']->details;\n $mform->addElement('static', 'summary_peerallocationdetails', get_string('allocate', 'udmworkshop'), $details);\n }\n\n // Anonymity.\n if (!$this->workshop->is_self_assessment_type()) {\n $anonymitysettings = new \\mod_udmworkshop\\anonymity_settings($this->workshop->context);\n // Display appraisees name.\n if (!empty($record->allowsubmission)) {\n $yesno = ($anonymitysettings->display_appraisees_name()) ? get_string('yes') : get_string('no');\n $label = get_string('displayappraiseesname', 'udmworkshop');\n $mform->addElement('static', 'summary_displayappraiseesname', $label, $yesno);\n }\n // Display appraisers name.\n $yesno = ($anonymitysettings->display_appraisers_name()) ? get_string('yes') : get_string('no');\n $label = get_string('displayappraisersname', 'udmworkshop');\n $mform->addElement('static', 'summary_displayappraisersname', $label, $yesno);\n // Assess without submission.\n if ($record->allowsubmission) {\n $yesno = $record->assesswithoutsubmission ? get_string('yes') : get_string('no');\n $mform->addElement('static',\n 'summary_assesswithoutsubmission', get_string('assesswithoutsubmission', 'udmworkshop'), $yesno);\n }\n }\n\n // Assessment start.\n if ($record->assessmentstart != 0) {\n $strdatestring = get_string('strftimerecentfull', 'langconfig');\n $date = userdate($record->assessmentstart, $strdatestring);\n $mform->addElement('static', 'summary_assessmentstart', get_string('assessmentstart', 'udmworkshop'), $date);\n }\n\n // Assessment end.\n if ($record->assessmentend != 0) {\n $strdatestring = get_string('strftimerecentfull', 'langconfig');\n $date = userdate($record->assessmentend, $strdatestring);\n $mform->addElement('static', 'summary_assessmentend', get_string('assessmentend', 'udmworkshop'), $date);\n }\n\n $mform->addElement('html', \\html_writer::end_div());\n\n }",
"function SetFormControl(&$form)\r\n\t{\r\n\t\tglobal $__psp__Form; \r\n\r\n\t\t$GLOBALS[$__psp__Form] =& $form;\t\r\n\t}",
"protected function _prepareForm()\n\t{\n\t\tparent::_prepareForm();\n\t\t\n\t\t$fieldset = $this->getForm()->addFieldset('splash_page_meta', array(\n\t\t\t'legend'=> $this->helper('adminhtml')->__('Meta Data'),\n\t\t\t'class' => 'fieldset-wide',\n\t\t));\n\n\n\t\t$fieldset->addField('page_title', 'text', array(\n\t\t\t'name' => 'page_title',\n\t\t\t'label' => $this->__('Page Title'),\n\t\t\t'title' => $this->__('Page Title'),\n\t\t))->setRenderer(\n\t\t\t$this->getLayout()->createBlock('landingpage/adminhtml_form_field_storechecker')\n\t\t);\n\t\t$fieldset->addField('meta_description', 'editor', array(\n\t\t\t'name' => 'meta_description',\n\t\t\t'label' => $this->__('Description'),\n\t\t\t'title' => $this->__('Description'),\n\t\t\t'style' => 'width:98%; height:110px;',\n\t\t))->setRenderer(\n\t\t\t$this->getLayout()->createBlock('landingpage/adminhtml_form_field_storechecker')\n\t\t);\n\t\t$fieldset->addField('meta_keywords', 'editor', array(\n\t\t\t'name' => 'meta_keywords',\n\t\t\t'label' => $this->__('Keywords'),\n\t\t\t'title' => $this->__('Keywords'),\n\t\t\t'style' => 'width:98%; height:110px;',\n\t\t))->setRenderer(\n\t\t\t$this->getLayout()->createBlock('landingpage/adminhtml_form_field_storechecker')\n\t\t);\n $fieldset->addField('set_index', 'select', array(\n\t\t\t'name' => 'set_index',\n\t\t\t'label' => $this->__('Set Index'),\n\t\t\t'title' => $this->__('Set Index'),\n 'values' => Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray(),\n\t\t))->setRenderer(\n\t\t\t$this->getLayout()->createBlock('landingpage/adminhtml_form_field_storechecker')\n\t\t);\n\t\t$this->getForm()->setValues($this->_getFormData());\n\t\t\n\t\treturn $this;\n\t}",
"protected function _prepareForm()\r\n {\r\n $form = new Varien_Data_Form(array(\r\n 'id' => 'edit_form',\r\n 'action' => $this->getUrl('*/*/save', array('id' => $this->getRequest()->getParam('id'))),\r\n 'method' => 'post',\r\n 'enctype' => 'multipart/form-data'\r\n ));\r\n\r\n $fieldset = $form->addFieldset('contactus_form', array(\r\n 'legend'\t => Mage::helper('dynamic_contactus')->__('Contactus'),\r\n 'class'\t\t=> 'fieldset-wide',\r\n )\r\n );\r\n\r\n $contactus_name = array();\r\n $attributeId = Mage::getResourceModel('eav/entity_attribute')->getIdByCode('catalog_product','contactus');\r\n $attribute = Mage::getModel('catalog/resource_eav_attribute')->load($attributeId);\r\n $attributeOptions = $attribute->getSource()->getAllOptions();\r\n foreach($attributeOptions as $each){\r\n $contactus_name []= array(\r\n \"label\" =>$each[\"label\"],\r\n \"value\" =>$each[\"label\"]\r\n );\r\n }\r\n\r\n $fieldset->addField('name', 'text', array(\r\n 'name' => 'name',\r\n 'label' => Mage::helper('dynamic_contactus')->__('Name'),\r\n 'readonly' => true,\r\n ));\r\n $fieldset->addField('telephone', 'text', array(\r\n 'name' => 'telephone',\r\n 'label' => Mage::helper('dynamic_contactus')->__('Telephone'),\r\n 'readonly' => true,\r\n ));\r\n $fieldset->addField('email', 'text', array(\r\n 'name' => 'email',\r\n 'label' => Mage::helper('dynamic_contactus')->__('Email'),\r\n 'readonly' => true,\r\n ));\r\n $fieldset->addField('referralcode', 'text', array(\r\n 'name' => 'referralcode',\r\n 'label' => Mage::helper('dynamic_contactus')->__('Referral Code'),\r\n 'readonly' => true,\r\n ));\r\n $fieldset->addField('know', 'text', array(\r\n 'name' => 'know',\r\n 'label' => Mage::helper('dynamic_contactus')->__('How did you hear about us?'),\r\n 'readonly' => true,\r\n ));\r\n $fieldset->addField('comment', 'textarea', array(\r\n 'name' => 'comment',\r\n 'label' => Mage::helper('dynamic_contactus')->__('Inquiry'),\r\n 'readonly' => true,\r\n ));\r\n $fieldset->addField('no', 'text', array(\r\n 'name' => 'no',\r\n 'label' => Mage::helper('dynamic_contactus')->__('Anti-Spam* What does 3 plus 5 equal?'),\r\n 'readonly' => true,\r\n ));\r\n\t\t\r\n if (Mage::registry('dynamic_contactus')) {\r\n $form->setValues(Mage::registry('dynamic_contactus')->getData());\r\n }\r\n\r\n $form->setUseContainer(true);\r\n $this->setForm($form);\r\n return parent::_prepareForm();\r\n }",
"protected function _prepareForm()\n {\n $data = $this->_setFactory->create()->load($this->getRequest()->getParam('id'));\n\n /** @var \\Magento\\Framework\\Data\\Form $form */\n $form = $this->_formFactory->create();\n $fieldset = $form->addFieldset('set_name', ['legend' => __('Edit Attribute Set Name')]);\n $fieldset->addField(\n 'attribute_set_name',\n 'label',\n [\n 'label' => __('Name'),\n 'note' => __(\"%1Click here%2 to edit product attribute set\", sprintf('<a href=\"%s\" target=\"_blank\">', $this->getEditAttributeSetUrl()), '</a>'),\n 'name' => 'attribute_set_name',\n 'required' => true,\n 'class' => 'required-entry validate-no-html-tags',\n 'value' => $data->getAttributeSetName()\n ]\n );\n\n if (!$this->getRequest()->getParam('id', false)) {\n $fieldset->addField('gotoEdit', 'hidden', ['name' => 'gotoEdit', 'value' => '1']);\n\n $sets = $this->_setFactory->create()->getResourceCollection()->setEntityTypeFilter(\n $this->_coreRegistry->registry('entityType')\n )->load()->toOptionArray();\n\n $fieldset->addField(\n 'skeleton_set',\n 'select',\n [\n 'label' => __('Based On'),\n 'name' => 'skeleton_set',\n 'required' => true,\n 'class' => 'required-entry',\n 'values' => $sets\n ]\n );\n }\n\n $form->setMethod('post');\n $form->setUseContainer(true);\n $form->setId('set-prop-form');\n $form->setAction($this->getUrl('vendors/*/save'));\n \n $form->setOnsubmit('return false;');\n $this->setForm($form);\n }",
"private function populateForm()\n {\n $this->form->get('version')->setValue($this->continuationDetailData['version']);\n }",
"public function setForm(ViewComponentInterface $form)\n {\n return $this->setComponent($form, static::FORM_ID, static::CONTAINER_ID);\n }",
"function setFormInfo($t) { $this->_formInfo = $t; }",
"protected function _prepareForm()\n {\n $model = Mage::registry('stores');\n $form = new Varien_Data_Form();\n $form->setMethod('post');\n // $form->setUseContainer(true);\n $form->setId('edit_form');\n $form->setAction($this->getUrl('*/*/save'));\n $form->setEnctype('multipart/form-data');\n\n $fieldset = $form->addFieldset('meta_fieldset', [\n 'legend' => $this->__('Meta Information'),\n 'class' => 'fieldset-wide']);\n\n $fieldset->addField('meta_title', 'text', [\n 'name' => 'meta_title',\n 'index' => 'meta_title',\n 'label' => $this->__('Meta Title'),\n 'title' => $this->__('Meta Title')\n ]);\n\n $fieldset->addField('meta_keywords', 'textarea', [\n 'name' => 'meta_keywords',\n 'index' => 'meta_keywords',\n 'label' => $this->__('Meta Keywords'),\n 'title' => $this->__('Meta Keywords')\n ]);\n\n $fieldset->addField('meta_description', 'textarea', [\n 'name' => 'meta_description',\n 'index' => 'meta_description',\n 'label' => $this->__('Meta Description'),\n 'title' => $this->__('Meta Description')\n ]);\n\n\n $form->setValues($model->getData());\n $this->setForm($form);\n\n return parent::_prepareForm();\n }",
"private function initForm()\n {\n /**\n * this way you can show certain values to customers as selected\n */\n $this->fields_value['type_1'] = true;\n $this->fields_value['type_3'] = true;\n\n $this->fields_form = array(\n 'legend' => array(\n 'title' => $this->module->l('Article'),\n 'icon' => 'icon-info-sign',\n ),\n 'input' => array(\n array(\n 'type' => 'text',\n 'label' => $this->module->l('Name'),\n 'name' => 'name',\n 'lang' => true,\n 'required' => true,\n 'col' => '4',\n 'hint' => $this->trans('Your internal name for this attribute.', array(), 'Admin.Catalog.Help') . ' ' . $this->trans('Invalid characters:', array(), 'Admin.Notifications.Info') . ' <>;=#{}',\n ),\n array(\n 'type' => 'textarea',\n 'label' => $this->module->l('Description'),\n 'name' => 'description',\n 'lang' => true,\n 'required' => true,\n 'col' => '4',\n 'hint' => $this->trans('Your internal name for this attribute.', array(), 'Admin.Catalog.Help') . ' ' . $this->trans('Invalid characters:', array(), 'Admin.Notifications.Info') . ' <>;=#{}',\n ),\n array(\n 'type' => 'checkbox',\n 'label' => $this->module->l('Type'),\n 'name' => 'type',\n 'values' => array(\n 'query' => Group::getGroups($this->context->language->id),\n 'id' => 'id_group',\n 'name' => 'name',\n ),\n 'col' => '4',\n 'hint' => $this->trans('Your internal name for this attribute.', array(), 'Admin.Catalog.Help') . ' ' . $this->trans('Invalid characters:', array(), 'Admin.Notifications.Info') . ' <>;=#{}',\n ),\n ),\n 'submit' => array(\n 'title' => $this->trans('Save', array(), 'Admin.Actions'),\n )\n );\n }",
"public function onFormSet(EventInterface $e)\n {\n $type = $e->getParam('type', 'create');\n $service = $this->serviceLocator->get('Rentals\\Service\\Rentals');\n $form = $this->serviceLocator->get('Rentals\\Form\\\\' . ucfirst($type));\n $service->setForm($form, $type);\n }",
"public function createForm()\n {\n $form = $this->Form();\n\n /**\n * @var \\Shopware\\Models\\Config\\Form $parent\n */\n $parent = $this->Forms()->findOneBy(array('name' => 'Interface'));\n $form->setParent($parent);\n\n $form->setElement('text', 'CONVERSION_ID', array(\n 'label' => 'Conversion ID / Tracking ID',\n 'value' => null,\n 'scope' => \\Shopware\\Models\\Config\\Element::SCOPE_SHOP\n ));\n\n $form->setElement('select', 'ARTICLE_FIELD', array(\n 'label' => 'Welche Nummern sollen übertragen werden?',\n 'store' => array(\n array('articleID', 'Interne Artikel-ID (DB: articleID)'),\n array('ordernumber', 'Artikelnummer (DB: ordernumber)'),\n array('ean', 'EAN (DB: ean)')\n ),\n 'required' => true,\n ));\n\n $this->translateForm();\n }",
"public function displayForm()\n\t{\n\t\t// Get default language\n\t\t$default_lang = (int)Configuration::get('PS_LANG_DEFAULT');\n\n\t\t// Init Fields form array\n\t\t$fields_form[0]['form'] = array(\n\t\t\t'legend' => array(\n\t\t\t\t'title' => $this->l('Settings'),\n\t\t\t\t'icon' => 'icon-cogs'\n\t\t\t),\n\t\t\t'input' => array(\n\t\t\t\tarray(\n\t\t\t\t 'type' => 'radio',\n\t\t\t\t 'label' => $this->l('Sandbox Mode'),\n\t\t\t\t 'desc' => $this->l('If enabled no real transactions will be made. Enable for testing mode.'),\n\t\t\t\t 'name' => 'EVERYPAY_SANDBOX_MODE',\n\t\t\t\t 'required' => true,\n\t\t\t\t 'class' => 't',\n\t\t\t\t 'is_bool' => true,\n\t\t\t\t 'values' => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t 'id' => 'sandbox_on',\n\t\t\t\t\t 'value' => 1,\n\t\t\t\t\t 'label' => $this->l('Enabled')\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t 'id' => 'sandbox_off',\n\t\t\t\t\t 'value' => 0,\n\t\t\t\t\t 'label' => $this->l('Disabled')\n\t\t\t\t\t)\n\t\t\t\t )\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'label' => $this->l('Public Key'),\n\t\t\t\t\t'name' => 'EVERYPAY_PUBLIC_KEY',\n\t\t\t\t\t'size' => 20,\n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'empty_message' => $this->l('If you haven\\'t registered, do so now at everypay.gr to get your API keys')\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'label' => $this->l('Secret Key'),\n\t\t\t\t\t'name' => 'EVERYPAY_SECRET_KEY',\n\t\t\t\t\t'size' => 20,\n\t\t\t\t\t'required' => true,\n\t\t\t\t\t'empty_message' => $this->l('If you haven\\'t registered, do so now at everypay.gr to get your API keys')\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'label' => $this->l('Installments'),\n\t\t\t\t\t'name' => 'EVERYPAY_INSTALLMENTS',\n\t\t\t\t\t'size' => 20,\n\t\t\t\t\t'desc' => $this->l('Format: total_min:total_max:max_installments; Eg 45.00:99.99:3;100:299.99:6;')\n\t\t\t\t)\n\t\t\t),\n\t\t\t'submit' => array(\n\t\t\t\t'title' => $this->l('Save'),\n\t\t\t\t'class' => 'btn btn-success pull-right'\n\t\t\t)\n\t\t);\n\n\t\t$helper = new HelperForm();\n\n\t\t// Module, token and currentIndex\n\t\t$helper->module = $this;\n\t\t$helper->name_controller = $this->name;\n\t\t$helper->token = Tools::getAdminTokenLite('AdminModules');\n\t\t$helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name;\n\n\t\t// Language\n\t\t$helper->default_form_language = $default_lang;\n\t\t$helper->allow_employee_form_lang = $default_lang;\n\n\t\t// Title and toolbar\n\t\t$helper->title = $this->displayName;\n\t\t$helper->show_toolbar = true; // false -> remove toolbar\n\t\t$helper->toolbar_scroll = true; // yes - > Toolbar is always visible on the top of the screen.\n\t\t$helper->submit_action = 'submit'.$this->name;\n\t\t$helper->toolbar_btn = array(\n\t\t\t'save' =>\n\t\t\tarray(\n\t\t\t\t'desc' => $this->l('Save'),\n\t\t\t\t'href' => AdminController::$currentIndex.'&configure='.$this->name.'&save'.$this->name.\n\t\t\t\t'&token='.Tools::getAdminTokenLite('AdminModules'),\n\t\t\t),\n\t\t\t'back' => array(\n\t\t\t\t'href' => AdminController::$currentIndex.'&token='.Tools::getAdminTokenLite('AdminModules'),\n\t\t\t\t'desc' => $this->l('Back to list')\n\t\t\t)\n\t\t);\n\n\t\t// Load current value\n\t\t$helper->fields_value['EVERYPAY_SANDBOX_MODE'] = Configuration::get('EVERYPAY_SANDBOX_MODE');\n\t\t$helper->fields_value['EVERYPAY_PUBLIC_KEY'] = Configuration::get('EVERYPAY_PUBLIC_KEY');\n\t\t$helper->fields_value['EVERYPAY_SECRET_KEY'] = Configuration::get('EVERYPAY_SECRET_KEY');\n\t\t$helper->fields_value['EVERYPAY_INSTALLMENTS'] = Configuration::get('EVERYPAY_INSTALLMENTS');\n\n\t\treturn $helper->generateForm($fields_form);\n\t}",
"protected function _prepareForm()\n {\n $model = $this->_coreRegistry->registry('current_amasty_storelocator_location');\n\n $yesno = $this->yesno->toOptionArray();\n\n /** @var \\Magento\\Framework\\Data\\Form $form */\n $form = $this->_formFactory->create();\n $form->setHtmlIdPrefix('location_');\n\n $ObjectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n\n $fieldset = $form->addFieldset('base_fieldset', ['legend' => __('General')]);\n if ($model->getId()) {\n $fieldset->addField('id', 'hidden', ['name' => 'id']);\n }\n\n $fieldset->addField(\n 'name',\n 'text',\n [\n 'label' => __('Location name'),\n 'required' => true,\n 'name' => 'name',\n ]\n );\n\n\n if (!$this->_storeManager->isSingleStoreMode()) {\n $fieldset->addField(\n 'stores',\n 'multiselect',\n [\n 'name' => 'stores[]',\n 'label' => __('Store View'),\n 'title' => __('Store View'),\n 'required' => true,\n 'values' => $this->_store->getStoreValuesForForm(false, true)\n ]\n );\n } else {\n $fieldset->addField(\n 'store_id',\n 'hidden',\n [\n 'name' => 'store_id[]',\n 'value' => $this->_storeManager->getStore(true)->getId()\n ]\n );\n }\n\n $fieldset->addField(\n 'country',\n 'select',\n [\n 'name' => 'country',\n 'required' => true,\n 'class' => 'countries',\n 'label' => 'Country',\n 'values' => $ObjectManager->get('Magento\\Config\\Model\\Config\\Source\\Locale\\Country')->toOptionArray(),\n ]\n );\n\n $fieldset->addField(\n 'state_id',\n 'select',\n [\n 'name' => 'state_id',\n 'label' => 'State/Province',\n ]\n );\n\n $fieldset->addField(\n 'state',\n 'text',\n [\n 'name' => 'state',\n 'label' => 'State/Province',\n\n ]\n );\n\n $fieldset->addField(\n 'city',\n 'text',\n [\n 'label' => __('City'),\n 'required' => true,\n 'name' => 'city',\n ]\n );\n\n $fieldset->addField(\n 'description',\n 'editor',\n [\n 'label' => __('Description'),\n 'config' => $this->_wysiwygConfig->getConfig(),\n 'name' => 'description',\n ]\n );\n\n $fieldset->addField(\n 'zip',\n 'text',\n [\n 'label' => __('Zip'),\n 'required' => true,\n 'name' => 'zip',\n ]\n );\n\n $fieldset->addField(\n 'address',\n 'text',\n [\n 'label' => __('Address'),\n 'required' => true,\n 'name' => 'address',\n ]\n );\n\n $fieldset->addField(\n 'contact_area',\n 'text',\n [\n 'label' => __('Contact Area'),\n 'name' => 'contact_area',\n ]\n );\n\n $fieldset->addField(\n 'contact',\n 'text',\n [\n 'label' => __('Contact 1'),\n 'name' => 'contact',\n ]\n );\n\n $fieldset->addField(\n 'contact_district',\n 'text',\n [\n 'label' => __('Contact 1 District'),\n 'name' => 'contact_district',\n ]\n );\n\n $fieldset->addField(\n 'phone',\n 'text',\n [\n 'label' => __('Contact Phone 1'),\n 'name' => 'phone',\n ]\n );\n\n $fieldset->addField(\n 'email',\n 'text',\n [\n 'label' => __('Contact Email 1'),\n 'name' => 'email',\n ]\n );\n\n $fieldset->addField(\n 'contact_two',\n 'text',\n [\n 'label' => __('Contact 2'),\n 'name' => 'contact_two',\n ]\n );\n\n $fieldset->addField(\n 'contact_district_two',\n 'text',\n [\n 'label' => __('Contact 2 District'),\n 'name' => 'contact_district_two',\n ]\n );\n\n $fieldset->addField(\n 'contact_phone_two',\n 'text',\n [\n 'label' => __('Contact Phone 2'),\n 'name' => 'contact_phone_two',\n ]\n );\n\n $fieldset->addField(\n 'contact_email_two',\n 'text',\n [\n 'label' => __('Contact Email 2'),\n 'name' => 'contact_email_two',\n ]\n );\n\n $fieldset->addField(\n 'toll_free_phone',\n 'text',\n [\n 'label' => __('Toll-Free Phone'),\n 'name' => 'toll_free_phone',\n ]\n );\n\n $fieldset->addField(\n 'office_phone',\n 'text',\n [\n 'label' => __('Office Phone'),\n 'name' => 'office_phone',\n ]\n );\n\n $fieldset->addField(\n 'fax',\n 'text',\n [\n 'label' => __('Fax'),\n 'name' => 'fax',\n ]\n );\n\n $fieldset->addField(\n 'website',\n 'text',\n [\n 'label' => __('Distributor Website'),\n 'name' => 'website',\n ]\n );\n\n// $fieldset->addField(\n// 'sales_zip_code',\n// 'text',\n// [\n// 'label' => __('Sales Zip Codes'),\n// 'name' => 'sales_zip_code',\n// ]\n// );\n\n $fieldset->addField(\n 'status',\n 'select',\n [\n 'label' => __('Status'),\n 'required' => true,\n 'name' => 'status',\n 'values' => ['1' => 'Enabled', '0' => 'Disabled'],\n ]\n );\n\n $fieldset->addField(\n 'show_schedule',\n 'select',\n [\n 'label' => __('Show Schedule'),\n 'required' => false,\n 'name' => 'show_schedule',\n 'values' => $yesno,\n ]\n );\n\n $fieldset->addField(\n 'position',\n 'text',\n [\n 'class' => 'validate-number',\n 'label' => __('Position'),\n 'required' => false,\n 'name' => 'position',\n ]\n );\n\n $form->setValues($model->getData());\n $form->addValues(['id' => $model->getId()]);\n $this->setForm($form);\n //return parent::_prepareForm();\n }",
"private function setFormValues(OpportunityForm $form, Opportunity $opportunity) {\n\t\t/* @var $ofs OpportunityFieldset */\n\t\t\n\t\t$form->get(OpportunityForm::SUBMIT)->setValue('Save');\n\t\t$form->get(OpportunityForm::SUBMITCLOSE)->setValue('Save and Close');\n\t\t$ofs = $form->get(OpportunityFieldset::FIELDSETNAME);\n\t\t\n\t\t// Set One-to-Many values\n\t\tif($opportunity->getAccount() != null) {\n\t\t\t$ofs->get(OpportunityFieldset::ACCOUNT)->setValue($opportunity->getAccount()->getId());\n\t\t}\n\t\tif($opportunity->getContact() != null) {\n\t\t\t$ofs->get(OpportunityFieldset::CONTACT)->setValue($opportunity->getContact()->getId());\n\t\t}\n\t\tif($opportunity->getOriginatingLead() != null) {\n\t\t\t$ofs->get(OpportunityFieldset::ORIGINATINGLEAD)->setValue($opportunity->getOriginatingLead()->getId());\n\t\t}\n\t\tif($opportunity->getOwner() != null) {\n\t\t\t$ofs->get(OpportunityFieldset::OWNER)->setValue($opportunity->getOwner()->getId());\n\t\t}\n\t\tif($opportunity->getBusinessUnit() != null) {\n\t\t\t$ofs->get(OpportunityFieldset::BUSINESSUNIT)->setValue($opportunity->getBusinessUnit()->getId());\n\t\t}\n\t\t\n\t\t// Set boolean values\n\t\t$ofs->get(OpportunityFieldset::DECISIONMAKER)->setValue($opportunity->getDecisionMaker() ? 'true' : 'false');\n\t\t$ofs->get(OpportunityFieldset::DEVELOPPROPOSAL)->setValue($opportunity->getDevelopProposal() ? 'true' : 'false');\n\t\t$ofs->get(OpportunityFieldset::EVALUATEFIT)->setValue($opportunity->getEvaluateFit() ? 'true' : 'false');\n\t\t$ofs->get(OpportunityFieldset::PRESENTPROPOSAL)->setValue($opportunity->getPresentProposal() ? 'true' : 'false');\n\t\t$ofs->get(OpportunityFieldset::PURSUITDECISION)->setValue($opportunity->getPursuitDecision() ? 'true' : 'false');\n\t\t$ofs->get(OpportunityFieldset::SENDTHANKYOU)->setValue($opportunity->getSendThankYou() ? 'true' : 'false');\n\n\t\t// Set dates in proper format\n\t\t$ofs->get(OpportunityFieldset::ESTIMATEDCLOSEDATE)->setValue($opportunity->getFormattedEstimatedCloseDate());\n\t\t$ofs->get(OpportunityFieldset::ACTUALCLOSEDATE)->setValue($opportunity->getFormattedActualCloseDate());\n\t\t$ofs->get(OpportunityFieldset::FINALDECISIONDATE)->setValue($opportunity->getFormattedFinalDecisionDate());\n\t\t$ofs->get(OpportunityFieldset::SCHEDULEFOLLOWUPPROSPECT)->setValue($opportunity->getFormattedScheduleFollowupProspect());\n\t\t$ofs->get(OpportunityFieldset::SCHEDULEFOLLOWUPQUALIFY)->setValue($opportunity->getFormattedScheduleFollowupQualify());\n\t\t$ofs->get(OpportunityFieldset::SCHEDULEPROPOSALMEETING)->setValue($opportunity->getFormattedScheduleProposalMeeting());\n\t}",
"function weekly_and_pre_job_meeting_form($form, &$form_state) {\n\n $form['main_container'] = array(\n '#type' => 'fieldset',\n '#title' => t('Weekly and Pre-Job Meeting Form'),\n );\n\n $form['main_container']['type_cont'] = array(\n '#type' => 'fieldset',\n '#title' => t('Type of Form'),\n '#id' => 'meeting-type',\n );\n\n\n $form['main_container']['type_cont']['form_type'] = array(\n '#type' => 'radios',\n '#options' => array(\n 'WEEKLY' => 'WEEKLY',\n 'JSA REVIEW' => 'JSA REVIEW',\n 'PRE-JOB' => 'PRE-JOB',\n 'HAZARD ASSESSMENT' => 'HAZARD ASSESSMENT',\n ),\n '#required' => TRUE,\n );\n\n $form['main_container']['rig'] = array(\n '#type' => 'textfield',\n '#title' => t('Rig'),\n '#default_value' => '',\n '#required' => TRUE,\n '#prefix' => '<div class=\"rig\">',\n '#suffix' => '</div>',\n );\n\n $form['main_container']['date'] = array(\n '#type' => 'textfield',\n '#title' => t('Date'),\n '#default_value' => date('M d, Y'),\n '#disabled' => TRUE,\n '#prefix' => '<div class=\"date\">',\n '#suffix' => '</div>',\n );\n\n\n $form['main_container']['location'] = array(\n '#type' => 'textfield',\n '#title' => t('Location'),\n '#default_value' => '',\n '#required' => TRUE,\n '#prefix' => '<div class=\"location\">',\n '#suffix' => '</div>',\n );\n\n $form['main_container']['recorded_by'] = array(\n '#type' => 'textfield',\n '#title' => t('Recorded By'),\n '#default_value' => '',\n '#required' => TRUE,\n '#prefix' => '<div class=\"recorded-by\">',\n '#suffix' => '</div>',\n );\n\n $form['main_container']['attend_cont'] = array(\n '#type' => 'fieldset',\n '#tree' => TRUE,\n '#title' => t('Attendance (Name, Position, Company)'),\n// '#attributes' => array('class', array('attend-cont')),\n '#id' => 'ajax-name-container',\n '#prefix' => '<div class=\"attend-cont\">',\n '#suffix' => '</div>',\n );\n\n // $form_state['repairs_req'] to determine the number of textfields to build.\n if (empty($form_state['counter'])) {\n $form_state['counter'] = 1;\n }\n\n for ($i = 0; $i < $form_state['counter']; $i++) {\n\n $form['main_container']['attend_cont'][$i]['name'][$i] = array(\n '#type' => 'textfield',\n '#title' => t('Name ' . ($i + 1)),\n '#default_value' => '',\n '#required' => TRUE,\n// '#id' => 'attendance_' . $i,\n '#prefix' => '<div class=\"attend-name\">',\n '#suffix' => '</div>',\n );\n\n $form['main_container']['attend_cont'][$i]['position'][$i] = array(\n '#type' => 'textfield',\n '#title' => t('Position ' . ($i + 1)),\n '#default_value' => '',\n '#required' => TRUE,\n// '#id' => 'position_' . $i,\n '#prefix' => '<div class=\"attend-position\">',\n '#suffix' => '</div>',\n );\n\n $form['main_container']['attend_cont'][$i]['company'][$i] = array(\n '#type' => 'textfield',\n '#title' => t('Company ' . ($i + 1)),\n '#default_value' => '',\n// '#id' => 'company_' . $i,\n '#required' => TRUE,\n '#prefix' => '<div class=\"attend-company\">',\n '#suffix' => '</div>',\n );\n }\n\n // Submit button to add more repairs text fields\n $form['main_container']['attend_cont']['add_name'] = array(\n '#type' => 'submit',\n '#value' => 'Add Name',\n '#submit' => array('jsa_forms_add_name_textfield'),\n '#ajax' => array(\n 'callback' => 'ajax_weekly_callback',\n 'wrapper' => 'ajax-name-container',\n 'method' => 'replace',\n 'effect' => 'fade',\n ),\n '#prefix' => '<div class=\"add\">',\n '#suffix' => '</div>',\n );\n // Submit button to remove repairs text fields\n $form['main_container']['attend_cont']['remove_name'] = array(\n '#type' => 'submit',\n '#value' => 'Remove Name',\n '#submit' => array('jsa_forms_remove_name_textfield'),\n '#ajax' => array(\n 'callback' => 'ajax_weekly_callback',\n 'wrapper' => 'ajax-name-container',\n 'method' => 'replace',\n 'effect' => 'fade',\n ),\n '#prefix' => '<div class=\"remove\">',\n '#suffix' => '</div>',\n );\n\n $form['main_container']['general_safety_topics'] = array(\n '#type' => 'textarea',\n '#title' => t('General Safety Topics Discussed'),\n '#default_value' => '',\n '#required' => TRUE,\n '#prefix' => '<div class=\"general-safety-topics\">',\n '#suffix' => '</div>',\n );\n\n $form['main_container']['pre_job_meeting'] = array(\n '#type' => 'textarea',\n '#title' => t('Pre-Job Meeting'),\n '#default_value' => '',\n '#required' => TRUE,\n '#prefix' => '<div class=\"pre-job-meeting\">',\n '#suffix' => '</div>',\n );\n\n $form['main_container']['jsa_procedure_review'] = array(\n '#type' => 'textarea',\n '#title' => t('JSA/Procedure Review'),\n '#default_value' => '',\n '#required' => TRUE,\n '#prefix' => '<div class=\"jsa-procedure-review\">',\n '#suffix' => '</div>',\n );\n\n $form['main_container']['hazard_cont'] = array(\n '#type' => 'fieldset',\n '#title' => t('Hazard Assessment'),\n '#id' => 'hazard-access',\n );\n\n\n $form['main_container']['hazard_cont']['hazard_assess'] = array(\n '#type' => 'checkboxes',\n '#title' => t('Hazard Assessment'),\n '#title_display' => 'invisible',\n '#options' => array(\n 'unlevel_lease' => 'UNLEVEL LEASE',\n 'rig_move' => 'RIG MOVE (Traffic, congestion)',\n 'weather' => 'WEATHER',\n 'overhead_work' => 'OVERHEAD WORK',\n 'riggin_ropes_slings' => 'RIGGIN / ROPES / SLINGS',\n 'slips_trips_falls' => 'SLIPS / TRIPS / FALLS',\n 'confined_space' => 'CONFINED SPACE',\n 'electrical_hazards' => 'ELECTRICAL HAZARDS',\n 'housekeeping' => 'HOUSEKEEPING',\n 'pinch_points' => 'PINCH POINTS',\n 'welding' => 'WELDING',\n 'cement' => 'CEMENT',\n 'equipment_service' => 'EQUIPMENT SERVICE',\n 'whmis_products' => 'WHMIS PRODUCTS',\n 'h2s' => 'H2S',\n 'grinders_hand_tools' => 'GRINDERS & HAND TOOLS',\n 'lifting_carrying' => 'LIFTING & CARRYING',\n 'noise' => 'NOISE',\n 'party_3rd_equip' => '3RD PARTY EQUIPMENT',\n 'washgun' => 'WASHGUN',\n 'pressure_hazards' => 'PRESSURE HAZARDS',\n 'rotating_equip' => 'ROTATING EQUIPMENT',\n 'invert' => 'INVERT',\n 'working_heights' => 'WORKING AT HEIGHTS',\n ),\n '#required' => TRUE,\n// '#prefix' => '<div class=\"hazard-access\">',\n// '#suffix' => '</div>',\n );\n\n $form['main_container']['hazard_discuss'] = array(\n '#type' => 'textarea',\n '#title' => t('Hazard Discussed (task, control, etc.)'),\n '#default_value' => '',\n '#required' => TRUE,\n '#prefix' => '<div class=\"hazard-discuss\">',\n '#suffix' => '</div>',\n );\n\n\n $form['main_container']['submit'] = array(\n '#type' => 'submit',\n '#value' => 'Submit Weekly and Pre-Job Meeting Form',\n '#executes_submit_callback' => TRUE,\n '#prefix' => '<div class=\"submit-button\">',\n '#suffix' => '</div>',\n );\n\n return $form;\n}",
"function _prepareForm() {\n\t\t\t$product = $this->getProduct( );\n\t\t\t$helper = $this->getWarehouseHelper( );\n\t\t\t$form = new Varien_Data_Form( );\n\t\t\t$form->setHtmlIdPrefix( 'product_' );\n\t\t\t$form->setFieldNameSuffix( 'product' );\n\t\t\t$fieldset = $form->addFieldset( 'priority', array( 'legend' => $helper->__( 'Priority' ) ) );\n\t\t\t$stockPrioritiesElement = $fieldset->addField( 'stock_priorities', 'text', array( 'name' => 'stock_priorities', 'label' => $helper->__( 'Warehouse Priority' ), 'title' => $helper->__( 'Warehouse Priority' ), 'required' => false, 'value' => $product->getStockPriorities( ) ) );\n\t\t\t$stockPrioritiesElement->setRenderer( $this->getLayout( )->createBlock( 'warehouse/adminhtml_catalog_product_edit_tab_stock_priority_renderer' ) );\n\t\t\t$this->setForm( $form );\n\t\t\treturn parent::_prepareForm( );\n\t\t}",
"public function displayForm() {\n $form = [\n 'form' => [\n 'legend' => [\n 'title' => $this->l('Settings'),\n ],\n 'input' => [\n [\n 'type' => 'text',\n 'label' => $this->l('Picksell Pay Merchant ID'),\n 'name' => 'PRESTASHOP_PICKSELL_PAY_MERCHANT_ID',\n 'size' => 20,\n 'required' => true,\n ],\n [\n 'type' => 'text',\n 'label' => $this->l('Picksell Pay API key'),\n 'name' => 'PRESTASHOP_PICKSELL_PAY_API_KEY',\n 'size' => 20,\n 'required' => true,\n ],\n [\n 'type' => 'text',\n 'label' => $this->l('Picksell Pay API secret'),\n 'name' => 'PRESTASHOP_PICKSELL_PAY_API_SECRET',\n 'size' => 20,\n 'required' => true,\n ],\n [\n 'type' => 'text',\n 'label' => $this->l('Picksell Pay Webhook URL'),\n 'name' => 'PRESTASHOP_PICKSELL_PAY_WEBHOOK_URL',\n 'size' => 20,\n 'disabled' => true,\n 'desc' => 'Use this link in Picksell Pay API key\\'s Webhook URL'\n ],\n [\n 'type' => 'switch',\n 'label' => $this->l('Dev mode'),\n 'desc' => 'Use this only for testing or development',\n 'name' => 'PRESTASHOP_PICKSELL_PAY_DEV_MODE',\n 'required' => true,\n 'values' => [[\n 'id' => 'active_on',\n 'value' => 1,\n 'label' => $this->l('Yes')], [\n 'id' => 'active_off',\n 'value' => 0,\n 'label' => $this->l('No')]]\n ],\n ],\n 'submit' => [\n 'title' => $this->l('Save'),\n 'class' => 'btn btn-default pull-right',\n ],\n ],\n ];\n\n $helper = new HelperForm();\n\n // Module, token and currentIndex\n $helper->table = $this->table;\n $helper->name_controller = $this->name;\n $helper->token = Tools::getAdminTokenLite('AdminModules');\n $helper->currentIndex = AdminController::$currentIndex . '&' . http_build_query(['configure' => $this->name]);\n $helper->submit_action = 'submit' . $this->name;\n\n // Default language\n $helper->default_form_language = (int) Configuration::get('PS_LANG_DEFAULT');\n\n // Load current value into the form\n $helper->fields_value['PRESTASHOP_PICKSELL_PAY_MERCHANT_ID'] = Tools::getValue('PRESTASHOP_PICKSELL_PAY_MERCHANT_ID', Configuration::get('PRESTASHOP_PICKSELL_PAY_MERCHANT_ID'));\n $helper->fields_value['PRESTASHOP_PICKSELL_PAY_API_KEY'] = Tools::getValue('PRESTASHOP_PICKSELL_PAY_API_KEY', Configuration::get('PRESTASHOP_PICKSELL_PAY_API_KEY'));\n $helper->fields_value['PRESTASHOP_PICKSELL_PAY_API_SECRET'] = Tools::getValue('PRESTASHOP_PICKSELL_PAY_API_SECRET', Configuration::get('PRESTASHOP_PICKSELL_PAY_API_SECRET'));\n $helper->fields_value['PRESTASHOP_PICKSELL_PAY_DEV_MODE'] = Tools::getValue('PRESTASHOP_PICKSELL_PAY_DEV_MODE', Configuration::get('PRESTASHOP_PICKSELL_PAY_DEV_MODE'));\n $helper->fields_value['PRESTASHOP_PICKSELL_PAY_WEBHOOK_URL'] = $this->context->link->getModuleLink($this->name, 'webhook', array(), true);\n\n return $helper->generateForm([$form]);\n }",
"protected function setFormMode() {\n // Retrieve the form display before it is overwritten in the parent.\n $bundle = $this->getBundleEntity()->id();\n\n // Set as variables, since the bundle might be different.\n $this->postViewDefault = 'post.' . $bundle . '.default';\n $this->postViewProfile = 'post.' . $bundle . '.profile';\n $this->postViewGroup = 'post.' . $bundle . '.group';\n }",
"protected function _prepareForm()\n {\n /** @var \\Magento\\Framework\\Data\\Form $form */\n $form = $this->_formFactory->create();\n $fieldset = $form->addFieldset('product_template_selecte', []);\n $fieldset->addField(\n 'current-affected-attribute-set',\n 'radio',\n [\n 'after_element_html' => __(\n 'Add configurable attributes to the current Attribute Set (\"%1\")',\n sprintf('<span data-role=\"name-container\">%s</span>', $this->getCurrentAttributeSetName())\n ),\n 'name' => 'affected-attribute-set',\n 'class' => 'admin__control-radio',\n 'css_class' => 'admin__field-option',\n 'checked' => true,\n 'value' => 'current'\n ]\n );\n $fieldset->addField(\n 'new-affected-attribute-set',\n 'radio',\n [\n 'after_element_html' => __('Add configurable attributes to the new Attribute Set based on current'),\n 'name' => 'affected-attribute-set',\n 'class' => 'admin__control-radio',\n 'css_class' => 'admin__field-option',\n 'value' => 'new'\n ]\n );\n $fieldset->addField(\n 'new-attribute-set-name',\n 'text',\n [\n 'label' => __('New attribute set name'),\n 'name' => 'new-attribute-set-name',\n 'required' => true,\n 'css_class' => 'no-display',\n 'field_extra_attributes' => 'data-role=\"affected-attribute-set-new-name-container\"',\n 'value' => ''\n ]\n );\n $fieldset->addField(\n 'existing-affected-attribute-set',\n 'radio',\n [\n 'after_element_html' => __('Add configurable attributes to the existing Attribute Set'),\n 'name' => 'affected-attribute-set',\n 'required' => true,\n 'class' => 'admin__control-radio no-display',\n 'css_class' => 'admin__field-option',\n 'value' => 'existing'\n ]\n );\n $fieldset->addField(\n 'choose-affected-attribute-set',\n 'select',\n [\n 'label' => __('Choose existing Attribute Set'),\n 'name' => 'attribute-set-name',\n 'required' => true,\n 'css_class' => 'no-display',\n 'field_extra_attributes' => 'data-role=\"affected-attribute-set-existing-name-container\"',\n 'values' => $this->attributeSetOptions->toOptionArray()\n ]\n );\n\n $form->setUseContainer(true);\n $this->setForm($form);\n }",
"function _setupForm(){\r\n\r\n //Defines the call back function for HTML Quickform to use when validating the form.\r\n $this->form->addFormRule(array(&$this,'XINValidate'));\r\n\r\n // display test name\r\n $this->form->addElement('header', 'npef_c', \"Neuropsychometric Evaluations Form\");\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n\r\n\r\n // automatically adds examiner & date of administration\r\n $this->_addMetadataFields();\r\n\r\n $yes_no_option= array(NULL=>\"\", \"yes\"=>\"Yes\", \"no\"=>\"No\", \"not_answered\"=>\"Not Answered\");\r\n $ecas_version_option = array(NULL=>\"\",\"v_one\"=>\"1\",\"v_two\"=>\"2\",\"v_three\"=>\"3\");\r\n $hvltr_version_option = array(NULL=>\"\",\"v_one\"=>\"1\",\"v_two\"=>\"2\");\r\n \t$general_spoken_written_option= array(NULL=>\"\", \"spoken\"=>\"Spoken\",\"written\"=>\"Written\");\r\n $victoria_test_option= array(NULL=>\"\", \"spoken\"=>\"Spoken\",\"color\"=>\"Colour Box Pointing\");\r\n $done_option=array(NULL=>\"\", \"done\"=>\"Done\",\"not_done\"=>\"Not Done\");\r\n $semnatic_fluency_option = array(NULL=>\"\",\"animal\"=>\"Animal\",\"fruit\"=>\"Fruit\",\"vegetable\"=>\"Vegetable\");\r\n $jlo_version_option = array(NULL=>\"\",\"v_one\"=>\"V\",\"v_two\"=>\"H\");\r\n $bnt_version_option=array(NULL=>\"\",\"short\"=>\"Short form\",\"long\"=>\"Standard (long) form\");\r\n\r\n // Breaks for formatting\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n \t\r\n // ECAS \r\n $this->form->addElement('static', null, '<font size=4>Edinburgh Cognitive and Behavioral ALS Screen (ECAS)</font>');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('select', 'ecas_done',$this->indent . $this->indent . 'Has the ECAS been done?', $done_option);\r\n\r\n // ECAS Done/Not Done Rules\r\n $this->XINRegisterRule(\"ecas_date\", array(\"ecas_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"ecas_type\", array(\"ecas_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"ecas_version\", array(\"ecas_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"language_naming\", array(\"ecas_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"language_comprehension\", array(\"ecas_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"language_spelling\", array(\"ecas_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"verbal_s\", array(\"ecas_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"verbal_t\", array(\"ecas_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"executive_reverse\", array(\"ecas_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"executive_alternation\", array(\"ecas_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"executive_social\", array(\"ecas_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"executive_sentence\", array(\"ecas_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"memory_immediate\", array(\"ecas_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"memory_delayed_retention\", array(\"ecas_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"memory_delayed_recognition\", array(\"ecas_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"visuospatial_dot\", array(\"ecas_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"visuospatial_cube\", array(\"ecas_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"visuospatial_number\", array(\"ecas_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"ecas_total_language\", array(\"ecas_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"ecas_total_verbal\", array(\"ecas_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"speech_date\", array(\"ecas_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"ecas_total_executive\", array(\"ecas_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"ecas_total_memory\", array(\"ecas_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"ecas_total_visuospatial\", array(\"ecas_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"ecas_total_final\", array(\"ecas_done{@}=={@}done\"), \"Required.\");\r\n\r\n\r\n\r\n\r\n // ECAS Questions\r\n $this->form->addElement('date', 'ecas_date', $this->indent . $this->indent . 'Date of ECAS:');\r\n $this->form->addElement('select', 'ecas_type',$this->indent . $this->indent . 'Type of test:', $general_spoken_written_option);\r\n\r\n $this->form->addElement('select', 'ecas_version',$this->indent . $this->indent . 'Test Version:', $ecas_version_option);\r\n\r\n $this->form->addElement('static', null, $this->indent . 'Language');\r\n\r\n $this->form->addElement('text', 'language_naming', $this->indent . $this->indent . $this->indent . $this->indent . 'Naming:');\r\n $this->form->addRule('language_naming','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'language_comprehension', $this->indent . $this->indent . $this->indent . $this->indent . 'Comprehension:');\r\n $this->form->addRule('language_comprehension','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'language_spelling', $this->indent . $this->indent . $this->indent . $this->indent . 'Spelling:');\r\n $this->form->addRule('language_spelling','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('static', null, $this->indent . 'Verbal Fluency');\r\n\r\n $this->form->addElement('text', 'verbal_s', $this->indent . $this->indent . $this->indent . $this->indent . 'First Letter (S/F/P):');\r\n $this->form->addRule('verbal_s','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'verbal_t', $this->indent . $this->indent . $this->indent . $this->indent . 'Second Letter (T/D/M):');\r\n $this->form->addRule('verbal_t','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('static', null, $this->indent . 'Executive');\r\n\r\n $this->form->addElement('text', 'executive_reverse', $this->indent . $this->indent . $this->indent . $this->indent . 'Reverse digit span:');\r\n $this->form->addRule('executive_reverse','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'executive_alternation', $this->indent . $this->indent . $this->indent . $this->indent . 'Alternation:');\r\n $this->form->addRule('executive_alternation','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'executive_sentence', $this->indent . $this->indent . $this->indent . $this->indent . 'Sentence Completion:');\r\n $this->form->addRule('executive_sentence','Numerical value required.', 'numeric');\r\n \r\n $this->form->addElement('text', 'executive_social', $this->indent . $this->indent . $this->indent . $this->indent . 'Social Cognitiion:');\r\n $this->form->addRule('executive_social','Numerical value required.', 'numeric');\r\n\r\n \r\n\r\n $this->form->addElement('static', null, $this->indent . 'Memory');\r\n\r\n $this->form->addElement('text', 'memory_immediate', $this->indent . $this->indent . $this->indent . $this->indent . 'Immediate recall:');\r\n $this->form->addRule('memory_immediate','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'memory_delayed_retention', $this->indent . $this->indent . $this->indent . $this->indent . 'Delayed retention:');\r\n $this->form->addRule('memory_delayed_retention','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'memory_delayed_recognition', $this->indent . $this->indent . $this->indent . $this->indent . 'Delayed recognition:');\r\n $this->form->addRule('memory_delayed_recognition','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('static', null, $this->indent . 'Visuospatial');\r\n\r\n $this->form->addElement('text', 'visuospatial_dot', $this->indent . $this->indent . $this->indent . $this->indent . 'Dot Counting:');\r\n $this->form->addRule('visuospatial_dot','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'visuospatial_cube', $this->indent . $this->indent . $this->indent . $this->indent . 'Cube Counting:');\r\n $this->form->addRule('visuospatial_cube','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'visuospatial_number', $this->indent . $this->indent . $this->indent . $this->indent . 'Number Location:');\r\n $this->form->addRule('visuospatial_number','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('static', null, $this->indent . 'Domain Totals');\r\n\r\n $this->form->addElement('text', 'ecas_total_language', $this->indent . $this->indent . $this->indent . $this->indent . 'Language:');\r\n $this->form->addRule('ecas_total_language','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'ecas_total_verbal', $this->indent . $this->indent . $this->indent . $this->indent . 'Verbal Fluency:');\r\n $this->form->addRule('ecas_total_verbal','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'ecas_total_executive', $this->indent . $this->indent . $this->indent . $this->indent . 'Executive:');\r\n $this->form->addRule('ecas_total_executive','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'ecas_total_memory', $this->indent . $this->indent . $this->indent . $this->indent . 'Memory:');\r\n $this->form->addRule('ecas_total_memory','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'ecas_total_visuospatial', $this->indent . $this->indent . $this->indent . $this->indent . 'Visuospatial:');\r\n $this->form->addRule('ecas_total_visuospatial','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'ecas_total_final', $this->indent . $this->indent . 'ECAS Total score');\r\n $this->form->addRule('ecas_total_final','Numerical value required.', 'numeric');\r\n\r\n\r\n\r\n // Breaks for formatting\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n \r\n // Semantic Fluency + Abrahams Correction \r\n $this->form->addElement('static', null, '<font size=4>Semantic Fluency + Abrahams Correction</font>');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('select', 'semantic_done',$this->indent . $this->indent . 'Has the Semantic Fluency + Abrahams Correction been done?', $done_option);\r\n\r\n // Semantic Fluency + Abrahams Correction Done/Not Done Rules\r\n $this->XINRegisterRule(\"semantic_date\", array(\"semantic_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"semantic_type\", array(\"semantic_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"semantic_fluency\", array(\"semantic_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"semantic_number\", array(\"semantic_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"semantic_time\", array(\"semantic_done{@}=={@}done\"), \"Required.\");\r\n\r\n\r\n // Semantic Fluency + Abarahams Correction Questions\r\n $this->form->addElement('date', 'semantic_date', $this->indent . $this->indent . 'Date of test:');\r\n $this->form->addElement('select', 'semantic_type',$this->indent . $this->indent . 'Type of test:', $general_spoken_written_option);\r\n $this->form->addElement('select', 'semantic_fluency',$this->indent . $this->indent . 'Type of test:', $semnatic_fluency_option);\r\n\r\n $this->form->addElement('text', 'semantic_number', $this->indent . $this->indent . 'Number of correct words:');\r\n $this->form->addRule('semantic_number','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'semantic_time', $this->indent . $this->indent . 'Time to read aloud/copy(s):');\r\n $this->form->addRule('semantic_time','Numerical value required.', 'numeric');\r\n\r\n\r\n\r\n // Breaks for formatting\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n \r\n // Digit Span\r\n $this->form->addElement('static', null, '<font size=4>Digit Span</font>');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('select', 'digit_done',$this->indent . $this->indent . 'Has the Digit Span test been done?', $done_option);\r\n\r\n // Digit Span Done/Not Done Rules\r\n $this->XINRegisterRule(\"digit_date\", array(\"digit_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"digit_type\", array(\"digit_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"digit_forward\", array(\"digit_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"digit_dot_score\", array(\"digit_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"digit_dot_maximal\", array(\"digit_done{@}=={@}done\"), \"Required.\");\r\n\r\n // Digit Span Questions\r\n $this->form->addElement('date', 'digit_date', $this->indent . $this->indent . 'Date of Digit Span test:');\r\n $this->form->addElement('select', 'digit_type',$this->indent . $this->indent . 'Type of test:', $general_spoken_written_option);\r\n \r\n $this->form->addElement('text', 'digit_forward', $this->indent . $this->indent . 'Forward score:');\r\n $this->form->addRule('digit_forward','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'digit_dot_score', $this->indent . $this->indent . 'DOT score:');\r\n $this->form->addRule('digit_dot_score','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'digit_dot_maximal', $this->indent . $this->indent . 'DOT maximal span:');\r\n $this->form->addRule('digit_dot_maximal','Numerical value required.', 'numeric');\r\n\r\n\r\n // Breaks for formatting\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n \r\n // BNT\r\n $this->form->addElement('static', null, '<font size=4>Boston Naming Test - II (BNT)</font>');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('select', 'bnt_done',$this->indent . $this->indent . 'Has the Digit Span test been done?', $done_option);\r\n\r\n // BNT Done/Not Done Rules\r\n $this->XINRegisterRule(\"bnt_date\", array(\"bnt_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"bnt_type\", array(\"bnt_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"bnt_version\", array(\"bnt_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"bnt_total\", array(\"bnt_done{@}=={@}done\"), \"Required.\");\r\n\r\n\r\n // BNT Questions\r\n $this->form->addElement('date', 'bnt_date', $this->indent . $this->indent . 'Date of BNT test:');\r\n $this->form->addElement('select', 'bnt_type',$this->indent . $this->indent . 'Type of test:', $general_spoken_written_option);\r\n \r\n $this->form->addElement('select', 'bnt_version', $this->indent . $this->indent . 'Test Version:', $bnt_version_option);\r\n \r\n $this->form->addElement('text', 'bnt_total', $this->indent . $this->indent . 'BNT Total score:');\r\n $this->form->addRule('bnt_total','Numerical value required.', 'numeric');\r\n\r\n\r\n // Breaks for formatting\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n \r\n // HVLTR\r\n $this->form->addElement('static', null, '<font size=4>Hopkins Verbal Learning Test - Revised (HVLT-R)</font>');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('select', 'hvltr_done', $this->indent . $this->indent . 'Has the HVLT-R test been done?', $done_option);\r\n\r\n // HVLTR Done/Not Done Rules\r\n $this->XINRegisterRule(\"hvltr_date\", array(\"hvltr_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"hvltr_type\", array(\"hvltr_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"hvltr_version\", array(\"hvltr_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"hvltr_total_recall\", array(\"hvltr_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"hvltr_delayed\", array(\"hvltr_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"hvltr_retention\", array(\"hvltr_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"hvltr_recognition\", array(\"hvltr_done{@}=={@}done\"), \"Required.\");\r\n \r\n\r\n\r\n // HVLTR Questions\r\n $this->form->addElement('date', 'hvltr_date', $this->indent . $this->indent . 'Date of HVLT-R test:');\r\n $this->form->addElement('select', 'hvltr_type',$this->indent . $this->indent . 'Type of test:', $general_spoken_written_option);\r\n \r\n $this->form->addElement('select', 'hvltr_version', $this->indent . $this->indent . 'Test Version:', $hvltr_version_option);\r\n \r\n\r\n $this->form->addElement('text', 'hvltr_total_recall', $this->indent . $this->indent . 'Total recall:');\r\n $this->form->addRule('hvltr_total_recall','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'hvltr_delayed', $this->indent . $this->indent . 'Delayed recall:');\r\n $this->form->addRule('hvltr_delayed','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'hvltr_retention', $this->indent . $this->indent . 'Retention (%):');\r\n $this->form->addRule('hvltr_retention','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'hvltr_recognition', $this->indent . $this->indent . 'Recognition discrimination index:');\r\n $this->form->addRule('hvltr_recognition','Numerical value required.', 'numeric');\r\n\r\n // Breaks for formatting\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n \r\n // Social Questionnaire\r\n $this->form->addElement('static', null, '<font size=4>Social Norms Questionnaire Survey</font>');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('select', 'social_questionnaire_done',$this->indent . $this->indent . 'Has the questionnaire been done?', $done_option);\r\n\r\n // Social Questionnaire Done/Not Done Rules\r\n \r\n $this->XINRegisterRule(\"social_questionnaire_date\", array(\"social_questionnaire_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"social_questionnaire_sum\", array(\"social_questionnaire_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"social_questionnaire_snq22\", array(\"social_questionnaire_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"social_questionnaire_break\", array(\"social_questionnaire_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"social_questionnaire_overadhere\", array(\"social_questionnaire_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"social_questionnaire_yn\", array(\"social_questionnaire_done{@}=={@}done\"), \"Required.\");\r\n\r\n\r\n // Social Questionnaire Questions\r\n $this->form->addElement('date', 'social_questionnaire_date', $this->indent . $this->indent . 'Date of Social Questionnaire:');\r\n \r\n\r\n $this->form->addElement('text', 'social_questionnaire_sum', $this->indent . $this->indent . 'Sum of items:');\r\n $this->form->addRule('social_questionnaire_sum','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'social_questionnaire_snq22', $this->indent . $this->indent . 'SNQ22 Total Score:');\r\n $this->form->addRule('social_questionnaire_snq22','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'social_questionnaire_break', $this->indent . $this->indent . 'Break Score:');\r\n $this->form->addRule('social_questionnaire_break','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'social_questionnaire_overadhere', $this->indent . $this->indent . 'Overadhere Score:');\r\n $this->form->addRule('social_questionnaire_overadhere','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'social_questionnaire_yn', $this->indent . $this->indent . 'Y/N Ratio Score:');\r\n $this->form->addRule('social_questionnaire_yn','Numerical value required.', 'numeric');\r\n\r\n // Breaks for formatting\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n \r\n // HADS \r\n $this->form->addElement('static', null, '<font size=4>Hospital Anxiety and Depression Scale (HADS)</font>');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('select', 'hads_done',$this->indent . $this->indent . 'Has the HADS been done?', $done_option);\r\n\r\n // HADS Done/Not Done Rules\r\n \r\n $this->XINRegisterRule(\"hads_date\", array(\"hads_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"hads_depression\", array(\"hads_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"hads_anxiety\", array(\"hads_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"hads_question_eight\", array(\"hads_done{@}=={@}done\"), \"Required.\");\r\n\r\n\r\n // HADS Questions\r\n $this->form->addElement('date', 'hads_date', $this->indent . $this->indent . 'Date of HADS:');\r\n \r\n\r\n $this->form->addElement('static', null, $this->indent . 'Total score:');\r\n\r\n $this->form->addElement('text', 'hads_depression', $this->indent . $this->indent . $this->indent . 'Depression (D):');\r\n $this->form->addRule('hads_depression','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'hads_anxiety', $this->indent . $this->indent . $this->indent . 'Anxiety (A):');\r\n $this->form->addRule('hads_anxiety','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'hads_question_eight', $this->indent . $this->indent . 'Score on Question #8 (\"I feel as if I am slowed down\"):');\r\n $this->form->addRule('hads_question_eight','Numerical value required.', 'numeric');\r\n\r\n // Breaks for formatting\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n \r\n // CNS-LS \r\n $this->form->addElement('static', null, '<font size=4>Center for Neurological Study - Liability Scale (CNS-LS)</font>');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('select', 'cns_done',$this->indent . $this->indent . 'Has the CNS-LS been done?', $done_option);\r\n\r\n // CNS-LS Done/Not Done Rules\r\n $this->XINRegisterRule(\"cns_date\", array(\"cns_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"cns_total\", array(\"cns_done{@}=={@}done\"), \"Required.\");\r\n\r\n\r\n\r\n // CNS-LS Questions\r\n $this->form->addElement('date', 'cns_date', $this->indent . $this->indent . 'Date of CNS-LS:');\r\n \r\n\r\n $this->form->addElement('text', 'cns_total', $this->indent . $this->indent . 'Total score:');\r\n $this->form->addRule('cns_total','Numerical value required.', 'numeric');\r\n\r\n\r\n // Breaks for formatting\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n \r\n // Vistoria Stroop Test \r\n $this->form->addElement('static', null, '<font size=4>Victoria Stroop Test</font>');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('select', 'victoria_done',$this->indent . $this->indent . 'Has the Victoria Stroop Test been done?', $done_option);\r\n\r\n // Victoria Strrop Test Done/Not Done Rules\r\n $this->XINRegisterRule(\"victoria_date\", array(\"victoria_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"victoria_type\", array(\"victoria_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"victoria_one_time\", array(\"victoria_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"victoria_one_errors\", array(\"victoria_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"victoria_two_time\", array(\"victoria_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"victoria_two_errors\", array(\"victoria_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"victoria_three_time\", array(\"victoria_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"victoria_three_errors\", array(\"victoria_done{@}=={@}done\"), \"Required.\");\r\n \r\n\r\n\r\n // Victoria Stroop Test Questions\r\n $this->form->addElement('date', 'victoria_date', $this->indent . $this->indent . 'Date of Victoria Stroop Test:');\r\n $this->form->addElement('select', 'victoria_type',$this->indent . $this->indent . 'Type of test:', $victoria_test_option);\r\n \r\n\r\n $this->form->addElement('static', null, $this->indent . '<i><font size=3>Trial 1 (Color Dots)</font></i>');\r\n\r\n $this->form->addElement('text', 'victoria_one_time', $this->indent . $this->indent . $this->indent . 'Time taken(s): ');\r\n $this->form->addRule('victoria_one_time','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'victoria_one_errors', $this->indent . $this->indent . $this->indent . '# of errors: ');\r\n $this->form->addRule('victoria_one_errors','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('static', null, $this->indent . '<i><font size=3>Trial 2 (Color Words)</font></i>');\r\n\r\n $this->form->addElement('text', 'victoria_two_time', $this->indent . $this->indent . $this->indent . 'Time taken(s): ');\r\n $this->form->addRule('victoria_two_time','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'victoria_two_errors', $this->indent . $this->indent . $this->indent . '# of errors: ');\r\n $this->form->addRule('victoria_two_errors','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('static', null, $this->indent . '<i><font size=3>Trial 3 (Color-Words Interference)</font></i>');\r\n\r\n $this->form->addElement('text', 'victoria_three_time', $this->indent . $this->indent . $this->indent . 'Time taken(s): ');\r\n $this->form->addRule('victoria_three_time','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'victoria_three_errors', $this->indent . $this->indent . $this->indent . '# of errors: ');\r\n $this->form->addRule('victoria_three_errors','Numerical value required.', 'numeric');\r\n\r\n // Breaks for formatting\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n \r\n // JLO\r\n $this->form->addElement('static', null, '<font size=4>Benton Judgement of Line Orientation (JLO)</font>');\r\n $this->form->addElement('static', null, $this -> indent. '<i>If ECAS Visuospatial Score <10 </i>');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('select', 'jlo_done',$this->indent . $this->indent . 'Has the JLO been done?', $done_option);\r\n\r\n // JLO Done/Not Done Rules\r\n $this->XINRegisterRule(\"jlo_date\", array(\"jlo_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"jlo_type\", array(\"jlo_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"jlo_version\", array(\"jlo_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"jlo_total\", array(\"jlo_done{@}=={@}done\"), \"Required.\");\r\n \r\n\r\n\r\n // JLO Questions\r\n $this->form->addElement('date', 'jlo_date', $this->indent . $this->indent . 'Date of JLO:');\r\n $this->form->addElement('select', 'jlo_type',$this->indent . $this->indent . 'Type of test:', $general_spoken_written_option);\r\n\r\n\r\n $this->form->addElement('select', 'jlo_version',$this->indent . $this->indent . 'Test Version:', $jlo_version_option);\r\n\r\n $this->form->addElement('text', 'jlo_total', $this->indent . $this->indent . 'Total score:');\r\n $this->form->addRule('jlo_total','Numerical value required.', 'numeric');\r\n\r\n // Breaks for formatting\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n \r\n // Social Behavior Observer Checklist\r\n $this->form->addElement('static', null, '<font size=4>Social Behavior Observer Checklist</font>');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('static', null, '');\r\n $this->form->addElement('select', 'social_behavior_done', $this->indent . $this->indent . 'Has the Social Behavior Observer Checklist been done?', $done_option);\r\n\r\n // Social Behavior Observer Checklist Done/Not Done Rules\r\n $this->XINRegisterRule(\"social_behavior_date\", array(\"social_behavior_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"social_behavior_descriptor\", array(\"social_behavior_done{@}=={@}done\"), \"Required.\");\r\n $this->XINRegisterRule(\"social_behavior_checklist\", array(\"social_behavior_done{@}=={@}done\"), \"Required.\");\r\n\r\n\r\n // Social Behavior Observer Checklist Questions\r\n $this->form->addElement('date', 'social_behavior_date', $this->indent . $this->indent . 'Date:');\r\n \r\n $this->form->addElement('text', 'social_behavior_descriptor', $this->indent . $this->indent . 'Descriptor Total score:');\r\n $this->form->addRule('social_behavior_descriptor','Numerical value required.', 'numeric');\r\n\r\n $this->form->addElement('text', 'social_behavior_checklist', $this->indent . $this->indent . 'Checklist (Behavior) Total Score:');\r\n $this->form->addRule('social_behavior_checklist','Numerical value required.', 'numeric');\r\n \r\n\r\n \r\n }",
"protected function _prepareForm()\n {\n $model = Mage::registry('secure_rule');\n $helper = Mage::helper('aws_customersecure');\n\n $form = new Varien_Data_Form(\n array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post')\n );\n\n $form->setHtmlIdPrefix('email_');\n\n $fieldset = $form->addFieldset('base_fieldset', array(\n 'legend' => Mage::helper('aws_customersecure')->__('General Information'),\n 'class' => 'fieldset-wide' // <div class=\"fieldset-wide\" in phtml\n ));\n\n if ($model->getEntityId()) {\n $fieldset->addField('entity_id', 'hidden', array(\n 'name' => 'entity_id'\n ));\n }\n\n $customerCollection = Mage::getResourceModel('customer/group_collection');\n\n $cmsPagesCollection = Mage::getResourceModel('cms/page_collection')\n ->addFieldToFilter('identifier', array('neq' => 'no-route')) // id != no-route\n ->addFieldToFilter('identifier', array('neq' => 'home'));\n\n $emailGroupCollection = Mage::getResourceModel('aws_customersecure/email_collection');\n\n\n\n $fieldset->addField('rule_name', 'text', array(\n 'name' => 'rule_name',\n 'label' => $helper->__('Rule Name'),\n 'title' => $helper->__('Rule Name'),\n 'required' => true,\n ));\n\n $fieldset->addField('code', 'text', array(\n 'name' => 'code',\n 'label' => $helper->__('Code'),\n 'title' => $helper->__('Code'),\n 'required' => true,\n ));\n\n $fieldset->addField('email_groups', 'multiselect', array(\n 'name' => 'email_groups',\n 'label' => $helper->__('Email Groups'),\n 'title' => $helper->__('Email Groups'),\n 'required' => true,\n 'values' => $helper->customToOptionArray($emailGroupCollection, 'entity_id', 'email_group')\n ));\n\n $fieldset->addField('customer_groups', 'multiselect', array(\n 'name' => 'customer_groups',\n 'label' => $helper->__('Customer Groups'),\n 'title' => $helper->__('Customer Groups'),\n 'required' => true,\n 'values' => $helper->customToOptionArray($customerCollection, 'customer_group_id', 'customer_group_code')\n ));\n\n $fieldset->addField('cms_pages', 'multiselect', array(\n 'name' => 'cms_pages',\n 'label' => $helper->__('Cms Pages'),\n 'title' => $helper->__('Cms Pages'),\n 'required' => true,\n 'values' => $helper->customToOptionArray($cmsPagesCollection, 'page_id', 'title')\n ));\n\n $fieldset->addField('is_active', 'select', array(\n 'name' => 'is_active',\n 'label' => $helper->__('Status'),\n 'title' => $helper->__('Status'),\n 'required' => true,\n 'values' => $helper->getStatusArray()\n ));\n\n $fieldset->addField('secure_rule', 'editor', array(\n 'name' => 'secure_rule',\n 'label' => $helper->__('Comment'),\n 'title' => $helper->__('Comment'),\n 'style' => 'height:16em',\n 'required' => true,\n 'config' => Mage::getSingleton('cms/wysiwyg_config')->getConfig()\n ));\n\n\n $form->setValues($model->getData());\n $form->setUseContainer(true);\n\n $this->setForm($form);\n\n return parent::_prepareForm();\n }"
] | [
"0.6008882",
"0.58925915",
"0.5840238",
"0.55368984",
"0.54847753",
"0.54842746",
"0.54036576",
"0.5398363",
"0.5373606",
"0.53511417",
"0.5305109",
"0.5304341",
"0.52668476",
"0.52654403",
"0.52513605",
"0.52430373",
"0.5218611",
"0.518217",
"0.5166288",
"0.51542443",
"0.51475996",
"0.5146103",
"0.5142059",
"0.51339597",
"0.5125776",
"0.5120114",
"0.5110379",
"0.51002026",
"0.5081147",
"0.5074177"
] | 0.637614 | 0 |
Add listing_layout metabox tab | function houzez_listing_layout_metabox_tab( $metabox_tabs ) {
if ( is_array( $metabox_tabs ) ) {
$metabox_tabs['listing_layout'] = array(
'label' => houzez_option('cls_layout', 'Layout'),
'icon' => 'dashicons-laptop',
);
}
return $metabox_tabs;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function AddTab($label, $content=\"\")\n\t{\n\t\t$container = $this->content(new Control('div'));\n\t\t$container->content($content);\n\t\t$this->list->content( new Control('li') )->content(\"<a href='#{$container->id}'>$label</a>\");\n\t\treturn $container;\n\t}",
"function myplaylist_add_custom_box() {\r\n\tadd_meta_box(\r\n 'dynamic_sectionid',\r\n\t__( 'Playlist Entries', 'radio-station' ),\r\n 'myplaylist_inner_custom_box',\r\n 'playlist');\r\n}",
"public function putLayoutTypeTabs(){\r\n\t\t\r\n\t\t\r\n\t\tdmp(\"get all template types\");\r\n\t\texit();\r\n\t\t\r\n\t\t?>\r\n\t\t<div class=\"uc-layout-type-tabs-wrapper\">\r\n\t\t\t\r\n\t\t\t<?php foreach($arrLayoutTypes as $type => $arrType):\r\n\r\n\t\t\t\t$tabTitle = UniteFunctionsUC::getVal($arrType, \"plural\");\r\n\t\t\t\t\r\n\t\t\t\t$urlView = HelperUC::getViewUrl_TemplatesList(null, $type);\r\n\t\t\t\t\r\n\t\t\t\t$addClass = \"\";\r\n\t\t\t\tif($type == $this->layoutType){\r\n\t\t\t\t\t$addClass = \" uc-tab-selected\";\r\n\t\t\t\t\t$urlView = \"javascript:void(0)\";\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t?>\r\n\t\t\t<a href=\"<?php echo esc_attr($urlView)?>\" class=\"uc-tab-layouttype<?php echo esc_attr($addClass)?>\"><?php echo esc_html($tabTitle)?></a>\r\n\t\t\t\r\n\t\t\t<?php endforeach?>\r\n\t\t\t\t\t\t\r\n\t\t</div>\r\n\t\t<?php \r\n\t\t\r\n\t}",
"static function get_tabs() {\n\t\t\t$select = array(\n\t\t\t\t'all' => _x('All', 'backend metabox', 'the7mk2'),\n\t\t\t\t'only' => _x('Only', 'backend metabox', 'the7mk2'),\n\t\t\t\t'except' => _x('All, except', 'backend metabox', 'the7mk2'),\n\t\t\t);\n\n\t\t\t$type = array(\n\t\t\t\t'albums'\t\t=> _x('Albums', 'backend metabox', 'the7mk2'),\n\t\t\t\t'category'\t\t=> _x('Category', 'backend metabox', 'the7mk2'),\n\t\t\t);\n\n\t\t\t$html = '';\n\t\t\t$html .= '<div class=\"dt_tabs\">';\n\t\t\t\t\n\t\t\t\t$hidden_class = '';\n\t\t\t\tif ( 'both' != self::$field['mode'] ) { $hidden_class = ' hide-if-js'; }\n\n\t\t\t\t// Arrange\n\t\t\t\t$html .= '<div class=\"dt_arrange-by' . $hidden_class . '\">';\n\t\t\t\t\n\t\t\t\t\tif ( 'both' == self::$field['mode'] ) {\n\t\t\t\t\t\t$html .= '<strong>' . _x('Arrange by:', 'backend metabox', 'the7mk2') . '</strong>';\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach ( $type as $value=>$title ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t$class = $value;\n\t\t\t\t\t\tif ( 'category' == $value ) { $class = 'categories'; }\n\n\t\t\t\t\t\t$html .= '<label class=\"dt_arrange dt_by-' . esc_attr($class) . '\">';\n\t\t\t\t\t\t$html .= sprintf( '<input class=\"type_selector\" type=\"radio\" name=\"%s\" value=\"%s\" %s/>',\n\t\t\t\t\t\t\tself::$field['field_name'] . '[type]',\n\t\t\t\t\t\t\t$value,\n\t\t\t\t\t\t\tchecked(self::$meta['type'], $value, false)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$html .= '<span>' . $title . '</span></label>';\n\t\t\t\t\t}\n\n\t\t\t\t$html .= '</div>';\n\n\t\t\t\t// Tabs\n\t\t\t\tforeach ( $select as $value=>$title ) {\n\t\t\t\t\t$html .= '<label class=\"dt_tab dt_' . esc_attr($value) . '\">';\n\t\t\t\t\t$html .= sprintf( '<input type=\"radio\" name=\"%s\" value=\"%s\" %s/>',\n\t\t\t\t\t\tself::$field['field_name'] . '[select]',\n\t\t\t\t\t\t$value,\n\t\t\t\t\t\tchecked(self::$meta['select'], $value, false)\n\t\t\t\t\t);\n\t\t\t\t\t$html .= '<span>' . $title . '</span></label>';\n\t\t\t\t}\n\n\t\t\t$html .= '</div>';\n\n\t\t\treturn $html;\n\t\t}",
"function add_slider_list_meta_box() {\n add_meta_box(\n 'slider_list',\n 'Slider à afficher',\n 'slider_list_meta',\n 'page',\n 'normal',\n 'high'\n );\n}",
"public static function add_tab_content($atts){\n $tooltips = array(\n __( 'Give this listing a name', 'super-forms' ),\n __('Paste shortcode on any page', 'super-forms' ),\n __('Change Settings', 'super-forms' ),\n __('Delete Listing', 'super-forms' )\n );\n $shortcode = '[form-not-saved-yet]';\n $form_id = absint($atts['form_id']);\n ?>\n <ul class=\"front-end-listing-list\">\n <?php\n // If no listings where found just add a default list\n if( !isset($atts['settings']['_listings']) ) $atts['settings']['_listings'] = array();\n\n if( count($atts['settings']['_listings'])==0 ) {\n $atts['settings']['_listings'][0]['name'] = '';\n }\n foreach( $atts['settings']['_listings'] as $k => $list ) {\n // Set default values if they don't exist\n $list = self::get_default_listing_settings($list);\n\n // Get the correct shortcode for this list\n if( $form_id!=0 ) {\n if( $k==0 ) {\n $shortcode = '[super_listing list="1" id="'. $form_id . '"]';\n }else{\n $shortcode = '[super_listing list="' . ($k+1) . '" id="'. $form_id . '"]';\n }\n }\n\n // Show settings to the user\n ?>\n <li>\n <div class=\"super-group\">\n <span><?php echo esc_html__( 'List Name', 'super-forms' ); ?>:</span>\n <input name=\"name\" type=\"text\" class=\"super-tooltip\" title=\"<?php echo esc_attr($tooltips[0]); ?>\" data-title=\"<?php echo esc_attr($tooltips[0]); ?>\" value=\"<?php echo $list['name']; ?>\">\n </div>\n <div class=\"super-group\">\n <span><?php echo esc_html__( 'Shortcode', 'super-forms' ); ?>:</span>\n <input type=\"text\" readonly=\"readonly\" class=\"super-get-form-shortcodes super-tooltip\" title=\"<?php echo esc_attr($tooltips[1]); ?>\" data-title=\"<?php echo esc_attr($tooltips[1]); ?>\" value=\"<?php echo $shortcode; ?>\">\n </div>\n <div class=\"super-setting super-tooltip\" onclick=\"SUPER.frontEndListing.toggleSettings(this)\" title=\"<?php echo esc_attr($tooltips[2]); ?>\" data-title=\"<?php echo esc_attr($tooltips[2]); ?>\"></div>\n <div class=\"super-delete super-tooltip\" onclick=\"SUPER.frontEndListing.deleteListing(this)\" title=\"<?php echo esc_attr($tooltips[3]); ?>\" data-title=\"<?php echo esc_attr($tooltips[3]); ?>\"></div>\n <div class=\"super-settings\">\n <div class=\"super-radio\" data-name=\"display_based_on\">\n <span <?php echo ($list['display_based_on']=='this_form' ? 'class=\"super-active\" ' : ''); ?>onclick=\"SUPER.frontEndListing.radio(this)\" data-value=\"this_form\">Only display entries based on this Form</span>\n <span <?php echo ($list['display_based_on']=='all_forms' ? 'class=\"super-active\" ' : ''); ?>onclick=\"SUPER.frontEndListing.radio(this)\" data-value=\"all_forms\">Display entries based on all forms</span>\n <span <?php echo ($list['display_based_on']=='specific_forms' ? 'class=\"super-active\" ' : ''); ?>onclick=\"SUPER.frontEndListing.radio(this)\" data-value=\"specific_forms\">Display entries based on the following Form ID's:<br /><input type=\"text\" name=\"form_ids\" placeholder=\"123,124\" value=\"<?php echo sanitize_text_field($list['form_ids']); ?>\" /><i>(seperate each ID with a comma)</i></span>\n </div>\n <div class=\"super-checkbox<?php echo ($list['date_range']!==false ? ' super-active' : ''); ?>\" data-name=\"date_range\">\n <span onclick=\"SUPER.frontEndListing.checkbox(event, this)\">Only display entries within the following date range:</span>\n <div class=\"super-sub-settings\">\n <div class=\"super-text\">\n <span>From: <i>(or leave blank for no minimum date)</i></span>\n <input type=\"date\" name=\"from\" value=\"<?php echo (!empty($list['from']) ? sanitize_text_field($list['from']) : ''); ?>\" />\n </div>\n <div class=\"super-text\">\n <span>Till: <i>(or leave blank for no maximum date)</i></span>\n <input type=\"date\" name=\"till\" value=\"<?php echo (!empty($list['till']) ? sanitize_text_field($list['till']) : ''); ?>\" />\n </div>\n </div>\n </div>\n <div class=\"super-checkbox<?php echo ($list['show_title']==true ? ' super-active' : ''); ?>\" data-name=\"show_title\">\n <span<?php echo ($list['show_title']==true ? ' class=\"super-active\"' : ''); ?> onclick=\"SUPER.frontEndListing.checkbox(event, this)\">\n <span>Show \"Title\" column</span>\n <input class=\"super-tooltip\" name=\"name\" value=\"<?php echo $list['show_title']['name']; ?>\" type=\"text\" title=\"Column name\" data-title=\"Column name\" />\n <input class=\"super-tooltip\" name=\"placeholder\" value=\"<?php echo $list['show_title']['placeholder']; ?>\" type=\"text\" title=\"Filter placeholder\" data-title=\"Filter placeholder\" />\n <input class=\"super-tooltip\" name=\"width\" value=\"<?php echo absint($list['show_title']['width']); ?>\" type=\"number\" title=\"Column width (px)\" data-title=\"Column width (px)\" />\n <input class=\"super-tooltip\" name=\"position\" value=\"<?php echo absint($list['show_title']['position']); ?>\" type=\"number\" title=\"Column position\" data-title=\"Column position\" />\n </span>\n </div>\n <div class=\"super-checkbox<?php echo ($list['show_status']==true ? ' super-active' : ''); ?>\" data-name=\"show_status\">\n <span<?php echo ($list['show_status']==true ? ' class=\"super-active\"' : ''); ?> onclick=\"SUPER.frontEndListing.checkbox(event, this)\">\n <span>Show \"Status\" column</span>\n <input class=\"super-tooltip\" name=\"name\" value=\"<?php echo $list['show_status']['name']; ?>\" type=\"text\" title=\"Column name\" data-title=\"Column name\" />\n <input class=\"super-tooltip\" name=\"placeholder\" value=\"<?php echo $list['show_status']['placeholder']; ?>\" type=\"text\" title=\"Filter placeholder\" data-title=\"Filter placeholder\" />\n <input class=\"super-tooltip\" name=\"width\" value=\"<?php echo absint($list['show_status']['width']); ?>\" type=\"number\" title=\"Column width (px)\" data-title=\"Column width (px)\" />\n <input class=\"super-tooltip\" name=\"position\" value=\"<?php echo absint($list['show_status']['position']); ?>\" type=\"number\" title=\"Column position\" data-title=\"Column position\" />\n </span>\n </div>\n <div class=\"super-checkbox<?php echo ($list['show_date']==true ? ' super-active' : ''); ?>\" data-name=\"show_date\">\n <span<?php echo ($list['show_date']==true ? ' class=\"super-active\"' : ''); ?> onclick=\"SUPER.frontEndListing.checkbox(event, this)\">\n <span>Show \"Date created\" column</span>\n <input class=\"super-tooltip\" name=\"name\" value=\"<?php echo $list['show_date']['name']; ?>\" type=\"text\" title=\"Column name\" data-title=\"Column name\" />\n <input class=\"super-tooltip\" name=\"placeholder\" value=\"<?php echo $list['show_date']['placeholder']; ?>\" type=\"text\" title=\"Filter placeholder\" data-title=\"Filter placeholder\" />\n <input class=\"super-tooltip\" name=\"width\" value=\"<?php echo absint($list['show_date']['width']); ?>\" type=\"number\" title=\"Column width (px)\" data-title=\"Column width (px)\" />\n <input class=\"super-tooltip\" name=\"position\" value=\"<?php echo absint($list['show_date']['position']); ?>\" type=\"number\" title=\"Column position\" data-title=\"Column position\" />\n </span>\n </div>\n <div class=\"super-checkbox<?php echo ($list['custom_columns']==true ? ' super-active' : ''); ?>\" data-name=\"custom_columns\">\n <span<?php echo ($list['custom_columns']==true ? ' class=\"super-active\"' : ''); ?> onclick=\"SUPER.frontEndListing.checkbox(event, this)\">Show the following \"Custom\" columns</span>\n <div class=\"super-sub-settings\">\n <ul>\n <?php\n $columns = $list['columns'];\n foreach( $columns as $ck => $cv ) {\n if( !isset($cv['filter']) ) {\n $cv['filter'] = 'text'; // Default filter to 'text'\n }\n ?> \n <li>\n <span class=\"sort-up\" onclick=\"SUPER.frontEndListing.sortColumn(this, 'up')\"></span>\n <span class=\"sort-down\" onclick=\"SUPER.frontEndListing.sortColumn(this, 'down')\"></span>\n <div class=\"super-text\">\n <span>Column name:</span>\n <input type=\"text\" name=\"name\" value=\"<?php echo $cv['name']; ?>\" />\n </div>\n <div class=\"super-text\">\n <span>Map to the following field <i>(enter a field name)</i>:</span>\n <input type=\"text\" name=\"field_name\" value=\"<?php echo $cv['field_name']; ?>\" />\n </div>\n <div class=\"super-text\">\n <span>Column width <i>(in px)</i>:</span>\n <input type=\"number\" name=\"width\" value=\"<?php echo $cv['width']; ?>\" />\n </div>\n\n <div class=\"super-text\">\n <span>Filter method:</span>\n <select name=\"filter\" onchange=\"SUPER.frontEndListing.showFilterItems(this)\">\n <option<?php echo ($cv['filter']=='none' ? ' selected=\"selected\"' : ''); ?> value=\"none\"><?php echo esc_html__( 'No filter', 'super-forms' ); ?></option>\n <option<?php echo ($cv['filter']=='text' ? ' selected=\"selected\"' : ''); ?> value=\"text\"><?php echo esc_html__( 'Text field (default)', 'super-forms' ); ?></option>\n <option<?php echo ($cv['filter']=='dropdown' ? ' selected=\"selected\"' : ''); ?> value=\"dropdown\"><?php echo esc_html__( 'Dropdown', 'super-forms' ); ?></option>\n </select>\n </div>\n <div class=\"super-text super-filter-items\"<?php echo ($cv['filter']!=='dropdown' ? ' style=\"display:none;\"' : ''); ?>>\n <span>Filter options <i>(put each on a new line)</i>:</span>\n <textarea name=\"filter_items\" placeholder=\"<?php echo esc_attr__( \"option_value1|Option Label 1\\noption_value2|Option Label 2\", 'super-forms' ); ?>\"><?php echo (isset($cv['filter_items']) ? $cv['filter_items'] : ''); ?></textarea>\n </div>\n\n <span class=\"add-column\" onclick=\"SUPER.frontEndListing.addColumn(this)\"></span>\n <span class=\"delete-column\" onclick=\"SUPER.frontEndListing.deleteColumn(this)\"></span>\n </li>\n <?php\n }\n ?>\n\n </ul>\n </div>\n </div>\n <div class=\"super-checkbox<?php echo ($list['edit_any']!==false ? ' super-active' : ''); ?>\" data-name=\"edit_any\">\n <span onclick=\"SUPER.frontEndListing.checkbox(event, this)\">Allow the following users to edit any entry</span>\n <div class=\"super-sub-settings\">\n\t\t\t\t <div class=\"super-radio\" data-name=\"method\">\n\t\t\t\t\t<span <?php echo ($list['edit_any']['method']=='modal' ? 'class=\"super-active\" ' : ''); ?>onclick=\"SUPER.frontEndListing.radio(this)\" data-value=\"modal\"><?php echo esc_html__( 'Open form in a modal (default)', 'super-forms' ); ?></span>\n\t\t\t\t\t<span <?php echo ($list['edit_any']['method']=='url' ? 'class=\"super-active\" ' : ''); ?>onclick=\"SUPER.frontEndListing.radio(this)\" data-value=\"url\"><?php echo esc_html__( 'Open via form page (Form Location must be configured for your forms)', 'super-forms' ); ?></span>\n\t\t\t\t </div>\n <div class=\"super-text\">\n <span>User roles:</span>\n <input type=\"text\" name=\"user_roles\" />\n </div>\n <div class=\"super-text\">\n <span>User ID's:</span>\n <input type=\"text\" name=\"user_ids\" />\n </div>\n </div>\n </div>\n <div class=\"super-checkbox\" data-name=\"edit_own\">\n <span onclick=\"SUPER.frontEndListing.checkbox(event, this)\">Allow the following users to edit their own entries</span>\n <div class=\"super-sub-settings\">\n <div class=\"super-text\">\n <span>User roles:</span>\n <input type=\"text\" name=\"user_roles\" />\n </div>\n <div class=\"super-text\">\n <span>User ID's:</span>\n <input type=\"text\" name=\"user_ids\" />\n </div>\n </div>\n </div>\n <div class=\"super-checkbox\" data-name=\"delete_any\">\n <span onclick=\"SUPER.frontEndListing.checkbox(event, this)\">Allow the following users to delete any entry</span>\n <div class=\"super-sub-settings\">\n <div class=\"super-text\">\n <span>User roles:</span>\n <input type=\"text\" name=\"user_roles\" />\n </div>\n <div class=\"super-text\">\n <span>User ID's:</span>\n <input type=\"text\" name=\"user_ids\" />\n </div>\n </div>\n </div>\n <div class=\"super-checkbox\" data-name=\"delete_own\">\n <span onclick=\"SUPER.frontEndListing.checkbox(event, this)\">Allow the following users to delete their own entries</span>\n <div class=\"super-sub-settings\">\n <div class=\"super-text\">\n <span>User roles:</span>\n <input type=\"text\" name=\"user_roles\" />\n </div>\n <div class=\"super-text\">\n <span>User ID's:</span>\n <input type=\"text\" name=\"user_ids\" />\n </div>\n </div>\n </div>\n <div class=\"super-radio\" data-name=\"pagination\">\n <span <?php echo ($list['pagination']=='pages' ? 'class=\"super-active\" ' : ''); ?>onclick=\"SUPER.frontEndListing.radio(this)\" data-value=\"pages\" class=\"super-active\">Show pagination</span>\n <span <?php echo ($list['pagination']=='load_more' ? 'class=\"super-active\" ' : ''); ?>onclick=\"SUPER.frontEndListing.radio(this)\" data-value=\"load_more\">Show \"Load More\" button</span>\n </div>\n <div class=\"super-dropdown\">\n <span>Results per page:</span>\n <select name=\"limit\">\n <option <?php echo ($list['limit']==10 ? 'selected=\"selected\" ' : ''); ?>value=\"10\">10</option>\n <option <?php echo ($list['limit']==25 ? 'selected=\"selected\" ' : ''); ?>value=\"25\">25</option>\n <option <?php echo ($list['limit']==50 ? 'selected=\"selected\" ' : ''); ?>value=\"50\">50</option>\n <option <?php echo ($list['limit']==100 ? 'selected=\"selected\" ' : ''); ?>value=\"100\">100</option>\n <option <?php echo ($list['limit']==300 ? 'selected=\"selected\" ' : ''); ?>value=\"300\">300</option>\n </select>\n </div>\n </div>\n </li>\n <?php\n }\n ?>\n </ul>\n <div class=\"create-listing\">\n <span class=\"super-create-listing\" onclick=\"SUPER.frontEndListing.addListing(this)\"><?php echo esc_html__( 'Add List', 'super-forms' ); ?></span>\n </div>\n <?php\n }",
"function houzez_listing_layout_metabox_fields( $metabox_fields ) {\n\t$houzez_prefix = 'fave_';\n\n\t$fields = array(\n\t\tarray(\n 'id' => \"{$houzez_prefix}single_top_area\",\n 'name' => esc_html__('Property Top Type', 'houzez'),\n 'desc' => esc_html__('Set the property top area type.', 'houzez'),\n 'type' => 'select',\n 'std' => \"global\",\n 'options' => array(\n 'global' => esc_html__( 'Global', 'houzez' ),\n 'v1' => esc_html__( 'Version 1', 'houzez' ),\n 'v2' => esc_html__( 'Version 2', 'houzez' ),\n 'v3' => esc_html__( 'Version 3', 'houzez' ),\n 'v4' => esc_html__( 'Version 4', 'houzez' ),\n 'v5' => esc_html__( 'Version 5', 'houzez' ),\n 'v6' => esc_html__( 'Version 6', 'houzez' )\n ),\n 'columns' => 12,\n 'tab' => 'listing_layout'\n ),\n array(\n 'id' => \"{$houzez_prefix}single_content_area\",\n 'name' => esc_html__('Property Content Layout', 'houzez'),\n 'desc' => esc_html__('Set property content area type.', 'houzez'),\n 'type' => 'select',\n 'std' => \"global\",\n 'options' => array(\n 'global' => esc_html__( 'Global', 'houzez' ),\n 'simple' => esc_html__( 'Default', 'houzez' ),\n 'tabs' => esc_html__( 'Tabs', 'houzez' ),\n 'tabs-vertical' => esc_html__( 'Tabs Vertical', 'houzez' ),\n 'v2' => esc_html__( 'Luxury Homes', 'houzez' )\n ),\n 'columns' => 12,\n 'tab' => 'listing_layout'\n ),\n\t);\n\n\treturn array_merge( $metabox_fields, $fields );\n\n}",
"function add_tabtastic_meta_box() { \n\t add_meta_box( \n\t 'tabtastic_meta_box', // $id \n\t 'Color Control for Tab', // $title \n\t array(&$this,'show_tabtastic_meta_box'), // $callback \n\t 'tabtastic', // $page \n\t 'normal', // $context \n\t 'high'); // $priority \n\t}",
"function wpyes_custom_tab_content() {\n\t\t$settings = new Wpyes( 'wpyes_custom_tab_content' ); // Initialize the Wpyes class.\n\n\t\t$settings->add_tab(\n\t\t\tarray(\n\t\t\t\t'id' => 'tab_1',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_section(\n\t\t\tarray(\n\t\t\t\t'id' => 'section_1',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_field(\n\t\t\tarray(\n\t\t\t\t'id' => 'wpyes_custom_tab_content_field_1',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_field(\n\t\t\tarray(\n\t\t\t\t'id' => 'wpyes_custom_tab_content_field_2',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_tab(\n\t\t\tarray(\n\t\t\t\t'id' => 'tab_2',\n\t\t\t\t'callback' => 'wpyes_custom_tab_2_content_chart',\n\t\t\t)\n\t\t);\n\n\t\t$settings->init(); // Run the Wpyes class.\n\t}",
"function pt_tab( $tabs, $pod, $addtl_args ) {\r\n\t\t$tabs[ 'fs-pods-repeater' ] = __( 'FS Repeater Options', 'fs-pods-repeater-field' );\r\n\t\t\r\n\t\treturn $tabs;\r\n\t\t\r\n\t}",
"function HtmlTabPlugin_admin_actions()\n{\t \n\tadd_options_page('HtmlTabPlugin','HtmlTabPlugin-Text','manage_options',_FILE_,'HtmlTabPlugin_admin');//Add to Setting as sub item\n\t//add_options_page('HtmlTabPlugin','HtmlTabPlugin-Text','manage_options',_FILE_,'HtmlTabPlugin_admin');\n\t//add_object_page(\"1\",\"2\",\"manage_options\",_FILE_,\"menuFunc\");//Show bottom comment as new Item\n\t//add_utility_page(\"1\",\"2\",\"manage_options\",_FILE_,\"menuFunc\");//Show on bottom as new Item\n\t//add_menu_page(\"1\",\"2\",\"manage_options\",_FILE_,\"menuFunc\");//Show on bottom as new Item\n}",
"public function add_help_tabs() {}",
"function add_widget_tabs($tabs) {\n $tabs[] = array(\n 'title' => __('GISAI widgets', 'GISAI'),\n 'filter' => array(\n 'groups' => array('GISAI')\n )\n );\n // TODO: Remove Sydney empty tab from sidebar\n return $tabs;\n}",
"function form( $post ){\n\t\t$args = wp_parse_args( $this->args, array(\n\t\t\t\t'name' \t\t\t=> 'mkpbx_postbox',\n\t\t\t\t'tab_current' \t=> array( 'post-text_add' ),\n\t\t\t\t'container' \t=> 'dynamic_tabs',\n\t\t\t\t'group'\t\t\t=> 'dynamic_tabs_group'\n\t\t\t )\n\t\t);\n\t\textract( $args );\n\t\t$metadatas = has_meta( $post->ID );\n\t\tforeach ( $metadatas as $key => $value )\n\t\t\tif ( $metadatas[ $key ][ 'meta_key' ] != '_dynamic_tabs' )\n\t\t\t\tunset( $metadatas[ $key ] );\n\t\t\telse\n\t\t\t\t$metadatas[ $key ]['meta_value'] = maybe_unserialize( $metadatas[ $key ]['meta_value'] );\n\t?>\t\n\t<ul class=\"mkpack-postbox-topnav nav nav-tabs\">\n\t\t<?php foreach( $metadatas as $meta ) :?>\n\t\t<li class=\"<?php if( in_array( 'dynamic_tab-content-'.$meta['meta_id'], $tab_current ) ) echo 'active';?>\">\n\t\t\t<a data-toggle=\"tab\" data-current=\"<?php echo $container;?>,dynamic_tab-content-<?php echo $meta['meta_id'];?>\" data-group=\"<?php echo $group;?>\" href=\"#dynamic_tab-content-<?php echo $meta['meta_id'];?>\">\n\t\t\t\t<input type=\"text\" name=\"mkpbx_postbox[multi][dynamic_tabs][<?php echo $meta['meta_id'];?>][tab-title]\" value=\"<?php echo esc_attr( @$meta['meta_value']['tab-title'] );?>\" />\n\t\t\t</a>\n\t\t</li>\n\t\t<?php endforeach; reset( $metadatas );?>\n\t\t<li class=\"<?php if( in_array('post-text_add', $tab_current ) ) echo 'active';?>\">\n\t\t\t<a id=\"add-tab\" data-toggle=\"tab\" data-name=\"mkpbx_postbox[multi][dynamic_tabs]\" data-sample=\"#tab-content-sample\" data-container=\"<?php echo $container;?>\" data-current=\"<?php echo $container;?>,post-text_add\" data-group=\"<?php echo $group;?>\" href=\"#\">+</a>\n\t\t</li>\t\t\t\n\t</ul>\n\t<div class=\"mkpack-postbox-inside tab-content\">\n\t<?php foreach( $metadatas as $meta ) :?>\n\t\t<div id=\"dynamic_tab-content-<?php echo $meta['meta_id'];?>\" class=\"tab-pane\"></div>\n\t<?php endforeach;?>\n\t</div>\n\t\n\t<?php\n\t \t$value = $default;\n\t\t$output = \"\";\n\t\tif( is_array( $value ) ) :\t\n\t\t\t$output .= preg_replace_callback( '/%%value%%\\[([a-zA-Z0-9_\\-]*)\\]/', function( $matches ) use ( $value ) { return ( isset( $value[ $matches[1] ] ) ) ? $value[ $matches[1] ] : ''; }, $sample_html );\n\t\telse :\n\t\t\t$output .= $sample_html;\n\t\tendif;\n\t?>\n\t<div id=\"tab-content-sample\" style=\"display:none;\">\t\t\n\t\t<?php echo $output;?>\n\t</div>\t\t\t\t\t\n\t<?php\n\t}",
"function houzez_floor_plans_metabox_tab( $metabox_tabs ) {\n\tif ( is_array( $metabox_tabs ) ) {\n\n\t\t$metabox_tabs['floor_plans'] = array(\n\t\t\t'label' => houzez_option('cls_floor_plans', 'Floor Plans'),\n 'icon' => 'dashicons-layout',\n\t\t);\n\n\t}\n\treturn $metabox_tabs;\n}",
"function mailbox_add_settings_tab()\n{\n $CI = & get_instance();\n $CI->app_tabs->add_settings_tab('mailbox-settings', [\n 'name' => ''._l('mailbox_setting').'',\n 'view' => 'mailbox/mailbox_settings',\n 'position' => 36,\n ]);\n}",
"function dweb_theme_widgets_tab($tabs){\n\t$tabs[] = array(\n\t\t'title' => __('DWeb Theme Widgets', 'dweb'),\n\t\t'filter' => array(\n\t\t\t'groups' => array('dweb-theme')\n\t\t)\n\t);\n\treturn $tabs;\n}",
"function add_page_item_data() {\n\t$screens = array( 'page' );\n\tforeach ( $screens as $screen ) {\n\t\tadd_meta_box(\n\t\t\t'page_sectionid',\n\t\t\t__( 'Page Metabox' ),\n\t\t\t'page_custom_box',\n\t\t\t$screen\n\t\t);\n\t}\n}",
"function options_tabs () {\n?>\n\t<ul class=\"tabs big-tabs\">\n\t\t<li class=\"current\"><a href=\"#options\"><?php _e('Optionen', $theme_code); ?></a></li>\n\t</ul>\n<?php\n}",
"function _rex721_add_tab_content($params) {\n include _rex721_PATH . 'templates/backend/template.article.options.content.phtml';\n}",
"public function tablist()\n {\n $this->beforeAction();\n $view = Piwik_View::factory('tablist');\n $plugins = $this->manager->setRelease($this->release)\n ->getCurrentPlugins();\n $view->pluginsName = $plugins;\n $view->debug = print_r($plugins, true);\n $this->render($view);\n }",
"function homenews_add() {\n\tadd_meta_box( 'homenews_control', 'Homepage news items', 'homenews_cb', 'page', 'side', 'default' );\n}",
"function wqc_add_calculator_tab() {\n\n\t\techo \"<li class=\\\"calculator_tab\\\"><a href=\\\"#calculator_tab_data\\\">\" . __( 'Calculator', 'wsbs' ) . \"</a></li>\";\n\t}",
"public function setHelpTabs() {\n // $this->args['help_tabs'][] = array(\n // 'id' => 'redux-help-tab-1',\n // 'title' => __( 'Theme Information 1', 'business-review' ),\n // 'content' => __( '<p>This is the tab content, HTML is allowed.</p>', 'business-review' )\n // );\n\n // $this->args['help_tabs'][] = array(\n // 'id' => 'redux-help-tab-2',\n // 'title' => __( 'Theme Information 2', 'business-review' ),\n // 'content' => __( '<p>This is the tab content, HTML is allowed.</p>', 'business-review' )\n // );\n\n // Set the help sidebar\n // $this->args['help_sidebar'] = __( '<p>This is the sidebar content, HTML is allowed.</p>', 'business-review' );\n }",
"public function list_menu_page_handler() {\r\n $widget_names = wpf_get_widget_names(); \r\n ?>\r\n <div class=\"wrap\">\r\n <h1 class=\"wp-heading-inline\"><?php echo __( 'WPF Fields', 'wpf' ); ?></h1>\r\n <a href=\"<?php echo esc_url( $this->get_add_url() ); ?>\" class=\"page-title-action\"> <?php echo __( 'Add New', 'wpf' ); ?></a> \r\n <table class=\"wp-list-table wpf-fields widefat fixed striped\">\r\n <thead> \r\n <td scope=\"col\" class=\"manage-column column-title\"><?php echo __( 'Title', 'wpf' ); ?> </td>\r\n <td scope=\"col\" class=\"manage-column column-name\"><?php echo __( 'Name', 'wpf' ); ?> </td>\r\n <td scope=\"col\" class=\"manage-column column-type\"><?php echo __( 'Type', 'wpf' ); ?></td> \r\n <td scope=\"col\" class=\"manage-column column-required\"><?php echo __( 'Required', 'wpf' ); ?></td>\r\n <td scope=\"col\" class=\"manage-column column-active-by-default\"><?php echo __( 'Active by default', 'wpf' ); ?></td>\r\n \r\n <td scope=\"col\" class=\"manage-column column-actions\"><?php echo __( 'Actions', 'wpf' ); ?></td>\r\n </thead>\r\n <tbody> \r\n <?php if ( sizeof( $this->fields ) ) : ?>\r\n <?php foreach ( $this->fields as $field_item ) : ?>\r\n <tr data-id=\"<?php echo $field_item['id']; ?>\"> \r\n <td><?php echo $field_item['title']; ?></td>\r\n <td><?php echo $field_item['name']; ?></td>\r\n <td><?php echo $widget_names[ $field_item['widget'] ]; ?></td>\r\n <td><?php echo $field_item['required'] ? 'yes' : 'no'; ?></td>\r\n <td><?php echo $field_item['active_by_default'] ? 'yes' : 'no'; ?></td> \r\n <td><a href=\"<?php echo esc_url( $this->get_edit_url( \r\n $field_item['id'] ) ); ?>\">\r\n <?php echo __( 'Edit', 'wpf' ); ?>\r\n <a>\r\n <a href=\"<?php echo esc_url( $this->get_delete_url( \r\n $field_item['id'] ) ); ?>\"\r\n onclick=\"return confirm('<?php echo __( 'Are you sure you want to delete this field? This action cannot be undone.', 'wpf' ); ?>');\">\r\n <?php echo __( 'Delete', 'wpf' ); ?>\r\n <a>\r\n </td>\r\n </tr> \r\n <?php endforeach; ?>\r\n <?php else : ?>\r\n <tr class=\"no-items\"><td colspan=\"4\"><?php echo __( 'No items found. You can add a new front field by clicking on `Add new` button next to the page title', 'wpf' ); ?></td>\r\n </tr>\r\n <?php endif; ?>\r\n </tbody>\r\n </table>\r\n </div>\r\n <?php \r\n }",
"public function tab1()\n {\n $this->layout = new \\stdClass();\n $quizzes = $this->getData('list', 'array');\n\n if($this->hide_default_menubar){\n $params['icon_color'] = $this->color_top_bar_text_color == '#FFFFFFFF' ? 'white' : 'black';\n $params['mode'] = 'gohome';\n $params['title'] = $this->model->getConfigParam('subject');\n\n\n if(!empty($menu)){\n $params['right_menu'] = $menu;\n }\n\n $this->layout->header[] = $this->components->uiKitFauxTopBar($params);\n }\n\n if($quizzes){\n foreach ($quizzes as $quiz){\n\n $onclick = $this->getOnclickOpenAction('quizquestion',false,[\n 'sync_open' => 1,'id' => $quiz->question->id,'back_button' => 1\n ]);\n\n $this->layout->scroll[] = $this->uiKitFormSettingsField(\n ['title' => $quiz->question->title,\n 'onclick' => $onclick,\n 'icon' => $quiz->question->picture ? $quiz->question->picture : 'uikit_form_settings.png',\n 'description' => $quiz->question->question\n ]\n );\n }\n }\n return $this->layout;\n }",
"function symmetri_dashwidget() { ?>\n\t\t<ul>\n\n\t\t\t<li><a href=\"post-new.php?post_type=symmetri_cpt_gallery\"><?php _e( 'Add new work item (image gallery)', 'symmetri' ); ?></a></li>\n\n\t\t\t<li><a href=\"edit.php?post_type=symmetri_cpt_gallery\"><?php _e( 'See all work items (shown on front page)', 'symmetri' ); ?></a></li>\n\n\t\t\t<li><a href=\"post-new.php\"><?php _e( 'Add new blog post (for category \"Work in progress\")', 'symmetri' ); ?></a></li>\n\n\t\t\t<li><a href=\"edit.php?post_type=page\"><?php _e( 'Edit pages (i.e. About, Contact)', 'symmetri' ); ?></a></li>\n\n\t\t</ul>\n\n\t\t<?php\n\t}",
"function _rex721_add_tab_option($params) {\n echo '<a href=\"#\" class=\"rex488_extra_settings_tab\" rel=\"social\" onclick=\"Rexblog.Article.ToggleExtraSettings(this, event);\">Social Links</a> | ';\n}",
"function wpyes_tabs() {\n\t\t$settings = new Wpyes( 'wpyes_tabs' ); // Initialize the Wpyes class.\n\n\t\t$settings->add_tab(\n\t\t\tarray(\n\t\t\t\t'id' => 'tab_1',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_section(\n\t\t\tarray(\n\t\t\t\t'id' => 'section_1',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_field(\n\t\t\tarray(\n\t\t\t\t'id' => 'wpyes_tabs_field_1',\n\t\t\t\t'required' => true,\n\t\t\t\t'type' => 'text',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_field(\n\t\t\tarray(\n\t\t\t\t'id' => 'wpyes_tabs_field_2',\n\t\t\t\t'required' => true,\n\t\t\t\t'type' => 'multicheckbox',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'foo' => 'foo',\n\t\t\t\t\t'bar' => 'bar',\n\t\t\t\t\t'foo bar' => 'foo bar',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_tab(\n\t\t\tarray(\n\t\t\t\t'id' => 'tab_2',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_section(\n\t\t\tarray(\n\t\t\t\t'id' => 'section_1',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_field(\n\t\t\tarray(\n\t\t\t\t'id' => 'wpyes_tabs_field_3',\n\t\t\t\t'required' => true,\n\t\t\t\t'type' => 'file',\n\t\t\t)\n\t\t);\n\n\t\t$settings->add_field(\n\t\t\tarray(\n\t\t\t\t'id' => 'wpyes_tabs_field_4',\n\t\t\t\t'required' => true,\n\t\t\t\t'type' => 'multiselect',\n\t\t\t\t'options' => array(\n\t\t\t\t\t'foo' => 'foo',\n\t\t\t\t\t'bar' => 'bar',\n\t\t\t\t\t'foo bar' => 'foo bar',\n\t\t\t\t),\n\t\t\t)\n\t\t);\n\n\t\t$settings->init(); // Run the Wpyes class.\n\t}",
"public function add_metaboxes()\n {\n }"
] | [
"0.62215954",
"0.59312814",
"0.592814",
"0.58939445",
"0.58414954",
"0.58304137",
"0.5800691",
"0.57910156",
"0.57573444",
"0.57456326",
"0.57298386",
"0.5725755",
"0.5710574",
"0.57085943",
"0.5701159",
"0.56118894",
"0.55992484",
"0.55933636",
"0.5592997",
"0.5592524",
"0.5591633",
"0.55544066",
"0.55475485",
"0.55271405",
"0.55026466",
"0.54982036",
"0.5487791",
"0.5474002",
"0.5472741",
"0.5471176"
] | 0.7526459 | 0 |
Add listing_layout metaboxes fields | function houzez_listing_layout_metabox_fields( $metabox_fields ) {
$houzez_prefix = 'fave_';
$fields = array(
array(
'id' => "{$houzez_prefix}single_top_area",
'name' => esc_html__('Property Top Type', 'houzez'),
'desc' => esc_html__('Set the property top area type.', 'houzez'),
'type' => 'select',
'std' => "global",
'options' => array(
'global' => esc_html__( 'Global', 'houzez' ),
'v1' => esc_html__( 'Version 1', 'houzez' ),
'v2' => esc_html__( 'Version 2', 'houzez' ),
'v3' => esc_html__( 'Version 3', 'houzez' ),
'v4' => esc_html__( 'Version 4', 'houzez' ),
'v5' => esc_html__( 'Version 5', 'houzez' ),
'v6' => esc_html__( 'Version 6', 'houzez' )
),
'columns' => 12,
'tab' => 'listing_layout'
),
array(
'id' => "{$houzez_prefix}single_content_area",
'name' => esc_html__('Property Content Layout', 'houzez'),
'desc' => esc_html__('Set property content area type.', 'houzez'),
'type' => 'select',
'std' => "global",
'options' => array(
'global' => esc_html__( 'Global', 'houzez' ),
'simple' => esc_html__( 'Default', 'houzez' ),
'tabs' => esc_html__( 'Tabs', 'houzez' ),
'tabs-vertical' => esc_html__( 'Tabs Vertical', 'houzez' ),
'v2' => esc_html__( 'Luxury Homes', 'houzez' )
),
'columns' => 12,
'tab' => 'listing_layout'
),
);
return array_merge( $metabox_fields, $fields );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function metaboxes() {\n\t\t\n\t\tadd_meta_box('contact_information', 'Contact Information', array( $this, 'contact_information' ), $this->pagehook, 'main', 'high');\n\n\t\tadd_meta_box( 'website_options', 'Website Options', array( $this, 'website_options' ), $this->pagehook, 'main' );\n\n\t\tadd_meta_box( 'social_media_accounts', 'Social Media Accounts', array( $this, 'social_media_accounts' ), $this->pagehook, 'main' );\n\t\t\n\t}",
"function createCustomFields() {\n if ( function_exists( 'add_meta_box' ) ) {\n foreach ( $this->postTypes as $postType ) {\n add_meta_box( 'jvfrm-post-custom-fields', 'Additional information', array( &$this, 'displayCustomFields' ), $postType, 'normal', 'high' );\n }\n }\n }",
"function add_slider_list_meta_box() {\n add_meta_box(\n 'slider_list',\n 'Slider à afficher',\n 'slider_list_meta',\n 'page',\n 'normal',\n 'high'\n );\n}",
"function createCustomFields() {\n foreach ( $this->postTypes as $postType )\n add_meta_box( $this->id, $this->name, [&$this, 'displayCustomFields'], $postType, 'normal', 'high' );\n }",
"function init_metaboxes_properties() {\n\tsp_add_custom_box();\n}",
"public function add_meta_boxes()\r\n\t{\r\n\t\t$this->add_meta_box('template_page_options', esc_html__('Page Options', '3dprinting'), 'page');\r\n\t\t$this->add_meta_box('testimonial_options', esc_html__('Testimonial about', '3dprinting'), 'testimonial');\r\n\t\t$this->add_meta_box('product_options', esc_html__('Product Settings', '3dprinting'), 'product');\r\n\t\t$this->add_meta_box('team_options', esc_html__('Team About', '3dprinting'), 'team');\r\n\t\t$this->add_meta_box('portfolio_options', esc_html__('Portfolio Settings', '3dprinting'), 'portfolio');\r\n\t}",
"public function add_metaboxes()\n {\n }",
"public function add_metabox(){\n extract( $this->metabox_settings );\n add_meta_box( $this->meta_id, $title, array($this, 'render_meta_field'), $this->get_admin_pages(), $context, $priority);\n $this->add_metabox_classes();\n }",
"function metaboxes() {\n\t\tadd_meta_box('uvasom-settings', 'UVA SOM Site Settings', array( $this, 'uvasom_settings_meta_box' ), $this->pagehook, 'main', 'high');\n\t}",
"function myplaylist_add_custom_box() {\r\n\tadd_meta_box(\r\n 'dynamic_sectionid',\r\n\t__( 'Playlist Entries', 'radio-station' ),\r\n 'myplaylist_inner_custom_box',\r\n 'playlist');\r\n}",
"function porto_category_meta_fields() {\n\tglobal $porto_settings;\n\n\t$meta_fields = porto_ct_default_view_meta_fields();\n\n\t// Post Options\n\t$meta_fields = array_insert_before(\n\t\t'loading_overlay',\n\t\t$meta_fields,\n\t\t'post_options',\n\t\tarray(\n\t\t\t'name' => 'post_options',\n\t\t\t'title' => __( 'Archive Options', 'porto-functionality' ),\n\t\t\t'desc' => __( 'Change default theme options.', 'porto-functionality' ),\n\t\t\t'type' => 'checkbox',\n\t\t)\n\t);\n\n\t// Infinite Scroll\n\t$meta_fields = array_insert_after(\n\t\t'post_options',\n\t\t$meta_fields,\n\t\t'post_infinite',\n\t\tarray(\n\t\t\t'name' => 'post_infinite',\n\t\t\t'title' => __( 'Infinite Scroll', 'porto-functionality' ),\n\t\t\t'desc' => __( 'Disable infinite scroll.', 'porto-functionality' ),\n\t\t\t'type' => 'checkbox',\n\t\t\t'required' => array(\n\t\t\t\t'name' => 'post_options',\n\t\t\t\t'value' => 'post_options',\n\t\t\t),\n\t\t)\n\t);\n\n\t// Layout\n\t$meta_fields = array_insert_after(\n\t\t'post_infinite',\n\t\t$meta_fields,\n\t\t'post_layout',\n\t\tarray(\n\t\t\t'name' => 'post_layout',\n\t\t\t'title' => __( 'Post Layout', 'porto-functionality' ),\n\t\t\t'type' => 'radio',\n\t\t\t'default' => 'large',\n\t\t\t'options' => porto_ct_post_archive_layouts(),\n\t\t\t'required' => array(\n\t\t\t\t'name' => 'post_options',\n\t\t\t\t'value' => 'post_options',\n\t\t\t),\n\t\t)\n\t);\n\t// Grid Columns\n\t$meta_fields = array_insert_after(\n\t\t'post_layout',\n\t\t$meta_fields,\n\t\t'post_grid_columns',\n\t\tarray(\n\t\t\t'name' => 'post_grid_columns',\n\t\t\t'title' => __( 'Grid Columns', 'porto-functionality' ),\n\t\t\t'desc' => __( 'Select the post columns in <strong>Grid or Masonry</strong> layout.', 'porto-functionality' ),\n\t\t\t'type' => 'radio',\n\t\t\t'default' => '3',\n\t\t\t'options' => array(\n\t\t\t\t'2' => __( '2 Columns', 'porto-functionality' ),\n\t\t\t\t'3' => __( '3 Columns', 'porto-functionality' ),\n\t\t\t\t'4' => __( '4 Columns', 'porto-functionality' ),\n\t\t\t),\n\t\t\t'required' => array(\n\t\t\t\t'name' => 'post_options',\n\t\t\t\t'value' => 'post_options',\n\t\t\t),\n\t\t)\n\t);\n\n\tif ( isset( $porto_settings['show-category-skin'] ) && $porto_settings['show-category-skin'] ) {\n\t\t$meta_fields = array_merge( $meta_fields, porto_ct_default_skin_meta_fields( true ) );\n\t}\n\n\treturn $meta_fields;\n}",
"public function add_meta_box() {\n\t\tadd_meta_box( 'mo-food-details', __( 'Food Details', 'mobile-order' ), array( $this, 'display_meta_box' ), 'food' );\n\t}",
"function vdsl_add_meta_box() {\n\t\t//this will add the metabox for the Events post type\n\t\t$screens = array( 'vdStores' );\n\n\t\tforeach ( $screens as $screen ) {\n\n\t\t add_meta_box(\n\t\t 'vdsl_sectionid',\n\t\t __( 'Store Infos', 'vdsl' ),\n\t\t 'vdsl_metabox_callback',\n\t\t $screen\n\t\t );\n\n\t\t}\n\t}",
"public function add_meta_box() {\n\t\tadd_meta_box( $this->id, $this->title, array($this, 'render'), $this->post_types, $this->context, $this->priority );\n\t}",
"function add_page_item_data() {\n\t$screens = array( 'page' );\n\tforeach ( $screens as $screen ) {\n\t\tadd_meta_box(\n\t\t\t'page_sectionid',\n\t\t\t__( 'Page Metabox' ),\n\t\t\t'page_custom_box',\n\t\t\t$screen\n\t\t);\n\t}\n}",
"public function metaboxes() {\n\t\t\n\t}",
"public static function add_mlm_meta_box()\n\t{\n\t\tglobal $post;\n\t\t\n\t\t$is_members_only = get_post_meta( $post->ID, '_mlm_is_members_only', true );\n\t\t$is_nonmembers_only = get_post_meta( $post->ID, '_mlm_is_nonmembers_only', true );\n\t\t\n\t\tif ( $post->post_type == 'post' ) {\n\t\t\t$mlm_default_post_state = get_option( 'mlm_default_post_state', 'public' );\n\t\t} else {\n\t\t\t$mlm_default_post_state = get_option( 'mlm_default_page_state', 'public' );\n\t\t}\n\t\t\n\t\tif ( $is_members_only == 'true' || ( $post->post_status == 'auto-draft' && $mlm_default_post_state == 'members' ) ) {\n\t\t\t$is_members_only = 'checked=\"checked\"';\n\t\t}\n\n\t\tif ( $is_nonmembers_only == 'true' || ( $post->post_status == 'auto-draft' && $mlm_default_post_state == 'nonmembers' ) ) {\n\t\t\t$is_nonmembers_only = 'checked=\"checked\"';\n\t\t}\n\t\t\n\t\t$mlm_show_in_search = get_post_meta( $post->ID, '_mlm_show_in_search', true );\n\t\t$mlm_show_excerpt_in_search = get_post_meta( $post->ID, '_mlm_show_excerpt_in_search', true );\n\t\t$pass_to_children = get_post_meta( $post->ID, '_mlm_pass_to_children', true );\n\n\t\t//include( dirname( __FILE__ ) . '/templates/meta_box.php' );\n\t}",
"function add_meta_boxes() {\n\n\t\tglobal $metaboxes;\n\n$metaboxes = array( \n\t'portfolio' => array(\n\t\t\t'id' => 'slider_meta_box',\n\t\t\t'title' => 'Page Layout',\n\t\t\t'page' => 'page',\n\t\t\t'context' => 'normal',\n\t\t\t'priority' => 'high',\n\t\t\t'fields' => array(\n\t\t\t\t\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'Text',\n\t\t\t\t\t\t'desc' => '',\n\t\t\t\t\t\t'id' => 'text1',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'std' => '',\n\t\t\t\t\t\t'options' => array('Right' =>'rsidebar','Left' => 'lsidebar','None'=>'full')),//endfield\t\t\t\t\t\n\t\t\t\t\tarray(\t\n\t\t\t\t\t\t'name' => 'Textarea',\n\t\t\t\t\t\t'desc' => '',\n\t\t\t\t\t\t'id' => 'textarea2',\n\t\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t\t'std' => '',\n\t\t\t\t\t\t'options' => array('Right' =>'rsidebar','Left' => 'lsidebar','None'=>'full')),//endfield\n\t\t\t\t\t\t\t\t\tarray(\t\n\t\t\t\t\t\t'name' => 'Date',\n\t\t\t\t\t\t'desc' => '',\n\t\t\t\t\t\t'id' => 'date2',\n\t\t\t\t\t\t'type' => 'date',\n\t\t\t\t\t\t'std' => '',\n\t\t\t\t\t\t'options' => array('Right' =>'rsidebar','Left' => 'lsidebar','None'=>'full')),//endfield\n\t\t\t\t\t\t\t\t\tarray(\t\n\t\t\t\t\t\t'name' => 'Editor',\n\t\t\t\t\t\t'desc' => '',\n\t\t\t\t\t\t'id' => 'editor2',\n\t\t\t\t\t\t'type' => 'editor',\n\t\t\t\t\t\t'std' => '',\n\t\t\t\t\t\t'options' => array('Right' =>'rsidebar','Left' => 'lsidebar','None'=>'full')),//endfield\n\t\t\t\t\t\t\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'Select',\n\t\t\t\t\t\t'desc' => '',\n\t\t\t\t\t\t'id' => 'radio2',\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'std' => '',\n\t\t\t\t\t\t'options' => array('Right' =>'rsidebar','Left' => 'lsidebar','None'=>'full')),//endfield\n\t\t\t\t\t\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t'name' => 'Radio2',\n\t\t\t\t\t\t'desc' => '',\n\t\t\t\t\t\t'id' => 'rrrr',\n\t\t\t\t\t\t'type' => 'radio',\n\t\t\t\t\t\t'std' => '',\n\t\t\t\t\t\t'options' => array('radd2' => 'radd2', 'raddd333' => 'raddd333' , '3arraa' => '3arraa')),//endfield\n\t\t\t\t\t\n\n\t\t\t\t\t\t// array(\n\t\t\t\t\t\t// \t'name' => 'Sidebar',\n\t\t\t\t\t\t// \t'desc' => '',\n\t\t\t\t\t\t// \t'id' => 'selected_sidebar',\n\t\t\t\t\t\t// \t'type' => 'sidebars',\n\t\t\t\t\t\t// \t'std' => '',\n\t\t\t\t\t\t// \t'options' => $sic_sidebars, \t\n\t\t\t\t\t\t// \t\t\t\t),//endfield\n\t\t\t\t\n\t\t\t\t),//end fields\n\t\t\t\t),//end portfolio\t\t\n);//end primary array\n\t\n\t//loops through each metabox and value uses show_the_meta_box to display fields\n\t\tforeach ($metaboxes as $metabox => $values) {\n\t\n\t\t\t\t\tadd_meta_box(\n\t\t\t\t\t\t\t\t$values['id'], \n\t\t\t\t\t\t\t\t$values['title'], \n\t\t\t\t\t\t\t\t'show_the_meta_box', \n\t\t\t\t\t\t\t\t$values['page'], \n\t\t\t\t\t\t\t\t$values['context'], \n\t\t\t\t\t\t\t\t$values['priority'], \n\t\t\t\t\t\t\t\t$values['fields']);\n\n\t\t}//add_meta_box( $id, $title, $callback, $page, $context, $priority, $callback_args );\n\t\n\t\n\t//displays the form fields in all of the newly formed meta boxes\n\tfunction show_the_meta_box ($post, $metabox) {\n\t\t\tglobal $forms;\n\n\n\t\techo '<form><input type=\"hidden\" name=\"meta_box_nonce\" value=\"', wp_create_nonce(basename(__FILE__)), '\" />';\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\tforeach ($metabox['args'] as $key => $field) {\n\t\t\n\t\t\t\t// get current post meta data\n\t\t\t\t$meta = get_post_meta($post->ID, $field['id'], true);\n\t\t\nif($field['type'] == 'radio'){\n\t\nif($field['options'][$meta] != \"\"){\n\n$field['std'] = $meta;\nvar_dump($field['options']);\n\t\t $forms->getField( $field['type'], array('id' => $field['id'], 'value' => 'new-value', 'options' => $field['options']));\n\n\n}\n\n}\t\t\t\t\nelse{\n\t\t $forms->getField( $field['type'], array('id' => $field['id'], 'value' => $meta ? $meta : $field['std'], 'options' => $field['options']));\n}\n\t\techo '<form>';\n\n// \t\t\t\tswitch ($field['type']) {\n\t\t\t\n\n// \t\t\t\t//If Text\t\t\n// \t\t\tcase 'text':\n// \t\t\techo '<input type=\"text\" name=\"', $field['id'], '\" id=\"datepicker\" value=\"', $meta ? $meta : $field['std'], '\" size=\"30\" style=\"width:97%\" />',\n// \t\t\t\t\t'<br />', $field['desc'];\n// \t\t\t\tbreak;\n\t\t\t\n\n\n\n// //If Text Area\t\t\t\n// \t\t\tcase 'textarea':\n// \t\t\t\techo '<textarea name=\"', $field['id'], '\" id=\"', $field['id'], '\" cols=\"60\" rows=\"4\" style=\"width:97%\">', $meta ? $meta : $field['std'], '</textarea>',\n// \t\t\t\t\t'<br />', $field['desc'];\n// \t\t\t\tbreak;\n\t\t\t\t\n// \t\t\t\tcase 'rich_textarea':\n\t\t\t\t\n// \t\t\t\tif (function_exists('wp_tiny_mce'))\n// \t\t\t\t wp_tiny_mce(false, array(\n// \t\t\t\t 'mode' => 'exact',\n// \t\t\t\t 'elements' => $field[id],\n// \t\t\t\t 'height' => 200,\n// \t\t\t\t 'plugins' => 'inlinepopups,wpdialogs,wplink,media,wpeditimage,wpgallery,paste,tabfocus',\n// \t\t\t\t 'forced_root_block' => false,\n// \t\t\t\t 'force_br_newlines' => true,\n// \t\t\t\t 'force_p_newlines' => false,\n// \t\t\t\t 'convert_newlines_to_brs' => true\n// \t\t\t\t ));\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n// \t\t\t\t\t\t\techo '<div id=\"editorcontainer\"><textarea id=\"' . $field['id'] . '\" name=\"' . $field['id'] .'\" cols=\"60\" rows=\"5\" style=\"width:100%; height: 200px\">' . $field['id'] . '</textarea> </div>';\n\t\t\t\t\n// \t\t\t\t\tbreak;\n\t\t\t\n\t\t\t\n// //If Drop Down\t\t\n// \t\t\tcase 'select':\n// \t\t\t\techo '<select name=\"', $field['id'], '\" id=\"', $field['id'], '\">';\n// \t\t\t\tforeach ($field['options'] as $option => $value) {\n// \t\t\t\t\techo '<option', $meta == $option ? ' selected=\"selected\"' : '', '>', $option, '</option>';\n// \t\t\t\t}\n// \t\t\t\techo '</select>';\n// \t\t\t\tbreak;\n\t\t\t\n// \t//If Drop Down\t\t\n// \t\t\tcase 'sidebars':\n// \t\t\t\techo '<select name=\"', $field['id'], '\" id=\"', $field['id'], '\">';\n// \t\t\t\techo '<option>Default</option>';\n// \t\t\t\tforeach ($field['options'] as $option => $value) {\n// \t\t\t\t\techo '<option', $meta == $value ? ' selected=\"selected\"' : '', '>', $value, '</option>';\n// \t\t\t\t}\n// \t\t\t\techo '</select>';\n// \t\t\t\tbreak;\n\t\t\t\t\n// //If Radio\t\t\t\n\t\t\t\t\n// \t\t\tcase 'radio':\n// \t\t\t\tforeach ($field['options'] as $option => $value) {\n// \t\t\t\t\techo '<input type=\"radio\" name=\"' . $field['id'] . '\" value=\"', $value , '\"', $meta == $value ? ' checked=\"checked\"' : '', ' />', $option . \"<br />\";\n// \t\t\t\t}\n// \t\t\t\tbreak;\n\t\t\t\n\t\t\t\n// //If Checkbox\t\t\n\t\t\t\n// \t\t\tcase 'checkbox':\n// \t\t\t\techo '<input type=\"checkbox\" name=\"', $field['id'], '\" id=\"', $field['id'], '\"', $meta ? ' checked=\"checked\"' : '', ' />';\n// \t\t\t\tbreak;\n\t\t\t\t\n// //If Button\t\t\t\t\n// \t\t\t\tcase 'button':\n// \t\t\t\techo '<input type=\"button\" name=\"', $field['id'], '\" id=\"', $field['id'], '\"value=\"', $meta ? $meta : $field['std'], '\" /><br />';\n// \t\t\t\tbreak;\n\t\t\t\t\n// \t\t\t\t//If Button\t\t\t\t\n// \t\t\t\tdefault:\n// \t\t\t\tdo_action(\"form_\" . $field['type'], $field);\n\t\t\t\t\n// \t\t\t\tbreak;\n// \t\t}\n// \t\techo \t'<td>',\n// \t\t\t'</tr>';\n\t\n\t}\n\n\t echo '</table>';\n\n\n}\t}",
"function houzez_listing_layout_metabox_tab( $metabox_tabs ) {\n\tif ( is_array( $metabox_tabs ) ) {\n\n\t\t$metabox_tabs['listing_layout'] = array(\n\t\t\t'label' => houzez_option('cls_layout', 'Layout'),\n 'icon' => 'dashicons-laptop',\n\t\t);\n\n\t}\n\treturn $metabox_tabs;\n}",
"function add_meta_boxes() {\n\tadd_meta_box(\n\t\t'schemify',\n\t\t_x( 'Structured Data', 'meta box title', 'schemify' ),\n\t\t__NAMESPACE__ . '\\meta_box_cb',\n\t\t'post'\n\t);\n}",
"public static function add_meta_boxes() {\n\t\tadd_meta_box( self::VALIDATION_ERRORS_META_BOX, __( 'Validation Errors', 'amp' ), array( __CLASS__, 'print_validation_errors_meta_box' ), self::POST_TYPE_SLUG, 'normal' );\n\t\tadd_meta_box( self::STATUS_META_BOX, __( 'Status', 'amp' ), array( __CLASS__, 'print_status_meta_box' ), self::POST_TYPE_SLUG, 'side' );\n\t}",
"public function add_meta_boxes() {\n foreach ( $this->sliders as $page => $args ) {\n add_meta_box(\n 'page-slider_' . $page, // $id\n __('Slider', 'wpzoom'), // $title\n array( $this, 'show_metabox' ), // $callback\n $page, // $page\n 'normal', // $context\n 'high', // $priority\n $args\n );\n }\n }",
"function add_multiple_meta_boxes()\n{\n add_meta_box('creatives_meta_box',\n 'Creatives',\n 'display_creatives_meta_box',\n 'productions', 'normal', 'high');\n\n add_meta_box('date_rage_meta_box',\n 'Date Range',\n 'display_date_range_meta_box',\n 'productions', 'normal', 'high');\n\n add_meta_box('partners_credits_meta_box',\n 'Credits',\n 'display_partners_credits_meta_box',\n 'productions', 'normal', 'high');\n\n add_meta_box('awards_meta_box',\n 'Awards',\n 'display_awards_meta_box',\n 'productions', 'normal', 'high');\n\n add_meta_box('reviews_meta_box',\n 'Reviews',\n 'display_reviews_meta_box',\n 'productions', 'normal', 'high');\n\n}",
"public function add_meta_box(){\n\t\t\t\n\t\tadd_meta_box(\n\t\t\t'el_archive_page_menu_metabox',\n\t\t\t__('Archive Pages', 'archive-pages-to-menu'),\n\t\t\tarray($this, 'display_meta_box'),\n\t\t\t'nav-menus',\n\t\t\t'side',\n\t\t\t'low'\n\t\t);\n\t}",
"public static function register_meta_boxes()\n {\n $data = array(\n 'title' => 'Title'\n ,'description' => 'Description'\n ,'capability' => 'Capability'\n ,'role' => 'Role'\n ,'order' => 'Order'\n ,'new' => 'New'\n ,'id' => 'ID'\n ,'slug' => 'Slug'\n );\n\n piklist::process_parts('media', $data, array('piklist_media', 'register_meta_boxes_callback'));\n }",
"function metabox() {\n\t\t$this->print_nonce();\n?>\t<p>\n<?php\t\t$this->print_menu_select( $this->field_name, genesis_get_custom_field( $this->field_name ), 'width: 99%;' ); ?>\n\t</p>\n<?php\t}",
"function add_meta_box($title, $form_fields = array()){\n\t \t$post_type_name = $this->post_type_name;\n\t\n\t // end update_edit_form\n\t add_action('post_edit_form_tag', function(){\n\t echo 'enctype=\"multipart/form-data\"';\n\t });\n\t\n\t\n\t // At WordPress' admin_init action, add any applicable metaboxes.\n\t $this->admin_init(function() use($title, $form_fields, $post_type_name)\n\t {\n\t add_meta_box(\n\t strtolower(str_replace(' ', '_', $title)), // id\n\t $title, // title\n\t function($post, $data)\n\t { // function that displays the form fields\n\t global $post;\n\t\n\t wp_nonce_field(plugin_basename(__FILE__), 'docothemes_nonce');\n\t\n\t // List of all the specified form fields\n\t $inputs = $data['args'][0];\n\t\n\t // Get the saved field values\n\t $meta = get_post_custom($post->ID);\n\t\n\t // For each form field specified, we need to create the necessary markup\n\t // $name = Label, $type = the type of input to create\n\t foreach ($inputs as $name => $type) {\n\t #'Happiness Info' in 'Snippet Info' box becomes\n\t # snippet_info_happiness_level\n\t $id_name = $data['id'] . '_' . strtolower(str_replace(' ', '_', $name));\n\t\n\t if (is_array($inputs[$name])) {\n\t // then it must be a select or file upload\n\t // $inputs[$name][0] = type of input\n\t\n\t if (strtolower($inputs[$name][0]) === 'select') {\n\t // filter through them, and create options\n\t $select = \"<select name='$id_name' class='widefat'>\";\n\t foreach ($inputs[$name][1] as $option) {\n\t // if what's stored in the db is equal to the\n\t // current value in the foreach, that should\n\t // be the selected one\n\t\n\t if (isset($meta[$id_name]) && $meta[$id_name][0] == $option) {\n\t $set_selected = \"selected='selected'\";\n\t } else $set_selected = '';\n\t\n\t $select .= \"<option value='$option' $set_selected> $option </option>\";\n\t }\n\t $select .= \"</select>\";\n\t array_push($_SESSION['taxonomy_data'], $id_name);\n\t }\n\t }\n\t\n\t // Attempt to set the value of the input, based on what's saved in the db.\n\t $value = isset($meta[$id_name][0]) ? $meta[$id_name][0] : '';\n\t\n\t $checked = ($type == 'checkbox' && !empty($value) ? 'checked' : '');\n\t\n\t // Sorta sloppy. I need a way to access all these form fields later on.\n\t // I had trouble finding an easy way to pass these values around, so I'm\n\t // storing it in a session. Fix eventually.\n\t array_push($_SESSION['taxonomy_data'], $id_name);\n\t\n\t // TODO - Add the other input types.\n\t $lookup = array(\n\t \"text\" => \"<input type='text' name='$id_name' value='$value' class='widefat' />\",\n\t \"textarea\" => \"<textarea name='$id_name' class='widefat' rows='10'>$value</textarea>\",\n\t \"checkbox\" => \"<input type='checkbox' name='$id_name' value='$name' $checked />\",\n\t \"select\" => isset($select) ? $select : '',\n\t \"file\" => \"<input type='file' name='$id_name' id='$id_name' />\"\n\t );\n\t ?>\n\t\n\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t<label><?php echo ucwords($name) . ':'; ?></label>\n\t\t\t\t\t\t\t\t<?php echo $lookup[is_array($type) ? $type[0] : $type]; ?>\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<p>\n\t\n\t\t\t\t\t\t\t\t\t<?php\n\t // If a file was uploaded, display it below the input.\n\t $file = get_post_meta($post->ID, $id_name, true);\n\t if ( $type === 'file' ) {\n\t // display the image\n\t $file = get_post_meta($post->ID, $id_name, true);\n\t\n\t $file_type = wp_check_filetype($file);\n\t $image_types = array('jpeg', 'jpg', 'bmp', 'gif', 'png');\n\t if ( isset($file) ) {\n\t if ( in_array($file_type['ext'], $image_types) ) {\n\t echo \"<img src='$file' alt='' style='max-width: 400px;' />\";\n\t } else {\n\t echo \"<a href='$file'>$file</a>\";\n\t }\n\t }\n\t }\n\t ?>\n\t\t\t\t\t\t\t\t</p>\n\t\n\t\t\t\t\t\t\t\t<?php\n\t\n\t }\n\t },\n\t $post_type_name, // associated post type\n\t 'normal', // location/context. normal, side, etc.\n\t 'default', // priority level\n\t array($form_fields) // optional passed arguments.\n\t ); // end add_meta_box\n\t });\n\n\t\t}",
"function metaboxes() {\n\t\tadd_meta_box('footer_metabox', 'Footer', array( $this, 'footer_metabox' ), $this->pagehook, 'main', 'high');\n\t}",
"function page_menu_add_meta_box() {\r\n add_meta_box(\r\n\t\t'page_menu_sectionid', //id\r\n\t\t__('Custom menu', 'cmp'), //title\r\n\t\t'page_menu_meta_box_callback', //collback\r\n\t\t'page', // screen\r\n\t\t'side'\r\t);\r\n}",
"public function add_meta_box() \n\t\t{\n\t\t\tforeach($this->metaoption['screen'] as $screen) \n\t\t\t{\n\t\t\t\tadd_meta_box( $this->metaoption['panelid'] , \n\t\t\t\t\t$this->metaoption['pagetitle'] , \n\t\t\t\t\tarray(&$this, 'display'),\n\t\t\t\t\t$screen,\n\t\t\t\t\t$this->metaoption['context'],\n\t\t\t\t\t$this->metaoption['priority']);\n\t\t\t}\n\t\t}"
] | [
"0.6342935",
"0.6280943",
"0.62047184",
"0.6204713",
"0.614517",
"0.61429715",
"0.6127156",
"0.61054575",
"0.6095158",
"0.60682905",
"0.6052304",
"0.6048301",
"0.6040204",
"0.59940606",
"0.59905183",
"0.59857345",
"0.5980588",
"0.5962519",
"0.5951676",
"0.5908558",
"0.59017116",
"0.5851984",
"0.582445",
"0.58234274",
"0.5820885",
"0.5819722",
"0.5819717",
"0.580698",
"0.5804407",
"0.5803091"
] | 0.7038637 | 0 |
Da los items de compra que el usuario dado ha comprado | function dar_items_compra_usuario($id_usuario) {
$this->db->escape($id_usuario);
$query = $this->db->query('
select tbl1.*, cr.refVenta from
(select cc.id_carrito_compra, fecha, cantidad, nombre as titulo, cc.id_usuario from carritos_compras cc
join carritos_compras_autopartes cca on cc.id_carrito_compra = cca.id_carrito_compra
join autopartes a on a.id_autoparte = cca.id_autoparte
union
select cc.id_carrito_compra, fecha, cantidad, titulo, cc.id_usuario from carritos_compras cc
join carritos_compras_ofertas cco on cc.id_carrito_compra = cco.id_carrito_compra
join oferta o on o.id_oferta = cco.id_oferta) as tbl1
join carritos_refVentas cr on cr.id_carritos_compras = tbl1.id_carrito_compra
where tbl1.id_usuario = ' . $id_usuario . '
order by fecha desc');
return $query->result();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dar_items_compras_usuarios() {\r\n $query = $this->db->query('\r\n select tbl1.*, cr.refVenta from\r\n (select cc.id_carrito_compra, fecha, cantidad, nombre as titulo, cc.id_usuario, \"Autoparte\" as tipo, cca.precio from carritos_compras cc\r\n join carritos_compras_autopartes cca on cc.id_carrito_compra = cca.id_carrito_compra\r\n join autopartes a on a.id_autoparte = cca.id_autoparte\r\n union\r\n select cc.id_carrito_compra, fecha, cantidad, titulo, cc.id_usuario, \"Oferta\" as tipo, o.precio from carritos_compras cc\r\n join carritos_compras_ofertas cco on cc.id_carrito_compra = cco.id_carrito_compra\r\n join oferta o on o.id_oferta = cco.id_oferta) as tbl1\r\n join carritos_refVentas cr on cr.id_carritos_compras = tbl1.id_carrito_compra\r\n order by fecha desc');\r\n return $query->result();\r\n }",
"public function usuariosBloqueados()\n\t{\n\t\t$busqueda = trim(\\Input::get('busqueda'));\n\t\t#estado 2 esquivalente a desactivado\n\t\t$estado = 2;\n\n\t\t$textobuscado=\"\";\n\n\t\tif ($busqueda == \"\")\n\t\t{\n\t\t\t// si el input de busqueda está vacio no es necesario realizar acciones \n\t\t}\n\t\telse if ($busqueda != \"\")\n\t\t{\n\t\t\t$textobuscado = $busqueda;\n\t\t\t//$usuarios = $this->usuarioRepo->busquedaUsuariosPorNombre($busqueda, $estado);\n\t\t\t\n\t\t\t$cuentas = $this->cuentaRepo->busquedaCuentasPorCorreoEstado($busqueda, $estado);\n\n\t\t\t# sizeof devuelve el tamaño del argumento recibido\n\t\t\tif (sizeof($cuentas) == 0)\n\t\t\t{\n\t\t\t\treturn \\Redirect::route('lista.usuarios.bloqueados')->with('status_nohaycoincidencias',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'No hay resultados de búsqueda \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t para '.$textobuscado);\n\t\t\t}\n\t\t\t\n\t\t\treturn \\View::make('modulos.super.listausuariosbloqueados', \n\t\t\t\t\t\t\t\t\tcompact('cuentas','textobuscado', 'rolenvista')\n\t\t\t\t\t\t);\n\t\t}\n\n\t\t$cuentas = $this->cuentaRepo->cuentasBloqueadas();\n\n\t\treturn \\View::make('modulos.super.listausuariosbloqueados', \n\t\t\t\t\t\t\tcompact('cuentas','textobuscado', 'rolenvista')\n\t\t\t\t);\n\t}",
"public function usuariosActivos()\n\t{\n\t\t$busqueda = trim(\\Input::get('busqueda'));\n\t\t$estado = 1;\n\n\t\t$textobuscado=\"\";\n\n\t\tif ($busqueda == \"\")\n\t\t{\n\t\t\t// si el input de busqueda está vacio no es necesario realizar acciones \n\t\t}\n\t\telse if ($busqueda != \"\")\n\t\t{\n\t\t\t$textobuscado = $busqueda;\n\t\t\t//$usuarios = $this->usuarioRepo->busquedaUsuariosPorNombre($busqueda, $estado);\n\t\t\t\n\t\t\t$cuentas = $this->cuentaRepo->busquedaCuentasPorCorreoEstado($busqueda, $estado);\n\n\t\t\t# sizeof devuelve el tamaño del argumento recibido\n\t\t\tif (sizeof($cuentas) == 0)\n\t\t\t{\n\t\t\t\treturn \\Redirect::route('lista.usuarios.activos')->with('status_nohaycoincidencias', \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'No hay resultados de búsqueda \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t para '.$textobuscado);\n\t\t\t}\n\t\t\t\n\t\t\treturn \\View::make('modulos.super.listausuariosactivos', \n\t\t\t\t\t\t\t\t\tcompact('cuentas','textobuscado', 'rolenvista')\n\t\t\t\t\t\t);\n\t\t}\n\n\t\t$cuentas = $this->cuentaRepo->cuentasActivas();\n\n\t\treturn \\View::make('modulos.super.listausuariosactivos', \n\t\t\t\t\t\t\tcompact('cuentas','textobuscado', 'rolenvista')\n\t\t\t\t);\n\t}",
"function listarUniConsComp(){\n\t\t$this->procedimiento='gem.f_uni_cons_comp_sel';\n\t\t$this->transaccion='GEM_UCC_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_comp_equipo','int4');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('opcional','varchar');\n\t\t$this->captura('id_uni_cons_padre','int4');\n\t\t$this->captura('cantidad','int4');\n\t\t$this->captura('id_uni_const_hijo','int4');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function get_userItem()\n {\n\n $verificacion = $this->get_userVerify();\n\n if ($verificacion == true ) // Si verificiación es positiva\n {\n\n $item_data = Model_items::find('all'); // Hacemos return a todos los Items\n return $item_data;\n\n }\n else\n {\n\n return $this->codeInfo($code = 404, $mensaje = 'Nada encontrado, revise los datos introducidos o vuelva a intentarlo');\n\n }\n }",
"public function multitablas_comprobantes_nota_credito_boletas() {\n $resultados = $this->db->query(\"\n SELECT id_tcomprobante,codigo,nombre,serie,num_comprobante+1 AS num_comprobante \n FROM tipo_comprobantes \n WHERE id_tcomprobante='5' AND nombre='Nota Credito' AND descripcion='Boleta'\");\n return $resultados->result();\n }",
"public function comboUsuario()\n\t\t\t{\n\t\t\t\t$sql = \"select * from tb_usuarios\";\n\t\t\t\t$res = mysql_query($sql,Conectar::conecta());\n\t\t\t\twhile($reg = mysql_fetch_assoc($res))\n\t\t\t\t{\n\t\t\t\t\t$this->datos[] = $reg;\n\t\t\t\t\t}\n\t\t\t\t\treturn $this->datos;\n\t\t\t\t}",
"public function listadoActividadesUsuariosInscripcion()\n {\n // Almacenamos en el array 'parametros[]'los valores que vamos a mostrar en la vista\n $parametros = [\n \"tituloventana\" => \"Base de Datos con PHP y PDO\",\n \"datos\" => NULL,\n \"mensajes\" => []\n ];\n // Realizamos la consulta y almacenamos los resultados en la variable $resultModelo\n $resultModelo = $this->modelo->listadoHorario();\n // Si la consulta se realizó correctamente transferimos los datos obtenidos\n // de la consulta del modelo ($resultModelo[\"datos\"]) a nuestro array parámetros\n // ($parametros[\"datos\"]), que será el que le pasaremos a la vista para visualizarlos\n if ($resultModelo[\"correcto\"]) :\n \n $parametros[\"datos\"] = $resultModelo[\"datos\"];\n //Definimos el mensaje para el alert de la vista de que todo fue correctamente\n $this->mensajes[] = [\n \"tipo\" => \"success\",\n \"mensaje\" => \"El listado se realizó correctamente\"\n ];\n else :\n //Definimos el mensaje para el alert de la vista de que se produjeron errores al realizar el listado\n $this->mensajes[] = [\n \"tipo\" => \"danger\",\n \"mensaje\" => \"El listado no pudo realizarse correctamente!! :( <br/>({$resultModelo[\"error\"]})\"\n ];\n endif;\n //Asignamos al campo 'mensajes' del array de parámetros el valor del atributo \n //'mensaje', que recoge cómo finalizó la operación:\n $parametros[\"mensajes\"] = $this->mensajes;\n // Incluimos la vista en la que visualizaremos los datos o un mensaje de error\n $this->view->show(\"UserHorarioReservas\", $parametros);\n \n }",
"public function getUsuarios(){ // va\n $sentencia = $this->db->prepare('SELECT * FROM usuarios ORDER BY id_usuario ASC');\n $sentencia->execute();\n\n return $sentencia->fetchAll(PDO::FETCH_OBJ);\n }",
"function buscar_nivel_item_actividad($id_documento, $id_seccion, $mes='NULL', $anio='NULL')\n {\n $data=$this->seguridad_model->consultar_permiso($this->session->userdata('id_usuario'),Dcumplimiento); \n if($data['id_permiso']!=\"\") { \n $this->db->trans_start();\n\n if($mes=='NULL') {\n $mes=date('m', (strtotime (\"-15 day\")));//Cambio de dias habiles\n }\n\n if($anio=='NULL') {\n $anio=date('Y', (strtotime (\"-15 day\"))); //Cambio de dias habiles\n }\n\n $data['items']=$this->monitoreo_model->buscar_nivel_item_actividad($id_documento, $id_seccion, $data['id_permiso'], $mes, $anio); \n\n $this->db->trans_complete();\n $tr=($this->db->trans_status()===FALSE)?0:1;\n $json =array(\n 'resultado'=>$tr,\n 'tabla'=>$data['items']\n );\n echo json_encode($json);\n }\n else {\n $json =array(\n 'resultado'=>0\n );\n echo json_encode($json);\n }\n }",
"public static function TraerTodos(){\n \n $retorno=false;\n $objCon=new Conexion();\n $conexion=$objCon->GetConexion();\n $sentencia=$conexion->prepare('SELECT * FROM usuarios');\n $sentencia->execute();\n \n if($sentencia->rowCount()>0){\n $retorno=$sentencia->fetchAll(PDO::FETCH_ASSOC);\n }\n\n return $retorno;\n }",
"public function getUserByRequerimiento()\n {\n $users = collect([]);\n\n $centro = $this->centro()->firstOrFail();\n $centroUser = $centro->users()->firstOrFail();\n $users->push($centroUser);\n\n $empresa = $centro->empresa()->firstOrFail();\n $empresaUser = $empresa->users()->firstOrFail();\n $users->push($empresaUser);\n\n $compassUsers = \\App\\User::whereHasMorph(\n 'userable',\n ['App\\CompassRole'],\n function ($query) {\n $query->where('name', 'like', 'Compras')->orWhere('name', 'like', 'Despacho');\n }\n )->get();\n foreach ($compassUsers as $user) {\n $users->push($user);\n }\n\n return $users;\n }",
"static function getUserItems() {\n\t\t$id = Users::getUser();\n\t\t\n\t\t$id = parent::escape($id, \"sql\");\n\t\t\n\t\t$data = parent::query(\"SELECT *\n\t\t\t\t\t\t\t\tFROM `user_objects`\n\t\t\t\t\t\t\t\tWHERE `user_id` = '$id'\n\t\t\t\t\t\t\t\tAND `approve` = '1'\n\t\t\t\t\t\t\t\");\n\t\t\t\t\t\t\t\n\t\treturn $data;\n\t}",
"public function getListActivar()\n {\n\n $sql = \"SELECT cod_distribuidor\n FROM distribuidor\n WHERE distribuidor.cod_estado = 2\n \";\n $list = array();\n if (!$resultado = pg_query($this->conexion, $sql)) die();\n while ($row = pg_fetch_array($resultado)) {\n $item = new Distribuidor();\n $item->setCod_distribuidor($row[0]);\n \n array_push($list, $item);\n\n }\n return $list;\n\n }",
"function aCargarPuestosClonarUsuario($datos) {\n $oLPermisos = new LPermisos();\n $o_TablaHtmlx = new tablaDHTMLX();\n\n /* $arrayFilas[0][0] = $datos['idPuestoEmpleado']; //para cargar la informacion que ya se tiene en la tabla en un nuevo array para pasarlo a la nueva tabla del mismo formulario\n $arrayFilas[0][1] = $datos['vNombrePuesto'];\n $arrayFilas[0][2] = $datos['bEstados'];\n $arrayFilas[0][3] = $datos['iCodigoEmpleado']; */\n // d.iCodigoEmpleado, e.bEstado,e.iidPuestoEmpleado,f.vNombrePuesto\n\n $arrayFilas = $oLPermisos->lCargarPuestosClonarUsuario($datos);\n\n $arrayCabecera = array(0 => \"Codigo de empleado\", 1 => \"Estado\", 2 => \"Estado\", 3 => \"Puesto del empleado\", 4 => \"codigo Persona\", 5 => \"Nombre sistema\");\n $arrayTamano = array(0 => \"80\", 1 => \"200\", 2 => \"50\", 3 => \"271\", 4 => \"50\", 5 => \"100\");\n $arrayTipo = array(0 => \"ro\", 1 => \"ro\", 2 => \"ro\", 3 => \"ro\", 4 => \"ro\", 5 => \"ro\");\n $arrayCursor = array(0 => \"default\", 1 => \"default\", 2 => \"default\", 3 => \"default\", 4 => \"default\", 5 => \"default\");\n $arrayHidden = array(0 => \"false\", 1 => \"true\", 2 => \"true\", 3 => \"false\", 4 => \"true\", 5 => \"false\");\n $arrayAling = array(0 => \"left\", 1 => \"left\", 2 => \"left\", 3 => \"left\", 4 => \"left\", 5 => \"left\");\n return $o_TablaHtmlx->generaTabla($arrayCabecera, $arrayFilas, $arrayTamano, $arrayTipo, $arrayCursor, $arrayHidden, $arrayAling);\n }",
"static public function ctrMostrarComprasAdquisicion($item, $valor){\r\n\r\n\t\t$tabla = \"compras\";\r\n\r\n\t\t$respuesta = ModeloCompras::mdlMostrarComprasAdquisicion($tabla, $item, $valor);\r\n\r\n\t\treturn $respuesta;\r\n\t}",
"public function obterTodasCompras(){\n $compra = new CompraDAO();\n return $compra->getAll();\n }",
"private function carregarItensOrigemProcessoDeCompras() {\n\n $sWhere = implode(\" and \", array(\n 'ac16_origem = ' . Acordo::ORIGEM_PROCESSO_COMPRAS,\n \"ac26_acordoposicaotipo = \" . AcordoPosicao::TIPO_INCLUSAO,\n \"ac16_dataassinatura >= '2016-05-02'\",\n \"(ac58_acordo is null or ac58_data >= '{$this->oCabecalho->getDataGeracao()->getDate()}')\",\n \"pc24_pontuacao = 1\",\n \"ac16_instit = {$this->oCabecalho->getInstituicao()->getCodigo()}\",\n ));\n\n $oDaoItemProcesso = new cl_solicitemvinculo();\n $sSqlBuscaItens = $oDaoItemProcesso->sql_query_item_licitacon(implode(', ', self::$aCampos), $sWhere);\n $rsBuscaItens = db_query($sSqlBuscaItens);\n if (!$rsBuscaItens) {\n throw new DBException(\"Não foi possível carregar os itens do acordo incluso com origem Processo de Compras.\");\n }\n\n $iTotalRegistros = pg_num_rows($rsBuscaItens);\n for ($iRow = 0; $iRow < $iTotalRegistros; $iRow++) {\n\n $oStdInformacao = db_utils::fieldsMemory($rsBuscaItens, $iRow);\n $this->adicionarItem(self::criarObjetoImpressao($oStdInformacao));\n }\n }",
"public function contarUsuariosConectados(){\n\t\t\t$conn = $this->conexionBD();\n\t\t\t//Consulta con el metodo count() que cuenta el total de los registros\n\t\t\t$sql = \"SELECT count(*) total FROM user WHERE status_id=1\";\n\t\t\t//Ejecutamos la consulta\n\t\t\t$result = $conn->query($sql);\n\t\t\t//Establecemos el array en un auxiliar\n\t\t\t$aux= $result->fetch_assoc();\n\t\t\t//Retornamos el total de registros contados\n\t\t\treturn $aux['total'];\n\t\t}",
"static public function ctrMostrarComprasPedidos($item, $valor){\r\n\r\n\t\t$tabla = \"compras\";\r\n\r\n\t\t$respuesta = ModeloCompras::mdlMostrarComprasPedidos($tabla, $item, $valor);\r\n\r\n\t\treturn $respuesta;\r\n\t}",
"public function getFechasRecompraPorProducto(): ComprasClientes{ \n $comprasCliente = $this->getArrayCompras();\n if(!is_array($comprasCliente)){\n return false;\n }\n //Obtiene todas las fechas de compras por sku\n $comprasPorSku = [];\n foreach($comprasCliente['customer']['purchases'] as $compras){\n foreach($compras['products'] as $atributo){\n $comprasPorSku[$atributo['sku']]['fechas'][] = $compras['date'];\n $comprasPorSku[$atributo['sku']]['name'] = $atributo['name'];\n $comprasPorSku[$atributo['sku']]['sku'] = $atributo['sku'];\n } \n }\n \n $comprasClienteDifFechas = $this->getDifFechasCompras($comprasPorSku);\n $comprasClienteFechasRecompra = $this->getFechasRecompraSku($comprasClienteDifFechas);\n $comprasClientesEntity = new ComprasClientes();\n foreach($comprasClienteFechasRecompra as $compraPorSku){\n $comprasClientesEntity->addComprasClientes(new CompraCliente($compraPorSku)); \n }\n \n return $comprasClientesEntity; \n }",
"public static function getAllCommandes($idUser){\n try{\n\n $q = Model::$pdo->prepare(\"SELECT * FROM projet_commande pc JOIN projet_a_commander pac ON pc.idCommande=pac.idCommande WHERE idUtilisateur=:idUser ORDER BY dateCommande DESC\");\n $q->execute([':idUser' => $idUser]);\n $q->setFetchMode(PDO::FETCH_CLASS, \"Commande\");\n $tab_c = $q->fetchAll();\n\n }catch(PDOException $e){\n if(Conf::getDebug()){\n echo $e->getMessage();\n }else {\n echo 'Une erreur est survenue <a href=\"\"> retour a la page d\\'accueil </a>';\n } \n }\n\n if(empty($tab_c))\n return false;\n return $tab_c;\n\n\n }",
"public function index()\n {\n if (Auth::check()){\n // $produto = Produto::all();\n // $user = User::all();\n // $item = ItemCarrinho::all();\n // $carrinho = Carrinho::all();\n $max = Compra::max('id');\n $item = DB::select('select DISTINCT item_carrinhos.id as id, item_carrinhos.quantia as quantia, item_carrinhos.valorU as valorU, item_carrinhos.valorT as valorT, produtos.nome as pnome, produtos.descricao as descr, produtos.plataforma as plat from item_carrinhos, carrinhos , produtos where produto_id = produtos.id and carrinho_id = ?' , [Auth::user()->id]);\n return view('carrinhos.index',['item'=>$item, 'compra'=>$max]);\n }\n else {\n return redirect()->route('login');\n }\n }",
"public function post_userItemById($id) //Recibo mandando datos con el id de la funcion que es el id que introducimos en postman\n {\n\n $verificacion = $this->get_userVerify();\n\n\n if ($verificacion == true )\n {\n $compra = Model_compra::find('all');\n $user = Model_users2::find('all');\n $players = Model_player::find('all');\n $item = Model_items::find('all');\n $character = Model_personaje::find('all');\n $mina = Model_minas::find('all');\n $granada = Model_granadas::find('all');\n $vida = Model_vida::find('all');\n $muni = Model_municion::find('all');\n $dlc = Model_personaje::find('all');\n $array = [];\n $name = \"\";\n\n if ($id != null){\n \n foreach ($user as $key) {\n\n if($key['id'] == $id)\n {\n \n $name = $key;\n $id = $key['id_jugador'];\n }\n }\n }else{\n return $this->codeInfo($code = 404, $mensaje = 'No existe Item con la Id seleccionada, elije mejor...');\n\n }\n\n foreach ($compra as $key ) {\n \n if($id == $key['id_jugador']){\n foreach ($item as $items)\n {\n\n if ($items['id'] != null && $items['id'] == $key['id_item'] )\n {\n\n if($items['id_personaje'] != null)\n {\n foreach ($character as $characters)\n {\n if($items['id_personaje'] == $characters['id'])\n {\n array_push($array, $characters);\n }\n }\n }\n if($items['id_municion'] != null)\n {\n foreach ($muni as $municion)\n {\n if($items['id_municion'] == $municion['id'])\n {\n array_push($array, $municion);\n }\n }\n }\n if($items['id_DLC'] != null)\n {\n foreach ($dlc as $dl)\n {\n if($items['id_DLC'] == $dl['id'])\n {\n array_push($array, $dl);\n }\n }\n }\n if($items['id_granada'] != null)\n {\n foreach ($granada as $grana)\n {\n if($items['id_granada'] == $grana['id'])\n {\n array_push($array, $grana);\n }\n }\n }\n if($items['id_mina'] != null)\n {\n\n foreach ($mina as $min)\n { \n if($items['id_mina'] == $min['id'])\n { \n array_push($array, $min);\n }\n }\n }\n if($items['id_vida'] != null)\n {\n foreach ($vida as $vid)\n {\n if($items['id_vida'] == $vid['id'])\n {\n array_push($array, $vid);\n \n }\n }\n }\n\n\n }\n else\n {\n\n // if ( $items['id'] == $id )\n // {\n\n // return $this->response(array($users));\n // }\n\n }\n }\n\n }\n } \n\n \n // SI EL ID NO CORRESPONDE A NINGÚN JUGADOR O USUARIO DEVUELVE ESTE MENSAJE:\n //return $this->codeInfo($code = 404, $mensaje = 'No existe Item con la Id seleccionada, elije mejor...');\n\n }\n\n else // Este else es la auteficacion del token que verifica si lo envias o no\n {\n\n return $this->codeInfo($code = 403, $mensaje = 'Error en verificacion sesion');\n }\n return $this->response(array(\"User\"=>$name,\"items\"=>$array));\n\n }",
"public function buscarUsuariosClonarUsuario($datos) {\n $oLPermisos = new LPermisos();\n $o_TablaHtmlx = new tablaDHTMLX();\n $arrayFilas = $oLPermisos->lbuscarUsuariosClonarUsuario($datos);\n $arrayCabecera = array(0 => \"codigo Persona\", 1 => \"loginUsuario\", 2 => \"Nombre de Usuario\", 3 => \"perfil\", 4 => \"Nombre sistema\", 5 => \"id sistema\", 6 => \"iCodigoEmpleado\", 7 => \"bEstado\", 8 => \"idPuestoEmpleado\", 9 => \"NombrePuesto\");\n $arrayTamano = array(0 => \"50\", 1 => \"80\", 2 => \"200\", 3 => \"50\", 4 => \"100\", 5 => \"30\", 6 => \"80\", 7 => \"80\", 8 => \"80\", 9 => \"250\");\n $arrayTipo = array(0 => \"ro\", 1 => \"ro\", 2 => \"ro\", 3 => \"ro\", 4 => \"ro\", 5 => \"ro\", 6 => \"ro\", 7 => \"ro\", 8 => \"ro\", 9 => \"ro\");\n $arrayCursor = array(0 => \"default\", 1 => \"default\", 2 => \"default\", 3 => \"default\", 4 => \"default\", 5 => \"default\", 6 => \"default\", 7 => \"default\", 8 => \"default\", 9 => \"default\");\n $arrayHidden = array(0 => \"false\", 1 => \"false\", 2 => \"false\", 3 => \"true\", 4 => \"false\", 5 => \"true\", 6 => \"true\", 7 => \"true\", 8 => \"true\", 9 => \"false\");\n $arrayAling = array(0 => \"left\", 1 => \"left\", 2 => \"left\", 3 => \"left\", 4 => \"left\", 5 => \"left\", 6 => \"left\", 7 => \"left\", 8 => \"left\", 9 => \"left\");\n return $o_TablaHtmlx->generaTabla($arrayCabecera, $arrayFilas, $arrayTamano, $arrayTipo, $arrayCursor, $arrayHidden, $arrayAling);\n }",
"public function ControladorProductos()\n {\n // section 10-25-2--51--31a7ca5b:13394855662:-8000:0000000000001136 begin\n $this->miModelo = new ModeloProductos();\t\n\t\t$this->miVista = new VistaGenerica();\t\n\t\t$this->usuario = new Usuario();\n\t\t\n \tif ($this->usuario->isRegistredUser()==null) {\t// No tiene autorización para este controlador\n \theader(\"Location: index.php\");\n }\n \n // var_dump($_SESSION[userRow][id]);\n \n \tif(@$_REQUEST[\"controlador\"]==\"\" || @$_REQUEST[Cancelar]) \t\t// Boton generico cancelar\n\t\t{\n\t\t\t$this->Lista();\n\t\t}\n\t\telse \n\t\t{\n\t\t\tif(@$_REQUEST[\"controlador\"]==\"Buscar\") \t\n\t\t\t\t$this->Buscar();\n\t\t\tif(@$_REQUEST[\"controlador\"]==\"nuevo\")\n\t\t\t\t$this->Alta();\t\t\t\n\t\t\tif(@$_REQUEST[\"controlador\"]==\"editar\")\n\t\t\t\t$this->Editar();\n\t\t\tif(@$_REQUEST[\"controlador\"]==\"borrar\") \n\t\t\t\t$this->Borrar();\n\t\t}\n \n // section 10-25-2--51--31a7ca5b:13394855662:-8000:0000000000001136 end\n }",
"public function mostrar_usuarios() {\n require 'model/ItemModel.php';\n $items = new ItemModel();\n $data['listado'] = $items->mostrarUsuarios();\n $this->view->show(\"vistar_Usuarios_creados.php\", $data);\n }",
"function acargarUsuariosInactivos($idServicio, $idSistema, $idFormulario) {\n $oLPermisos = new LPermisos();\n $o_TablaHtmlx = new tablaDHTMLX();\n $arrayFilas = $oLPermisos->lcargarUsuariosInactivos($idServicio, $idSistema, $idFormulario);\n\n $arrayCabecera = array(0 => \"Id\", 1 => \"Nombre de Usuario\", 2 => \"ID Formulario\", 3 => \"Id Sistema\", 4 => \"Id Persona\", 5 => \"Acción\");\n $arrayTamano = array(0 => \"50\", 1 => \"*\", 2 => \"40\", 3 => \"110\", 4 => \"110\", 5 => \"50\");\n $arrayTipo = array(0 => \"ro\", 1 => \"ro\", 2 => \"ro\", 3 => \"ro\", 4 => \"ro\", 5 => \"img\");\n $arrayCursor = array(0 => \"default\", 1 => \"default\", 2 => \"default\", 3 => \"default\", 4 => \"default\", 5 => \"default\");\n $arrayHidden = array(0 => \"false\", 1 => \"false\", 2 => \"true\", 3 => \"true\", 4 => \"true\", 5 => \"false\");\n $arrayAling = array(0 => \"left\", 1 => \"left\", 2 => \"left\", 3 => \"left\", 4 => \"left\", 5 => \"left\");\n return $o_TablaHtmlx->generaTabla($arrayCabecera, $arrayFilas, $arrayTamano, $arrayTipo, $arrayCursor, $arrayHidden, $arrayAling);\n }",
"public function podpadbuscarUsuariosClonarUsuario() {\n $oLPermisos = new LPermisos();\n require_once(\"../../cvista/permisos/BusquedaClonarUsuario.php\");\n }",
"private function getPermisosBotonera()\n\t{\n\t\t$auth = new Zend_Session_Namespace('veoliaZend_Auth');\n\t\t$rol = Zend_Registry::get('role');\n\t\t$permisos = array();\n\t\t$permisos[\"edit\"] = ($auth->_acl->isAllowed($rol,\"default:aclusuarios\",\"edit\"))? true : false;\n\t\t$permisos[\"add\"] = ($auth->_acl->isAllowed($rol,\"default:aclusuarios\",\"add\"))? true : false;\n\t\t$permisos[\"delete\"] = ($auth->_acl->isAllowed($rol,\"default:aclusuarios\",\"delete\"))? true : false;\n\t\t$permisos[\"password\"] = ($auth->_acl->isAllowed($rol,\"default:aclusuarios\",\"password\"))? true : false;\n\t\t$permisos[\"estado\"] = ($auth->_acl->isAllowed($rol,\"default:aclusuarios\",\"estado\"))? true : false;\n\t\t$permisos[\"detail\"] = ($auth->_acl->isAllowed($rol,\"default:aclusuarios\",\"detail\"))? true : false;\n\t\treturn $permisos;\n\t}"
] | [
"0.65132993",
"0.61611843",
"0.5888522",
"0.57548624",
"0.5702262",
"0.55963355",
"0.55926865",
"0.55769366",
"0.55551183",
"0.55532753",
"0.5543949",
"0.5531217",
"0.5507963",
"0.55004495",
"0.54982615",
"0.5472945",
"0.5472374",
"0.546936",
"0.54575783",
"0.54171014",
"0.54151875",
"0.54104424",
"0.54091966",
"0.54030293",
"0.53953904",
"0.5394245",
"0.53938806",
"0.5393728",
"0.5392687",
"0.5392006"
] | 0.63229257 | 1 |
Da los items de compra que el usuario dado ha comprado | function dar_items_compras_usuarios() {
$query = $this->db->query('
select tbl1.*, cr.refVenta from
(select cc.id_carrito_compra, fecha, cantidad, nombre as titulo, cc.id_usuario, "Autoparte" as tipo, cca.precio from carritos_compras cc
join carritos_compras_autopartes cca on cc.id_carrito_compra = cca.id_carrito_compra
join autopartes a on a.id_autoparte = cca.id_autoparte
union
select cc.id_carrito_compra, fecha, cantidad, titulo, cc.id_usuario, "Oferta" as tipo, o.precio from carritos_compras cc
join carritos_compras_ofertas cco on cc.id_carrito_compra = cco.id_carrito_compra
join oferta o on o.id_oferta = cco.id_oferta) as tbl1
join carritos_refVentas cr on cr.id_carritos_compras = tbl1.id_carrito_compra
order by fecha desc');
return $query->result();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dar_items_compra_usuario($id_usuario) {\r\n $this->db->escape($id_usuario);\r\n $query = $this->db->query('\r\n select tbl1.*, cr.refVenta from\r\n (select cc.id_carrito_compra, fecha, cantidad, nombre as titulo, cc.id_usuario from carritos_compras cc\r\n join carritos_compras_autopartes cca on cc.id_carrito_compra = cca.id_carrito_compra\r\n join autopartes a on a.id_autoparte = cca.id_autoparte\r\n union\r\n select cc.id_carrito_compra, fecha, cantidad, titulo, cc.id_usuario from carritos_compras cc\r\n join carritos_compras_ofertas cco on cc.id_carrito_compra = cco.id_carrito_compra\r\n join oferta o on o.id_oferta = cco.id_oferta) as tbl1\r\n join carritos_refVentas cr on cr.id_carritos_compras = tbl1.id_carrito_compra\r\n where tbl1.id_usuario = ' . $id_usuario . '\r\n order by fecha desc');\r\n return $query->result();\r\n }",
"public function usuariosBloqueados()\n\t{\n\t\t$busqueda = trim(\\Input::get('busqueda'));\n\t\t#estado 2 esquivalente a desactivado\n\t\t$estado = 2;\n\n\t\t$textobuscado=\"\";\n\n\t\tif ($busqueda == \"\")\n\t\t{\n\t\t\t// si el input de busqueda está vacio no es necesario realizar acciones \n\t\t}\n\t\telse if ($busqueda != \"\")\n\t\t{\n\t\t\t$textobuscado = $busqueda;\n\t\t\t//$usuarios = $this->usuarioRepo->busquedaUsuariosPorNombre($busqueda, $estado);\n\t\t\t\n\t\t\t$cuentas = $this->cuentaRepo->busquedaCuentasPorCorreoEstado($busqueda, $estado);\n\n\t\t\t# sizeof devuelve el tamaño del argumento recibido\n\t\t\tif (sizeof($cuentas) == 0)\n\t\t\t{\n\t\t\t\treturn \\Redirect::route('lista.usuarios.bloqueados')->with('status_nohaycoincidencias',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'No hay resultados de búsqueda \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t para '.$textobuscado);\n\t\t\t}\n\t\t\t\n\t\t\treturn \\View::make('modulos.super.listausuariosbloqueados', \n\t\t\t\t\t\t\t\t\tcompact('cuentas','textobuscado', 'rolenvista')\n\t\t\t\t\t\t);\n\t\t}\n\n\t\t$cuentas = $this->cuentaRepo->cuentasBloqueadas();\n\n\t\treturn \\View::make('modulos.super.listausuariosbloqueados', \n\t\t\t\t\t\t\tcompact('cuentas','textobuscado', 'rolenvista')\n\t\t\t\t);\n\t}",
"public function usuariosActivos()\n\t{\n\t\t$busqueda = trim(\\Input::get('busqueda'));\n\t\t$estado = 1;\n\n\t\t$textobuscado=\"\";\n\n\t\tif ($busqueda == \"\")\n\t\t{\n\t\t\t// si el input de busqueda está vacio no es necesario realizar acciones \n\t\t}\n\t\telse if ($busqueda != \"\")\n\t\t{\n\t\t\t$textobuscado = $busqueda;\n\t\t\t//$usuarios = $this->usuarioRepo->busquedaUsuariosPorNombre($busqueda, $estado);\n\t\t\t\n\t\t\t$cuentas = $this->cuentaRepo->busquedaCuentasPorCorreoEstado($busqueda, $estado);\n\n\t\t\t# sizeof devuelve el tamaño del argumento recibido\n\t\t\tif (sizeof($cuentas) == 0)\n\t\t\t{\n\t\t\t\treturn \\Redirect::route('lista.usuarios.activos')->with('status_nohaycoincidencias', \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'No hay resultados de búsqueda \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t para '.$textobuscado);\n\t\t\t}\n\t\t\t\n\t\t\treturn \\View::make('modulos.super.listausuariosactivos', \n\t\t\t\t\t\t\t\t\tcompact('cuentas','textobuscado', 'rolenvista')\n\t\t\t\t\t\t);\n\t\t}\n\n\t\t$cuentas = $this->cuentaRepo->cuentasActivas();\n\n\t\treturn \\View::make('modulos.super.listausuariosactivos', \n\t\t\t\t\t\t\tcompact('cuentas','textobuscado', 'rolenvista')\n\t\t\t\t);\n\t}",
"function listarUniConsComp(){\n\t\t$this->procedimiento='gem.f_uni_cons_comp_sel';\n\t\t$this->transaccion='GEM_UCC_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_comp_equipo','int4');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('opcional','varchar');\n\t\t$this->captura('id_uni_cons_padre','int4');\n\t\t$this->captura('cantidad','int4');\n\t\t$this->captura('id_uni_const_hijo','int4');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function get_userItem()\n {\n\n $verificacion = $this->get_userVerify();\n\n if ($verificacion == true ) // Si verificiación es positiva\n {\n\n $item_data = Model_items::find('all'); // Hacemos return a todos los Items\n return $item_data;\n\n }\n else\n {\n\n return $this->codeInfo($code = 404, $mensaje = 'Nada encontrado, revise los datos introducidos o vuelva a intentarlo');\n\n }\n }",
"public function multitablas_comprobantes_nota_credito_boletas() {\n $resultados = $this->db->query(\"\n SELECT id_tcomprobante,codigo,nombre,serie,num_comprobante+1 AS num_comprobante \n FROM tipo_comprobantes \n WHERE id_tcomprobante='5' AND nombre='Nota Credito' AND descripcion='Boleta'\");\n return $resultados->result();\n }",
"public function comboUsuario()\n\t\t\t{\n\t\t\t\t$sql = \"select * from tb_usuarios\";\n\t\t\t\t$res = mysql_query($sql,Conectar::conecta());\n\t\t\t\twhile($reg = mysql_fetch_assoc($res))\n\t\t\t\t{\n\t\t\t\t\t$this->datos[] = $reg;\n\t\t\t\t\t}\n\t\t\t\t\treturn $this->datos;\n\t\t\t\t}",
"public function listadoActividadesUsuariosInscripcion()\n {\n // Almacenamos en el array 'parametros[]'los valores que vamos a mostrar en la vista\n $parametros = [\n \"tituloventana\" => \"Base de Datos con PHP y PDO\",\n \"datos\" => NULL,\n \"mensajes\" => []\n ];\n // Realizamos la consulta y almacenamos los resultados en la variable $resultModelo\n $resultModelo = $this->modelo->listadoHorario();\n // Si la consulta se realizó correctamente transferimos los datos obtenidos\n // de la consulta del modelo ($resultModelo[\"datos\"]) a nuestro array parámetros\n // ($parametros[\"datos\"]), que será el que le pasaremos a la vista para visualizarlos\n if ($resultModelo[\"correcto\"]) :\n \n $parametros[\"datos\"] = $resultModelo[\"datos\"];\n //Definimos el mensaje para el alert de la vista de que todo fue correctamente\n $this->mensajes[] = [\n \"tipo\" => \"success\",\n \"mensaje\" => \"El listado se realizó correctamente\"\n ];\n else :\n //Definimos el mensaje para el alert de la vista de que se produjeron errores al realizar el listado\n $this->mensajes[] = [\n \"tipo\" => \"danger\",\n \"mensaje\" => \"El listado no pudo realizarse correctamente!! :( <br/>({$resultModelo[\"error\"]})\"\n ];\n endif;\n //Asignamos al campo 'mensajes' del array de parámetros el valor del atributo \n //'mensaje', que recoge cómo finalizó la operación:\n $parametros[\"mensajes\"] = $this->mensajes;\n // Incluimos la vista en la que visualizaremos los datos o un mensaje de error\n $this->view->show(\"UserHorarioReservas\", $parametros);\n \n }",
"function buscar_nivel_item_actividad($id_documento, $id_seccion, $mes='NULL', $anio='NULL')\n {\n $data=$this->seguridad_model->consultar_permiso($this->session->userdata('id_usuario'),Dcumplimiento); \n if($data['id_permiso']!=\"\") { \n $this->db->trans_start();\n\n if($mes=='NULL') {\n $mes=date('m', (strtotime (\"-15 day\")));//Cambio de dias habiles\n }\n\n if($anio=='NULL') {\n $anio=date('Y', (strtotime (\"-15 day\"))); //Cambio de dias habiles\n }\n\n $data['items']=$this->monitoreo_model->buscar_nivel_item_actividad($id_documento, $id_seccion, $data['id_permiso'], $mes, $anio); \n\n $this->db->trans_complete();\n $tr=($this->db->trans_status()===FALSE)?0:1;\n $json =array(\n 'resultado'=>$tr,\n 'tabla'=>$data['items']\n );\n echo json_encode($json);\n }\n else {\n $json =array(\n 'resultado'=>0\n );\n echo json_encode($json);\n }\n }",
"public function getUsuarios(){ // va\n $sentencia = $this->db->prepare('SELECT * FROM usuarios ORDER BY id_usuario ASC');\n $sentencia->execute();\n\n return $sentencia->fetchAll(PDO::FETCH_OBJ);\n }",
"public static function TraerTodos(){\n \n $retorno=false;\n $objCon=new Conexion();\n $conexion=$objCon->GetConexion();\n $sentencia=$conexion->prepare('SELECT * FROM usuarios');\n $sentencia->execute();\n \n if($sentencia->rowCount()>0){\n $retorno=$sentencia->fetchAll(PDO::FETCH_ASSOC);\n }\n\n return $retorno;\n }",
"public function getUserByRequerimiento()\n {\n $users = collect([]);\n\n $centro = $this->centro()->firstOrFail();\n $centroUser = $centro->users()->firstOrFail();\n $users->push($centroUser);\n\n $empresa = $centro->empresa()->firstOrFail();\n $empresaUser = $empresa->users()->firstOrFail();\n $users->push($empresaUser);\n\n $compassUsers = \\App\\User::whereHasMorph(\n 'userable',\n ['App\\CompassRole'],\n function ($query) {\n $query->where('name', 'like', 'Compras')->orWhere('name', 'like', 'Despacho');\n }\n )->get();\n foreach ($compassUsers as $user) {\n $users->push($user);\n }\n\n return $users;\n }",
"static function getUserItems() {\n\t\t$id = Users::getUser();\n\t\t\n\t\t$id = parent::escape($id, \"sql\");\n\t\t\n\t\t$data = parent::query(\"SELECT *\n\t\t\t\t\t\t\t\tFROM `user_objects`\n\t\t\t\t\t\t\t\tWHERE `user_id` = '$id'\n\t\t\t\t\t\t\t\tAND `approve` = '1'\n\t\t\t\t\t\t\t\");\n\t\t\t\t\t\t\t\n\t\treturn $data;\n\t}",
"public function getListActivar()\n {\n\n $sql = \"SELECT cod_distribuidor\n FROM distribuidor\n WHERE distribuidor.cod_estado = 2\n \";\n $list = array();\n if (!$resultado = pg_query($this->conexion, $sql)) die();\n while ($row = pg_fetch_array($resultado)) {\n $item = new Distribuidor();\n $item->setCod_distribuidor($row[0]);\n \n array_push($list, $item);\n\n }\n return $list;\n\n }",
"function aCargarPuestosClonarUsuario($datos) {\n $oLPermisos = new LPermisos();\n $o_TablaHtmlx = new tablaDHTMLX();\n\n /* $arrayFilas[0][0] = $datos['idPuestoEmpleado']; //para cargar la informacion que ya se tiene en la tabla en un nuevo array para pasarlo a la nueva tabla del mismo formulario\n $arrayFilas[0][1] = $datos['vNombrePuesto'];\n $arrayFilas[0][2] = $datos['bEstados'];\n $arrayFilas[0][3] = $datos['iCodigoEmpleado']; */\n // d.iCodigoEmpleado, e.bEstado,e.iidPuestoEmpleado,f.vNombrePuesto\n\n $arrayFilas = $oLPermisos->lCargarPuestosClonarUsuario($datos);\n\n $arrayCabecera = array(0 => \"Codigo de empleado\", 1 => \"Estado\", 2 => \"Estado\", 3 => \"Puesto del empleado\", 4 => \"codigo Persona\", 5 => \"Nombre sistema\");\n $arrayTamano = array(0 => \"80\", 1 => \"200\", 2 => \"50\", 3 => \"271\", 4 => \"50\", 5 => \"100\");\n $arrayTipo = array(0 => \"ro\", 1 => \"ro\", 2 => \"ro\", 3 => \"ro\", 4 => \"ro\", 5 => \"ro\");\n $arrayCursor = array(0 => \"default\", 1 => \"default\", 2 => \"default\", 3 => \"default\", 4 => \"default\", 5 => \"default\");\n $arrayHidden = array(0 => \"false\", 1 => \"true\", 2 => \"true\", 3 => \"false\", 4 => \"true\", 5 => \"false\");\n $arrayAling = array(0 => \"left\", 1 => \"left\", 2 => \"left\", 3 => \"left\", 4 => \"left\", 5 => \"left\");\n return $o_TablaHtmlx->generaTabla($arrayCabecera, $arrayFilas, $arrayTamano, $arrayTipo, $arrayCursor, $arrayHidden, $arrayAling);\n }",
"static public function ctrMostrarComprasAdquisicion($item, $valor){\r\n\r\n\t\t$tabla = \"compras\";\r\n\r\n\t\t$respuesta = ModeloCompras::mdlMostrarComprasAdquisicion($tabla, $item, $valor);\r\n\r\n\t\treturn $respuesta;\r\n\t}",
"public function obterTodasCompras(){\n $compra = new CompraDAO();\n return $compra->getAll();\n }",
"private function carregarItensOrigemProcessoDeCompras() {\n\n $sWhere = implode(\" and \", array(\n 'ac16_origem = ' . Acordo::ORIGEM_PROCESSO_COMPRAS,\n \"ac26_acordoposicaotipo = \" . AcordoPosicao::TIPO_INCLUSAO,\n \"ac16_dataassinatura >= '2016-05-02'\",\n \"(ac58_acordo is null or ac58_data >= '{$this->oCabecalho->getDataGeracao()->getDate()}')\",\n \"pc24_pontuacao = 1\",\n \"ac16_instit = {$this->oCabecalho->getInstituicao()->getCodigo()}\",\n ));\n\n $oDaoItemProcesso = new cl_solicitemvinculo();\n $sSqlBuscaItens = $oDaoItemProcesso->sql_query_item_licitacon(implode(', ', self::$aCampos), $sWhere);\n $rsBuscaItens = db_query($sSqlBuscaItens);\n if (!$rsBuscaItens) {\n throw new DBException(\"Não foi possível carregar os itens do acordo incluso com origem Processo de Compras.\");\n }\n\n $iTotalRegistros = pg_num_rows($rsBuscaItens);\n for ($iRow = 0; $iRow < $iTotalRegistros; $iRow++) {\n\n $oStdInformacao = db_utils::fieldsMemory($rsBuscaItens, $iRow);\n $this->adicionarItem(self::criarObjetoImpressao($oStdInformacao));\n }\n }",
"public function contarUsuariosConectados(){\n\t\t\t$conn = $this->conexionBD();\n\t\t\t//Consulta con el metodo count() que cuenta el total de los registros\n\t\t\t$sql = \"SELECT count(*) total FROM user WHERE status_id=1\";\n\t\t\t//Ejecutamos la consulta\n\t\t\t$result = $conn->query($sql);\n\t\t\t//Establecemos el array en un auxiliar\n\t\t\t$aux= $result->fetch_assoc();\n\t\t\t//Retornamos el total de registros contados\n\t\t\treturn $aux['total'];\n\t\t}",
"static public function ctrMostrarComprasPedidos($item, $valor){\r\n\r\n\t\t$tabla = \"compras\";\r\n\r\n\t\t$respuesta = ModeloCompras::mdlMostrarComprasPedidos($tabla, $item, $valor);\r\n\r\n\t\treturn $respuesta;\r\n\t}",
"public function getFechasRecompraPorProducto(): ComprasClientes{ \n $comprasCliente = $this->getArrayCompras();\n if(!is_array($comprasCliente)){\n return false;\n }\n //Obtiene todas las fechas de compras por sku\n $comprasPorSku = [];\n foreach($comprasCliente['customer']['purchases'] as $compras){\n foreach($compras['products'] as $atributo){\n $comprasPorSku[$atributo['sku']]['fechas'][] = $compras['date'];\n $comprasPorSku[$atributo['sku']]['name'] = $atributo['name'];\n $comprasPorSku[$atributo['sku']]['sku'] = $atributo['sku'];\n } \n }\n \n $comprasClienteDifFechas = $this->getDifFechasCompras($comprasPorSku);\n $comprasClienteFechasRecompra = $this->getFechasRecompraSku($comprasClienteDifFechas);\n $comprasClientesEntity = new ComprasClientes();\n foreach($comprasClienteFechasRecompra as $compraPorSku){\n $comprasClientesEntity->addComprasClientes(new CompraCliente($compraPorSku)); \n }\n \n return $comprasClientesEntity; \n }",
"public static function getAllCommandes($idUser){\n try{\n\n $q = Model::$pdo->prepare(\"SELECT * FROM projet_commande pc JOIN projet_a_commander pac ON pc.idCommande=pac.idCommande WHERE idUtilisateur=:idUser ORDER BY dateCommande DESC\");\n $q->execute([':idUser' => $idUser]);\n $q->setFetchMode(PDO::FETCH_CLASS, \"Commande\");\n $tab_c = $q->fetchAll();\n\n }catch(PDOException $e){\n if(Conf::getDebug()){\n echo $e->getMessage();\n }else {\n echo 'Une erreur est survenue <a href=\"\"> retour a la page d\\'accueil </a>';\n } \n }\n\n if(empty($tab_c))\n return false;\n return $tab_c;\n\n\n }",
"public function index()\n {\n if (Auth::check()){\n // $produto = Produto::all();\n // $user = User::all();\n // $item = ItemCarrinho::all();\n // $carrinho = Carrinho::all();\n $max = Compra::max('id');\n $item = DB::select('select DISTINCT item_carrinhos.id as id, item_carrinhos.quantia as quantia, item_carrinhos.valorU as valorU, item_carrinhos.valorT as valorT, produtos.nome as pnome, produtos.descricao as descr, produtos.plataforma as plat from item_carrinhos, carrinhos , produtos where produto_id = produtos.id and carrinho_id = ?' , [Auth::user()->id]);\n return view('carrinhos.index',['item'=>$item, 'compra'=>$max]);\n }\n else {\n return redirect()->route('login');\n }\n }",
"public function post_userItemById($id) //Recibo mandando datos con el id de la funcion que es el id que introducimos en postman\n {\n\n $verificacion = $this->get_userVerify();\n\n\n if ($verificacion == true )\n {\n $compra = Model_compra::find('all');\n $user = Model_users2::find('all');\n $players = Model_player::find('all');\n $item = Model_items::find('all');\n $character = Model_personaje::find('all');\n $mina = Model_minas::find('all');\n $granada = Model_granadas::find('all');\n $vida = Model_vida::find('all');\n $muni = Model_municion::find('all');\n $dlc = Model_personaje::find('all');\n $array = [];\n $name = \"\";\n\n if ($id != null){\n \n foreach ($user as $key) {\n\n if($key['id'] == $id)\n {\n \n $name = $key;\n $id = $key['id_jugador'];\n }\n }\n }else{\n return $this->codeInfo($code = 404, $mensaje = 'No existe Item con la Id seleccionada, elije mejor...');\n\n }\n\n foreach ($compra as $key ) {\n \n if($id == $key['id_jugador']){\n foreach ($item as $items)\n {\n\n if ($items['id'] != null && $items['id'] == $key['id_item'] )\n {\n\n if($items['id_personaje'] != null)\n {\n foreach ($character as $characters)\n {\n if($items['id_personaje'] == $characters['id'])\n {\n array_push($array, $characters);\n }\n }\n }\n if($items['id_municion'] != null)\n {\n foreach ($muni as $municion)\n {\n if($items['id_municion'] == $municion['id'])\n {\n array_push($array, $municion);\n }\n }\n }\n if($items['id_DLC'] != null)\n {\n foreach ($dlc as $dl)\n {\n if($items['id_DLC'] == $dl['id'])\n {\n array_push($array, $dl);\n }\n }\n }\n if($items['id_granada'] != null)\n {\n foreach ($granada as $grana)\n {\n if($items['id_granada'] == $grana['id'])\n {\n array_push($array, $grana);\n }\n }\n }\n if($items['id_mina'] != null)\n {\n\n foreach ($mina as $min)\n { \n if($items['id_mina'] == $min['id'])\n { \n array_push($array, $min);\n }\n }\n }\n if($items['id_vida'] != null)\n {\n foreach ($vida as $vid)\n {\n if($items['id_vida'] == $vid['id'])\n {\n array_push($array, $vid);\n \n }\n }\n }\n\n\n }\n else\n {\n\n // if ( $items['id'] == $id )\n // {\n\n // return $this->response(array($users));\n // }\n\n }\n }\n\n }\n } \n\n \n // SI EL ID NO CORRESPONDE A NINGÚN JUGADOR O USUARIO DEVUELVE ESTE MENSAJE:\n //return $this->codeInfo($code = 404, $mensaje = 'No existe Item con la Id seleccionada, elije mejor...');\n\n }\n\n else // Este else es la auteficacion del token que verifica si lo envias o no\n {\n\n return $this->codeInfo($code = 403, $mensaje = 'Error en verificacion sesion');\n }\n return $this->response(array(\"User\"=>$name,\"items\"=>$array));\n\n }",
"public function buscarUsuariosClonarUsuario($datos) {\n $oLPermisos = new LPermisos();\n $o_TablaHtmlx = new tablaDHTMLX();\n $arrayFilas = $oLPermisos->lbuscarUsuariosClonarUsuario($datos);\n $arrayCabecera = array(0 => \"codigo Persona\", 1 => \"loginUsuario\", 2 => \"Nombre de Usuario\", 3 => \"perfil\", 4 => \"Nombre sistema\", 5 => \"id sistema\", 6 => \"iCodigoEmpleado\", 7 => \"bEstado\", 8 => \"idPuestoEmpleado\", 9 => \"NombrePuesto\");\n $arrayTamano = array(0 => \"50\", 1 => \"80\", 2 => \"200\", 3 => \"50\", 4 => \"100\", 5 => \"30\", 6 => \"80\", 7 => \"80\", 8 => \"80\", 9 => \"250\");\n $arrayTipo = array(0 => \"ro\", 1 => \"ro\", 2 => \"ro\", 3 => \"ro\", 4 => \"ro\", 5 => \"ro\", 6 => \"ro\", 7 => \"ro\", 8 => \"ro\", 9 => \"ro\");\n $arrayCursor = array(0 => \"default\", 1 => \"default\", 2 => \"default\", 3 => \"default\", 4 => \"default\", 5 => \"default\", 6 => \"default\", 7 => \"default\", 8 => \"default\", 9 => \"default\");\n $arrayHidden = array(0 => \"false\", 1 => \"false\", 2 => \"false\", 3 => \"true\", 4 => \"false\", 5 => \"true\", 6 => \"true\", 7 => \"true\", 8 => \"true\", 9 => \"false\");\n $arrayAling = array(0 => \"left\", 1 => \"left\", 2 => \"left\", 3 => \"left\", 4 => \"left\", 5 => \"left\", 6 => \"left\", 7 => \"left\", 8 => \"left\", 9 => \"left\");\n return $o_TablaHtmlx->generaTabla($arrayCabecera, $arrayFilas, $arrayTamano, $arrayTipo, $arrayCursor, $arrayHidden, $arrayAling);\n }",
"public function ControladorProductos()\n {\n // section 10-25-2--51--31a7ca5b:13394855662:-8000:0000000000001136 begin\n $this->miModelo = new ModeloProductos();\t\n\t\t$this->miVista = new VistaGenerica();\t\n\t\t$this->usuario = new Usuario();\n\t\t\n \tif ($this->usuario->isRegistredUser()==null) {\t// No tiene autorización para este controlador\n \theader(\"Location: index.php\");\n }\n \n // var_dump($_SESSION[userRow][id]);\n \n \tif(@$_REQUEST[\"controlador\"]==\"\" || @$_REQUEST[Cancelar]) \t\t// Boton generico cancelar\n\t\t{\n\t\t\t$this->Lista();\n\t\t}\n\t\telse \n\t\t{\n\t\t\tif(@$_REQUEST[\"controlador\"]==\"Buscar\") \t\n\t\t\t\t$this->Buscar();\n\t\t\tif(@$_REQUEST[\"controlador\"]==\"nuevo\")\n\t\t\t\t$this->Alta();\t\t\t\n\t\t\tif(@$_REQUEST[\"controlador\"]==\"editar\")\n\t\t\t\t$this->Editar();\n\t\t\tif(@$_REQUEST[\"controlador\"]==\"borrar\") \n\t\t\t\t$this->Borrar();\n\t\t}\n \n // section 10-25-2--51--31a7ca5b:13394855662:-8000:0000000000001136 end\n }",
"public function mostrar_usuarios() {\n require 'model/ItemModel.php';\n $items = new ItemModel();\n $data['listado'] = $items->mostrarUsuarios();\n $this->view->show(\"vistar_Usuarios_creados.php\", $data);\n }",
"function acargarUsuariosInactivos($idServicio, $idSistema, $idFormulario) {\n $oLPermisos = new LPermisos();\n $o_TablaHtmlx = new tablaDHTMLX();\n $arrayFilas = $oLPermisos->lcargarUsuariosInactivos($idServicio, $idSistema, $idFormulario);\n\n $arrayCabecera = array(0 => \"Id\", 1 => \"Nombre de Usuario\", 2 => \"ID Formulario\", 3 => \"Id Sistema\", 4 => \"Id Persona\", 5 => \"Acción\");\n $arrayTamano = array(0 => \"50\", 1 => \"*\", 2 => \"40\", 3 => \"110\", 4 => \"110\", 5 => \"50\");\n $arrayTipo = array(0 => \"ro\", 1 => \"ro\", 2 => \"ro\", 3 => \"ro\", 4 => \"ro\", 5 => \"img\");\n $arrayCursor = array(0 => \"default\", 1 => \"default\", 2 => \"default\", 3 => \"default\", 4 => \"default\", 5 => \"default\");\n $arrayHidden = array(0 => \"false\", 1 => \"false\", 2 => \"true\", 3 => \"true\", 4 => \"true\", 5 => \"false\");\n $arrayAling = array(0 => \"left\", 1 => \"left\", 2 => \"left\", 3 => \"left\", 4 => \"left\", 5 => \"left\");\n return $o_TablaHtmlx->generaTabla($arrayCabecera, $arrayFilas, $arrayTamano, $arrayTipo, $arrayCursor, $arrayHidden, $arrayAling);\n }",
"private function getPermisosBotonera()\n\t{\n\t\t$auth = new Zend_Session_Namespace('veoliaZend_Auth');\n\t\t$rol = Zend_Registry::get('role');\n\t\t$permisos = array();\n\t\t$permisos[\"edit\"] = ($auth->_acl->isAllowed($rol,\"default:aclusuarios\",\"edit\"))? true : false;\n\t\t$permisos[\"add\"] = ($auth->_acl->isAllowed($rol,\"default:aclusuarios\",\"add\"))? true : false;\n\t\t$permisos[\"delete\"] = ($auth->_acl->isAllowed($rol,\"default:aclusuarios\",\"delete\"))? true : false;\n\t\t$permisos[\"password\"] = ($auth->_acl->isAllowed($rol,\"default:aclusuarios\",\"password\"))? true : false;\n\t\t$permisos[\"estado\"] = ($auth->_acl->isAllowed($rol,\"default:aclusuarios\",\"estado\"))? true : false;\n\t\t$permisos[\"detail\"] = ($auth->_acl->isAllowed($rol,\"default:aclusuarios\",\"detail\"))? true : false;\n\t\treturn $permisos;\n\t}",
"public function podpadbuscarUsuariosClonarUsuario() {\n $oLPermisos = new LPermisos();\n require_once(\"../../cvista/permisos/BusquedaClonarUsuario.php\");\n }"
] | [
"0.6322936",
"0.6159464",
"0.58880836",
"0.57551765",
"0.57008827",
"0.5597446",
"0.5591485",
"0.5577466",
"0.5554718",
"0.5554359",
"0.5543948",
"0.5530036",
"0.55059755",
"0.5500669",
"0.5498347",
"0.5475484",
"0.54736155",
"0.54706174",
"0.5458583",
"0.541984",
"0.5416076",
"0.5410518",
"0.5410269",
"0.54039764",
"0.5394968",
"0.5394507",
"0.53937066",
"0.53933376",
"0.53928196",
"0.53920245"
] | 0.6513484 | 0 |
Elimina el registro de los campos de la imagen del usuario | function eliminar_usuario_imagen($id_usuario) {
$this->db->escape($id_usuario);
$this->db->set('imagen_url', NULL);
$this->db->set('imagen_thumb_url', NULL);
$this->db->where('id_usuario', $id_usuario);
$this->db->update('usuarios');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function postEliminarfoto (Request $request){\n $datos = $request->all();\n if ($datos['usrUrlimage']<>null){\n $array= explode('/', $datos['usrUrlimage']);\n Storage::disk($array[1])->delete($array[2]);\n } \n $model= new User();\n $result=$model->eliminarFoto($datos);\n return $result;\n }",
"function eliminarUsuario($matricula){\n \t}",
"public function delImage()\n\t{\n\t\tif (isset($_POST['file']) && $_POST['file'] != '')\n\t\t{\n\t\t\t$userID = Auth::user()->id;\n\t\t\t//disect the URL\n\t\t\t$temp = explode(\"/\", $_POST['file']);\n\t\t\t$fileName = array_pop( $temp );\n\t\t\t$userDirID = array_pop( $temp );\n\t\t\t//make sure this is the user's images\n\t\t\tif ($userID == $userDirID)\n\t\t\t{\n\t\t\t\t//all good, remove!\n\t\t\t\t$images_uploadDir = Setting::where('name', 'images_uploadDir')->first();\n\t\t\t\tunlink( './'. $images_uploadDir->value . '/' . $userID. '/' . $fileName );\n\t\t\t}\n\t\t}\n\t}",
"private function sql_img_nueva(){\n\t\tunset($_POST['imagen']); //(por si esta aunque vacio)\n\t\t$this->agregar_db('anuncios_img');\n\n\t}",
"protected function removeFields()\n {\n // logged in. In neither case is it appropriate for\n // the user to get to pick an existing userid. The user\n // also doesn't get to modify the validate field which\n // is part of how their account is verified by email.\n\n unset($this['user_id'], $this['validate'], $this['validate_at'],\n $this['created_at'], $this['updated_at'], $this['email_new']);\n\n }",
"function eliminar_crucero(){\t\n\t\t$id=$_GET['id'];\n\t\t$sql=\"DELETE FROM crucero WHERE id_cru='$id'\";\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\n\t\t//Eliminamos las imagenes\n\t\t$sql=\"SELECT id_image, directorio_image, nombre_image FROM imagen WHERE galeria_image='$id' AND tabla_image='crucero' AND nombre_image!='mapa'\";\n\t\t$consulta2=mysql_query($sql) or die(mysql_error());\n\t\twhile($resultado2=mysql_fetch_array($consulta2)){\n\t\t\t$directorio=\"../../imagenes/\".$resultado2['directorio_image'];\n\t\t\t//eliminamos el registro de la imagen\n\t\t\t$id_imagen=$resultado2['id_image'];\n\t\t\t$sql=\"DELETE FROM imagen WHERE id_image='$id_imagen'\";\n\t\t\t$qr_eliminar=mysql_query($sql) or die(mysql_error());\n\t\t\t//borramos la imagen del directorio\n\t\t\tunlink($directorio);\n\t\t\tif($resultado2['nombre_image']==\"logo\"){\n\t\t\t\t$directorio2=\"../../imagenes/\".$this->modificar_url($resultado2['directorio_image']);\n\t\t\t\tunlink($directorio2);\n\t\t\t}\n\t\t}\n\t\t\n\t\theader(\"location:/admin/crucero/\");\n\t}",
"function picture_delete() {\n\t\t$person = $this->Person->read(null, $this->Session->read('person'));\n\t\tif (!empty($person['Person']['picture'])) {\n\t\t\t$this->__deleteImage($person['Person']['picture']);\n\t\t}\n\t\t$person['Person']['picture'] = \"\";\n\t\t$this->Person->save($person);\n\t\t$this->redirect($this->referer());\n\t}",
"function removeimg($img){\n if($img != null) {\n $path = \"../images/Users/\".$this->userid.\"/Uploads/\".$img;\n unlink($path);\n }\n }",
"function elimina_immagine()\n {\n $image_name = Params::get(\"image_name\");\n $id_prodotto_servizio = Params::get(\"id_prodotto_servizio\");\n\n $product_image_dir = new Dir(self::PRODUCT_IMAGE_DIR.\"/\".$id_prodotto_servizio);\n $product_image_file = $product_image_dir->newFile($image_name);\n\n ImagePicker::delete_image_thumbnails($product_image_file);\n\n //elimino la riga associata all'immagine\n $peer = new ImmagineProdottoServizioPeer();\n $peer->id_prodotto_servizio__EQUALS($id_prodotto_servizio);\n $peer->nome_immagine__EQUALS($image_name);\n $elenco_immagini_prodotto_servizio = $peer->find();\n foreach ($elenco_immagini_prodotto_servizio as $img)\n $peer->delete($img);\n\n $product_image_file->delete();\n\n if ($product_image_dir->isEmpty())\n $product_image_dir->delete();\n\n return Redirect::success();\n }",
"public function delete()\n {\n $this->auth->photo = null;\n $this->auth->save();\n }",
"function borrar_usuarios_fecha($fecha) {\n // FUNCION PARA ADMIN\n\n $path = $this -> config -> item(\"upload_path\"); // En beta necesario poner el path, en guay lo leemos del config\n\n // Lo primero seria eliminar los pisos del usuario\n $sql_idu = \"SELECT idu FROM usuarios WHERE fechaalta <='\".$fecha.\"'\";\n $resultado = $this -> db -> query($sql_idu);\n if ($resultado -> num_rows()>0) {\n foreach ($resultado -> result() as $row) {\n // Comentarios y amigos\n $sql_comentarios = \"DELETE FROM comentarios WHERE idusuario=\".$row -> idu;\n $resultado_comentario = $this -> db -> query($sql_comentarios);\n $sql_denuncias = \"DELETE FROM denuncias WHERE iddenunciante=\".$row -> idu;\n $resultado_denuncias = $this -> db -> query($sql_denuncias);\n // Eliminamos las imagenes\n // Primero los ficheros\n $sql_pisos = \"SELECT id_piso FROM pisos WHERE idusuario=\".$row -> idu;\n $resultado_pisos = $this -> db -> query($sql_pisos);\n if ($resultado_pisos -> num_rows()>0) {\n // Si hay pisos, necesitamos las imagenes\n foreach ($resultado_pisos -> result() as $row_pisos) {\n $sql_imagenes = \"SELECT imagen FROM imagenes_piso WHERE idpiso=\".$row_pisos -> id_piso;\n $resultado_imagenes = $this -> db -> query($sql_imagenes);\n if ($resultado_imagenes -> num_rows()>0) {\n foreach ($resultado_imagenes -> result() as $row_imagenes) {\n unlink($path.\"/\".$row -> idu.\"/\".$row_imagenes -> imagen);\n }\n }\n // Lo eliminamos de la BD\n $sql_elimina_imagenes = \"DELETE FROM imagenes_piso WHERE idpiso=\".$row_pisos -> id_piso;\n $resultado_borrado = $this -> db -> query($sql_elimina_imagenes);\n } // Fin de borrar las imagenes y dejarlo como una patena\n }\n // Eliminamos los pisos que tenga\n $sql_elimina_pisos = \"DELETE FROM pisos WHERE idusuario=\".$row -> idu;\n $resultado_elimina_pisos = $this -> db -> query($sql_elimina_pisos);\n }\n }\n }",
"public function destroy($id)\n {\n echo \"ola\";\n $usuario = User::findOrFail($id);\n if($usuario->imagem!=null){\n Storage::delete($usuario->imagem);\n }\n $imagens = DB::table('users')\n ->join('imagens', 'users.id', '=', 'imagens.user_id')\n ->select('imagens.imagem')\n ->where('users.id', '=', $id)\n ->get();\n foreach ($imagens as $i){\n Storage::delete($i->imagem);\n }\n $usuario->delete();\n return redirect()->route('user.index')->with('successMsg','Usuário removido .'); \n\n }",
"private function sql_img_actualizar(){\n\t\t$imagen = $_POST['imagen'];\n\t\tunset($_POST['imagen']);\n\t\t$this->actualizar_db('anuncios_img',$imagen);\n\t}",
"public function deleteAlumnos()\n\t{\n\n\t\t$id = $this->request->alumno;\n\n\t\t$this->UsuarioModel->deleteUsuario($id);\n}",
"public function DeleteImagen($usuario){\n\t\t\t$this->id=intval($_GET['id']);\n\t\t\t$this->usuario=$usuario;\n\t\t\t$sql=$this->db->query(\"SELECT imagen FROM slider WHERE id_slider=$this->id LIMIT 1;\");\n\t\t\t$data=$this->db->recorrer($sql);\n\t\t\t$indicesServer = array('REMOTE_ADDR',);\n\t\t\t$ip=$_SERVER['REMOTE_ADDR'];\n\t\t\t$evento=\"Elimino al carrusel la imagen \".$data[0];\n\t\t\t$this->db->query(\"INSERT INTO registro_eventos(ip, usuario, evento, fecha, operacion) VALUES('$ip', '$this->usuario', '$evento', NOW(), 'DELETE');\");\n\t\t\t$this->db->liberar($sql);\n\t\t\t$this->db->query(\"DELETE FROM slider WHERE id_slider=$this->id LIMIT 1;\");\n\t\t\theader(\"location: ?view=config&mode=Carrusel&success=2\");\n\t\t}",
"public function picture_delete ()\n {\n $picture = $this->products::PICTURE_PATH . $this->upload->data('file_name') ?? '';\n if (is_file($picture)) unlink ($picture);\n }",
"public function removeralumno(Request $request){\n //dd($request['userId']);\n $act=\"0\";\n $id=DB::table('datos_alumnos')->where('user_id',$request['userId'])->pluck('id');\n $apro = UpdateAlum::find($id[0]);\n $apro->activo = $act;\n $apro->save();\n $eliG=UserAlum_Grup::where('user_id', '=', $request['userId'])->first();\n $eliG->delete();\n return back()->with('success', 'Eliminado correctamente');\n }",
"function delete_img_emty()\n{\n\t// get link\n \t$path_file = FCPATH . 'api/users/avatar/';\n \t// get name images in folder\n \t$files1 = array_slice(scandir('api/users/avatar'),2);\n \t// get link images in database\n \t$datas = $this->Users_Model->get_img_all();\n \t$img_name = [];\n\n \tforeach ($datas as $data) {\n \t\t// get name images in database\n \t\t$img_name[] = str_replace('users/avatar/',\"\", $data->avatar);\n \t}\n\n \tfor($i = 0; $i < count($files1); $i++)\n \t{\n \t\t// check \n \t\tif(!in_array($files1[$i], $img_name))\n \t\t{\n \t\t\t$file = $path_file.$files1[$i];\n \t\t\tif(file_exists($file)) {\n \t\t\t\t// remove images in folder\n\t \t\t\tunlink($file);\n\t \t\t}\n \t\t}\n \t}\n\n}",
"function f_eliminar_foto(\n\t\t\t$cod_tabla\t\t\t\t,\n\t\t\t$arr_post\t\t\t\t,\n\t\t\t$cod_pk\t\t\t\t\t,\n\t\t\t$nom_columna_con_foto\n\t){\n\t\tglobal $db;\n\t\t$tabla_autonoma\t= new tabla_autonoma;\n\t\t//=== Borra el archivo fisico\n\t\t$ruta_archivo \t\t= $arr_post[$nom_columna_con_foto];\n\t\t@unlink($ruta_archivo); \t//Si ya existe elimina el archivo para modificarlo >>>\n\n\t\t//=== Encuentra nombre de la tabla >>>\n\t\t$row_tabla\t\t\t= $tabla_autonoma->f_get_row($cod_tabla);\n\t\t$nom_tabla\t\t\t= $row_tabla['txt_nombre'];\n\n\t\t//=== Nombre llave primaria>>>\n\t\t$row_pk\t\t\t\t= $this->f_get_row_pk($cod_tabla);\n\t\t$nom_pk\t\t\t\t= $row_pk['txt_nombre'];\n\t\t\n\t\t//=== Actualiza el campo donde estaba almacenado el nombre del archivo>>>\n\t\t$query\t\t\t\t= \"update $nom_tabla set $nom_columna_con_foto='' where $nom_pk=$cod_pk\";\n\t\t$db->consultar($query);\n\t}",
"public function destroy_avatar(User $user){\n \n abort_if(auth()->user()->id != $user->id,403); \n\n\n $image_path = public_path().'/uploads/'.$user->details->file_name;\n unlink($image_path);\n\n $image_attribures['mime'] = \"\";\n $image_attribures['original_file_name'] = \"\";\n $image_attribures['file_name'] = \"\";\n\n // dd($image_attribures);\n $user->details->update($image_attribures);\n }",
"public function deleteUserEmpresa() {\n $id = isset($_POST['id']) ? $_POST['id'] : null;\n $idPessoa = isset($_POST['idPessoa']) ? $_POST['idPessoa'] : null;\n \n\n echo User::deleteUserEmpresa($id, $idPessoa);\n }",
"function eliminar_formulario($id_usuario_sesion, $tipo_sesion, $usuario_sesion, $id_ef_sesion, $conexion) {\n\n\t$idformulario = base64_decode($_GET['idformulario']);\n\t//VEO SI SE HA HECHO CLICK EN EL BOTON ELIMINAR\n\tif(isset($_POST['btnEliminar'])) {\n\n\t\t//ELIMINAMOS EL REGISTRO\n\t\t\n\t\t$delete = \"DELETE FROM s_sgc_formulario WHERE id_formulario='\".$idformulario.\"' LIMIT 1;\";\n\t\t//$rs = mysql_query($delete, $conexion);\t \n\t\tif($conexion->query($delete)===TRUE){\n\t\t \n\t\t\t if(file_exists('../file_form/'.$_POST['archivodel'])){ \n\t\t\t borra_archivo('../file_form/'.$_POST['archivodel']);\n\t\t\t }\t\t\n\t\t\t\n\t\t $mensaje=\"Se elimino correctamente el archivo\";\n\t\t header('Location: index.php?l=archivos&var='.$_GET['var'].'&op=1&msg='.base64_encode($mensaje));\n\t\t exit;\t\t\t\t\n\t\t} else{\n\t\t $mensaje=\"Hubo un error al ingresar los datos, consulte con su administrador \".\"\\n \".$conexion->errno. \": \" . $conexion->error;\n\t\t header('Location: index.php?l=archivos&var='.$_GET['var'].'&op=2&msg='.base64_encode($mensaje));\n\t\t exit;\n\t\t}\n\t\t\n\t} elseif(isset($_POST['btnCancelar'])){\n\t header('Location: index.php?l=archivos&var='.$_GET['var']);\n\t exit;\n\t}else {\n\t\t//SI NO SE HIZO CLICK EN EL BOTON ELIMINAR, MOSTRAMOS EL FORM\n\t\tmostrar_form_eliminar($id_usuario_sesion, $tipo_sesion, $usuario_sesion, $id_ef_sesion, $conexion);\n\t}\n}",
"function rem_propic($id)\t{\r\n\t\t$mysqli = connect();\r\n\t\t\r\n\t\t$stmt = $mysqli->prepare(\"DELETE FROM propics WHERE userID = ?\");\r\n\t\t$stmt->bind_param('i', $id);\r\n\t\t$stmt->execute();\r\n\t\t//echo \"<br/> Old picture removed <br/>\";\r\n $stmt->close();\r\n\t}",
"public function eliminarDatos()\n\t{\n\t\t$userEmail \t\t= $this->input->post('userEmail');\n\n\t\t$this->load->model('CrudModel');\n\t\t$this->CrudModel->eliminar($userEmail);\n\n\t\t$this->load->view('crudView');\n\t}",
"public function removeProfilleimg()\n {\n if (isset($_SESSION [LOGGED_IN])) {\n $user = $_SESSION [LOGGED_IN];\n $userID = $user [USER_ID];\n $this->load->model('usermanagement/Usermanagementmodel');\n $result = $this->Usermanagementmodel->removeProfileimg($userID);\n $_SESSION[LOGGED_IN]['profile'] = 0;\n if ($result) {\n $response = array(\n STATUS => true,\n );\n } else {\n $response = array(\n STATUS => false,\n );\n }\n $this->apiResponse($response);\n }\n }",
"public function deleteUserImage(Request $request, $id=null){\n \n $user_image= User::where(['id'=>$id])->first();\n \n \n //Get Product Image Paths\n \n $large_image_path=\"images/backend_image/admin_users/small/\";\n $medium_image_path=\"images/backend_image/admin_users/medium/\";\n $small_image_path=\"images/backend_image/admin_users/large/\";\n \n //Delete Large image if not exist\n \n if(file_exists($large_image_path.$user_image->user_image)){\n \n unlink($large_image_path.$user_image->user_image); \n }\n \n \n //Delete Medium image if not exist\n \n if(file_exists($medium_image_path.$user_image->user_image)){\n \n unlink($medium_image_path.$user_image->user_image); \n }\n \n //Delete Small image if not exist\n \n if(file_exists($small_image_path.$user_image->user_image)){\n \n unlink($small_image_path.$user_image->user_image); \n }\n \n //Delete image from the table\n \n User::where(['id'=>$id])->update(['user_image'=>'']);\n \n return redirect()->back()->with('flash_message_success','User Image has been deleted Successfully');\n \n\n}",
"function eliminarGrupos() {\n\t\t//Realiza la insercion en Postgresql con base en los parametros\n\t\t\t\n\t\t\t$cnx = \tconectar_postgres();\n\t\t\t$cons = \"DELETE FROM Consumo.grupos\";\n\t\t\t\t\t \n\t\t\t\n\t\t\t$res = @pg_query($cnx, $cons);\n\t\t\t\tif (!$res) {\n\n\t\t\t\t\t\t\techo \"<p class='error1'> Error de ejecucion </p>\".pg_last_error().\"<br>\";\n\t\t\t\t\t\t\techo \"<p class= 'subtitulo1'>Comando SQL </p> <br>\".$consUTF8.\"<br/> <br/> <br/>\"; \n\n\t\t\t\t}\n\t\t}",
"public function deleteUserAvatar()\n {\n $user = \\App\\User::find(\\Auth::user()->id);\n $placeholderAvatar = '/image/avatar-placeholder.png';\n if (isset($user->fullInfoAboutUser->avatar_path)) {\n $current_user_avatar = $user->fullInfoAboutUser->avatar_path;\n $current_user_avatar_path = base_path('/public/' . $current_user_avatar);\n if (\\File::isFile($current_user_avatar_path)) {\n if (strpos($current_user_avatar_path, 'user_avatars') !== false) {\n \\File::delete($current_user_avatar_path);\n }\n }\n $user->fullInfoAboutUser()->update(['avatar_path' => $placeholderAvatar]);\n }\n }",
"public function excluirImagem(){\n\t\t\t$imagem = new ImagemLib();\n\n\t\t\t//Validação da imagem excluida\n\t\t\tif($this->input->post('id') == null){\n\t\t\t\treturn array('erro' => \"Erro interno no sistema\");\n\t\t\t}\n\n\t\t\t$imagem->setId($this->input->post('id'));\n\n\t\t\t$imagem->excluiImagem();\n\n\t\t\treturn array('sucesso' => \"Imagem excluída com sucesso!\");\n\t\t}",
"public function remove_image() {\n $ad = $this->ad_protected_for_current_user($this->params['id']);\n $ad->remove_image($this->params['image_id']);\n redirect('/ads/edit', ['notice' => 'Image successfully removed.'], ['id' => $ad->id]);\n }"
] | [
"0.64932513",
"0.62754405",
"0.62256277",
"0.6223933",
"0.61663324",
"0.60895276",
"0.6086216",
"0.6072177",
"0.6061229",
"0.6036112",
"0.60083",
"0.5993228",
"0.5991279",
"0.59851336",
"0.59835714",
"0.5938246",
"0.59370327",
"0.5935657",
"0.59307593",
"0.5888215",
"0.5853913",
"0.5842668",
"0.5833566",
"0.58299166",
"0.5827228",
"0.5812394",
"0.57987756",
"0.5783407",
"0.5774202",
"0.5753476"
] | 0.7146224 | 0 |
Verifica si existe un usuario | function existe_usuario($usuario) {
$this->db->escape($usuario);
$this->db->where('usuario', $usuario);
$query = $this->db->get('usuarios');
if ($query->num_rows() != 0)
return TRUE;
else
return FALSE;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function doesUserExist($username);",
"public function Does_user_exist()\n {\n $existance = $this->search_user_byEmail();\n $rows_number = mysqli_fetch_assoc($existance);\n if ($rows_number) res(\"Email already exist ...\", 400);\n }",
"function comprueba($usuario) {\n\t\t// Devuelve true si existe y false si no\n\t\t$sql = \"SELECT usuario FROM usuarios WHERE usuario='\".$usuario.\"'\";\n\t\t$resultado = $this -> db -> query($sql);\n\n\t\tif ($resultado -> num_rows()>0) {\n\t\t\t// Existe\n\t\t\treturn true;\n\t\t} else {\n\t\t\t// No existe\n\t\t\treturn false;\n\t\t}\n\t}",
"public function existeUsuario(){\n $query = \"SELECT * FROM \". self::$tabla . \" WHERE email = '\" . $this->email . \"' LIMIT 1\";\n\n $resultado = self::$db->query($query);\n\n if (!$resultado->num_rows) { //num bows es mi indicativo para saber si hay resultados o no\n self::$errores[] = 'El usuario no existe';\n return; //para que el codigo deje de ejecutarse\n }\n return $resultado; //en caso de no existir un error retorna el resultado\n\n\n }",
"function verificar_existencia($usuarioR){\n $usuario = $usuarioR;\n $respuesta = false;\n\n /*Recorremos la base de datos buscando un unico usuario que coincida con\n el ingresado, y $token_user los contara,solo deber haber 1*/\n $token_user = 0;\n\n $query = 'SELECT username FROM usuarios';\n $data = mysqli_fetch_all($this->get_results_from_query($query));\n //return $data;\n\n for ($i = 0; $i < count($data); $i++) {\n\n if ($data[$i][0] == $usuario){\n $token_user++;\n }\n\n }\n\n if ($token_user == 1) {\n $respuesta = true;\n }\n\n return $respuesta;\n }",
"public function isUserExisted($login) {\n $result = mysql_query(\"SELECT login from `mydb`.`Usuario` WHERE login = '$login'\");\n $no_of_rows = mysql_num_rows($result);\n if ($no_of_rows > 0) {\n // user existed \n return true;\n } else {\n // user not existed\n return false;\n }\n }",
"function verificaExistencia_Usuario($email_Busca){\n\t\t\n\t\t$this->conectarSQL('royal210_vincentProject'); //conexão com o BD\n\t\t$this->con->query(\"SET NAMES 'utf8'\");\n\t\t$query = \"SELECT email FROM usuarios WHERE email='\".$email_Busca.\"'\"; //query para verificar a existencia de usuario pelo email\n\t\t$resultado = $this->con->query($query) or die ($this->con->error); //executando Query\n\n\t\t\n\t\treturn $resultado->num_rows; //retornando quantos usuarios foram encontrados pelo email\n\t}",
"function existLogin(){\n $stmt = $this->db->prepare(\"SELECT *\n\t\t\t\t\tFROM usuario\n\t\t\t\t\tWHERE login = ?\");\n $stmt->execute(array($this->login));\n $resultado = $stmt->fetch(PDO::FETCH_ASSOC);\n if($resultado != null){\n return true;\n }else{\n return \"El usuario con este login ya existe\";\n }\n\t\t}",
"public function isUserExisted($userDetail) {\r\n\t\r\n $stmt = $this->conn->prepare(\"SELECT username,firstname,lastname,email FROM admins WHERE (email = '\".$userDetail.\"' OR username='\".$userDetail.\"')\");\r\n \r\n $stmt->execute();\r\n \r\n $stmt->store_result();\r\n \r\n if ($stmt->num_rows > 0) {\r\n // user existed \r\n $stmt->close();\r\n return true;\r\n }\r\n\t\telse {\r\n // user not existed\r\n $stmt->close();\r\n return false;\r\n }\r\n }",
"public function userExists($name);",
"public function test_username_exist() {\n $link = $this->_link.'users';\n $method = 'POST';\n $params = array(\n 'username' => 'phamtam',\n 'password' => '123456',\n 'email' => '[email protected]',\n 'firstname' => 'tam',\n 'lastname' => 'pham',\n 'group' => 1,\n 'gender' => 1,\n 'avatar' => 'avatar.jpg',\n 'birthday' => '1988-12-13',\n 'address' => '111D Ly Chinh Thang',\n 'city' => 'HCMC',\n 'mobile' => '0909999999',\n );\n $res = $this->curl($link, $method, $params);\n\n $this->assertEquals(ERROR_USERNAME_EXIST, $res->meta->code);\n }",
"private function existeUsuario($nombre,$pass)\n {\n $user = new Usuario;\n $usuario = $user->GetUsuario($nombre,$pass);\n $respuesta = false; \n if($usuario!=null)\n { \n Session::put('id',(int)$usuario[0]->id_usuario);\n Session::put('tipo',(int)$usuario[0]->tipo_usuario);\n Session::put('nombre_usuario',$usuario[0]->nombre_usuario); \n Session::put('nombre_foto',$usuario[0]->foto);// OJO\n\n $user->SetBitacora($usuario[0]->id_usuario);\n $respuesta = true;\n }\n return $respuesta;\n }",
"public function existeUsuario($correo,$clave)\n {\n $existe=FALSE;\n $objetoAccesoDato = AccesoDatos::dameUnObjetoAcceso();\n \n $consulta = $objetoAccesoDato->RetornarConsulta(\"SELECT * FROM usuarios \n WHERE correo='$correo' AND clave='$clave'\"); \n \n $consulta->execute();\n //echo $consulta->rowCount();\n if($consulta->rowCount()>0) //SI EXISTE EL CORREO EN LA BASE DE DATOS, DEVUELVE 1 FILA\n $existe=TRUE; // POR LO QUE ROWCOUNT SERA 1, INGRESANDO AL IF\n\n return $existe;\n }",
"private function userExists(){\n if(!$this->valid){\n $sql = \"SELECT tweet_id FROM %s WHERE username = ?\";\n } else {\n $sql = \"SELECT tweet_id FROM %s WHERE username = ? AND valid = 1\";\n }\n $params = array('s',$this->tweetObj->from_user);\n\n $res = TwitterDBWrapper::query($sql, $params);\n if($res->fetch()){\n return true;\n } else {\n return false;\n }\n }",
"public function isuserexist($nickname) {\n\n $result = mysql_query(\"SELECT nickname from usuarios WHERE nickname = '$nickname'\");\n\n $num_rows = mysql_num_rows($result); //numero de filas retornadas\t\t\n\t\t\n if ($num_rows > 0) {\n\t echo(\"lalala\");\n return true; // el usuario existe \n } else {\n return false; // no existe\n }\n }",
"private function ehUsuarioExistente($login) {\r\n $stmt = $this->conn->prepare(\"SELECT usuario.cd_usuario \"\r\n . \"FROM tb_usuario AS usuario \"\r\n . \"WHERE usuario.nm_login = ?\");\r\n $stmt->bind_param(\"s\", $login);\r\n $stmt->execute();\r\n $stmt->store_result();\r\n $num_rows = $stmt->num_rows;\r\n $stmt->close();\r\n return $num_rows > 0;\r\n }",
"function Register(){\r\n\r\n\t\t$sql = \"select * from usuarios where login = '\".$this->login.\"'\";\r\n\r\n\t\t$result = $this->mysqli->query($sql);//Guarda el resultado\r\n\t\tif ($result->num_rows == 1){ // existe el usuario\r\n\t\t\t\treturn 'El usuario ya existe';//Devuelve mensaje de error\t\r\n\t\t\t}\r\n\t\telse{\r\n\t \t\treturn true; //no existe el usuario\r\n\t\t}\r\n\r\n\t}",
"private function existe_usuario($email, $id = -1, $usuario, $dni ) {\r\n if (filter_var($email, FILTER_VALIDATE_EMAIL)) {\r\n if($id<=0){\r\n $query = $this->_conn->prepare(\"SELECT email from usuarios WHERE email = :email\");\r\n $query->bindValue(\":email\", $email);\r\n }else{\r\n $id_usuario = (int) $id;\r\n $query = $this->_conn->prepare(\"SELECT email from usuarios WHERE (email = :email or nombre = :usuario or dni=:dni) and id_usuarios <> :id_usuario\");\r\n $query->bindValue(\":email\", $email);\r\n $query->bindValue(\":usuario\", $usuario);\r\n $query->bindValue(\":dni\", $dni);\r\n $query->bindValue(\":id_usuario\", $id_usuario);\r\n }\r\n $query->execute();\r\n if ($query->fetch(PDO::FETCH_ASSOC)) {\r\n return true;\r\n }\r\n }\r\n else\r\n return false;\r\n }",
"public function verificarNombreUsuarioNuevo($usuario){\n $usuario = new Usuario;\n $id_usuario=$usuario->getIdUsuarioSegunNombre($usuario);\n if(count($id_usuario)>0){\n return TRUE;\n } else{\n return FALSE;\n } \n\n }",
"function user_exists(string $username):bool\n {\n $user_id = user_id($username);\n if($user_id)\n return true;\n else\n return false;\n }",
"function userExists($user){\n global $conn;\n $query = \"SELECT *\n FROM e_store.users\n WHERE username = :user;\";\n\n $stmt = $conn->prepare($query);\n $stmt->execute( array('user' => $user) );\n return count($stmt->fetchAll()) == 0 ? 1 : 0;\n }",
"private function _checkUserExists()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$this->_getDn(false);\n\n\t\t\treturn true;\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function isUserExisted($name) {\r\n\t\t$params = array(\r\n\t\t\t\t'name' => $name\r\n\t\t);\r\n\t\t$result = $this->pdoQuery->executePdoSelectQueryTable(self::SELECT_USER_BY_NAME, $params);\r\n $no_of_rows = sizeOf($result);\r\n if ($no_of_rows > 0) {\r\n // user existed \r\n return true;\r\n } else {\r\n // user not existed\r\n return false;\r\n }\r\n }",
"public function excluir_usuario(){\n // $this->funcionario_id = $this->funcionario_id ? $this->funcionario_id : \"null\";\n // $this->profissional_id = $this->profissional_id ? $this->profissional_id : \"null\";\n\n $sql = \" DELETE FROM usuario WHERE login = '{$this->login}' \";\n $qry = pg_query($sql);\n \n return pg_affected_rows($qry) ? true : false;\n }",
"public function isUserExist(){\r\n //connect to database\r\n $con = new mysqli(DB_SERVER, DB_USER, DB_PASS, DB_NAME);\r\n \r\n // Check connection\r\n if ($con->connect_error) {\r\n die(\"Connection failed: \" . $con->connect_error);\r\n }\r\n\r\n $uname = $this->username;\r\n\r\n $res = mysqli_query($con, \"SELECT username FROM user WHERE username = '$uname'\") or die(\"Error \" . mysqli_error($con));\r\n\r\n if(mysqli_num_rows($res)>0){\r\n return \"Username already taken.\";\r\n }else{\r\n return null;\r\n }\r\n }",
"public function isuserexist($dni) {\n\n $result = mysql_query(\"SELECT DNI from PERSONA WHERE DNI = '$dni'\");\n\n $num_rows = mysql_num_rows($result); //numero de filas retornadas\n\n if ($num_rows > 0) {\n\n // el usuario existe \n return true;\n } else {\n // no existe\n return false;\n }\n }",
"function comprobarRegistro(){\n\n\t\t$sql = \"SELECT * FROM USUARIO WHERE login = '$this->login'\";\n\n\t\t$result = $this->mysqli->query($sql);\n\t\t$total_tuplas = mysqli_num_rows($result);\n\n\t\tif ($total_tuplas > 0){ // esi hay mas de 0 tuplas, existe ya el usuarios\n\t\t\t$this->lista['mensaje'] = 'ERROR: El usuario ya existe';\n\t\t\treturn $this->lista;\n\t\t\t}\n\t\telse{\n\t \treturn true; //no existe el usuario\n\t\t}\n\n\t}",
"public static function existeCuenta(String $user):bool{\n $userLC = strtolower($user);\n $stmt = self::$dbh->prepare(self::$consulta_user);\n $stmt->bindValue(1, $userLC);\n $stmt->execute();\n if($stmt->rowCount() > 0){ \n return true;\n }\n return false;\n }",
"public function checkUsuarios($usuario){\n\t\t$sql = \"SELECT PK_id_usuario, correo FROM usuarios WHERE correo = ?\";\n\t\t$params = array($usuario);\n\t\t$data = Database::getRow($sql, $params);\n\t\tif($data){\n\t\t\t$this->PK_id_usuario = $data['PK_id_usuario'];\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"public static function existeUsuario($matricula){\n $user=Doctrine_Query::create()\n ->select(\"*\")\n ->from('Usuario u')\n ->where(\"u.matricula=?\",$matricula)\n ->orWhere(\"u.usuario_espol=?\",$matricula)\n ->orWhere(\"u.cedula=?\",$matricula)\n ->execute();\n \n if($user->count()==0){\n return false;\n }else{\n return true;\n }\n }"
] | [
"0.73518336",
"0.7327069",
"0.72679013",
"0.7236399",
"0.71255606",
"0.7040708",
"0.7023433",
"0.7018223",
"0.7008158",
"0.6979644",
"0.69547963",
"0.69332194",
"0.6907275",
"0.68451726",
"0.681925",
"0.6795721",
"0.67902106",
"0.6782195",
"0.677827",
"0.67720324",
"0.67667955",
"0.67658585",
"0.67609227",
"0.67565346",
"0.672683",
"0.6719531",
"0.6709643",
"0.670797",
"0.6704523",
"0.67009896"
] | 0.7328682 | 1 |
Solicita la lista de ciudades con su respectivo kilometraje | function dar_kilometraje_ciudades() {
$this->db->select('id_ciudad, ciudad, kilometraje');
$query = $this->db->get('kilometraje_ciudades');
return $query->result();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function Cajero() {\n $this->result = new OperationResult();\n $this->min_denominacion = min($this->denominaciones);\n asort($this->denominaciones);\n foreach ($this->denominaciones as $value) {\n $this->billetes[] = new Billete($value, 0);\n }\n }",
"function Compartilhamento($cliques)\n{\n $compartilhamentos = $cliques * PORCENTAGEM_COMPARTILHAMENTO_SOCIAL;\n\n return $compartilhamentos;\n}",
"public function cesta() {\n\t\t$sql = \"SELECT COUNT(*) as num_cesta from cesta \n\t\t\twhere id_usuario='\".$this->session->id_usuario.\"' \n\t\t\tAND gestionado='0'\";\n\t\t$num_cesta = $this->db->query($sql)->result();\n\t\tforeach ($num_cesta[0] as $key => $value) {\n\t\t\t$cesta[0][$key] = $value;\n\t\t}\n\t\treturn $cesta;\n\t}",
"public function getOngkos($provinsi, $kota , $invoice = 'AGFX2016102101392569')\n {\n // 152 jakarta Pusat\n $this->db->select('master_invoice.invoice, master_product.prod_name, client_aecode.name, email, client_aecode_address.city_id, master_product.prod_weight');\n $this->db->from('master_invoice');\n $this->db->join('master_cart', 'master_invoice.invoice = master_cart.invoice');\n $this->db->join('master_product','master_cart.id_prod = master_product.id');\n $this->db->join('client_aecode', 'master_product.aecodeid = client_aecode.aecodeid');\n $this->db->join('client_aecode_address', 'client_aecode.aecodeid = client_aecode_address.aecodeid', 'left');\n $this->db->group_by('client_aecode.aecodeid');\n $this->db->where('master_invoice.invoice', $invoice);\n $get = $this->db->get();\n\n foreach ($get->result() as $key => $value) {\n $kota_pengririm = ($value->city_id == null) ? 152 : $value->city_id;\n // var_dump($kota);\n $cities[] = $this->rajaongkir->cost($kota_pengririm, $kota, $value->prod_weight, 'jne');\n }\n // print_r($cities);\n foreach ($cities as $key => $value) {\n\n # code...\n $decode = json_decode($value);\n $ongkir = array();\n foreach($decode->rajaongkir->results as $results):\n foreach($results->costs as $costs):\n $ongkir_int = $costs->cost[0]->value;\n $ongkir[$costs->service] = @$ongkir[$costs->service] + $ongkir_int;\n endforeach;\n endforeach;\n }\n echo json_encode($ongkir, JSON_PRETTY_PRINT);\n // origin=501&destination=114&weight=1700&courier=jne\n // $cities = $this->rajaongkir->cost($kota, $destination, $weight, $courier);\n\n }",
"function tot_homi_caroni_mes() {\n\t\tinclude_once 'connections/guayana_s.php';\n\t\t$conexion=new Conexion();\n\t\t$db=$conexion->getDbConn();\n\t\t$db->debug = false;\n\t\t$db->SetFetchMode(ADODB_FETCH_ASSOC);\n\t\t$muni_id = 3;\n\t\t$delito_deta = 7;\n\t\t$query_sucesos = $db->Prepare(\"SELECT COUNT(fecha_suceso) AS tot_homi_me, YEAR(now()) AS an, MONTH(now()) AS me\n\t\t\tFROM sucesos AS s\n\t\t\tWHERE YEAR(fecha_suceso) = YEAR(now()) AND MONTH(fecha_suceso) = MONTH(now()) AND municipio_id = $municipio_id AND delito_detalle_id = $delito_deta\");\n\t\t$rs_sucesos = $db->Execute($query_sucesos);\n\t\t$i = 0;\n\t\t$sucesos = array();\n\t\tforeach ($rs_sucesos as $suceso) {\n\t\t\t$sucesos[$i][1] = $suceso['tot_homi_me'];\n\t\t\t$sucesos[$i][2] = $suceso['an'];\n\t\t\t$sucesos[$i][3] = $suceso['me'];\n\t\t\t$i++;\n\t\t}\n\t\t//$sucesos[$i][\"tot_homi_mes\"] = $rs_sucesos->Fields('tot_homi_me');\n\t\t//$sucesos[$i][\"ano\"] = $rs_sucesos->Fields('an');\n\t\t//$sucesos[$i][\"mes\"] = $rs_sucesos->Fields('me');\n\n\t\treturn $sucesos;\n\t}",
"function minutyNaPrednske($conn,$poleLudi){\n\n\n\n $pocet =pocetTabuliek($conn);\n $minutyNaPrednaske = array();\n\n foreach ($poleLudi as $clovek){\n $osobaNaPrednaske=array();\n for ($i =0; $i<$pocet; $i++){\n\n $db = \"Predanaska\".$i;\n $meno='\"'.$clovek['meno'].'\"';\n $sql = 'select * from '.$db.' where meno='.$meno.' ;';\n $stm = $conn->prepare($sql);\n $stm->execute();\n $statistiky = $stm->fetchALl(PDO::FETCH_ASSOC);\n\n $cas =0;\n foreach ($statistiky as $item) {\n\n if ($item['akcia']==\"Joined\"){\n $datumAcas = explode(' ', $item['datum']);\n $cas = $cas + minutes($datumAcas[1]);\n }\n else{\n $datumAcas = explode(' ', $item['datum']);\n $cas = $cas - minutes($datumAcas[1]);\n }\n\n }\n $minuty = round(abs($cas),2);\n array_push($osobaNaPrednaske,$minuty);\n\n\n\n }\n\n array_push($minutyNaPrednaske,$osobaNaPrednaske);\n }\n\n return $minutyNaPrednaske;\n\n}",
"public function detalle_coincidencias()\n {\n if (!$this->session->userdata('user_id') || !$this->uri->segment(2)) {\n $this->session->set_flashdata('error', 'Necesitas ingresar con tu email y contraseña.');\n redirect('ingreso');\n }\n $citas = $this->cita->citas_by_evento($this->uri->segment(2), $this->session->userdata('user_id'));\n\n $listado_citas = [];\n foreach ($citas as $cita) {\n $mi_cita = $this->usuario->get_record($cita->cita_id);\n\n $yo_marque = $this->cita->check_clasificacion($this->uri->segment(2), $this->session->userdata('user_id'),$cita->cita_id);\n $me_marcaron = $this->cita->check_clasificacion($this->uri->segment(2), $cita->cita_id, $this->session->userdata('user_id'));\n\n $datos_cita = \"\";\n if($yo_marque == 1 AND $me_marcaron == 1){\n $estado = \"Flechazo\";\n $datos_cita = ['tel_cita' => $mi_cita->telcontacto, 'email_cita' => $mi_cita->email ];\n }elseif ($yo_marque == 1 AND $me_marcaron == 2) {\n $estado = \"Amistad\";\n $datos_cita = ['tel_cita' => $mi_cita->telcontacto, 'email_cita' => $mi_cita->email ];\n }elseif ($me_marcaron == 1 AND $yo_marque == 2) {\n $estado = \"Amistad\";\n $datos_cita = ['tel_cita' => $mi_cita->telcontacto, 'email_cita' => $mi_cita->email ];\n }elseif ($me_marcaron == 2 AND $yo_marque == 2) {\n $estado = \"Amistad\";\n $datos_cita = ['tel_cita' => $mi_cita->telcontacto, 'email_cita' => $mi_cita->email ];\n }else{\n $estado = \"Sin afinidad\";\n }\n\n $cita_avatar = $this->imagenes_usuario->usuario_avatar($cita->cita_id);\n $perfil_cita = [\"cita_nickname\" => $mi_cita->nickname, 'cita_avatar' => $cita_avatar];\n\n //array_pasado la front\n $cita_detalle = ['info_cita' => $perfil_cita,\n 'yo_marque' => $yo_marque,\n 'me_marcaron' => $me_marcaron,\n 'estado' => $estado,\n 'contacto' => $datos_cita,\n ];\n $listado_citas[] = $cita_detalle;\n }\n\n $data['query'] = $this->usuario->get_record($this->session->userdata('user_id'));\n $data['citas'] = $listado_citas;\n $data['content'] = 'frontend/detalle-coincidencias';\n $this->load->view('frontend_main', $data);\n }",
"function listarCierreCaja(){\r\n $this->procedimiento='vef.ft_apertura_cierre_caja_sel';\r\n $this->transaccion='VF_CIE_SEL';\r\n $this->tipo_procedimiento='SEL';//tipo de transaccion\r\n //$this->setCount(false);\r\n\r\n $this->setParametro('fecha','fecha','date');\r\n //Definicion de la lista del resultado del query\r\n $this->captura('id_apertura_cierre_caja','int4');\r\n $this->captura('id_sucursal','int4');\r\n $this->captura('id_punto_venta','int4');\r\n $this->captura('nombre_punto_venta','varchar');\r\n $this->captura('obs_cierre','text');\r\n $this->captura('monto_inicial','numeric');\r\n $this->captura('obs_apertura','text');\r\n $this->captura('monto_inicial_moneda_extranjera','numeric');\r\n $this->captura('estado','varchar');\r\n $this->captura('fecha_apertura_cierre','date');\r\n $this->captura('arqueo_moneda_local','numeric');\r\n $this->captura('arqueo_moneda_extranjera','numeric');\r\n //$this->captura('monto_boleto_moneda_base','numeric');\r\n //$this->captura('monto_boleto_moneda_ref','numeric');\r\n $this->captura('monto_base_fp_boleto','numeric');\r\n $this->captura('monto_ref_fp_boleto','numeric');\r\n $this->captura('monto_base_fp_ventas','numeric');\r\n $this->captura('monto_ref_fp_ventas','numeric');\r\n //$this->captura('monto_cc_boleto_bs','numeric');\r\n //$this->captura('monto_cc_boleto_usd','numeric');\r\n\r\n //Ejecuta la instruccion\r\n $this->armarConsulta();\r\n $this->ejecutarConsulta();\r\n\r\n //Devuelve la respuesta\r\n return $this->respuesta;\r\n }",
"private function doMeusCursos() {\r\n\t\t\r\n\t\t$palavra = $this->system->session->getItem('palavra_busca');\r\n\t\tif ($palavra) $this->system->session->deleteItem('palavra_busca');\r\n\r\n\t\t$cursos = $this->system->curso->getCursosByAluno($this->system->session->getItem('session_cod_usuario'), $palavra);\t\t\r\n\t\t$concluidos = array();\r\n\t\t$andamento = array();\r\n\r\n\t\t$certificado = $this->system->configuracoesgerais->getProdutosCertificados();\r\n\r\n\t\tforeach ($cursos as $curso) {\r\n\t\t\t// tipo venda\t\t\t\t\t\t\r\n\t\t\tif($curso['plano_id'] != '' && $curso['plano_id'] != 0){\r\n\t\t\t\t$plano = $this->system->planos->getPlano($curso['plano_id']);\t\r\n\t\t\t\t$curso['tipo_venda'] = 'Plano '.$plano['plano'];\r\n\t\t\t}else{\r\n\t\t\t\t$curso['tipo_venda'] = 'Avulso';\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t//ultima aula\r\n\t\t\t\r\n\t\t\t$ultimaAula = $this->system->aulas->getAula($curso['ultima_aula']);\r\n\r\n\t\t\tif ($ultimaAula['aula_id']) $curso['aula'] = $ultimaAula['nome'];\r\n\r\n\t\t\t//professor\r\n\t\t\t$professor = $this->system->professores->getProfessor($curso['professor_id']);\r\n\t\t\tif ($professor['id']) $curso['professor'] = $professor['nome'];\r\n\r\n\t\t\t//porcentagem\r\n\t\t\t\r\n\t\t\tif ($curso['aulas_assistidas'])\r\n\t\t\t\t$curso['porcentagem'] = round(($curso['aulas_assistidas']/$curso['aulas_total'])*100);\r\n\t\t\telse \r\n\t\t\t\t$curso['porcentagem'] = 0;\r\n\r\n\r\n\t\t\tif ($curso['aulas_assistidas'] >= $curso['aulas_total'])\r\n\t\t\t\t$concluidos[] = $curso;\r\n\t\t\telse \r\n\t\t\t\t$andamento[] = $curso;\r\n\t\t}\r\n\t\t$this->system->view->assign(array(\r\n\t\t\t'url_site'\t\t=> \t$this->system->getUrlSite(),\r\n\t\t\t'concluidos'\t=>\t$concluidos,\r\n\t\t\t'andamento'\t\t=>\t$andamento,\r\n\t\t\t'certificado'\t=> ($certificado['produtos_certificado_tipo'] == 0 ? false: true)\r\n\t\t));\r\n\t\t\r\n\t\t$this->system->admin->topo(2);\r\n\t\t$this->system->view->display('aluno/cursos.tpl');\r\n\t\t$this->system->admin->rodape();\r\n\t}",
"function tot_homi_caroni_mes_ant() {\n\t\t//include_once 'connections/guayana_s.php';\n\t\t$conexion=new Conexion();\n\t\t$db=$conexion->getDbConn();\n\t\t$db->debug = false;\n\t\t$db->SetFetchMode(ADODB_FETCH_ASSOC);\n\t\t$muni_id = 3;\n\t\t$delito_deta = 7;\n\n\t\t$mes = mes_act();\n\n\t\t$query_sucesos = $db->Prepare(\"SELECT COUNT(fecha_suceso) AS tot_car_homi_mes_ant\n\t\t\tFROM sucesos AS s\n\t\t\tWHERE YEAR(fecha_suceso) = YEAR(now()) AND MONTH(fecha_suceso) = MONTH(DATE_ADD(CURDATE(),INTERVAL -1 MONTH))\n\t\t\tAND municipio_id = $muni_id AND delito_detalle_id = 7\");\n\n\t\t//solo mes 1\n\t\tif ($mes==1){\n\t\t\t$query_sucesos = $db->Prepare(\"SELECT COUNT(fecha_suceso) AS tot_car_homi_mes_ant\n\t\t\tFROM sucesos AS s\n\t\t\tWHERE YEAR(fecha_suceso) = YEAR(now())-1 AND MONTH(fecha_suceso) = MONTH(DATE_ADD(CURDATE(),INTERVAL -1 MONTH))\n\t\t\tAND municipio_id = $muni_id AND delito_detalle_id = $delito_deta\");\n\n\t\t}\n\t\t//San Felix\n\t\t$query_homici_mes_ant_sf = $db->Prepare(\"SELECT count(*) AS acu_mes_ant_sf\n\t\t\tFROM `sucesos` AS s\n\t\t\tINNER JOIN parroquias AS p ON s.parroquia_id = p.parroquia_id\n\t\t\tWHERE year(fecha_suceso) =year(now()) AND MONTH(fecha_suceso)=(Month(now())-1)\n\t\t\tAND s.municipio_id = $muni_id AND delito_detalle_id = $delito_deta AND capital_sector = 'sf'\");\n\n\t\t//solo mes 1\n\t\tif ($mes==1){\n\t\t\t$query_homici_mes_ant_sf = $db->Prepare(\"SELECT count(*) AS acu_mes_ant_sf\n\t\t\tFROM `sucesos` AS s\n\t\t\tINNER JOIN parroquias AS p ON s.parroquia_id = p.parroquia_id\n\t\t\tWHERE YEAR(fecha_suceso) = YEAR(now())-1 AND MONTH(fecha_suceso) = MONTH(DATE_ADD(CURDATE(),INTERVAL -1 MONTH))\n\t\t\tAND s.municipio_id = $muni_id AND delito_detalle_id = $delito_deta AND capital_sector = 'sf'\");\n\n\t\t}\n\t\t//Puerto Ordaz\n\t\t$query_homici_mes_ant_poz = $db->Prepare(\"SELECT count(*) AS acu_mes_ant_poz\n\t\t\tFROM `sucesos` AS s\n\t\t\tINNER JOIN parroquias AS p ON s.parroquia_id = p.parroquia_id\n\t\t\tWHERE year(fecha_suceso) =year(now()) AND MONTH(fecha_suceso)=(Month(now())-1)\n\t\t\tAND s.municipio_id = $muni_id AND delito_detalle_id = $delito_deta AND capital_sector = 'poz'\");\n\n\t\t//solo mes 1\n\t\tif ($mes==1){\n\t\t\t$query_homici_mes_ant_poz = $db->Prepare(\"SELECT count(*) AS acu_mes_ant_poz\n\t\t\tFROM `sucesos` AS s\n\t\t\tINNER JOIN parroquias AS p ON s.parroquia_id = p.parroquia_id\n\t\t\tWHERE YEAR(fecha_suceso) = YEAR(now())-1 AND MONTH(fecha_suceso) = MONTH(DATE_ADD(CURDATE(),INTERVAL -1 MONTH))\n\t\t\tAND s.municipio_id = $muni_id AND delito_detalle_id = $delito_deta AND capital_sector = 'poz'\");\n\n\t\t}\n\n\t\t$rs_sucesos = $db->Execute($query_sucesos);\n\t\t//4-1-17, devuelve varias campos tipo endpoint, en un array, para no tener q llamar varias funciones\n\t\t$rs_homici_mes_ant_sf = $db->Execute($query_homici_mes_ant_sf);\n\t\t$rs_homici_mes_ant_poz = $db->Execute($query_homici_mes_ant_poz);\n\t\t\n\n\t\t$homi_car_mes_ant = $rs_sucesos->Fields('tot_car_homi_mes_ant');\n\t\t$homi_car_mes_ant_sf = $rs_homici_mes_ant_sf->Fields('acu_mes_ant_sf');\n\t\t$homi_car_mes_ant_poz = $rs_homici_mes_ant_poz->Fields('acu_mes_ant_poz');\n\t\treturn array($homi_car_mes_ant,$homi_car_mes_ant_sf,$homi_car_mes_ant_poz);\n\t\t//return $homi_car_mes_ant;\n\t}",
"public function get_precios($totalhabil,$totalfines,$clientevip) \n { \n $sql= \"SELECT * FROM hotel \";\n $result = $this->_db->query($sql); \n $reservas= $result->fetch_all(MYSQLI_ASSOC); \n\n $con = 0; \n foreach ($reservas as $row)\n { \n if ($clientevip == 'SI')\n { \n $preciofinsemana= $row['preciovipsd'] *$totalfines; \n $preciolunvin= $row['precioviplv'] * $totalhabil;\n $preciototal = $preciofinsemana + $preciolunvin;\n \n }else{\n $preciofinsemana= $row['precioregularsd'] *$totalfines; \n $preciolunvin= $row['precioregularlv'] * $totalhabil;\n $preciototal = $preciofinsemana + $preciolunvin;\n }\n $con = $con +1; \n if ($con == 1)\n { \n $preciomenor = $preciototal ;\n $array = array($row['id_hotel'],$row['nombre'],$preciomenor);\n } \n if ($preciomenor >= $preciototal)\n { \n $preciomenor = $preciototal ;\n $array = array($row['id_hotel'],$row['nombre'],$preciomenor);\n }\n \n } \n\n return $array;\n }",
"function CodigosCentro(){\n\t\t//query sql\n\t\t$sql = \"SELECT CODCENTRO\n\t\t\t\tFROM CENTRO\";\n\t\tif (!$resultado = $this->mysqli->query($sql)) //error base de datos\n\t\t{\n\t\t\treturn 'Error de gestor de base de datos';\n\t\t}\n\t\telse //query ok, \n\t\t{\n\t\t\t$toret = array(); //array de codedificio a devolver\n\t\t\twhile ($row=$resultado->fetch_array()) { //recorro todas las filas que ha devuelto fetcharray\n\t\t\t\tarray_push($toret,$row[0]);\n\t\t\t}\n\t\t}\n\t\treturn $toret;\n\t}",
"public function calcNumKmComTanqueCheio()\n {\n $km = $this -> volumeTanque * 15;\n return $km;\n }",
"public function getCutiKhusus()\n\t\t{\n\t\t\t$this->db->select('*');\n\t\t\t$this->db->from('tb_cuti_karyawan');\n\t\t\t$this->db->join('tb_karyawan','tb_karyawan.id_kar=tb_cuti_karyawan.id_kar','LEFT');\n\t\t\t$this->db->where('tipe_cukar',\"KHUSUS\");\n\t\t\t$this->db->where('stat_cukar !=',\"BATAL\");\n\t\t\t$this->db->order_by('id_cukar','DESC');\n\t\t\t$data = $this->db->get();\n\t\t\treturn $data->result_array();\n\t\t}",
"public function hitungratingkecocokan()\r\n\t{\r\n\t\t$sql=\"select *,max(nilairating) as maxkriteria from ratingkecocokan group by idkriteria\";\r\n\t\t$qmax=$this->db->query($sql);\r\n\t\t//hitung nilai r per kriteria tergantung jenisnya cost atau benefit\r\n\t\tforeach ($qmax->result() as $rekk) {\r\n\t\t\t$sqlk=\"select * from kriteria where idkriteria='\".$rekk->idkriteria.\"'\";\r\n\t\t\t$qk=$this->db->query($sqlk);\r\n\t\t\tforeach ($qk->result() as $rk) {\r\n\t\t\t\t$sqla=\"select * from atribut\";\r\n\t\t\t\t$qa=$this->db->query($sqla);\r\n\t\t\t\tforeach ($qa->result() as $ra) {\r\n\t\t\t\t\tif ($rk->jeniskriteria == '1') {\r\n\t\t\t\t\t\t$sqlr=\"select nilairating/\".$rekk->maxkriteria.\" as nilair from ratingkecocokan where \r\n\t\t\t idkriteria='\".$rekk->idkriteria.\"' and idatribute='\".$ra->idatribute.\"'\";\r\n } else {\r\n\t\t\t\t\t\t$sqlr=\"select \".$rekk->maxkriteria.\"/nilairating\".\" as nilair from ratingkecocokan where \r\n\t\t\t idkriteria='\".$rekk->idkriteria.\"' and idatribute='\".$ra->idatribute.\"'\";\t\r\n\t\t\t }\r\n $qr=$this->db->query($sqlr);$nilair=0;\r\n foreach ($qr->result() as $rr) {\r\n\t\t\t\t\t $bobotnormalisasi=$rk->bobotpreferensi * $rr->nilair;\r\n\t\t\t\t\t $nilair=$rr->nilair;\r\n\t\t\t $sqlri=\"update ratingkecocokan set nilainormalisasi = '\".$nilair.\"' , \r\n\t\t\t\t\t bobotnormalisasi = \".$bobotnormalisasi.\" where \r\n\t\t\t\t\t idkriteria ='\".$rekk->idkriteria.\"' and idatribute='\".$ra->idatribute.\"'\";\r\n\t\t\t $qri=$this->db->query($sqlri);\r\n }\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//hitungnilaipreferensi\r\n\t\t$sqla=\"select * from atribut\";\r\n\t\t$qa=$this->db->query($sqla);\r\n\t\tforeach ($qa->result() as $ra) {\r\n\t\t\t$sqlr=\"select sum(bobotnormalisasi) as nilaipreferensi from ratingkecocokan \r\n\t\t\twhere idatribute='\".$ra->idatribute.\"' group by idatribute\";\r\n\t\t\t$qr=$this->db->query($sqlr);\r\n\t\t\tforeach ($qr->result() as $rr) {\r\n\t\t\t\t$sqlua=\"update atribut set nilaipreferensi=\".$rr->nilaipreferensi.\" \r\n\t\t\t\twhere idatribute='\".$ra->idatribute.\"'\";\r\n\t\t\t\t$qua=$this->db->query($sqlua);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn; \r\n\t}",
"public function leerCitas($ciu)\n {\n $consulta = $this->db->query(\"SELECT * FROM vista_citas_pacientes_medicos WHERE CIU_paciente = ? AND estado = '0'\", array($ciu));\n\n //ejecutamos la consulta y devolvemos el array de citas\n $citas = $consulta->result_array();\n\n return $citas;\n }",
"function listarAperturaCierreCajaVentas(){\r\n $this->procedimiento='vef.ft_apertura_cierre_caja_sel';\r\n $this->transaccion='VF_LISCAR_SEL';\r\n $this->tipo_procedimiento='SEL';//tipo de transaccion\r\n $this->setCount(false);//tipo de transaccion\r\n\r\n $this->setParametro('id_apertura_cierre_caja','id_apertura_cierre_caja','int4');\r\n\r\n //Definicion de la lista del resultado del query\r\n $this->captura('cajero','varchar');\r\n $this->captura('fecha','varchar');\r\n $this->captura('pais','varchar');\r\n $this->captura('estacion','varchar');\r\n $this->captura('punto_venta','varchar');\r\n $this->captura('obs_cierre','varchar');\r\n // $this->captura('arqueo_moneda_local','numeric');\r\n // $this->captura('arqueo_moneda_extranjera','numeric');\r\n $this->captura('monto_inicial','numeric');\r\n $this->captura('monto_inicial_moneda_extranjera','numeric');\r\n $this->captura('tipo_cambio','numeric');\r\n $this->captura('tiene_dos_monedas','varchar');\r\n $this->captura('moneda_local','varchar');\r\n $this->captura('moneda_extranjera','varchar');\r\n $this->captura('cod_moneda_local','varchar');\r\n $this->captura('cod_moneda_extranjera','varchar');\r\n $this->captura('efectivo_ventas_ml','numeric');\r\n $this->captura('efectivo_ventas_me','numeric');\r\n $this->captura('tarjeta_ventas_ml','numeric');\r\n $this->captura('tarjeta_ventas_me','numeric');\r\n $this->captura('cuenta_corriente_ventas_ml','numeric');\r\n $this->captura('cuenta_corriente_ventas_me','numeric');\r\n $this->captura('mco_ventas_ml','numeric');\r\n $this->captura('mco_ventas_me','numeric');\r\n $this->captura('otros_ventas_ml','numeric');\r\n $this->captura('otros_ventas_me','numeric');\r\n /***************recuperacion recibos*****************/\r\n $this->captura('efectivo_recibo_ml','numeric');\r\n $this->captura('efectivo_recibo_me','numeric');\r\n $this->captura('tarjeta_recibo_ml','numeric');\r\n $this->captura('tarjeta_recibo_me','numeric');\r\n $this->captura('cuenta_corriente_recibo_ml','numeric');\r\n $this->captura('cuenta_corriente_recibo_me','numeric');\r\n $this->captura('deposito_recibo_ml','numeric');\r\n $this->captura('deposito_recibo_me','numeric');\r\n $this->captura('otros_recibo_ml','numeric');\r\n $this->captura('otros_recibo_me','numeric');\r\n /************************************************/\r\n $this->captura('monto_ca_boleto_bs','numeric');\r\n $this->captura('monto_cc_boleto_bs','numeric');\r\n $this->captura('monto_cte_boleto_bs','numeric');\r\n $this->captura('monto_mco_boleto_bs','numeric');\r\n $this->captura('monto_ca_boleto_usd','numeric');\r\n $this->captura('monto_cc_boleto_usd','numeric');\r\n $this->captura('monto_cte_boleto_usd','numeric');\r\n $this->captura('monto_mco_boleto_usd','numeric');\r\n $this->captura('monto_ca_recibo_ml','numeric');\r\n\r\n $this->captura('otro_boletos_ml','numeric');\r\n $this->captura('otros_boletos_me','numeric');\r\n\r\n $this->captura('monto_cc_recibo_ml','numeric');\r\n $this->captura('monto_ca_recibo_me','numeric');\r\n $this->captura('monto_cc_recibo_me','numeric');\r\n $this->captura('arqueo_moneda_local','numeric');\r\n $this->captura('arqueo_moneda_extranjera','numeric');\r\n //Ejecuta la instruccion\r\n $this->armarConsulta();\r\n $this->ejecutarConsulta();\r\n //var_dump($this->respuesta);exit;\r\n //Devuelve la respuesta\r\n return $this->respuesta;\r\n }",
"public function horario_profesor_ciclo_actual()\n {\n //$codigo = $_SESSION[\"Codigo\"];\n //$token = $_SESSION[\"Token\"];\n \n $codigo = $_COOKIE[$this->services->get_fuzzy_name(\"Codigo\")];\n $this->services->set_cookie(\"Codigo\",$codigo, time() + (1800), \"/\");\n\n ee()->db->select('*');\n ee()->db->where('codigo',$codigo);\n $query_modelo_result = ee()->db->get('exp_user_upc_data');\n\n foreach($query_modelo_result->result() as $row){\n $token = $row->token;\n }\n\n $url = 'HorarioProfesor/?Codigo='.$codigo.'&Token='.$token;\n\n $result=$this->services->curl_url($url);\n $json = json_decode($result, true);\n \n $error = $json['CodError'];\n $error_mensaje = $json['MsgError']; \n \n //limpio la variable para reutilizarla\n $result = '';\n \n //genera el tamano del array\n $tamano = count($json['HorarioDia']); \n \n for ($i=0; $i<$tamano; $i++) {\n $result .= '<div>';\n $result .= '<span class=\"zizou-16\">';\n if ($json['HorarioDia'][$i]['CodDia'] == 1) {\n $result .= 'Lunes';\n }\n if ($json['HorarioDia'][$i]['CodDia'] == 2) {\n $result .= 'Martes';\n } \n if ($json['HorarioDia'][$i]['CodDia'] == 3) {\n $result .= 'Miércoles';\n } \n if ($json['HorarioDia'][$i]['CodDia'] == 4) {\n $result .= 'Jueves';\n } \n if ($json['HorarioDia'][$i]['CodDia'] == 5) {\n $result .= 'Viernes';\n } \n if ($json['HorarioDia'][$i]['CodDia'] == 6) {\n $result .= 'Sábado';\n } \n $result .= '</span>';\n $result .= '</div>'; \n $result .= '<div class=\"panel-body red-line mb-7\">';\n $result .= '<div class=\"panel-body-head-table white\">'; \n $result .= '<ul class=\"tr\">'; \n $result .= '<li class=\"col-sm-1-5 col-xs-1-5 col-md-2 \">'; \n $result .= '<div class=\"\"><span>Inicio</span></div>'; \n $result .= '</li>'; \n $result .= '<li class=\"col-sm-1-5 col-xs-1-5 col-md-2\">'; \n $result .= '<div class=\"\"><span>Fin</span></div>'; \n $result .= '</li>'; \n $result .= '<li class=\"col-sm-4-5 col-xs-4-5 col-md-5 \">'; \n $result .= '<div class=\"\"><span>Clase</span></div>'; \n $result .= '</li>'; \n $result .= '<li class=\"col-sm-1-5 col-xs-1-5 col-md-2 \">'; \n $result .= '<div class=\"\"><span>Sede</span></div>'; \n $result .= '</li>'; \n $result .= '<li class=\"col-sm-1-5 col-xs-1-5 col-md-2\">'; \n $result .= '<div class=\"\"><span>Sección</span></div>'; \n $result .= '</li>'; \n $result .= '<li class=\"col-sm-1-5 col-xs-1-5 col-md-2 \">'; \n $result .= '<div class=\"\"><span>Salón</span></div>'; \n $result .= '</li>'; \n $result .= '</ul>'; \n $result .= '</div>'; \n \n //genera el tamano del array\n $tamano_int = count($json['HorarioDia'][$i]['Clases']); \n \n for ($b=0; $b<$tamano_int; $b++) {\n $result .= '<div class=\"panel-table\">'; \n $result .= '<ul class=\"tr mis-cursos-row\">'; \n $result .= '<li class=\"col-sm-1-5 col-xs-1-5 col-md-2 \">'; \n $result .= '<div class=\"text-center\">';\n $result .= '<span>';\n $HoraInicio = substr($json['HorarioDia'][$i]['Clases'][$b]['HoraInicio'], 0, 2);\n $HoraInicio = ltrim($HoraInicio,'0');\n $result .= $HoraInicio.':00';\n $result .='</span>'; \n $result .= '</div>'; \n $result .= '</li>'; \n $result .= '<li class=\"col-sm-1-5 col-xs-1-5 col-md-2 \">';\n $result .= '<div class=\"text-center\">'; \n $result .= '<span>';\n $HoraFin = substr($json['HorarioDia'][$i]['Clases'][$b]['HoraFin'], 0, 2);\n $HoraFin = ltrim($HoraFin,'0');\n $result .= $HoraFin.':00'; \n $result .='</span>'; \n $result .= '</div>'; \n $result .= '</li>'; \n $result .= '<li class=\"col-sm-4-5 col-xs-4-5 col-md-5\">'; \n $result .= '<div class=\"text-center\">'; \n $result .= '<span>';\n $result .= $json['HorarioDia'][$i]['Clases'][$b]['CursoNombre'];\n $result .= '</span>'; \n $result .= '</div>'; \n $result .= '</li>'; \n $result .= '<li class=\"col-sm-1-5 col-xs-1-5 col-md-2 \">'; \n $result .= '<div class=\"text-center\">'; \n $result .= '<span>';\n $result .= $json['HorarioDia'][$i]['Clases'][$b]['Sede'];\n $result .= '</span>'; \n $result .= '</div>'; \n $result .= '</li>'; \n $result .= '<li class=\"col-sm-1-5 col-xs-1-5 col-md-2\" >'; \n $result .= '<div class=\"text-center\">'; \n $result .= '<span>';\n $result .= $json['HorarioDia'][$i]['Clases'][$b]['Seccion'];\n $result .= '</span>'; \n $result .= '</div>'; \n $result .= '</li>'; \n $result .= '<li class=\"col-sm-1-5 col-xs-1-5 col-md-2 \">'; \n $result .= '<div class=\"text-center\">'; \n $result .= '<span>';\n $result .= $json['HorarioDia'][$i]['Clases'][$b]['Salon'];\n $result .= '</span>'; \n $result .= '</div>'; \n $result .= '</li>'; \n $result .= '</ul>'; \n $result .= '</div>'; \n } \n $result .= '</div>';\n }\n\n //Control de errores\n if ($error!='00000') {\n $result = '';\n $result .= '<div>';\n $result .= '<div class=\"panel-body mb-35\">';\n $result .= '<div class=\"panel-table\">';\n $result .= '<ul class=\"tr mis-cursos-row\">';\n $result .= '<li class=\"col-xs-12\">';\n $result .= '<span>'.$error_mensaje.'</span>';\n $result .= '</li>'; \n $result .= '</ul>'; \n $result .= '</div>';\n $result .= '</div>'; \n $result .= '</div>'; \n } \n \n return $result; \n }",
"public function cortesia()\n {\n $this->costo = 0;\n }",
"public function get_cargosJefe($centro_costo,$cod_jefe){\n\t\t\t\n\t\t\tunset($this->lista); //limpiar variable\n\t\t\t\n\t\t\ttry { \n\t\t\t\tglobal $conn;\n\t\t\t\t$sql=\"SELECT distinct c.cod_car, C.NOM_CAR \n\t\t\t\t\t FROM CARGOS C, CENTROCOSTO2 AREA, EMPLEADOS_BASIC EPL, EMPLEADOS_GRAL GRAL\n\t\t\t\t\t\tWHERE EPL.COD_EPL = GRAL.COD_EPL\n\t\t\t\t\t\tAND EPL.COD_CC2='\".$centro_costo.\"'\n\t\t\t\t\t\tAND EPL.COD_CAR=C.COD_CAR\n\t\t\t\t\t\tAND gral.COD_JEFE = '\".$cod_jefe.\"'\n\t\t\t\t\t\torder by nom_car asc\n\t\t\t\t\t\t\";\n\t\t\t\t\t\t\n\t\t\t\t$rs=$conn->Execute($sql);\n\t\t\t\twhile($fila=$rs->FetchRow()){\n\t\t\t\t\t$this->lista[]=array(\"codigo\" => $fila[\"cod_car\"],\n\t\t\t\t\t\t\t\t\t\t \"cargos\"=> utf8_encode($fila[\"NOM_CAR\"]));\n\t\t\t\t}\n\t\t\t\n\t\t\t\treturn $this->lista;\n\t\t\t\t\n\t\t\t}catch (exception $e) { \n\n\t\t\t var_dump($e); \n\n\t\t\t adodb_backtrace($e->gettrace());\n\n\t\t\t} \n\t\t\n\t\t}",
"function contratos()\n{\n $avisos = new Avisos();\n $hnocump = 0;\n $k=0;\n //Clientes Finalizan contrato Hoy\n $finalizan = $avisos->finalizanContrato('hoy');\n $cadena =\"<table width='100%'>\";\n $cadena .= \"<tr><th Colspan='2'>Hoy finalizan contrato</th></tr>\";\n if (count($finalizan)) {\n foreach ($finalizan as $resultado) {\n $cadena .=\"<tr><td class='\".clase($k++).\"'>\n <a href='javascript:muestra(\".$resultado['idemp'].\")' >\"\n .$resultado['Nombre'].\"</a></td></tr>\";\n $k++;\n }\n } else {\n $hnocump++;\n $cadena.=\"<tr><td class='\".clase($k++).\"' colspan='2'>\n Nadie Finaliza contrato hoy</td></tr>\";\n }\n $cadena .= \"</table>\";\n\n // Clientes finalizan contrato este mes\n $finalizan = $avisos->finalizanContrato('hoy');\n $cadena .= \"\n <table width='100%'>\n <tr>\n <th>Dia</th>\n <th>Finalizan contrato en los proximos 30 días</th>\n </tr>\";\n if (count($finalizan)) {\n foreach ($finalizan as $resultado) {\n $cadena .=\"<tr>\n <td class='\".clase($k).\"'>\".$resultado['renovacion'].\"</td>\n <td class='\".clase($k).\"'>\n <a href='javascript:muestra(\".$resultado['idemp'].\")' >\"\n .$resultado['Nombre'].\"</a>\n </td>\n </tr>\";\n $k++;\n }\n } else {\n $hnocump++;\n $cadena.=\"<tr><td colspan='2' class='\".clase($k++).\"'>\n Nadie Finaliza contrato en los proximos 30 días</td></tr>\";\n }\n $cadena .= \"</table>\";\n // Proximos 60 dias\n $finalizan = $avisos->finalizanContrato('60');\n $cadena .= \"\n <table width='100%'>\n <tr>\n <th>Dia</th>\n <th>Finalizan contrato en los proximos 60 dias</th>\n </tr>\";\n if (count($finalizan)) {\n foreach ($finalizan as $resultado) {\n $cadena .=\"<tr>\n <td class='\".clase($k).\"'>\".$resultado['renovacion'].\"</td>\n <td class='\".clase($k).\"'>\n <a href='javascript:muestra(\".$resultado['idemp'].\")' >\"\n .$resultado['Nombre'].\"</a>\n </td></tr>\";\n $k++;\n }\n } else {\n $hnocump++;\n $cadena.=\"<tr><td colspan='2' class='\".clase($k++).\"'>\n Nadie Finaliza contrato en los proximos 60 dias</td></tr>\";\n }\n $cadena .= \"</table>\";\n return $cadena;\n}",
"private function setCnabBancos() {\n\n $bancos = $this->divideBancos();\n foreach ($bancos as $key => $value) {\n\n $this->setDadosBanco($this->Model_Banco->get($key)[0]);\n $this->setDadosContaBancaria($this->Model_Conta_Bancaria->get(\n array(\n Model_Conta_Bancaria::EMPRESA => $this->getPerguntaEmpresa(),\n Model_Conta_Bancaria::BANCO => $key,\n )\n )[0]\n );\n\n $this->setBancoAtual($key);\n\n if ($this->getDadosBanco()[Model_Banco::COD] == 237 && !$this->layout240) {\n $this->cnab200();\n } else {\n $this->cnab240();\n }\n\n $this->finalizaCnab();\n }\n }",
"function get_lista_categorias_contratos($ejercicio, $minimo)\n {\n $sqltext = \"\n select \n categoria, \n tipo, \n sum(total) as total,\n count(*) as numero \n from vpor_proveedor \n where total >= \" . $minimo . \"\n \";\n\n if(!empty($ejercicio)){\n $sqltext .= \" and ejercicio = '\" . $ejercicio . \"'\";\n }\n\n $sqltext .= \" group by categoria, tipo\";\n \n $query = $this->db->query( $sqltext );\n\n $array_items = [];\n\n if($query->num_rows() > 0)\n {\n $this->load->model('tpoadminv1/Generales_model');\n\n $cont = 0;\n foreach ($query->result_array() as $row) \n {\n /*$row_list[0] = $row['categoria'];\n $row_list[1] = $row['tipo'];\n $row_list[2] = floatval($row['numero']);\n $row_list[3] = \"monto: \" . $row['total'];*/\n $row_list = array(\n 'from' => $row['categoria'],\n 'to' => $row['tipo'],\n 'weight' => floatval($row['numero']),\n 'description' => $this->Generales_model->money_format(\"%.2n\", $row['total']) \n );\n $array_items[$cont] = $row_list;\n $cont++;\n }\n }\n\n return $array_items;\n }",
"public function cargar_lsita_centros_medicos_cupos(Request $request){\n //return \"Holas como estas\";\n $gestion = $request->gestion;\n $periodo = $request->periodo;\n $list_medical_centers = EstableSalud::list_medical_centers($request->gestion, $request->periodo);\n $tipos_internado = \\DB::table('internation_types')->where('internation_types.level_ac','=',1)->get();\n return view('designations.quotas.components.table_lista_centros_medicos',compact('list_medical_centers','tipos_internado','gestion','periodo'));\n }",
"public function detalle_de_curos_por_alumno()\n {\n //$codigo = $_SESSION[\"Codigo\"];\n //$token = $_SESSION[\"Token\"];\n\n $codigo = $_COOKIE[$this->services->get_fuzzy_name(\"Codigo\")];\n $this->services->set_cookie(\"Codigo\",$codigo, time() + (1800), \"/\");\n\n ee()->db->select('*');\n ee()->db->where('codigo',$codigo);\n $query_modelo_result = ee()->db->get('exp_user_upc_data');\n\n foreach($query_modelo_result->result() as $row){\n $token = $row->token;\n }\n \n $url = 'Inasistencia/?CodAlumno='.$codigo.'&Token='.$token;\n\n $result=$this->services->curl_url($url);\n $json = json_decode($result, true);\n \n //limpio la variable para reutilizarla\n $result = '';\n \n //genera el tamano del array\n $tamano = count($json['Cursos']);\n \n for ($i=0; $i<$tamano; $i++) {\n $result .= '<ul class=\"tr bg-muted\">';\n $result .= '<li class=\"col-sm-8 helvetica-12 pb-0\">';\n $result .= '<div>';\n $result .= '<span>'.$json['Cursos'][$i]['CursoNombre'].'</span>';\n $result .= '</div>';\n $result .= '</li>';\n $result .= '<li class=\"col-sm-2 helvetica-bold-14 curso-faltas\">';\n $result .= '<div class=\"text-center\">';\n $result .= '<span>'.$json['Inasistencias'][$i]['Total'].'/'.$json['Inasistencias'][$i]['Maximo'].'</span>';\n $result .= '</div>';\n $result .= '</li>';\n $result .= '<li class=\"col-sm-2 helvetica-bold-14 curso-promedio\">';\n\n $codcurso = $json['Inasistencias'][$i]['CodCurso'];\n \n //Loop interno para calcular notas segun curso\n $url = 'Nota/?CodAlumno='.$codigo.'&Token='.$token.'&CodCurso='.$codcurso;\n\n $result_int=$this->services->curl_url($url);\n $json_int = json_decode($result_int, true);\n \n //genera el tamano del array\n $tamano_int = count($json_int['Notas']);\n $nota = 0;\n $porcentaje = 0;\n \n for ($b=0; $b<$tamano_int; $b++) {\n $porcentaje = rtrim($json_int['Notas'][$b]['Peso'],\"%\");\n $nota = ($json_int['Notas'][$b]['Valor']*$porcentaje)/100 + $nota; \n }\n \n //Cambia el formato a 2 decimales\n $nota = number_format($nota, 2, '.', '');\n \n $result .= '<div class=\"text-center\"><span>'.$nota.'</span></div>';\n $result .= '</li>';\n $result .= '<li class=\"col-sm-4 show-curso-detail\"><div class=\"text-center\"><span><img src=\"{site_url}assets/img/ojo.png\"></span></div></li>';\n $result .= '</ul>';\n } \n \n return $result; \n }",
"public function listaCostosCategoria()\n\t{\n\t\tif (!isset($_POST['cve']))\n\t\t{\n\t\t\theader (\"HTTP/1.1 514 An Error\");\n\t\t\treturn;\n\t\t}\n\n\t\t$clave = $_POST['cve'];\n\n\t\t$opciones = \"<option value=''>Seleccione:</option>\";\n\t\t$precios = $this->evt->getCostosCategoria($clave, $this->idEvento);\n\n\t\tforeach ($precios as $key => $value)\n\t\t{\n\t\t\t$opciones .= '<option value=\"' . $key . '\"';\n\t\t\t$opciones .= ($key == 5) ? ' selected' : '';\n\t\t\t$opciones .= '>' . $value['nombre'] . ' - ' . $this->func->moneda2screen($value['costo']) . '</option>';\n\t\t}\n\n\t\techo $opciones;\n\t}",
"function Cuerpo($acceso,$deuda,$desde,$hasta,$status_contrato)\n\t{\n\t\t$w=array(15,45,20,20,18,15,18,15,10,10,5);\n\t\t\nif($status_contrato!=''){\n\t$status=\"contrato.status_contrato='$status_contrato' and \";\n\t$statusw=\" where contrato.status_contrato='$status_contrato' \";\n}\n\n$deuda=\"(SELECT sum(contrato_servicio_deuda.cant_serv::numeric * contrato_servicio_deuda.costo_cobro) \n FROM contrato_servicio_deuda,contrato,zona,calle,sector\n WHERE $status calle.id_calle = contrato.id_calle AND calle.id_sector = sector.id_sector and \n contrato_servicio_deuda.id_contrato = contrato.id_contrato AND contrato_servicio_deuda.status_con_ser = 'DEUDA'::bpchar and sector.id_zona=zona.id_zona and sector.id_sector=vista_sector.id_sector and fecha_inst between '$desde' and '$hasta') AS deuda\";\n$pagado=\"(SELECT sum(contrato_servicio_pagado.cant_serv::numeric * contrato_servicio_pagado.costo_cobro) \n FROM contrato_servicio_pagado,contrato,zona,calle,sector\n WHERE $status calle.id_calle = contrato.id_calle AND calle.id_sector = sector.id_sector and \n contrato_servicio_pagado.id_contrato = contrato.id_contrato AND contrato_servicio_pagado.status_con_ser = 'PAGADO'::bpchar and sector.id_zona=zona.id_zona and sector.id_sector=vista_sector.id_sector and fecha_inst between '$desde' and '$hasta') AS pagado\";\n$num_pagado=\"(SELECT count(contrato_servicio_pagado.id_contrato) FROM contrato_servicio_pagado,contrato,zona,calle,sector WHERE $status calle.id_calle = contrato.id_calle AND calle.id_sector = sector.id_sector and contrato_servicio_pagado.id_contrato = contrato.id_contrato AND contrato_servicio_pagado.status_con_ser = 'PAGADO'::bpchar and sector.id_zona=zona.id_zona and sector.id_sector=vista_sector.id_sector and fecha_inst between '$desde' and '$hasta' and (contrato_servicio_pagado.id_serv = 'SER00001' or contrato_servicio_pagado.id_serv = 'BM00008' or contrato_servicio_pagado.id_serv = 'BM00009' ) ) AS num_pagado\";\n\n\n\t\t $num_deuda=\"(select count(*) from contrato,zona,calle,sector where $status calle.id_calle = contrato.id_calle AND calle.id_sector = sector.id_sector and sector.id_zona=zona.id_zona and sector.id_sector=vista_sector.id_sector and \n(SELECT sum(contrato_servicio_deuda.cant_serv::numeric * contrato_servicio_deuda.costo_cobro) as deuda \n FROM contrato_servicio_deuda\n WHERE contrato_servicio_deuda.id_contrato = contrato.id_contrato and fecha_inst between '$desde' and '$hasta' and (contrato_servicio_deuda.id_serv = 'SER00001' or contrato_servicio_deuda.id_serv = 'BM00008' or contrato_servicio_deuda.id_serv = 'BM00009' ) ) > 0 ) as num_deuda\";\n$t_cli=\"(SELECT count(*) \n FROM contrato,zona,calle,sector\n WHERE $status calle.id_calle = contrato.id_calle AND calle.id_sector = sector.id_sector and \n sector.id_zona=zona.id_zona and sector.id_sector=vista_sector.id_sector ) as t_cli\";\n\n$valor=explode(\"-\",$hasta);\n$mes=$valor[1];\n$anio=$valor[0];\n$ult_dia_mes=date(\"t\",mktime( 0, 0, 0, $mes, 1, $anio ));\n$hasta_f=\"$anio-$mes-$ult_dia_mes\";\n\n$t_rec=\"(select count(*) from contrato,calle where $status calle.id_calle = contrato.id_calle and calle.id_sector = vista_sector.id_sector\n and (select count(*) from ordenes_tecnicos where id_det_orden='DEO00003' and fecha_orden between '$desde' and '$hasta_f' and ordenes_tecnicos.id_contrato = contrato.id_contrato)>0\n and (select count(*) from ordenes_tecnicos where id_det_orden='DEO00010' and fecha_orden between '$desde' and '$hasta_f' and ordenes_tecnicos.id_contrato = contrato.id_contrato)>0) as t_rec \";\n\n\n$t_reco=\"(select count(*) from contrato,calle where $status calle.id_calle = contrato.id_calle and calle.id_sector = vista_sector.id_sector\n and (select count(*) from ordenes_tecnicos where id_det_orden='DEO00003' and fecha_orden between '$desde' and '$hasta_f' and ordenes_tecnicos.id_contrato = contrato.id_contrato)>0\n and (select count(*) from ordenes_tecnicos where id_det_orden='DEO00010' and fecha_orden between '$desde' and '$hasta_f' and ordenes_tecnicos.id_contrato = contrato.id_contrato)=0) as t_reco \";\n\n \n$cor=\"(select count(*) from contrato,calle where $status calle.id_calle = contrato.id_calle and calle.id_sector = vista_sector.id_sector\nand (select count(*) from ordenes_tecnicos where id_det_orden='DEO00010' and fecha_orden between '$desde' and '$hasta_f' and ordenes_tecnicos.id_contrato = contrato.id_contrato)>0) as cor \";\n\n//echo $t_rec;\n\t\t \n\t\t/*\n\t\t$deuda=\"(select sum(deuda) from vista_deudacli where vista_deudacli.id_sector=vista_sector.id_sector) as deuda\";\n\t\t$pagado=\"(select sum(pagado) from vista_deudacli where vista_deudacli.id_sector=vista_sector.id_sector) as pagado\";\n\t\t$num_deuda=\"(select count(*) from vista_deudacli where vista_deudacli.id_sector=vista_sector.id_sector and deuda>0) as num_deuda\";\n\t\t$t_cli=\"(select count(*) from vista_deudacli where vista_deudacli.id_sector=vista_sector.id_sector) as t_cli\";\n*/\n\n\t\t$where=\"\n\t\tselect nro_sector,nombre_sector,nombre_zona,$t_cli,$deuda,$num_deuda,$pagado,$num_pagado,$t_rec,$t_reco,$cor from vista_sector\n\t\t\";\n\t\t//echo \"$where\";\n\t\t$acceso->objeto->ejecutarSql($where);\n\t\t\n\t\t$this->SetFont('Arial','',9);\n\t\t$cont=1;\n\t\t$this->SetFillColor(249,249,249);\n\t\t$this->SetDrawColor(225,240,255);\n\t\t$this->SetLineWidth(.2);\n\t\t$this->SetTextColor(0);\n\t\t$sumad=0;\n\t\t$sumap=0;\n\t\t$sumat=0;\n\t\t$sumar=0;\n\t\t$sumadr=0;\n\t\twhile ($row=row($acceso))\n\t\t{\n\t\t\t$this->SetX(15);\n\t\t\t$this->Cell($w[0],6,utf8_d(trim($row[\"nro_sector\"])),\"LR\",0,\"J\",$fill);\n\t\t\t$this->Cell($w[1],6,utf8_d(trim($row[\"nombre_sector\"])),\"LR\",0,\"J\",$fill);\n\t\t\t$this->Cell($w[2],6,utf8_d(trim($row[\"nombre_zona\"])),\"LR\",0,\"J\",$fill);\n\t\t\t$deuda=trim($row[\"deuda\"]);\n\t\t\t$pagado=trim($row[\"pagado\"]);\n\t\t\t$t_cli=trim($row[\"t_cli\"]);\n\t\t\t$num_deuda=trim($row[\"num_deuda\"]);\n\t\t\tif($deuda=='')\n\t\t\t\t$deuda=0;\n\t\t\tif($pagado=='')\n\t\t\t\t$pagado=0;\n\t\t\t\n\t\t\t$sumad=$sumad+$deuda;\t\n\t\t\t$sumap=$sumap+$pagado;\t\n\t\t\t$sumat=$sumat+trim($row[\"t_cli\"]);\t\n\t\t\t$sumar=$sumar+trim($row[\"num_deuda\"]);\t\n\t\t\t$sumadr=$sumadr+trim($row[\"num_pagado\"]);\t\n\t\t\t$num_deuda=trim($row[\"num_deuda\"]);\n\t\t\t\n\t\t\t$sumarec=$sumarec+trim($row[\"t_rec\"]);\t\n\t\t\t$sumareco=$sumareco+trim($row[\"t_reco\"]);\t\n\t\t\t$sumacor=$sumacor+trim($row[\"cor\"]);\t\n\t\t\t$this->Cell($w[3],6,utf8_d(trim($row[\"t_cli\"])),\"LR\",0,\"C\",$fill);\n\t\t\t$this->Cell($w[4],6,number_format($deuda+0, 2, ',', '.'),\"LR\",0,\"C\",$fill);\n\t\t\t$this->Cell($w[5],6,utf8_d(trim($row[\"num_deuda\"])),\"LR\",0,\"C\",$fill);\n\t\t\t$this->Cell($w[6],6,number_format($pagado+0, 2, ',', '.'),\"LR\",0,\"C\",$fill);\n\t\t\t$this->Cell($w[7],6,utf8_d(trim($row[\"num_pagado\"])),\"LR\",0,\"C\",$fill);\n\t\t\t$this->Cell($w[8],6,utf8_d(trim($row[\"t_rec\"])),\"LR\",0,\"C\",$fill);\n\t\t\t$this->Cell($w[9],6,utf8_d(trim($row[\"t_reco\"])),\"LR\",0,\"C\",$fill);\n\t\t\t$this->Cell($w[10],6,utf8_d(trim($row[\"cor\"])),\"LR\",0,\"C\",$fill);\n\n\t\t\t$this->Ln();\n\t\t\t$fill=!$fill;\n\t\t\t$cont++;\n\t\t}\n\t\t$this->SetX(15);\n\t\t$this->Cell(array_sum($w),5,'','T');\n\t\t\n\t\t$this->SetFont('Arial','B',10);\n\t\t$this->SetX(15);\n\t\t$this->Cell($w[0]+$w[1]+$w[2],6,strtoupper(_(\"total\")),\"LR\",0,\"J\",$fill);\n\t\t\t\n\t\t\t$this->Cell($w[3],6,$sumat,\"LR\",0,\"C\",$fill);\n\t\t\t$this->Cell($w[4],6,number_format($sumad+0, 2, ',', '.'),\"LR\",0,\"C\",$fill);\n\t\t\t$this->Cell($w[5],6,$sumar,\"LR\",0,\"C\",$fill);\n\t\t\t$this->Cell($w[6],6,number_format($sumap+0, 2, ',', '.'),\"LR\",0,\"C\",$fill);\n\t\t\t$this->Cell($w[7],6,$sumadr,\"LR\",0,\"C\",$fill);\n\t\t\n\t\t\t$this->Cell($w[8],6,$sumarec,\"LR\",0,\"C\",$fill);\n\t\t\t$this->Cell($w[9],6,$sumareco,\"LR\",0,\"C\",$fill);\n\t\t\t$this->Cell($w[10],6,$sumacor,\"LR\",0,\"C\",$fill);\n\t\t\n\t}",
"public function verCentroCostos(){\n $this->db->SELECT('*');\n $this->db->from('proyecto');\n $this->db->order_by('nombreproyecto', 'ASC');\n $query = $this->db->get();\n if($query->num_rows()>0){\n return $query->result();\n }\n }",
"public function moisFicheEnCours() {\n\t$req = \" Select distinct(mois) from fichefrais where fichefrais.idEtat='CR'\";\n\treturn PdoGsb::$monPdo->query($req);\n }",
"function listarComisionistas(){\n\t\t$this->procedimiento='conta.ft_comisionistas_sel';\n\t\t$this->transaccion='CONTA_CMS_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\n $this->capturaCount('total_monto_total','numeric');\n $this->capturaCount('total_monto_total_comision','numeric');\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_comisionista','int4');\n\t\t$this->captura('nit_comisionista','varchar');\n\t\t$this->captura('nro_contrato','varchar');\n\t\t$this->captura('codigo_producto','varchar');\n\t\t$this->captura('descripcion_producto','varchar');\n $this->captura('cantidad_total_entregado','numeric');\n $this->captura('cantidad_total_vendido','numeric');\n $this->captura('precio_unitario','numeric');\n $this->captura('monto_total','numeric');\n $this->captura('monto_total_comision','numeric');\n $this->captura('revisado','varchar');\n $this->captura('id_periodo','int4');\n $this->captura('id_depto_conta','int4');\n $this->captura('registro','varchar');\n $this->captura('tipo_comisionista','varchar');\n $this->captura('lista_negra','varchar');\n $this->captura('gestion','int4');\n $this->captura('usr_reg','varchar');\n $this->captura('usr_mod','varchar');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('usuario_ai','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_ai','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('nombre_agencia','varchar');\n\t\t$this->captura('nro_boleto','varchar');\n\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}"
] | [
"0.65055645",
"0.6395146",
"0.626171",
"0.6186907",
"0.6108718",
"0.6078164",
"0.60257614",
"0.60218626",
"0.59623164",
"0.59214044",
"0.59169203",
"0.59137565",
"0.5903107",
"0.590159",
"0.5899371",
"0.588992",
"0.58733106",
"0.5861223",
"0.5860172",
"0.5851634",
"0.5823095",
"0.5803114",
"0.5795148",
"0.5784555",
"0.57839024",
"0.5770649",
"0.5770025",
"0.57662743",
"0.5761967",
"0.57451916"
] | 0.6397337 | 1 |
Valida que nombre de usuario no exista, en caso de que exista el usuario retorna false, en caso de que no exista retorna true | function validar_nombre_usuario($usuario) {
$this->db->escape($usuario);
$this->db->where('usuario', $usuario);
$query = $this->db->get('usuarios');
if ($query->num_rows() > 0) {
return "false";
} else {
return "true";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasUserName()\n {\n return $this->get(self::USERNAME) !== null;\n }",
"public function unique_user_name(){\n //do not validate if exist\n //Unless it is the current record\n $id = $this->uri->segment(4);\n \n $this->db->where('u_name', $this->input->post('u_name'));\n !$id || $this->db->where('id !=', $id);\n \n $found = $this->user_m->get();\n if (count($found)){\n $this->form_validation->set_message('unique_user_name','%s already exists!');\n \n return FALSE;\n }\n \n return TRUE;\n }",
"function username_not_exist($username) {\n\t\tif ($this -> user -> check_user($username)) {\n\t\t\t$this -> form_validation -> set_message('username_not_exist', 'Usuario existente.');\n\t\t\treturn FALSE;\n\t\t} else {\n\t\t\treturn TRUE;\n\t\t}\n\n\t}",
"public function isUserExisted($name) {\r\n\t\t$params = array(\r\n\t\t\t\t'name' => $name\r\n\t\t);\r\n\t\t$result = $this->pdoQuery->executePdoSelectQueryTable(self::SELECT_USER_BY_NAME, $params);\r\n $no_of_rows = sizeOf($result);\r\n if ($no_of_rows > 0) {\r\n // user existed \r\n return true;\r\n } else {\r\n // user not existed\r\n return false;\r\n }\r\n }",
"public function isRegisteredUserUserValid()\n {\n if ($this['registeredUser'] < 1) {\n return true;\n }\n \n $uname = UserUtil::getVar('uname', $this['registeredUser']);\n \n return (!is_null($uname) && !empty($uname));\n }",
"public function isuserexist($nickname) {\n\n $result = mysql_query(\"SELECT nickname from usuarios WHERE nickname = '$nickname'\");\n\n $num_rows = mysql_num_rows($result); //numero de filas retornadas\t\t\n\t\t\n if ($num_rows > 0) {\n\t echo(\"lalala\");\n return true; // el usuario existe \n } else {\n return false; // no existe\n }\n }",
"function usern_check($str)\n {\n $ret = $this->user_model->getUserByUsername($str);\n\n if (!empty($ret)) {\n $this->validation->_error_messages['usern_check']\n = 'Username already exists!';\n return false;\n }\n\n return true;\n }",
"public function validate_username()\n\t{\n\t\tif($this->user->check() == TRUE)\n\t\t{\n\t\t\t$this->form_validation->set_message('validate_username', 'Sorry! Username already in use.');\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}",
"function existe_usuario($usuario) {\r\n $this->db->escape($usuario);\r\n $this->db->where('usuario', $usuario);\r\n $query = $this->db->get('usuarios');\r\n if ($query->num_rows() != 0)\r\n return TRUE;\r\n else\r\n return FALSE;\r\n }",
"function validateUsername($username) {\n\n\n $check_username = $this->fetchRow($this->select()->where(\"username=?\",$username));\n\n if(!is_null($check_username)) {\n\n $error = \"This username is already taken.Try another name.\";\n return $error;\n }\n\n return true;\n }",
"function comprueba($usuario) {\n\t\t// Devuelve true si existe y false si no\n\t\t$sql = \"SELECT usuario FROM usuarios WHERE usuario='\".$usuario.\"'\";\n\t\t$resultado = $this -> db -> query($sql);\n\n\t\tif ($resultado -> num_rows()>0) {\n\t\t\t// Existe\n\t\t\treturn true;\n\t\t} else {\n\t\t\t// No existe\n\t\t\treturn false;\n\t\t}\n\t}",
"public function verificarNombreUsuarioNuevo($usuario){\n $usuario = new Usuario;\n $id_usuario=$usuario->getIdUsuarioSegunNombre($usuario);\n if(count($id_usuario)>0){\n return TRUE;\n } else{\n return FALSE;\n } \n\n }",
"public function checkUsername(){\r\n $u = new Apps\\Netcoid\\Models\\Users;\r\n $e = $u->userexist($_POST['username']);\r\n if (!empty($e)) {\r\n echo json_encode(false);\r\n }\r\n\r\n if (empty($e)) {\r\n echo json_encode(true);\r\n } \r\n }",
"public function validName()\n {\n return !empty($this->name);\n }",
"public function checkNameRoleUnique() {\n\t\tif ($this->isUnique(array('name', 'role'), false)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"function is_username_exists($username) \n\t{\n\t\t\n // $result=$this->db->query('SELECT email FROM tbl_user WHERE email=? LIMIT 1',array($email));\n $result=User::checkusername($username);\n\t\t \t \n\t\t if($result){\n\t\t\t $this->form_validation->set_message('is_username_exists', 'The username you entered is already in use. please try another one.');\n\t\t\t return false; \n\t\t }\n\t\t \n }",
"function nombre_usuario_disponible(){\n\t\t$username = $this->input->post('datos');\n\n\t\t$valida_usuario=$this->Registro_usuario_m->validar_usuario($username['user_name']);\n\n\t\tif ($valida_usuario == TRUE) {\n\t\t\techo \"NO\";\n\t\t} else {\n\t\t\techo \"SI\";\n\t\t}\n\t}",
"public function username_exist($email)\n {\n $email_exist = $this->account_model->get_user($email);\n\n if(count($email_exist) !== 0)\n {\n $this->form_validation->set_message('username_exist', 'The {field} your entered exist please try new one.');\n\n return false;\n }\n\n return true;\n }",
"public function checkUserExists() {\n\n if(!get_magic_quotes_gpc()) {\n $this -> sanitizeInput();\n }\n\n extract($_POST);\n\n $qry = \"SELECT userName, userEmail FROM users WHERE userName = '$userName' OR userEmail = '$userEmail'\";\n //echo $qry;\n $rs = $this -> db -> query($qry);\n\n if($rs) {\n if($rs -> num_rows > 0) {\n return true;\n } else {\n return false;\n }\n } else {\n //echo 'Error executing query \"checkUserExists\"';\n return false;\n } \n\n }",
"function validateUsername($username)\n {\n $sql = $this->db->prepare('select count(*) as nro from usuario where username = ?');\n $sql->bindParam(1, $username);\n $sql->execute();\n $nro = $sql->fetch(\\PDO::FETCH_ASSOC);\n if ($nro['nro'] == 0) {\n return true;\n } else {\n return false;\n }\n }",
"private function existeNombre($nombre) {\r\n\t\treturn R::findOne('tamano','nombre = ?',[$nombre]) != null ? true : false;\r\n\t}",
"function validUserName($userName) {\n\t\t\tif($stmt = $this->dbConnection->prepare(\"SELECT COUNT(username)\n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM usersinfo\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE username = ?\"));\n\t\t\t$stmt->bind_param(\"s\", $userName);\n\t\t\t$stmt->execute();\n\t\t\t$stmt->bind_result($userNameCount);\n\t\t\t$stmt->fetch();\n\t\t\t$stmt->close();\n\t\t\tif ($userNameCount != 0) { //the username must exist\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse return false;\n\t\t}",
"public function check_username_exists($username){\n\t\t// Set pesan\n\t\t$this->form_validation->set_message('check_username_exists', 'Username sudah dipakai.');\n\n\t\t\t// Memanggil model (mUser) dengan fungsi check_username_exists yg melempar data username\n\t\tif($this->mUser->check_username_exists($username)){\n\t\t\t\treturn true; // melempar true\n\t\t\t}else{\n\t\t\t\treturn false; // melempar false\n\t\t\t}\n\t\t}",
"private function validate_userexist($username)\n\t{\n\t\t$db = Slim::getInstance()->db();\n\n\t\t$username = strtolower($username);\n\t\t\n\t\t$sql = \"SELECT username \n\t\t\t\tFROM users \n\t\t\t\tWHERE username_clean = '{$username}'\";\n\t\t$result = $db->sql_query($sql);\n\t\t$row = $db->sql_fetchrow($result);\n\t\t\n\t\t// Check if the user exist \n\t\tif (!$row['username']) \n\t\t{\n\t\t\treturn 'This user does not exist';\n\t\t}\n\n\t\treturn false;\n\t}",
"function checkExist($user_name, $email, $conn)\n\t{\n\t\t$stmt = $conn->prepare(\"SELECT * FROM users WHERE email=:email OR user_name=:user_name\");\n\t\t$stmt->bindValue(':email', $email);\n\t\t$stmt->bindValue(':user_name', $user_name);\n\t\t$stmt->execute();\n\t\t$user = $stmt->fetch();\n\n\t\tif ($user)\n\t\t{\n\t\t\t$conn = null;\n\t\t\treturn true;\n\t\t}\n\t\telse if (!$user)\n\t\t{\n\t\t\t$conn = null;\n\t\t\treturn false;\n\t\t}\n\t}",
"public static function is_user_exist_by_name($username)\r\n\t{\r\n\t\tglobal $currdb;\r\n\t\t$curr_user_counting = $currdb -> sql_fetch_assoc($curr_user_src = $currdb -> sql_query(\"SELECT count(*) FROM `ac_user` WHERE `username` = '\".$username.\"'\"));\r\n\t\tif(intval($curr_user_counting['count(*)']) != 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 static function isUsername($var, $esObligatorio = FALSE) {\r\n \tif ($esObligatorio === TRUE) {\r\n \t\t if (Validacion::isEmpty($var)) {\r\n \t\t \treturn false;\r\n \t\t }\r\n \t}\r\n $coincidencias = preg_match( \"/^[a-zA-Z .@_0-9]+$/i\", trim($var) ); // false on error\r\n if( $coincidencias===false || $coincidencias === 0 ) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }",
"public function userValidate($usuario = NULL){\n\t\tif(isset($usuario)){\n\t\t\t$data = array('email' => $usuario, 'status' => '1');\n\t\t\t$this->db->where($data);\n\t\t\t$query = $this->db->get('usuario');\n\t\t\tif($query->num_rows() == 1){\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}",
"private function if_exist_username($username)\n {\n\n $user_obj=$this->model_objs['user_obj'];\n\n $output=$user_obj->select(array(\n \"where\"=>\"users.user_name='{$username}'\"\n ));\n\n if($output[\"status\"] == 1){\n\n if($output[\"num_rows\"] == 1 && $output[\"fetch_all\"][0][\"user_name\"] == $username){\n \n return true;\n \n }else{\n \n return false;\n }\n \n }else{\n\n return $output[\"error\"];\n }\n\n }",
"public function checkName(){\r\n $u = new Apps\\Netcoid\\Models\\Users;\r\n $e = $u->companyexist($_POST['name']);\r\n if (!empty($e)) {\r\n echo json_encode(false);\r\n }\r\n\r\n if (empty($e)) {\r\n echo json_encode(true);\r\n } \r\n }"
] | [
"0.7238606",
"0.71309626",
"0.7107371",
"0.7056333",
"0.70176184",
"0.70033807",
"0.7002624",
"0.6994887",
"0.69880164",
"0.6957154",
"0.69328463",
"0.69325143",
"0.6925849",
"0.69234717",
"0.69142085",
"0.6885068",
"0.68696344",
"0.6865723",
"0.6835194",
"0.68258274",
"0.68158066",
"0.6814038",
"0.68116814",
"0.6797649",
"0.6787184",
"0.678337",
"0.6770976",
"0.6768493",
"0.67618126",
"0.6754777"
] | 0.772696 | 0 |
Agrega el id del carrito de compra y retorna el consecutivo de compra | function agregar_consecutivo_compra($id_carrito_compra) {
$this->db->escape($id_carrito_compra);
$this->db->set('id_carritos_compras', $id_carrito_compra);
$this->db->insert('consecutivo_factura');
$id_consecutivo = mysql_insert_id();
$carritos = $this->usuario_model->dar_items_compra_idcarrito($id_carrito_compra);//el id está vacío
foreach ($carritos as $carrito) {
$params = array();
$params['id_carrito'] = $id_carrito_compra;
$params['id_usuario'] = $carrito->id_usuario;
$params['usuario'] = $this->dar_usuario($carrito->id_usuario);
$params['name'] = $carrito->titulo;
$params['amount'] = $carrito->precio;
$params['tipo'] = $carrito->tipo;
$params['titulo'] = $carrito->titulo;
$params['cantidad'] = $carrito->cantidad;
$params['fecha_compra'] = $carrito->fecha;
$params['recibo'] = 'http://www.laspartes.com/usuario/recibo/'.$carrito->refVenta;
$this->crm->agregar_carrito_compras_REST($params);
}
return $id_consecutivo;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function agregar_consecutivo_recibo($id_carrito_compra) {\r\n $this->db->escape($id_carrito_compra);\r\n $this->db->set('id_carritos_compras', $id_carrito_compra);\r\n $this->db->insert('consecutivo_recibos');\r\n $id_consecutivo = mysql_insert_id();\r\n \r\n $carritos = $this->usuario_model->dar_items_compra_idcarrito($id_carrito_compra);//el id está vacío\r\n return $id_consecutivo;\r\n }",
"public function get_next_id() {\n $result_id = $this->db->query('SELECT getNextSeq(\"company_seq as id\");');\n $last_id = $result_id[0]['id'];\n //\n /* print \"<pre>\";\n print_r($last_id);\n print \"</pre>\";\n exit();*/\n return $last_id;\n }",
"public function getIdCompetencia()\n {\n return $this->idCompetencia;\n }",
"public function SelecId() {\n \n\t $db= new conexion(); \t \n\t\t\t\t \n\t$cadena = \"SELECT * FROM tbcotizaciones INNER JOIN tbpersona ON tbcotizaciones.ced_cli = tbpersona.Identificacion INNER JOIN tbvehiculo ON tbcotizaciones.placa = tbvehiculo.Placa WHERE estatus='0' and Num_Cot='$this->Num_Cot' GROUP BY tbcotizaciones.Num_Cot\";\n\t\t\t \n\t $ejecutor = $db->query($cadena);\n\t\t\t \n\treturn($ejecutor);\n \n }",
"public function obtenerUltimoId();",
"public function getId(){\n $id = Cantones::whereRaw('id > ? or deleted_at <> null', [0])->get();\n $next = count($id);\n if($next > 0 ){\n $next+=1;\n }else\n $next =1;\n return $next;\n }",
"function getConsecutivo($arregloDatos) \n\n {\n\n $fecha=FECHA;\n\n\t$sql=\" SELECT LAST_INSERT_ID( ) as consecutivo\";\n\n\t\t\t\n\n $this->query($sql);\n\n if($this->_lastError) \n\n {\n\n $arregloDatos[mensaje]=\" Error al obtener Consecutivo $sql\".$this->_lastError->message;\n\n $arregloDatos[estilo]=$this->estilo_error;\n\n return TRUE;\n\n }\n\n $this->fetch();\n\n //echo \"READYXXXXXXXXXXXXXXx \".$this->consecutivo;\n\n return $this->consecutivo;\n\n \n\n }",
"public function getCompteRenduId()\n { return $this->compteRenduId; }",
"private function lastId()\n {\n $lastData = $this->all(1, 0, \"COD_ARQUIVO\", \"COD_ARQUIVO DESC\");\n return ($lastData ? $lastData[0]->COD_ARQUIVO + 1 : 1);\n }",
"function getId_repeticion()\n {\n if (!isset($this->iid_repeticion) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_repeticion;\n }",
"function getMaintenanceeLastId(){\n $sql = \"SELECT idMain FROM maintenance ORDER BY idMain ASC\";\n $bornes = pg_query($sql); \n while($maintenance = pg_fetch_object($bornes)):\n $lastid = $maintenance->idMain;\n endwhile;\n return $lastid;\n \n }",
"public function traerUltimoId(){\r\n\r\n $arrayDeUsuarios=$this->traerTodos();\r\n if(empty($arrayDeUsuarios)){\r\n return 1;\r\n }\r\n //si hay usuarios en el array, traigo el ultimo\r\n $elUltimo = array_pop($arrayDeUsuarios);\r\n $id = $elUltimo->getId();\r\n //$id = $elUltimo->id; // MODIFIQUE ACAAAAAAAAAAA\r\n //$id = $elUltimo->getId();\r\n return $id + 1;\r\n }",
"function idServicio(){\n $consulta = \"SELECT id FROM servicios ORDER BY id DESC LIMIT 1\";\n\n $conec = new Conexion();\n\n $conec->conectar();\n\n if (!$conec->obtenerConexion()){\n return -1; // Error en la conexion!\n }\n\n $resultado = pg_query($consulta);\n\n if (!$resultado){\n return 0; // Error en la consulta\n }else{// Se ejecuto con éxito\n if (pg_numrows($resultado) > 0){\n $arr = pg_fetch_row ($resultado, 0);\n\n $this->id = $arr[0]+1;\n\n pg_FreeResult($resultado);\n $conec->cerrarConexion();\n }\n return 1;\n }\n }",
"function id()\n {\n if ( $this->IsCoherent == 0 )\n $this->get();\n return $this->id();\n }",
"public function nextId(){\n $json = file_get_contents($this->getBaseJson());\n $usuarios = json_decode($json,true);\n $ultimoUsuario = array_pop($usuarios['usuarios']);\n $ultimoId = $ultimoUsuario['id'];\n if($ultimoId != 0){\n return $ultimoId + 1;\n }else{\n return 1;\n }\n }",
"function identificarDespesarubricaID($idDespesarubrica){\r\n $database\t= JFactory::getDBO();\r\n $sql = \"SELECT * FROM #__contproj_rubricadeprojeto WHERE id = $idDespesarubrica LIMIT 1\";\r\n $database->setQuery( $sql );\r\n $despesarubrica = $database->loadObjectList();\r\n return ($despesarubrica[0]);\r\n}",
"function getNextId()\n\t{\n\t\t$ids = $this->getCronIDs();\n\t\tif(count($ids) == 0) return 1; // If there are no scripts, use #1\n\t\tasort($ids);\n\t\treturn array_pop($ids)+1;\n\t}",
"function getId(){\n\t\treturn $this->idTriagem;\n\t}",
"public function getIdCurso(){\n return $this-> idCurso;\n }",
"public abstract function getNextId();",
"function getMaxIdBoletosAvulsos(){\n\t\t\t// Monta a query\n\t\t\t$consulta = mysql_query(\"SELECT id FROM `boletos_registrados` ORDER BY id DESC LIMIT 0,1\");\n\t\t\t\n\t\t\t// Pega o ultimo id do boleto.\n\t\t\t$id = mysql_fetch_array($consulta);\n\t\t\t\n\t\t\t// Retorna o proximo numero para gerar o boleto.\n\t\t\treturn $id['id'] + 1;\t\t\t\n\t\t\t\n\t\t\t// Este código foi comentado para evitar erro que excluir o boleto e ele sobre escrever o ultimo boleto avulso. \n\t\t\t//$consulta = mysql_query(\"SELECT id FROM `boletos_registrados` \");\n\t\t\t//return mysql_num_rows($consulta) + 1;\n\t\t}",
"function auto_id(){\n\t\t$query = $this->db->query(\"SELECT max(id_pinjam) as id_new FROM pinjam\");\n\t\t$data =$query->row_array();\n\t\t$id_pinjam = $data['id_new'];\n\n\t\t// mengambil angka dari kode barang terbesar, menggunakan fungsi substr\n\t\t// dan diubah ke integer dengan (int)\n\t\t$urutan = (int) substr($id_pinjam, 3, 3);\n\n\t\t// bilangan yang diambil ini ditambah 1 untuk menentukan nomor urut berikutnya\n\t\t$urutan++;\n\n\t\t// membentuk kode barang baru\n\t\t// perintah sprintf(\"%03s\", $urutan); berguna untuk membuat string menjadi 3 karakter\n\t\t// misalnya perintah sprintf(\"%03s\", 15); maka akan menghasilkan '015'\n\t\t// angka yang diambil tadi digabungkan dengan kode huruf yang kita inginkan, misalnya BRG \n\t\t$huruf = \"S-\";\n\t\t$id_pinjam = $huruf . sprintf(\"%03s\", $urutan);\n\t\treturn $id_pinjam;\n\t}",
"public function createCompositeIdentifier()\n {\n $itemId = $this['id'];\n \n return $itemId;\n }",
"public function getIdModulo()\n {\n return $this->_id_Modulo;\n }",
"public function getIdCarrito(){\n return $this->idCarrito;\n }",
"function nextID($ID = '') {\r\n\r\n global $prefix, $SYS;\r\n\r\n if (empty($ID)) {\r\n $ID = $this->ID;\r\n }\r\n\r\n\r\n $qry = \"SELECT `ID` from {$prefix}_\" . $this->name . \" WHERE `ID`>$ID AND `ID`>1 ORDER BY `ID` ASC\";\r\n\r\n $bdres = _query($qry);\r\n /* $rawres=fetch_array($bdres);\r\n $this->ID=$rawres[\"ID\"];\r\n $this->properties=array_slice($rawres,1); */\r\n if ($bdres)\r\n if ($rawres = _fetch_array($bdres))\r\n return $rawres[\"ID\"];\r\n else\r\n return $ID;\r\n }",
"function getMaxIdBoletosCertificados(){\n\t\t\t$consulta = mysql_query(\"SELECT id FROM `boletos_registrados` ORDER BY id DESC LIMIT 0,1\");\n\t\t\t\n\t\t\t// Pega o ultimo id do boleto.\n\t\t\t$id = mysql_fetch_array($consulta);\n\t\t\t\n\t\t\t// Retorna o proximo numero para gerar o boleto.\n\t\t\treturn $id['id'] + 1;\n\t\t}",
"public function getIdComunidad()\n {\n return $this->idComunidad;\n }",
"public function getIdReserva()\n {\n return $this->idReserva;\n }",
"function nextID($ID='') {\n\n\t\tglobal $prefix,$SYS;\n\t\t\n\t\tif (empty($ID)) {\n\t\t\t$ID=$this->ID;\n\t\t}\n\t\t\n\t\t\n\t\t$qry=\"SELECT ID from {$prefix}_\".$this->name.\" WHERE ID>$ID AND ID>1 ORDER BY ID ASC\";\n\t\t\n\t\t$bdres=_query($qry);\n\t\t/*$rawres=fetch_array($bdres);\n\t\t$this->ID=$rawres[\"ID\"];\n\t\t$this->properties=array_slice($rawres,1);*/\n\t\tif ($bdres)\n\t\t\tif ($rawres=_fetch_array($bdres))\n\t\t\t\treturn $rawres[\"ID\"];\n\t\t\telse\n\t\t\t\treturn $ID;\n\n\n\t}"
] | [
"0.7286167",
"0.660654",
"0.64608985",
"0.631996",
"0.6249595",
"0.62239385",
"0.61734563",
"0.6145443",
"0.6096309",
"0.60303754",
"0.6027922",
"0.6010108",
"0.59639394",
"0.59453326",
"0.5882093",
"0.5875385",
"0.5860116",
"0.58415437",
"0.5825368",
"0.5777741",
"0.5766642",
"0.575146",
"0.57486886",
"0.57457525",
"0.574262",
"0.5741181",
"0.57289714",
"0.5727422",
"0.5717821",
"0.571652"
] | 0.71181047 | 1 |
Agrega el id del carrito de compra y retorna el consecutivo de recibo | function agregar_consecutivo_recibo($id_carrito_compra) {
$this->db->escape($id_carrito_compra);
$this->db->set('id_carritos_compras', $id_carrito_compra);
$this->db->insert('consecutivo_recibos');
$id_consecutivo = mysql_insert_id();
$carritos = $this->usuario_model->dar_items_compra_idcarrito($id_carrito_compra);//el id está vacío
return $id_consecutivo;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function agregar_consecutivo_compra($id_carrito_compra) {\r\n $this->db->escape($id_carrito_compra);\r\n $this->db->set('id_carritos_compras', $id_carrito_compra);\r\n $this->db->insert('consecutivo_factura');\r\n $id_consecutivo = mysql_insert_id();\r\n \r\n $carritos = $this->usuario_model->dar_items_compra_idcarrito($id_carrito_compra);//el id está vacío\r\n foreach ($carritos as $carrito) {\r\n $params = array();\r\n $params['id_carrito'] = $id_carrito_compra;\r\n $params['id_usuario'] = $carrito->id_usuario;\r\n $params['usuario'] = $this->dar_usuario($carrito->id_usuario);\r\n $params['name'] = $carrito->titulo;\r\n $params['amount'] = $carrito->precio;\r\n $params['tipo'] = $carrito->tipo;\r\n $params['titulo'] = $carrito->titulo;\r\n $params['cantidad'] = $carrito->cantidad;\r\n $params['fecha_compra'] = $carrito->fecha;\r\n $params['recibo'] = 'http://www.laspartes.com/usuario/recibo/'.$carrito->refVenta;\r\n $this->crm->agregar_carrito_compras_REST($params);\r\n }\r\n \r\n return $id_consecutivo;\r\n }",
"public function get_next_id() {\n $result_id = $this->db->query('SELECT getNextSeq(\"company_seq as id\");');\n $last_id = $result_id[0]['id'];\n //\n /* print \"<pre>\";\n print_r($last_id);\n print \"</pre>\";\n exit();*/\n return $last_id;\n }",
"public function traerUltimoId(){\r\n\r\n $arrayDeUsuarios=$this->traerTodos();\r\n if(empty($arrayDeUsuarios)){\r\n return 1;\r\n }\r\n //si hay usuarios en el array, traigo el ultimo\r\n $elUltimo = array_pop($arrayDeUsuarios);\r\n $id = $elUltimo->getId();\r\n //$id = $elUltimo->id; // MODIFIQUE ACAAAAAAAAAAA\r\n //$id = $elUltimo->getId();\r\n return $id + 1;\r\n }",
"public function SelecId() {\n \n\t $db= new conexion(); \t \n\t\t\t\t \n\t$cadena = \"SELECT * FROM tbcotizaciones INNER JOIN tbpersona ON tbcotizaciones.ced_cli = tbpersona.Identificacion INNER JOIN tbvehiculo ON tbcotizaciones.placa = tbvehiculo.Placa WHERE estatus='0' and Num_Cot='$this->Num_Cot' GROUP BY tbcotizaciones.Num_Cot\";\n\t\t\t \n\t $ejecutor = $db->query($cadena);\n\t\t\t \n\treturn($ejecutor);\n \n }",
"public function obtenerUltimoId();",
"private function lastId()\n {\n $lastData = $this->all(1, 0, \"COD_ARQUIVO\", \"COD_ARQUIVO DESC\");\n return ($lastData ? $lastData[0]->COD_ARQUIVO + 1 : 1);\n }",
"public function getId(){\n $id = Cantones::whereRaw('id > ? or deleted_at <> null', [0])->get();\n $next = count($id);\n if($next > 0 ){\n $next+=1;\n }else\n $next =1;\n return $next;\n }",
"public function idreservacion(){\n\t\treturn $this->_idreservacion;\n\t}",
"protected function getID()\n {\n return $this->idremessa;\n }",
"public function getCompteRenduId()\n { return $this->compteRenduId; }",
"function getConsecutivo($arregloDatos) \n\n {\n\n $fecha=FECHA;\n\n\t$sql=\" SELECT LAST_INSERT_ID( ) as consecutivo\";\n\n\t\t\t\n\n $this->query($sql);\n\n if($this->_lastError) \n\n {\n\n $arregloDatos[mensaje]=\" Error al obtener Consecutivo $sql\".$this->_lastError->message;\n\n $arregloDatos[estilo]=$this->estilo_error;\n\n return TRUE;\n\n }\n\n $this->fetch();\n\n //echo \"READYXXXXXXXXXXXXXXx \".$this->consecutivo;\n\n return $this->consecutivo;\n\n \n\n }",
"public function requestSequenceId()\n {\n $id = $this->_counter++;\n $this->_sequenceIds[] = $id;\n return $id;\n }",
"function idServicio(){\n $consulta = \"SELECT id FROM servicios ORDER BY id DESC LIMIT 1\";\n\n $conec = new Conexion();\n\n $conec->conectar();\n\n if (!$conec->obtenerConexion()){\n return -1; // Error en la conexion!\n }\n\n $resultado = pg_query($consulta);\n\n if (!$resultado){\n return 0; // Error en la consulta\n }else{// Se ejecuto con éxito\n if (pg_numrows($resultado) > 0){\n $arr = pg_fetch_row ($resultado, 0);\n\n $this->id = $arr[0]+1;\n\n pg_FreeResult($resultado);\n $conec->cerrarConexion();\n }\n return 1;\n }\n }",
"public function create_receptionist_id(){\n\t\tglobal $con;\n\t\t$query=\"SELECT receptionist_id FROM receptionists ORDER BY receptionist_id DESC LIMIT 1\";\n\t\t$new_id=0;\n\t\t$result=$this->select($con,$query);\n\t\tforeach ($result as $key => $value) {\n\t\t\t$new_id=(int)$value['receptionist_id'];\n\t\t}\n\t\t$new_id=$new_id+1;\n\t\treturn $new_id;\n\t}",
"public function getIdCompetencia()\n {\n return $this->idCompetencia;\n }",
"public function Buscar_por_id()\n\t{\n\t\t$id_laboratorio = $this -> input -> post('id_laboratorio');\n\t\t$recupera_laboratorio = $this -> Modelo_laboratorio -> Busca_por_id($id_laboratorio);\n\t\tif ($recupera_laboratorio==false)\n\t\t{\n\t\t}\n\t\telse\n\t\t{\n\t\techo\"<script type='text/javascript'>\n\t\t\t$('#descripcion_recupera').val('\".$recupera_laboratorio -> descripcion.\"');\n\t\t\t$('#id_laboratorio_recuperado').val('\".$recupera_laboratorio -> id_laboratorio.\"');\n\t\t\t\n\t\t</script>\n\t\t\";\n\t\t}\n\t}",
"public function nextId(){\n $json = file_get_contents($this->getBaseJson());\n $usuarios = json_decode($json,true);\n $ultimoUsuario = array_pop($usuarios['usuarios']);\n $ultimoId = $ultimoUsuario['id'];\n if($ultimoId != 0){\n return $ultimoId + 1;\n }else{\n return 1;\n }\n }",
"function getMaxIdBoletosCertificados(){\n\t\t\t$consulta = mysql_query(\"SELECT id FROM `boletos_registrados` ORDER BY id DESC LIMIT 0,1\");\n\t\t\t\n\t\t\t// Pega o ultimo id do boleto.\n\t\t\t$id = mysql_fetch_array($consulta);\n\t\t\t\n\t\t\t// Retorna o proximo numero para gerar o boleto.\n\t\t\treturn $id['id'] + 1;\n\t\t}",
"function getIdRetiro($arregloDatos) {\n\n $sql = \" SELECT max(codigo) as codigo FROM inventario_maestro_movimientos\";\n\n\n\n $this->query($sql);\n\n if ($this->_lastError) {\n\n $this->mensaje = \"error al consultar ID levante \";\n\n $this->estilo = $this->estilo_error;\n\n return TRUE;\n\n }\n\n }",
"public function getIdReserva()\n {\n return $this->idReserva;\n }",
"function getIdtrabajador() {return $this->idtrabajador;}",
"function getSoreIdporBackId($id_solicitud){\n\t\t$this->db->select('tbl_back.sore_id');\n\t\t$this->db->from('tbl_back');\n\t\t$this->db->where('tbl_back.backId', $id_solicitud);\n\t\t$query = $this->db->get();\n\t\treturn $query->row('sore_id');\n\t}",
"function getMaxIdBoletosAvulsos(){\n\t\t\t// Monta a query\n\t\t\t$consulta = mysql_query(\"SELECT id FROM `boletos_registrados` ORDER BY id DESC LIMIT 0,1\");\n\t\t\t\n\t\t\t// Pega o ultimo id do boleto.\n\t\t\t$id = mysql_fetch_array($consulta);\n\t\t\t\n\t\t\t// Retorna o proximo numero para gerar o boleto.\n\t\t\treturn $id['id'] + 1;\t\t\t\n\t\t\t\n\t\t\t// Este código foi comentado para evitar erro que excluir o boleto e ele sobre escrever o ultimo boleto avulso. \n\t\t\t//$consulta = mysql_query(\"SELECT id FROM `boletos_registrados` \");\n\t\t\t//return mysql_num_rows($consulta) + 1;\n\t\t}",
"function getMaintenanceeLastId(){\n $sql = \"SELECT idMain FROM maintenance ORDER BY idMain ASC\";\n $bornes = pg_query($sql); \n while($maintenance = pg_fetch_object($bornes)):\n $lastid = $maintenance->idMain;\n endwhile;\n return $lastid;\n \n }",
"public function getRxsezioneId()\n {\n return $this->rxsezione_id;\n }",
"public abstract function getNextId();",
"function idDiario($sContrato,$sNumeroOrden,$fecha){\n $sql=\"SELECT MAX(iIdDiario) as iIdDiario FROM bitacoradeactividades WHERE sContrato='$sContrato' AND dIdFecha='$fecha' \";\n $result = queryTransaccion($sql);\n if($row = mysql_fetch_array($result)){\n $iIdDiarioBA = $row[0];\n if($iIdDiarioBA==0)$iIdDiarioBA=1;\n else $iIdDiarioBA = $iIdDiarioBA + 1;\n }\n return $iIdDiarioBA;\n }",
"function id()\n {\n if ( $this->IsCoherent == 0 )\n $this->get();\n return $this->id();\n }",
"function dameUltimoId($wSeq=null) {\n\t\t\treturn $this->lastID;\n\t}",
"function auto_id(){\n\t\t$query = $this->db->query(\"SELECT max(id_pinjam) as id_new FROM pinjam\");\n\t\t$data =$query->row_array();\n\t\t$id_pinjam = $data['id_new'];\n\n\t\t// mengambil angka dari kode barang terbesar, menggunakan fungsi substr\n\t\t// dan diubah ke integer dengan (int)\n\t\t$urutan = (int) substr($id_pinjam, 3, 3);\n\n\t\t// bilangan yang diambil ini ditambah 1 untuk menentukan nomor urut berikutnya\n\t\t$urutan++;\n\n\t\t// membentuk kode barang baru\n\t\t// perintah sprintf(\"%03s\", $urutan); berguna untuk membuat string menjadi 3 karakter\n\t\t// misalnya perintah sprintf(\"%03s\", 15); maka akan menghasilkan '015'\n\t\t// angka yang diambil tadi digabungkan dengan kode huruf yang kita inginkan, misalnya BRG \n\t\t$huruf = \"S-\";\n\t\t$id_pinjam = $huruf . sprintf(\"%03s\", $urutan);\n\t\treturn $id_pinjam;\n\t}"
] | [
"0.6638419",
"0.6336683",
"0.6206956",
"0.6160147",
"0.60790336",
"0.6025449",
"0.6020222",
"0.5999812",
"0.5980912",
"0.59578305",
"0.59541076",
"0.58716995",
"0.5828952",
"0.5826591",
"0.582434",
"0.580031",
"0.57892424",
"0.5772457",
"0.5767864",
"0.5763427",
"0.575721",
"0.57310385",
"0.57277113",
"0.5719697",
"0.5716427",
"0.5705958",
"0.56945693",
"0.5689871",
"0.5686963",
"0.56845754"
] | 0.754211 | 0 |
Filter the robots.txt contents and add the /exports/ directory to the list of disallowed folders. | function exports_reports_robots_txt( $robots_txt ) {
$exclude_path = str_replace( ABSPATH, '', WP_ADMIN_UI_EXPORT_DIR );
$exclude_path = str_replace( DIRECTORY_SEPARATOR, '/', $exclude_path );
$exclude_path = trim( $exclude_path, '/' );
return $robots_txt . "\n" . 'Disallow: */' . $exclude_path . '/*';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addExcludesFromRobotsTxt($sContent) {\r\n $regs = Array();\r\n \r\n $bCheck=1;\r\n if (!$sContent){\r\n return false;\r\n }\r\n foreach(explode(\"\\n\", $sContent) as $line) {\r\n // echo \"DEBUG: $line\\n\";\r\n $line=preg_replace('/#.*/', '', $line);\r\n if (preg_match(\"/^user-agent: *([^#]+) */i\", $line, $regs)) {\r\n $this_agent = trim($regs[1]);\r\n $bCheck = ($this_agent == '*' || strtolower($this->aAbout['product'])===strtolower($this_agent));\r\n }\r\n if ($bCheck == 1 && preg_match(\"/disallow: *([^#]+)/i\", $line, $regs) ) {\r\n // echo \"ROBOTS:TXT: $line\\n\";\r\n $disallow_str = preg_replace(\"/[\\n ]+/i\", \"\", $regs[1]);\r\n if (trim($disallow_str) != \"\") {\r\n // $sEntry = '.*\\/\\/'. $sHost . '/' . $disallow_str . '.*';\r\n $sEntry = $disallow_str;\r\n $sEntry = str_replace('//', '/', $sEntry);\r\n // ?? $sEntry = str_replace('*\\.*', '.*', $sEntry);\r\n // $sEntry = str_replace('.', '\\.', $sEntry);\r\n foreach (array('.', '?') as $sMaskMe){\r\n $sEntry = str_replace($sMaskMe, '\\\\'.$sMaskMe, $sEntry);\r\n }\r\n $sEntry = str_replace('*', '.*', $sEntry);\r\n \r\n if (!strpos($sEntry, '$')){\r\n $sEntry .= '.*';\r\n }\r\n \r\n if (!array_search($sEntry, $this->aProfileEffective['searchindex']['exclude'])) {\r\n $this->aProfileEffective['searchindex']['exclude'][] = $sEntry;\r\n }\r\n }\r\n }\r\n }\r\n // print_r($this->aProfile['searchindex']['exclude']); die();\r\n return true;\r\n \r\n }",
"function respect_robots_txt() {\n\t\t// ?robots=1 is here to trigger `is_robots()`, which prevents canonical.\n\t\t// ?gp_route=robots.txt is here, as GlotPress ultimately is the router for the request.\n\t\tadd_rewrite_rule( '^robots\\.txt$', 'index.php?robots=1&gp_route=robots.txt', 'top' );\n\t}",
"public static function handleRobots()\n {\n // robots only allowed on the www domain\n if (($_SERVER['REQUEST_URI'] == '/robots.txt')) {\n header('Content-type: text/plain');\n\n if ((substr($_SERVER['HTTP_HOST'], 0, 4) !== 'www.')) {\n die(\"User-agent: *\\nDisallow: /\\n\");\n }\n\n die(\"User-agent: *\\nDisallow:\\n\");\n // die(\"User-agent: *\\nDisallow: /de_CH/\\nDisallow: /de_AT/\\n\");\n }\n }",
"private function excludeFilesFromAnnotationChecks()\n {\n $th = \\Core::make(\"helper/text\");\n $driver = $this->getEntityManager()->getConfiguration()->getMetadataDriverImpl();\n $excludePaths = array();\n foreach (self::$pageListPlusFilters as $handle => $name) {\n $excludePaths[] = DIR_PACKAGES . '/' . $this->pkgHandle . '/src/PageListPlus/Filter/' . $th->CamelCase($name) . '.php';\n }\n $driver->addExcludePaths($excludePaths);\n }",
"public function addToWhiteList()\n {\n if ($this->_listenStarted) {\n\n return false;\n } else {\n foreach ($this->whiteList as $dir) {\n $this->phpCC->filter()->addDirectoryToWhitelist($_SERVER['DOCUMENT_ROOT'] . $dir);\n }\n }\n }",
"function shibboleth_insert_htaccess() {\n\t$disabled = defined( 'SHIBBOLETH_DISALLOW_FILE_MODS' ) && SHIBBOLETH_DISALLOW_FILE_MODS;\n\n\tif ( got_mod_rewrite() && ! $disabled ) {\n\t\t$htaccess = get_home_path() . '.htaccess';\n\t\t$rules = array( '<IfModule mod_shib>', 'AuthType shibboleth', 'Require shibboleth', '</IfModule>', '<IfModule mod_shib.c>', 'AuthType shibboleth', 'Require shibboleth', '</IfModule>', '<IfModule mod_shib.cpp>', 'AuthType shibboleth', 'Require shibboleth', '</IfModule>' );\n\t\tinsert_with_markers( $htaccess, 'Shibboleth', $rules );\n\t}\n}",
"public static function mlmDenyAll();",
"public function grant_or_deny_access()\r\r\n\t{\r\r\n\t\tglobal $ipfilter_plugin_dir;\r\r\n\r\r\n\t\t//exclude administrators\r\r\n\t\tif( current_user_can( 'manage_options' ) )\r\r\n\t\t{\r\r\n\t\t\treturn;\r\r\n\t\t}\r\r\n\r\r\n\t\t//do not block if we access the administration area\r\r\n\t\tif( is_admin() )\r\r\n\t\t{\r\r\n\t\t\treturn;\r\r\n\t\t}\r\r\n\r\r\n\t\t//A way for admins to get access back to the blog if they managed to block themselves\r\r\n\t\tif( ! empty( $this->bypass_url ) && isset( $_GET[ $this->bypass_url ] ) )\r\r\n\t\t{\r\r\n\t\t\treturn;\r\r\n\t\t}\r\r\n\r\r\n\t\t$visitor_ips = $this->get_visitor_ips();\r\r\n\r\r\n\t\t//TRUE = deny, FALSE = grant\r\r\n\t\t$boolean = ( $this->filter_type == 'deny' );\r\r\n\r\r\n\t\tforeach( $visitor_ips as $visitor_ip )\r\r\n\t\t{\r\r\n\t\t\t//if the IP address IS in the list, we deny access\r\r\n\t\t\tif( $this->wildcard_in_array( $visitor_ip, $this->filtered_ips ) == $boolean )\r\r\n\t\t\t{\r\r\n\t\t\t\tif( $this->log_blocked_ips == true )\r\r\n\t\t\t\t{\r\r\n\t\t\t\t\t//We record the blocked IP into the log\r\r\n\t\t\t\t\t$logline = \"Blocked: {$visitor_ip}, on \" . date( 'Y-m-d H:i:s' ) . \", using '{$_SERVER['HTTP_USER_AGENT']}', trying to access '{$_SERVER['REQUEST_URI']}'\\n\";\r\r\n\t\t\t\t\tfile_put_contents( $ipfilter_plugin_dir . '/logs/log.txt', $logline, FILE_APPEND | LOCK_EX );\r\r\n\t\t\t\t}\r\r\n\r\r\n\t\t\t\t//deny access\r\r\n\t\t\t\theader( 'Status: 403 Forbidden' );\r\r\n\t\t\t\theader( 'HTTP/1.1 403 Forbidden' );\r\r\n\t\t\t\twp_die( $this->deny_message );\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t}",
"public static function banned(): void\n {\n // Set the \"forbidden\" status code\n Http::setHeadersByCode(StatusCode::FORBIDDEN);\n\n // Inclusion of the HTML IP Banned page\n include PH7_PATH_SYS . 'global/' . PH7_VIEWS . PH7_DEFAULT_THEME . '/tpl/other/banned.html.php';\n\n // Stop script\n exit;\n }",
"private function analyze_robots($robot_contents) {\n //make the contents of the robots file into an array\n $lines = explode(\"\\n\", $robot_contents);\n \n //if the array contains both these lines 'User-agent: *' and \n //'Disallow: /' it means nobody can crawl anything\n if(in_array('User-agent: *', $lines) && in_array('Disallow: /', $lines)) {\n return false;\n \n //if the array contains a specific command for Fancentr.org\n } elseif(in_array('User-agent: Fancentr.org', $lines)) {\n \n //get the index of that line\n $index = array_search('User-agent: Fancentr.org', $lines);\n \n //get only the lines after the user agent line\n $lines_after = array_slice($lines, $index);\n \n //check if one of those lines disallows Fancentr.org from crawling the page\n if(in_array('Disallow: /', $lines_after)) {\n return false;\n } else {\n return true;\n }\n } else {\n return true;\n }\n }",
"public function updateRobots() {\n if (!isset( $this->sitemaps )) {\n throw new BadMethodCallException(\"To update robots.txt, call createSitemap function first.\");\n }\n $sampleRobotsFile = \"User-agent: *\\nAllow: /\";\n if (file_exists($this->basePath . $this->robotsFileName)) {\n $robotsFile = explode(\"\\n\",\n file_get_contents($this->basePath . $this->robotsFileName));\n $robotsFileContent = \"\";\n foreach ($robotsFile as $key => $value) {\n if (substr($value,\n 0,\n 8) == 'Sitemap:'\n ) {\n unset( $robotsFile[$key] );\n }\n else {\n $robotsFileContent .= $value . \"\\n\";\n }\n }\n $robotsFileContent .= \"Sitemap: $this->sitemapFullURL\";\n if ($this->createGZipFile && !isset( $this->sitemapIndex )) {\n $robotsFileContent .= \"\\nSitemap: \" . $this->sitemapFullURL . \".gz\";\n }\n file_put_contents($this->basePath . $this->robotsFileName,\n $robotsFileContent);\n }\n else {\n $sampleRobotsFile = $sampleRobotsFile . \"\\n\\nSitemap: \" . $this->sitemapFullURL;\n if ($this->createGZipFile && !isset( $this->sitemapIndex )) {\n $sampleRobotsFile .= \"\\nSitemap: \" . $this->sitemapFullURL . \".gz\";\n }\n file_put_contents($this->basePath . $this->robotsFileName,\n $sampleRobotsFile);\n }\n }",
"private function setWhiteAndBlacklists()\n {\n $config = $this->context->configuration;\n\n if (!empty($config[\"Analysis\"][\"Languages\"][\"except\"])) {\n $this->languagesBlacklist = $config[\"Analysis\"][\"Languages\"][\"except\"];\n }\n\n if (!empty($config[\"Analysis\"][\"Languages\"][\"only\"])) {\n $this->languagesWhitelist = $config[\"Analysis\"][\"Languages\"][\"only\"];\n }\n\n if (!empty($config[\"Analysis\"][\"Analyzers\"][\"except\"])) {\n $this->analyzersBlacklist = $config[\"Analysis\"][\"Analyzers\"][\"except\"];\n }\n\n if (!empty($config[\"Analysis\"][\"Analyzers\"][\"only\"])) {\n $this->analyzersWhitelist = $config[\"Analysis\"][\"Analyzers\"][\"only\"];\n }\n }",
"function shibboleth_remove_htaccess() {\n\t$disabled = defined( 'SHIBBOLETH_DISALLOW_FILE_MODS' ) && SHIBBOLETH_DISALLOW_FILE_MODS;\n\n\tif ( got_mod_rewrite() && ! $disabled ) {\n\t\t$htaccess = get_home_path() . '.htaccess';\n\t\tinsert_with_markers( $htaccess, 'Shibboleth', array() );\n\t}\n}",
"protected static function _prepareInvalidPermissions($excludeIgnoredPaths = false)\n\t{\n\t\tself::_prepareChmodLists($excludeIgnoredPaths);\n\n\t\tif(count(self::$writable) === 0 || count(self::$nonWritable) === 0)\n\t\t{\n\t\t\tself::$writable = array();\n\t\t\tself::$nonWritable = array();\n\n\t\t\t$configure = 'includes' . DIRECTORY_SEPARATOR . 'configure.php';\n\t\t\t$configureOrg = 'includes' . DIRECTORY_SEPARATOR . 'configure.org.php';\n\n\t\t\t// handle chmod.txt\n\t\t\tforeach(self::$chmodList as $item)\n\t\t\t{\n\t\t\t\t$path = DIR_FS_CATALOG . $item;\n\n\t\t\t\t// configure files files must be non writable\n\t\t\t\tif((self::_endWith($item, $configure) || self::_endWith($item, $configureOrg))\n\t\t\t\t && is_writable($path)\n\t\t\t\t)\n\t\t\t\t{\n\t\t\t\t\tself::$nonWritable[] = $path;\n\t\t\t\t}\n\t\t\t\telseif(!self::_endWith($item, $configure) && !self::_endWith($item, $configureOrg)\n\t\t\t\t && (is_dir($path)\n\t\t\t\t || is_file($path))\n\t\t\t\t && !is_writable($path)\n\t\t\t\t)\n\t\t\t\t{\n\n\t\t\t\t\tself::$writable[] = $path;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// handle chmod_all.txt\n\t\t\tforeach(self::$chmodRecursiveList as $item)\n\t\t\t{\n\t\t\t\t$path = DIR_FS_CATALOG . $item;\n\n\t\t\t\tif(!is_writable($path))\n\t\t\t\t{\n\t\t\t\t\tself::$writable[] = $path;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"function dzk_blacklist()\n{\n $ztemp = System::getVar('temp');\n $blacklistfile = $ztemp . '/Dizkus_spammer.txt';\n\n $fh = fopen($blacklistfile, 'a');\n if ($fh) {\n $ip = dzk_getip();\n $line = implode(',', array(strftime('%Y-%m-%d %H:%M'),\n $ip,\n System::serverGetVar('REQUEST_METHOD'),\n System::serverGetVar('REQUEST_URI'),\n System::serverGetVar('SERVER_PROTOCOL'),\n System::serverGetVar('HTTP_REFERRER'),\n System::serverGetVar('HTTP_USER_AGENT')));\n fwrite($fh, DataUtil::formatForStore($line) . \"\\n\"); \n fclose($fh);\n }\n\n return;\n}",
"private function createHtaccessFiles()\n {\n $dir = $this->getGalleryDir();\n $this->fileHandler->createFileProtection($dir, Image::OBJECT_TYPE);\n }",
"function get_allowed_use_subdirectories() {\n\treturn [ 'common' ];\n}",
"public function generate_robots() {\n\t\t$robots = $this->get_base_robots();\n\n\t\t$robots['index'] = 'noindex';\n\n\t\treturn $this->filter_robots( $robots );\n\t}",
"private function removeHtaccessFiles()\n {\n $dir = $this->getGalleryDir();\n $this->fileHandler->deleteFileProtection($dir);\n }",
"private function checkDisabledUris()\n\t{\n\t\tif ($this->uri) {\n\n\t\t\t$disabledPatterns = [\n\t\t\t\t'wordpress',\n\t\t\t\t'wp-includes',\n\t\t\t\t'wp-admin',\n\t\t\t\t'autodiscover',\n\t\t\t];\n\n\t\t\tforeach ($disabledPatterns as $pattern) {\n\t\t\t\tif (preg_match('/' . $pattern . '/', $this->uri)) {\n\t\t\t\t\t$this->event->setResponse(new RedirectResponse($this->request->getSchemeAndHttpHost(), 301));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public static function getDenyhosts () {\n return array (\n 'www.vimeo.com', \n 'soundcloud.com', \n 'youtu.be', \n 'www.youtu.be', \n 'www.youtube.com', \n 'youtube.com');\n }",
"public function allowHiddenFiles()\n\t{\n\t\t$this->_allowHiddenFiles = TRUE;\n\t}",
"public function get_denylist_plugins() {\n\t\t\t// Fetch denylist from wp-options\n\t\t\t$denylist = get_option( 'woocart_denylist_plugins', array() );\n\n\t\t\t// Merge it with the list which already exists\n\t\t\tif ( count( $denylist ) > 0 ) {\n\t\t\t\t$new_denylist = array_merge( $this->plugins_denylist, $denylist );\n\n\t\t\t\t// Remove dupes\n\t\t\t\t$new_denylist = array_unique( $new_denylist );\n\n\t\t\t\t// Set $this->plugins_denylist to the new list\n\t\t\t\t$this->plugins_denylist = $new_denylist;\n\t\t\t}\n\t\t}",
"public function accessRules()\n\t{\n\t\treturn array(\n\t\t\tarray('allow',\n\t\t\t\t'users'=>AdminModule::getAdmins(),\n\t\t\t),\n\t\t\t//this stopped uploading of images for some reason!!\n\t\t\t//array('deny', // deny all users\n\t\t\t\t//'users'=>array('*'),\n\t\t\t//),\n\t\t);\n\t}",
"private function __construct() {\n $this->domains = $this->getListFromFile(\"forbiddenDomains.txt\");\n $this->emails = $this->getListFromFile(\"forbiddenEmails.txt\");\n $this->characters = $this->getListFromFile(\"forbiddenCharacters.txt\");\n }",
"public static function getIgnores() {\n\t\treturn array('.','..','application-conf.php','application-classmap.php','fingerprints','migrations','sql','.svn');\n\t}",
"public function accessRules() {\n return array(\n array('allow', // allow all users to perform 'index' and 'view' actions\n 'actions' => array('admin', 'export','exportTxt'),\n 'roles' => array('research'),\n ),\n array('deny', // deny all users\n 'users' => array('*'),\n ),\n );\n }",
"public function protectUploadsDir() {\n\t\tif ( defined( 'UPLOADS' ) ) {\n\t\t\t$this->contentdir_path = ABSPATH . UPLOADS . '/' . '.htaccess';\n\t\t\t//should be same with protect content dirs\n\t\t\t$this->protectContentDir();\n\t\t}\n\t}",
"function setAllowFile($file){\n $this->allow_file = array_map('strtolower', $file);\n $this->forbid_file = array();\n }",
"function adapted_add_default_text_formats_and_perms() {\n // Add text formats.\n $filtered_html_format = array(\n 'format' => 'filtered_html',\n 'name' => 'Filtered HTML',\n 'weight' => 0,\n 'filters' => array(\n // URL filter.\n 'filter_url' => array(\n 'weight' => 0,\n 'status' => 1,\n ),\n // HTML filter.\n 'filter_html' => array(\n 'weight' => 1,\n 'status' => 1,\n ),\n // Line break filter.\n 'filter_autop' => array(\n 'weight' => 2,\n 'status' => 1,\n ),\n // HTML corrector filter.\n 'filter_htmlcorrector' => array(\n 'weight' => 10,\n 'status' => 1,\n ),\n ),\n );\n $filtered_html_format = (object) $filtered_html_format;\n filter_format_save($filtered_html_format);\n\n $full_html_format = array(\n 'format' => 'full_html',\n 'name' => 'Full HTML',\n 'weight' => 1,\n 'filters' => array(\n // URL filter.\n 'filter_url' => array(\n 'weight' => 0,\n 'status' => 1,\n ),\n // Line break filter.\n 'filter_autop' => array(\n 'weight' => 1,\n 'status' => 1,\n ),\n // HTML corrector filter.\n 'filter_htmlcorrector' => array(\n 'weight' => 10,\n 'status' => 1,\n ),\n ),\n );\n $full_html_format = (object) $full_html_format;\n filter_format_save($full_html_format);\n \n // Enable default permissions for system roles.\n $filtered_html_permission = filter_permission_name($filtered_html_format);\n user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access content', $filtered_html_permission));\n user_role_grant_permissions(DRUPAL_AUTHENTICATED_RID, array('access content', $filtered_html_permission));\n}"
] | [
"0.6422962",
"0.59648806",
"0.59237",
"0.56536597",
"0.5597683",
"0.5264295",
"0.52096057",
"0.52023417",
"0.5180214",
"0.517131",
"0.51698226",
"0.5145303",
"0.51260036",
"0.511453",
"0.5058266",
"0.5013154",
"0.4986664",
"0.49360445",
"0.49251798",
"0.49159235",
"0.49142128",
"0.48936114",
"0.4886521",
"0.48855233",
"0.48677728",
"0.48655292",
"0.484929",
"0.48398247",
"0.48383695",
"0.48268658"
] | 0.70023715 | 0 |
Sample function to get customer Details based on the id passed in the url. e.g site_url.com/api/user/customer_details?id=679 | public function customer_details_get()
{
if(!$this->get('id'))
{
$this->response(NULL, 400);
}
$user = $this->Users_model->fetchdata( $this->get('id') );
if($user)
{
$this->response($user, 200); // 200 being the HTTP response code
}
else
{
$this->response(NULL, 404);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show($id)\n {\n //show particular customer\n }",
"public function show($id)\n {\n $customer=Customer::join('users', 'customers.user_id', 'users.id')\n ->join('credit_cards', 'credit_cards.customer_id', 'customers.id')\n ->select('customers.*','users.name', 'users.email', 'users.role', 'credit_cards.id as cc_id', 'credit_cards.name as cc_name',\n 'credit_cards.number', 'credit_cards.exp_date')\n ->where('customers.id', '=', $id)\n ->get();\n $array = Array();\n $array['data'] = $customer;\n if(count($customer) > 0)\n return response()->json($array, 200);\n return response()->json(['error' => 'customer not found'], 404);\n }",
"function CustomerDetails($varCustomerId)\n {\n $arrClms = array(\n 'ReferalID',\n 'CustomerScreenName',\n 'CustomerFirstName',\n 'CustomerLastName',\n 'CustomerEmail',\n 'CustomerPassword',\n 'BillingFirstName',\n 'BillingLastName',\n 'BillingOrganizationName',\n 'BillingAddressLine1',\n 'BillingAddressLine2',\n 'BillingCountry',\n 'BillingPostalCode',\n 'BillingTown',\n 'BillingPhone',\n 'ShippingFirstName',\n 'ShippingLastName',\n 'ShippingOrganizationName',\n 'ShippingAddressLine1',\n 'ShippingAddressLine2',\n 'ShippingCountry',\n 'ShippingPostalCode',\n 'ShippingTown',\n 'ShippingPhone',\n 'BusinessAddress',\n 'BalancedRewardPoints',\n 'CustomerDateAdded',\n 'ResAddressLine1', 'ResAddressLine2', 'ResPostalCode', 'ResCountry', 'ResTown', 'ResPhone',\n 'CustomerWebsiteVisitCount', 'SameShipping'\n );\n $argWhere = \"pkCustomerID='\" . $varCustomerId . \"' \";\n $arrRes = $this->select(TABLE_CUSTOMER, $arrClms, $argWhere);\n\n\n\n//pre($arrRes);\n return $arrRes;\n }",
"private function getCustomer($id)\n {\n $result = $this->find($id);\n if (! $result) {\n return $this->notFoundResponse();\n }\n $response['status_code_header'] = 'HTTP/1.1 200 OK';\n $response['body'] = json_encode($result);\n return $response;\n }",
"public function showCustomerById(Request $req) \n {\n $id = $req->input('id');\n // $show = Customer::where('id', $id)->first();\n $show = Customer::find($id);\n return json_encode($show);\n }",
"function getCustomerInformation($cust_id)\n\n\t{\t\t\t\n\n\t\t$this->db->where(\"cust_id\", $cust_id);\n\n\t\t$result = $this->db->getOne(\"customer\");\n\n\t\treturn $result; \n\n\t}",
"public function getDetails($id) {\n $sql = \"SELECT * FROM customers WHERE id = '$id'\";\n \n $result = $this->con->query ($sql);\n \n $row = $result->fetch_assoc();\n \n return $row;\n }",
"public function show(Customer $customer,$id)\n {\n //\n }",
"public function show($id)\n { $this->grantIfRole('admin');\n $customer = Customer::find($id);\n if (empty($customer)){\n return response()->json([\n 'message' => 'Record not found',\n ], 404);\n }\n return $customer;\n }",
"public function testCustomerDetailEndpoint()\n {\n $user = factory('App\\User')->create();\n $this->actingAs($user, 'api');\n\n $customer = factory('App\\Customer')->make();\n $user->addCustomer($customer);\n\n $response = $this->get(route('api.customer.detail', ['customerId' => $customer->id]));\n $response->assertStatus(200);\n $response->assertJsonFragment(['name' => $customer->name]);\n }",
"public function getCustomer($id) {\n return response()->json(Customer::find($id));\n }",
"public function requestCustomerId();",
"public function getByCustomerId($customerId);",
"public function getCustomer($id)\n\t{\n\t\t$ct = \\App\\Customer::find($id);\n\t\treturn response()->json($ct);\n\t}",
"public function show_customer_details(Request $request)\n {\n $input = $request->all();\n $validator = Validator::make($input, [\n 'customer_id' => 'required'\n ]);\n\n if ($validator->fails()) {\n return $this->sendError($validator->errors());\n }\n\n $result = AddCustomer::select('id', 'customer_name', 'gender','email', 'contact_no','address','customer_code','branch')->where('id',$input['customer_id'])->first();\n \n if (is_object($result)) {\n \n return response()->json([\n \"result\" => $result,\n \"message\" => 'Success',\n \"status\" => 1\n ]);\n } else {\n return response()->json([\n \"message\" => 'Sorry, something went wrong...',\n \"status\" => 0\n ]);\n }\n }",
"public function view($id){\n \n return Customer::find($id);\n }",
"public function show($id)\n {\n //\n $customer = Customer::with('membership')->find($id);\n return \\Response::json($customer);\n }",
"public function getcustomerDetails() {\n\t\t$path = base_url();\n\t\t$url = $path . 'api/ManageQuotations_api/getcustomerDetails';\n\t\t$ch = curl_init($url);\n\t\tcurl_setopt($ch, CURLOPT_HTTPGET, true);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t$response_json = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t$response = json_decode($response_json, true);\n\t\treturn $response;\n\t}",
"public function detail(){\n\t\t\t$MaKH = $_GET['MaKH'];\n\t\t\t$customer = $this->customerModel->detail($MaKH);\n\t\t\trequire_once('views/customer/detail.php');\n\t\t}",
"public function show($id)\n {\n $user=User::findOrFail(Auth::guard('api')->id());\n if($user->user_type==\"customer\"){\n $customer=DB::select(\"select customer_id from customers where username = '$user->name'\");\n $event=DB::select(\"select customer_id from customer_events where event_id = '$id'\");\n //$event=customer_event::findOrFail($id);\n if($event[0]->customer_id==$customer[0]->customer_id){\n $eve=customer_event::findOrFail($id);\n return $eve;\n }\n }\n }",
"public function getLoggedIdCustomer(string $id);",
"public function getCustomerDetails($customer_id) {\n return $this->api->customer->fetch($customer_id);\n }",
"private function getCustomerFromId(string $customer_id, array $params = []): \\Mollie\\Api\\Resources\\Customer\n {\n return $this->mollie->customers->get($customer_id, $params);\n }",
"public function getCustomer($c_id){\n $this->load->database();\n if($c_id==-1){\n $result=$this->db->select('*')->from('customer_details')->get()->result_array();\n return($result);\n }\n else{\n $result=$this->db->select('*')->from('customer_details')->where('c_id',$c_id)->get()->result_array();\n return($result);\n }\n }",
"public function show($id)\n {\n $customer = Customer::findOrFail($id);\n return response()->json($customer, 200);\n }",
"public function customer($customer_id=''){\n }",
"public function show($id)\n {\n $customer = Customer::findOrFail($id);\n\n $response = [\n 'message' => 'Detail of customer',\n 'data' => $customer\n ];\n\n return response()->json($response, Response::HTTP_OK);\n }",
"public function show($id)\n {\n // return view('backend.customer.show');\n if ( !$id || empty($id) ) {\n return view('errors.500');\n }\n\n $store_id = explode('-', $id)[0];\n $customer_id = explode('-', $id)[1];\n\n try {\n $url = $this->host.\"/customer/\".$store_id.\"/\".$customer_id;\n $client = new Client;\n $headers = ['headers' => ['x-access-token' => Cookie::get('api_token')]];\n $response = $client->request(\"GET\", $url, $headers);\n $data = json_decode($response->getBody());\n if ( $response->getStatusCode() == 200 ) {\n return view('backend.customer.show')->with('response', $data->data);\n } else {\n return view('errors.500');\n }\n } catch (\\RequestException $e) {\n $statusCode = $e->getResponse()->getStatusCode();\n $data = json_decode($e->getResponse()->getBody()->getContents());\n $request->session()->flash('message', isset($data->message) ? $data->message : $data->error->error);\n if ( $statusCode == 401 ) {\n return redirect()->route('logout');\n }\n return back();\n Log::error((string) $response->getBody());\n return view('errors.500');\n } catch ( \\Exception $e ) {\n $statusCode = $e->getResponse()->getStatusCode();\n $data = json_decode($e->getResponse()->getBody()->getContents());\n $request->session()->flash('message', isset($data->message) ? $data->message : $data->error->error);\n if ( $statusCode == 401 ) {\n return redirect()->route('logout');\n }\n return back();\n Log::error((string) $response->getBody());\n return view('errors.500');\n }\n }",
"public function get($customer_id){\n return $this->customer_model->get($customer_id, 'id');\n }",
"public function getCustomer($id)\n {\n $sql = \"select customer_id,first_name,last_name,address_line_1,address_line_2,address_line_3,nic,contact_no from customer where customer_id=?;\";\n\n $stmt = $this->con->prepare($sql);\n $stmt->bind_param(\"s\",$id);\n if($stmt->execute())\n {\n $stmt->store_result();\n if($stmt->num_rows>0)\n {\n return $stmt;\n }\n else\n {\n return null;\n }\n\n }\n else\n {\n return null;\n }\n }"
] | [
"0.6914556",
"0.6782938",
"0.6757016",
"0.6699581",
"0.6666836",
"0.6646735",
"0.6590419",
"0.65872496",
"0.65611786",
"0.6554455",
"0.6532841",
"0.652037",
"0.64883935",
"0.6483769",
"0.6446071",
"0.6440114",
"0.6371507",
"0.6370039",
"0.6348003",
"0.6333372",
"0.6327137",
"0.63249505",
"0.6314834",
"0.62703866",
"0.6241773",
"0.62340796",
"0.6232039",
"0.6223486",
"0.62075496",
"0.6195442"
] | 0.77632433 | 0 |
/ deleteRoomPlanByIdList function delete room plan by Room plan id list string separated with comma. | public static function deleteRoomPlanByIdList($rpid_str)
{
if ($rpid_str == '0')
return;
$sql = 'INSERT INTO '._DB_PREFIX_.'RoomPlan_del (
RoomPlanId,
RoomTypeId,
RoomPlanName,
RoomPlanName_en,
RoomPlanName_jp,
RoomPlanName_S_CN,
RoomPlanName_T_CN,
RoomMaxPersons,
StartTime,
EndTime,
RoomSize,
RoomPlanDescription,
RoomPlanDescription_en,
RoomPlanDescription_jp,
RoomPlanDescription_S_CN,
RoomPlanDescription_T_CN,
Breakfast,
Dinner,
UseCon,
ConFromTime,
ConToTime,
Nights,
PriceAll,
PriceAsia,
PriceEuro,
Active,
liaojin,
zaiku
) SELECT
RoomPlanId,
RoomTypeId,
RoomPlanName,
RoomPlanName_en,
RoomPlanName_jp,
RoomPlanName_S_CN,
RoomPlanName_T_CN,
RoomMaxPersons,
StartTime,
EndTime,
RoomSize,
RoomPlanDescription,
RoomPlanDescription_en,
RoomPlanDescription_jp,
RoomPlanDescription_S_CN,
RoomPlanDescription_T_CN,
Breakfast,
Dinner,
UseCon,
ConFromTime,
ConToTime,
Nights,
PriceAll,
PriceAsia,
PriceEuro,
Active,
liaojin,
zaiku
FROM
'._DB_PREFIX_.'RoomPlan
WHERE
RoomPlanId IN ('.$rpid_str.')';
Db::getInstance()->ExecuteS($sql);
$sql = 'DELETE FROM '._DB_PREFIX_.'RoomPlan WHERE RoomPlanId in ('.$rpid_str.')';
Db::getInstance()->ExecuteS($sql);
$sql='INSERT INTO '._DB_PREFIX_.'RoomPlanRoomFileLink_del (
RoomPlanRoomFileLinkId,
RoomPlanId,
RoomFileId,
ShowOrder
) SELECT
RoomPlanRoomFileLinkId,
RoomPlanId,
RoomFileId,
ShowOrder
FROM
'._DB_PREFIX_.'RoomPlanRoomFileLink
WHERE
RoomPlanId IN ('.$rpid_str.')';
Db::getInstance()->ExecuteS($sql);
$sql = 'DELETE FROM '._DB_PREFIX_.'RoomPlanRoomFileLink WHERE RoomPlanId in ('.$rpid_str.')';
Db::getInstance()->ExecuteS($sql);
$sql = 'INSERT INTO '._DB_PREFIX_.'RoomStockAndPrice_del (
RoomPriceId,
RoomPlanId,
ApplyDate,
Price,
Amount,
Asia,
Euro
) SELECT
RoomPriceId,
RoomPlanId,
ApplyDate,
Price,
Amount,
Asia,
Euro
FROM
'._DB_PREFIX_.'RoomStockAndPrice
WHERE
RoomPlanId IN ('.$rpid_str.')';
Db::getInstance()->ExecuteS($sql);
$sql = 'DELETE FROM '._DB_PREFIX_.'RoomStockAndPrice WHERE RoomPlanId in ('.$rpid_str.')';
Db::getInstance()->ExecuteS($sql);
$sql = 'INSERT INTO '._DB_PREFIX_.'HotelRoomPlanLink_del (
HotelRoomPlanLinkId,
HotelId,
RoomPlanId,
ShowOrder
) SELECT
HotelRoomPlanLinkId,
HotelId,
RoomPlanId,
ShowOrder
FROM
'._DB_PREFIX_.'HotelRoomPlanLink
WHERE
RoomPlanId IN ('.$rpid_str.')';
Db::getInstance()->ExecuteS($sql);
$sql = 'DELETE FROM '._DB_PREFIX_.'HotelRoomPlanLink WHERE RoomPlanId in ('.$rpid_str.')';
Db::getInstance()->ExecuteS($sql);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteList($list_id){\n\t$conn = getDatabaseConnection();\n\n\t$query = $conn->prepare(\"DELETE FROM tasks WHERE list_id = :list_id\");\n\t$query->bindParam(\":list_id\", $list_id);\n\t$query->execute();\n\n\t$query = $conn->prepare(\"DELETE FROM lists WHERE id = :list_id\");\n\t$query->bindParam(\":list_id\", $list_id);\n\t$query->execute();\n}",
"function delete($ids = '', $comapt = false, $comapt2 = false)\n\t{\n\t\t$vars = get_defined_vars();\n\n\t\tif (!empty($vars))\n\t\t{\n\t\t\tforeach ($vars as $key => $var)\n\t\t\t{\n\t\t\t\t$params[$key] = &${$key};\n\t\t\t}\n\t\t}\n\n\t\t$this->startHook(\"beforePlanDelete\", $params);\n\n\t\tif (empty($ids))\n\t\t{\n\t\t\t$this->message = 'The ID parameter is empty.';\n\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!is_array($ids))\n\t\t{\n\t\t\t$ids = array($ids);\n\t\t}\n\n\t\tforeach($ids as $id)\n\t\t{\n\t\t\tparent::delete(\"`id` = :id\", array('id' => (int)$id));\n\n\t\t\tparent::setTable(\"listings\");\n\t\t\tparent::update(array('sponsored' => '0'), \"`plan_id` = :id\", array('id' => $id), array('sponsored_start' => '0', 'transaction_id' => '0'));\n\t\t\tparent::resetTable();\n\t\t}\n\n\t\t$where = $this->convertIds('plan_id', $ids);\n\t\t$this->cascadeDelete(array(\"plan_categories\", \"field_plans\"), $where);\n\n\t\t$vars = get_defined_vars();\n\n\t\tif (!empty($vars))\n\t\t{\n\t\t\tforeach ($vars as $key => $var)\n\t\t\t{\n\t\t\t\t$params[$key] = &${$key};\n\t\t\t}\n\t\t}\n\n\t\t$this->startHook(\"afterPlanDelete\", $params);\n\n\t\treturn true;\n\t}",
"public function delete_plans(){\n\t\tif ($this->checkLogin('A') == ''){\n\t\t\tredirect(ADMIN_PATH);\n\t\t}else {\n\t\t\t$plan_id = $this->uri->segment(4,0);\n\t\t\t$condition = array('id' => $plan_id);\n\t\t\t$this->plans_model->commonDelete(PLANS,$condition);\n\t\t\t$this->setErrorMessage('success','Plan deleted successfully');\n\t\t\tredirect(ADMIN_PATH.'/plans/display_plans');\n\t\t}\n\t}",
"public function delete($id_list){\n $query='DELETE FROM ToDoList WHERE id_list=:id_list';\n $this->con->executeQuery($query, array(\n ':id_list'=>array($id_list, PDO::PARAM_INT)\n ));\n }",
"public function deleteByCollection($langId, $area, $list)\n {\n if (empty($list)) {\n return;\n }\n\n foreach ($list as $group => $element) {\n DB::table('tbl_translations')\n ->where('lang_id', $langId)\n ->where('group', $group)\n ->where('area', $area)\n ->where('key', key($element))\n ->where('value', current($element))->delete();\n }\n return true;\n }",
"function deleteFromPlan($planid, $locid, $db) {\n $sql = \"DELETE FROM contains WHERE planID =\".$planid.\" AND locationID = \".$locid.\";\";\n $result = $db->query($sql);\n if (!$result) {\n printf(\"Errormessage: %s\\n\", $db->error);\n }\n return NULL;\n }",
"function delete_list($pawn_id) {\n $this->db->where_in('id', $pawn_id);\n return $this->db->update('pawn', array('deleted' => 1));\n }",
"function command_member_plan_delete () {\n global $esc_post;\n \n // Verify permissions\n if (!user_access('member_plan_edit')) {\n error_register('Permission denied: member_plan_edit');\n return 'index.php?q=members';\n }\n\n // Delete plan\n $sql = \"DELETE FROM `plan` WHERE `pid`='$esc_post[pid]'\";\n $res = mysql_query($sql);\n if (!$res) die(mysql_error());\n\n return 'index.php?q=plans';\n}",
"public static function delete_courses_from_list_category($category_id_list = array()) {\n global $wpdb;\n // Create a place holder string based on the amount of category id %s, %s, %s, ...\n $place_holders = implode(', ', array_fill(0, count($category_id_list), '%s'));\n $stmt = $wpdb->prepare('\n DELETE FROM ' . CM_Category_Item_Table::table_name() . ' WHERE ' . CM_Category_Item_Table::$category_id . '\n IN (' . $place_holders . ');\n ', $category_id_list);\n return $wpdb->query($stmt);\n }",
"public function delete_list($params) {\n\t\t$request_url = \"{$this->url}&api_action=campaign_delete_list&api_output={$this->output}&{$params}\";\n\t\t$response = parent::curl($request_url);\n\t\treturn $response;\n\t}",
"public function delete_plan($plan_id)\n\t{\n\t\t$data['title']= 'Delete Plan';\n\t\t$this->session->set_flashdata('msg','deleted');\n\t\techo $fetchedData=$this->planModel->deletePlanById($plan_id);\n\t}",
"public function deleteList($id_liste){\n\t\tglobal $wpdb;\n\t\trequire_once ABSPATH .'/wp-config.php';\n\t\t$sql = $wpdb->prepare('DELETE FROM `ch_liste` WHERE `id` = (%d)', $id_liste);\n\t\t$sql2 =$wpdb->prepare('DELETE FROM `ch_salaries` WHERE `id_liste` = (%d)', $id_liste);\n\t\t$wpdb->query($sql);\n\t\t$wpdb->query($sql2);\n\t}",
"public function deletePlan($id)\n {\n try {\n if (empty($id)) {\n return $this->getResponse(false, [\n 'message' => 'Cannot delete data'\n ]);\n }\n $item = $this->planRepo->deletePlan($id);\n if (!$item) {\n return $this->getResponse(false, ['code' => '', 'message' => 'Cannot delete data!']);\n }\n if ($this->redis->exists('plan:' . $id)) { //Check and delete redis key of current plan\n $this->redis->del(['plan:' . $id]);\n }\n $this->deleteListPlanKeys(); //Delete all plan lists on redis\n return $this->getResponse(true, (object)[], 'Delete data successfully');\n } catch (\\Exception $e) {\n return $this->catchResponseException($e);\n }\n }",
"function delete_list($ids)\n {\n $this->db->where_in('id', $ids);\n $success = $this->db->delete('attribute_sets');\n return $success;\n }",
"public function destroy($plan)\n {\n $plan = Planes::all()->where('PK_id',$plan)->first();\n $plan->delete();\n }",
"public function deleteList(Request $request)\n {\n $explode_id = array_map('intval', explode(',', $request->id));\n if($explode_id->ob_get_length()>0)\n $res = Ticket::wherein('id', $explode_id)->delete();\n return response()->json($res);\n }",
"public function deleteListPlanKeys()\n {\n $redisKeys = $this->redis->keys('list:*'); //Get all redis keys start with 'list:'\n if (empty($redisKeys)) {\n return true;\n }\n foreach ($redisKeys as $key) {\n $this->redis->del($key);\n }\n return true;\n }",
"public function deleteList()\n {\n if (!request()->ajax()) {\n return response()->json(['error' => 1, 'msg' => 'Method not allow!']);\n } else {\n $ids = request('ids');\n $arrID = explode(',', $ids);\n // ahihi\n// foreach ($arrID as $item){\n// $providerOrder= ShopProviderOrder::find($item);\n// $provider= ShopProvider::find($providerOrder->id);\n// $provider->total_payment= $provider->total_payment - $providerOrder->total;\n// $provider->debt= $provider->debt - $providerOrder->balance;\n// $provider->save();\n//\n// $debtProvider= ShopDebtProvider::find($providerOrder->id);\n// $debtProviderOrderDescription= ShopDebtProviderDiscription::where('provider_order_id', $providerOrder->id)->get();\n//\n// if(count($debtProviderOrderDescription) > 0) {\n//\n// foreach ($debtProviderOrderDescription as $des) {\n//\n// }\n// }\n// }\n ShopProviderOrder::destroy($arrID);\n return response()->json(['error' => 0, 'msg' => trans('order.admin.update_success')]);\n }\n }",
"function eliminar_plan_temporada(){\t\n\t\t$id=$_GET['id'];\n\t\t$plan=$_GET['plan'];\n\t\t$temporada=$_GET['temp'];\n\t\t$sql=\"DELETE FROM habitaciones WHERE id='$plan' AND id_temporada='$temporada' AND id_alojamiento='$id'\";\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\theader(\"location:/admin/hotel/detalle.php?id=$id#tarifas$temporada\");\n\t\texit();\n\t}",
"public function planner_delete_planification() {\n \n // Delete planification rule meta\n (new MidrubBaseUserAppsCollectionPlannerHelpers\\Planify)->planner_delete_planification();\n \n }",
"public function deleteItems($delList){\n \ttry {\n \t\t$arrDelete = explode(',', $delList);\n \t\tforeach ($arrDelete as $key=>$value) {\n \t\t\t$where = array('md5(client_id) = ?' => $this->_CommonController->decodeKey($value));\n \t\t\t$this->delete($where);\n \t\t}\n \t} catch (Exception $e) {\n \t\t// pass possible exceptions to log file\n \t$this->_CommonController->writeLog($e->getMessage());\n \t}\n }",
"public function destroy($plan_id)\n {\n if(!Auth::user()->can('Excluir planos')){\n return redirect()->back()->withErrors('Você não esta autorizado para executar esta ação.');\n }\n $plan = Plan::find($plan_id);\n $plan->delete();\n\n return redirect()->route('dashboard.plan.list')->withSuccess('Plano excluido com sucesso!');\n }",
"public function deleteShipmentIds($rmaId, array $shipmentIds);",
"public function deleteListItem( $id );",
"function removeList(){\n\tglobal $debug, $message, $success, $Dbc, $returnThis;\n\t$output = '';\n\ttry{\n\t\tif(empty($_SESSION['userId'])){\n\t\t\tthrow new Adrlist_CustomException('','$_SESSION[\\'userId\\'] is empty.');\n\t\t}elseif(empty($_POST['listId'])){\n\t\t\tthrow new Adrlist_CustomException('','$_POST[\\'listId\\'] is empty.');\n\t\t}elseif(!is_numeric($_POST['listId'])){\n\t\t\tthrow new Adrlist_CustomException('','$_POST[\\'listId\\'] is not numeric.');\n\t\t}\n\t\t$Dbc->beginTransaction();\n\t\t//Delete the user's listRoleId for all lists in the folder.\n\t\t$deleteListRoleStmt = $Dbc->prepare(\"DELETE\n\tuserListSettings\nFROM\n\tuserListSettings\nWHERE\n\tuserId = ?\");\n\t\t$deleteListRoleParams = array($_SESSION['userId']);\n\t\t$deleteListRoleStmt->execute($deleteListRoleParams);\n\t\t//Check for pending shares started by the current user.\n\t\t$removePendingSharesStmt = $Dbc->prepare(\"DELETE FROM\n\tinvitations\nWHERE\n\tsenderId = ? AND\n\tlistId = ?\");\n\t\t$removePendingSharesParams = array($_SESSION['userId'],$_POST['listId']);\n\t\t$removePendingSharesStmt->execute($removePendingSharesParams);\n\t\t$Dbc->commit();\n\t\t$returnThis['buildLists'] = buildLists();\n\t\tif(MODE == 'removeList'){\n\t\t\t$success = true;\n\t\t\t$message .= 'Removed List';\n\t\t}\n\t}catch(Adrlist_CustomException $e){\n\t}catch(PDOException $e){\n\t\terror(__LINE__,'','<pre>' . $e . '</pre>');\n\t}\n\tif(MODE == 'removeList'){\n\t\treturnData();\n\t}\n}",
"function delete($plan_id) {\n $this->load->library('form_validation');\n $this->load->helper('form');\n $this->load->model('Pricingplanmodel');\n\n //get pricing plan details\n $pricing_plan = array();\n $pricing_plan = $this->Pricingplanmodel->getDetails($plan_id);\n if (!$pricing_plan) {\n $this->utility->show404();\n return;\n }\n\n $this->Pricingplanmodel->deleteRecord($pricing_plan);\n $this->session->set_flashdata('SUCCESS', 'pricing_plans_deleted');\n redirect(\"pricing/pricing_plans/index/\");\n exit();\n }",
"function delete($plan_id) {\n $this->load->library('form_validation');\n $this->load->helper('form');\n $this->load->model('Pricingplanmodel');\n\n //get pricing plan details\n $pricing_plan = array();\n $pricing_plan = $this->Pricingplanmodel->getDetails($plan_id);\n if (!$pricing_plan) {\n $this->utility->show404();\n return;\n }\n\n $this->Pricingplanmodel->deleteRecord($pricing_plan);\n $this->session->set_flashdata('SUCCESS', 'pricing_plans_deleted');\n redirect(\"pricing/pricing_plans/index/\");\n exit();\n }",
"public function deleteList($id) {\n\t\treturn ShoppingList::where('user_id', $this->getId())->where('id', $id)->delete();\n\t}",
"function deleteList($listId){\n $WS_URI = $this->apiUrl . \"lists/$listId\";\n $params = array();\n\n $response = Http::connect($this->host, $this->port, http::HTTPS)\n //->setHeaders(array('Content-Type: application/json', 'Accept: application/json'))\n ->setCredentials($this->user, $this->apiKey)\n ->doDelete($WS_URI, $params);\n $arr_response = json_decode($response, true);\n return $arr_response;\n }",
"public function deleteBatchPlan(Request $request): JsonResponse\n {\n if (config('app.env') == 'demo') {\n return response()->json([\n 'status' => 'error',\n 'message' => 'Sorry! This option is not available in demo mode',\n ]);\n }\n\n\n $ids = $request->get('ids');\n $status = SenderidPlan::whereIn('uid', $ids)->delete();\n\n if ( ! $status) {\n throw new GeneralException(__('locale.exceptions.something_went_wrong'));\n }\n\n return response()->json([\n 'status' => 'success',\n 'message' => __('locale.plans.plan_successfully_deleted'),\n ]);\n\n }"
] | [
"0.5836527",
"0.58224624",
"0.571881",
"0.57095504",
"0.5583",
"0.55314094",
"0.54929376",
"0.5258582",
"0.5230048",
"0.5220031",
"0.5218147",
"0.52121687",
"0.51876444",
"0.51761657",
"0.5154432",
"0.51271254",
"0.5084258",
"0.50478554",
"0.50377196",
"0.50269204",
"0.50211495",
"0.50173616",
"0.5010564",
"0.5000713",
"0.499826",
"0.49943867",
"0.49943867",
"0.49822664",
"0.497672",
"0.49681252"
] | 0.7318965 | 0 |
/ having clause for room plan type list if agent searched room plan type1, and type2, then we have to show those hotels that have both two plan types, of course we will not show hotels that have only one that types. we will use this function when this case occured. | public static function getCriteriaHavingClause2($criteria)
{
$having_cond = ' ';
if (array_key_exists('RoomTypeVals', $criteria))
{
$roomtype_cond = '';
$roomtype_cond .= ' HAVING (1 ';
// echo count($criteria['RoomTypeVals']);
$cond_count = 0;
foreach($criteria['RoomTypeVals'] as $roomType => $roomTypeCount)
{
if ($roomTypeCount > 0)
{
// sum(if(A.`RoomTypeId` = 1, 1, 0))
$cond_count = 1;
$roomtype_cond .= '* (';
$roomtype_cond .= "sum(if(`RoomTypeId` = $roomType, 1, 0))";
$roomtype_cond .= ') ';
}
}
$roomtype_cond .= ') > 0';
$having_cond .= $roomtype_cond;
}
return $having_cond;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function searchHotelRoomPlan($criteria, $p, $n)\n\t{\n global $cookie;\n $iso = Language::getIsoById((int)$cookie->LanguageID);\n\n $where_cond = RoomPlan::getCriteriaWhereClause($criteria);\n\t\t$having_cond = RoomPlan::getCriteriaHavingClause($criteria);\n $price_field = RoomPlan::getCriteriaPriceField($criteria);\n $having_cond2 = RoomPlan::getCriteriaHavingClause2($criteria);\n $role=RoomPlan::getCriteriaRole($criteria);\n\n $usecond_cond = ' ';\n if (array_key_exists('CheckIn', $criteria) && '' != $criteria['CheckIn'] &&\n array_key_exists('CheckOut', $criteria) && '' != $criteria['CheckOut'])\n {\n // $usecond_cond .= \" , if(C.UseCon = 1, (DATE_ADD(\\\"{$criteria['CheckIn']}\\\", INTERVAL C.Nights-1 DAY) <= C.`ConToTime`) AND (DATE_SUB(\\\"{$criteria['CheckOut']}\\\",INTERVAL 1 DAY) >= C.`ConFromTime`) , 0) as UseCon \";\n $usecond_cond .= \" , if(C.UseCon = 1, DATEDIFF(LEAST(C.`ConToTime`, DATE_SUB(\\\"{$criteria['CheckOut']}\\\",INTERVAL 1 DAY)) , GREATEST(\\\"{$criteria['CheckIn']}\\\", C.`ConFromTime`)) >= (C.Nights - 1), 0) as UseCon \";\n }\n\n\t\t$order_by = '';\n\t\t\n\t\tif (array_key_exists('SortBy', $criteria) && '' != $criteria['SortBy'] && \n\t\t\tarray_key_exists('SortOrder', $criteria) && '' != $criteria['SortOrder'])\n\t\t{\n\t\t\tif ($criteria['SortBy'] == 'price' && array_key_exists('ContinentCode', $criteria))\n\t\t\t{\n\t\t\t\t$order_by = \" MinPrice \".$criteria['SortOrder'];\n\t\t\t} else if ($criteria['SortBy'] == 'class')\n\t\t\t{\n\t\t\t\t$order_by = ' HotelClassName '.$criteria['SortOrder'];\n\t\t\t}else if ($criteria['SortBy'] == 'name')\n\t\t\t{\n\t\t\t\t$order_by = ' A.HotelName '.$criteria['SortOrder'];\n\t\t\t}\n\t\t}\n\t\t$sql = '\n\t\t\tselect A.HotelId,A.HotelName_'.$iso.' as HotelName, A.HotelClass, A.HotelAddress_'.$iso.' as HotelAddress, F.HotelClassName, A.HotelCity, G.CityName_'.$iso.' as CityName, A.HotelArea, H.AreaName_'.$iso.' as AreaName\n\t\t\t\t\t,A.HotelDescription_'.$iso.' as HotelDescription, C.RoomPlanId, C.RoomTypeId, J.`RoomTypeName`, C.RoomPlanName_'.$iso.' as RoomPlanName, C.RoomMaxPersons,C.zaiku\n\t\t\t\t\t, C.Breakfast, C.Dinner, E.HotelOrder, C.`StartTime` , F.HotelClassName\n\t\t\t\t\t, C.`EndTime` '.$usecond_cond.$price_field;\n if($role=='Agent'){\n $sql.=', min(I.`Amount`) as MinAmount';\n }\n\n $sql.='\tFROM HT_Hotel as A, HT_HotelRoomPlanLink as B, HT_RoomPlan as C';\n if($role=='Agent'){\n $sql.=', `HT_RoomStockAndPrice` as I';\n }\n $sql.=',(\n\t\t\t\t\tSELECT HotelId, @curRow := @curRow + 1 AS HotelOrder\n\t\t\t\t\tFROM (\n\t\t\t\t\t select\n\t\t\t\t\t\t *\n\t\t\t\t\t From\n\t\t\t\t\t\t (\n\t\t\t\t\t\t\tselect \n\t\t\t\t\t\t\t\t(A.HotelId), A.HotelName, F.HotelClassName, C.RoomTypeId '.$price_field.'\n\t\t\t\t\t\t\tfrom\n\t\t\t\t\t\t\t\tHT_Hotel as A, HT_HotelRoomPlanLink as B, HT_RoomPlan as C,';\n if($role=='Agent'){\n $sql.='`HT_RoomStockAndPrice` as I,';\n }\n $sql.='HT_HotelClass as F\n\t\t\t\t\t\t\twhere \n\t\t\t\t\t\t\t\tA.HotelId = B.HotelId and B.RoomPlanId = C.RoomPlanId and F.HotelClassId = A.HotelClass ';\n if($role=='Agent'){\n $sql.=' AND C.`RoomPlanId` = I.`RoomPlanId`';\n }\n $sql.=$where_cond;\n if($role=='Agent'){\n $sql.=' GROUP BY I.`RoomPlanId`';\n }\n $sql .=\t$having_cond;\n if ($order_by != '')\n $sql .= ' ORDER BY '.$order_by;\n $sql .= '\t\t)\n\t\t\t\t\t\tAS A GROUP BY HotelId '.$having_cond2;\n if ($order_by != '')\n $sql .= ' ORDER BY '.$order_by;\n $sql .='\tLIMIT '.(($p - 1) * $n).','.$n;\n\t\t\n\t\t$sql\t.=') AS A join (SELECT @curRow := 0) r\n\t\t\t\t) AS E,\n\t\t\t\t\n\t\t\t\tHT_HotelClass as F,\n\t\t\t\tHT_City as G,\n\t\t\t\tHT_Area as H,\n\t\t\t\tHT_RoomType as J\n\t\t\tWHERE\n\t\t\t\tA.HotelId = E.HotelId and\n\t\t\t\tA.HotelId = B.HotelId and B.RoomPlanId = C.RoomPlanId\n\t\t\t\tAND A.HotelClass = F.HotelClassId\n\t\t\t\tAND A.HotelCity = G.CityId\n\t\t\t\tAND A.HotelArea = H.AreaId\n\t\t\t\tAND C.`RoomTypeId` = J.`RoomTypeId`';\n if($role=='Agent'){\n $sql.=' AND C.`RoomPlanId` = I.`RoomPlanId`';\n }\n $sql.=$where_cond;\n if($role=='Agent'){\n $sql.=' GROUP BY I.`RoomPlanId`';\n }\n $sql .=\t$having_cond.\n ' ORDER BY E.HotelOrder ASC';\n\t\tif ($order_by != '')\n\t\t\t\t\t$sql .= ', '.$order_by;\n\t\telse\n\t\t\t\t\t$sql .=', C.`RoomPlanId` ASC';\n\t\t\t\t\n\t //echo $sql;\n\t\t$res = Db::getInstance()->ExecuteS($sql);\n\t\tif (!$res)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\n\t\t// indexed by hotel id\n\t\t$search_result = array();\n\t\t\n\t\t$pre_buy_plans = array();\n\t\t//\n\t\tforeach ($res as $hotel_roomplan)\n\t\t{\n if($hotel_roomplan['zaiku']=='1'&&$hotel_roomplan['MinAmount']=='0'){\n continue;\n }\n\t\t\t// key\n\t\t\t$hotel_id = $hotel_roomplan['HotelId'];\n\t\t\t\n\t\t\t$search_record = array();\n\t\t\t$new_roomplan = Tools::element_copy($hotel_roomplan, 'RoomPlanId', 'RoomTypeId','RoomTypeName', 'RoomPlanName',\n\t\t\t 'RoomMaxPersons', 'UseCon', 'Breakfast', 'Dinner', 'RoomPriceId', 'ApplyDate', 'MinPrice', 'MinAmount');\n\t\t\t\n\t\t\tif (array_key_exists($hotel_id, $search_result)) // hotel already exists.\n\t\t\t{\n\t\t\t\t// get hotel record\n\t\t\t\t$search_record = $search_result[$hotel_id];\n\t\t\t\t\n\t\t\t} else { // It's new a hotel key\n\t\t\t\t\n\t\t\t\t// create new hotel info\n\t\t\t\t$search_record = Tools::element_copy($hotel_roomplan, 'HotelId', 'HotelName', 'HotelClass', 'HotelClassName', 'HotelAddress', \n\t\t\t\t'HotelCity', 'CityName' , 'HotelArea', 'AreaName', 'HotelDescription');\n\t\t\t\t\n\t\t\t\t// pre-calculation price for display\n\t\t\t\t// but user can reselect room type and count \n\t\t\t\t$search_record['BookingPrice'] = 0;\n\t\t\t\t\n\t\t\t\t// get hotel first image\n\t\t\t\t$image = HotelDetail::getFirstFileOfHotel($search_record['HotelId']);\n\t\t\t\t$search_record['HotelFilePath'] = $image['HotelFilePath'];\n\t\t\t\t$search_record['w5_path'] = $image['w5_path'];\n\t\t\t\t$search_record['w5'] = $image['w5'];\n\t\t\t\t$search_record['h5'] = $image['h5'];\n\t\t\t\t\n\t\t\t\t//\n\t\t\t\t$search_record['RoomPlanList'] = array();\n\t\t\t}\n\t\t\t\n\t\t\t$new_roomplan['PreSelect'] = 0;\n\t\t\t\n\t\t\tif ($criteria['RoomTypeVals'][$new_roomplan['RoomTypeId']] > 0) // pre-buy engine\n\t\t\t{\n\t\t\t\tif (!array_key_exists($hotel_id, $pre_buy_plans))\n\t\t\t\t\t$pre_buy_plans[$hotel_id] = array();\n\t\t\t\t\n\t\t\t\t// check already selected same room type\n\t\t\t\tif (!array_key_exists($new_roomplan['RoomTypeId'], $pre_buy_plans[$hotel_id]))\n\t\t\t\t{\n\t\t\t\t\t$new_roomplan['PreSelect'] = 1;\n\t\t\t\t\t$pre_buy_plans[$hotel_id][$new_roomplan['RoomTypeId']] = 1; // pre-select\n\t\t\t\t\t$search_record['BookingPrice'] += $new_roomplan['MinPrice'] * $criteria['RoomTypeVals'][$new_roomplan['RoomTypeId']];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// insert image information \n\t\t\t$rp_images = RoomFile::getRoomFileListByRoomPlanId($hotel_roomplan['RoomPlanId']);\n\t\t\t$file_id = $rp_images[0]['RoomFileId'];\n\t\t\t$res = RoomFile::getRoomFile($file_id);\n\t\t\tif (!$res)\n\t\t\t{\n\t\t\t\t$w2 = 0; $h2= 0;\t\n\t\t\t} else {\n\t\t\t\t$filepath = $res[0]['RoomFilePath'];\n\t\t\t\tlist($width, $height, $type, $attr) = getimagesize($filepath);\n\t\t\t\tif ($width < 100 && $height < 75) {\n\t\t\t\t\t$w2 = width; $h2 = $height;\n\t\t\t\t} else {\n\t\t\t\t\t$ratio1=$width/100;\n\t\t\t\t\t$ratio2=$height/75;\n\t\t\t\t\tif ($ratio1 < $ratio2) {\n\t\t\t\t\t\t$w2 = 100;$h2 = intval($height / $ratio1);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$h2 = 75;$w2 = intval($width / $ratio2); \n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$pos = strpos($filepath, \"asset\");\n\t\t\t\t$new_roomplan['img_path'] = substr($filepath, $pos);\n\t\t\t}\n\t\t\t$new_roomplan['img_width'] = $w2;$new_roomplan['img_height'] = $h2;\n\t\t\t\n\t\t\t// insert new roomplan-stock info\n\t\t\t$search_record['RoomPlanList'][] = $new_roomplan;\n\t\t\t\n\t\t\t\n\t\t\t// add or reset search result record\n\t\t\t$search_result[$hotel_id] = $search_record;\n\t\t\t\t\n\t\t}\n\t\treturn $search_result;\n\t}",
"public static function getCriteriaHavingClause($criteria)\n {\n $having_cond = ' HAVING 1=1 ';\n\n\n if (array_key_exists('CheckIn', $criteria) && '' != $criteria['CheckIn'] &&\n array_key_exists('CheckOut', $criteria) && '' != $criteria['CheckOut'])\n {\n $having_cond .= \" AND count(I.`RoomPlanId`) = DATEDIFF(\\\"{$criteria['CheckOut']}\\\", \\\"{$criteria['CheckIn']}\\\") \";\n }\n\n\n if (array_key_exists('HideRQ', $criteria) && '1' == $criteria['HideRQ'])\n {\n // $having_cond.=' AND min(I.`Amount`) > 0 ';\n if (array_key_exists('RoomTypeVals', $criteria))\n {\n $roomtype_cond = '';\n $roomtype_cond .= ' AND (1 ';\n // echo count($criteria['RoomTypeVals']);\n $cond_count = 0;\n foreach($criteria['RoomTypeVals'] as $roomType => $roomTypeCount)\n {\n if ($roomTypeCount > 0)\n {\n // sum(if(A.`RoomTypeId` = 1, 1, 0))\n $cond_count = 1;\n $roomtype_cond .= '* (';\n $roomtype_cond .= \"if(`RoomTypeId` = $roomType, min(I.`Amount`) >= {$roomTypeCount}, 1)\";\n $roomtype_cond .= ') ';\n }\n }\n $roomtype_cond .= ') > 0';\n\n $having_cond .= $roomtype_cond;\n }\n }\n\n return $having_cond;\n }",
"public function filterByMembership(string $type);",
"function validateFarmland($type) {\n\t\t//This checks that the land is not too wet or dry, doesn't have too many rocks, bushes or trees\n\t\t$local = new LocalMap($this->mysqli, $this->gx, $this->gy);//Note, this assumes that the area has been unlocked\n\t\t$local->loadcreate();\n\t\t$validList = array();\n\t\t$notList = array();\n\t\t\n\t\tforeach($this->coords_list as $square) {\n\t\t\t$valid = true;\n\t\t\t$px = floor($square[\"lx\"]/10);\n\t\t\t$py = floor($square[\"ly\"]/10);\n\t\t\t\n\t\t\t$vege = $local->getVegetation($px, $py);\n\t\t\t$row = $local->getROW($px, $py);\n\t\t\t$waterLevel = max(0,ceil(min($row[\"b\"]-10,219)/36));\n\t\t\t\n\t\t\tif ($type == 1) {\n\t\t\t\tif ($vege[\"r\"]>60||$vege[\"g\"]>128||$vege[\"b\"]>75||$row[\"r\"]>115||$waterLevel>3||$waterLevel==0) $valid = false;\n\t\t\t}\n\t\t\tif ($type == 2) {\n\t\t\t\tif ($vege[\"r\"]>60||$vege[\"g\"]>128||$vege[\"b\"]>75||$row[\"r\"]>115||$waterLevel<5) $valid = false;\n\t\t\t}\n\t\t\t\n\t\t\tif ($valid) $validList[] = $square;\n\t\t\telse $notList[] = $square;\n\t\t}\n\t\t\n\t\treturn array(\n\t\t\t\"valid\" => $validList, \n\t\t\t\"not\" => $notList\n\t\t\t);\n\t}",
"function _buildContentHaving()\n\t{\n\t\t$app = JFactory::getApplication();\n\t\t$option = JRequest::getVar('option');\n\t\t\n\t\t$filter_assigned\t= $app->getUserStateFromRequest( $option.'.fields.filter_assigned', 'filter_assigned', '', 'word' );\n\t\t\n\t\t$having = '';\n\t\t\n\t\tif ( $filter_assigned ) {\n\t\t\tif ( $filter_assigned == 'O' ) {\n\t\t\t\t$having = ' COUNT(rel.type_id) = 0';\n\t\t\t} else if ($filter_assigned == 'A' ) {\n\t\t\t\t$having = ' COUNT(rel.type_id) > 0';\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $having;\n\t}",
"public function test_plans_visibility(){\n $planType = $this->createPlanType();\n\n $isVisible = true;\n $visiblePlan = $this->createPlan('visible_plan', $planType, false, [], $isVisible);\n\n $isVisible = false;\n $visiblePlan = $this->createPlan('hidden_plan', $planType, false, [], $isVisible);\n\n $this->assertEquals($planType->plans()->visible()->count(), 1);\n $this->assertEquals($planType->plans()->withHiddens()->hidden()->count(), 1);\n $this->assertEquals($planType->plans()->withHiddens()->count(), 2);\n }",
"public function getVewOptoinTypeByTypes($type=null,$limit =null){\r\n \t$db = $this->getAdapter();\r\n \t$lang = $this->getCurrentLang();\r\n \t$array = array(1=>\"name_en\",2=>\"name_kh\");\r\n \t$sql=\"SELECT key_code as id,\".$array[$lang].\" AS name ,displayby FROM `ldc_view` WHERE status =1 AND name_en!='' \";//just concate\r\n \tif($type!=null){\r\n \t\t$sql.=\" AND type = $type \";\r\n \t}\r\n \tif($limit!=null){\r\n \t\t$sql.=\" LIMIT $limit \";\r\n \t}\r\n \t$rows = $db->fetchAll($sql);\r\n \treturn $rows;\r\n }",
"public static function searchHotelRoomPlanCount($criteria)\n\t{\n $where_cond = RoomPlan::getCriteriaWhereClause($criteria);\n $having_cond = RoomPlan::getCriteriaHavingClause($criteria);\n $price_field = RoomPlan::getCriteriaPriceField($criteria);\n $having_cond2 = RoomPlan::getCriteriaHavingClause2($criteria);\n\t\t$role=RoomPlan::getCriteriaRole($criteria);\n\t\t$sql = '\n\t\tSELECT count(*)\n\t\t\t\t\tFROM (\n\t\t\t\t\t select\n\t\t\t\t\t\t *\n\t\t\t\t\t From\n\t\t\t\t\t\t (\n\t\t\t\t\t\t\tselect\n\t\t\t\t\t\t\t\t(A.HotelId), A.HotelName, F.HotelClassName, C.RoomTypeId '.$price_field.'\n\t\t\t\t\t\t\tfrom\n\t\t\t\t\t\t\t\tHT_Hotel as A, HT_HotelRoomPlanLink as B, HT_RoomPlan as C,';\n if($role=='Agent'){\n $sql.='`HT_RoomStockAndPrice` as I,';\n }\n $sql.='\n\t\t\t\t\t\t\t\t HT_HotelClass as F\n\t\t\t\t\t\t\twhere\n\t\t\t\t\t\t\t\tA.HotelId = B.HotelId and B.RoomPlanId = C.RoomPlanId\n\t\t\t\t\t\t\t\t and F.HotelClassId = A.HotelClass';\n if($role=='Agent'){\n $sql.='AND C.`RoomPlanId` = I.`RoomPlanId`';\n }\n $sql.=$where_cond;\n if($role=='Agent'){\n $sql.='GROUP BY I.`RoomPlanId`';\n }\n $sql .=\t$having_cond;\n $sql .= '\t\t)\n\t\t\t\t\t\tAS A GROUP BY HotelId '.$having_cond2;\n $sql .= \") AS A\";\n //echo $sql;\n\t\treturn (int)Db::getInstance()->getValue($sql);\n\t}",
"function checkAllowedStockType($type)\n {\n if ($type == \"Sale\") {\n return array(2);\n } else if($type == \"Rental\") {\n return array(3);\n }else{\n return array(2,3);\n }\n \n }",
"public static function criteriaGrafik($model, $type='data', $addCols = array()){\n $criteria = new CDbCriteria;\n $criteria->select = 'count(pendaftaran_id) as jumlah';\n if ($_GET['filter'] == 'carabayar') {\n if (!empty($model->penjamin_id)) {\n $criteria->select .= ', penjamin_nama as '.$type;\n $criteria->group .= 'penjamin_nama';\n } else if (!empty($model->carabayar_id)) {\n $criteria->select .= ', penjamin_nama as '.$type;\n $criteria->group = 'penjamin_nama';\n } else {\n $criteria->select .= ', carabayar_nama as '.$type;\n $criteria->group = 'carabayar_nama';\n }\n } else if ($_GET['filter'] == 'wilayah') {\n if (!empty($model->kelurahan_id)) {\n $criteria->select .= ', kelurahan_nama as '.$type;\n $criteria->group .= 'kelurahan_nama';\n } else if (!empty($model->kecamatan_id)) {\n $criteria->select .= ', kelurahan_nama as '.$type;\n $criteria->group .= 'kelurahan_nama';\n } else if (!empty($model->kabupaten_id)) {\n $criteria->select .= ', kecamatan_nama as '.$type;\n $criteria->group .= 'kecamatan_nama';\n } else if (!empty($model->propinsi_id)) {\n $criteria->select .= ', kabupaten_nama as '.$type;\n $criteria->group .= 'kabupaten_nama';\n } else {\n $criteria->select .= ', propinsi_nama as '.$type;\n $criteria->group .= 'propinsi_nama';\n }\n }else{\n\t\t\t\t$criteria->select .= ', carabayar_nama as '.$type;\n\t\t\t\t$criteria->group = 'carabayar_nama';\n\t\t\t}\n\n if (!isset($_GET['filter'])){\n $criteria->select .= ', propinsi_nama as '.$type;\n $criteria->group .= 'propinsi_nama';\n }\n\n if (count($addCols) > 0){\n if (is_array($addCols)){\n foreach ($addCols as $i => $v){\n $criteria->group .= ','.$v;\n $criteria->select .= ','.$v.' as '.$i;\n }\n } \n }\n\n return $criteria;\n }",
"function getMatches($usertype, $matches) {\r\n\t$realMatches = array();\r\n\tforeach($matches as $match){\r\n\t\tif (pcheck($usertype, $match['ptype'])){\r\n\t\t\t\tarray_push($realMatches, $match);\r\n\t\t}\r\n\t}\r\n\treturn $realMatches;\r\n}",
"private function getRulesByType(&$column)\n {\n $rules = collect();\n\n $mainType = explode(' ', $column->Type)[0];\n if (Str::startsWith($mainType, ['tinyint', 'smallint', 'int', 'bigint'])) {\n if ($mainType === 'tinyint') {\n $field = Str::studly($column->Field);\n $rules->add(\"enum_value:' . $field::class . ',false\");\n // $rules->add(\"enum_key:' . $field::class\");\n } else\n $rules->add('integer');\n } elseif (Str::startsWith($mainType, 'tinyint(1)'))\n $rules->add('in:true,false');\n elseif (Str::startsWith($mainType, 'json'))\n $rules->add('json');\n elseif (Str::startsWith($mainType, 'enum')) {\n $rules->add('in:' . str_replace('\\'', '', substr($mainType, strpos($mainType, '(') + 1, -1)));\n } elseif (Str::startsWith($mainType, 'varchar')) {\n $rules->add('string');\n $rules->add('max:' . substr($mainType, strpos($mainType, '(') + 1, -1));\n } elseif (Str::startsWith($mainType, 'timestamp')) {\n $rules->add('date');\n }\n\n return $rules;\n }",
"function canContain(array $rules, string $bagType) : array {\n\t$result = [];\n\n\tforeach ($rules as $bag => $contains) {\n\t\tif (empty($contains)) continue;\n\n\t\tforeach ($contains as $bagTypes) {\n\t\t\tif ($bagTypes[1] === $bagType) {\n\t\t\t\t$result[] = $bag;\n\t\t\t\t$result = array_merge($result, canContain($rules, $bag));\n\t\t\t}\n\t\t}\n\t}\n\n\treturn array_unique($result);\n}",
"public function search($params)\n {\n $query = BuildingShopFloor::find()->joinWith('buildingCompany')->joinWith('buildingShopContract');\n\n // add conditions that should always apply here\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n\n $this->load($params);\n\n if (!$this->validate()) {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->where('0=1');\n return $dataProvider;\n }\n\n if($this->type == 1){\n $query->andWhere(['>','yl_building_shop_floor.led_total_screen_number',0]);\n }else if($this->type == 2){\n $query->andWhere(['>','yl_building_shop_floor.poster_total_screen_number',0]);\n }else if($this->type == 3){\n $query->andWhere(['>','yl_building_shop_floor.led_total_screen_number',0]);\n $query->andWhere(['yl_building_shop_floor.led_examine_status'=>[0,1,2]]);\n }else if($this->type == 4){\n $query->andWhere(['>','yl_building_shop_floor.poster_total_screen_number',0]);\n $query->andWhere(['yl_building_shop_floor.led_examine_status'=>[0,1,2]]);\n }else if($this->type == 5){\n $query->andWhere(['>','yl_building_shop_floor.poster_total_screen_number',0]);\n $query->andWhere(['yl_building_shop_floor.led_examine_status'=>[3,4,5]]);\n }else if($this->type == 6){\n $query->andWhere(['>','yl_building_shop_floor.poster_total_screen_number',0]);\n $query->andWhere(['yl_building_shop_floor.led_examine_status'=>[3,4,5]]);\n }\n\n $area = max($this->province,$this->city,$this->area,$this->town);\n if(!empty($area)){\n $query->andWhere(['left(yl_building_shop_floor.area_id,'.strlen($area).')' => $area]);\n }\n\n //LED审核通过时间\n if(isset($this->led_examine_at) && $this->led_examine_at){\n $query->andWhere(['>=','yl_building_shop_floor.led_examine_at',$this->led_examine_at.' 00:00:00']);\n }\n if(isset($this->led_examine_end) && $this->led_examine_end){\n $query->andWhere(['<=','yl_building_shop_floor.led_examine_at',$this->led_examine_end.' 23:59:59']);\n }\n\n //LED安装完成时间\n if(isset($this->led_install_finish_at) && $this->led_install_finish_at){\n $query->andWhere(['>=','yl_building_shop_floor.led_install_finish_at',$this->led_install_finish_at.' 00:00:00']);\n }\n if(isset($this->led_install_finish_end) && $this->led_install_finish_end){\n $query->andWhere(['<=','yl_building_shop_floor.led_install_finish_at',$this->led_install_finish_end.' 23:59:59']);\n }\n\n //LED合同审核通过时间\n if(isset($this->contract_examine_at) && $this->contract_examine_at){\n $query->andWhere(['>=','yl_building_shop_contract.examine_at',$this->led_install_finish_at.' 00:00:00']);\n }\n if(isset($this->contract_examine_end) && $this->contract_examine_end){\n $query->andWhere(['<=','yl_building_shop_contract.examine_at',$this->contract_examine_end.' 23:59:59']);\n }\n\n\n //海报审核通过时间\n if(isset($this->poster_examine_at) && $this->poster_examine_at){\n $query->andWhere(['>=','yl_building_shop_floor.poster_examine_at',$this->poster_examine_at.' 00:00:00']);\n }\n if(isset($this->poster_examine_end) && $this->poster_examine_end){\n $query->andWhere(['<=','yl_building_shop_floor.poster_examine_at',$this->poster_examine_end.' 23:59:59']);\n }\n\n //海报安装完成时间\n if(isset($this->poster_install_finish_at) && $this->poster_install_finish_at){\n $query->andWhere(['>=','yl_building_shop_floor.poster_install_finish_at',$this->poster_install_finish_at.' 00:00:00']);\n }\n if(isset($this->poster_install_finish_end) && $this->poster_install_finish_end){\n $query->andWhere(['<=','yl_building_shop_floor.poster_install_finish_at',$this->poster_install_finish_end.' 23:59:59']);\n }\n\n //认领\n if($this->default_status == 1){//led\n $query->andWhere([\n 'yl_building_shop_floor.led_examine_status' => [0,1],\n 'yl_building_shop_floor.led_examine_user_group' => '',\n 'yl_building_shop_floor.led_examine_user_name' => '',\n ]);\n }elseif($this->default_status == 2){//poster\n $query->andWhere([\n 'yl_building_shop_floor.poster_examine_status' => [0,1],\n 'yl_building_shop_floor.poster_examine_user_group' => '',\n 'yl_building_shop_floor.poster_examine_user_name' => '',\n ]);\n// }else{\n// if(Yii::$app->user->identity->member_group>0){\n// $query->andFilterWhere(['yl_building_shop_floor.examine_user_group'=> Yii::$app->user->identity->member_group]);\n// }\n }\n\n // grid filtering conditions\n $query->andFilterWhere([\n 'yl_building_shop_floor.id' => $this->id,\n 'contact_mobile' => $this->contact_mobile,\n 'yl_building_shop_floor.floor_type' => $this->floor_type,\n 'yl_building_shop_contract.status' => $this->contract_status,\n 'yl_building_shop_floor.led_examine_status' => $this->led_examine_status,\n 'yl_building_shop_floor.poster_examine_status' => $this->poster_examine_status,\n\n ]);\n\n $query->andFilterWhere(['like', 'shop_name', $this->shop_name])\n ->andFilterWhere(['like', 'yl_building_company.company_name', $this->company_name])\n ->andFilterWhere(['like', 'contact_name', $this->contact_name])\n ->andFilterWhere(['like', 'yl_building_company.apply_name', $this->apply_name]);\n// $commandQuery = clone $query;\n// echo $commandQuery->createCommand()->getRawSql();\n return $dataProvider;\n }",
"function getBusinessesByType( $type )\r\n {\r\n global $dbhost, $dbuser, $dbpass, $dbname;\r\n $array = array();\r\n $connection = mysqli_connect( $dbhost, $dbuser, $dbpass, $dbname );\r\n\r\n $index = 0;\r\n\r\n $sql = \"SELECT * from ilr_business_type \";\r\n\r\n $result = mysqli_query($connection, $sql);\r\n\r\n if( ($result->num_rows ) > 0 )\r\n {\r\n while( $row = $result->fetch_assoc() )\r\n {\r\n if( $row[$type] == 1 )\r\n {\r\n $array[ $index ] = $row[\"id\"];\r\n $index++;\r\n }\r\n }\r\n }\r\n\r\n if( $index > 0 )\r\n {\r\n $sql = 'SELECT * FROM ilr_business WHERE id IN (' . implode(',', array_map('intval', $array)) . ')';\r\n\r\n $result = mysqli_query($connection, $sql);\r\n\r\n if( $result->num_rows > 0 )\r\n {\r\n return $result;\r\n }\r\n }\r\n\r\n return 0;\r\n // close db connection\r\n mysqli_close($connection);\r\n }",
"public function modeOfVaccineSupplyByFacilityTypeAction() {\n //ccem proposed list 1.1 (1)\n $search_form = new Form_ReportsSearch();\n\n $data_arr = array(\n 'WorkingWell' => '90',\n 'WorkingNeedsService' => '7',\n 'NotWorking' => '3'\n );\n\n $main_heading = \"Mode Of Vaccine Supply By Facility Type\";\n $str_sub_heading = \"\";\n $number_prefix = \"\";\n $number_suffix = \"%\";\n $s_number_prefix = \"\";\n\n $xmlstore = \"<?xml version=\\\"1.0\\\"?>\";\n $xmlstore .= '<chart caption=\"' . $main_heading . '\" subCaption=\"' . $str_sub_heading . '\" numberPrefix=\"' . $number_prefix . '\" numberSuffix=\"' . $number_suffix . '\" sformatNumberScale=\"1\" sNumberPrefix=\"' . $s_number_prefix . '\" syncAxisLimits=\"1\" rotateValues=\"1\" showSum=\"0\" theme=\"fint\">';\n $xmlstore .='<set label=\"Working Well\" value=\"' . $data_arr['WorkingWell'] . '\"/>';\n $xmlstore .='<set label=\"Working Needs Service\" value=\"' . $data_arr['WorkingNeedsService'] . '\"/>';\n $xmlstore .='<set label=\"Not Working\" value=\"' . $data_arr['NotWorking'] . '\"/>';\n $xmlstore .=\"</chart>\";\n\n $this->view->xmlstore = $xmlstore;\n\n $this->view->main_heading = $main_heading;\n $this->view->str_sub_heading = $str_sub_heading;\n $this->view->chart_type = 'Pie3D';\n $this->view->width = '80%';\n $this->view->height = '400';\n $this->view->search_form = $search_form;\n $this->view->inlineScript()->appendFile(Zend_Registry::get('baseurl') . '/js/all_level_area_combo.js');\n }",
"public static function getRestaurantsByType($type) {\n $db = Zend_Registry::get('dbAdapter');\n $sql = sprintf('SELECT distinct(restaurants.name), SUBSTRING(restaurants.plz , 1, 1) as plz FROM restaurants INNER JOIN orders on orders.restaurantId=restaurants.id WHERE orders.mode=\"%s\" and orders.state>0 and restaurants.isOnline=0 and restaurants.status=0 and restaurants.deleted=0', $type);\n $result = $db->fetchAll($sql);\n\n return $result;\n }",
"function crs_availability($cin,$cout,$days,$sec_res)\n\t{\n\t$hotelName = $this->session->userdata('hotel_name');\n\t$roomusedtype = $this->session->userdata('roomusedtype');\n\t//print_r($roomusedtype); exit;\n\t$roomcount = $this->session->userdata('roomcount');\n\t $condition='';\n\t $sel='';\n\t // echo $hotelName;\n\t for($rm=0;$rm< count($roomcount);$rm++)\n\t {\n\t\t // echo $roomusedtype[$rm]; exit;\n\t if($roomusedtype[$rm]==1 )\n\t {\n\t\t\tif(!empty($hotelName) && $hotelName !='Enter Hotel name')\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$condition .= \" AND a.name LIKE '$hotelName%' OR a.name LIKE '%$hotelName' OR a.name LIKE '%$hotelName%'\";\n\t\t\t\t\n\t\t\t}\n\t //$condition .= \" AND b.single_room > 0\";\n\t\t// $condition .= \" AND b.check_in < '$cin' AND b.check_out > '$cout'\";\n\t $sel .= \",b.single_room\";\n\t\t \n\t }\n\t if($roomusedtype[$rm]==3)\n\t {\n\t\t\tif(!empty($hotelName) && $hotelName !='Enter Hotel name')\n\t\t\t{\n\t\t\t\t$condition .= \" AND a.name LIKE '$hotelName%' OR a.name LIKE '%$hotelName' OR a.name LIKE '%$hotelName%'\";\n\t\t\t\t\n\t\t\t}\n\t // $condition .= \" AND b.twin_room > 0\";\n\t\t// $condition .= \" AND b.check_in < '$cin' AND b.check_out > '$cout'\";\n\t // $sel .= \",b.twin_room\";\n\t\t $sel .= \",b.single_room\";\n\t }\n\t\t if($roomusedtype[$rm]==4)\n\t {\n\t\t\tif(!empty($hotelName) && $hotelName !='Enter Hotel name')\n\t\t\t{\n\t\t\t\t$condition .= \" AND a.name LIKE '$hotelName%' OR a.name LIKE '%$hotelName' OR a.name LIKE '%$hotelName%'\";\n\t\t\t\t\n\t\t\t}\n\t // $condition .= \" AND b.twin_room > 0\";\n\t\t// $condition .= \" AND b.check_in < '$cin' AND b.check_out > '$cout'\";\n\t $sel .= \",b.twin_room\";\n\t }\n\t\t if($roomusedtype[$rm]==7)\n\t {\n\t\t\tif(!empty($hotelName) && $hotelName !='Enter Hotel name')\n\t\t\t{\n\t\t\t\t$condition .= \" AND a.name LIKE '$hotelName%' OR a.name LIKE '%$hotelName' OR a.name LIKE '%$hotelName%'\";\n\t\t\t\t\n\t\t\t}\n\t // $condition .= \" AND b.twin_room > 0\";\n\t\t// $condition .= \" AND b.check_in < '$cin' AND b.check_out > '$cout'\";\n\t $sel .= \",b.triple_room\";\n\t }\n\t if($roomusedtype[$rm]==8)\n\t {\n\t\t\tif(!empty($hotelName))\n\t\t\t{\n\t\t\t\t$condition .= \" AND a.name LIKE '$hotelName%' OR a.name LIKE '%$hotelName' OR a.name LIKE '%$hotelName%'\";\n\t\t\t\t\n\t\t\t}\n\t //$condition .= \" AND b.triple_room > 0\";\n\t\t// $condition .= \" AND b.check_in < '$cin' AND b.check_out > '$cout'\";\n\t $sel .= \",b.triple_room\";\n\t }\n\t if($roomusedtype[$rm]==9)\n\t {\n\t\t\tif(!empty($hotelName))\n\t\t\t{\n\t\t\t\t$condition .= \" AND a.name LIKE '$hotelName%' OR a.name LIKE '%$hotelName' OR a.name LIKE '%$hotelName%'\";\n\t\t\t\t\n\t\t\t}\n\t //$condition .= \" AND b.quad_room > 0\";\n\t\t //$condition .= \" AND b.check_in < '$cin' AND b.check_out > '$cout'\";\n\t $sel .= \",b.quad_room\";\n\t }\n\t }\n\t $cin=$this->session->userdata('cin');\n\t $cout=$this->session->userdata('cout');\n\t \t$city=$this->session->userdata('citycode'); \n\t //echo $city = $this->session->userdata('destination'); exit;\n\t\t//echo $condition; exit;\n\t\t//echo \"SELECT a.*,b.categoryname,b.breakfast,b.roomdescription $sel FROM hotel_details AS a INNER JOIN room_details AS b ON a.hotel_id=b.hotel_id WHERE a.city='$city' AND a.status='active' $condition GROUP BY b.hotel_id\"; exit;\n\t\t//SELECT a.*,b.categoryname,b.breakfast,b.roomdescription $sel FROM hotel_details AS a INNER JOIN room_details AS b ON a.hotel_id=b.hotel_id WHERE a.city ='$city' AND a.status='active' $condition GROUP BY b.hotel_id \n\t\t//\n\t $querydb=$this->db->query(\"SELECT a.*,b.categoryname,b.breakfast,b.roomdescription $sel FROM hotel_details AS a INNER JOIN room_details AS b ON a.hotel_id=b.hotel_id WHERE a.city='$city' AND a.status='active' $condition GROUP BY b.hotel_id\");\n\t\n\n\t\t\n\t\t $resultdb=$querydb->result();\n\t\t $rw= $querydb->num_rows(); \t\n\t\t for($i=0;$i < count($resultdb); $i++)\n\t\t {\n\t\t\t \n\t\t\t $cityCode = $resultdb[$i]->city;\n\t\t\t $hotel_id=$resultdb[$i]->hotel_id;\n\t\t\t $itemCode=$resultdb[$i]->hotel_code;\n\t\t\t $itemVal=$resultdb[$i]->name;\n\t\t\t\t$starVal=$resultdb[$i]->rating;\n\t\t\t\t$roomDesc='';\n\t\t\t\tif(isset($resultdb[$i]->single_room))\n\t\t\t\t{\n\t\t\t\t$roomDesc.=\"Single -\".$resultdb[$i]->categoryname.\"+\";\n\t\t\t\t}\n\t\t\t\tif(isset($resultdb[$i]->twin_room))\n\t\t\t\t{\n\t\t\t\t$roomDesc.=\"Twin -\".$resultdb[$i]->categoryname.\"+\";\n\t\t\t\t}\n\t\t\t\tif(isset($resultdb[$i]->triple_room))\n\t\t\t\t{\n\t\t\t\t$roomDesc.=\"Triple -\".$resultdb[$i]->categoryname.\"+\";\n\t\t\t\t}\n\t\t\t\tif(isset($resultdb[$i]->quad_room))\n\t\t\t\t{\n\t\t\t\t$roomDesc.=\"Quad -\".$resultdb[$i]->categoryname.\"+\";\n\t\t\t\t}\n\t\n\t\n\t\t\t $roomDesc = substr($roomDesc, 0, -1); \n\t\n\t\t\t\t$meal = $resultdb[$i]->breakfast;\n\t\t\t\tif($meal == 0)\n\t\t\t\t{\n\t\t\t\t\t$mealsval = \"Room Only\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$mealsval = $meal;\n\t\t\t\t}\n\t\t\n\t\t\t\t$roomdescCode = '';\n\t\t\t\t$ConfirmationVal = $resultdb[$i]->status;\n\t\t\t\n\t\t\t\t$desc =$resultdb[$i]->description;\n\t\t\t\tif($resultdb[$i]->image != '')\n\t\t\t\t{\n\t\t\t\t$image = WEB_DIR_ADMIN.'hotel_logo/'.$resultdb[$i]->image;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$image = WEB_DIR.'supplier_logo/noimage.jpg';\n\t\t\t\t}\n\t\t\t\t$supplier_id=$resultdb[$i]->supplier_id;\n\t\t\t\n\t\t // $pernight=0;\n\t\t\t //echo $resultdb[$i]; \n\t\t\t\tif(isset($resultdb[$i]->single_room))\n\t\t\t\t{\n\t\t\t\t\t//echo \"1\";\n\t\t\t\t\t$pernight = $resultdb[$i]->single_room;\n\t\t\t\t}\n\t\t\t\tif(isset($resultdb[$i]->twin_room))\n\t\t\t\t{\n\t\t\t\t\t//echo \"2\";\n\t\t\t\t\t$pernight = $pernight+ $resultdb[$i]->twin_room;\n\t\t\t\t}\n\t\t\t\tif(isset($resultdb[$i]->triple_room))\n\t\t\t\t{\n\t\t\t\t\t//echo \"3\";\n\t\t\t \t$pernight = $pernight+$resultdb[$i]->triple_room;\n\t\t\t\t}\n\t\t\t\tif(isset($resultdb[$i]->quad_room))\n\t\t\t\t{\n\t\t\t\t\t//echo \"4\";\n\t\t\t \t$pernight = $pernight+$resultdb[$i]->quad_room;\n\t\t\t\t}\n\n\t\t\t\n\t\t\t\t//echo $resultdb[$i]->single_room; exit;\n\t\t\t\t$currencyVal = 'GBP';\n\t\t\t\t$curtype='GBP';\n\t\t\t \t\t$dateFromValc = '';\n\t\t\t\t$dateToValc = ''; \t \n\t\t\t\t$dateFromTimeValc = ''; \t \n\t\t\t\t$dateToTimeVal = ''; \n\t\t\t\t$serviceval = '';\n\t\t\t\t \t $finalcurval ='';\n\t\t\t\t\t $cancelCodeVal='';\n\t\t\t\t\t $purTokenVal='';\n\t\n\t$roomDesc11 = $roomDesc;\n\t$pernight11 = $pernight;\t\n\t\t\t//echo $pernight; \n\t //$com_rate=$this->Agent_Model->comp_info($hotel_id);\n\t$com_rate='';\n\t if(isset($com_rate))\n\t {\n\t if($com_rate==\"\")\n\t {\n\t $com_rate=0;\n\t }\n\t else\n\t {\n\t\n\t\t\t $com_rate=$com_rate[0]->comprate;\n\t\t }\n\t }\n\t\t $hotel_mark=0;\n\t\t $admark=0;\n\t\t//$hotel_markup=$this->Agent_Model->markup_supplier($hotel_id);\n\t\t$hotel_markup='';\n\t\tif($hotel_markup!=\"\")\n\t\t{\n\t $hotel_markup_type=$hotel_markup->type;\n\n\t if($hotel_markup_type=='amt')\n\t {\n\t\t$hotel_mark=$hotel_markup->amount;\n\t \n\t \n\t }\n\t else\n\t {\n\t\t$markup=$hotel_markup->markup;\n\t\t $hotel_mark=$pernight11*$markup/100;\n\t \n\t }\n\t \n\t \n\t \n\t \n\t\t}\n\t\t $api4=\"gta\";\n\t $common_commission=$this->Home_Model->get_common_markup($api4);\n\t $admark=$common_commission*$pernight11/100;\n\t //echo $pernight11; exit;\n\t $finalperNightValh= $pernight11+$hotel_mark+$admark+$com_rate;\n\t $night=$this->session->userdata('dt');\t\n\t $finalNightValh = $finalperNightValh*$night;\n\t\n\t\t//echo $finalNightValh; exit;\n\t $api4='crs';\n\t\t\t$this->Home_Model->insert_search_result_crs($sec_res,$api4,$cityCode,$itemCode,$itemVal,$starVal,$finalperNightValh,$finalNightValh,$currencyVal,$roomDesc11,$mealsval,$dateFromValc,$dateToValc,$dateFromTimeValc,$dateToTimeVal,$serviceval,$finalcurval,$cancelCodeVal,$purTokenVal,'0','0',$roomdescCode,$ConfirmationVal,$cin,$cout,'0',$image,$desc);\n\t\n\t}\n\t\t\n\t\t\t\t \n\t}",
"function get_filter_query(&$filters) {\n if (isset($_GET[\"type\"])) {\n $types = explode(\",\", $_GET[\"type\"]);\n foreach ($types as $type) {\n if ($type !== \"Available\") {\n array_push($filters, \"function LIKE '%{$type}%'\");\n } else {\n array_push($filters, \"available > 0\");\n }\n }\n }\n }",
"function get_all_organisations_by_type_list() {\n\n\t\tglobal $wpdb;\n\n\t\t$type_array[1] = \"Festivals\";\n\t\t$type_array[2] = \"BKV/AV\";\n\t\t$type_array[3] = \"Film(producenten)\";\n\t\t$type_array[4] = \"Musea\";\n\t\t$type_array[5] = \"Podia\";\n\t\t$type_array[6] = \"Producenten podiumkunsten\";\n\t\t$type_array[7] = \"Podia Theater\";\n\n\t\t$vragenlijst_organisations = $this->get_all_vragenlijst_organisations_list();\n\n\t\t$organisations_by_type = array();\n\n\t\t// Walk throught the types and get corresponding organisations\n\t\tforeach ($type_array as $key => $type) {\n\n\t\t\tif (!array_key_exists($key, $organisations_by_type)) {\n\t\t\t\t$organisations_by_type[$key] = array('label'=>$type_array[$key],'amount'=>0,'organisations'=>array());\n\t\t\t}\n\n\n\t\t\t// Walk through organisations and compare to type_array\n\t\t\tforeach ($vragenlijst_organisations as $organisation) {\n\n\t\t\t\t$categories = get_field('vragenlijst_categorie',$organisation['id']);\n\n\t\t\t\tif (in_array($key, $categories)) {\n\t\t\t\t\tarray_push($organisations_by_type[$key]['organisations'], $organisation['id']);\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$organisations_by_type[$key]['amount'] = count($organisations_by_type[$key]['organisations']);\n\n\t\t}\n\n\t\t$organisations_by_type['amount'] = count($vragenlijst_organisations);\n\n\t\treturn $organisations_by_type;\n\n\t}",
"function shcaa_list_hope_groups($type, $showmap = 'true', $showchart = 'true'){\n\t// create the city object\n\t\n\t$ca = new CityApi();\n\t$ca->debug = false;\n\t$ca->json = false;\t\n\t\n\t// set the args\n\t// args array can include\n\t/*\n\tpage = [1,2,3,4,...]\n\tsearch = [\"downtown\" | etc] <- optional group name search\n\tunder_group_id = [ 1234 | etc ] <- defaults to church group's ID\n\tgroup_types = [\"CG\" | \"Service\" | \"Campus\" | etc] <- defaults to all group types\n\tinclude_inactive = [ true | false ] <- defaults to false\n\tinclude_addresses = [ true | false ]\n\tinclude_composition = [ true | false ]\n\tinclude_user_ids = [ true | false ]\n\t\n\t*/\n\t\n\t// cache the results\n\t// attempt to get cached request\n\t$transient_key = \"_shcaa_hope_groups_feed\";\n\t// If cached (transient) data are used, output an HTML\n\t// comment indicating such\n\t\n\t$cached = get_transient( $transient_key );\n\tif ( false !== $cached ) {\n\t\t$mygrps = $cached; \n\t} else {\n\t\t\n\t\t// create array of the groups filtered by the args and include the tags - for the call to theCITY api\n\t\t$args = array();\n\t\t$args['group_types'] = 'Hope';\n\t\t$args['include_addresses'] = 'true';\n\t\n\t\t$groups = $ca->groups_index($args); \n\t\t\n\t\t$mygrps = array();\n\t\t$grps = $groups['groups'];\n\t\t$i = 0;\n\t\tforeach ($grps as $grp){\n\t\t\t$mygrps[$i]['grp_id'] = $grp['id'];\n\t\t\t$mygrps[$i]['parentid'] = $grp['parent_id'];\n\t\t\t\n\t\t\t$mygrps[$i]['image'] = $grp['profile_pic'];\n\t\t\t$mygrps[$i]['name'] = $grp['name'];\n\t\t\t$mygrps[$i]['description'] = $grp['external_description'];\n\t\t\t$mygrps[$i]['neighborhood'] = $grp['nearest_neighborhood_name'];\n\t\t\t$mygrps[$i]['invite'] = $grp['default_invitation_custom_message'];\n\t\t\t$mygrps[$i]['cityurl'] = $grp['internal_url'];\n\t\t\t\n\t\t\t// address fields\n\t\t\tif (isset($grp['addresses'][0]) && !empty($grp['addresses'][0]) ){\n\t\t\t\t$mygrps[$i]['add_name'] = $grp['addresses'][0]['friendly_name'];\n\t\t\t\t$mygrps[$i]['add_street'] = $grp['addresses'][0]['street'];\n\t\t\t\t$mygrps[$i]['add_street2'] = $grp['addresses'][0]['street2'];\n\t\t\t\t$mygrps[$i]['add_city'] = $grp['addresses'][0]['city'];\n\t\t\t\t$mygrps[$i]['add_state'] = $grp['addresses'][0]['state'];\n\t\t\t\t$mygrps[$i]['add_zipcode'] = $grp['addresses'][0]['zipcode'];\n\t\t\t\t$mygrps[$i]['add_longitude'] = $grp['addresses'][0]['longitude'];\n\t\t\t\t$mygrps[$i]['add_latitude'] = $grp['addresses'][0]['latitude'];\n\t\t\t}\n\t\t\t\n\t\t\t// Get Tags\n\t\t\t$tags = $ca->groups_tags_index($grp['id']); \n\t\t\tif ($tags){\n\t\t\t\tforeach ($tags as $tag){\n\t\t\t\t\tif (is_array($tag)){\n\t\t\t\t\t\t$mygrps[$i]['mytags'] = array();\n\t\t\t\t\t\tforeach ($tag as $el){\n\t\t\t\t\t\t\t$mygrps[$i]['mytags'][] = $el;\n\t\t\t\t\t\t} // end inner foreach\n\t\t\t\t\t} // end if\n\t\t\t\t} // end foreach\n\t\t\t} // end if tags\n\t\t\t\n\t\t\t// Get Users\n\t\t\t$users = $ca->groups_roles_index($grp['id']); \n\t\t\t\n\t\t\tif ($users){\n\t\t\t\tforeach ($users as $user){\n\t\t\t\t\tif (is_array($user)){\n\t\t\t\t\t\t$mygrps[$i]['leaders'] = array();\n\t\t\t\t\t\t$lc = 0;\n\t\t\t\t\t\tforeach ($user as $usr){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($usr['title'] == 'Leader'){\n\n\t\t\t\t\t\t\t\t$mygrps[$i]['leaders'][$lc]['name'] = $usr['user_name'];\n\n\t\t\t\t\t\t\t\t// get contact info\n\t\t\t\t\t\t\t\t$userinfo = $ca->users_show($usr['user_id']);\n\t\t\t\t\t\t\t\t$mygrps[$i]['leaders'][$lc]['phone'] = $userinfo['primary_phone'];\n\t\t\t\t\t\t\t\t$mygrps[$i]['leaders'][$lc]['email'] = $userinfo['email'];\n\t\t\t\t\t\t\t\t$mygrps[$i]['leaders'][$lc]['first'] = $userinfo['first'];\n\t\t\t\t\t\t\t\t$mygrps[$i]['leaders'][$lc]['last'] = $userinfo['last'];\n\t\t\t\t\t\t\t\t$mygrps[$i]['leaders'][$lc]['nickname'] = $userinfo['nickname'];\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// group family members\n\t\t\t\t\t\t\t\t$userfam = $ca->users_family_index($usr['user_id']);\n\t\t\t\t\t\t\t\t$mygrps[$i]['leaders'][$lc]['fam_id'] = $userfam['external_id'];\n\t\t\t\t\t\t\t\t$lc++;\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} // end inner foreach\n\t\t\t\t\t} // end if\n\t\t\t\t} // end foreach\n\t\t\t} // end if users\n\t\t\t$i++;\n\t\t} // end foreach\n\t\t//print_r('<pre style=\"padding: 10px; border: 1px solid #000; margin: 10px\">'); print_r( $mygrps ); print_r('</pre>'); \n\n\t\tset_transient( $transient_key, $mygrps, 60*60*24*7 ); // seven days\n\t} // end if not cached\n\t\n\t$output = ''; \n\t// group map output\n\t\n\tif ($showmap != 'false'){\n\t\t$output .= '<div class=\"hf-g-map\"></div>';//output_google_map();\n\t}\n\t// group chart output\n\tif ($showchart != 'false'){\n\t\t$output .= '<table class=\"groupslist\">'; \n\t\t$output .= '<tr>\n\t\t <th>Leader</th>\n\t\t <th>Day/Time</th>\n\t\t <th>Location</th>\n\t\t <th>Contact</th>\n\t\t</tr>';\n\t} else {\n\t\t$output .= '<div class=\"groupslist\">'; \n\t} // end if showchart \n\n\t$cnt = 0;\n\t//print_r('<pre style=\"padding: 10px; border: 1px solid #000; margin: 10px\">'); print_r( $mygrps ); print_r('</pre>'); \n\tforeach ($mygrps as $grpkey => $mygrp){\n\t\t$grp_id = $mygrp['grp_id'];\n\t\t// get the tags array and start making choices\n\t\t$dtags = $mygrp['mytags'];\t\n\t\t$meta = sh_find_groupmeta($dtags);\n\t\t\n\t\t$leaders = $mygrp['leaders'];\n\t\t\n\t\t// stuff from meta\n\t\t$hgtype = $meta['type'];\n\t\t$day = $meta['day'];\n\t\t$time = $meta['time'];\n\t\t$extras = $meta['extra']; // array\n\t\t// is kid friendly\n\t\t$prokid = 0;\n\t\tif (in_array('kid-friendly',$extras)){\n\t\t\t$prokid = 1;\n\t\t}\n\t\t$name = $mygrp['name'];\n\t\t$name = str_replace('HG:','',$name);\n\t\t//print_r('<pre style=\"padding: 10px; border: 1px solid #000; margin: 10px\">'); print_r( $name ); print_r( '--<br />--' ); print_r( $meta); print_r('------------</pre>'); \n\t\t\n\t\t// Leader information\n\t\t$ldrs = $mygrp['leaders'];\n\t\t$leaders = '<div class=\"leaders\">';\n\t\t$famids = array();\n\t\t$leds = array();\n\t\tforeach ($ldrs as $k => $ldr){\n\t\t\t// search the famids for previous use of same famid\n\t\t\t$key = array_search($ldr['fam_id'],$famids);\n\t\t\t\n\t\t\tif(is_numeric($key)){\n\t\t\t\t$nnic = $ldrs[$key]['nickname'];\n\t\t\t\t$nfirst = $ldrs[$key]['first'];\n\t\t\t\t$nlast = $ldrs[$key]['last'];\n\t\t\t\t$phone = $ldrs[$key]['phone'];\n\t\t\t\t$email = $ldrs[$key]['email'];\n\t\t\t\t\n\t\t\t\t//print_r('<pre style=\"padding: 10px; border: 1px solid #000; margin: 10px\">'); print_r( $key ); print_r('</pre>');\n\t\t\t\t$fn1 = (isset($nnic) && !empty($nnic) ? $nnic : $nfirst);\n\t\t\t\t$fn2 = (isset($ldr['nickname']) && !empty($ldr['nickname']) ? $ldr['nickname'] : $ldr['first']);\n\t\t\t\t$fullname = $fn1 .' & '. $fn2 .' '.$nlast;\n\t\t\t\tunset($leds[$key]);\n\t\t\t} else {\n\t\t\t\t$first = (isset($ldr['nickname']) && !empty($ldr['nickname']) ? $ldr['nickname'] : $ldr['first'] );\n\t\t\t\t$fullname = $first .' '.$ldr['last'];\n\t\t\t\t$phone = $ldr['phone'];\n\t\t\t\t$email = $ldr['email'];\n\t\t\t} // end if\n\t\t\t$leds[] = array(\n\t\t\t\t'fullname' => $fullname,\n\t\t\t\t'phone' => $phone,\n\t\t\t\t'email' => $email\n\t\t\t);\n\t\t\t// store the fam id \n\t\t\t$famids[] = $ldr['fam_id'];\n\t\t} // end foreach\n\t\t// output\n\t\t$numled = count($leds);\n\t\t$lcntr = 1;\n\t\tforeach ($leds as $key => $led ){\n\t\t\t$leaders .= '<span class=\"leader\">';\n\t\t\t\t$leaders .= $led['fullname'];\n\t\t\t$leaders .= '</span>';\n\t\t\tif($numled !== $lcntr){\n\t\t\t\t$leaders .= ', ';\n\t\t\t}\n\t\t\t$lcntr++;\n\t\t}\n\t\t$leaders .= '</div>';\n\t\t\n\t\t$neighborhood = $mygrp['neighborhood'];\n\t\t$neighborhood = str_replace('Neighborhood:','',$neighborhood);\n\t\t\n\t\t$grpfriendname = $mygrp['add_name'];\n\t\t\n\t\t$grp_name = (isset($grpfriendname) && !empty($grpfriendname) ? $grpfriendname : $neighborhood);\n\t\t\n\t\t// map coords\n\t\t$lng = $mygrp['add_longitude'];\n\t\t$lat = $mygrp['add_latitude'];\n\t\t\n\t\t// contact button\n\t\t$contactform = '<form id=\"hope-group-contact\" action=\"/hope-group-contact\">\n\t\t\t\t\t\t\t<input value=\"'.$grpkey.'\" id=\"group\" name=\"group\" type=\"hidden\">\n\t\t\t\t\t\t\t<input type=\"submit\" value=\"Contact Leaders\">\n\t\t\t\t\t\t</form>';\n\t\tunset($leds);\n\t\t\n\t\t// Allow output of only the hopegroup type requested in the shortcode, if parameter is there\n\t\tif ($showchart != 'false'){\n\t\t if($type=='ALL' || $type == $hgtype){\n\t\t\t $output .= '<tr>';\n\t\t\t // name\n\t\t\t if (isset($leaders) && !empty($leaders) ){\n\t\t\t\t $output .= '<td class=\"grp-name\">'.$leaders.'</td>';\n\t\t\t }\n\t\t\t // Day - time\n\t\t\t if (isset($day) && !empty($day) && $day!='TBD' ){\n\t\t\t\t $daytime = '<td class=\"grp-day\">'.$day.' '.$time.'</div>';\n\t\t\t } else {\n\t\t\t\t $daytime = '<td class=\"grp-day\">To Be Determined</div>';\n\t\t\t } \n\t\t\t $output .= $daytime;\n\t\t\t // neighborhood\n\t\t\t if (isset($grp_name) && !empty($grp_name) ){\n\t\t\t\t $output .= '<td class=\"grp-location\">'.$grp_name.'</td>';\n\t\t\t }\n\t \n\t\t\t // contact\n\t\t\t $output .= '<td class=\"grp-contact\">';\n\t\t\t $output .= $contactform;\n\t\t\t // stuff for the map markers\n\t\t\t $mleaders = html_entity_decode($name);\n\t\t\t \n\t\t\t $output .= '\n\t\t\t <div class=\"marker\" style=\"display:none;\" data-lat=\"'.$lat.'\" data-lng=\"'.$lng.'\">\n\t\t\t\t <div class=\"output\">\n\t\t\t\t\t <div class=\"mled\">'.$mleaders.'</div>\n\t\t\t\t\t <div class=\"mday\">'.$day.' '.$time.'</div>\n\t\t\t\t </div>\n\t\t\t\t <div class=\"kids\">'.$prokid.'</div>\n\t\t\t\t <div class=\"zone\">'.$hgtype.'</div>\n\t\t\t </div>';\n\t\t\t $output .= '</td>';\n\t\t\t\t \n\t\t\t $output .= '</tr>';\n\t\t } // end if type\n\t\t \n\t\t} else { // end if showchart\n\t\t\t if (isset($day) && !empty($day) && $day!='TBD' ){\n\t\t\t\t $daytime = '<td class=\"grp-day\">'.$day.' '.$time.'</div>';\n\t\t\t } else {\n\t\t\t\t $daytime = '<td class=\"grp-day\">To Be Determined</div>';\n\t\t\t } \n\n\t\t\t$mleaders = html_entity_decode($name);\n\t\t\t$output .= '\n\t\t\t<div class=\"marker\" style=\"display:none;\" data-lat=\"'.$lat.'\" data-lng=\"'.$lng.'\">\n\t\t\t\t<div class=\"output\">\n\t\t\t\t\t<div class=\"mled\">'.$mleaders.'</div>\n\t\t\t\t\t<div class=\"mday\">'.$day.' '.$time.'</div>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"kids\">'.$prokid.'</div>\n\t\t\t\t<div class=\"zone\">'.$hgtype.'</div>\n\t\t\t</div>';\n\t\t}\n\n\t } // end foreach\n\t \n\t if ($showchart != 'false'){\n\t \t$output .= '</table>';\n\t } else {\n\t\t $output .= '</div>';\n\t }\n\n\treturn $output;\n}",
"function _having($field, $value = '', $type = 'AND ', $escape = TRUE)\n\t{\n\t\tif ( !is_array($field))\n\t\t{\n\t\t\t$field = array($field => $value);\n\t\t}\n\t\tforeach ($field as $k => $v)\n\t\t{\n\t\t\t$prefix = (count($this->ar_having) == 0) ? '' : $type;\n\t\t\tif ($escape === TRUE)\n\t\t\t{\n\t\t\t\t$k = $this->_protect_identifiers($k);\n\t\t\t}\n\t\t\tif ( !$this->_has_operator($k))\n\t\t\t{\n\t\t\t\t$k .= ' = ';\n\t\t\t}\n\t\t\tif ($v != '')\n\t\t\t{\n\t\t\t\t$v = ' '.$this->escape_str($v);\n\t\t\t}\n\t\t\t$this->ar_having[] = $prefix.$k.$v;\n\t\t}\n\t\treturn $this;\n\t}",
"public function andHaving($conditions, $params = array(), $types = array())\n {\n $conditions = $this->processCondition($conditions, $params, $types);\n return $this->add('having', $conditions, true, 'AND');\n }",
"function showItems() {\n global $DB, $CFG_GLPI;\n\n $locations_id = $this->fields['id'];\n $crit = Session::getSavedOption(__CLASS__, 'criterion', '');\n\n if (!$this->can($locations_id, READ)) {\n return false;\n }\n\n $first = 1;\n $query = '';\n\n if ($crit) {\n $table = getTableForItemType($crit);\n $query = \"SELECT `$table`.`id`, '$crit' AS type\n FROM `$table`\n WHERE `$table`.`locations_id` = '$locations_id' \".\n getEntitiesRestrictRequest(\" AND\", $table, \"entities_id\");\n } else {\n foreach ($CFG_GLPI['location_types'] as $type) {\n $table = getTableForItemType($type);\n $query .= ($first ? \"SELECT \" : \" UNION SELECT \").\"`id`, '$type' AS type\n FROM `$table`\n WHERE `$table`.`locations_id` = '$locations_id' \".\n getEntitiesRestrictRequest(\" AND\", $table, \"entities_id\");\n $first = 0;\n }\n }\n\n $result = $DB->query($query);\n $number = $DB->numrows($result);\n $start = (isset($_REQUEST['start']) ? intval($_REQUEST['start']) : 0);\n if ($start >= $number) {\n $start = 0;\n }\n // Mini Search engine\n echo \"<table class='tab_cadre_fixe'>\";\n echo \"<tr class='tab_bg_1'><th colspan='2'>\".__('Type').\"</th></tr>\";\n echo \"<tr class='tab_bg_1'><td class='center'>\";\n echo __('Type').\" \";\n Dropdown::showItemType($CFG_GLPI['location_types'],\n array('value' => $crit,\n 'on_change' => 'reloadTab(\"start=0&criterion=\"+this.value)'));\n echo \"</td></tr></table>\";\n\n if ($number) {\n echo \"<div class='spaced'>\";\n Html::printAjaxPager('', $start, $number);\n\n echo \"<table class='tab_cadre_fixe'>\";\n echo \"<tr><th>\".__('Type').\"</th>\";\n echo \"<th>\".__('Entity').\"</th>\";\n echo \"<th>\".__('Name').\"</th>\";\n echo \"<th>\".__('Serial number').\"</th>\";\n echo \"<th>\".__('Inventory number').\"</th>\";\n echo \"</tr>\";\n\n $DB->data_seek($result, $start);\n for ($row=0 ; ($data=$DB->fetch_assoc($result)) && ($row<$_SESSION['glpilist_limit']) ; $row++) {\n $item = getItemForItemtype($data['type']);\n $item->getFromDB($data['id']);\n echo \"<tr class='tab_bg_1'><td class='center top'>\".$item->getTypeName().\"</td>\";\n echo \"<td class='center'>\".Dropdown::getDropdownName(\"glpi_entities\",\n $item->getEntityID());\n echo \"</td><td class='center'>\".$item->getLink().\"</td>\";\n echo \"<td class='center'>\".\n (isset($item->fields[\"serial\"])? \"\".$item->fields[\"serial\"].\"\" :\"-\");\n echo \"</td>\";\n echo \"<td class='center'>\".\n (isset($item->fields[\"otherserial\"])? \"\".$item->fields[\"otherserial\"].\"\" :\"-\");\n echo \"</td></tr>\";\n }\n } else {\n echo \"<p class='center b'>\".__('No item found').\"</p>\";\n }\n echo \"</table></div>\";\n\n }",
"public function orHaving($conditions, $params = array(), $types = array())\n {\n $conditions = $this->processCondition($conditions, $params, $types);\n return $this->add('having', $conditions, true, 'OR');\n }",
"function type_search_query($type){\n\tif ($type == \"SpecialNeeds\")\n\t\t$sql = \"SELECT DISTINCT\twp_term_relationships.object_id\n\t\t\t\tFROM \t\t\twp_term_relationships\n\t\t\t\tINNER JOIN \t\twp_term_taxonomy\n\t\t\t\t\t\t\t\tON wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id\n\t\t\t\tINNER JOIN \t\twp_terms\n\t\t\t\t\t\t\t\tON wp_term_taxonomy.term_id = wp_terms.term_id\n\t\t\t\tWHERE \t\t\twp_terms.slug IN ('addadhd',\n\t\t\t\t\t\t\t\t\t\t\t 'asperger-disorder',\n\t\t\t\t\t\t\t\t\t\t\t 'autism',\n\t\t\t\t\t\t\t\t\t\t\t 'behavioral',\n\t\t\t\t\t\t\t\t\t\t\t 'down-syndrome',\n\t\t\t\t\t\t\t\t\t\t\t 'dyslexia',\n\t\t\t\t\t\t\t\t\t\t\t 'physical-disability-assistance',\n\t\t\t\t\t\t\t\t\t\t\t 'special-needs-assistance')\";\n\telse\n\t\t$sql = \"SELECT \t\twp_term_relationships.object_id\n\t\t\t\tFROM \t\twp_term_relationships\n\t\t\t\tINNER JOIN \twp_term_taxonomy\n\t\t\t\t\t\t\tON wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id\n\t\t\t\tINNER JOIN \twp_terms\n\t\t\t\t\t\t\tON wp_term_taxonomy.term_id = wp_terms.term_id\n\t\t\t\tWHERE \t\twp_terms.slug = '{$type}'\";\n\n\treturn $sql;\n}",
"function ting_search_context_matches_material_type($facets, $total_number, $type_array) {\n $audio_types = array('lydbog (net)', 'lydbog (cd-mp3)', 'lydbog (cd)');\n $number_of_type = ting_search_context_get_term_count($facets, 'facet.type', $type_array);\n return ting_search_context_evalute_condition($number_of_type , $total_number, 0.5);\n}",
"private function _get_views($type = 0)\n {\n //type = 1 get all live classifieds\n //type = 2 get all live auctions\n\n $sql = \"SELECT COALESCE(SUM(viewed),0) FROM \" . geoTables::classifieds_table . \" WHERE `live` = 1 \";\n\n if ($type == 1) {\n $type_sql .= \" AND `item_type`=1 \";\n } elseif ($type == 2) {\n $type_sql .= \" AND `item_type`=2 \";\n } else {\n //nothing to add...list all types\n $type_sql = \"\";\n }\n\n trigger_error('DEBUG ADDON: SQL - ' . $sql . $type_sql . $cutoff_sql);\n $db = DataAccess::getInstance();\n $sql_result = $db->GetOne($sql . $type_sql . $cutoff_sql);\n if (is_numeric($sql_result)) {\n if ($this->testing == 1) {\n $return_this = $sql_result . \" (\" . $sql . $type_sql . \")\";\n return $return_this;\n } else {\n return $sql_result;\n }\n } else {\n //didn't work so just return empty\n if ($this->testing == 1) {\n return \"error (\" . $sql . $type_sql . $cutoff_sql . \")\";\n } else {\n return '';\n }\n }\n }",
"public function search($params,$type)\n {\n $query = TbFiNhsoRep::find();\n\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n ]);\n\n $this->load($params);\n\n if (!$this->validate()) {\n // uncomment the following line if you do not want to return any records when validation fails\n // $query->where('0=1');\n return $dataProvider;\n }\n\n $query->andFilterWhere([\n 'nhso_rep_id' => $this->nhso_rep_id,\n ]);\n $type_where = explode(\"-\", $type); \n $query->orFilterWhere(['like', 'invoice_eclaim_num', $this->invoice_eclaim_num])\n ->orFilterWhere(['like', 'rep', $this->rep])\n ->orFilterWhere(['like', 'report_filename', $this->report_filename])\n ->orFilterWhere(['like', 'report_date', $this->report_date])\n ->orFilterWhere(['like', 'report_time', $this->report_time])\n ->orFilterWhere(['like', 'fund_section', $this->fund_section])\n ->orFilterWhere(['like', 'fund_region', $this->fund_region])\n ->orFilterWhere(['like', 'prov', $this->prov])\n ->orFilterWhere(['like', 'hcode', $this->hcode])\n ->orFilterWhere(['like', 'import_by', $this->import_by])\n ->orFilterWhere(['like', 'Import_date', $this->Import_date])\n ->andWhere(['doc_type' => $type_where[0]])\n ->orWhere(['doc_type' => $type_where[1]]);\n return $dataProvider;\n }",
"function get_all_organisations_by_kernactiviteit_type_list() {\n\n\t\tglobal $wpdb;\n\n\t\t$type_array[1] = \"Theater\";\n\t\t$type_array[2] = \"Concertzaal\";\n\t\t$type_array[3] = \"Filmtheater\";\n\t\t$type_array[4] = \"Festival\";\n\t\t$type_array[5] = \"Museum\";\n\t\t$type_array[6] = \"Bibliotheek\";\n\t\t$type_array[7] = \"Cbk\";\n\t\t$type_array[8] = \"Gezelschap\";\n\t\t$type_array[9] = \"Werkplaats\";\n\t\t$type_array[10] = \"Opleiding\";\n\t\t$type_array[11] = \"Steunfunctie\";\n\n\t\t$table_name = $wpdb->prefix . \"cab_organisatie_type\";\n\n\t\t$organisations_by_type = array();\n\n\t\t// Walk throught the types and get corresponding organisations\n\t\tforeach ($type_array as $key => $type) {\n\n\t\t\tif (!array_key_exists($key, $organisations_by_type)) {\n\t\t\t\t$organisations_by_type[$key] = array('label'=>$type_array[$key],'organisations'=>array());\n\t\t\t}\n\n\t\t\t// Get all organisations of a certain type\n\t\t\t$sql = \"SELECT DISTINCT organisation_id FROM \".$table_name.\" WHERE type_id = \".$key;\n\t\t\t$organisations = $wpdb->get_results($sql, 'ARRAY_N');\n\n\t\t\tforeach ($organisations as $organisation) {\n\n\t\t\t\tif ($this->is_organisation_active($organisation[0])) {\n\t\t\t\t\tarray_push($organisations_by_type[$key]['organisations'], $organisation[0]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\treturn $organisations_by_type;\n\n\t}"
] | [
"0.57268536",
"0.5073268",
"0.49700096",
"0.4940813",
"0.48891887",
"0.47943217",
"0.47256324",
"0.4716705",
"0.4683922",
"0.46613216",
"0.46465498",
"0.4644327",
"0.46253628",
"0.4592606",
"0.45721892",
"0.4513984",
"0.45033845",
"0.44970465",
"0.44945717",
"0.44911274",
"0.44797274",
"0.44753146",
"0.44466433",
"0.4437728",
"0.44266367",
"0.43928212",
"0.43637246",
"0.43607548",
"0.4360697",
"0.43337262"
] | 0.5458382 | 1 |
/ get count of hotel room plan with search condition | public static function searchHotelRoomPlanCount($criteria)
{
$where_cond = RoomPlan::getCriteriaWhereClause($criteria);
$having_cond = RoomPlan::getCriteriaHavingClause($criteria);
$price_field = RoomPlan::getCriteriaPriceField($criteria);
$having_cond2 = RoomPlan::getCriteriaHavingClause2($criteria);
$role=RoomPlan::getCriteriaRole($criteria);
$sql = '
SELECT count(*)
FROM (
select
*
From
(
select
(A.HotelId), A.HotelName, F.HotelClassName, C.RoomTypeId '.$price_field.'
from
HT_Hotel as A, HT_HotelRoomPlanLink as B, HT_RoomPlan as C,';
if($role=='Agent'){
$sql.='`HT_RoomStockAndPrice` as I,';
}
$sql.='
HT_HotelClass as F
where
A.HotelId = B.HotelId and B.RoomPlanId = C.RoomPlanId
and F.HotelClassId = A.HotelClass';
if($role=='Agent'){
$sql.='AND C.`RoomPlanId` = I.`RoomPlanId`';
}
$sql.=$where_cond;
if($role=='Agent'){
$sql.='GROUP BY I.`RoomPlanId`';
}
$sql .= $having_cond;
$sql .= ' )
AS A GROUP BY HotelId '.$having_cond2;
$sql .= ") AS A";
//echo $sql;
return (int)Db::getInstance()->getValue($sql);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getTotalRooms(){\r\n\t\tif (empty($this->_total)) {\r\n\t\t\t$db = JFactory::getDBO();\r\n\t\t\t$query = $this->getSearchQuery($this->searchParams);\r\n\t\t\t$db->setQuery($query);\r\n\t\t\tif($db->query()){\r\n\t\t\t\t$this->_total = $db->getNumRows();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tif(!isset($this->_total)){\r\n\t\t\t\t$this->_total = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\treturn $this->_total;\r\n\t}",
"function get_result_count( $params = [] ) {\n $text_of = __( 'of', 'fwp-front' );\n\n $page = (int) $params['page'];\n $per_page = (int) $params['per_page'];\n $total_rows = (int) $params['total_rows'];\n\n if ( $per_page < $total_rows ) {\n $lower = ( 1 + ( ( $page - 1 ) * $per_page ) );\n $upper = ( $page * $per_page );\n $upper = ( $total_rows < $upper ) ? $total_rows : $upper;\n $output = \"$lower-$upper $text_of $total_rows\";\n }\n else {\n $lower = ( 0 < $total_rows ) ? 1 : 0;\n $upper = $total_rows;\n $output = $total_rows;\n }\n\n return apply_filters( 'facetwp_result_count', $output, [\n 'lower' => $lower,\n 'upper' => $upper,\n 'total' => $total_rows,\n ] );\n }",
"final function count()\n\t{\n\t\t$o = Db::query(\"SELECT COUNT(*) as cnt FROM $this->model_table $this->model_sql_join $this->model_sql_search\", $this->model_params)->fetchObj();\n\t\tif($o->cnt >= 0) {\n\t\t\treturn $o->cnt;\n\t\t}\n\t\treturn 0;\n\t}",
"public function countQuery();",
"public function count(array $criteria);",
"function getCountZoekresultaten($search){\n\n\n\n\n\ttry {\n\t\t$voorwerpen = null;\n\t\t$db = getConnection ();\n\n\t\t$queried = $search;\n\n\t\t$keys = explode(\" \",$queried);\n\n\n\t\t$sql = \"SELECT Count(voorwerpnummer) as count FROM Voorwerp V \nWHERE V.Voorwerpnummer NOT IN (SELECT voorwerp FROM ProductVanDag PVVD WHERE PVVD.voorwerp = V.Voorwerpnummer AND PVVD.ProductVanDag = FORMAT(GETDATE (),'d','af'))\nAND V.VeilingGesloten = 0 AND V.Starttijd <GETDATE() AND Titel LIKE :keyword0\";\n\n\t\t$totalKeywords = count($keys);\n\n\t\tfor($i=1 ; $i < $totalKeywords; $i++){\n\t\t\t$sql .= \" AND Titel LIKE :keyword\".$i;\n\t\t}\n\t\t//$sql .= \" ORDER BY V.Eindtijd ASC\";\n\n\t\t$stmt = $db->prepare ($sql);\n\n\t\tforeach($keys as $key => $keyword){\n\t\t\t$keyword = \"%\".$keyword.\"%\";\n\t\t\t$stmt->bindParam(\"keyword\".$key, $keyword, PDO::PARAM_STR);\n\t\t}\n\n\t\t$stmt->execute();\n\n\t\twhile ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n\t\t\tReturn $row[\"count\"];\n\t\t}\n\n\t\t$db = null;\n\n\n\n\n\t}\n\tcatch (PDOException $e) {\n\t\techo $e->getMessage ();\n\t\techo $e->errorInfo;\n\t}\n\treturn 0;\n\n}",
"public function countAdvanced(?array $criteria = null, ?array $search = null): int;",
"function userListingCount($searchText = '')\n {\n //count_all functino must be first if you run select query\n $total = $this->db->count_all(CHEQUE_TABLE);\n if($total > 0){\n return $total;\n }\n else{\n return FALSE;\n }\n }",
"function count($criteriaExp=null) {\n\t\treturn $this->execCount(__FUNCTION__, $criteriaExp);\n\t}",
"public function count()\n\t{\n\t\t$condition = $this->get_condition();\n\t\t$info = $this->mode->count($condition);\n\t\techo json_encode($info);\n\t}",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"public function count();",
"abstract public function count($where = array());",
"public function category_total_num_rows($search_params)\n\t{\t\t\n\t\t$this->db->select('pm.*,pt.name as type,pu.name as unit');\n\t\t$this->db->from('packing_material_category pm');\n\t\t$this->db->join('packing_type pt','pt.packing_type_id=pm.packing_type_id');\n\t\t$this->db->join('pm_unit pu','pu.pm_unit=pm.pm_unit');\n\t\tif($search_params['name']!='')\n\t\t\t$this->db->like('pm.name',$search_params['name']);\n\t\t$this->db->order_by('pm.pm_category_id DESC');\n\t\t$res = $this->db->get();\n\t\treturn $res->num_rows();\n\t}",
"public function count(array $criteria = []): int;",
"public function count(array $criteria = []): int;",
"public function filteredCount();",
"public function getReservationCounts() {\n $qry = \"SELECT fiTerrain, COUNT(*) AS qcfCount FROM tblReservation GROUP BY fiTerrain\";\n\n try {\n $stmt = $this->dbh->prepare($qry);\n\n if ($stmt->execute()) {\n return json_encode($stmt->fetchAll(PDO::FETCH_ASSOC));\n }\n else {\n return json_encode(false);\n }\n }\n catch(PDOException $e) {\n echo \"PDO has encountered an error: \" + $e->getMessage();\n die();\n }\n }",
"public function count ($from_etc, $where_etc = null);",
"public function CountBasedOnFilter($business_unit='',$department='',$sub_department='',$city='',$daysAgo=''){\n $query = $this->find();\n $query->select(['count' => $query->func()->count('id')]);\n $query->where(['ob_status' => 1]);\n if(!empty($business_unit)){\n $query->where(['businees_unit' => $business_unit]);\n }\n if(!empty($department)){\n $query->where(['department' => $department]);\n }\n if(!empty($sub_department)){\n $query->where(['sub_department' => $sub_department]);\n }\n if(!empty($city)){\n $query->where(['city' => $city]);\n }\n if(!empty($daysAgo)){\n $query->where(['DATE(created)' => $daysAgo]);\n }\n $total = $query->toArray();\n return $result = $total[0]->count; \n }",
"public function getCountOfOfficers($shift)\n {\n $this->db->query(\"\n SELECT COUNT(Officer_ID) AS NumberOfOfficers, Shift\n FROM Officer\n WHERE Officer.Shift = :shift;\n \");\n\n $this->db->bind(':shift', $shift);\n \n // ASSIGN RESULT SET\n $results = $this->db->single();\n return $results;\n }",
"public function getTotalHostelVisitor($conditions='') {\n \n \n $query = \"SELECT COUNT(*) AS totalRecords \n FROM hostel_visitor \n $conditions \";\n return SystemDatabaseManager::getInstance()->executeQuery($query,\"Query: $query\");\n }"
] | [
"0.6489722",
"0.6203128",
"0.60326403",
"0.5983303",
"0.59812206",
"0.59572655",
"0.5955556",
"0.5954478",
"0.593483",
"0.5931054",
"0.5905756",
"0.5905756",
"0.5905756",
"0.5905756",
"0.5905756",
"0.5905756",
"0.5905756",
"0.5905756",
"0.5905756",
"0.5905756",
"0.589676",
"0.58963543",
"0.58810556",
"0.58810556",
"0.5878095",
"0.5874602",
"0.5861872",
"0.5859753",
"0.5848686",
"0.583834"
] | 0.7598692 | 0 |
/ search hotel room plan list function | public static function searchHotelRoomPlan($criteria, $p, $n)
{
global $cookie;
$iso = Language::getIsoById((int)$cookie->LanguageID);
$where_cond = RoomPlan::getCriteriaWhereClause($criteria);
$having_cond = RoomPlan::getCriteriaHavingClause($criteria);
$price_field = RoomPlan::getCriteriaPriceField($criteria);
$having_cond2 = RoomPlan::getCriteriaHavingClause2($criteria);
$role=RoomPlan::getCriteriaRole($criteria);
$usecond_cond = ' ';
if (array_key_exists('CheckIn', $criteria) && '' != $criteria['CheckIn'] &&
array_key_exists('CheckOut', $criteria) && '' != $criteria['CheckOut'])
{
// $usecond_cond .= " , if(C.UseCon = 1, (DATE_ADD(\"{$criteria['CheckIn']}\", INTERVAL C.Nights-1 DAY) <= C.`ConToTime`) AND (DATE_SUB(\"{$criteria['CheckOut']}\",INTERVAL 1 DAY) >= C.`ConFromTime`) , 0) as UseCon ";
$usecond_cond .= " , if(C.UseCon = 1, DATEDIFF(LEAST(C.`ConToTime`, DATE_SUB(\"{$criteria['CheckOut']}\",INTERVAL 1 DAY)) , GREATEST(\"{$criteria['CheckIn']}\", C.`ConFromTime`)) >= (C.Nights - 1), 0) as UseCon ";
}
$order_by = '';
if (array_key_exists('SortBy', $criteria) && '' != $criteria['SortBy'] &&
array_key_exists('SortOrder', $criteria) && '' != $criteria['SortOrder'])
{
if ($criteria['SortBy'] == 'price' && array_key_exists('ContinentCode', $criteria))
{
$order_by = " MinPrice ".$criteria['SortOrder'];
} else if ($criteria['SortBy'] == 'class')
{
$order_by = ' HotelClassName '.$criteria['SortOrder'];
}else if ($criteria['SortBy'] == 'name')
{
$order_by = ' A.HotelName '.$criteria['SortOrder'];
}
}
$sql = '
select A.HotelId,A.HotelName_'.$iso.' as HotelName, A.HotelClass, A.HotelAddress_'.$iso.' as HotelAddress, F.HotelClassName, A.HotelCity, G.CityName_'.$iso.' as CityName, A.HotelArea, H.AreaName_'.$iso.' as AreaName
,A.HotelDescription_'.$iso.' as HotelDescription, C.RoomPlanId, C.RoomTypeId, J.`RoomTypeName`, C.RoomPlanName_'.$iso.' as RoomPlanName, C.RoomMaxPersons,C.zaiku
, C.Breakfast, C.Dinner, E.HotelOrder, C.`StartTime` , F.HotelClassName
, C.`EndTime` '.$usecond_cond.$price_field;
if($role=='Agent'){
$sql.=', min(I.`Amount`) as MinAmount';
}
$sql.=' FROM HT_Hotel as A, HT_HotelRoomPlanLink as B, HT_RoomPlan as C';
if($role=='Agent'){
$sql.=', `HT_RoomStockAndPrice` as I';
}
$sql.=',(
SELECT HotelId, @curRow := @curRow + 1 AS HotelOrder
FROM (
select
*
From
(
select
(A.HotelId), A.HotelName, F.HotelClassName, C.RoomTypeId '.$price_field.'
from
HT_Hotel as A, HT_HotelRoomPlanLink as B, HT_RoomPlan as C,';
if($role=='Agent'){
$sql.='`HT_RoomStockAndPrice` as I,';
}
$sql.='HT_HotelClass as F
where
A.HotelId = B.HotelId and B.RoomPlanId = C.RoomPlanId and F.HotelClassId = A.HotelClass ';
if($role=='Agent'){
$sql.=' AND C.`RoomPlanId` = I.`RoomPlanId`';
}
$sql.=$where_cond;
if($role=='Agent'){
$sql.=' GROUP BY I.`RoomPlanId`';
}
$sql .= $having_cond;
if ($order_by != '')
$sql .= ' ORDER BY '.$order_by;
$sql .= ' )
AS A GROUP BY HotelId '.$having_cond2;
if ($order_by != '')
$sql .= ' ORDER BY '.$order_by;
$sql .=' LIMIT '.(($p - 1) * $n).','.$n;
$sql .=') AS A join (SELECT @curRow := 0) r
) AS E,
HT_HotelClass as F,
HT_City as G,
HT_Area as H,
HT_RoomType as J
WHERE
A.HotelId = E.HotelId and
A.HotelId = B.HotelId and B.RoomPlanId = C.RoomPlanId
AND A.HotelClass = F.HotelClassId
AND A.HotelCity = G.CityId
AND A.HotelArea = H.AreaId
AND C.`RoomTypeId` = J.`RoomTypeId`';
if($role=='Agent'){
$sql.=' AND C.`RoomPlanId` = I.`RoomPlanId`';
}
$sql.=$where_cond;
if($role=='Agent'){
$sql.=' GROUP BY I.`RoomPlanId`';
}
$sql .= $having_cond.
' ORDER BY E.HotelOrder ASC';
if ($order_by != '')
$sql .= ', '.$order_by;
else
$sql .=', C.`RoomPlanId` ASC';
//echo $sql;
$res = Db::getInstance()->ExecuteS($sql);
if (!$res)
{
return null;
}
// indexed by hotel id
$search_result = array();
$pre_buy_plans = array();
//
foreach ($res as $hotel_roomplan)
{
if($hotel_roomplan['zaiku']=='1'&&$hotel_roomplan['MinAmount']=='0'){
continue;
}
// key
$hotel_id = $hotel_roomplan['HotelId'];
$search_record = array();
$new_roomplan = Tools::element_copy($hotel_roomplan, 'RoomPlanId', 'RoomTypeId','RoomTypeName', 'RoomPlanName',
'RoomMaxPersons', 'UseCon', 'Breakfast', 'Dinner', 'RoomPriceId', 'ApplyDate', 'MinPrice', 'MinAmount');
if (array_key_exists($hotel_id, $search_result)) // hotel already exists.
{
// get hotel record
$search_record = $search_result[$hotel_id];
} else { // It's new a hotel key
// create new hotel info
$search_record = Tools::element_copy($hotel_roomplan, 'HotelId', 'HotelName', 'HotelClass', 'HotelClassName', 'HotelAddress',
'HotelCity', 'CityName' , 'HotelArea', 'AreaName', 'HotelDescription');
// pre-calculation price for display
// but user can reselect room type and count
$search_record['BookingPrice'] = 0;
// get hotel first image
$image = HotelDetail::getFirstFileOfHotel($search_record['HotelId']);
$search_record['HotelFilePath'] = $image['HotelFilePath'];
$search_record['w5_path'] = $image['w5_path'];
$search_record['w5'] = $image['w5'];
$search_record['h5'] = $image['h5'];
//
$search_record['RoomPlanList'] = array();
}
$new_roomplan['PreSelect'] = 0;
if ($criteria['RoomTypeVals'][$new_roomplan['RoomTypeId']] > 0) // pre-buy engine
{
if (!array_key_exists($hotel_id, $pre_buy_plans))
$pre_buy_plans[$hotel_id] = array();
// check already selected same room type
if (!array_key_exists($new_roomplan['RoomTypeId'], $pre_buy_plans[$hotel_id]))
{
$new_roomplan['PreSelect'] = 1;
$pre_buy_plans[$hotel_id][$new_roomplan['RoomTypeId']] = 1; // pre-select
$search_record['BookingPrice'] += $new_roomplan['MinPrice'] * $criteria['RoomTypeVals'][$new_roomplan['RoomTypeId']];
}
}
// insert image information
$rp_images = RoomFile::getRoomFileListByRoomPlanId($hotel_roomplan['RoomPlanId']);
$file_id = $rp_images[0]['RoomFileId'];
$res = RoomFile::getRoomFile($file_id);
if (!$res)
{
$w2 = 0; $h2= 0;
} else {
$filepath = $res[0]['RoomFilePath'];
list($width, $height, $type, $attr) = getimagesize($filepath);
if ($width < 100 && $height < 75) {
$w2 = width; $h2 = $height;
} else {
$ratio1=$width/100;
$ratio2=$height/75;
if ($ratio1 < $ratio2) {
$w2 = 100;$h2 = intval($height / $ratio1);
} else {
$h2 = 75;$w2 = intval($width / $ratio2);
}
}
$pos = strpos($filepath, "asset");
$new_roomplan['img_path'] = substr($filepath, $pos);
}
$new_roomplan['img_width'] = $w2;$new_roomplan['img_height'] = $h2;
// insert new roomplan-stock info
$search_record['RoomPlanList'][] = $new_roomplan;
// add or reset search result record
$search_result[$hotel_id] = $search_record;
}
return $search_result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function crs_availability($cin,$cout,$days,$sec_res)\n\t{\n\t$hotelName = $this->session->userdata('hotel_name');\n\t$roomusedtype = $this->session->userdata('roomusedtype');\n\t//print_r($roomusedtype); exit;\n\t$roomcount = $this->session->userdata('roomcount');\n\t $condition='';\n\t $sel='';\n\t // echo $hotelName;\n\t for($rm=0;$rm< count($roomcount);$rm++)\n\t {\n\t\t // echo $roomusedtype[$rm]; exit;\n\t if($roomusedtype[$rm]==1 )\n\t {\n\t\t\tif(!empty($hotelName) && $hotelName !='Enter Hotel name')\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$condition .= \" AND a.name LIKE '$hotelName%' OR a.name LIKE '%$hotelName' OR a.name LIKE '%$hotelName%'\";\n\t\t\t\t\n\t\t\t}\n\t //$condition .= \" AND b.single_room > 0\";\n\t\t// $condition .= \" AND b.check_in < '$cin' AND b.check_out > '$cout'\";\n\t $sel .= \",b.single_room\";\n\t\t \n\t }\n\t if($roomusedtype[$rm]==3)\n\t {\n\t\t\tif(!empty($hotelName) && $hotelName !='Enter Hotel name')\n\t\t\t{\n\t\t\t\t$condition .= \" AND a.name LIKE '$hotelName%' OR a.name LIKE '%$hotelName' OR a.name LIKE '%$hotelName%'\";\n\t\t\t\t\n\t\t\t}\n\t // $condition .= \" AND b.twin_room > 0\";\n\t\t// $condition .= \" AND b.check_in < '$cin' AND b.check_out > '$cout'\";\n\t // $sel .= \",b.twin_room\";\n\t\t $sel .= \",b.single_room\";\n\t }\n\t\t if($roomusedtype[$rm]==4)\n\t {\n\t\t\tif(!empty($hotelName) && $hotelName !='Enter Hotel name')\n\t\t\t{\n\t\t\t\t$condition .= \" AND a.name LIKE '$hotelName%' OR a.name LIKE '%$hotelName' OR a.name LIKE '%$hotelName%'\";\n\t\t\t\t\n\t\t\t}\n\t // $condition .= \" AND b.twin_room > 0\";\n\t\t// $condition .= \" AND b.check_in < '$cin' AND b.check_out > '$cout'\";\n\t $sel .= \",b.twin_room\";\n\t }\n\t\t if($roomusedtype[$rm]==7)\n\t {\n\t\t\tif(!empty($hotelName) && $hotelName !='Enter Hotel name')\n\t\t\t{\n\t\t\t\t$condition .= \" AND a.name LIKE '$hotelName%' OR a.name LIKE '%$hotelName' OR a.name LIKE '%$hotelName%'\";\n\t\t\t\t\n\t\t\t}\n\t // $condition .= \" AND b.twin_room > 0\";\n\t\t// $condition .= \" AND b.check_in < '$cin' AND b.check_out > '$cout'\";\n\t $sel .= \",b.triple_room\";\n\t }\n\t if($roomusedtype[$rm]==8)\n\t {\n\t\t\tif(!empty($hotelName))\n\t\t\t{\n\t\t\t\t$condition .= \" AND a.name LIKE '$hotelName%' OR a.name LIKE '%$hotelName' OR a.name LIKE '%$hotelName%'\";\n\t\t\t\t\n\t\t\t}\n\t //$condition .= \" AND b.triple_room > 0\";\n\t\t// $condition .= \" AND b.check_in < '$cin' AND b.check_out > '$cout'\";\n\t $sel .= \",b.triple_room\";\n\t }\n\t if($roomusedtype[$rm]==9)\n\t {\n\t\t\tif(!empty($hotelName))\n\t\t\t{\n\t\t\t\t$condition .= \" AND a.name LIKE '$hotelName%' OR a.name LIKE '%$hotelName' OR a.name LIKE '%$hotelName%'\";\n\t\t\t\t\n\t\t\t}\n\t //$condition .= \" AND b.quad_room > 0\";\n\t\t //$condition .= \" AND b.check_in < '$cin' AND b.check_out > '$cout'\";\n\t $sel .= \",b.quad_room\";\n\t }\n\t }\n\t $cin=$this->session->userdata('cin');\n\t $cout=$this->session->userdata('cout');\n\t \t$city=$this->session->userdata('citycode'); \n\t //echo $city = $this->session->userdata('destination'); exit;\n\t\t//echo $condition; exit;\n\t\t//echo \"SELECT a.*,b.categoryname,b.breakfast,b.roomdescription $sel FROM hotel_details AS a INNER JOIN room_details AS b ON a.hotel_id=b.hotel_id WHERE a.city='$city' AND a.status='active' $condition GROUP BY b.hotel_id\"; exit;\n\t\t//SELECT a.*,b.categoryname,b.breakfast,b.roomdescription $sel FROM hotel_details AS a INNER JOIN room_details AS b ON a.hotel_id=b.hotel_id WHERE a.city ='$city' AND a.status='active' $condition GROUP BY b.hotel_id \n\t\t//\n\t $querydb=$this->db->query(\"SELECT a.*,b.categoryname,b.breakfast,b.roomdescription $sel FROM hotel_details AS a INNER JOIN room_details AS b ON a.hotel_id=b.hotel_id WHERE a.city='$city' AND a.status='active' $condition GROUP BY b.hotel_id\");\n\t\n\n\t\t\n\t\t $resultdb=$querydb->result();\n\t\t $rw= $querydb->num_rows(); \t\n\t\t for($i=0;$i < count($resultdb); $i++)\n\t\t {\n\t\t\t \n\t\t\t $cityCode = $resultdb[$i]->city;\n\t\t\t $hotel_id=$resultdb[$i]->hotel_id;\n\t\t\t $itemCode=$resultdb[$i]->hotel_code;\n\t\t\t $itemVal=$resultdb[$i]->name;\n\t\t\t\t$starVal=$resultdb[$i]->rating;\n\t\t\t\t$roomDesc='';\n\t\t\t\tif(isset($resultdb[$i]->single_room))\n\t\t\t\t{\n\t\t\t\t$roomDesc.=\"Single -\".$resultdb[$i]->categoryname.\"+\";\n\t\t\t\t}\n\t\t\t\tif(isset($resultdb[$i]->twin_room))\n\t\t\t\t{\n\t\t\t\t$roomDesc.=\"Twin -\".$resultdb[$i]->categoryname.\"+\";\n\t\t\t\t}\n\t\t\t\tif(isset($resultdb[$i]->triple_room))\n\t\t\t\t{\n\t\t\t\t$roomDesc.=\"Triple -\".$resultdb[$i]->categoryname.\"+\";\n\t\t\t\t}\n\t\t\t\tif(isset($resultdb[$i]->quad_room))\n\t\t\t\t{\n\t\t\t\t$roomDesc.=\"Quad -\".$resultdb[$i]->categoryname.\"+\";\n\t\t\t\t}\n\t\n\t\n\t\t\t $roomDesc = substr($roomDesc, 0, -1); \n\t\n\t\t\t\t$meal = $resultdb[$i]->breakfast;\n\t\t\t\tif($meal == 0)\n\t\t\t\t{\n\t\t\t\t\t$mealsval = \"Room Only\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$mealsval = $meal;\n\t\t\t\t}\n\t\t\n\t\t\t\t$roomdescCode = '';\n\t\t\t\t$ConfirmationVal = $resultdb[$i]->status;\n\t\t\t\n\t\t\t\t$desc =$resultdb[$i]->description;\n\t\t\t\tif($resultdb[$i]->image != '')\n\t\t\t\t{\n\t\t\t\t$image = WEB_DIR_ADMIN.'hotel_logo/'.$resultdb[$i]->image;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$image = WEB_DIR.'supplier_logo/noimage.jpg';\n\t\t\t\t}\n\t\t\t\t$supplier_id=$resultdb[$i]->supplier_id;\n\t\t\t\n\t\t // $pernight=0;\n\t\t\t //echo $resultdb[$i]; \n\t\t\t\tif(isset($resultdb[$i]->single_room))\n\t\t\t\t{\n\t\t\t\t\t//echo \"1\";\n\t\t\t\t\t$pernight = $resultdb[$i]->single_room;\n\t\t\t\t}\n\t\t\t\tif(isset($resultdb[$i]->twin_room))\n\t\t\t\t{\n\t\t\t\t\t//echo \"2\";\n\t\t\t\t\t$pernight = $pernight+ $resultdb[$i]->twin_room;\n\t\t\t\t}\n\t\t\t\tif(isset($resultdb[$i]->triple_room))\n\t\t\t\t{\n\t\t\t\t\t//echo \"3\";\n\t\t\t \t$pernight = $pernight+$resultdb[$i]->triple_room;\n\t\t\t\t}\n\t\t\t\tif(isset($resultdb[$i]->quad_room))\n\t\t\t\t{\n\t\t\t\t\t//echo \"4\";\n\t\t\t \t$pernight = $pernight+$resultdb[$i]->quad_room;\n\t\t\t\t}\n\n\t\t\t\n\t\t\t\t//echo $resultdb[$i]->single_room; exit;\n\t\t\t\t$currencyVal = 'GBP';\n\t\t\t\t$curtype='GBP';\n\t\t\t \t\t$dateFromValc = '';\n\t\t\t\t$dateToValc = ''; \t \n\t\t\t\t$dateFromTimeValc = ''; \t \n\t\t\t\t$dateToTimeVal = ''; \n\t\t\t\t$serviceval = '';\n\t\t\t\t \t $finalcurval ='';\n\t\t\t\t\t $cancelCodeVal='';\n\t\t\t\t\t $purTokenVal='';\n\t\n\t$roomDesc11 = $roomDesc;\n\t$pernight11 = $pernight;\t\n\t\t\t//echo $pernight; \n\t //$com_rate=$this->Agent_Model->comp_info($hotel_id);\n\t$com_rate='';\n\t if(isset($com_rate))\n\t {\n\t if($com_rate==\"\")\n\t {\n\t $com_rate=0;\n\t }\n\t else\n\t {\n\t\n\t\t\t $com_rate=$com_rate[0]->comprate;\n\t\t }\n\t }\n\t\t $hotel_mark=0;\n\t\t $admark=0;\n\t\t//$hotel_markup=$this->Agent_Model->markup_supplier($hotel_id);\n\t\t$hotel_markup='';\n\t\tif($hotel_markup!=\"\")\n\t\t{\n\t $hotel_markup_type=$hotel_markup->type;\n\n\t if($hotel_markup_type=='amt')\n\t {\n\t\t$hotel_mark=$hotel_markup->amount;\n\t \n\t \n\t }\n\t else\n\t {\n\t\t$markup=$hotel_markup->markup;\n\t\t $hotel_mark=$pernight11*$markup/100;\n\t \n\t }\n\t \n\t \n\t \n\t \n\t\t}\n\t\t $api4=\"gta\";\n\t $common_commission=$this->Home_Model->get_common_markup($api4);\n\t $admark=$common_commission*$pernight11/100;\n\t //echo $pernight11; exit;\n\t $finalperNightValh= $pernight11+$hotel_mark+$admark+$com_rate;\n\t $night=$this->session->userdata('dt');\t\n\t $finalNightValh = $finalperNightValh*$night;\n\t\n\t\t//echo $finalNightValh; exit;\n\t $api4='crs';\n\t\t\t$this->Home_Model->insert_search_result_crs($sec_res,$api4,$cityCode,$itemCode,$itemVal,$starVal,$finalperNightValh,$finalNightValh,$currencyVal,$roomDesc11,$mealsval,$dateFromValc,$dateToValc,$dateFromTimeValc,$dateToTimeVal,$serviceval,$finalcurval,$cancelCodeVal,$purTokenVal,'0','0',$roomdescCode,$ConfirmationVal,$cin,$cout,'0',$image,$desc);\n\t\n\t}\n\t\t\n\t\t\t\t \n\t}",
"function fetchListings($search = null)\r\n\t{\r\n\t\tglobal $mysqli, $db_table_prefix; \r\n\t\t$stmt = $mysqli->prepare(\"SELECT \r\n\t\t\tapartment_id,\r\n\t\t\tname,\r\n\t\t\taddress,\r\n\t\t\tlatitude,\r\n\t\t\tlongitude,\r\n\t\t\tnum_bedrooms,\r\n\t\t\tnum_bathrooms,\r\n\t\t\tlandlord_id,\r\n\t\t\tprice,\r\n\t\t\tdeposit,\r\n\t\t\tdescription,\r\n\t\t\tstatus,\r\n\t\t\tlast_updated\r\n\t\t\tFROM \".$db_table_prefix.\"apartments\");\r\n\t\t$stmt->execute();\r\n\t\t$stmt->bind_result($apartment_id, $name, $address, $latitude, $longitude, $num_bedrooms, $num_bathrooms, $landlord_id, $price, $deposit, $description, $status, $last_updated);\r\n\t\t\r\n\t\twhile ($stmt->fetch())\r\n\t\t{\r\n\t\t\t$row[] = array('apartment_id' => $apartment_id, 'name' => $name, 'address' => $address, 'latitude' => $latitude, 'longitude' => $longitude, 'num_bedrooms' => $num_bedrooms, 'num_bathrooms' => $num_bathrooms, 'landlord_id' => $landlord_id, 'price' => $price, 'deposit' => $deposit, 'description' => $description, 'status' => $status, 'last_updated' => $last_updated);\r\n\t\t}\r\n\t\t$stmt->close();\r\n\t\t\t\r\n\t\tif($search != null)\r\n\t\t{\r\n\t\t\tif(isset($row))\r\n\t\t\t{\r\n\t\t\t\t$terms = explode(\" \", $search);\r\n\t\t\t\t$rowLength = count($row);\r\n\t\t\t\t\r\n\t\t\t\tfor($i = 0; $i < $rowLength; $i++)\r\n\t\t\t\t{\r\n\t\t\t\t\t$matchFound = false;\r\n\t\t\t\t\tforeach($terms as $t)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(contains($row[$i]['name'], $t) || contains($row[$i]['address'], $t) || contains($row[$i]['description'], $t))\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$matchFound = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($matchFound == false)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tunset($row[$i]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn ($row);\r\n\t}",
"abstract public function rooms();",
"public function findOptmialTravelPlan();",
"public function getRoomList() {\n $db = new PDOData();\n $data = $db->doQuery(\"\n select *\n from room\n order by room_id asc;\n \");\n\n return $data;\n }",
"public function availableRooms($array = []);",
"function search_hotel_flight()\n\t\t{\n\t\t\t$city1=$this->session->userdata('citycode');\n\t\t\tif($city1==\"\")\n\t\t\t{\n\t\t\t\t$city1=$this->input->post('citycode');\n\t\t\t\t\n\t\t\t}\n\t\t\t//$expcicode=explode(\",\",$city1);\n\t\t\t\n\t\t\t//$citi=$expcicode[0];\n\t\t\t//$cntry=$expcicode[1];\n\t\t\t\t//echo $city1; exit;\n\t\t\t\n\t\t\t$row1=$this->Home_Model->cityCode_gta($city1);\n\t\t\tif($row1 !='')\n\t\t\t{\n\t\t\t\t$city_gta_code=trim($row1->cityCode);\n\t\t\t\t$destinationType=trim($row1->destinationType);\n\t\t\t\t$countrycode=trim($row1->countryCode);\n\t\t\t}\n\t\t\t$roomcount=$this->session->userdata('roomcount');\n\t\t\t$roomusedtypeval=$this->session->userdata('roomusedtype');\n\t\t\t//$roomusedtype=$roomusedtypeval[0];\n\t\t\t$roomusedtype = $roomusedtypeval;\n\t\t\t//$city=$city_gta_code;\t\t\t\n\t\t\t$sec_res=$this->session->userdata('sec_res');\t\n\t\t\t//$cin=$this->session->userdata('sec_res');\t\n\t\t\t//$cout=$this->session->userdata('sec_res');\t\n\t\t\t$check_in = $this->input->post('sd');\n\t\t\t$check_out = $this->input->post('ed');\t\t\n\t\t\t$costval=$this->input->post('costtype');\n\t\t\t$out=explode(\"/\",$this->input->post('ed'));\n\t\t\t$cout=$out[2].\"-\".$out[1].\"-\".$out[0];\n\t\t\t$in=explode(\"/\",$this->input->post('sd'));\n\t\t\t$cin=$in[2].\"-\".$in[1].\"-\".$in[0];\n\t\t\t$diff = strtotime($cout) - strtotime($cin);\n\t\t\t\n\t\t\t$data['rtype']=$roomusedtype;\n\t\t\t$child=0;\n\t\t\t$adult=0;\n\t\t\t$noofroom1=0;\n\t\t\t\t/*for($i=0;$i< count($roomcount);$i++)\n\t\t\t\t{\n\t\t\t\t\n\t\t\t\t\tswitch($roomusedtypeval[$i])\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t$adult=$adult+(1*$roomcount[$i]);\n\t\t\t\t\t\t\t$noofroom1=$noofroom1+$roomcount[$i];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase 3:\t\t\t\t\n\t\t\t\t\t\t\t$adult=$adult+(2*$roomcount[$i]);\n\t\t\t\t\t\t\t$noofroom1=$noofroom1+$roomcount[$i];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase 9:\n\t\t\t\t\t\t\t$adult=$adult+(4*$roomcount[$i]);\n\t\t\t\t\t\t\t$noofroom1=$noofroom1+$roomcount[$i];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase 6:\n\t\t\t\t\t\t\t$adult=$adult+(2*$roomcount[$i]);\n\t\t\t\t\t\t\t$noofroom1=$noofroom1+$roomcount[$i];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\t $adult=$adult+(1*$roomcount[$i]);\n\t\t\t\t\t\t\t $noofroom1=$noofroom1+$roomcount[$i];\n\t\t\t\t\t break;\n\t\t\t\t\t \n\t\t\t\t\t case 8:\n\t\t\t\t\t\t\t $adult=$adult+(3*$roomcount[$i]);\n\t\t\t\t\t\t\t $noofroom1=$noofroom1+$roomcount[$i];\n\t\t\t\t\t break;\n\t\t\t\t\t \n\t\t\t\t\t case 4:\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t $child=$child+(1*$roomcount[$i]);\n\t\t\t\t\t\t\t $adult=$adult+(2*$roomcount[$i]);\t\n\t\t\t\t\t\t\t $noofroom1=$noofroom1+$roomcount[$i]; \n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\t\tcase 7:\n\t\t\t\t\t\t\t$child=$child+(1*$roomcount[$i]);\n\t\t\t\t\t\t\t$adult=$adult+(2*$roomcount[$i]);\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$noofroom1=$noofroom1+$roomcount[$i];\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}*/\n\t\t\t\t\t\t\t\n\t\t\t\t\t/*$data['child']=$child;\n\t\t\t\t\t$data['adult']=$adult;\n\t\t\t\t\t$data['nor']=$noofroom1;\n\t\t\t\t\t$data['room']=$noofroom=$noofroom1;\t*/\t\n\t\t\t\t\t$data['child']='0';\n\t\t\t\t\t$data['adult']= '1';\n\t\t\t\t\t$data['nor']= $this->session->userdata('nor');\n\t\t\t\t\t$data['room']= '1';\t\n\t\t\t\n\t\t\t$sec = $diff % 60;\n\t\t\t$diff = intval($diff / 60);\n\t\t\t$min = $diff % 60;\n\t\t\t$diff = intval($diff / 60);\n\t\t\t$hours = $diff % 24;\n\t\t\t$days = intval($diff / 24);\n\t\t\t$data['dt']=$days;\n\t\t\t//,'nor'=>$data['nor'],\n\t\t\t$this->session->set_userdata(array('check_in_new'=>$check_in,'dt'=>$days,'adult'=>$data['adult'],'child'=>$data['child'],\n\t\t\t'cin'=>$cin,'cout'=>$cout,'rtype'=>$data['rtype']));\n\t\t\t//echo $adult; exit;\n\t\t\t//$this->crs_availability_new($cin,$cout,$days,$sec_res);\n\t\t\t$country_travel = $this->session->userdata('country_travel');\n\t\t\t$destination = $this->session->userdata('destination');\n\t\t\t$resort = $this->session->userdata('resort');\n\t\t\t$this->hotel_search_youtravel_flight($country_travel,$destination,$resort);\n\t\n\t\t\t//exit;\n\t\t\tredirect('home/search_result_new','refresh');\n\t\t\n\t\t}",
"private function get_hotel_list(){ \n $hotelAvail = new SabreHotelAvail();\n\n return $hotelAvail->get_response(); \n }",
"public static function getRoomPlanListDetailByHotelId($hotelId)\n\t{\n\t\t$sql = '\n\t\t\tSELECT\n\t\t\t\t A.*, min(B.Price) AS MinPrice, C.RoomTypeName\n\t\t\tFROM\n\t\t\t\t(\n\t\t\t\t\tSELECT \n\t\t\t\t\t\tB.*, C.ShowOrder\n\t\t\t\t\tFROM \n\t\t\t\t\t\tHT_Hotel as A, HT_HotelRoomPlanLink as C, HT_RoomPlan as B \n\t\t\t\t\tWHERE\n\t\t\t\t\t\tA.`HotelId` = C.`HotelId` AND B.`RoomPlanId` = C.RoomPlanId AND A.HotelId = '.$hotelId.'\n\t\t\t\t) as A left join HT_RoomStockAndPrice as B on A.RoomPlanId = B.`RoomPlanId` AND B.Price > 0\n\t\t\t\t, HT_RoomType as C\n\t\t\tWHERE\n\t\t\t\tA.RoomTypeId = C.RoomTypeId\n\t\t\tGROUP BY \n\t\t\t\tA.RoomPlanId\n\t\t\tORDER BY \n\t\t\t\tA.ShowOrder, min(B.Price) ASC\n\t\t';\n\t\t// echo $sql;\n\t\treturn Db::getInstance()->ExecuteS($sql);\n\t}",
"private static function getAvailableRoomRecords(){\n $response = self::$accessSvc->getAvailableRoomRecords(self::$x, self::$y, self::$date);\n echo $response;\n }",
"function get_rooms($id) {\n $id = mysqli_real_escape_string($this->connection, $id); \n return $this->query(\"SELECT name, room.id AS id, building, size, note, floor FROM room WHERE kwds_id='$id' ORDER BY name\");\n }",
"public function search($id){\n\n\t\t$query = \"SELECT * FROM \".$this->tableName.\" WHERE (idrooms = :idrooms)\";\n $newRoom = null;\n $parameters[\"idrooms\"] = $id;\n\n $this->connection = Connection::GetInstance();\n $array = $this->connection->Execute($query, $parameters);\n foreach($array as $newArray){\n if($newArray !== null){ \n $newRoom = new Room($newArray['capacity'],$newArray['id_cinema'],$newArray['name'],$newArray['price']);\n $newRoom->setId($newArray['idrooms']);\n }\n }\n return $newRoom;\n\n\n }",
"function roomsList(){\n\t\t\n\t\t//Call Connection function\n\t\t$conn = manageExamApplication::dbConn();\n\t\t\n\t\t//Fetch all records from room table\n\t\t$query = $conn->prepare(\"SELECT id,description FROM room\"); \n\t\t$query->execute();\n\t\t\n\t\t//Intialize variable\n\t\t$rooms = '';\n\t\t\n\t\t\n\t\t//Execute Loop\n\t\twhile ($room = $query->fetch()){\n\t\t\t$rooms .= '<option value=\"'.$room['id'].'\">'.$room['description'].'</option>';\n\t\t} \n\t\t//Echo rooms list\n\t\techo $rooms;\n\t}",
"public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\t\t$criteria=new CDbCriteria;\n\t\t\n\t\t$hotel_branch_id = yii::app()->user->branch_id;\n\t\t$criteria->condition=\"t.branch_id = $hotel_branch_id\";\n\t\t$criteria->compare('mst_room_id',$this->mst_room_id);\n\t\t$criteria->compare('mst_room_name',$this->mst_room_name, true);\n\t\t//$criteria->compare('mst_floor_id',$this->mst_floor_id);\n\t\t$criteria->compare('Floor.description',$this->mst_floor_id, true);\n\t\t//$criteria->compare('mst_roomtypeid',$this->mst_roomtypeid);\n\t\t$criteria->compare('Roomtype.room_name',$this->mst_roomtypeid, true);\n\t\t$criteria->compare('mst_room_remarks',$this->mst_room_remarks,true);\n\t\t$criteria->compare('mst_room_adults',$this->mst_room_adults);\n\t\t$criteria->compare('mst_room_childs',$this->mst_room_childs);\n\t\t$criteria->compare('mst_room_status',$this->mst_room_status,true);\n\t\t$criteria->compare('branch_id',$this->branch_id);\n\t\t$criteria->with=array('Floor'=>array('select'=>'Floor.description'), 'Roomtype'=>array('select'=>'Roomtype.room_name'));\n\t\t//$criteria->with=array('Roomtype');\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'pagination'=>array('pageSize'=>20),\n\t\t));\n\t}",
"public function listpawn() {\n//\n// $datestr = $date->format('Y') . '-' . $date->format('m') . '-1';\n// $dateend = $date->format('Y') . '-' . $date->format('m') . '-31';\n\n\n\n $branch = $this->Core->getLocalBranchId();\n $where = '';\n if ($branch != '0') {\n $where = $branch;\n }\n $pawns = $this->Pawns->find('all', [\n 'conditions' => ['Pawns.branch_id ' => $where],\n 'contain' => ['Bpartners'],\n 'order' => ['docno' => 'DESC']\n ]);\n if ($this->request->is(['post'])) {\n\n $code = $this->request->data('txtsearch');\n\n if ($code != '') {\n\n $code = '%' . $this->request->data('txtsearch') . '%';\n\n\n $pawns = $this->Pawns->find('all', [\n 'conditions' => ['docno LIKE ' => $code, 'returndate is' => NULL, 'Pawns.branch_id' => $where],\n 'contain' => ['Bpartners'],\n 'order' => ['docno' => 'DESC']\n ]);\n }\n }\n $docStatusList = $this->TransactionCode->getStatusCode();\n $this->set(compact('pawns', 'docStatusList'));\n $this->set('_serialize', ['pawns']);\n }",
"public function view1($room_number,$max_guest, $check_in_date, $check_out_date, $type_name,$bookingCalendar, $customer_id=0) {\n if(!isset($_SESSION['user_id'])) {\n $dashboard = new DashboardController();\n $dashboard->index(); \n }\n else {\n $db = new RoomDetails();\n $rooms = $db->getRoomAll();\n $roomsAll = $db->getRoomID($room_number);\n $room_id = $roomsAll['room_id'];\n $data['rooms'] = $rooms;\n if($customer_id != 0) {\n $customer = new Customer();\n $customerDetails = $customer->getCustomer($customer_id);\n $data['customer'] = $customerDetails;\n }\n // think room search result will be indicate here\n $value=1;\n $data['room_id'] = $room_id;\n $data['discount'] = array(\"value\"=>$value);\n $data['bookingCalendar'] = $bookingCalendar; // normal search add should\n $data['reservation'] = array(\"check_in_date\"=>$check_in_date, \"check_out_date\"=>$check_out_date, \"type_name\"=>$type_name, 'room_number' => $room_number, 'max_guest' => $max_guest);\n view::load('dashboard/reservation/create', $data);\n \n }\n \n }",
"static function getOffers($params){\n $con = $params['dbconnection'];\n $offers = [];\n $outlet_id = \"\";\n $datarange = \"\";\n $search = \"\";\n if($params['search'] != ''){\n $search = \" AND (ou.`name` LIKE '%{$params['search']}%' OR\n\tof.`search_tags` LIKE '%{$params['search']}%' OR\n\tof.`SKU` LIKE '%{$params['search']}%' OR\n\tof.`title` LIKE '%{$params['search']}%')\";\n }\n if($params['outlet_id'] != ''){\n $outlet_id = \" AND of.`outlet_id`='{$params['outlet_id']}'\";\n }\n if($params['start_date'] != \"\" && $params['end_date']){\n $datarange = \" AND of.`created_at` > '{$params['start_date']}' AND of.`created_at` < '{$params['end_date']}'\";\n }\n $sortby = \"of.`id` DESC\";\n if($params['sortby'] != '' && $params['orderby'] != ''){\n if($params['sortby'] == 'outlet_name'){\n $sortby = \"ou.`name` \".$params['orderby'];\n }\n else if($params['sortby'] == 'live'){\n $sortby = \"`remaining_days` DESC\";\n }\n else if($params['sortby'] == 'expired'){\n $sortby = \"`remaining_days` ASC\";\n }\n else{\n $sortby = \"ou.`{$params['sortby']}` \".$params['orderby'];\n }\n }\n $offersCount = \"\";\n if($offersCount = $con->query(\"SELECT\n\tof.`id`\n\tFROM `offers` as of\n\tINNER JOIN `outlets` as ou ON(of.`outlet_id`=ou.`id`)\n\tWHERE of.`id`=of.`id` \".$search.\" \".$outlet_id.\" \".$datarange.\"\")\n ){\n $offersCount = $offersCount->num_rows;\n }\n $query = \"SELECT\n\tof.*,\n\tdatediff(`end_datetime`, NOW()) as remaining_days,\n\tou.`name` as outlet_name\n\tFROM `offers` as of\n\tINNER JOIN `outlets` as ou ON(of.`outlet_id`=ou.`id`)\n\tWHERE of.`id`=of.`id` \".$search.\" \".$outlet_id.\" \".$datarange.\"\n\tORDER BY \".$sortby.\" LIMIT \".$params['index'].\",\".$params['index2'].\" \";\n $result = mysqli_query($con, $query);\n if(mysqli_error($con) != ''){\n return \"mysql_Error:-\".mysqli_error($con);\n }\n if(mysqli_num_rows($result) > 0){\n while($row = mysqli_fetch_assoc($result)){\n $row['image_name'] = $row['image'];\n if(empty(DbMethods::checkImageSrc($row['image']))){\n $row['image'] = '';\n }\n if($row['special'] == null){\n $row['special'] = '0';\n }\n $offers[] = $row;\n }\n }\n if($offersCount != ''){\n return [\"offers\" => $offers, \"offersCount\" => $offersCount];\n }\n else{\n return '';\n }\n }",
"public function getCalendarRoomList()\n\t{\n\t\t$result = $this->myPdoObj\n\t\t\t->select('id_room, name_room')\n\t\t\t->table('rooms')\n\t\t\t->limit(START_ROOM, END_ROOM)\n\t\t\t->query()\n\t\t\t->commit();\n\n\t\treturn $result;\n\t}",
"public function process()\n\t{\n\t\tglobal $cookie;\n\t\t\n\t\tparent::process();\n\t\t\n\t\t$roomtype_list = RoomPlan::getRoomTypeList();\n\t\t\n\t\t$roomtype_form_list = array();\n $search_form = array();\n\n // get contient code\n self::$cookie->UserID;\n $continentCode = Tools::getUserContinentCode(self::$cookie->CompanyID);\n\t\tif (Tools::isSubmit(\"search\")) {\n\t\t\t$search_form = Tools::element_copy($_REQUEST, 'CityId', 'AreaId', 'CheckIn', 'CheckOut', 'Nights', 'HotelClassId', 'HotelName', 'SortBy', 'SortOrder');\n\n if (self::$cookie->RoleID == 2 || self::$cookie->RoleID == 3) {\n $search_form['ContinentCode'] = $continentCode;\n $search_form['HideRQ'] = @$_REQUEST['HideRQ'];\n $search_form['Role'] = 'Agent';\n }\n\n\t\t\tforeach($roomtype_list as $roomtype)\n\t\t\t{\n\t\t\t\t$roomTypeId = $roomtype['RoomTypeId'];\n\t\t\t\t$roomtype_form_list[$roomTypeId] = $_REQUEST['RoomType_'.$roomTypeId];\n\t\t\t}\n\t\t\t$search_form['RoomTypeVals'] = $roomtype_form_list;\n \n\t\t\tif (self::$cookie->RoleID == 2 || self::$cookie->RoleID == 3 || ($search_form['CheckIn'] && $search_form['CheckOut'])) {\n $search_form['Role'] = 'Agent';\n\t\t\t\t$hotel_roomplan_count = RoomPlan::searchHotelRoomPlanCount($search_form);\n\t\t\t\tparent::pagination($hotel_roomplan_count);\n\t\t\t\t$hotel_roomplan_list = RoomPlan::searchHotelRoomPlan($search_form, $this->p, $this->n);\n\t\t\t} else {\n\t\t\t\t$hotel_roomplan_count = HotelDetail::getHotelByAreaCityCount($search_form);\n\t\t\t\tparent::pagination($hotel_roomplan_count);\n\t\t\t\t$hotel_roomplan_list = HotelDetail::getHotelByAreaCity($search_form, $this->p, $this->n);\n\t\t\t}\n\t\t} else { \n\t\t\t// redirect \n\t\t\tTools::redirect('index.php');\n\t\t}\n\t\t\n\t\tself::$smarty->assign(\"hotel_roomplan_list\", $hotel_roomplan_list);\n\t\tself::$smarty->assign(\"hotel_roomplan_count\", $hotel_roomplan_count);\n\t\tself::$smarty->assign(\"search_form\", $search_form);\n\t\tself::$smarty->assign(\"search_city_name\", Tools::getCityName($search_form['CityId']));\n\t\tself::$smarty->assign(\"search_area_name\", Tools::getAreaName($search_form['AreaId']));\n\n\t\tself::$smarty->assign(\"roomTypeList\", $roomtype_list);\n\t\tself::$smarty->assign(\"classList\", Tools::getAllHotelClasses());\n\t\tself::$smarty->assign(\"areaList\", Tools::getJapanAreas());\n\t\t\n\t}",
"function search_hotel_by_name( $req, $conexion, $db ) {\n\t\n\tmysqli_select_db( $conexion, $db ); //Conexiona a la base de datos\n\n\t$hotel_name = $req['hotel'];\n\n\t$array_hotels = array();\n\t\n\t$select_hotels = \" SELECT nombre, id, zona FROM hoteles WHERE nombre LIKE '%\" . $hotel_name . \"%'\";\n\t\n\t$query_hotels = mysqli_query( $conexion, $select_hotels ) or die( mysqli_error() );\n\t\n\t$total_hotels = mysqli_num_rows($query_hotels);\n\n\tif( $total_hotels > 0 ){\n\n\t\twhile( $row_hotels = mysqli_fetch_assoc( $query_hotels ) ) {\n\t\t\t\n\t\t\t$row_array['label'] = $row_hotels['nombre'];\n\t $row_array['value'] = $row_hotels['id'];\n\t $row_array['zona'] = $row_hotels['zona'];\n\n\t\t\tarray_push( $array_hotels, $row_hotels );\n\t\t}\n\t\t\t\n\t\techo json_encode( $array_hotels );\n\t\n\t} else {\t\n\t\techo '[{\"id\":\"\",\"nombre\":\"No results\"}]';\n\t}\n\n}",
"public function getSearchResults()\n {\n global $mysqli, $_GET;\n $key = $mysqli->real_escape_string($_GET['key']);\n $results = array();\n\n $status[\"hidden\"] = \"versteckt\";\n $status[\"online\"] = \"online\";\n $status[\"offline\"] = \"offline\";\n $status[\"deleted\"] = \"gelöscht\";\n\n $searchData = \"AND `title` LIKE '%\" . $key . \"%'\";\n $search = \"SELECT id, title, status FROM `schools` WHERE status<>'deleted' AND (title<>'' OR title<>null) $searchData ORDER BY FIELD(status, 'online', 'hidden', 'offline', 'deleted'), title\";\n $rows = $mysqli->query($search);\n $shl_count = $rows->num_rows;\n if ($shl_count > 0) {\n $school_list = '';\n while ($school = $rows->fetch_array()) {\n $school_list .= '<tr><td><a href=\"edit_school.php?sid='.$school['id'].'\">' . $school['title'] . \" <small>(\" . $status[$school['status']] . ')</small></a></td></tr>';\n }\n if ($school_list != '') {\n $results[\"search_schools\"] = '<table class=\"table table-striped\"><thead><tr><th>Golfschulen</th></tr></thead><tbody class=\"searchable\"><tr class=\"no-data\"><td colspan=\"9\">No data in this page.</td></tr>' . $school_list . '</tbody></table>';\n }\n }\n\n $search_hotel = \"SELECT id, title, status FROM `hotels` WHERE status<>'deleted' AND (title<>'' OR title<>null) $searchData ORDER BY FIELD(status, 'online', 'offer', 'hidden', 'offline', 'deleted'), title\";\n $hotels = $mysqli->query($search_hotel);\n $htl_count = $hotels->num_rows;\n if ($htl_count > 0) {\n $hotel_list = '';\n while ($hotel = $hotels->fetch_array()) {\n $hotel_list .= '<tr><td><a href=\"edit_hotel.php?hid='.$hotel['id'].'\">' . $hotel['title'] . \" <small>(\" . $hotel['status'] . ')</small></a></td></tr>';\n }\n if ($hotel_list != '') {\n $results[\"search_hotels\"] = '<table class=\"table table-striped\"><thead><tr><th>Hotels</th></tr></thead><tbody class=\"searchable\"><tr class=\"no-data\"><td colspan=\"9\">No data in this page.</td></tr>' . $hotel_list . '</tbody></table>';\n }\n }\n\n return $results;\n }",
"public static function getRoomPlanListForBooking($id_list, $checkin, $checkout)\n\t{\n\t\tglobal $cookie;\n $iso = Language::getIsoById((int)$cookie->LanguageID);\n\n\t\t$ids = implode(',', $id_list);\n\t\t$sql = '\n SELECT\n A.RoomPlanId, A.RoomPlanName_'.$iso.' as RoomPlanName, A.RoomTypeId, A.`Breakfast`, A.`Dinner`, B.`RoomTypeName`, A.`RoomMaxPersons`\n FROM\n HT_RoomPlan as A, HT_RoomType as B, HT_RoomStockAndPrice as C\n WHERE\n A.RoomTypeId = B.`RoomTypeId` AND A.RoomPlanId = C.`RoomPlanId`\n AND C.`ApplyDate` >= \"'.$checkin.'\" AND C.`ApplyDate` < \"'.$checkout.'\" \n\t\t\tAND A.`StartTime` <= \"'.$checkin.'\" AND A.`EndTime` >= DATE_SUB(\"'.$checkout.'\", INTERVAL 1 DAY) \n AND A.`RoomPlanId` in ('.$ids.')\n group by C.RoomPlanId\n\t\t';\n\n\n // echo $sql;\n $result = Db::getInstance()->ExecuteS($sql);\n\n $plan_list = array();\n foreach($result as $record)\n {\n $plan_list[$record['RoomPlanId']] = $record;\n }\n\n $ret_plan_list = array();\n foreach($id_list as $rpid)\n {\n $ret_plan_list[] = $plan_list[$rpid];\n }\n\n\n\t\treturn $ret_plan_list;\n\t}",
"public function index()\n\t{\n\t\t$rooms = HotelRoom::with('category', 'floor')\n\t\t\t->orderBy('id', 'DESC');\n\n\t\tif (request()->ajax()) {\n\t\t\tif (request('hotel_floor_id')) {\n\t\t\t\t$rooms = $rooms->where('hotel_floor_id', request('hotel_floor_id'));\n\t\t\t}\n\t\t\tif (request('hotel_category_id')) {\n\t\t\t\t$rooms = $rooms->where('hotel_category_id', request('hotel_category_id'));\n\t\t\t}\n\t\t\tif (request('status')) {\n\t\t\t\t$rooms = $rooms->where('status', request('status'));\n\t\t\t}\n\t\t\tif (request('name')) {\n\t\t\t\t$rooms = $rooms->where('name', 'like', '%' . request('name') . '%');\n\t\t\t}\n\n\t\t\treturn response()->json([\n\t\t\t\t'success' => true,\n\t\t\t\t'rooms' => $rooms->paginate(25),\n\t\t\t], 200);\n\t\t}\n\n\t\t$rooms = $rooms->paginate(25);\n\n\t\t$categories = HotelCategory::where('active', true)\n\t\t\t->orderBy('description')\n\t\t\t->get();\n\n\t\t$floors = HotelFloor::where('active', true)\n\t\t\t->orderBy('description')\n\t\t\t->get();\n\n\t\t$roomStatus = HotelRoom::$status;\n\n\t\treturn view('hotel::rooms.index', compact('rooms', 'floors', 'categories', 'roomStatus'));\n\t}",
"function listar_hotel(){\n\t\t/* Metodo para listar los usuarios y sus opciones. */\n\t\tif (isset($_POST['buscar']))\n\t\t\t$_SESSION['buscar']=$_POST['buscar'];\n\t\t\t\n\t\t\tif(isset($_SESSION['buscar']) && $_SESSION['buscar']!=\"\")\n\t\t\t\t$this->keywords=$_SESSION['buscar'];\n\t\t\t\t$palabras[] = $this->keywords;\n\t\t\t\t//array_unshift($palabras, $this->keywords);\n\t\t\t\n\t\t\t$ciudad=$_SESSION['ciudad_admin'];\n\t\t\t\t\n\t\t\tif (isset($_SESSION['buscar']) && $_SESSION['buscar']!=\"\"){\t\n\t\t\t\t$this->buscar=$_SESSION['buscar'];\n\t\t\t\t$sql=\"SELECT * FROM hotel, categoria WHERE \";\n\t\t\t\t$sql.= \" (\";\n\t\t\t\tforeach($palabras as $valor => $indice){\n\t\t\t\t\t$sql.=\"ciudad_hot LIKE '%' '\".$palabras[$valor].\"' '%' OR \n\t\t\t\t\tcategoria_hot LIKE '%' '\".$palabras[$valor].\"' '%' OR \n\t\t\t\t\tubicacion_hot LIKE '%' '\".$palabras[$valor].\"' '%' OR \n\t\t\t\t\tclaves_hot LIKE '%' '\".$palabras[$valor].\"' '%' OR \n\t\t\t\t\tcategoria_hot LIKE '%' '\".$palabras[$valor].\"' '%' OR \n\t\t\t\t\tnombre_hot LIKE '%' '\".$palabras[$valor].\"' '%' OR \n\t\t\t\t\tdescripcion_hot LIKE '%' '\".$palabras[$valor].\"' '%' OR \";\n\t\t\t\t}\n\t\t\t\t$sql.=\"id_hot LIKE '%' '\".$palabras[$valor].\"' '%') GROUP BY id_hot ORDER BY disponible_hot, prioridad_hot, nombre_hot ASC\";\n\t\t\t}else{\n\t\t\t\t$sql=\"SELECT * FROM hotel GROUP BY id_hot ORDER BY disponible_hot, prioridad_hot, nombre_hot ASC\";\n\t\t\t}\n\t\t\t//echo $sql;\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t$this->mensaje=\"si\";\n\t\t\t\n\t\t\t$resultado['bandera_hot']=$this->buscar_bandera($resultado['pais_hot']);\n\t\t\t$resultado['pais_hot']=$this->buscar_pais($resultado['pais_hot']);\n\t\t\t$resultado['estado_hot']=$this->buscar_estado($resultado['estado_hot']);\n\t\t\t\n\t\t\t$this->listado[] = $resultado;\n\t\t}\n\t}",
"public function getrooms(){\n\t\tif(isset($_POST)){\n\t\t\tif(isset($_POST['building_id']) && $_POST['building_id']!=''){\n\t\t\t\t$rooms = $this->mapModel->getRooms($_POST);\n\t\t\t\techo json_encode(array('message'=>'rooms', 'result'=>$rooms));\t\t\t\n\t\t\t}else{\n\t\t\t\techo json_encode(array('message'=>'$_POST[\"building_id\"] must be set and not be empty'));\n\t\t\t}\n\t\n\t\t}else{\n\t\t\techo json_encode(array('message'=>'use post'));\n\t\n\t\t}\n\t\t\n\t}",
"public function getRoomsAction() {\n echo 'GET ALL ROOMS A USER BELONGS TO!';\n }",
"public function findActivePlan(): array;",
"public function getRoomsByGrid($args) {\n $db = \\Helper::getDB();\n $db->join('grid_regions r', 'mr.regionUuid = r.uuid AND r.gridId = mr.gridId', 'LEFT');\n $db->where(\"mr.gridId\", $db->escape($args[1]));\n $columns = array(\n 'mr.id as roomId',\n 'mr.regionUuid as regionUuid',\n 'mr.gridId as gridId',\n 'mr.name as name',\n 'mr.description as description',\n 'mr.x as x',\n 'mr.y as y',\n 'mr.z as z',\n 'r.name as regionName'\n );\n $results = $db->get('meeting_rooms mr', NULL, $columns);\n\n // Create the grid\n $grid = new \\Models\\Grid($results[0]['gridId']);\n\n // Process results\n $data = array();\n foreach($results as $result) {\n // Only set the region once, reuse it for other rooms in the same region\n $region = $grid->getRegionByUuid($result['regionUuid']);\n if($region == FALSE) {\n $region = new \\Models\\Region($result['regionUuid'], $grid);\n $region->setName($result['regionName']);\n $grid->addRegion($region);\n }\n $room = new \\Models\\MeetingRoom($result['roomId'], $region, $result['name'], $result['description'], $result['x'], $result['y'], $result['z']);\n $data[] = $this->getRoomData($room, FALSE);\n }\n\n return $data;\n }",
"public function search() {\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\n\t\t$this->title = \"Search land \";\n\t\t$this->list = $this->Results();\t\r\n return $this->renderWith(array('Land_results', 'App'));\r\n }",
"public function getPossibleReservationsForTerrain() {\n $today = date(\"Y-m-d\", time());\n\n $qry = \"SELECT fiDate, idHour, dtWeekDay, fiTerrain FROM tblPossibleReservation, tblHour, tblWeekDay, tblHourWeekDay WHERE fiHourWeekDay = idHourWeekDay AND fiHour = idHour AND fiWeekDay = idWeekDay AND fiDate BETWEEN :date AND DATE_ADD(:date, INTERVAL 7 DAY ) ORDER BY fiDate, idHour\";\n\n try {\n $stmt = $this->dbh->prepare($qry);\n\n $stmt->bindValue(\":date\", $today);\n\n if ($stmt->execute()) {\n return json_encode($stmt->fetchAll(PDO::FETCH_ASSOC));\n }\n else {\n return false;\n }\n }\n catch(PDOException $e) {\n echo \"PDO has encountered an error: \" + $e->getMessage();\n die();\n }\n }"
] | [
"0.60438883",
"0.5885246",
"0.5849219",
"0.58024657",
"0.58006144",
"0.5783867",
"0.5757281",
"0.5740843",
"0.5698439",
"0.5695601",
"0.56888986",
"0.5679257",
"0.5666504",
"0.5632177",
"0.562846",
"0.5627255",
"0.5618953",
"0.5613455",
"0.5550291",
"0.554601",
"0.55448073",
"0.55104834",
"0.54925334",
"0.54771805",
"0.546728",
"0.54499006",
"0.5432263",
"0.5429559",
"0.5424854",
"0.54084885"
] | 0.67486346 | 0 |
/ get room plan sales info by primary key | public static function getRoomPlanSales($rpid)
{
$sql = "
SELECT `UseCon`, DATE_FORMAT(`ConFromTime`, '%Y-%m-%d') as ConFromTime, DATE_FORMAT(`ConToTime`, '%Y-%m-%d') as ConToTime, `Nights`, `PriceAll`, `PriceAsia`, `PriceEuro`, `Active`
FROM HT_RoomPlan
WHERE RoomPlanId = {$rpid}
";
return Db::getInstance()->getRow($sql);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function viewBySales($sales_id);",
"function get_spa_reservation_data($cond)\n {\n $sql = '\n select \n massage_reservation_room.id,\n massage_reservation_room.tax,\n massage_reservation_room.tip_amount,\n massage_reservation_room.total_amount,\n massage_reservation_room.discount,\n MASSAGE_PRODUCT_CONSUMED.time_out\n from\n MASSAGE_PRODUCT_CONSUMED \n inner join massage_reservation_room\n on MASSAGE_PRODUCT_CONSUMED.reservation_room_id = massage_reservation_room.id\n where\n '.$cond;\n //System::debug($sql); \n $items = DB::fetch_all($sql);\n return $items;\n }",
"public function get_sales_by_id($sales_id){\n\t\t$this->db->select('*');\n\t\t$this->db->from('new_psb');\n\t\t$this->db->where('psb_id',$sales_id); \n\t\t$query_result=$this->db->get();\n\t\t$result=$query_result->row();\n\t\treturn $result;\n\t}",
"public function get_sale($listing_id) \n {\n $this->get(\n 'sale/get', \n [\n 'user_key' => $this->user_key,\n 'id' => $listing_id\n ]\n );\n }",
"function obtener_planificacion($id_plan_producto)\r\n { \r\n $sql=\"select pp.*,\r\n p.codigo as pcodigo, p.nombre as pnombre, p.definicion as pdefinicion, \r\n s.codigo as scodigo, s.nombre, s.definicion, s.es_determinado,\r\n s.es_tramite, s.unidad_medida, s.activo, s.es_extraordinario,\r\n e.id_estructura, e.codigo as ecodigo, e.descripcion as estructura\r\n from c_plan_productos pp\r\n join c_subproductos s using(id_subproducto)\r\n join c_productos p using(id_producto)\r\n join e_estructura e using(id_estructura)\r\n where id_plan_producto=$id_plan_producto\";\r\n \r\n $query = $this->db->query($sql);\r\n if($query->num_rows()>0)\r\n {\r\n return $query->row_array();\r\n }\r\n else {return false;}\r\n }",
"public function get_sales()\n {\n // $id_sales = $_POST['id_sales'];\n $id_sales = $_POST['id_sales'];\n echo json_encode($this->db->get_where('mst_sales', ['id_sales' => $id_sales])->row_array());\n }",
"function saler_summary_get(){\n try{\n /*\n * Check user\n */\n $account_id = $this->checkSessionAndTokenAuth();\n $where = array(\n 'account_id'=>$account_id\n );\n $data_type = $this->user_get_type_model->findOne($where);\n\n $type_user = !empty($this->input->request_headers()['Type']) ? $this->input->request_headers()['Type'] : '';\n\n //check is sale get info\n if($type_user == $data_type->type && $data_type->type == 'counselors'){\n /*\n * Get point of account login\n */\n $where_account = array(\n \"account_id\" => $account_id\n );\n $select_account = array(\n \"point2rank\"\n );\n $data_account = $this->account_info_model->findOne($where_account,$select_account);\n $data_account = !empty($data_account) ? $data_account : [];\n /*\n * Get list Rank\n */\n\n $select_rank = array(\n \"*\"\n );\n $data_rank = $this->rank_model->find($select_rank);\n $data_rank = !empty($data_rank) ? $data_rank : [];\n /*\n * Get list salary\n */\n $where_salary = array(\n \"account_id\" =>$account_id,\n );\n $select_salary = array(\n 'total_price',\n 'received_price',\n 'not_received_price'\n );\n /*\n * Get appointment nearly show on app\n */\n $where_appointment = \"seller_id = $account_id AND status = 'confirmed' ORDER BY time_booking DESC\";\n $select_appointment = array(\n 'project_id',\n 'time_booking',\n 'address'\n );\n $data_appointment = $this->appointment_model->findOne($where_appointment,$select_appointment);\n\n /*\n * Get info project\n */\n if(!empty($data_appointment)){\n $where_project = array(\n \"project._id\" => $data_appointment->project_id\n );\n $select_project = array(\n 'project.name',\n 'project.address'\n );\n $data_project = $this->project_model->findOne($where_project,$select_project);\n }else{\n $data_project = [];\n }\n\n //\t\tdump($data_appointment,true);\n $data_salary = $this->salary_model->findOne($where_salary,$select_salary);\n $data_salary = !empty($data_salary) ? $data_salary : [];\n $rs = array(\n 'data_account' => $data_account,\n 'data_rank' => $data_rank,\n 'data_salary' => $data_salary,\n 'data_project' => $data_project\n );\n $rs = !empty($rs) ? removeNullOfObject($rs) : [];\n\n $this->response(RestSuccess($rs), SUCCESS_CODE);\n }else{\n $this->response(RestBadRequest(WRONG_TYPE_USERNAME), BAD_REQUEST_CODE);\n }\n }catch (Exception $e){\n $this->response(RestBadRequest(ERROR), BAD_REQUEST_CODE);\n }\n\n }",
"public function fetch_salesbyid($id)\n\t{\n\t\t$where = array(\n\t\t\t\"sale_id\" => $id\n\t\t);\n\t\t$this->db->select()->from('sales')->where($where);\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}",
"function find_salesperson_by_id($id=0) {\n global $db;\n $sql = \"SELECT * FROM salespeople \";\n $sql .= \"WHERE id='\" . $id . \"';\";\n $salespeople_result = db_query($db, $sql);\n return $salespeople_result;\n }",
"public function sale($param){\n\n\t\t$type = array('type'=> 'sale');\n\n\n\t\t$transaction = CardFlex::flex($param, $type);\n\t\treturn $transaction;\n\t\t\n\t}",
"public function GetPurchasRowByCalendar($calendarId)\n {\n try\n {\n // inicio purchase row\n \n $purchaseRowArray= array();\n \n // SELECT \n // pr.idPurchaseRow as 'purchaseRowId', pr.quantity as 'purchaseRowQuantity', pr.price as 'purchaseRowPrice',\n // es.idEventSeat as 'eventSeatId', es.price as 'price', es.quantity as 'quantity', es.remains as 'remains', es.idSeatType as 'idSeatType', \n // st.typeName as 'typeName', es.idCalendar as 'calendarId', \n // cal.datecalendar as 'calendarDate', e.id as 'eventId', \n // e.name as 'eventName', e.picture as 'eventPicture', \n // cat.id as 'categoryId', cat.name as 'categoryName', cat.description as 'categoryDescription',\n // p.id as 'placeEventId', p.name as 'placeEventName', p.capacity as 'placeEventCapacity' \n // FROM seattypes st \n // INNER JOIN eventseats es ON st.idSeatType = es.idSeatType \n // INNER JOIN calendars cal ON es.idCalendar= cal.idCalendar \n // INNER JOIN events e ON cal.idEvent = e.id \n // INNER JOIN categories cat ON e.categoryId = cat.id \n // INNER JOIN placeevents p on cal.idPlace = p.id \n // INNER JOIN purchaserows pr ON pr.idEventSeat = es.idEventSeat \n // INNER JOIN purchases pu ON pr.idPurchase = pu.idPurchase \n // WHERE cal.idCalendar= 1\n\n $query3= \"SELECT pr.idPurchaseRow as 'purchaseRowId', pr.quantity as 'purchaseRowQuantity', pr.price as 'purchaseRowPrice',\n es.idEventSeat as 'eventSeatId', es.price as 'price', es.quantity as 'quantity', es.remains as 'remains', es.idSeatType as 'idSeatType', \n st.typeName as 'typeName', es.idCalendar as 'calendarId', \n cal.datecalendar as 'calendarDate', e.id as 'eventId', \n e.name as 'eventName', e.picture as 'eventPicture', \n cat.id as 'categoryId', cat.name as 'categoryName', cat.description as 'categoryDescription',\n p.id as 'placeEventId', p.name as 'placeEventName', p.capacity as 'placeEventCapacity' \n FROM \" . $this->tableNameSeatType. \" st \n INNER JOIN \" .$this->tableNameEventSeat.\" es ON st.idSeatType = es.idSeatType \n INNER JOIN \" .$this->tableNameCalendar. \" cal ON es.idCalendar= cal.idCalendar \n INNER JOIN \". $this->tableNameEvent .\" e ON cal.idEvent = e.id \n INNER JOIN \" .$this->tableNameCategory. \" cat ON e.categoryId = cat.id \n INNER JOIN \" .$this->tableNamePlaceEvent. \" p on cal.idPlace = p.id \n INNER JOIN \" .$this->tableNamePurchaseRow. \" pr ON pr.idEventSeat = es.idEventSeat \n WHERE cal.idCalendar= :idCalendar\";\n \n $parameters2= array();\n $parameters2[\"idCalendar\"]= $calendarId;\n $resulSet2= $this->connection->Execute($query3, $parameters2);\n\n \n foreach($resulSet2 as $row)\n {\n $category1= new category();\n $category1->setId($row[\"categoryId\"]);\n $category1->setName($row[\"categoryName\"]);\n $category1->setDescription($row[\"categoryDescription\"]);\n\n $event1= new Event();\n $event1->setId($row[\"eventId\"]);\n $event1->setName($row[\"eventName\"]);\n \n $oPhotoEvent1= new Photo();\n $oPhotoEvent1->setPath($row[\"eventPicture\"]);\n \n $event1->setPhoto($oPhotoEvent1);\n $event1->setCategory($category1);\n \n $placeEvent1= new PlaceEvent();\n $placeEvent1->setId($row[\"placeEventId\"]);\n $placeEvent1->setName($row[\"placeEventName\"]);\n $placeEvent1->setCapacity($row[\"placeEventCapacity\"]);\n \n $calendar1 = new calendar();\n $calendar1->setId($row[\"calendarId\"]);\n $calendar1->setDate($row[\"calendarDate\"]);\n $calendar1->setEvent($event1);\n $calendar1->setPlaceEvent($placeEvent1);\n\n $query4= \"SELECT axc.idCalendar as 'calendarId', a.id as 'artistId', a.name as 'artistName', a.lastName as 'artistLastName', a.artisticName as 'artisticName', a.picture as 'artistPicture'\n FROM \". $this->tableNameArtistsxCalendars. \" axc INNER JOIN \" . $this->tableNameArtist . \" a ON axc.idArtist = a.id\n WHERE axc.idCalendar = :idCal;\";\n\n $parameters3[\"idCal\"]= $calendar1->getId();\n $resulSet3= $this->connection->Execute($query4, $parameters3);\n $artistArray1= array();\n \n foreach($resulSet3 as $row1)\n {\n $artist1= new Artist();\n $artist1->setId($row1[\"artistId\"]);\n $artist1->setName($row1[\"artistName\"]);\n $artist1->setLastName($row1[\"artistLastName\"]);\n $artist1->setArtisticName($row1[\"artisticName\"]);\n $oPhotoArtist1= new Photo();\n $oPhotoArtist1->setPath($row1[\"artistPicture\"]);\n $artist1->setPhoto($oPhotoArtist1);\n\n array_push($artistArray1, $artist1);\n }\n $calendar1->setArtistList($artistArray1);\n \n $SeatType= new SeatType();\n $SeatType->setId($row[\"idSeatType\"]);\n $SeatType->setType($row[\"typeName\"]);\n \n $eventSeat= new EventSeat();\n $eventSeat->setId($row[\"eventSeatId\"]);\n $eventSeat->setPrice($row[\"price\"]);\n $eventSeat->setQuantity($row[\"quantity\"]);\n $eventSeat->setRemains($row[\"remains\"]);\n $eventSeat->setCalendar($calendar1);\n $eventSeat->setSeatType($SeatType);\n\n \n $purchaseRow= new PurchaseRow();\n $purchaseRow->setId($row[\"purchaseRowId\"]);\n $purchaseRow->setPrice($row[\"purchaseRowPrice\"]);\n $purchaseRow->setQuantity($row[\"purchaseRowQuantity\"]);\n $purchaseRow->setEventSeat($eventSeat);\n\n array_push($purchaseRowArray, $purchaseRow);\n \n }\n \n return $purchaseRowArray;\n }\n catch(Exception $ex)\n {\n throw $ex;\n }\n }",
"function get_anchor_with_wallet($db,$year,$month,$prod){\n \t$this->db->select('anchor.id, anchor.name');\n \t$this->db->select($prod.\"_vol\");\n \t$this->db->join('anchor', 'anchor.id = wholesale_'.$db.'.anchor_id');\n \t$this->db->where('year',$year);\n \tif($db == \"realization\" ){\n \t\t$this->db->where('month',$month);\n \t}\n \t$this->db->where($prod.\"_vol <> 0\");\n \t$this->db->where('show_anc',1);\n \t$this->db->where('holding', \"\");\n \t$this->db->order_by($prod.\"_vol\", \"desc\"); \n \t$result = $this->db->get('wholesale_'.$db);\n \t$query = $result->result();\n \treturn $query;\n }",
"function showProductSales($sid)\n\t{\n\t\t//declare vars\n\t\t$data = array();\n\t\t\n\t\t//statement\n\t\t$select = \"SELECT * FROM product_sales\n\t\t\t\t WHERE sales_id\t= '$sid'\";\n\t\t\t\t \n\t\t//execute query\n\t\t$query\t= mysql_query($select);\n\t\t//echo $select.mysql_error();exit;\n\t\t//holds the data\n\t\twhile($result = mysql_fetch_object($query))\n\t\t{\n\t\t\t$data = array(\n\t\t\t\t\t$result->sales_id,\t\t\t\t\t//0\n\t\t\t\t\t$result->design_no,\t\t\t\t\t\t\t//1\n\t\t\t\t\t$result->sales,\t\t\t\t\t\t//2\n\t\t\t\t\t$result->company,\t\t\t\t\t\t//3\n\t\t\t\t\t$result->address,\t\t\t\t\t\t\t//4\n\t\t\t\t\t$result->contact_no,\t\t\t//5\n\t\t\t\t\t$result->remarks,\t\t\t\t\t\t//6\n\t\t\t\t\t$result->added_on,\t\t\t\t\t//7\n\t\t\t\t\t$result->added_by,\t\t\t\t\t\t//8\n\t\t\t\t\t$result->modified_on,\t\t\t\t\t\t//9\n\t\t\t\t\t$result->modified_by,\t\t\t\t\t\t//10\n\t\t\t\t\t$result->sale_colour\t\t\t\t\t\t//11\n\n\t\t\t\t\t);\n\t\t}\n\t\t\n\t\t//return the data\n\t\treturn $data;\n\t\t\n\t}",
"public function getGetSalesReps($param);",
"public function getSale_bySaleNo($dateBegin, $dateEnd, $index, $length){\n\t\t$strSQL = \"SELECT \n\t\ts.saleIndex, \n\t\ts.saleNo, \n\t\ts.customerIndex, \n\t\ts.saleType, \t\t\n\t\ts.saleDone, \t\t\n\t\ts.saleTotalAmount, \n\t\ts.saleTotalDiscount, \n\t\ts.saleTotalBalance, \n\t\ts.CRE_DTE, \n\t\ts.CRE_USR, \t\t\n\t\tu.userIndex as userIndex, \n\t\tu.userID as userID, \n\t\tu.fullname as userName \n\t\tFROM saledetailview s \n\t\tinner join _myuser u on u.userID = s.CRE_USR \";\t\n\t\t\n\t\t$where = \"WHERE (CONVERT_TZ(s.CRE_DTE, '+00:00', '+07:00') BETWEEN ? AND ?) \";\n\n\t\tif ($index > -1) {\n\t\t\t$where .= \" LIMIT {$index}, {$length} \";\n\t\t}\n\n\t\t$strSQL .= $where;\n\n\t\t$stmt = mysqli_prepare($this->connection, $strSQL);\n\t\t$this->throwExceptionOnError();\n\n\t\tmysqli_stmt_bind_param($stmt, 'ss',\n\t\t\t\t$dateBegin,\n\t\t\t\t$dateEnd);\n\t\tmysqli_stmt_execute($stmt);\n\t\t$this->throwExceptionOnError();\n\n\t\t$rows = array();\n\n\t\tmysqli_stmt_bind_result($stmt, $row->saleIndex, \n\t\t\t\t\t\t\t\t\t\t$row->saleNo, \n\t\t\t\t\t\t\t\t\t\t$row->customerIndex,\n\t\t\t\t\t\t\t\t\t\t$row->saleType, \t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t$row->saleDone, \n\t\t\t\t\t\t\t\t\t\t$row->saleTotalAmount, \n\t\t\t\t\t\t\t\t\t\t$row->saleTotalDiscount, \n\t\t\t\t\t\t\t\t\t\t$row->saleTotalBalance, \n\t\t\t\t\t\t\t\t\t\t$row->CRE_DTE, \n\t\t\t\t\t\t\t\t\t\t$row->CRE_USR, \n\t\t\t\t\t\t\t\t\t\t$row->userIndex, \n\t\t\t\t\t\t\t\t\t\t$row->userID, \n\t\t\t\t\t\t\t\t\t\t$row->userName);\n\n\t while (mysqli_stmt_fetch($stmt)) {\n\t\t $row->CRE_DTE = new DateTime($row->CRE_DTE);\n\t $rows[] = $row;\n\t $row = new stdClass();\n\t\t mysqli_stmt_bind_result($stmt, $row->saleIndex, \n\t\t\t\t\t\t\t\t\t\t$row->saleNo, \n\t\t\t\t\t\t\t\t\t\t$row->customerIndex,\n\t\t\t\t\t\t\t\t\t\t$row->saleType, \t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t$row->saleDone, \n\t\t\t\t\t\t\t\t\t\t$row->saleTotalAmount, \n\t\t\t\t\t\t\t\t\t\t$row->saleTotalDiscount, \n\t\t\t\t\t\t\t\t\t\t$row->saleTotalBalance, \n\t\t\t\t\t\t\t\t\t\t$row->CRE_DTE, \n\t\t\t\t\t\t\t\t\t\t$row->CRE_USR, \n\t\t\t\t\t\t\t\t\t\t$row->userIndex, \n\t\t\t\t\t\t\t\t\t\t$row->userID, \n\t\t\t\t\t\t\t\t\t\t$row->userName);\n\t }\n\n\t\tmysqli_stmt_free_result($stmt);\n\t\tmysqli_close($this->connection);\n\n\t\treturn $rows;\n\t\t\n\t\t\n\t}",
"function propertyPriceDetails($propertyId)\n{\n $query = \"select * from add_property_price_dtls where ap_id={$propertyId}\";\n\n return getQueryResults($query)[0];\n}",
"public function getReportSales(Request $request){\n $id_outlet_menu = $request->get('id_outlet_menu');\n $startDate = date(\"yy-m-d\", strtotime($request->get('start_date')));\n $endDate = date(\"yy-m-d\", strtotime($request->get('end_date')));\n \n try{\n $sales = SalesLineItem::select('id_outlet_menu',DB::raw('SUM(quantity) as qty'),'created_at')->where([\n ['id_outlet_menu', '=', $id_outlet_menu],\n ['created_at', '>=', $startDate],\n ['created_at', '<=', $endDate]\n ])->groupBy('created_at','id_outlet_menu')->orderBy('created_at')->get();\n return response()->json([\n 'success' => true,\n 'message' => 'Get Sales Success!',\n 'data' => $sales\n ], 200);\n } catch(Throwable $e){\n return response()->json([\n 'success' => false,\n 'message' => 'Get Sales Failed!',\n 'data' => ''\n ], 400);\n } \n }",
"public function getProductPlanProduct($id){\r\n\t\treturn $this->getObject(\"sql_purchase_plan_details_getById\", array('id'=>$id) ) ;\r\n\t\t\r\n\t\t//return $this->query($sql) ;\r\n\t}",
"public function calculatePlanSaleData($plan, $monthYear){\n\t\t\t\n\t\t\t$fromMonth = array(date('m', strtotime($monthYear)));\n\t\t\t\n\t\t\t\n\t\t\t$getSale = InvestmentModel::where('plan_id',$plan->id )\n\t\t\t\t\t\t\t\t\t\t->whereNotNull('paypal_transaction_id')\n\t\t\t\t\t\t\t\t\t\t->whereMonth('plan_start_date', $fromMonth)\n\t\t\t\t\t\t\t\t\t\t->count();\n\t\t\t\n\t\t\treturn (int)$getSale;\n\t\t\t\n\t\t}",
"public function getCommercial($id){\n\t\t\t\t\t$sql = \"SELECT * FROM commercial WHERE commercial.id = \".$id.\" \";\n\t\t\t\t\t if($this->db != null)\n\t\t\t\t\t {\n\t\t\t\t\t return $this->db->query($sql)->fetch();\n\t\t\t\t\t }else{\n\t\t\t\t\t return null;\n\t\t\t\t\t }\n\t\t\t\t\t }",
"function getProductInfo($invId){\r\n $db = acmeConnect();\r\n $sql = 'SELECT * FROM inventory WHERE invId = :invId';\r\n $stmt = $db->prepare($sql);\r\n $stmt->bindValue(':invId', $invId, PDO::PARAM_INT);\r\n $stmt->execute();\r\n $prodInfo = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n $stmt->closeCursor();\r\n return $prodInfo;\r\n }",
"public function fetch_record_product_sales_qty()\r\n {\r\n // WEATHER IT WOULD BE VISIBLE OR HIDDEN MEANS STATUS = 0 OR STATUS = 1\r\n $sql = \"SELECT *, SUM(qty) AS sum_quantity FROM mp_sales INNER JOIN mp_productslist ON (mp_sales.product_id = mp_productslist.id) group by mp_sales.product_id\";\r\n $query = $this->db->query($sql);\r\n if ($query->num_rows() > 0)\r\n {\r\n return $query->result_array();\r\n }\r\n else\r\n {\r\n return NULL;\r\n }\r\n }",
"public function getSaledetailviewBySaleNo($saleNo) {\n\t\trequire_once 'ScustomerService.php';\n\n\t\t$stmt = mysqli_prepare($this->connection, \"SELECT * FROM $this->tablename where saleNo=?\");\n\t\t$this->throwExceptionOnError();\n\n\t\tmysqli_stmt_bind_param($stmt, 's', $saleNo);\n\t\t$this->throwExceptionOnError();\n\n\t\tmysqli_stmt_execute($stmt);\n\t\t$this->throwExceptionOnError();\n\n\t\tmysqli_stmt_bind_result($stmt, $row->saleIndex, $row->saleNo, $row->saleType, $row->customerIndex, $row->saleDone, $row->creditCardID, $row->approvalCode, $row->saleTotalAmount, $row->saleTotalDiscount, $row->saleTotalBalance, $row->creditCardAuthorizer, $row->CRE_DTE, $row->CRE_USR, $row->UPD_DTE, $row->UPD_USR, $row->DEL_DTE, $row->DEL_USR, $row->customerID, $row->fullname);\n\n\t\tif(mysqli_stmt_fetch($stmt)) {\n\t $row->CRE_DTE = new DateTime($row->CRE_DTE);\n\t $row->UPD_DTE = new DateTime($row->UPD_DTE);\n\t $row->DEL_DTE = new DateTime($row->DEL_DTE);\n\n\t\t// Get SaleDetail for Customer By CustomerIndex\n\t\tif($row != null){\n\t\t\t$ScustomerService = new ScustomerService();\n\t\t\t$data_CustomerInfo = $ScustomerService->get_customerByID($row->customerIndex,0);\n\t\t\t$row->phone = $data_CustomerInfo->phone;\n\t\t}\n\n\t return $row;\n\t\t} else {\n\t return null;\n\t\t}\n\t}",
"function getProductInfo($invId)\n{\n $db = acmeConnect();\n $sql = 'SELECT * FROM inventory WHERE invId = :invId';\n $stmt = $db->prepare($sql);\n $stmt->bindValue(':invId', $invId, PDO::PARAM_INT);\n $stmt->execute();\n $prodInfo = $stmt->fetch(PDO::FETCH_ASSOC);\n $stmt->closeCursor();\n return $prodInfo;\n}",
"public function show($id)\n {\n \n $planInfo = $this->planService->getPlanInfo($id);\n\n dd($planInfo->total);\n $toatl \n }",
"public function show(Sales $sales)\n {\n //\n }",
"public function show(Sales $sales)\n {\n //\n }",
"public function show(Sales $sales)\n {\n //\n }",
"public function detail($booking_id = ' ',$room_no = ' ')\n {\n\t \n\t\t$requested_mod = 'HotelRooms';\n\t\tif(!$this->acl->hasPermission($requested_mod))\n\t\t{\n\t\t\tredirect('admin/dashboard');\n\t\t}\n\t\t$this->data['title'] = \"Invoice Details\";\n\t\t$this->data['hotel_data'] = $this->Hotel_model->get_hotel_data($this->session->userdata('logged_in_user')->sb_hotel_id);\n\t\t$this->data['guest_general_data']=$this->Guest_model->get_hotel_guest_general_data($booking_id);\n\t\t$guest_data=$this->Guest_model->get_hotel_guest_data($booking_id,$room_no);\n\t\t$i=0;\n\t\twhile($i<count($guest_data))\n\t\t{\n\t\t\t$room_number =$guest_data[$i]->sb_guest_allocated_room_no;\n\t\t\t\n\t\t\t$customer_orders=$this->Guest_model->get_hotel_guest_orders($booking_id,$room_number);\n\t\t\t$count =0;\n\t\t\t$total_amount =0;\n\t\t\t\n\t\t\twhile($count < count($customer_orders))\n\t\t\t{\n\t\t\t\t$total_amount = $total_amount + ($customer_orders[$count]->quantity * $customer_orders[$count]->price);\n\t\t\t\t$count++;\n\t\t\t}\n\t\t\t$guest_data[$i]->customer_orders=$customer_orders;\n\t\t\t$guest_data[$i]->total_amount=$total_amount;\n\t\t\t$i++;\n\t\t}\n\t\t$this->data['guest_data']=$guest_data;\n\t\t$this->template->load('page_tpl','hotel_checkout_bill_vw',$this->data);\n }",
"protected function findPkSimple($key, $con)\n {\n $sql = 'SELECT `refno`, `customercode`, `locationcode`, `projectcode`, `blockrefnumber`, `payplanrefno`, `nofinstallments`, `description`, `installamount`, `totalpayable`, `paymentduedate`, `agrementstartdate`, `agrementfinishdate`, `saletype`, `salerightoff_amt`, `salerightoff_status`, `salerightoff_comment`, `deleted`, `addedby`, `addeddate`, `addedtime`, `lastmodifiedby`, `lastmodifieddate`, `lastmodifiedtime`, `deletedby`, `deleteddate`, `deletedtime` FROM `sales` WHERE `refno` = :p0';\n try {\n $stmt = $con->prepare($sql);\n $stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n $stmt->execute();\n } catch (Exception $e) {\n Propel::log($e->getMessage(), Propel::LOG_ERR);\n throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n }\n $obj = null;\n if ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n $obj = new Sales();\n $obj->hydrate($row);\n SalesPeer::addInstanceToPool($obj, (string) $key);\n }\n $stmt->closeCursor();\n\n return $obj;\n }"
] | [
"0.5870783",
"0.5624061",
"0.557053",
"0.55427957",
"0.5504598",
"0.5394858",
"0.53721106",
"0.5346218",
"0.5271183",
"0.524493",
"0.52289087",
"0.5209744",
"0.52030426",
"0.518478",
"0.5180123",
"0.5179683",
"0.5164596",
"0.5148611",
"0.5147641",
"0.51437455",
"0.51294464",
"0.51184577",
"0.5112341",
"0.5107514",
"0.5083253",
"0.50795484",
"0.50795484",
"0.50795484",
"0.5071682",
"0.50592434"
] | 0.6311565 | 0 |
/ get room plan summary for popup summary info | public static function getRoomPlanSummary($rpid)
{
global $cookie;
$iso = Language::getIsoById((int)$cookie->LanguageID);
$sql = "
SELECT RoomPlanId, RoomSize, RoomPlanName_".$iso." as RoomPlanName, RoomPlanDescription_".$iso." as RoomPlanDescription
FROM HT_RoomPlan
WHERE RoomPlanId = {$rpid}
";
$roomplan_summary = Db::getInstance()->getRow($sql);
$sql = "
SELECT B.*
FROM HT_RoomPlanRoomFileLink as A, HT_RoomFile as B
WHERE A.`RoomPlanId` = {$rpid} AND B.`RoomFileId` = A.`RoomFileId`
ORDER BY A.ShowOrder ASC
";
$results = Db::getInstance()->ExecuteS($sql);
foreach ($results as $row) {
$filepath = $row['RoomFilePath'];
list($width, $height, $type, $attr) = getimagesize($filepath);
if ($width < 100 && $height < 75) {
$w2 = width; $h2 = $height;
} else {
$ratio1=$width/100;
$ratio2=$height/75;
if ($ratio1 < $ratio2) {
$w2 = 100;$h2 = intval($height / $ratio1);
} else {
$h2 = 75;$w2 = intval($width / $ratio2);
}
}
$pos = strpos($filepath, "asset");
$row['img_path'] = substr($filepath, $pos);
$row['img_width'] = $w2;$row['img_height'] = $h2;
$roomplan_summary['RelImages'][] = $row;
}
return $roomplan_summary;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function summary()\n {\n global $g_layout;\n $output = '<b>'.text(\"summary\", \"projectplan\").'</b><br><br>';\n $output.= $g_layout->data_top();\n $output.= '<tr>'.$g_layout->ret_td_datatitle();\n $output.= $g_layout->ret_td_datatitle(text(\"quotation\", \"projectplan\"));\n $output.= $g_layout->ret_td_datatitle(text(\"initial\", \"projectplan\"));\n $output.= $g_layout->ret_td_datatitle(text(\"current\", \"projectplan\"));\n $output.= $g_layout->ret_td_datatitle(text(\"planned\", \"projectplan\"));\n $output.= $g_layout->ret_td_datatitle(text(\"actual\", \"projectplan\"));\n $output.='</tr>';\n $output.='<tr class=\"row1\"><td class=\"table\">'.text(\"project_total\").'</td>';\n $output.='<td class=\"table\">'.$this->amount_format($this->m_project['fixed_price']).'</td>';\n $output.='<td class=\"table\" style=\"background-color: '.($this->m_project_totals[\"initial_amount\"]>$this->m_project[\"fixed_price\"]?COLOR_ERROR:COLOR_OK).'\">'.$this->amount_format($this->m_project_totals['initial_amount']).'</td>'; \n $output.='<td class=\"table\" style=\"background-color: '.($this->m_project_totals[\"current_amount\"]>$this->m_project_totals[\"initial_amount\"]?COLOR_ERROR:COLOR_OK).'\">'.$this->amount_format($this->m_project_totals['current_amount']).'</td>'; \n $output.='<td class=\"table\" style=\"background-color: '.($this->m_project_totals[\"planned_amount\"]>$this->m_project_totals[\"current_amount\"]?COLOR_ERROR:COLOR_OK).'\">'.$this->amount_format($this->m_project_totals['planned_amount']).'</td>';\n $output.='<td class=\"table\" style=\"background-color: '.($this->m_project_totals[\"booked_amount\"]>$this->m_project_totals[\"initial_amount\"]?COLOR_ERROR:COLOR_OK).'\">'.$this->amount_format($this->m_project_totals['booked_amount']).'</td>';\n $output.='</tr>';\n $output.= $g_layout->data_bottom();\n return $output;\n }",
"function getSummary();",
"function getSummary()\n {\n }",
"private function summary()\n {\n $summary = new Summary();\n $summary = $summary->findSummaryAuth();\n $text = empty($summary) ? \"\" : \"<br><br><strong>Resumo</strong><br>\"; \n $text .= empty($summary->description) ? '' : ' '.$summary->description;\n return $text;\n }",
"public function getSummary();",
"public function getSummary();",
"public function getMySummaryAction()\n {\n\t\t$temp = array();\n\t\t$striped_prof_exp = strip_tags(Auth_UserAdapter::getIdentity()->getProfessional_exp());\n\t\t$striped_prof_goals = strip_tags(Auth_UserAdapter::getIdentity()->getProfessional_goals());\n \t$temp['exp'] = $striped_prof_exp;\n \t$temp['goals'] = $striped_prof_goals;\n \tif($temp)\n \t\techo Zend_Json::encode($temp);\n \telse\n \t\techo Zend_Json::encode(0);\n \tdie;\n }",
"function info()\n {\n $output = '<b>'.text(\"info\", \"projectplan\").'</b><br><br>';\n $output.= '<table border=\"0\"><tr><td class=\"table\">'.text(\"project\").': </td><td class=\"table\">'.$this->m_project[\"name\"].'</td></tr>';\n $output.= '<tr><td class=\"table\">'.text(\"coordinator\").': </td><td class=\"table\">'.$this->m_project[\"coordinator\"].'</td></tr>';\n $output.= '</table>';\n return $output;\n }",
"function get_summary_text()\n\t{\n\t\treturn $this->ulica . ' - ' . $this->title;\n\t}",
"public function getSummary(){\n return $this->getParameter('summary');\n }",
"public function get_summary() {\n return $this->summary;\n }",
"public function get_summary() {\n return $this->summary;\n }",
"public function getOppoSummary()\r\n {\r\n return $this->get(self::_OPPO_SUMMARY);\r\n }",
"public function summary()\n {\n // @todo: Display summary\n }",
"public function getSummary()\n {\n return $this->summary;\n }",
"public function getSummary()\n {\n return $this->summary;\n }",
"public function getSummary()\n {\n return $this->summary;\n }",
"public function getSummary()\n {\n return $this->summary;\n }",
"public function getSummary()\n {\n return $this->summary;\n }",
"public function getSummaryAction()\n {\n $this->saveAjax('module-summary');\n $name = $this->params()->fromPost('name');\n\n $directory = Pi::service('module')->directory($name);\n $callback = sprintf(\n 'Module\\\\%s\\Dashboard::summary',\n ucfirst($directory)\n );\n if (is_callable($callback)) {\n $content = call_user_func($callback, $name);\n } else {\n $content = '';\n }\n\n return $content;\n }",
"public function wweSmPlanNotice()\n {\n $planRefreshUrl = $this->getPlanRefreshUrl();\n return $this->dataHelper->wweSmallSetPlanNotice($planRefreshUrl);\n }",
"function showSummary () {\r\n\r\n\t\t//echo $GLOBALS['totalSolved'];\r\n\t\t//echo $GLOBALS['totalPoints'];\r\n\r\n\r\n\t\t$GLOBALS['moo'] .= '<table class =\"table\" text-centered><tbody>';\r\n\t\t$GLOBALS['moo'] .= '<tr><td colspan = \"\"><h2><center>Totals</center></h2></td>';\r\n\t\t$GLOBALS['moo'] .= '<tr><td colspan=\"\"><center>Score: '.$GLOBALS['totalSolved'].'/'.$GLOBALS['totalPoints'];\r\n\t\t$GLOBALS['moo'] .= ' = '. floor(100*$GLOBALS['totalSolved']/$GLOBALS['totalPoints']).'%.</center>';\r\n\t\t$GLOBALS['moo'] .= '</td><tr></tbody></table><br>';\r\n\r\n\t}",
"private function buildDisplaySummary()\r\n\t{\r\n\t\tif ($this->displayMode == 'TEXT') {\r\n\t\t\t//TODO: Format for text\r\n\t\t} else {\r\n\t\t\t//TODO: Format for html\r\n\t\t}\r\n\t}",
"public function getSummary()\r\n {\r\n return Language::getString(\"GridBandSummary\");\r\n }",
"public function summary()\n {\n return $this->_summary;\n }",
"public function getSummary()\n\t\t{\n\t\t\treturn $this->getAttribute(\"summary\");\n\t\t}",
"function summary()\r\n {\r\n $this->_f3->set('title', 'Summary');\r\n\r\n //Save the cart and orders to the database\r\n $cartId = $GLOBALS['dataLayer']->saveCart($_SESSION['cart']);\r\n $this->_f3->set('cartId', $cartId);\r\n\r\n //Display the second orders form\r\n $view = new Template();\r\n echo $view->render('views/summary.html');\r\n\r\n //This might be problematic\r\n unset($_SESSION['orders']);\r\n }",
"public function getSummary(): ?string;",
"public function getDetails();",
"public function getDetails();"
] | [
"0.6392829",
"0.63558096",
"0.62249243",
"0.6221302",
"0.6165329",
"0.6165329",
"0.61147445",
"0.59212345",
"0.59003216",
"0.5834832",
"0.58108616",
"0.58108616",
"0.58048946",
"0.57734734",
"0.5746882",
"0.5746882",
"0.5746882",
"0.5746882",
"0.5746882",
"0.5660731",
"0.56373966",
"0.55907667",
"0.55639803",
"0.5561945",
"0.5560678",
"0.555694",
"0.5541318",
"0.5540216",
"0.5539778",
"0.5539778"
] | 0.6408068 | 0 |
Destroys the bid with the given id. | public function destroy(int $id)
{
$bid = Bid::find($id);
/** @var Bid|null $bid */
if ($bid !== null && $bid->isMadeBy(auth()->user())) {
$bid->delete();
}
return back();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function destroy($id)\n {\n $bid = Bid::findOrFail($id);\n $bid->delete();\n\n return redirect()->route('bids.index');\n }",
"public function destroy($id)\n {\n Bank::whereId($id)->delete();\n }",
"public function destroy($id)\n {\n AuctionItem::find($id)?->delete(); \n return back();\n }",
"public function destroy($id)\n {\n $this->repository->find($id)->delete();\n }",
"public function destroy($id)\n {\n //数据删除\n try {\n PBrand::destroy($id);\n Log::info('删除成功');\n return Y::success('删除成功');\n } catch (\\Exception $e) {\n Log::error($e);\n return Y::error('删除失败');\n }\n }",
"public function destroy($id)\n {\n $this->command->destroy($id);\n }",
"public function destroy($id)\n\t{\n\t\t$bank = $this->repo->findOrFail($id);\n\n\t\tif ($this->repo->destroy($id)) {\n\t\t\treturn $this->rest->response(202, $bank);\n\t\t}\n\n\t\treturn $this->response->errorBadRequest();\n\t}",
"public function destroy($id)\n {\n $item = Item::find($id);\n $item->delete();\n }",
"public function destroy($id)\n {\n $bidsHistory = $this->bidsHistoryRepository->findWithoutFail($id);\n\n if (empty($bidsHistory)) {\n Flash::error('Bids History not found');\n return redirect(route('admin.bidsHistories.index'));\n }\n\n $this->bidsHistoryRepository->delete($id);\n\n Flash::success('Bids History deleted successfully.');\n return redirect(route('admin.bidsHistories.index'));\n }",
"public function destroy($id)\n {\n //\n $bill = Bill::find($id);\n\n if($bill->delete()){\n Session::flash(\"success_message\",\"Record Successfully deleted\");\n\n echo \"Company Successfully Deleted\";\n exit;\n }\n }",
"public function destroy($id)\n {\n OwnLibrary::validateAccess($this->moduleId,4);\n $budget_codes = BudgetCode::find($id);\n \n if ($budget_codes->delete()) {\n Session::flash('success', 'Budget Code Deleted Successfully');\n return Redirect::to('budget_code/view');\n } else {\n Session::flash('error', 'Budget Code Not Found');\n return Redirect::to('budget_code/view');\n }\n }",
"public function destroy($id)\n\t\t{\n\t\t\t\t//\n\t\t}",
"public function destroy($id)\n {\n //\n $item = Item::find($id);\n $item->delete();\n }",
"public function destroy($id)\n {\n $class = $this->class->find($id);\n $class->delete();\n }",
"public function destroy($id) {\n return Jsend::compile(self::delete('Offer', $id));\n }",
"public function destroy($id)\n\t{\n\n\t\t//\n\t}",
"public function destroy($id) {\n\t\t\t//\n\t\t}",
"public function destroy($id)\r\n\t{\r\n\t\t$this->sh->destroy($id);\r\n\t}",
"public function destroy($id)\n {\n //商品,品牌的关联\n $count=DB::table('goods')->where('bid', $id)->count();\n if(!empty($count)){\n return response()->json(['msg' => -1,'info'=>'无法删除,已被商品使用']);\n }\n //\n DB::beginTransaction();\n try{\n DB::table('cfg_brand')->where('bid', $id)->delete();\n DB::table('brand_category_rela')->where('brand_id', $id)->delete();\n DB::commit();\n return response()->json([\n 'msg' => 1\n ]);\n\n }catch (\\Exception $exception){\n Log::error($exception->getMessage());\n DB::rollBack();\n return response()->json([\n 'msg' => 0\n ]);\n }\n\n }",
"public function destroy($id)\n {\n $delete = ShopAddBankEntry::where('bankId',$id)->delete();\n }",
"public function destroy($id)\r\n\t{\r\n\t\t//\r\n\t}",
"public function destroy($id)\r\n\t{\r\n\t\t//\r\n\t}",
"public function destroy($id)\r\n\t{\r\n\t\t//\r\n\t}",
"public function destroy($id)\n {\n $amount = Amount::find($id);\n\n if ( $amount && $amount->delete() )\n {\n\n }\n }",
"public function destroy($id)\n {\n Bid::findOrFail($id)->delete();\n\n return back();\n }",
"public function destroy( $id ) {\n\t\t//\n\t}",
"public function destroy( $id ) {\n\t\t//\n\t}",
"public function destroy( $id ) {\n\t\t//\n\t}",
"public function destroy($id)\n\t{\n\t\t//\n\t}",
"public function destroy($id)\n\t{\n\t\t//\n\t}"
] | [
"0.73326826",
"0.705866",
"0.7016757",
"0.6906484",
"0.68780386",
"0.6836938",
"0.68028605",
"0.6791109",
"0.6787107",
"0.6785358",
"0.6766821",
"0.67661685",
"0.6765286",
"0.6761565",
"0.6750896",
"0.6749675",
"0.6740061",
"0.67371714",
"0.67361194",
"0.6715985",
"0.67144734",
"0.67144734",
"0.67144734",
"0.67044824",
"0.67043906",
"0.66953695",
"0.66953695",
"0.66953695",
"0.6694098",
"0.6694098"
] | 0.71122843 | 1 |
To get the inventory for available products to allocate it for the given order. | public function get_inventory($db_conn, $order) {
$inventory = array();
mysqli_autocommit($db_conn, false);
$sql_command = '';
foreach($order->Lines as $product) {
$sql_command .= "SELECT product_code, available_qty FROM products WHERE product_code = '" . $product->Product . "' AND available_qty > 0 AND is_active = 1 FOR UPDATE;";
}
if (mysqli_multi_query($db_conn,$sql_command))
{
do {
if ($result = mysqli_store_result($db_conn)) {
while ($result_arr = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
$inventory[$result_arr['product_code']] = $result_arr['available_qty'];
}
mysqli_free_result($result);
}
} while (mysqli_next_result($db_conn));
}
return $inventory;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function allocate_inventory($inventory, $order) {\n\t\t$order_details_arr = array();\n\t\t$total_alloted_qty = 0;\n\t\tforeach($order->Lines as $line) {\n\t\t\t$ordered_qty = $line->Quantity;\n\t\t\t$alloted_qty = 0;\n\t\t\t$backordered = 0;\n\t\t\t$available_qty = 0;\n\t\t\t\n\t\t\tif (array_key_exists($line->Product, $inventory)) {\n\t\t\t\t$available_qty = $inventory[$line->Product];\n\t\t\t}\n\t\t\t\n\t\t\tif ($available_qty > 0 && $available_qty >= $ordered_qty) {\n\t\t\t\t$alloted_qty = $ordered_qty;\n\t\t\t} else if ($available_qty > 0 && $ordered_qty > $available_qty) {\n\t\t\t\t$alloted_qty = $available_qty;\n\t\t\t\t$backordered = $ordered_qty - $available_qty;\n\t\t\t} else {\n\t\t\t\t$backordered = $ordered_qty;\n\t\t\t}\n\t\t\t$total_alloted_qty += $alloted_qty;\n\t\t\t$order_details = new OrderDetails($line->Product, $ordered_qty, $alloted_qty, $backordered);\n\t\t\tarray_push($order_details_arr, $order_details);\n\t\t}\n\t\t$processed_order = new OrderHeader($order->Header, $order_details_arr, $total_alloted_qty);\n\t\treturn $processed_order;\n\t}",
"protected function purchasedItems(Request $request, Order $order) :array{\n $orderItems = ArrayHelper::lvl1_formatter($request->all());\n $items = [];\n foreach($orderItems as $key => $item){\n if(!isset($item['product'])){\n break;\n }\n $inventory = Product::find($item['product'])->inventory;\n $items[$key] = [\n 'order_id' => $order->id,\n 'inventory_id' => $inventory->id,\n 'quantity' => $item['quantity'],\n 'amount' => $inventory->price * ($inventory->product->is_rental ? $this->rentDays : 1),\n 'is_addon' => $item['addon'] ? 1 : 0,\n 'delivery_date' => date('Y-m-d', strtotime($order->delivery_date)),\n 'pickup_date' => date('Y-m-d', strtotime($order->pickup_date))\n ];\n }\n return $items;\n }",
"public function getProductsToPrepareAndSupply($orderId) {\n return response()->json(Inventory::getProductsToPrepareAndSupply($orderId));\n }",
"function check_order_inventory ( $order_id, $warehouse_id, &$order_products, $for_reallocation = false ) {\n\t\t$result = $this->db->query(CHECK_ORDER_INVENTORY, array($order_id, $warehouse_id, (($for_reallocation)?CHECK_ORDER_INVENTORY_FOR_REALLOCATION:CHECK_ORDER_INVENTORY_FOR_ALLOCATION)));\n\t\t$parameters = array($order_id, $warehouse_id, \n\t\t\t(($for_reallocation)?CHECK_ORDER_INVENTORY_FOR_REALLOCATION:CHECK_ORDER_INVENTORY_FOR_ALLOCATION)\n\t\t);\n\t\t\n\t\t$order_products = array();\n\t\t$k = $op_result->num_rows;\n\t\t\n\t\t$enough = true;\n\t\twhile (false != ($row = $result->fetch())) {\n\t\t\t$order_products[$row['order_product_id']] = $row;\n\t\t\tif ($row['backorder']) {\n\t\t\t\t$enough = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $enough;\n\t}",
"public function getAvailableInventoryAttribute(){\n // if deliveredVariantQuantity is not loaded already, let's do it first\n if ( ! $this->relationLoaded('deliveredVariantQuantity')) \n $this->load('deliveredVariantQuantity');\n \n $variant_count = $this->getRelation('deliveredVariantQuantity');\n $delivered_variant = ($variant_count) ? (int) $variant_count->aggregate : 0;\n\n // if fulfilledOrders is not loaded already, let's do it first\n if ( ! $this->relationLoaded('fulfilledOrders')) \n $this->load('fulfilledOrders');\n \n $order_count = $this->getRelation('fulfilledOrders');\n $orders = ($order_count) ? (int) $order_count->aggregate : 0;\n\n return $this->inventory + $delivered_variant - $orders;\n }",
"private function reservePendingOrders()\n { \n // 1\n $pending_order_products = \\App\\Models\\OrderProduct::with('order')->pending()->get()\n ->sortByDesc(function($pending_order_product){\n return $pending_order_product->order->created;\n });\n\n $order_reservations = collect([]);\n\n foreach ($pending_order_products as $pending_order_product) {\n $order_reservations->push(Order::reserveProduct($pending_order_product));\n }\n\n return $order_reservations;\n }",
"public function getForOrder($order)\n {\n $unavailableProducts = [];\n foreach ($order->getItemsCollection($this->salesConfig->getAvailableProductTypes(), false) as $orderItem) {\n /** @var \\Magento\\Sales\\Model\\Order\\Item $orderItem */\n if (!$this->orderedProductAvailabilityChecker->isAvailable($orderItem)) {\n $unavailableProducts[] = $orderItem->getSku();\n }\n }\n return $unavailableProducts;\n }",
"private static function getItemsFromOrder(WC_Order $order){\r\n\t\t$currency = get_woocommerce_currency();\r\n\t\t$items = $order->get_items();\r\n\t\t$itemList = new ItemList();\r\n\t\t$itemArray = array();\r\n\t\tforeach($items as $item => $meta){\r\n\t\t\t$product = $order->get_product_from_item($meta);\r\n\t\t\tself::$product_ids[$product->id][] = $product;\r\n\t\t}\r\n\t\tforeach(self::$product_ids as $product_id => $array){\r\n\t\t\t$paypalItem = new Item();\r\n\t\t\t$quantity = count($array);\r\n\t\t\t$paypalItem->setName($array[0]->get_title());\r\n\t\t\t$paypalItem->setQuantity($quantity);\r\n\t\t\t$paypalItem->setCurrency($currency);\r\n\t\t\t$paypalItem->setSku($array[0]->get_sku());\r\n\t\t\t$paypalItem->setPrice($array[0]->get_price());\r\n\t\t\t$itemArray[] = $paypalItem;\r\n\t\t}\r\n\t\t$itemList->setItems($itemArray);\r\n\t\treturn $itemList;\r\n\t}",
"private function getOrderProducts()\n {\n return $this->order->products()->get();\n }",
"public function addOrderProducts() {\n \n }",
"private function getItems()\n {\n $result = array();\n\n $attributesByProduct = array();\n foreach ($this->order['attributes'] as $attribute) {\n $attributesByProduct[$attribute['orders_products_id']][]\n = $attribute;\n }\n\n foreach ($this->order['products'] as $product) {\n $name = $product['products_name'];\n foreach (\n $attributesByProduct[$product['orders_products_id']] as\n $attribute\n ) {\n $name .= \", {$attribute['products_options']}: {$attribute['products_options_values']}\";\n }\n\n $item = new ShopgateExternalOrderItem();\n $item->setItemNumber($product['products_id']);\n $item->setItemNumberPublic($product['products_model']);\n $item->setName($name);\n $item->setQuantity($product['products_quantity']);\n $item->setTaxPercent($product['products_tax']);\n $item->setUnitAmountWithTax($product['products_price']);\n $item->setCurrency($this->order['currency']);\n\n $result[] = $item;\n }\n\n return $result;\n }",
"protected function _gatherOrderItemsData()\n {\n $itemsData = [];\n if ($this->_coreRegistry->registry('current_order')) {\n foreach ($this->_coreRegistry->registry('current_order')->getItemsCollection() as $item) {\n $itemsData[$item->getId()] = [\n 'qty_shipped' => $item->getQtyShipped(),\n 'qty_returned' => $item->getQtyReturned(),\n ];\n }\n }\n $this->setOrderItemsData($itemsData);\n }",
"private function prepareItems(Order $order) : array\n {\n $items = array();\n /**\n * @var $item OrderItem\n */\n foreach ($order->getAllVisibleItems() as $item) {\n $items[$item->getId()] = $item->getQtyOrdered();\n }\n return $items;\n }",
"public function getSellableInventoryAttribute(){\n if ( ! $this->relationLoaded('deliveredVariantQuantity')) \n $this->load('deliveredVariantQuantity');\n \n $variant_count = $this->getRelation('deliveredVariantQuantity');\n $delivered_variant = ($variant_count) ? (int) $variant_count->aggregate : 0;\n\n // if fulfilledOrders is not loaded already, let's do it first\n if ( ! $this->relationLoaded('fulfilledOrders')) \n $this->load('fulfilledOrders');\n \n $order_count = $this->getRelation('fulfilledOrders');\n $orders = ($order_count) ? (int) $order_count->aggregate : 0;\n\n // if pendingOrders is not loaded already, let's do it first\n if ( ! $this->relationLoaded('pendingOrders')) \n $this->load('pendingOrders');\n\n $pending_orders = $this->getRelation('pendingOrders');\n $pending_orders = ($pending_orders) ? (int) $pending_orders->aggregate : 0;\n\n return $this->inventory + $delivered_variant - $orders - $pending_orders;\n }",
"public function available(OrderInterface $order);",
"public function available(OrderInterface $order);",
"protected function _getItemQtys($order) {\n $data = $this->getRequest()->getParam('shipment');\n $shipItems = array();\n if (isset($data['items'])) {\n $qtys = $data['items'];\n } else {\n $qtys = array();\n }\n \n if(count($qtys)){\n foreach($qtys as $itemId=>$qty) {\n $item = $order->getItemById($itemId);\n if($parentItem = $item->getParentItem()){\n $shipItems[$parentItem->getId()] = $qty;\n } else {\n $shipItems[$item->getId()] = $qty;\n }\n }\n }\n return $shipItems;\n }",
"public static function getAllInventory()\n {\n $collection = Products::getProducts();\n $products = [];\n\n for ($i = 0; $i < count($collection); $i++) {\n if ($collection[$i]['stock'] == 0)\n $collection[$i]['status'] = 'OUT OF STOCK';\n else if ($collection[$i]['stock'] < $collection[$i]['min_stock'])\n $collection[$i]['status'] = 'LAST UNITS';\n else\n $collection[$i]['status'] = 'ALL GOOD';\n\n array_push($products, [\n 'product_id' => $collection[$i]['product_id'],\n 'description' => $collection[$i]['description'],\n 'min_stock' => $collection[$i]['min_stock'],\n 'max_stock' => $collection[$i]['max_stock'],\n 'stock' => $collection[$i]['stock'],\n 'warehouse_section' => $collection[$i]['warehouse_section'],\n 'status' => $collection[$i]['status']\n ]);\n }\n\n $status = array_column($products, 'status');\n array_multisort($status, SORT_DESC, $products);\n\n return $products;\n }",
"public function getPurchasedItems();",
"protected function getOrderItemData($order)\n {\n $itemsData = [];\n foreach ($order->getItemsCollection() as $item) {\n /* @var $item \\Magento\\Sales\\Model\\Order\\Item */\n $productType = 'produit';\n $packType = '';\n $product = $item->getProduct();\n $puNTTC = $item->getPriceInclTax();\n $puBTTC = $item->getBaseOriginalPrice();\n $maintenanceKm = null;\n\n if ($item->getProductType() == \\Avatacar\\Catalog\\Helper\\Data::PRODUCT_TYPE_ID_CONFIGURABLE) {\n $productType = 'pack';\n $packType = $item->getSku();\n $puBTTC = $item->getPriceInclTax();\n } elseif (!in_array($item->getProductType(), $this->productTypeFilter)) {\n $productType = 'pack';\n $packType = $item->getSku();\n //Calculate unit prices for bundle products.\n $tmpPuBTTC = $this->getBundleItemBrutPrice($item->getId(), $order, true);\n $tmpPuNTTC = $this->getBundleItemNetPrice($item->getId(), $order, true);\n $puBTTC = $tmpPuBTTC ? $tmpPuBTTC : $puBTTC;\n $puNTTC = $tmpPuNTTC ? $tmpPuNTTC : $puNTTC;\n } elseif ($item->getProductType() == \\Avatacar\\DynamicBundle\\Model\\Product\\Type::TYPE_CODE) {\n $productType = 'service';\n $puBTTC = $item->getBasePriceInclTax();\n $data = $item->getAdditionalData();\n if (!empty($data) && $data = unserialize($data)) {\n if (!empty($data['maintenance_plan'])) {\n $maintenanceKm = $data['maintenance_plan']['kms'];\n }\n }\n\n } elseif ($item->getParentItemId() && !$puBTTC) {\n $puBTTC = $item->getPriceInclTax() - $item->getDiscountAmount();\n } elseif ($item->getParentItemId() && $item->getDiscountAmount() > 0) {\n //If line has discount, we have to set the NTTC price by dividing discount by qtyOrdered.\n $puNTTC = $item->getPriceInclTax() - ( $item->getDiscountAmount() / $item->getQtyOrdered() );\n }\n $additionalData = unserialize($item->getAdditionalData());\n $taxeRate = $this->taxCalculation->getCalculatedRate(\n $product->getTaxClassId(),\n $order->getCustomerId(),\n $order->getStoreId()\n );\n $fournisseurLabel = '';\n if ($additionalData && isset($additionalData['fournisseur'])) {\n $fournisseurLabel = $additionalData['fournisseur'];\n } elseif ($product->getFournisseur()) {\n $fournisseurLabel = $product->getFournisseur();\n }\n\n if (!$puNTTC && $product->getFinalPrice()) {\n $puNTTC = $product->getFinalPrice();\n }\n\n if (!$puBTTC && $product->getFinalPrice()) {\n $puBTTC = $product->getFinalPrice();\n }\n\n $itemData = [\n 'type' => $productType,\n 'packType' => $packType,\n 'logCode' => $additionalData && isset($additionalData['logId']) ? $additionalData['logId'] : '',\n 'sku' => $product->getSku(),\n 'ean' => $product->getEan(),\n 'reference' => $product->getReference(),\n 'fournisseurLabel' => $fournisseurLabel,\n 'nom' => $item->getName(),\n 'quantite' => $item->getQtyOrdered(),\n 'paHT' => $product->getCost(),\n 'puBTTC' => $puBTTC,\n 'puNTTC' => $puNTTC,\n 'coeffTva' => $taxeRate / 100,\n 'fdpAchatHT' => $product->getPortpaht(),\n 'fdpTTC' => $item->getFraisDePort(),\n 'fddTTC' => '',\n 'anomalie' => '',\n 'estFacturable' => '',\n 'decalageRdv' => $additionalData && isset($additionalData['decalage_rdv']) ?\n $additionalData['decalage_rdv'] :\n '',\n 'temps_prestation' => $item->getProduct()->getTempsPrestation(),\n ];\n $promotionData = $this->getPromotionDataForItem($item, $order);\n $itemData['promotions'] = $promotionData;\n\n if (!empty($maintenanceKm)) {\n $itemData['planRevisionConstructeur'] = $maintenanceKm;\n }\n\n if (isset($itemsData[$item->getParentItemId()])) {\n $itemsData[$item->getParentItemId()]['items'][] = $itemData;\n if (!empty($itemsData[$item->getParentItemId()]['promotions'])) {\n $itemsData[$item->getParentItemId()]['promotions'][0]['montantRemise']\n += $item->getDiscountAmount();\n }\n } else {\n $itemsData[$item->getId()] = $itemData;\n\n $itemProductOption = $this->getItemProductOptionData($item, $taxeRate);\n if (!empty($itemProductOption)) {\n $itemsData[$item->getId()]['items'][] = $itemProductOption;\n }\n }\n }\n return $itemsData;\n }",
"public function getProductsToPrepare() {\n\n $products = $this->setProductsToPrepare(Inventory::getProductsToPrepare());\n\n return response()->json($products);\n }",
"public function getAvailablePaymentProducts($amount, $currencyCode, $countryCode, $locale, $scopeId);",
"public function getproduct(Request $request)\n {\n $id = $request->order_id;\n $order = Order::findOrFail($id);\n $cart = CartOrder::with('product')->where('status', 0)->where('status_admin', 1)->where('order_id', $order->id)->get();\n return CardProductCollection::collection($cart);\n }",
"function available_quantity_array () {\n\t\tif($this->number_inserted ($this->id)==0) return -1;\n\t\t\n\t\t$dish=new dish($this->id);\n\t\t$dish->fetch_data();\n\t\t\n\t\t$avail=array();\n\t\t\n\t\t$ingreds = $dish->ingredients();\n\t\t\n\t\tforeach ($ingreds as $ingred_id) {\n\t\t\t$ingred = new ingredient ($ingred_id);\n\t\t\t\n\t\t\t$stock = new stock_object;\n\t\t\tif ($stock_id=$stock->find_external($ingred_id, TYPE_INGREDIENT)) {\n\t\t\t\t$stock = new stock_object ($stock_id);\n\t\t\t\t$qty = new stock_ingredient_quantity;\n\t\t\t\tif($qty_id=$qty->find ($stock_id,$this->id)) {\n\t\t\t\t\t$qty = new stock_ingredient_quantity ($qty_id);\n\t\t\t\t\tif($qty->data['quantity']!=0) $avail[$ingred_id] = $stock->data['quantity']/$qty->data['quantity'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $avail;\n\t}",
"function getOrderedQuantity();",
"public function actionCalculateInventory()\n\t{\n\t\t//First, run our request_url creation if needed\n\t\t$matches = Product::RecalculateInventory();\n\n\t\tif ($matches>0)\n\t\t\treturn array('result'=>\"success\",'makeline'=>48,'tag'=>'Calculating available inventory '.$matches.' products remaining','total'=>50);\n\t\telse\n\t\t{\n\t\t\treturn array('result'=>\"success\",'makeline'=>49,'tag'=>'Final cleanup','total'=>50);\n\n\t\t}\n\n\n\t}",
"public function getInventory($options) {\n try {\n if ($options instanceof InventoryOptions) {\n $options = $options->toArray();\n }\n\n $response = $this->client->guzzle()->get('/v1/inventory', [\n 'headers' => [\n 'Accept' => 'application/json',\n 'Authorization' => 'Bearer ' . $this->client->auth()->get(),\n ],\n 'query' => $options\n ]);\n\n if ($response->getStatusCode() !== 200) {\n throw new ProductException($response->getBody(), $response->getStatusCode());\n }\n\n return json_decode($response->getBody(), true);\n } catch (Exception $ex) {\n throw new ProductException($ex->getMessage(), $ex->getCode());\n }\n }",
"public function getOrderitems()\n {\n return $this->hasMany(Orderitems::className(), ['productId' => 'productId']);\n }",
"function get () {\n // PARAM $id : order ID\n\n $orderid = $this->fetch(\n \"SELECT order_id FROM orders ORDER BY order_id DESC LIMIT 1\"\n );\n\n $id =$orderid[0]['order_id'];\n\n $order = $this->fetch(\n \"SELECT * FROM `orders` WHERE `order_id`=?\", [$id]\n );\n $order['items'] = $this->fetch(\n \"SELECT * FROM `orders_items` LEFT JOIN `products` USING (`product_id`) WHERE `orders_items`.order_id=?\",\n [$id], \"product_id\"\n );\n return $order;\n }",
"public function seachItemPurchase(Request $request){\n return m_itemm::seachItemPurchase($request);\n }"
] | [
"0.71540606",
"0.6413934",
"0.64037806",
"0.63486904",
"0.6240027",
"0.615978",
"0.61276865",
"0.5986803",
"0.5944089",
"0.5936924",
"0.592246",
"0.58396494",
"0.5826505",
"0.5817482",
"0.57443297",
"0.57443297",
"0.57440424",
"0.5735882",
"0.57271963",
"0.5708027",
"0.56754994",
"0.5649864",
"0.5605835",
"0.5604284",
"0.5599369",
"0.5595096",
"0.55767196",
"0.55739814",
"0.55308",
"0.55264026"
] | 0.70858467 | 1 |
To update the inventory for the allocated order. | public function update_inventory($db_conn, $order_info) {
foreach($order_info->OrderDetails as $product) {
if ($product->AllotedQty > 0) {
$sql_command = "UPDATE products SET available_qty = available_qty - " . $product->AllotedQty . ", ordered_qty = ordered_qty + " . $product->AllotedQty . " WHERE product_code = '" . $product->ProductCode . "';";
$result = $db_conn->multi_query($sql_command);
if (!$result) {
throw new Exception ("Inventory Update Error: " . mysqli_errno($db_conn) . ' - ' . mysqli_error($db_conn));
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function update(Request $request, Order $order)\n {\n $order->update($request->all());\n foreach ($request->order_items as $key => $item) {\n $product = Product::find($item['product_id']);\n $order->order_items[$key]->update([\n \"product_id\" => $product->id,\n 'quantity' => $item['quantity'],\n 'price' => $product->price\n ]);\n $currentStock = $product->stock - $item['quantity'];\n $product->update(['stock' => $currentStock]);\n }\n return response()->json(new OrderResource($order));\n }",
"public function allocate_inventory($inventory, $order) {\n\t\t$order_details_arr = array();\n\t\t$total_alloted_qty = 0;\n\t\tforeach($order->Lines as $line) {\n\t\t\t$ordered_qty = $line->Quantity;\n\t\t\t$alloted_qty = 0;\n\t\t\t$backordered = 0;\n\t\t\t$available_qty = 0;\n\t\t\t\n\t\t\tif (array_key_exists($line->Product, $inventory)) {\n\t\t\t\t$available_qty = $inventory[$line->Product];\n\t\t\t}\n\t\t\t\n\t\t\tif ($available_qty > 0 && $available_qty >= $ordered_qty) {\n\t\t\t\t$alloted_qty = $ordered_qty;\n\t\t\t} else if ($available_qty > 0 && $ordered_qty > $available_qty) {\n\t\t\t\t$alloted_qty = $available_qty;\n\t\t\t\t$backordered = $ordered_qty - $available_qty;\n\t\t\t} else {\n\t\t\t\t$backordered = $ordered_qty;\n\t\t\t}\n\t\t\t$total_alloted_qty += $alloted_qty;\n\t\t\t$order_details = new OrderDetails($line->Product, $ordered_qty, $alloted_qty, $backordered);\n\t\t\tarray_push($order_details_arr, $order_details);\n\t\t}\n\t\t$processed_order = new OrderHeader($order->Header, $order_details_arr, $total_alloted_qty);\n\t\treturn $processed_order;\n\t}",
"function updateOrd()\r\n {\r\n $sql = \"update order1 set quantity = quantity +:quantity where Service_ID=:Service_ID and Cus_ID=:Cus_ID\";\r\n $args = [':Service_ID' => $this->Service_ID, ':quantity' => $this->quantity, ':Cus_ID' => $this->Cus_ID];\r\n DB::run($sql, $args);\r\n }",
"public function updateQtyAction()\n {\n try {\n $invoice = $this->_initInvoice(true);\n // Save invoice comment text in current invoice object in order to display it in corresponding view\n $invoiceRawData = $this->getRequest()->getParam('invoice');\n $invoiceRawCommentText = $invoiceRawData['comment_text'];\n $invoice->setCommentText($invoiceRawCommentText);\n\n $this->loadLayout();\n $response = $this->getLayout()->getBlock('order_items')->toHtml();\n } catch (Mage_Core_Exception $e) {\n $response = array(\n 'error' => true,\n 'message' => $e->getMessage()\n );\n $response = Mage::helper('core')->jsonEncode($response);\n } catch (Exception $e) {\n $response = array(\n 'error' => true,\n 'message' => $this->__('Cannot update item quantity.')\n );\n $response = Mage::helper('core')->jsonEncode($response);\n }\n $this->getResponse()->setBody($response);\n }",
"public function update(Request $request, Order $order)\n {\n\t\t$total = 0;\n\t\t$item_ids = [];\n\t\t$itemIds = [];\n\t\tforeach ($request->item as $id => $amount) {\n\t\t\tif (!$amount) continue;\n\t\t\t$item = $order->menu->items->find($id);\n\t\t\t$total += $item->price*$amount;\n\t\t\t$item_ids[$id] = ['quantity' => $amount,];\n\t\t\t$itemIds[] = $id;\n\t\t}\n\t\t$request->request->add(['item_id' => $itemIds,'total' => $total,]);\n\t\t$data = $request->validate($this->rules());\n\t\tunset($data['item_id']);\n\t\t$order->update($data);\n\t\t$order->items()->sync($item_ids);\n\t\tMail::to($order->email)->send(new OrderMailer($order));\n\t\treturn redirect(route('orders.show', $order->id));\n }",
"public function testUpdateInventoryLocation()\n {\n }",
"public function increaseQuantity()\n {\n $this->setQuantity($this->getQuantity() + 1);\n $this->save();\n }",
"public function updateItems(CartInterface $quote);",
"public function update(Request $request, Client $client, Order $order) {\n $request->validate([\n 'products' => 'required|array',\n ]);\n\n $total_price = 0;\n\n foreach ($request->products as $id=>$quantity_array) {\n $product = Product::findOrFail($id);\n $orderProducts = $order->products;\n\n if ($orderProducts->contains($product)) { \n // If the product is already attached to the order\n $pivot = $orderProducts->find($id)->pivot;\n\n $productQuantity = ($quantity_array['quantity'] - $pivot->quantity);\n } else {\n // If the product is added by admins so it's not yet attached to the order \n $order->products()->syncWithoutDetaching($product);\n\n $productQuantity = $quantity_array['quantity'];\n }\n\n $product->update([\n // stock - (new - old) --> ex: 17-(2-3) / 17-(5-3)\n 'stock' => $product->stock - $productQuantity\n ]);\n\n $total_price += $product->sale_price * $quantity_array['quantity'];\n }\n\n $order->products()->sync($request->products);\n\n $order->update([\n 'total_price' => $total_price\n ]);\n\n session()->flash('success', __('site.updated_successfully'));\n\n return redirect()->route('dashboard.orders.index');\n }",
"private static function updateItems($order, $orderToUpdate)\n {\n $id_order_detail = null;\n foreach ($order['items'] as $key => $item) {\n if (isset($item['delete']) && $item['delete'] == true) {\n if (strpos($item['offer']['externalId'], '#') !== false) {\n $itemId = explode('#', $item['offer']['externalId']);\n $product_id = $itemId[0];\n $product_attribute_id = $itemId[1];\n } else {\n $product_id = $item['offer']['externalId'];\n $product_attribute_id = 0;\n }\n\n if (isset($item['externalIds'])) {\n foreach ($item['externalIds'] as $externalId) {\n if ($externalId['code'] == 'prestashop') {\n $id_order_detail = explode('_', $externalId['value']);\n }\n }\n }else {\n $id_order_detail = explode('#', $item['offer']['externalId']);\n }\n\n if (isset($id_order_detail[1])){\n $id_order_detail = $id_order_detail[1];\n }\n\n self::deleteOrderDetailByProduct($orderToUpdate->id, $product_id, $product_attribute_id, $id_order_detail);\n\n unset($order['items'][$key]);\n $ItemDiscount = true;\n }\n }\n\n /*\n * Check items quantity and discount\n */\n foreach ($orderToUpdate->getProductsDetail() as $orderItem) {\n foreach ($order['items'] as $key => $item) {\n if (strpos($item['offer']['externalId'], '#') !== false) {\n $itemId = explode('#', $item['offer']['externalId']);\n $product_id = $itemId[0];\n $product_attribute_id = $itemId[1];\n } else {\n $product_id = $item['offer']['externalId'];\n $product_attribute_id = 0;\n }\n if ($product_id == $orderItem['product_id'] &&\n $product_attribute_id == $orderItem['product_attribute_id']) {\n $product = new Product((int) $product_id, false, self::$default_lang);\n $tax = new TaxCore($product->id_tax_rules_group);\n if ($product_attribute_id != 0) {\n $prodPrice = Combination::getPrice($product_attribute_id);\n $prodPrice = $prodPrice > 0 ? $prodPrice : $product->price;\n } else {\n $prodPrice = $product->price;\n }\n $prodPrice = $prodPrice + $prodPrice / 100 * $tax->rate;\n // discount\n if (self::$apiVersion == 5) {\n $productPrice = $prodPrice - (isset($item['discountTotal']) ? $item['discountTotal'] : 0);\n } else {\n $productPrice = $prodPrice - $item['discount'];\n if ($item['discountPercent'] > 0) {\n $productPrice = $productPrice - ($prodPrice / 100 * $item['discountPercent']);\n }\n }\n $productPrice = round($productPrice, 2);\n\n if (isset($item['externalIds'])) {\n foreach ($item['externalIds'] as $externalId) {\n if ($externalId['code'] == 'prestashop') {\n $id_order_detail = explode('_', $externalId['value']);\n }\n }\n } else {\n $id_order_detail = explode('#', $item['offer']['externalId']);\n }\n\n $orderDetail = new OrderDetail($id_order_detail[1]);\n $orderDetail->unit_price_tax_incl = $productPrice;\n $orderDetail->id_warehouse = 0;\n\n // quantity\n if (isset($item['quantity']) && $item['quantity'] != $orderItem['product_quantity']) {\n $orderDetail->product_quantity = $item['quantity'];\n $orderDetail->product_quantity_in_stock = $item['quantity'];\n $orderDetail->id_order_detail = $id_order_detail[1];\n $orderDetail->id_warehouse = 0;\n }\n\n if (!isset($orderDetail->id_order) && !isset($orderDetail->id_shop)) {\n $orderDetail->id_order = $orderToUpdate->id;\n $orderDetail->id_shop = Context::getContext()->shop->id;\n $product = new Product((int) $product_id, false, self::$default_lang);\n\n $productName = htmlspecialchars(strip_tags($item['offer']['displayName']));\n\n $orderDetail->product_name = implode('', array('\\'', $productName, '\\''));\n $orderDetail->product_price = $item['initialPrice'] ? $item['initialPrice'] : $product->price;\n\n if (strpos($item['offer']['externalId'], '#') !== false) {\n $product_id = explode('#', $item['offer']['externalId']);\n $product_attribute_id = $product_id[1];\n $product_id = $product_id[0];\n }\n\n $orderDetail->product_id = (int) $product_id;\n $orderDetail->product_attribute_id = (int) $product_attribute_id;\n $orderDetail->product_quantity = (int) $item['quantity'];\n\n if ($orderDetail->save()) {\n $upOrderItems = array(\n 'externalId' => $orderDetail->id_order,\n );\n\n $orderdb = new Order($orderDetail->id_order);\n\n foreach ($orderdb->getProducts() as $item) {\n if (isset($item['product_attribute_id']) && $item['product_attribute_id'] > 0) {\n $productId = $item['product_id'] . '#' . $item['product_attribute_id'];\n } else {\n $productId = $item['product_id'];\n }\n\n $upOrderItems['items'][] = array(\n \"id\" => $key,\n \"externalIds\" => array(\n array(\n 'code' =>'prestashop',\n 'value' => $productId.\"_\".$item['id_order_detail'],\n )\n ),\n 'initialPrice' => $item['unit_price_tax_incl'],\n 'quantity' => $item['product_quantity'],\n 'offer' => array('externalId' => $productId),\n 'productName' => $item['product_name'],\n );\n }\n\n unset($orderdb);\n self::$api->ordersEdit($upOrderItems);\n }\n }\n\n $orderDetail->update();\n $ItemDiscount = true;\n unset($order['items'][$key]);\n }\n }\n }\n\n /*\n * Check new items\n */\n if (!empty($order['items'])) {\n foreach ($order['items'] as $key => $newItem) {\n $product_id = $newItem['offer']['externalId'];\n $product_attribute_id = 0;\n if (strpos($product_id, '#') !== false) {\n $product_id = explode('#', $product_id);\n $product_attribute_id = $product_id[1];\n $product_id = $product_id[0];\n }\n $product = new Product((int) $product_id, false, self::$default_lang);\n $tax = new TaxCore($product->id_tax_rules_group);\n if ($product_attribute_id != 0) {\n $productName = htmlspecialchars(\n strip_tags(Product::getProductName($product_id, $product_attribute_id))\n );\n $productPrice = Combination::getPrice($product_attribute_id);\n $productPrice = $productPrice > 0 ? $productPrice : $product->price;\n } else {\n $productName = htmlspecialchars(strip_tags($product->name));\n $productPrice = $product->price;\n }\n\n // discount\n if ((isset($newItem['discount']) && $newItem['discount'])\n || (isset($newItem['discountPercent']) && $newItem['discountPercent'])\n || (isset($newItem['discountTotal']) && $newItem['discountTotal'])\n ) {\n $productPrice = $productPrice - $newItem['discount'];\n $productPrice = $productPrice - $newItem['discountTotal'];\n $productPrice = $productPrice - ($prodPrice / 100 * $newItem['discountPercent']);\n $ItemDiscount = true;\n }\n\n if(isset($newItem['externalIds'])) {\n foreach ($newItem['externalIds'] as $externalId) {\n if ($externalId['code'] == 'prestashop') {\n $id_order_detail = explode('_', $externalId['value']);\n }\n }\n } else {\n $id_order_detail = explode('#', $item['offer']['externalId']);\n }\n\n $orderDetail = new OrderDetail($id_order_detail[1]);\n $orderDetail->id_order = $orderToUpdate->id;\n $orderDetail->id_order_invoice = $orderToUpdate->invoice_number;\n $orderDetail->id_shop = Context::getContext()->shop->id;\n $orderDetail->product_id = (int) $product_id;\n $orderDetail->product_attribute_id = (int) $product_attribute_id;\n $orderDetail->product_name = implode('', array('\\'', $productName, '\\''));\n $orderDetail->product_quantity = (int) $newItem['quantity'];\n $orderDetail->product_quantity_in_stock = (int) $newItem['quantity'];\n $orderDetail->product_price = $productPrice;\n $orderDetail->product_reference = implode('', array('\\'', $product->reference, '\\''));\n $orderDetail->total_price_tax_excl = $productPrice * $newItem['quantity'];\n $orderDetail->total_price_tax_incl = ($productPrice + $productPrice / 100 * $tax->rate) * $newItem['quantity'];\n $orderDetail->unit_price_tax_excl = $productPrice;\n $orderDetail->unit_price_tax_incl = ($productPrice + $productPrice / 100 * $tax->rate);\n $orderDetail->original_product_price = $productPrice;\n $orderDetail->id_warehouse = !empty($orderToUpdate->id_warehouse) ? $orderToUpdate->id_warehouse : 0;\n $orderDetail->id_order_detail = $id_order_detail[1];\n\n if ($orderDetail->save()) {\n $upOrderItems = array(\n 'externalId' => $orderDetail->id_order,\n );\n\n $orderdb = new Order($orderDetail->id_order);\n foreach ($orderdb->getProducts() as $item) {\n if (isset($item['product_attribute_id']) && $item['product_attribute_id'] > 0) {\n $productId = $item['product_id'] . '#' . $item['product_attribute_id'];\n } else {\n $productId = $item['product_id'];\n }\n\n $upOrderItems['items'][] = array(\n \"externalIds\" => array(\n array(\n 'code' =>'prestashop',\n 'value' => $productId.\"_\".$item['id_order_detail'],\n )\n ),\n 'initialPrice' => $item['unit_price_tax_incl'],\n 'quantity' => $item['product_quantity'],\n 'offer' => array('externalId' => $productId),\n 'productName' => $item['product_name'],\n );\n }\n\n unset($orderdb);\n self::$api->ordersEdit($upOrderItems);\n }\n\n unset($orderDetail);\n unset($order['items'][$key]);\n }\n }\n\n $infoOrd = self::$api->ordersGet($order['externalId']);\n $infoOrder = $infoOrd->order;\n $totalPaid = $infoOrder['totalSumm'];\n $orderToUpdate->total_paid = $totalPaid;\n $orderToUpdate->update();\n\n /*\n * Fix prices & discounts\n * Discounts only for whole order\n */\n if (isset($order['discount'])\n || isset($order['discountPercent'])\n || isset($order['delivery']['cost'])\n || isset($order['discountTotal'])\n || $ItemDiscount\n ) {\n $orderTotalProducts = $infoOrder['summ'];\n $deliveryCost = $infoOrder['delivery']['cost'];\n $totalDiscount = $deliveryCost + $orderTotalProducts - $totalPaid;\n $orderCartRules = $orderToUpdate->getCartRules();\n\n foreach ($orderCartRules as $valCartRules) {\n $order_cart_rule = new OrderCartRule($valCartRules['id_order_cart_rule']);\n $order_cart_rule->delete();\n }\n\n $orderToUpdate->total_discounts = $totalDiscount;\n $orderToUpdate->total_discounts_tax_incl = $totalDiscount;\n $orderToUpdate->total_discounts_tax_excl = $totalDiscount;\n $orderToUpdate->total_shipping = $deliveryCost;\n $orderToUpdate->total_shipping_tax_incl = $deliveryCost;\n $orderToUpdate->total_shipping_tax_excl = $deliveryCost;\n $orderToUpdate->total_paid = $totalPaid;\n $orderToUpdate->total_paid_tax_incl = $totalPaid;\n $orderToUpdate->total_paid_tax_excl = $totalPaid;\n $orderToUpdate->total_products_wt = $orderTotalProducts;\n $orderToUpdate->update();\n unset($ItemDiscount);\n }\n }",
"function update_quantities($order_id = false)\n {\n $order_id = intval($order_id);\n if ($order_id == false) {\n return;\n }\n $res = false;\n $ord_data = $this->get_order_by_id($order_id);\n\n $cart_data = $this->order_items($order_id);\n if (!empty($cart_data)) {\n $res = array();\n foreach ($cart_data as $item) {\n\n\n if (isset($item['rel_type']) and isset($item['rel_id']) and $item['rel_type'] == 'content') {\n\n $data_fields = $this->app->content_manager->data($item['rel_id'], 1);\n\n if (isset($item['qty']) and isset($data_fields['qty']) and $data_fields['qty'] != 'nolimit') {\n $old_qty = intval($data_fields['qty']);\n\n $new_qty = $old_qty - intval($item['qty']);\n mw_var('FORCE_SAVE_CONTENT_DATA_FIELD', 1);\n $new_qty = intval($new_qty);\n\n\n if (defined('MW_DB_TABLE_CONTENT_DATA')) {\n\n $table_name_data = MW_DB_TABLE_CONTENT_DATA;\n $notify = false;\n mw_var('FORCE_ANON_UPDATE', $table_name_data);\n $new_q = array();\n $new_q['field_name'] = 'qty';\n $new_q['content_id'] = $item['rel_id'];\n if ($new_qty > 0) {\n\n $new_q['field_value'] = $new_qty;\n\n\n } else {\n $notify = true;\n $new_q['field_value'] = '0';\n\n\n }\n $res[] = $new_q;\n $upd_qty = $this->app->content_manager->save_content_data_field($new_q);\n $res = true;\n\n if ($notify) {\n $notification = array();\n //$notification['module'] = \"content\";\n $notification['rel_type'] = 'content';\n $notification['rel_id'] = $item['rel_id'];\n $notification['title'] = \"Your item is out of stock!\";\n $notification['description'] = \"You sold all items you had in stock. Please update your quantity\";\n $notification = $this->app->notifications_manager->save($notification);\n\n }\n\n\n }\n }\n\n }\n\n\n }\n\n }\n\n\n return $res;\n }",
"public function testUpdateQty() {\n $requestData = [\n 'items' => [\n [\n 'qty' => '1',\n 'entity_id' => '19'\n ], [\n 'qty' => '1',\n 'entity_id' => '21'\n ], [\n 'qty' => '1',\n 'entity_id' => '22'\n ], [\n 'qty' => '1',\n 'entity_id' => '23'\n ], [\n 'qty' => '1',\n 'entity_id' => '25'\n ]\n ],\n 'order_id' => 'WP11513743849738'\n ];\n\n $serviceInfo = [\n 'rest' => [\n 'resourcePath' => self::RESOURCE_PATH . 'updateqty?',\n 'httpMethod' => RestRequest::HTTP_METHOD_POST,\n ]\n ];\n\n $results = $this->_webApiCall($serviceInfo, $requestData);\n \\Zend_Debug::dump($results);\n $this->assertNotNull($results);\n $this->assertGreaterThanOrEqual(\n '1',\n $results['total_count'],\n 'The results doesn\\'t have items.'\n );\n }",
"function update_order_info($order){\n }",
"public function update($host, Order $order, OrderRequest $request)\n\t{\n// dd($request);\n $attributes = $request->all();\n $updateOrder = [\n '' => $attributes,\n 'partner_id' => $attributes['partner_id'],\n 'address_id' => $attributes['address_id'],\n 'currency_id' => $attributes['currency_id'],\n 'type_id' => $attributes['type_id'],\n 'payment_id' => $attributes['payment_id'],\n 'posted_at' => $attributes['posted_at'],\n ];\n if (isset($attributes['valor_total'])) $updateOrder['valor_total'] = $attributes['valor_total'];\n if (isset($attributes['desconto_total'])) $updateOrder['desconto_total'] = $attributes['desconto_total'];\n if (isset($attributes['troco'])) $updateOrder['troco'] = $attributes['troco'];\n if (isset($attributes['descricao'])) $updateOrder['descricao'] = $attributes['descricao'];\n if (isset($attributes['referencia'])) $updateOrder['referencia'] = $attributes['referencia'];\n if (isset($attributes['obsevacao'])) $updateOrder['obsevacao'] = $attributes['obsevacao'];\n $order->update($updateOrder);\n\n //Atualizando Status\n// dd($attributes['status']);\n $this->syncStatus($order, $attributes['status']);\n\n //Atualizando os itens do pedido\n $somaTotal = 0;\n// for($i=0;$i<$this->itemCount;$i++){\n for($i=0;isset($attributes['id'.$i]);$i++) {\n if (! $attributes['quantidade'.$i]>0) {\n ItemOrder::find($attributes['id'.$i])->delete();\n continue;\n }\n// dd($attributes['id'.$i]);\n// dd(ItemOrder::find($attributes['id'.$i])->toArray());\n $updateItemOrder = [\n 'cost_id' => $attributes['cost_id'.$i],\n 'product_id' => $attributes['product_id'.$i],\n 'currency_id' => $attributes['item_currency_id'.$i],\n 'quantidade' => $attributes['quantidade'.$i],\n 'valor_unitario' => $attributes['valor_unitario'.$i],\n ];\n if (isset($attributes['desconto_unitario'.$i])) $updateItemOrder['desconto_unitario'] = $attributes['desconto_unitario'.$i];\n if (isset($attributes['descricao'.$i])) $updateItemOrder['descricao'] = $attributes['descricao'.$i];\n\n ItemOrder::find($attributes['id'.$i])->update($updateItemOrder);\n\n $somaTotal = $somaTotal+($attributes['quantidade'.$i]*$attributes['valor_unitario'.$i]);\n }\n\n $order->valor_total=$somaTotal;\n $order->save();\n\n flash()->overlay(trans('order.flash.orderUpdated', ['ordem' => $order->id]),trans('order.flash.orderUpdatedTitle'));\n return redirect(route('orders.index', $host));\n\t}",
"public function update(Request $request, Inventory $inventory)\n {\n //\n }",
"public function update(Request $request, Inventory $inventory)\n {\n //\n }",
"public function update(Request $request, Inventory $inventory)\n {\n //\n }",
"public function updateOrderAction() {\n //CHECK POST\n if ($this->getRequest()->isPost()) {\n $db = Engine_Db_Table::getDefaultAdapter();\n $db->beginTransaction();\n $values = $_POST;\n try {\n foreach ($values['order'] as $key => $value) {\t\t \n $row = Engine_Api::_()->getItem('sitereaction_reactionicon', (int) $value);\t\t\n if (!empty($row)) {\t\t\n $row->order = $key + 1;\t\t\n $row->save();\t\t\n }\t\t\n }\n $db->commit();\n $this->_redirect('admin/sitereaction/reaction');\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n }\n }",
"function update_item($key, $quantity) {\n $quantity = (int) $quantity;\n if (isset($_SESSION['cart13'][$key])) {\n if ($quantity <= 0) {\n unset($_SESSION['cart13'][$key]);\n } else {\n $_SESSION['cart13'][$key]['qty'] = $quantity;\n $total = $_SESSION['cart13'][$key]['cost'] *\n $_SESSION['cart13'][$key]['qty'];\n $_SESSION['cart13'][$key]['total'] = $total;\n }\n }\n }",
"public function update(Request $request, $id)\n {\n $order_details = Order_detail::getOrderDetailsByOrderId($id);\n DB::beginTransaction();\n try {\n foreach ($order_details as $order_detail) {\n $stock = Product_Attribute_value::getProductAttributeValueById($order_detail->product_attribute_value_id)->quantity;\n DB::table('product_attribute_values')->where('id', '=', $order_detail->product_attribute_value_id)->update([\n 'quantity' => $stock + $order_detail->quantity,\n 'updated_at' => Carbon::now()\n ]);\n Order_detail::destroy($order_detail->id);\n }\n $totals = 0;\n $totals_price = [];\n $shipfee = Shipfee::getShipfeeById($request->ship_id);\n foreach ($request->products as $index=>$product_id) {\n $product = Product::getProductById($product_id);\n if ($product->sale_price != \"\") {\n $totals = $totals + $product->sale_price * $request->quantities[$index];\n $totals_price[] = $product->sale_price * $request->quantities[$index];\n }\n else {\n $totals = $totals + $product->price * $request->quantities[$index];\n $totals_price[] = $product->price * $request->quantities[$index];\n }\n }\n $totals = $totals + $shipfee->price;\n Order::where('id', $id)->update([\n 'name' => $request->name,\n 'email' => $request->email,\n 'phone_number' => $request->phone_number,\n 'tinh_id' => $request->tinh_id,\n 'huyen_id' => $request->huyen_id,\n 'xa_id' => $request->xa_id,\n 'address' => $request->address,\n 'ship_id' => $request->ship_id,\n 'payment_method' => $request->payment_method,\n 'totals' => $totals,\n 'note' => $request->note,\n 'updated_at' => Carbon::now()\n ]);\n Order_detail::createOrderDetailsfromBE($id, $request->products, $request->product_attribute_values, $request->quantities, $totals_price);\n Mail::to($request->email)->send(new MailNotify($request->all(), $id, $request->products, $request->product_attribute_values, $request->quantities, $totals_price, $totals, [], 'update'));\n DB::commit();\n\n echo '<script>';\n echo 'alert(\"Thêm đơn hàng thành công\");';\n echo 'window.location.href=\"'.route('be.order.index').'\";';\n echo '</script>';\n\n }\n catch (\\Exception $e) {\n DB::rollBack();\n throw new Exception($e);\n }\n }",
"public function update(Request $request, $id)\n {\n $product = OrderItem::find($id);\n //return $item;\n $product->quantity = $request->input('quantity');\n $product->total = $product->quantity * $product->product_price;\n $product->save();\n $product->order->sub_total = ($product->order->sub_total - $product->product_price + $product->total);\n $product->order->total_price = ($product->order->total_price - $product->product_price + $product->total);\n $product->order->save();\n return redirect()->route('order.index')->with('message','Quantity updated');\n }",
"function updateOrder1()\r\n {\r\n $sql = \"update order1 set quantity=:quantity where Ord_ID=:order_id\";\r\n $args = [':quantity' => $this->quantity, ':order_id' => $this->Ord_ID];\r\n return DB::run($sql, $args);\r\n }",
"public function update_inventory($product_id,$qty,$refrence_id,$total, &$_costofsale,$date,$datebit){\n\n // echo 'product_id '.$product_id.\"  Quantity \".$qty.\"<br>\";\n //updated at date formate\n $updated_at=date('Y-m-d H:i:s');\n $fin=0;\n $costofsale=0;\n $fin2=0;\n $input_qty=$qty;\n $res_price=0;\n $originalqty=0;\n $wholeqty =Inventory::where('inv_product_id',$product_id)->sum('inv_qty');\n $dbcp=0;\n //getting inventories\n $inventories=Inventory::where('inv_product_id',$product_id)->get();\n foreach ($inventories as $inventory) {\n //storing inventory id in $inventory_id\n $inventory_id=$inventory->id;\n //checking if sold item quantot is less then qty available in inventory agaainst that product\n if($inventory->inv_qty > $qty && $qty != 0 || $inventory->inv_qty == $qty && $qty != 0){\n //updated qty\n $final_qty=$inventory->inv_qty-$qty;\n //updated inventory of particular product with final_qty in below query\n $dbcp=$inventory->inv_cost_price;\n DB::table('inventories')->where('id',$inventory->id)->update(['inv_qty'=>$final_qty,'updated_at'=>$updated_at]);\n\n //empting sold product qty\n $qty=$qty-$qty;\n \n }\n //checking if sold item quantot is greater then qty available in inventory agaainst that product\n elseif($inventory->inv_qty < $qty) {\n //updated qty\n $final_qty=$inventory->inv_qty-$inventory->inv_qty;\n \n //updated inventory of particular product with $final_qty in below query\n DB::table('inventories')->where('id',$inventory->id)->update(['inv_qty'=>$final_qty,'updated_at'=>$updated_at]);\n\n //summing up qty\n $originalqty +=$inventory->inv_qty;\n //sutracting sold qty from available qty\n $qty=$qty-$inventory->inv_qty;\n //getting last product ledger\n \n \n $dbcp=$inventory->inv_cost_price;\n //calculating resulting price\n $res_price += $inventory->inv_qty*$inventory->inv_cost_price;\n }\n \n \n //echo 'price ='.$fin.\"<br>\";\n \n }\n //echo $wholeqty.\"<br>\";\n if($input_qty > $wholeqty){\n $minus_quantity=$wholeqty-$input_qty;\n $last_record=DB::table('inventories')->where('inv_product_id',$product_id)->orderby('id', 'desc')->first();\n //updated inventory of particular product with $minus_quantity in below query\n DB::table('inventories')->where('id',$last_record->id)->update(['inv_qty'=>$minus_quantity,'updated_at'=>$updated_at]);\n }\n \n // //calculating final price\n $fin =$res_price+($input_qty-$originalqty)*$dbcp;\n $_costofsale +=$fin;\n // //echo $fin;\n // //storing inventory ledger by calling inventoryledger function\n $this->inventoryledger(\"product_\".$product_id,$fin,$refrence_id,$date,$datebit);\n \n }",
"public function update_item() {\r\n\t\t$data = array(\r\n\t\t\t\t'rowid' => $this->input->post('row_id'),\r\n\t\t\t\t'qty' => $this->input->post('qty')\r\n\t\t);\r\n\t\t$this->cart->update($data);\r\n\t\t$this->load_cart();\r\n\t}",
"protected function _gatherOrderItemsData()\n {\n $itemsData = [];\n if ($this->_coreRegistry->registry('current_order')) {\n foreach ($this->_coreRegistry->registry('current_order')->getItemsCollection() as $item) {\n $itemsData[$item->getId()] = [\n 'qty_shipped' => $item->getQtyShipped(),\n 'qty_returned' => $item->getQtyReturned(),\n ];\n }\n }\n $this->setOrderItemsData($itemsData);\n }",
"public function update(UpdateOrder $request)\n {\n $request->validate([\n 'items.*.quantity' => new InStock($request->get('items')),\n ]);\n\n $order = new OrderService(Order::find($request->id));\n\n return response()->json($order->updateOrder($request->items));\n }",
"public function orderItemsAction() {\n if (!Arr::get($this->post, 'id')) {\n $this->error();\n }\n if (!Arr::get($this->post, 'catalog_id')) {\n $this->error();\n }\n $res = DB::update('orders_items')->set([\n 'count' => Arr::get($this->post, 'count'),\n ])\n ->where('order_id', '=', Arr::get($this->post, 'id'))\n ->where('catalog_id', '=', Arr::get($this->post, 'catalog_id'))\n ->execute();\n if ($res) {\n Common::factory('orders')->update(['changed' => 1], Arr::get($this->post, 'id'));\n $this->success(['email_button' => true]);\n }\n $this->success(['email_button' => false]);\n }",
"public function updated(Order $order)\n {\n\n }",
"private function setItemsInformation()\n {\n foreach ($this->_checkoutSession->getLastRealOrder()->getAllVisibleItems() as $product) {\n $this->_paymentRequest->addItems()->withParameters(\n $product->getProduct()->getId(), //id\n \\UOL\\PagSeguro\\Helper\\Data::fixStringLength($product->getName(), 255), //description\n $product->getSimpleQtyToShip(), //quantity\n \\UOL\\PagSeguro\\Helper\\Data::toFloat($product->getPrice()), //amount\n round($product->getWeight()) //weight\n );\n }\n }",
"public function editquantity(){\n if(isset($this->params[0])) {\n $id = (int)($this->params[0]);\n $quantity = (int)($this->params[1]);\n if (!array_key_exists($id, $this->products)) {\n $this->products[$id] = (int)($quantity);\n }else{\n $this->products[$id] = (int)($quantity);\n }\n }\n Cookie::set('cart', json_encode($this->products));\n\n echo $this->indicator();\n die();\n }"
] | [
"0.6501156",
"0.6465894",
"0.64182293",
"0.637074",
"0.63008755",
"0.6105057",
"0.60602164",
"0.6053678",
"0.60009944",
"0.59865826",
"0.5967683",
"0.5932711",
"0.5926249",
"0.5884962",
"0.5846819",
"0.5846819",
"0.5846819",
"0.583558",
"0.5833948",
"0.583187",
"0.5824744",
"0.58230025",
"0.5821252",
"0.58157253",
"0.5784711",
"0.5782317",
"0.5773079",
"0.5766454",
"0.5748919",
"0.5741469"
] | 0.68850046 | 0 |
To allocate the inventory for the given order. | public function allocate_inventory($inventory, $order) {
$order_details_arr = array();
$total_alloted_qty = 0;
foreach($order->Lines as $line) {
$ordered_qty = $line->Quantity;
$alloted_qty = 0;
$backordered = 0;
$available_qty = 0;
if (array_key_exists($line->Product, $inventory)) {
$available_qty = $inventory[$line->Product];
}
if ($available_qty > 0 && $available_qty >= $ordered_qty) {
$alloted_qty = $ordered_qty;
} else if ($available_qty > 0 && $ordered_qty > $available_qty) {
$alloted_qty = $available_qty;
$backordered = $ordered_qty - $available_qty;
} else {
$backordered = $ordered_qty;
}
$total_alloted_qty += $alloted_qty;
$order_details = new OrderDetails($line->Product, $ordered_qty, $alloted_qty, $backordered);
array_push($order_details_arr, $order_details);
}
$processed_order = new OrderHeader($order->Header, $order_details_arr, $total_alloted_qty);
return $processed_order;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function createOrder()\n {\n\n $user = Auth::user();\n \n $admins = User::where('role', 'super_admin')\n ->orWhere('role', 'admin')\n ->get();\n\n $order = $user->orders()\n ->create([\n 'total' => Cart::total(),\n 'delivered' => 0,\n 'hash' => str_random(60)\n ]);\n\n $cartItems = Cart::content();\n\n\n foreach ($cartItems as $cartItem) {\n\n if ($cartItem->options->type == 'w') {\n\n $order->widgetItems()->attach($cartItem->id,[\n 'qty' => $cartItem->qty,\n 'total' => $cartItem->qty * $cartItem->price\n ]);\n\n }else{\n\n $order->orderItems()->attach($cartItem->id,[\n 'qty' => $cartItem->qty,\n 'total' => $cartItem->qty * $cartItem->price\n ]);\n\n }\n\n \n }\n\n Mail::to($user)\n ->send( new OrderShipped($order) );\n\n Notification::send($admins, new NewOrder($order));\n\n //$user->notify(new NewPost($post));\n \n\n /*Mail::to($request->user())\n ->cc($moreUsers)\n ->bcc($evenMoreUsers)\n ->send(new OrderShipped($order))\n ->queue(new OrderShipped($order));*/\n\n }",
"public function get_inventory($db_conn, $order) {\n\t\t$inventory = array();\t\t\n\t\tmysqli_autocommit($db_conn, false);\t\t\n\t\t$sql_command = '';\t\t\n\t\tforeach($order->Lines as $product) {\n\t\t\t$sql_command .= \"SELECT product_code, available_qty FROM products WHERE product_code = '\" . $product->Product . \"' AND available_qty > 0 AND is_active = 1 FOR UPDATE;\";\n\t\t}\n\t\tif (mysqli_multi_query($db_conn,$sql_command))\n\t\t{\n\t\t do {\n\t\t\t\tif ($result = mysqli_store_result($db_conn)) {\n\t\t\t\t\twhile ($result_arr = mysqli_fetch_array($result, MYSQLI_ASSOC)) {\n\t\t\t\t\t\t$inventory[$result_arr['product_code']] = $result_arr['available_qty'];\n\t\t\t\t\t}\n\t\t\t\t\tmysqli_free_result($result);\n\t\t\t\t}\n\t\t\t} while (mysqli_next_result($db_conn));\n\t\t}\n\t\treturn $inventory;\n\t}",
"public function createOrder() {\n\n\t if(!$this->getOrderid()){\n\t\t\t\n\t\t\t$theOrder = Orders::create ( $this->getCustomerId(), Statuses::id('tobepaid', 'orders'), null );\n\t\n\t\t\t// For each item in the cart\n\t\t\tforeach ($this->getItems() as $item){\n\t\t\t\t$item = Orders::addOrderItem ($item);\n\t\t\t}\n\t\t\t\n\t\t\t$this->setOrderid($theOrder['order_id']);\n\t\t\t\n\t\t\t// Send the email to confirm the order\n\t\t\tOrders::sendOrder ( $theOrder['order_id'] );\n\t\t\t\n\t\t\treturn Orders::getOrder();\n\t\t\t\n\t\t}else{\n\t\t\t\n\t\t\treturn Orders::find($this->getOrderid());\n\t\t}\n\t\t\n\t}",
"public function add() {\n\t\tif (!empty($this->data)) {\n\t\t\ttry {\n\t\t\t\t$result = $this->InventoryEntry->add(array('InventoryEntry' => array(\n\t\t\t\t\t'purchase_order_id' => $this->data['InventoryEntry']['purchase_order_id'],\n\t\t\t\t\t'user_id' => $this->Auth->user('id')\n\t\t\t\t)));\n\n\t\t\t\tif ($result === true) {\n\t\t\t\t\t$this->redirect(\n\t\t\t\t\t\tarray('controller' => 'inventory_items', 'action' => 'add', $this->InventoryEntry->id)\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\t$this->data = $result;\n\t\t\t\t}\n\t\t\t} catch (OutOfBoundsException $e) {\n\t\t\t\t$this->Session->setFlash($e->getMessage());\n\t\t\t}\n\t\t}\n\t\t$purchaseOrders = $this->InventoryEntry->PurchaseOrder->find('list', array(\n\t\t\t'conditions' => array(\n\t\t\t\t//\"NOT\" => array('PurchaseOrder.status' => array(PurchaseOrder::VOID, PurchaseOrder::COMPLETED)),\n\t\t\t\tarray('PurchaseOrder.status' => array(PurchaseOrder::INVOICED)),\n\t\t\t),\n\t\t\t'order' => array('PurchaseOrder.created' => 'desc')));\n\t\t$this->set(compact('purchaseOrders'));\n\t}",
"public function makeOrder(Request $request)\n {\n $orders = new Order;\n $item = new Item;\n $orders->user_id = $request->user_id;\n $orders->item_id = $request->item_id;\n $request = $request->all();\n\n if ($orders->save()) {\n $itemId = (array) array_get($request, 'item_id');\n $orderId = Order::find($orders->id);\n $orders->items()->attach($itemId);\n $item->orders()->attach($orderId);\n return redirect('/orders/all');\n }\n }",
"function check_order_inventory ( $order_id, $warehouse_id, &$order_products, $for_reallocation = false ) {\n\t\t$result = $this->db->query(CHECK_ORDER_INVENTORY, array($order_id, $warehouse_id, (($for_reallocation)?CHECK_ORDER_INVENTORY_FOR_REALLOCATION:CHECK_ORDER_INVENTORY_FOR_ALLOCATION)));\n\t\t$parameters = array($order_id, $warehouse_id, \n\t\t\t(($for_reallocation)?CHECK_ORDER_INVENTORY_FOR_REALLOCATION:CHECK_ORDER_INVENTORY_FOR_ALLOCATION)\n\t\t);\n\t\t\n\t\t$order_products = array();\n\t\t$k = $op_result->num_rows;\n\t\t\n\t\t$enough = true;\n\t\twhile (false != ($row = $result->fetch())) {\n\t\t\t$order_products[$row['order_product_id']] = $row;\n\t\t\tif ($row['backorder']) {\n\t\t\t\t$enough = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $enough;\n\t}",
"public function create_order()\n {\n $this->log->startLog();\n\n $findProduct = $this->productRepository->getProduct($this->request->json('product_id'));\n\n $reqQty = $this->request->json('qty');\n\n\n /*\n * Check Quantity\n */\n\n if($reqQty <= 0)\n {\n return response('Qty must be more than 0',500);\n }\n\n if($findProduct->product_qty <= 0)\n {\n return response('Sold Out',500);\n }\n\n if($findProduct->product_qty < $reqQty)\n {\n return response('Stock Empty',500);\n }\n\n $amount = ($reqQty * $findProduct->product_price);\n\n $order = Order::create([\n 'user' => $this->request->json('user'),\n 'product_id' => $this->request->json('product_id'),\n 'amount' => $amount,\n 'qty' => $reqQty,\n ]);\n\n /*\n * Deduct Product Qty after add the order\n */\n\n $newQty = ($findProduct->product_qty - $this->request->qty);\n\n $this->productRepository->updateQty($newQty,$findProduct);\n\n /*\n * update item to bind to the order\n */\n\n for($i=0;$i<$reqQty;$i++)\n {\n $this->itemRepository->markItemAsSold($order->id);\n }\n\n $this->log->endLog($order);\n\n return response('Order Success');\n\n }",
"private function transferOrderStock(TransferOrder $transfer_order)\n {\n // use $stock->move($from_location, $to_location)\n // for better receivings stock tracking\n\n $location = Location::find($transfer_order->location_id);\n $item = Inventory::find($transfer_order->purchase_order_product->inventory->id);\n $stock = InventoryStock::find($item->id);\n $stock = InventoryStock::where('inventory_id', $item->id)->where('location_id', $location->id)->first();\n $reason = 'New stock from Transfer Order #'.$transfer_order->id;\n\n // dd($transfer_order->location, $item, $stock);\n \n // Add the stocks to the existing inventory stock location else create a new one.\n if ($stock) {\n // Add to existing inventory stock.\n $stock->add($transfer_order->quantity, $reason);\n } else {\n // Create new inventory stock to add new stocks to.\n $stock = new InventoryStock;\n $stock->inventory_id = $item->id;\n $stock->location_id = $location->id;\n $stock->quantity = $transfer_order->quantity;\n // $stock->cost = '5.20';\n $stock->reason = $reason;\n $stock->aisle = isset($transfer_order->aisle) ? $transfer_order->aisle : null;\n $stock->row = isset($transfer_order->row) ? $transfer_order->row : null;\n $stock->bin = isset($transfer_order->bin) ? $transfer_order->bin : null;\n $stock->save();\n }\n\n // Link the stock movement to the transfer order.\n $stock->getLastMovement()->update(['transfer_order_id' => $transfer_order->id]);\n\n // dd($location, $item, $stock);\n \n return $stock;\n }",
"protected function purchasedItems(Request $request, Order $order) :array{\n $orderItems = ArrayHelper::lvl1_formatter($request->all());\n $items = [];\n foreach($orderItems as $key => $item){\n if(!isset($item['product'])){\n break;\n }\n $inventory = Product::find($item['product'])->inventory;\n $items[$key] = [\n 'order_id' => $order->id,\n 'inventory_id' => $inventory->id,\n 'quantity' => $item['quantity'],\n 'amount' => $inventory->price * ($inventory->product->is_rental ? $this->rentDays : 1),\n 'is_addon' => $item['addon'] ? 1 : 0,\n 'delivery_date' => date('Y-m-d', strtotime($order->delivery_date)),\n 'pickup_date' => date('Y-m-d', strtotime($order->pickup_date))\n ];\n }\n return $items;\n }",
"private function reservePendingOrders()\n { \n // 1\n $pending_order_products = \\App\\Models\\OrderProduct::with('order')->pending()->get()\n ->sortByDesc(function($pending_order_product){\n return $pending_order_product->order->created;\n });\n\n $order_reservations = collect([]);\n\n foreach ($pending_order_products as $pending_order_product) {\n $order_reservations->push(Order::reserveProduct($pending_order_product));\n }\n\n return $order_reservations;\n }",
"private function composeCreateOrderForm()\n {\n View::composer(\n\n 'admin.order.create',\n\n function($view)\n {\n $config = Config::findOrFail(auth()->user()->merchantId());\n\n $view->with('payment_statuses', ListHelper::payment_statuses());\n $view->with('payment_methods', optional($config->paymentMethods)->pluck('name', 'id'));\n\n $inventories = Inventory::mine()->active()->with('product', 'attributeValues')->get();\n\n foreach ($inventories as $inventory){\n $str = ' - ';\n\n foreach ($inventory->attributeValues as $k => $attrValue){\n $str .= $attrValue->value .' - ';\n }\n\n $str = substr($str, 0, -3);\n\n $items[$inventory->id] = $inventory->sku .': '. $inventory->product->name . $str . ' - ' . $inventory->condition;\n\n if ($inventory->image)\n $img_path = optional($inventory->image)->path;\n else if ($inventory->product->featuredImage)\n $img_path = optional($inventory->product->featuredImage)->path;\n else\n $img_path = optional($inventory->product->image)->path;\n\n\n $product_info[$inventory->id] = [\n \"id\" => $inventory->product_id,\n \"image\" => $img_path,\n \"salePrice\" => round($inventory->sale_price, 2),\n \"offerPrice\" => round($inventory->offer_price, 2),\n \"stockQtt\" => $inventory->stock_quantity,\n \"shipping_weight\" => $inventory->shipping_weight,\n \"offerStart\" => $inventory->offer_start,\n \"offerEnd\" => $inventory->offer_end,\n ];\n }\n\n $view->with('products', isset($items) ? $items : []);\n $view->with('inventories', isset($product_info) ? $product_info : []);\n }\n );\n }",
"public function store(OrderRequest $request)\n {\n $order = $this->order->create($request->all());\n foreach ($request->order_items as $item) {\n $product = Product::find($item['product_id']);\n $order->order_items()->create([\n \"product_id\" => $product->id,\n 'quantity' => $item['quantity'],\n 'price' => $product->price\n ]);\n $currentStock = $product->stock - $item['quantity'];\n $product->update(['stock' => $currentStock]);\n }\n return response()->json(new OrderResource($order));\n }",
"public function createOrder(){\r\n\r\n }",
"public function create($order) {\n $array = [$order->getStatusId(),\n $order->getTableId(),\n $order->getChefId(),\n $order->getWaiterId(),\n $order->getClientId(),\n $order->getMenuId(),\n $order->getTotalPrice()];\n\n return $this->dataSource->executeTransaction(self::INSERT_ORDER, $array);\n }",
"public function enterorder()\n\t\t{\n\t\t\t$_SESSION['redirect'] = 0;\n\n\t\t\t$stageDBO = DatabaseObjectFactory::build('Item');\n\t\t\t$arr = ['item_id','name'];\n\t\t\t$items = $stageDBO->getRecords($arr); \n\n\t\t\t$stageDBO = DatabaseObjectFactory::build('material');\n\t\t\t$stageDBO->SetJoin([\"[><]item\" => \"item_id\"]);\n\t\t\t$arr = ['material_id','name'];\n\t\t\t$materials = $stageDBO->getRecords($arr);\n\n\n\t\t\t$db = databaseConnection::getInstance();\n\t\t\t$materials = $db->query(\"SELECT name, material.material_id, item.item_id FROM material, item WHERE material.item_id = item.item_id\")->fetchAll();\n\t\t\t\n\t\t\tif (empty(self::$error)){\n\t\t\t\trequire_once('views/pages/enterorder.php');\n\t\t\t}\n\t\t}",
"public function createSystemOutInventory($orderId){\n $out_mod=M('inventoryOut');\n $data=array(\n 'type'=> C(\"INVENTORY_OUT_TYPE_SYSTEM\"),\n 'title'=>'出库单'.date(\"m.d\"),\n 'outdate'=>date(\"Y-m-d\").' 00:00:00', //todo 今天?或者过一定时间变成明天?\n 'description'=>'系统出库单'.date(\"m.d\"),\n 'cdatetime'=>date('Y-m-d H:i:s'),\n 'operator'=>'system',\n 'status'=>1,\n 'ifagree'=>0,\n 'agreeoperator'=>'',\n 'agreedatetime'=>'',\n 'ifconfirm'=>0,\n 'confirmoperator'=>'',\n 'confirmdatetime'=>'',\n 'ifselfpackage'=>1\n );\n $in_out_id=$out_mod->add($data);\n\n $total_num=0;//当前订单内商品总数\n\n //get product detail\n $detail_mod=M(\"userOrderSendProductdetail\");\n $info=$detail_mod->where(array('self_package_order_id'=>$orderId))->field('productid,product_num')->select();\n $stat_mod=M(\"inventoryStat\");\n $product_mod = M(\"products\");\n foreach ($info AS $k => $val){\n $product = $product_mod->field(\"inventory_item_id\")->getByPid($val['productid']);\n $data1=array(\n 'itemid'=>$product['inventory_item_id'],\n 'message'=>'',\n 'operator'=>'',\n 'quantity'=>-$val['product_num'],\n 'add_time'=>'',\n 'status'=>0,\n 'in_out_id'=>$in_out_id\n );\n $stat_mod->add($data1);\n $total_num = $total_num + $val['product_num'];\n }\n $order = $this->getOrderInfo($orderId,\"userid,cost\");\n\n //generate order send\n $order_send_mod=M(\"UserOrderSend\");\n $orderSendData['orderid'] = $orderId;\n $orderSendData['userid'] = $order['userid'];\n $orderSendData['productnum'] = $total_num;\n $orderSendData['productprice'] = $order['cost'];\n $orderSendData['inventory_out_id'] = $in_out_id;\n $orderSendData['inventory_out_status'] = C(\"INVENTORY_OUT_STATUS_UNFINISHED\");\n $order_send_mod->add($orderSendData);\n\n //关联user_self_package _order\n $orderData['inventory_out_id'] = $in_out_id;\n $orderData['inventory_out_status'] = C(\"INVENTORY_OUT_STATUS_UNFINISHED\");\n $this->where(array('ordernmb'=>$orderId))->setField($orderData);\n\t}",
"public function creating(Order $order)\n {\n $order->total = ($order->width * $order->height * $order->amount * $order->price_unit) / 10000;\n if ($order->client->email != null) {\n Mail::to($order->client)->send(new OrderPlaced($order));\n }\n }",
"private function prepareItems(Order $order) : array\n {\n $items = array();\n /**\n * @var $item OrderItem\n */\n foreach ($order->getAllVisibleItems() as $item) {\n $items[$item->getId()] = $item->getQtyOrdered();\n }\n return $items;\n }",
"public function inventoryNewOrder(Varien_Event_Observer $observer) {\n\n $order = $observer->getEvent()->getOrder();\n $items = $order->getAllItems();\n\n foreach($items as $item) {\n\n if( ($item->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_BUNDLE) or ($item->getProductType() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) ) {\n continue;\n }\n\n $this->_saveInventoryChange($item->getProductId(), $item->getProduct()->getStockItem()->getItemId());\n\n }\n\n return $this;\n\n\t}",
"public function build_payment_items(Order $order)\n {\n $items = new ItemBag;\n\n foreach ($order->items as $item) {\n $items->add(array(\n 'name' => $item->title,\n 'quantity' => $item->item_qty,\n 'price' => $item->price,\n ));\n }\n\n foreach ($order->adjustments as $adjustment) {\n if (!$adjustment->included) {\n $items->add(array(\n 'name' => $adjustment->name,\n 'quantity' => 1,\n 'price' => $adjustment->amount,\n ));\n }\n }\n\n return $items;\n }",
"public function _placeOrder()\n {\n\n try {\n\n $payment = $this->getInfoInstance();\n $order = $payment->getOrder();\n $helper = Mage::helper('pix');\n\n $result = $helper->getClient()->charge($order, $payment);\n\n if ($result) {\n $payment->setAdditionalInformation($result);\n $payment->setTransactionId('created_'.$result['transactionId']);\n $payment->setCcStatus($result['financialStatement']['status']);\n $payment->setTransactionAdditionalInfo(Mage_Sales_Model_Order_Payment_Transaction::RAW_DETAILS, $helper->array_flatten($result));\n $payment->save();\n\n $order->addStatusHistoryComment($helper->__('PIX - Pedido Criado'));\n $order->save();\n }\n } catch (Inovarti_Pix_Model_Client_Exception $e) {\n Mage::throwException($helper->__($e->getMessage()));\n $helper->log('Inovarti_Pix_Model_Client_Exception: ' . $e->getMessage());\n } catch (Mage_Core_Exception $e) {\n Mage::throwException($helper->__($e->getMessage()));\n $helper->log('Mage_Core_Exception: ' . $e->getMessage());\n } catch (Exception $e) {\n Mage::throwException($helper->__($e->getMessage()));\n $helper->log('connection failed(T): ' . $e->getMessage());\n }\n\n return $this;\n }",
"public function __construct($order)\n {\n $this->stockOrder = $order;\n }",
"protected function createVirtualOrder()\n {\n global $USER;\n try\n {\n $siteId = Context::getCurrent()->getSite(); // імя сайта\n $this->fUserId = $this->getFuserId();\n $basket = Basket::loadItemsForFUser($this->fUserId, $siteId);\n\n if(count($basket->getOrderableItems()) == 0) // якщо кошик пустий перехід на головну сторінку сайта, або на вказану в налаштуванні\n LocalRedirect('/personal/cart/'); // TODO - доробити, якщо кошик пустий\n\n // створюємо віртуальний заказ\n $this->order = Order::create($siteId, $this->fUserId);\n $this->order->setPersonTypeId($this->arParams['PERSON_TYPE_ID']);\n // приєднеємо до заказу поточний кошик\n $this->order->setBasket($basket);\n\n $this->basket = $this->order->getBasket();\n }\n catch (Exception $e)\n {\n $this->errors[] = $e->getMessage();\n }\n }",
"public function create(Order $order)\n {\n\t\t$user = Auth::user();\n\t\t$supplier=$order->suppliers()->whereIn('id',$user->suppliers->pluck('id'))->first();\n\n\t\t$supplierId = Auth::user()->suppliers()->first()->id;\n\n $hasInventories = $this->inventoryRepo->hasInventories($supplierId);\n\t\t$equipmentIds = $this->inventoryRepo->findEquipmentIdsBySupplier($supplierId);\n\t\t\n\t\t$settings = $this->settings_repository->findAll()->whereIn('name', 'market_place_fee')->first();\n\t\t$marketPlaceFee = $settings['value'];\n\n\t\t$insurance = $this->bid_repository->getInsurance();\n\t\n\t\n return view('web.supplier.bids.create')->with(compact('order','equipmentIds', 'marketPlaceFee', 'insurance'));\n }",
"public function addOrder(Request $request)\n {\n // If user is logged in then continue\n if ($auth = Auth::user()) {\n $auth;\n }\n\n //request variables\n $products = $request->session()->get('shopping_cart');\n $amount = $request->quantity;\n\n // If products is not equal to null then do an iteration of each product. Create new order and order_detail\n if ($products != NULL) {\n foreach ($products as $product) {\n $order = new Order;\n $order->client_id = $auth->id;\n \n // if ($order->client_id != NULL) {\n\n // if ($auth->id == $order->client_id) { //$client = Client::where('id', $order->client_id)->first()\n\n // $order->client_id = $auth->id;\n\n // }else{\n\n // $order->client_id;\n\n // }\n\n // }else{\n\n // $order->client_id = NULL;\n\n // }\n\n $order->status = env('ORDER_STATUS');\n $order->save();\n\n $odetail = new OrderDetail;\n $odetail->order_id = $order->id;\n $odetail->product_id = $product->productId->id;\n $odetail->total_products = $product->qty;\n foreach ($amount as $key => $value) {\n if ($key == $product->productId->id) {\n $odetail->total_products = $value;\n }\n }\n $odetail->save();\n }\n }\n \n return redirect('orders');\n }",
"public function store(Request $request)\n {\n $input = $request->all();\n\n\n $validator = Validator::make($input, [\n 'name' => 'required',\n 'status' => 'required',\n 'grand_total' => 'required',\n 'item_count' => 'required',\n 'tables_id' => 'required',\n ]);\n\n\n if($validator->fails()){\n return $this->sendError('Validation Error.', $validator->errors());\n }\n\n foreach($request->orderList as $order)\n {\n $order = Order::create([\n 'name' => 'ORD-'.strtoupper(uniqid()),\n 'status' => 'pending',\n 'grand_total' => $order['total'],\n 'tables_id' => $order['tables_id'],\n 'details' => $order['details'],\n 'notes' => $order['notes']\n ]);\n }\n\n\n\n\n /* if ($order) {\n\n $items = \\request()->get('cart');\n\n foreach ($items as $item)\n {\n // A better way will be to bring the product id with the cart items\n // you can explore the package documentation to send product id with the cart\n $product = Product::where('id', $item['id'])->first();\n\n $orderItem = new OrderItem([\n 'product_id' => $product->id,\n 'quantity' => $item['quantity'],\n 'price' => $item['quantity'] * $item['price']\n ]);\n\n $order->items()->save($orderItem);\n }\n }\n\n return $order;*/\n\n return $this->sendResponse($order->toArray(), 'Order taken successfully.');\n }",
"public function initFromOrder(Mage_Sales_Model_Order $order)\n {\n if (!$order->getReordered()) {\n $this->getSession()->setOrderId($order->getId());\n } else {\n $this->getSession()->setReordered($order->getId());\n }\n\n /**\n * Check if we edit quest order\n */\n $this->getSession()->setCurrencyId($order->getOrderCurrencyCode());\n if ($order->getCustomerId()) {\n $this->getSession()->setCustomerId($order->getCustomerId());\n } else {\n $this->getSession()->setCustomerId(false);\n }\n\n $this->getSession()->setStoreId($order->getStoreId());\n\n //Notify other modules about the session quote\n Mage::dispatchEvent('init_from_order_session_quote_initialized',\n array('session_quote' => $this->getSession()));\n\n /**\n * Initialize catalog rule data with new session values\n */\n $this->initRuleData();\n foreach ($order->getItemsCollection(\n array_keys(Mage::getConfig()->getNode('adminhtml/sales/order/create/available_product_types')->asArray()),\n true\n ) as $orderItem) {\n /* @var $orderItem Mage_Sales_Model_Order_Item */\n if (!$orderItem->getParentItem()) {\n if ($order->getReordered()) {\n $qty = $orderItem->getQtyOrdered();\n } else {\n $qty = $orderItem->getQtyOrdered() - $orderItem->getQtyShipped() - $orderItem->getQtyInvoiced();\n }\n\n if ($qty > 0) {\n $item = $this->initFromOrderItem($orderItem, $qty);\n if (is_string($item)) {\n Mage::throwException($item);\n }\n }\n }\n }\n\n $shippingAddress = $order->getShippingAddress();\n if ($shippingAddress) {\n $addressDiff = array_diff_assoc($shippingAddress->getData(), $order->getBillingAddress()->getData());\n unset($addressDiff['address_type'], $addressDiff['entity_id']);\n $shippingAddress->setSameAsBilling(empty($addressDiff));\n }\n\n $this->_initBillingAddressFromOrder($order);\n $this->_initShippingAddressFromOrder($order);\n\n if (!$this->getQuote()->isVirtual() && $this->getShippingAddress()->getSameAsBilling()) {\n $this->setShippingAsBilling(1);\n }\n\n $this->setShippingMethod($order->getShippingMethod());\n $this->getQuote()->getShippingAddress()->setShippingDescription($order->getShippingDescription());\n\n $this->getQuote()->getPayment()->addData($order->getPayment()->getData());\n\n\n $orderCouponCode = $order->getCouponCode();\n if ($orderCouponCode) {\n $this->getQuote()->setCouponCode($orderCouponCode);\n }\n\n if ($this->getQuote()->getCouponCode()) {\n $this->getQuote()->collectTotals();\n }\n\n Mage::helper('core')->copyFieldset(\n 'sales_copy_order',\n 'to_edit',\n $order,\n $this->getQuote()\n );\n\n Mage::dispatchEvent('sales_convert_order_to_quote', array(\n 'order' => $order,\n 'quote' => $this->getQuote()\n ));\n\n if (!$order->getCustomerId()) {\n $this->getQuote()->setCustomerIsGuest(true);\n }\n\n if ($this->getSession()->getUseOldShippingMethod(true)) {\n /*\n * if we are making reorder or editing old order\n * we need to show old shipping as preselected\n * so for this we need to collect shipping rates\n */\n $this->collectShippingRates();\n } else {\n /*\n * if we are creating new order then we don't need to collect\n * shipping rates before customer hit appropriate button\n */\n $this->collectRates();\n }\n\n // Make collect rates when user click \"Get shipping methods and rates\" in order creating\n // $this->getQuote()->getShippingAddress()->setCollectShippingRates(true);\n // $this->getQuote()->getShippingAddress()->collectShippingRates();\n\n $this->getQuote()->save();\n $cur_quote = $quote = $this->getQuote()->getId();\n $items = Mage::getModel('sales/quote_item')->getCollection()\n ->addFieldToFilter('quote_id',array('eq'=>$cur_quote))\n ->getData();\n foreach($items as $item){\n if($item['parent_item_id']){\n if($item['custom_price']){\n $parent_item = Mage::getModel('sales/quote_item')\n ->load($item['parent_item_id']);\n if(($parent_item->getData('product_type') == 'configurable' || $parent_item->getData('product_type') == 'bundle') && is_null($parent_item->getData('custom_price'))){\n\n $data = array();\n $info = array();\n $info['qty'] = $parent_item->getData('qty');\n $info['custom_price'] = $item['custom_price'];\n $data[$item['parent_item_id']] = $info;\n $data = $this->processDatas($data);\n $this->updateQuoteItemsConfig($data);\n }\n }\n }\n }\n\n return $this;\n }",
"public function store(StorePurchaseOrdersRequest $request)\n {\n if (! Gate::allows('purchase_order_create')) {\n return abort(401);\n }\n $purchase_order = PurchaseOrder::create($request->all());\n\n for ($i=0; $i < count($request->item_description); $i++) {\n if (isset($request->qty[$i]) && isset($request->unit[$i]) && isset($request->unit_price[$i])) {\n $purchase_order->invoice_items()->create([\n 'invoice_number_id' => $purchase_order->id,\n 'item_description' => $request->item_description[$i],\n 'qty' => $request->qty[$i],\n 'unit' => $request->unit[$i],\n 'unit_price' => $request->unit_price[$i],\n 'total' => $request->total[$i]\n ]);\n }\n }\n\n return redirect()->route('admin.purchase_orders.index');\n }",
"function submitOrders() {\n\t\t\t$this->_deleteNominalItems( );\n\t\t\t$this->_validateMultiple( );\n\t\t\t$this->clearOrders( );\n\t\t\t$quote = $this->getQuote( );\n\t\t\t$billingAddress = $quote->getBillingAddress( );\n\t\t\t$convertor = $this->getConvertor( );\n\t\t\t$isVirtual = $quote->isVirtual( );\n\t\t\t$transaction = Mage::getModel( 'core/resource_transaction' );\n\n\t\t\tif ($quote->getCustomerId( )) {\n\t\t\t\t$transaction->addObject( $quote->getCustomer( ) );\n\t\t\t}\n\n\t\t\t$transaction->addObject( $quote );\n\t\t\t$addresses = array( );\n\n\t\t\tif (!$isVirtual) {\n\t\t\t\tforeach ($quote->getAllShippingAddresses( ) as $address) {\n\t\t\t\t\tarray_push( $addresses, $address );\n\t\t\t\t}\n\t\t\t} \nelse {\n\t\t\t\tarray_push( $addresses, $quote->getBillingAddress( ) );\n\t\t\t}\n\n\t\t\t$addresses = array_reverse( $addresses );\n\t\t\tforeach ($addresses as $address) {\n\t\t\t\t$stockId = intval( $address->getStockId( ) );\n\t\t\t\t$quote->unsReservedOrderId( );\n\t\t\t\t$quote->reserveOrderId( );\n\t\t\t\t$quote->collectTotals( );\n\t\t\t\t$order = $convertor->addressToOrder( $address );\n\t\t\t\t$orderBillingAddress = $convertor->addressToOrderAddress( $quote->getBillingAddress( ) );\n\n\t\t\t\tif ($billingAddress->getCustomerAddress( )) {\n\t\t\t\t\t$orderBillingAddress->setCustomerAddress( $billingAddress->getCustomerAddress( ) );\n\t\t\t\t}\n\n\t\t\t\t$order->setBillingAddress( $orderBillingAddress );\n\n\t\t\t\tif (!$isVirtual) {\n\t\t\t\t\tif (!$address->isVirtual( )) {\n\t\t\t\t\t\t$orderShippingAddress = $convertor->addressToOrderAddress( $address );\n\n\t\t\t\t\t\tif ($address->getCustomerAddress( )) {\n\t\t\t\t\t\t\t$orderShippingAddress->setCustomerAddress( $address->getCustomerAddress( ) );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$order->setShippingAddress( $orderShippingAddress );\n\t\t\t\t\t} \nelse {\n\t\t\t\t\t\t$order->setIsVirtual( 1 );\n\t\t\t\t\t}\n\t\t\t\t} \nelse {\n\t\t\t\t\t$order->setIsVirtual( 1 );\n\t\t\t\t}\n\n\t\t\t\t$order->setPayment( $convertor->paymentToOrderPayment( $quote->getPayment( ) ) );\n\n\t\t\t\tif (Mage::app( )->getStore( )->roundPrice( $address->getGrandTotal( ) ) == 0) {\n\t\t\t\t\t$order->getPayment( )->setMethod( 'free' );\n\t\t\t\t}\n\n\t\t\t\tforeach ($this->_orderData as $key => $value) {\n\t\t\t\t\t$order->setData( $key, $value );\n\t\t\t\t}\n\n\t\t\t\tforeach ($quote->getAllItems( ) as $item) {\n\n\t\t\t\t\tif (( $isVirtual || $item->getStockId( ) == $stockId )) {\n\t\t\t\t\t\t$orderItem = $convertor->itemToOrderItem( $item );\n\n\t\t\t\t\t\tif ($item->getParentItem( )) {\n\t\t\t\t\t\t\t$orderItem->setParentItem( $order->getItemByQuoteItemId( $item->getParentItem( )->getId( ) ) );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$order->addItem( $orderItem );\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$order->setQuote( $quote );\n\t\t\t\t$this->setOrder( $stockId, $order );\n\t\t\t\t$transaction->addObject( $order );\n\t\t\t\t$transaction->addCommitCallback( array( $order, 'place' ) );\n\t\t\t\t$transaction->addCommitCallback( array( $order, 'save' ) );\n\t\t\t\tMage::dispatchEvent( 'checkout_type_onepage_save_order', array( 'order' => $order, 'quote' => $quote ) );\n\t\t\t\tMage::dispatchEvent( 'sales_model_service_quote_submit_before', array( 'order' => $order, 'quote' => $quote ) );\n\t\t\t}\n\n\t\t\t$transaction->save( );\n\t\t\t$this->_inactivateQuote( );\n\t\t\tforeach ($this->getOrders( ) as $order) {\n\t\t\t\tMage::dispatchEvent( 'sales_model_service_quote_submit_success', array( 'order' => $order, 'quote' => $quote ) );\n\t\t\t}\n\n\t\t\tjmp;\n\t\t\tException {\n\t\t\t\tif (!Mage::getSingleton( 'customer/session' )->isLoggedIn( )) {\n\t\t\t\t\t$quote->getCustomer( )->setId( null );\n\t\t\t\t}\n\n\t\t\t\tforeach ($this->getOrders( ) as $order) {\n\t\t\t\t\t$order->setId( null );\n\t\t\t\t\tforeach ($order->getItemsCollection( ) as $item) {\n\t\t\t\t\t\t$item->setOrderId( null );\n\t\t\t\t\t\t$item->setItemId( null );\n\t\t\t\t\t}\n\n\t\t\t\t\tMage::dispatchEvent( 'sales_model_service_quote_submit_failure', array( 'order' => $order, 'quote' => $quote ) );\n\t\t\t\t}\n\n\t\t\t\tthrow $e;\n\t\t\t\tforeach ($this->getOrders( ) as $order) {\n\t\t\t\t\tMage::dispatchEvent( 'sales_model_service_quote_submit_after', array( 'order' => $order, 'quote' => $quote ) );\n\t\t\t\t}\n\n\t\t\t\treturn $this->getOrders( );\n\t\t\t}\n\t\t}",
"public function getAvailableInventoryAttribute(){\n // if deliveredVariantQuantity is not loaded already, let's do it first\n if ( ! $this->relationLoaded('deliveredVariantQuantity')) \n $this->load('deliveredVariantQuantity');\n \n $variant_count = $this->getRelation('deliveredVariantQuantity');\n $delivered_variant = ($variant_count) ? (int) $variant_count->aggregate : 0;\n\n // if fulfilledOrders is not loaded already, let's do it first\n if ( ! $this->relationLoaded('fulfilledOrders')) \n $this->load('fulfilledOrders');\n \n $order_count = $this->getRelation('fulfilledOrders');\n $orders = ($order_count) ? (int) $order_count->aggregate : 0;\n\n return $this->inventory + $delivered_variant - $orders;\n }"
] | [
"0.57488465",
"0.5644555",
"0.56427026",
"0.5605711",
"0.5546643",
"0.5543224",
"0.5498158",
"0.5474255",
"0.5441624",
"0.54097533",
"0.54002726",
"0.53824633",
"0.53386444",
"0.5338484",
"0.5335105",
"0.52972096",
"0.5291799",
"0.5289368",
"0.5273773",
"0.52707714",
"0.5257145",
"0.5227101",
"0.5205741",
"0.52007014",
"0.5198817",
"0.5191115",
"0.5188476",
"0.51733637",
"0.5167435",
"0.5162025"
] | 0.7924075 | 0 |
function to display paging | function RenderPaging($in_totRecord,$in_recPerPage, $in_currPage = 1)
{
global $pagingMax;
$selisih = 3;
if ($in_currPage == 1) $strPaging .= " First Prev ";
else {
$strPaging .= "<A HREF=\"".$this->_page."?currentPage="."1"."&recPerPage=".$in_recPerPage.$this->_newQString."\">First</A>\n";
$strPaging .= "<A HREF=\"".$this->_page."?currentPage=".($in_currPage - 1)."&recPerPage=".$in_recPerPage.$this->_newQString."\">Prev</A>\n";
}
$strPaging .= " | \n";
if (strtoupper($in_recPerPage) != "ALL") $pagingNum = ceil($in_totRecord/$in_recPerPage);
else $pagingNum = 1;
if($pagingNum <= $pagingMax) $atas = 1;
else{
$sisa = $in_currPage + $selisih;
$sisa2 = $sisa - $pagingMax;
if($sisa2 <= 0) $atas = 1;
elseif($sisa<=$pagingNum) $atas = $sisa2 + 1;
else $atas = $pagingNum - $pagingMax + 1;
}
if($pagingNum <= $pagingMax) $bawah = $pagingNum;
else $bawah=($atas+$pagingMax-1);
for ($i=$atas; $i<=$bawah; $i++) {
if ($i == $in_currPage) $strPaging .= $i." \n";
else $strPaging .= "<A HREF=\"".$this->_page."?currentPage=".$i."&recPerPage=".$in_recPerPage.$this->_newQString."\">$i</A> \n" ;
}
$strPaging .= " | \n";
if ($in_currPage == $pagingNum || $in_totRecord == 0) $strPaging .= "Next Last\n";
else {
$strPaging .= "<A HREF=\"".$this->_page."?currentPage=".($in_currPage + 1)."&recPerPage=".$in_recPerPage.$this->_newQString."\">Next</A>\n";
$strPaging .= "<A HREF=\"".$this->_page."?currentPage=".$pagingNum."&recPerPage=".$in_recPerPage.$this->_newQString."\">Last</A>\n";
}
return $strPaging;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function NewshowPaging()\n\t\t{\n\t\t\tglobal $PAGE_TOTAL_ROWS;\n\t\t\tglobal $PAGE_LIMIT;\n\t\t\tglobal $PAGE_URL;\n\t\t\tglobal $DISPLAY_PAGES;\n\t\t\t\n\t\t\t@$numofpages = ceil($PAGE_TOTAL_ROWS / $PAGE_LIMIT);\n\t\t\t$pages = ((empty($_GET['pages']))?1:$_GET['pages']);\n\t\t\t$page = ((empty($_GET['page']))?1:$_GET['page']);\n\t\t\t$filename = $PAGE_URL;\n\t\t\t$displayPages = (($DISPLAY_PAGES < 1)?10:$DISPLAY_PAGES);\n\n\t\t\tif(strlen(trim($filename)) > 0)\n\t\t\t{\t//echo \"filename : \".$filename;\t\t\n\t\t\t\t$file = split(\"-\",$filename);\n\t\t\t\t//echo \"filename : \".print_r($file);\n\t\t\t\tif(sizeof($file) == 1)\n\t\t\t\t{\n\t\t\t\t\t$_file = $file[0].\"?\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tfor($m=1;$m<sizeof($file);$m++)\t{\t$fn.= $file[$m].\"&\";\t}\n\t\t\t\t\t$_file = $file[0].\"?\".$fn;\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\tif($pages > 1)\n\t\t\t{\n\t\t\t\t$pageprev = $pages-$displayPages;\n\t\t\t\t$working_data = \"<a href=\".$_file.\"pages=\".$pageprev.\" class=\\\"nopage\\\" style=\\\"color:#000000\\\">PREV</a> \";\n\t\t\t}\n\t\t\t\t\t\n\t\t\t for($i = 1; $i <=$numofpages; $i++)\n\t\t\t {\n\t\t\t\tif($i == $page) \n\t\t\t\t{\n\t\t\t\t\t$selectedPage = (($page == $i)?\"style='font-weight:normal;'\":\"\");\n\t\t\t\t\t$working_data.= \"<a href=\".$_file.\"pages=\".$pages.\"&page=\".$i.\" class=\\\"selectedpage\\\"><strong>\".$i.\"</strong></a> \";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t $working_data.= \"<a href=\".$_file.\"pages=\".$pages.\"&page=\".$i.\" class=\\\"nopage\\\">\".$i.\"</a> \";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t }\n\t\t\t\n\t\t\tif($pages + $displayPages <= $numofpages)\n\t\t\t{\n\t\t\t\t$pagenext = ($pages + $displayPages);\n\t\t\t\t$working_data.= \"<a href=\".$_file.\"pages=\".$pagenext.\" class=\\\"grey-txt\\\">NEXT</a>\";\n\t\t\t}\n\t\t\t\n\t\t\treturn \"<span class=\\\"text\\\">Page: </span>\".((empty($working_data))?0:$working_data);\n\t\t}",
"function paging($p=1, $page, $num_page, $num_record, $click='href', $extra='')\n{\n\t$pnumber = '';\n\techo '<div class=\"box_paging\">';\n\tif($p>1){\n\t\t$previous=$p-1;\n\t\techo '<a '.$click.'=\"'.$page.$previous.$extra.'\">«</a> ';\n\t}\n\tif($p>3) echo '<a '.$click.'=\"'.$page.'1'.$extra.'\">1</a> ';\n\tfor($i=$p-2;$i<$p;$i++){\n\t if($i<1) continue;\n\t $pnumber .= '<a '.$click.'=\"'.$page.$i.$extra.'\">'.$i.'</a> ';\n\t}\n\t$pnumber .= ' <a class=\"active\" id=\"active\">'.$p.'</a> ';\n\tfor($i=$p+1;$i<($p+3);$i++){\n\t if($i>$num_page) break;\n\t $pnumber .= '<a '.$click.'=\"'.$page.$i.$extra.'\">'.$i.'</a> ';\n\t}\n\t$pnumber .= ($p+2<$num_page ? ' <a '.$click.'=\"'.$page.$num_page.$extra.'\">'.$num_page.'</a> ' : \" \");\n\techo $pnumber;\n\tif($p<$num_page){\n\t\t$next=$p+1;\n\t\techo '<a '.$click.'=\"'.$page.$next.$extra.'\">»</a>';\n\t}\n\techo '<span>Total: <b>'.$num_record.'</b> Records</span>';\n\techo '</div>';\n}",
"function odin_paging_nav() {\n\t\t$mid = 2; // Total of items that will show along with the current page.\n\t\t$end = 1; // Total of items displayed for the last few pages.\n\t\t$show = false; // Show all items.\n\n\t\techo odin_pagination( $mid, $end, false );\n\t}",
"public function showPageResults() {\n $fullResults = $this->buildResults();\n foreach($fullResults as $item) {\n echo $item->displayTeaser() . \"\\n\";\n }\n echo \"{$this->getCount()} records of {$this->totalRows}. \\n\";\n }",
"private function pagination() {\n\t\t$this->line(\"Page: <fg=green>\" . $this->page['current'] . \" of \" . $this->page['total'] . \"</>\");\n\t\t$this->line(\"Page size: <fg=green>\" . $this->page['size'] . \"</>\");\n\t}",
"function showpages($table,$count) {\r\n global $limit_first,$per_page,$per_pagination;\r\n\r\n if($count<=$per_page) {\r\n return '';\r\n }\r\n\r\n $limit_first = (isset($_REQUEST['pagination'])) ? $_REQUEST['pagination']*$per_page : 0;\r\n $limit_last = min($limit_first + $per_page,$count);\r\n\r\n if($count==0) echo \"<p>No results.</p>\";\r\n else {\r\n echo \"<p>$count results.\";\r\n if($count > $per_page) echo \" Showing results $limit_first to $limit_last.\";\r\n echo \"</p>\";\r\n }\r\n\r\n if($count>$per_page) {\r\n // figure out the first and last button to display\r\n $last_page=ceil((float)$count/$per_page);\r\n $current_page=floor($limit_first/$per_page);\r\n $start=$current_page-$per_pagination/2;\r\n $end=$current_page+$per_pagination/2;\r\n if($start<0) {\r\n $start=0;\r\n $end=$start+$per_pagination;\r\n }\r\n if($end>$last_page) {\r\n $end=$last_page;\r\n $start=$end-$per_pagination;\r\n if($start<0) $start=0;\r\n }\r\n\r\n // find the next/prev buttons\r\n $next=min($current_page+1,$last_page-1);\r\n $prev=max($current_page-1,0);\r\n\r\n // build the URL to link to\r\n $url = parse_url($_SERVER['REQUEST_URI']);\r\n $q = (isset($url['query'])) ? explode('&',$url['query']) : array();\r\n foreach($q as $k=>$v) {\r\n if(strncasecmp($v, \"pagination\",10)==0) {\r\n unset($q[$k]);\r\n break;\r\n }\r\n }\r\n $link=$url['path'].'?'.implode('&',$q);\r\n\r\n // build the buttons\r\n $buttons='';\r\n for($i=$start;$i<$end;++$i) {\r\n $buttons.=\"<a class='btn page-$i' href='$link&pagination=$i'>$i</a>\";\r\n }\r\n $buttons=str_replace(\"page-$current_page'\",\"page-$current_page this-page'\",$buttons);\r\n\r\n echo \"<div class='btn-toolbar center'>\r\n <div class='btn-group'>\r\n <a class='btn' href='$link&pagination=0'><<</a>\r\n <a class='btn' href='$link&pagination=$prev'><</a>\r\n </div>\r\n <div class='btn-group'>$buttons</div>\r\n <div class='btn-group'>\r\n <a class='btn' href='$link&pagination=$next'>></a>\r\n <a class='btn' href='$link&pagination=\".($last_page-1).\"'>>></a>\r\n </div>\r\n </div>\";\r\n }\r\n\r\n return \"LIMIT $limit_first, $per_page\";\r\n}",
"function bbp_get_paged()\n{\n}",
"function pager($range = PAGINATION_RANGE, $pages = 'total', $prevnext = TRUE, $prevnext_always = FALSE, $firstlast = TRUE, $firstlast_always = FALSE) {\n extract( $this->kernel->params );\n $result_array = array();\n\n $total_items = $result_array[\"total_items\"] = $this->filter[\"total_items\"];\n $per_page = $this->filter[\"per_page\"];\n $start = $this->filter[\"start\"];\n\n // First, check on a few parameters to see if they're ok, we don't want negatives\n $total_items = ($total_items < 0) ? 0 : $total_items;\n $per_page = ($per_page < 1) ? 1 : $per_page;\n $range = ($range < 1) ? 1 : $range;\n $sel_page = 1;\n\n $float_val = $total_items / $per_page;\n $int_val = (int) $float_val;\n $reminder = $float_val - $int_val;\n $last_page_calc = round( $per_page * $reminder);\n $total_pages = $int_val + ($last_page_calc >= 1 ? 1 : 0);\n\n // Are there more than one pages to show? If not, this section will be skipped,\n // and only the pages_text will be shown\n if ($total_pages > 1) {\n // The page we are on\n $sel_page = round($start / $per_page) + 1;\n\n // The ranges indicate how many pages should be displayed before and after\n // the selected one. Here, it will check if the range is an even number,\n // and adjust the ranges appropriately. It will behave best on non-even numbers\n $range_min = ($range % 2 == 0) ? ($range / 2) - 1 : ($range - 1) / 2;\n $range_max = ($range % 2 == 0) ? $range_min + 1 : $range_min;\n $page_min = $sel_page - $range_min;\n\n $page_max = $sel_page + $range_max;\n\n // This parts checks whether the ranges are 'out of bounds'. If we're at or near\n // the 'edge' of the pagination, we will start or end there, not at the range\n $page_min = ($page_min < 1) ? 1 : $page_min;\n $page_max = ($page_max < ($page_min + $range - 1)) ? $page_min + $range - 1 : $page_max;\n if ($page_max > $total_pages) {\n $page_min = ($page_min > 1) ? $total_pages - $range + 1 : 1;\n $page_min = ($page_min < 1) ? 1 : $page_min;\n $page_max = $total_pages;\n }\n\n // Build the links\n for ($i = $page_min;$i <= $page_max;$i++)\n $result_array[\"pages\"][] = array( (($i - 1) * $per_page), $i );\n\n // Do we got previous and next links to display?\n if (($prevnext) || (($prevnext) && ($prevnext_always))) {\n // Aye we do, set what they will look like\n $prev_num = (($prevnext === 'num') || ($prevnext === 'nump')) ? $sel_page - 1 : '';\n $next_num = (($prevnext === 'num') || ($prevnext === 'numn')) ? $sel_page + 1 : '';\n\n // Display previous link?\n if (($sel_page > 1) || ($prevnext_always)) {\n $start_at = ($sel_page - 2) * $per_page;\n $start_at = ($start_at < 0) ? 0 : $start_at;\n $result_array[\"prev_page\"] = $start_at;\n }\n // Next link?\n if (($sel_page < $total_pages) || ($prevnext_always)) {\n $start_at = $sel_page * $per_page;\n $start_at = ($start_at >= $total_items) ? $total_items - $per_page : $start_at;\n $result_array[\"next_page\"] = $start_at;\n }\n }\n\n // This part is just about identical to the prevnext links, just a few minor\n // value differences\n if (($firstlast) || (($firstlast) && ($firstlast_always))) {\n $first_num = (($firstlast === 'num') || ($firstlast === 'numf')) ? 1 : '';\n $last_num = (($firstlast === 'num') || ($firstlast === 'numl')) ? $total_pages : '';\n\n $first_txt = sprintf($first_txt, $first_num);\n $last_txt = sprintf($last_txt, $last_num);\n\n if ((($sel_page > ($range - $range_min)) && ($total_pages > $range)) || ($firstlast_always))\n $result_array[\"first_page\"] = 0;\n\n if ((($sel_page < ($total_pages - $range_max)) && ($total_pages > $range)) || ($firstlast_always))\n $result_array[\"last_page\"] = ($total_pages - 1) * $per_page;\n\n }\n }\n\n // Display pages text?\n if ($pages) {\n $result_array[\"total_pages\"] = $total_pages;\n $result_array[\"selected_page\"] = $sel_page;\n }\n\n return $result_array;\n\n }",
"public function paginate();",
"function show_paging_bar($totalcount,$paging,$baseurl){\n\t\t$pagevar=\"pageno\";\n\t\t$baseurl->params(array('perpage'=>$paging->perpage,'sort'=>$paging->sort));\n \treturn $this->output->paging_bar($totalcount,$paging->pageno,$paging->perpage,$baseurl,$pagevar);\n }",
"public function printPagination() {\n\t\techo \"\\n\t\t\t\t\t<div class=\\\"pagination\\\">\\n\t\t\t\t\t\t\";\n\t\tfor ($i = 1; $i <= $this->nopages; $i++) {\n\t\t\tif ($i == $this->page)\n\t\t\t\techo \"<em>{$i}</em>\";\n\t\t\telse\n\t\t\t\techo \"<a href=\\\"\" . $this->getUrl(\"order\") . \"/\" . $i . \"/\" . $this->pagesize . \"\\\">$i</a>\";\n\t\t}\n\t\techo \"\\n\t\t\t\t\t</div>\\n\";\n\t\t$this->printSorting();\n\t}",
"public function handlesOrderedPaging();",
"public function handlesOrderedPaging();",
"public function render() {\r\n\t\r\n\t\t$stages = 3;\r\n\t\t$page = Database::getInstance()->orm->driver->escape($_GET[$this->variable]);\r\n\r\n\t\t// Initial page num setup\r\n\t\tif ($page == 0){$page = 1;}\r\n\t\t$prev = $page - 1;\t\r\n\t\t$next = $page + 1;\t\t\t\t\t\t\t\r\n\t\t$lastpage = ceil($this->total_pages/$this->limit);\t\t\r\n\t\t$LastPagem1 = $lastpage - 1;\t\t\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t$paginate = '';\r\n\t\tif($lastpage > 1) {\t\r\n\t\r\n\t\t\t$paginate .= \"<div class='\".$this->class.\"'>\";\r\n\t\t\t// Previous\r\n\t\t\tif ($page > 1){\r\n\t\t\t\t$paginate.= \"<a href='\".$this->page.\"?\".$this->variable.\"=\".$prev.\"'>\".$this->previous.\"</a>\";\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\t$paginate.= \"<span class='\".$this->classDisabled.\"'>\".$this->previous.\"</span>\";\t}\r\n\t\t\t\r\n\r\n\t\t\r\n\t\t// Pages\t\r\n\t\tif ($lastpage < 7 + ($stages * 2))\t// Not enough pages to breaking it up\r\n\t\t{\t\r\n\t\t\tfor ($counter = 1; $counter <= $lastpage; $counter++)\r\n\t\t\t{\r\n\t\t\t\tif ($counter == $page){\r\n\t\t\t\t\t$paginate.= \"<span class='\".$this->classCurrent.\"'>$counter</span>\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$paginate.= \"<a href='\".$this->page.\"?\".$this->variable.\"=$counter'>$counter</a>\";}\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\telseif($lastpage > 5 + ($stages * 2))\t// Enough pages to hide a few?\r\n\t\t{\r\n\t\t\t// Beginning only hide later pages\r\n\t\t\tif($page < 1 + ($stages * 2))\t\t\r\n\t\t\t{\r\n\t\t\t\tfor ($counter = 1; $counter < 4 + ($stages * 2); $counter++)\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($counter == $page){\r\n\t\t\t\t\t\t$paginate.= \"<span class='\".$this->classCurrent.\"'>$counter</span>\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$paginate.= \"<a href='\".$this->page.\"?\".$this->variable.\"=$counter'>$counter</a>\";}\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t$paginate.= \"...\";\r\n\t\t\t\t$paginate.= \"<a href='\".$this->page.\"?\".$this->variable.\"=$LastPagem1'>$LastPagem1</a>\";\r\n\t\t\t\t$paginate.= \"<a href='\".$this->page.\"?\".$this->variable.\"=$lastpage'>$lastpage</a>\";\t\t\r\n\t\t\t}\r\n\t\t\t// Middle hide some front and some back\r\n\t\t\telseif($lastpage - ($stages * 2) > $page && $page > ($stages * 2))\r\n\t\t\t{\r\n\t\t\t\t$paginate.= \"<a href='\".$this->page.\"?\".$this->variable.\"=1'>1</a>\";\r\n\t\t\t\t$paginate.= \"<a href='\".$this->page.\"?\".$this->variable.\"=2'>2</a>\";\r\n\t\t\t\t$paginate.= \"...\";\r\n\t\t\t\tfor ($counter = $page - $stages; $counter <= $page + $stages; $counter++)\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($counter == $page){\r\n\t\t\t\t\t\t$paginate.= \"<span class='\".$this->classCurrent.\"'>$counter</span>\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$paginate.= \"<a href='\".$this->page.\"?\".$this->variable.\"=$counter'>$counter</a>\";}\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t$paginate.= \"...\";\r\n\t\t\t\t$paginate.= \"<a href='\".$this->page.\"?\".$this->variable.\"=$LastPagem1'>$LastPagem1</a>\";\r\n\t\t\t\t$paginate.= \"<a href='\".$this->page.\"?\".$this->variable.\"=$lastpage'>$lastpage</a>\";\t\t\r\n\t\t\t}\r\n\t\t\t// End only hide early pages\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$paginate.= \"<a href='\".$this->page.\"?\".$this->variable.\"=1'>1</a>\";\r\n\t\t\t\t$paginate.= \"<a href='\".$this->page.\"?\".$this->variable.\"=2'>2</a>\";\r\n\t\t\t\t$paginate.= \"...\";\r\n\t\t\t\tfor ($counter = $lastpage - (2 + ($stages * 2)); $counter <= $lastpage; $counter++)\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($counter == $page){\r\n\t\t\t\t\t\t$paginate.= \"<span class='\".$this->classCurrent.\"'>$counter</span>\";\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$paginate.= \"<a href='\".$this->page.\"?\".$this->variable.\"=$counter'>$counter</a>\";}\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t// Next\r\n\t\tif ($page < $counter - 1){ \r\n\t\t\t$paginate.= \"<a href='\".$this->page.\"?\".$this->variable.\"=$next'>\".$this->next.\"</a>\";\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$paginate.= \"<span class='\".$this->classDisabled.\"'>\".$this->next.\"</span>\";\r\n\t\t}\r\n\t\t$paginate.= \"</div>\";\t\t\r\n\t\t\r\n\t\techo $paginate;\r\n\t\t}\r\n\t}",
"public function per_page();",
"function displayPaginationBelow($per_page,$page){\r\n\t\t\t$page_url=$_SESSION['FON_SESS_FILTER_URL'];//page link\r\n\t\t\t$total = $_SESSION['FON_SESS_NUM_ROWS'];\r\n\t\t\t$adjacents = \"2\";\r\n\t\t\t$page = ($page == 0 ? 1 : $page);\r\n\t\t\t$start = ($page - 1) * $per_page;\r\n\t\t\t$prev = $page - 1;\r\n\t\t\t$next = $page + 1;\r\n\t\t\t$setLastpage = ceil($total/$per_page);\r\n\t\t\t$lpm1 = $setLastpage - 1;\r\n\t\t\t$setPaginate = \"\";\r\n\t\t\tif($setLastpage > 1){\r\n\t\t\t$setPaginate .= \"<ul id='pagination' class='pagination pull-right'>\";\r\n\t\t\t$setPaginate .= \"<li class='setPage'>Page $page of $setLastpage</li>\";\r\n\t\t\tif ($setLastpage < 7 + ($adjacents * 2))\r\n\t\t\t{\r\n\t\t\tfor ($counter = 1; $counter <= $setLastpage; $counter++)\r\n\t\t\t{\r\n\t\t\tif ($counter == $page)\r\n\t\t\t$setPaginate.= \"<li><a class='current_page'>$counter</a></li>\";\r\n\t\t\telse\r\n\t\t\t$setPaginate.= \"<li><a OnClick='getdata($counter)' href='javascript:void(0);'>$counter</a></li>\";\r\n\t\t\t}\r\n\t\t\t}\r\n\t\t\telseif($setLastpage > 5 + ($adjacents * 2))\r\n\t\t\t{\r\n\t\t\tif($page < 1 + ($adjacents * 2))\r\n\t\t\t{\r\n\t\t\tfor ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++)\r\n\t\t\t{\r\n\t\t\tif ($counter == $page)\r\n\t\t\t$setPaginate.= \"<li><a class='current_page'>$counter</a></li>\";\r\n\t\t\telse\r\n\t\t\t$setPaginate.= \"<li><a OnClick='getdata($counter)' href='javascript:void(0);'>$counter</a></li>\";\r\n\t\t\t}\r\n\t\t\t$setPaginate.= \"<li class='dot'>...</li>\";\r\n\t\t\t$setPaginate.= \"<li><a OnClick='getdata($lpm1)' href='javascript:void(0);'>$lpm1</a></li>\";\r\n\t\t\t$setPaginate.= \"<li><a OnClick='getdata($setLastpage)' href='javascript:void(0);'>$setLastpage</a></li>\";\r\n\t\t\t}\r\n\t\t\telseif($setLastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2))\r\n\t\t\t{\r\n\t\t\t$setPaginate.= \"<li><a href='javascript:void(0);' OnClick='getdata(1)'>1</a></li>\";\r\n\t\t\t$setPaginate.= \"<li><a href='javascript:void(0);' OnClick='getdata(2)'>2</a></li>\";\r\n\t\t\t$setPaginate.= \"<li class='dot'>...</li>\";\r\n\t\t\tfor ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++)\r\n\t\t\t{\r\n\t\t\tif ($counter == $page)\r\n\t\t\t$setPaginate.= \"<li><a class='current_page'>$counter</a></li>\";\r\n\t\t\telse\r\n\t\t\t$setPaginate.= \"<li><a href='javascript:void(0);' OnClick='getdata($counter)'>$counter</a></li>\";\r\n\t\t\t}\r\n\t\t\t$setPaginate.= \"<li class='dot'>..</li>\";\r\n\t\t\t$setPaginate.= \"<li><a href='javascript:void(0);' OnClick='getdata($lpm1)'>$lpm1</a></li>\";\r\n\t\t\t$setPaginate.= \"<li><a href='javascript:void(0);' OnClick='getdata($setLastpage)'>$setLastpage</a></li>\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t$setPaginate.= \"<li><a href='javascript:void(0);' OnClick='getdata(1)'>1</a></li>\";\r\n\t\t\t$setPaginate.= \"<li><a href='javascript:void(0);' OnClick='getdata(2)'>2</a></li>\";\r\n\t\t\t$setPaginate.= \"<li class='dot'>..</li>\";\r\n\t\t\tfor ($counter = $setLastpage - (2 + ($adjacents * 2)); $counter <= $setLastpage; $counter++)\r\n\t\t\t{\r\n\t\t\tif ($counter == $page)\r\n\t\t\t$setPaginate.= \"<li><a class='current_page'>$counter</a></li>\";\r\n\t\t\telse\r\n\t\t\t$setPaginate.= \"<li><a href='javascript:void(0);' OnClick='getdata($counter)'>$counter</a></li>\";\r\n\t\t\t}\r\n\t\t\t}\r\n\t\t\t}\r\n\t\t\r\n\t\t\tif ($page < $counter - 1){\r\n\t\t\t$setPaginate.= \"<li><a href='javascript:void(0);' OnClick='getdata($next)'>Next</a></li>\";\r\n\t\t\t$setPaginate.= \"<li><a href='javascript:void(0);' OnClick='getdata($setLastpage)'>Last</a></li>\";\r\n\t\t\t}else{\r\n\t\t\t$setPaginate.= \"<li><a class='current_page'>Next</a></li>\";\r\n\t\t\t$setPaginate.= \"<li><a class='current_page'>Last</a></li>\";\r\n\t\t\t}\r\n\t\t\r\n\t\t\t$setPaginate.= \"</ul>\\n\";\r\n\t\t}\r\n\t\treturn $setPaginate;\r\n\t\t}",
"function pagination($cn,$count)\r\n{\r\n \t$prev=1;\r\n\t$next=1;\r\n \t\r\n\tif($cn==1)\r\n\t$prev=$cn;\r\n\telse\r\n\t$prev=$cn-1;\r\n\t\r\n\tif($cn==$count)\r\n\t$next=$cn;\r\n\telse\r\n\t$next=$cn+1;\r\n\t\r\n\t \r\n\t \r\n\t\t $output='\r\n\t \r\n\t \r\n \r\n <tr >\r\n <td colspan=\"2\">\r\n <div class=\"pagenation\">\r\n <ul>\r\n <li><a href=\"viewarticals.php?&page='.$prev.'\">Prev</a></li> \r\n\t';\r\n\t\r\n\t\t if($count>0)\r\n\t\t {\r\n\t\t\tfor($i=1;$i<=$count;$i++)\r\n\t\t\t$output.='\r\n\t\t\t <li><a href=\"viewarticals.php?&page='.$i.'\">'.$i.'</a></li>\r\n\t\t\t \r\n\t\t\t ';\r\n\t\t }//count if\r\n \r\n\r\n \r\n\t $output.='\r\n\t \r\n\t \r\n\t <li><a href=\"viewarticals.php?&page='.$next.'\">Next</a></li>\r\n\t \r\n\t </ul>\r\n </div>\r\n\t\r\n\t</td>\r\n\t \r\n\t</tr>\r\n ';\r\n\t \r\n\t \r\n\t \r\n\treturn $output; \r\n\t\r\n}",
"abstract protected function getPaginationView();",
"function drawPager($records, $p, $rpp, $q_encoded) {\n ?>\n <script type=\"text/javascript\">\n //<![CDATA[\n <?php\n for ($i = $rpp; $i < $records; $i ++) {\n echo 'document.getElementById(\"r'.$i.'\").style.display=\"none\";'.\"\\n\";\n }\n ?>\n //]]>\n </script>\n <?php\n echo '<p class=\"s_text\">';\n echo 'View Page: ';\n $j = 1;\n for ($i = 1; $i <= $records; $i += $rpp) {\n echo '<input type=\"button\" name=\"page'.$j.'\" value=\"'.$j.'\" onclick=\"'.pagerShow($i, $rpp, $records).'\" />';\n echo ' ';\n $j ++;\n }\n echo '</p>';\n}",
"function paging($pIntPageNo,$intNumRows)\n\t{\n\t\t$objAdminDAO = new AdminDAO();\n\t\t$recordLimit = $objAdminDAO->getPagingLimit();;\n\t\t$pagesLimit = $objAdminDAO->getPagesLimit();\n\t\t$intNumPages = ceil($intNumRows / $recordLimit);\n\n\t\t$intStartPage=1;\n\t\t$intEndPage=$intNumPages;\n\n\t\tif($intNumPages>$pagesLimit)\n\t\t{\n\t\t\t$intEndPage=$pagesLimit;\n\t\t\t$intMidPageValue=ceil($pagesLimit/2);\n\t\t\t\n\t\t\tif($pIntPageNo>$intMidPageValue)\n\t\t\t{\n\t\t\t\t$intStartPage=$pIntPageNo-$intMidPageValue+1;\n\t\t\t\t$intEndPage=$pIntPageNo+$intMidPageValue-1;\n\t\t\t\tif(($pIntPageNo-1)>($intNumPages-$intMidPageValue))\n\t\t\t\t{\n\t\t\t\t\t$intStartPage=$intNumPages-$pagesLimit+1;\n\t\t\t\t\t$intEndPage=$intNumPages;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($intNumRows>=$recordLimit) \n\t\t{\n\t\t\t$stringHtml=\"\";\n\t\t\tif($pIntPageNo <= 1) \n\t\t\t{\n\t\t\t\t$stringHtml.=\"<img border=0 align=middle src=/ImageFiles/common/paging/pre.gif>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$pvs = $pIntPageNo -1;\n\t\t\t\t$stringHtml.=\"<a class=links href=# onclick=GoToPage(\". $pvs .\")><img border=0 align=middle src=/ImageFiles/common/paging/pre.gif></a>\";\n\t\t\t}\n\t\t\t\t \n\t\t\tfor($_i = $intStartPage ; $_i <= $intEndPage ; $_i++)\n\t\t\t{\n\t\t\t\tif($_i == $pIntPageNo) \n\t\t\t\t{\n\t\t\t\t\t$stringHtml.= \" <font color=black>\".$_i.\"</font> \";\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$stringHtml.= \" <a href=# onclick=GoToPage('\".$_i.\"') class=LinkSmall>\".$_i.\"</a> \";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif($pIntPageNo >= $intNumPages)\n\t\t\t{\n\t\t\t\t$stringHtml.= \"<img border=0 align=middle src=/ImageFiles/common/paging/next.gif><br>(Total Pages:\".$intNumPages.\")\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$nxt = $pIntPageNo + 1;\n\t\t\t\t$stringHtml.= \"<a class=links href=# onclick=GoToPage('\". $nxt .\"')><img border=0 align=middle src=/ImageFiles/common/paging/next.gif></a><br>(Total Pages:\".$intNumPages.\")\";\n\t\t\t}\n\t\t}\n\t\treturn $stringHtml;\n\t}",
"function show_pages($data){\n\t\t\n\t\t$total_pages = $data->headers->{'X-WP-TotalPages'};\n\t\t//$page_requested = $_GET['page'];\n\t\t$current_page = (isset($_GET['page'])) ? $_GET['page'] : '1';\n\n\t\tif($total_pages > 1){\n\t\t\n\t\t// echo pages li based on page total\n\t\techo '<ul class=\"block-selector\">';\n\t\tfor($i = 1; $i <= $total_pages; ++$i) {\n\t\t\t\n\t\t\t$class = ($current_page == $i) ? 'class=\"current-page\"' : '';\n\n\t\t\t$_GET['page'] = $i;\n\t\t\t$url_query = http_build_query($_GET);\n\t\t\t\t\t\t\n\t\t\techo '<li><a href=\"?'.$url_query.'\" '.$class.'>'.$i.'</a></li>';\n\t\t}\n\t\techo '</ul>';\n\t\t\n\t\t$_GET['page'] = $current_page;\n\t\t\n\t\t}\n\t}",
"function ShowArticlesByPages()\n {\n $this->PageUser->h1 = $this->multi['TXT_ARTICLE_TITLE'];\n $this->PageUser->breadcrumb = '';\n\n $articles = $this->GetArticlesRows('limit');\n\n $pages = '';\n if (count($articles) > 0) {\n $n_rows = $this->GetArticlesRows('nolimit');\n $link = $this->Link($this->category, NULL);\n $pages = $this->Form->WriteLinkPagesStatic($link, $n_rows, $this->display, $this->start, $this->sort, $this->page);\n }\n\n echo View::factory('/modules/mod_article/templates/tpl_article_by_pages.php')\n ->bind('articles', $articles)\n ->bind('multi', $this->multi)\n ->bind('pages', $pages);\n }",
"function prt_pagination($query, $page_from, $page_size, $page_cp, $list_count, $type, $suje) {\r\n\r\n\techo '\r\n\t\t\t <!-- Pagination -->\r\n\t\t\t <div class=\"row text-center\">\r\n\t\t\t\t\t<div class=\"col-lg-12\">\r\n\t\t\t\t\t\t<ul class=\"pager\">\r\n\t';\r\n\t// -- echo.\r\n\r\n\t// 이전보기 구현\r\n\tif ($page_from > 0) {\r\n\t\t$cur_from = $page_from - $page_size;\r\n\t\techo '\r\n\t\t\t\t\t\t\t<li>\r\n\t\t\t\t\t\t\t\t<a href=\"./search.php?q='.$query.'&from=0&size='.$page_size.'&cp='.$page_cp.'&type='.$type.'&suje='.$suje.'\"> 처음으로 </a>\r\n\t\t\t\t\t\t\t</li>\r\n\t\t\t\t\t\t\t<li>\r\n\t\t\t\t\t\t\t\t<a href=\"./search.php?q='.$query.'&from='.$cur_from.'&size='.$page_size.'&cp='.$page_cp.'&type='.$type.'&suje='.$suje.'\"> 이전 </a>\r\n\t\t\t\t\t\t\t</li>\r\n\t\t';\r\n\t\t// -- echo.\r\n\t}\r\n\r\n\t// 더보기 구현\r\n\tif ($list_count == $page_size) {\r\n\t\t$next_from = $page_from + $page_size;\r\n\t\techo '\r\n\t\t\t\t\t\t\t<li>\r\n\t\t\t\t\t\t\t\t<a href=\"./search.php?q='.$query.'&from='.$next_from.'&size='.$page_size.'&cp='.$page_cp.'&type='.$type.'&suje='.$suje.'\"> 다음 </a>\r\n\t\t\t\t\t\t\t</li>\r\n\t\t';\r\n\t\t// -- echo.\r\n\t}\r\n\r\n\r\n\t// pagination 마무리.\r\n\techo '\r\n\t\t\t\t\t\t</ul>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</div>\r\n\t\t\t\t<!-- /.row -->\r\n\r\n\t\t\t\t<hr>\r\n\t';\r\n\t// -- echo.\r\n}",
"public function getPages();",
"public function Show_Pagination($link,$get='page',$div_class_name='pagination')\n\t{\n\n\tif($this->Pages==1)return;\n\n\t//$link is the addres of current page\n\t\n\t//$get is name of get method\n\n\t//echo pagination's div\n\t\n\techo'<div class=\"'.$div_class_name.'\">';\n\techo '<ul class=\"maut\">';\n\t//echo pre button\n\t\n\tif($this->Page_number>1)echo '<li><a href=\"'.$link.$get.'/'.($this->Page_number -1 ).'\">Ant</a></li>';\n\t\n\telse echo '<li class=\"gray\"><a>Ant</a></li>';\n\t\n\t//print button\n\t\n\t$this->Buttons=(int)$this->Buttons;\n\t\n\t$start_counter\t=\t$this->Page_number-floor($this->Buttons/2);\t\t\t//for normal mode\n\t\n\t$end_conter\t\t=\t$this->Page_number+floor($this->Buttons/2);\t\t\t//for normal mode\n\t\n\t//try to buttons exactly equal to $Buttons\n\t\n\tif($start_counter<1) $end_conter=$end_conter+abs($start_counter);\t\t\n\t\n\tif($end_conter>$this->Pages) $start_counter=$start_counter-($end_conter-$this->Pages);\n\t\n\tif(($this->Page_number-floor($this->Buttons/2))<1)$end_conter ++;\n\t\n\t\n\t\n\tfor ($i=$start_counter;$i<=$end_conter;$i++)\n\t\t\t{\n\t\n\t\t\tif($i>$this->Pages || $i<1)continue;\t\t//no print less than 1 value or grater than totall page\n\t\n\t\t\tif($i==$this->Page_number)echo '<li class=\"current\"><a>'.$i.'</a></li>'; \t\t// change current page' class\n\t\n\t\t\telse echo '<li><a href=\"'.$link.$get.'/'.$i.'\">'.$i.'</a></li>'; \t// normal pages\n\t\n\t\t\t}\n\t\t\t\n\t\n\t//echo next button\n\t\n\tif($this->Page_number<$this->Pages)echo '<li><a href=\"'.$link.$get.'/'. ($this->Page_number +1 ) .'\">Sig</a></li>';\n\t\n\telse echo '<li class=\"gray\"><a>Sig</a></li>';\t\t\n\t\n\t//close div tag\n\techo '</ul>';\n\techo'</div>';\n\t\n\t}",
"function showpaging_query($table,$query,$file,$pno)\n\t{\n\t\t//\t\t$strResult\t=\t\"\";\n\t\t$this->_table = $table ;\n\t\t$this->_file = $file ;\n\t\t$this->_pno = $pno ;\n\n\t\t$result = mysql_query($query) ;\n\t\t$rows = mysql_num_rows($result) ;\n\t\t$pages = ceil($rows / $this->_limit) ;\n\n\t\t$strResult = \"<table border=\\\"0\\\" cellspacing=\\\"0\\\" cellpadding=\\\"0\\\">\" ;\n\t\t$strResult .= \"<tr>\" ;\n\n\t\t$i = $this->_pno ;\n\t\t$next = $this->_pno + 1 ;\n\t\t$previous = $this->_pno - 1 ;\n\t\t$noOfTImes = 10 ;\n\t\t$noOfTImes = $noOfTImes + $this->_pno ;\n\n\t\tif($noOfTImes>$pages)\n\t\t$noOfTImes = $pages ;\n\n\t\t$im = $pages - 10 ;\n\n\t\tif($i>$im) { $i = $im ; }\n\n\t\tif($i>1)\n\t\t$strResult .= \"<td><font face=\\\"Verdana\\\" size=\\\"1\\\"><a href=\\\"$this->_file?pno=$previous\\\"><u>Previous</u></a></font> </td>\" ;\n\n\t\twhile($i <= $noOfTImes)\n\t\t{\n\t\t\tif($pno==$i){\n\t\t\t\t$strResult .= \"<td><font face=\\\"Verdana\\\" size=\\\"1\\\">$i</font> </td>\" ;\n\t\t\t}else{\n\t\t\t\t$strResult .= \"<td><font face=\\\"Verdana\\\" size=\\\"1\\\"><a href=\\\"$this->_file?pno=$i\\\"><u>$i</u></a></font> </td>\" ;\n\t\t\t}\n\t\t\t$i++ ;\n\t\t}\n\n\t\tif($next<=$pages)\n\t\t$strResult .= \"<td><font face=\\\"Verdana\\\" size=\\\"1\\\"><a href=\\\"$this->_file?pno=$next\\\"><u>Next</u></a></font> </td>\" ;\n\t\t$strResult .= \"</tr>\" ;\n\t\t$strResult .= \"</table>\" ;\n\n\t\techo $strResult;\n\t}",
"public function show() {\n\t\t$pageCount = ceil( $this->total / $this->per_page );\n\t\t$prev = $this->page - 1;\n\t\t$next = $this->page + 1;\n\n\t\t?>\n\n <div class=\"tablenav-pages\">\n <span class=\"pagination-links\">\n <a class=\"button prev-page\" href=\"<?=$_SERVER['REQUEST_URI'] ?>&p=<?=$prev?>\">\n <span class=\"screen-reader-text\">برگه قبل</span>\n <span aria-hidden=\"true\">‹</span>\n </a>\n\n <span id=\"table-paging\" class=\"paging-input\">\n <span class=\"tablenav-paging-text\"><?= $this->page ?> از <span\n class=\"total-pages\"><?= $pageCount ?></span></span>\n </span>\n <a class=\"button next-page\" href=\"<?=$_SERVER['REQUEST_URI'] ?>&p=<?= $next ?>\">\n <span class=\"screen-reader-text\">برگه بعد</span>\n <span aria-hidden=\"true\">›</span>\n </a>\n </span>\n </div>\n\n\t\t<?php\n\t}",
"public function paginate(){\n\t\t$output=\"<table class='table table-striped'>\n\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr style='text-align:center;'> PAGINATION TEST </tr>\n\t\t\t\t\t</thead>\";\n\t\t$offset=(isset($_GET['offset'])) ? $_GET['offset'] : 0;\n\t\t$sql= \" SELECT * FROM \" . $this->databaseTableName. \" ORDER BY customerNumber ASC \" . \" LIMIT \" . $this->limitPerPage . \" OFFSET \". $offset ;\n\t\t$prepared=$this->db->prepare($sql);\n\t\t$prepared->execute();\n\t\t//loops through the prepared object. You can format the html to make it display however you deem fit\n\t\twhile ($valid= $prepared->fetchObject()){\n\t\t\t//You can choose to format it anyway you want to format it . Ensure the object properties are the same with the column names in your table\n\t\t\t$output .=\"\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td> $valid->contactFirstName </td>\n\t\t\t\t\t\t<td>$valid->contactLastName </td>\n\t\t\t\t\t</tr>\n\t\t\t\t\";\n\t\t}\n\t\t$output.=\"</table>\";\n\t\t$output .= $this->printNavBar();\n\t\treturn $output;\n\t}",
"public function print_page()\n {\n $return_page = \"\";\n\n // Use $_GET param to send page number.\n $page = intval($_GET['page']);\n if(empty($page)) $page = 1;\n\n // Calculate amount of pages\n $number = (int)($this->get_total()/$this->get_pnumber());\n if((float)($this->get_total()/$this->get_pnumber()) - $number != 0)\n {\n $number++;\n }\n\n // Link on first page\n $return_page .= \"<a href='$_SERVER[PHP_SELF]?page=1{$this->get_parameters()}'><<</a> ... \";\n // Output link \"Back\" if it is not firs page.\n if($page != 1) $return_page .= \" <a href='$_SERVER[PHP_SELF]?page=\".($page - 1).\"{$this->get_parameters()}'><</a> ... \"; \n \n // Output previous elements\n if($page > $this->get_page_link() + 1) \n { \n for($i = $page - $this->get_page_link(); $i < $page; $i++) \n { \n $return_page .= \"<a href='$_SERVER[PHP_SELF]?page=$i'>$i</a> \"; \n } \n } \n else \n { \n for($i = 1; $i < $page; $i++) \n { \n $return_page .= \"<a href='$_SERVER[PHP_SELF]?page=$i'>$i</a> \"; \n } \n } \n // Output current element\n $return_page .= \"$i \"; \n // Output next elements\n if($page + $this->get_page_link() < $number) \n { \n for($i = $page + 1; $i <= $page + $this->get_page_link(); $i++) \n { \n $return_page .= \"<a href='$_SERVER[PHP_SELF]?page=$i'>$i</a> \"; \n } \n } \n else \n { \n for($i = $page + 1; $i <= $number; $i++) \n { \n $return_page .= \"<a href='$_SERVER[PHP_SELF]?page=$i'>$i</a> \"; \n } \n } \n\n // Output link \"Next\" if it is not first page.\n if($page != $number) $return_page .= \" ... <a href='$_SERVER[PHP_SELF]?page=\".($page + 1).\"{$this->get_parameters()}'>></a>\"; \n // Link on last page.\n $return_page .= \" ... <a href='$_SERVER[PHP_SELF]?page=$number{$this->get_parameters()}'>>></a>\";\n \n return $return_page;\n }",
"public function getPage();"
] | [
"0.799726",
"0.74992836",
"0.7442259",
"0.7346041",
"0.7342998",
"0.7337078",
"0.73115647",
"0.72701895",
"0.7261815",
"0.7250748",
"0.72189087",
"0.7213731",
"0.7213731",
"0.721232",
"0.71737134",
"0.71684843",
"0.7130162",
"0.7123589",
"0.7118756",
"0.71120256",
"0.7104551",
"0.70060974",
"0.7004941",
"0.6951236",
"0.6945084",
"0.69405985",
"0.6939655",
"0.69395196",
"0.6935083",
"0.69285053"
] | 0.7685174 | 1 |
Returns the default TCA array to apply to the table | public function getTca(): array
{
return $this->tca;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addTsTca()\n {\n if (!empty($this->pObj->conf['tca.'][$this->table . '.'])) {\n $tsTca = tx_t3devapi_miscellaneous::stripDotInTsArray($this->pObj->conf['tca.'][$this->table . '.']);\n $this->tca = tx_t3devapi_miscellaneous::arrayMergeRecursiveReplace($this->tca, $tsTca);\n }\n }",
"public function getTable(): TcaTable\n {\n return $this->table;\n }",
"public function getTable(): TcaTable\n {\n return $this->table;\n }",
"static function tableArray(){\n\t\t\t\n\t\t\t$tableArray = array(\"ottobrain_arrays\", \"ottobrain_spartans\", \"ottobrain_vms\", \"queue\", \"requests\");\n\t\t\treturn $tableArray;\n\t\t}",
"public function getTvaCa12Ae() {\n return $this->tvaCa12Ae;\n }",
"public function setTca(array $tca): self\n {\n $this->tca = $tca;\n \n return $this;\n }",
"public function default() : array;",
"public function _getDefaultData()\n {\n return array();\n }",
"public function getDefault()/*# : array */;",
"public function getCdashTable()\n {\n\n $cdashTable = array(\n \"PEPERF\" => \"\",\n \"PEDAT\" => \"PEDTC\",\n \"PETIM\" => \"PEDTC\",\n \"PEDTC\" => \"PEDTC\",\n \"PESPID\" => \"PESPID\",\n \"PETEST\" => \"PETEST\",\n \"PEDESC\" => \"PEORRES\",\n \"PERES\" => \"PEORRES\",\n \"PECLSIG\" => \"\",\n \"PEEVAL\" => \"PEEVAL\"\n );\n\n return $cdashTable;\n }",
"public function getAbattementCga() {\n return $this->abattementCga;\n }",
"public function getClefTable() {\n\t\treturn null;\n\t}",
"public function getTableau(){\n return array (\n \"noCommande\" => $this->getNoCommande(),\n \"dateCommande\" => $this->getDateCommande(),\n \"noClient\" => $this->getNoClient(),\n \"paypalOrderId\" => $this->getPaypalOrderId()\n );\n }",
"protected function getCharsetTable(): array\n {\n if ($this->charsetTable === null) {\n $this->charsetTable = $this->getCollatedFromDb();\n }\n\n return $this->charsetTable;\n }",
"public function getComptesComptables() {\n return $this->comptesComptables;\n }",
"function get_array($table,$lang) {\n\t\t\t$this->table = $table;\n\t\t\t$this->lang = $lang;\n\t\t\t\n\t\t\t$this->column_titles = $this->get_column_titles();\n\t\t\t$this->get_structured_array();\n\t\t\t$this->array_structure = $this->get_structure();\n\t\t\t$this->column_structure = $this->get_column_structure();\n\t\t\t\n\t\t}",
"function SetDefaultTableAttribute($array) {\n foreach ($array as $key => $value) {\n $this->default_settings[\"table\"][$key] = $value;\n }\n }",
"public function cesta() {\n\t\t$sql = \"SELECT COUNT(*) as num_cesta from cesta \n\t\t\twhere id_usuario='\".$this->session->id_usuario.\"' \n\t\t\tAND gestionado='0'\";\n\t\t$num_cesta = $this->db->query($sql)->result();\n\t\tforeach ($num_cesta[0] as $key => $value) {\n\t\t\t$cesta[0][$key] = $value;\n\t\t}\n\t\treturn $cesta;\n\t}",
"function toArray(){\n\t\t$table = get_object_vars ($this);\n\t\treturn $table;\n\t}",
"public function getDefaultData(): array\n {\n return [];\n }",
"public function getDefaultValues(): array;",
"function initialValue()\n {\n return array();\n }",
"public function getTabla()\r\n {\r\n return $this->tabla;\r\n }",
"public function getTabla()\r\n {\r\n return $this->tabla;\r\n }",
"public function getDefaults(): array;",
"public function getTableArray()\n {\n //$sql = 'SELECT b.name AS Name,value as Comment FROM sys.extended_properties a left JOIN sysobjects b ON a.major_id=b.id where a.minor_id=0 and a.name=\\'MS_Description\\'';\n $sql = 'SELECT a.name AS Name,value as Comment FROM sysobjects a left JOIN (select * from sys.extended_properties where minor_id =0) b ON a.id=b.major_id where a.xtype=\\'U\\' and a.name<>\\'sysdiagrams\\'';\n $result = $this->db->query($sql);\n $tableArray = array();\n while ($row = $this->db->fetch($result)) {\n $tableArray[] = $row;\n }\n return $tableArray;\n }",
"function create()\n\t{\n\t\t// Tai file thanh phan\n\t\t$this->CI->load->helper('string');\n\t\t\n\t\t// Tao ma tran\n\t\t$matrix = array();\n\t\tfor ($r = 1; $r <= count($this->key); $r++)\n\t\t{\n\t\t\tforeach ($this->key as $c)\n\t\t\t{\n\t\t\t\t$matrix[$r][$c] = random_string('numeric', 3);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $matrix;\n\t}",
"private function table() {\n return array(\n 'name' => 'test',\n 'engine' => 'MyISAM',\n 'charset'=> 'utf8',\n 'collate'=> 'utf8_spanish_ci',\n 'comment'=> ''\n );\n }",
"function ca_ca_entity() {\n $entities = array();\n\n $entities['user'] = array(\n '#title' => t('Drupal user'),\n '#type' => 'object',\n '#load' => 'user_load',\n '#save' => 'user_save',\n );\n $entities['node'] = array(\n '#title' => t('Node'),\n '#type' => 'object',\n '#load' => 'node_load',\n '#save' => 'node_save',\n );\n $entities['arguments'] = array(\n '#title' => t('Trigger arguments'),\n '#type' => 'array',\n );\n\n return $entities;\n}",
"public function getPatientTableArray() {\n return array($this->getId(), $this->getFirstname(), $this->getLastname(), $this->getBirthdate(), $this->getEmail(), $this->getUsername(),$this->getStatus(),$this->getToken_used());\n }"
] | [
"0.59555906",
"0.5560228",
"0.5560228",
"0.54960316",
"0.5477347",
"0.53618294",
"0.53250176",
"0.51446486",
"0.5133757",
"0.513351",
"0.5123382",
"0.5121624",
"0.510943",
"0.5037853",
"0.5035669",
"0.5033791",
"0.5028625",
"0.5017757",
"0.50143033",
"0.49255797",
"0.49223408",
"0.49113277",
"0.4897271",
"0.4897271",
"0.48671693",
"0.485934",
"0.4850374",
"0.48359877",
"0.4834122",
"0.4829023"
] | 0.6884775 | 0 |
Updates the TCA array to apply to the table | public function setTca(array $tca): self
{
$this->tca = $tca;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addTsTca()\n {\n if (!empty($this->pObj->conf['tca.'][$this->table . '.'])) {\n $tsTca = tx_t3devapi_miscellaneous::stripDotInTsArray($this->pObj->conf['tca.'][$this->table . '.']);\n $this->tca = tx_t3devapi_miscellaneous::arrayMergeRecursiveReplace($this->tca, $tsTca);\n }\n }",
"public function getTca(): array\n {\n return $this->tca;\n }",
"function SetTableAttributes($array) {\n foreach ($array as $key => $value) {\n $this->table[0][\"table_values\"][$key] = $value;\n }\n }",
"protected function arrayupdate() {\n \n }",
"public function setTable($table)\n {\n $this->table = $table;\n $this->tca = tx_t3devapi_miscellaneous::getTableTCA($table);\n $this->addTsTca();\n }",
"function transform_array($data,$table,$trans,$read=TRUE){\n if(empty($trans)) return($data);\n $res = array();\n foreach($data as $key=>$val)\n $res[$key] = $this->transform_row($data[$key],$table,$trans,$read);\n if(def($trans,'transpose')==TRUE) $res = $this->transpose($res);\n return($res);\n }",
"function loadTCA( $table )\n {\n if ( !$table )\n {\n // DRS\n if ( $this->pObj->b_drs_error )\n {\n $prompt = '$table is empty.';\n t3lib_div::devlog( '[ERROR/DISCOVER] ' . $prompt, $this->pObj->extKey, 3 );\n }\n // DRS\n return;\n }\n\n // RETURN : TCA is loaded\n if ( is_array( $GLOBALS[ 'TCA' ][ $table ][ 'columns' ] ) )\n {\n return;\n }\n // RETURN : TCA is loaded\n // Load the TCA\n t3lib_div::loadTCA( $table );\n\n // DRS\n if ( $this->pObj->b_drs_tca )\n {\n $prompt = '$GLOBALS[TCA][' . $table . '] is loaded.';\n t3lib_div::devlog( '[INFO/DISCOVER] ' . $prompt, $this->pObj->extKey, 0 );\n }\n // DRS\n }",
"function updateArray($content,$conf) {\n\t//echo \"function updateArray($content,$conf) {\"; //jstmp\n\t//print_r($content);\n\t//print_r($conf);\n\t# debug($content,'updateArray content');\n# debug($conf,'updateArray conf');\n $fe_adminLib = &$conf['parentObj'];\n $dataArr = $content;\n $table = $fe_adminLib->theTable;\n\n foreach((array)$dataArr as $fN=>$value) {\n switch((string)$GLOBALS['TCA'][$table]['columns'][$fN]['config']['type']) {\n case 'group':\n\t// we need to update the additional field $fN.'_file'.\n\t$fe_adminLib->additionalUpdateFields .= ','.$fN.'_file';\n\tbreak;\n case 'input':\n\t// if evaltype is date or datetime and defaultValue is 'now' we transform it into the current timestamp + the int following 'now'.\n\t// Example: if default value is now+30 we transform it into a timestamp representing the day 30 days from today\n\tif(($GLOBALS['TCA'][$table]['columns'][$fN]['config']['eval']=='date' || $GLOBALS['TCA'][$table]['columns'][$fN]['config']['eval']=='datetime') &&\n\t substr($fe_adminLib->conf[$fe_adminLib->cmdKey.\".\"][\"defaultValues.\"][$fN],0,3) == 'now'/* && empty($dataArr[$fN])*/) {\n\t $dataArr[$fN] = time() + 24*60*60*intval(substr($fe_adminLib->conf[$fe_adminLib->cmdKey.\".\"][\"defaultValues.\"][$fN],3));\n\t}\n\n\t\t//jsmod\n\t\t//if overridevalue is [currentUsername] , author is set to current user's username.\n\t\t//tmpjs \n\t\t// echo \" \\$fN :\" . $fN; //tmpjs\n\t\t// echo \" overrideValues :\" . $fe_adminLib->conf[$fe_adminLib->cmdKey.\".\"][\"overrideValues.\"][$fN]; //tmpjs\n\t\t// echo \" loginUser :\" . $GLOBALS['TSFE']->loginUser;//tmpjs\n\t\t// echo \" username :\" . $GLOBALS['TSFE']->fe_user->user['username'];\n\t\t// print_r( $fe_adminLib->conf[$fe_adminLib->cmdKey.\".\"][\"overrideValues.\"][$fN]); //jstmp\n\t\t// \n\t\tif ($fe_adminLib->conf[$fe_adminLib->cmdKey.\".\"][\"overrideValues.\"][$fN] == '[currentUsername]') {\n\t\t//badif ($conf[$fe_adminLib->cmdKey.\".\"][\"overrideValues.\"][$fN] == '[currentUsername]') {\n\t\t\t//echo 'currentUsername blocka ';//jstmp\n\t\t}\n\t\t//removed this condition($GLOBALS['TCA'][$table]['columns'][$fN]['config']['eval']=='author' &&\n\t\tif(( \n\t\t $fe_adminLib->conf[$fe_adminLib->cmdKey.\".\"][\"overrideValues.\"][$fN] == '[currentUsername]')) {\n\t\t\t // echo 'currentUsername blockb ';//jstmp\n\t\t\t if ($GLOBALS['TSFE']->loginUser) {\n\t\t\t\t //echo 'loginUser block ';\n\t\t\t\t $dataArr[$fN] = $GLOBALS['TSFE']->fe_user->user['username'];\n\t\t\t }\n\t\t} \n\n\tbreak;\n case 'text':\n\t$dataArr = $this->rteProcessDataArr($dataArr, $table, $fN, 'rte');\n\tbreak;\n case 'select':\n\t$feData = t3lib_div::_POST('FE');\n\t$uid = $feData[$table]['uid'] ? $feData[$table]['uid'] : t3lib_div::_GET('rU');\n\tif($GLOBALS['TCA'][$table]['columns'][$fN][\"config\"][\"foreign_table\"] && \n\t $GLOBALS['TCA'][$table]['columns'][$fN][\"config\"][\"MM\"] &&\n\t $uid) {\n\n\t $dataArr[$fN] = implode(',',$this->getUidsOfSelectedRecords($dataArr,$fN,$fe_adminLib->theTable));\n\t}\n\tbreak;\n default:\n\t \t//echo \"default case\";\n\t\tbreak;\n\t }\n\t \n }\n# debug($dataArr);\n return $dataArr;\n }",
"private function setDataTitulos(){\n $i=0;\n foreach($this->tabla->thead->tr->th as $key => $columna){\n if($i>0){\n $columna->data=array(\n \"data-jvista\"=>\"orden\",\n \"data-order-celda\"=>$this->orderBy,\n \"data-indice\"=>($i+1),\n \"data-name\"=>$columna->contenido,\n );\n }\n ++$i;\n\n }\n\n }",
"function updateNewTable()\n\t{\n\t\tset_time_limit(0);\n\t\tApp::import('model','Category');\n\t\t$this->Category = new Category();\n\t\t\n\t\tApp::import('model','CountyCategory');\n\t\t$this->CountyCategory = new CountyCategory();\n\t\t\n\t\t$cat = $this->Category->find('all');\n\t\t\n\t\tforeach($cat as $cat) {\n\t\t\t\t\t$county = '';\n\t\t\t\t\t$county = array_values(array_filter(explode(',',$cat['Category']['county'])));\n\t\t\t\t\tif(is_array($county) && !empty($county)) {\n\t\t\t\t\t\tforeach($county as $county) {\n\t\t\t\t\t\t\t$save2 = '';\n\t\t\t\t\t\t\t$save2['CountyCategory']['id'] = '';\n\t\t\t\t\t\t\t$save2['CountyCategory']['county_id'] = $county;\n\t\t\t\t\t\t\t$save2['CountyCategory']['category_id'] = $cat['Category']['id'];\n\t\t\t\t\t\t\t$this->CountyCategory->save($save2,false);\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"public static function saveFlexformValuesToTca(array $row, $piFlexform): void\n {\n $dceUid = DatabaseUtility::getDceUidByContentElementRow($row);\n $queryBuilder = DatabaseUtility::getConnectionPool()->getQueryBuilderForTable('tx_dce_domain_model_dcefield');\n $dceFieldsWithMapping = $queryBuilder\n ->select('*')\n ->from('tx_dce_domain_model_dcefield')\n ->where(\n $queryBuilder->expr()->eq(\n 'parent_dce',\n $queryBuilder->createNamedParameter($dceUid, \\PDO::PARAM_INT)\n ),\n $queryBuilder->expr()->neq(\n 'map_to',\n $queryBuilder->createNamedParameter('', \\PDO::PARAM_STR)\n )\n )\n ->executeQuery()\n ->fetchAllAssociative();\n\n if (empty($piFlexform) || 0 === \\count($dceFieldsWithMapping)) {\n return;\n }\n\n $flexFormArray = GeneralUtility::xml2array($piFlexform);\n if (!is_array($flexFormArray)) {\n return;\n }\n\n /** @var array $fieldToTcaMappings */\n $fieldToTcaMappings = [];\n foreach ($dceFieldsWithMapping as $dceField) {\n $mapTo = $dceField['map_to'];\n if ('*newcol' === $mapTo) {\n $mapTo = $dceField['new_tca_field_name'];\n if (empty($mapTo)) {\n throw new \\InvalidArgumentException('No \"new_tca_field_name\" given in DCE field configuration.');\n }\n }\n $fieldToTcaMappings[$dceField['variable']] = $mapTo;\n }\n\n $updateData = [];\n $flatFlexFormData = ArrayUtility::flatten($flexFormArray);\n foreach ($flatFlexFormData as $key => $value) {\n $fieldName = preg_replace('/.*settings\\.(.*?)\\.vDEF$/', '$1', $key);\n if (array_key_exists($fieldName, $fieldToTcaMappings)) {\n if (empty($updateData[$fieldToTcaMappings[$fieldName]])) {\n $updateData[$fieldToTcaMappings[$fieldName]] = $value;\n } else {\n $updateData[$fieldToTcaMappings[$fieldName]] .= PHP_EOL . PHP_EOL . $value;\n }\n }\n }\n\n if (!empty($updateData)) {\n $databaseColumns = DatabaseUtility::adminGetFields('tt_content');\n foreach (array_keys($updateData) as $columnName) {\n if (!array_key_exists($columnName, $databaseColumns)) {\n $tcaMappings = array_flip($fieldToTcaMappings);\n $fieldName = $tcaMappings[$columnName];\n throw new \\InvalidArgumentException('You\\'ve mapped the DCE field \"' . ($fieldName ?? '') . '\" (of DCE with uid ' . $dceUid . ') to the ' . 'non-existing tt_content column \"' . $columnName . '\". Please update your mapping or ensure ' . 'that the tt_content column is existing in database.');\n }\n }\n $connection = DatabaseUtility::getConnectionPool()->getConnectionForTable('tt_content');\n $connection->update(\n 'tt_content',\n $updateData,\n [\n 'uid' => (int)$row['uid'],\n ]\n );\n }\n }",
"public function initTraAsignacioness()\n\t{\n\t\t$this->collTraAsignacioness = array();\n\t}",
"public function montarTablero(){\n for ($i = 1; $i <= 8; $i++) {\n for ($j = 1; $j <= 8; $j++) {\n $casilla = new Casilla($i, $j);\n $this->casillas[$i][$j] = $casilla;\n if(!empty($this->fichas[$i][$j])){\n\n $this->casillas[$i][$j]->cambioOcupado($this->fichas[$i][$j]);\n\n }\n }\n }\n }",
"public function addcasetoarray() {\n\t\t$this->load->model('model_planconsultation','planconsultation');\n\t\t$this->load->model('model_planbundles','planbundles');\n\t\n\t\t$sNewRow['status'] = TRUE;\n\t\t$editingby \t\t= $this->input->post('editingby');\n\t\t$tag \t\t= $this->input->post('tags');\n\t\t$tagtype \t= $this->input->post('tagtype');\n\t\t$bundle \t= $this->input->post('bundle');\n\t\n\t\t$aSelectedTag = $this->planconsultation->choices_tags($tag);\n\t\t$aSelectedTagType = $this->planconsultation->choices_tagtypes($tagtype);\n\t\t$aSelectedBundle = $this->planbundles->getBundleDetails($bundle);\n\t\n\t\t$data['tagid'] \t\t\t= $tag;\n\t\t$data['tagtype'] \t\t= $tagtype;\n\t\t$data['bundle'] \t\t= $bundle;\n\t\t$data['editing_by'] \t= $editingby;\n\t\n\t\t$nCountExist = $this->planconsultation->select_from_temporary_table(\"temp_case_tags\",array(\"COUNT(*) as cnt\"),\"tagid=$tag AND tagtype=$tagtype AND editing_by='$editingby'\");\n\t\n\t\tif($nCountExist[0]['cnt'] == 0) {\n\t\t\t$insertID = $this->planconsultation->insert_to_temporary_table(\"temp_case_tags\",$data);\n\t\t\tif($insertID) {\n\t\t\t\t$sNewRow['newrow'] = '<tr id=\"case_'.$insertID.'\">\n\t\t\t\t\t\t\t<td>'.$aSelectedTag[0]['name'].'<input type=\"hidden\" value=\"'.$tag.'\" name=\"casedtls['.$insertID.'][tag]\"></td>\n\t\t\t\t\t\t\t<td>'.$aSelectedTagType[0]['name'].'<input type=\"hidden\" value=\"'.$tagtype.'\" name=\"casedtls['.$insertID.'][tagtype]\"></td>\n\t\t\t\t\t\t\t<td>'.$aSelectedBundle['_name'].'<input type=\"hidden\" value=\"'.$bundle.'\" name=\"casedtls['.$insertID.'][bundle]\"></td>\n\t\t\t\t\t\t\t<td><a href=\"\" id=\"'.$insertID.'\" class=\"deleteCaseRow\">Delete</a></td>\n\t\t\t\t\t\t</tr>';\n\t\t\t} else {\n\t\t\t\t$sNewRow['status'] = FALSE;\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t$sNewRow['status'] = \"exist\";\n\t\t}\n\t\n\t\techo json_encode($sNewRow);\n\t\n\t}",
"public function initTbfilacalouross()\n\t{\n\t\t$this->collTbfilacalouross = array();\n\t}",
"private function getTableDataArray($input_data_array, $action=''){\n\n\t // Get the Table Column Briefjenaams.\n\t $keys = $this->getTableColumnNames($this->getTableName());\n\n\t // Get data array with table collumns\n\t // NULL if collumns and data does not match in count\n\t //\n\t // Note: The order of the fields shall be the same for both!\n\t $table_data = array_combine($keys, $input_data_array);\n\n\t switch ( $action ){\n\t case 'update': // Intended fall-through\n\t case 'insert':\n\t // Remove the index -> is primary key and can\n\t// therefore not be changed!\n\t if (!empty($table_data)){\n\t unset($table_data['id_Briefje']);\n\t }\n\t break;\n\t // Remove\n\t }\n\t return $table_data;\n\t}",
"public function processData()\n {\n /** @var \\TYPO3\\CMS\\Core\\Migrations\\TcaMigration $tcaMigration */\n $tcaMigration = GeneralUtility::makeInstance(\\TYPO3\\CMS\\Core\\Migrations\\TcaMigration::class);\n $GLOBALS['TCA'] = $tcaMigration->migrate($GLOBALS['TCA']);\n $messages = $tcaMigration->getMessages();\n if (!empty($messages)) {\n $context = 'ext:compatibility6 did an automatic migration of TCA during bootstrap. This costs performance on every'\n . ' call. It also means some old extensions register TCA in ext_tables.php and not in Configuration/TCA.'\n . ' Please adapt TCA accordingly until this message is not thrown anymore and unload extension compatibility6'\n . ' as soon as possible';\n array_unshift($messages, $context);\n GeneralUtility::deprecationLog(implode(LF, $messages));\n }\n }",
"function set_dataTinversionistas()\n {\n $this->tinversionistas['data1'] = 'iduser';\n $this->tinversionistas['data2'] = 'gnombre';\n $this->tinversionistas['data3'] = 'gresponsablelegal';\n $this->tinversionistas['data4'] = 'odireccion';\n $this->tinversionistas['data5'] = 'ocolonia';\n $this->tinversionistas['data6'] = 'ociudad';\n $this->tinversionistas['data7'] = 'oestado';\n $this->tinversionistas['data8'] = 'opais';\n $this->tinversionistas['data9'] = 'otelofc';\n $this->tinversionistas['data10'] = 'ogiro';\n\n $this->tinversionistas['data11'] = 'crfc';\n $this->tinversionistas['data12'] = 'cocupacion';\n $this->tinversionistas['data13'] = 'cnacionalidad';\n $this->tinversionistas['data14'] = 'ccurp';\n $this->tinversionistas['data15'] = 'cdireccionparticular';\n $this->tinversionistas['data16'] = 'cciudad';\n $this->tinversionistas['data17'] = 'ccp';\n $this->tinversionistas['data18'] = 'ctelcasa';\n $this->tinversionistas['data19'] = 'cmovil';\n $this->tinversionistas['data20'] = 'cestadocivil';\n $this->tinversionistas['data21'] = 'cnombreconyugue';\n $this->tinversionistas['data22'] = 'ccurpconyugue';\n $this->tinversionistas['data23'] = 'cregimen';\n $this->tinversionistas['data24'] = 'crfcconyugue';\n $this->tinversionistas['data25'] = 'clugarnacimientoconyugue';\n $this->tinversionistas['data26'] = 'cdomicilioconyugue';\n $this->tinversionistas['data27'] = 'ranking';\n $this->tinversionistas['data28'] = 'regdate';\n\n $this->tinversionistas['data29'] = 'cuenta';\n\n\n }",
"private function structTableArr()\n\t\t{\n\t\t\t$length = $this->trNodes->length;\n\t\t\t//making sure that the table is of the same length as trNodes variables\n\t\t\tfor($i = 0; $i < $length; $i++)\n\t\t\t{\n\t\t\t\t$this->table[\"row$i\"] = array();\n\t\t\t}\n\t\t}",
"function updateYACA() {\r\n global $IP, $db, $databasefile;\r\n\r\n $db = new DBClass(\"{$IP}/db/{$databasefile}\");\r\n $tables = array('auc_domains', 'exp_domains');\r\n $count = 0;\r\n foreach ($tables as $table) {\r\n $res = $db->select($table, '*', \"yc IS NULL OR glue IS NULL\", 'ORDER BY yandex_tci desc LIMIT 0,25');\r\n while ($row = $res->fetchObject()) {\r\n $count++;\r\n $domain = strtolower($row->domain);\r\n $url = \"http://bar-navig.yandex.ru/u?ver=2&show=16&url=http://{$domain}\";\r\n $xml = simplexml_load_file($url);\r\n if (($xml->url->attributes()->domain == $domain) || ($xml->url->attributes()->domain == \"www.{$domain}\")) {\r\n // Домен не склеен\r\n $update['glue'] = \"'false'\";\r\n } else {\r\n // Домен склеен\r\n $update['glue'] = \"'true'\";\r\n $update['gluedom'] = \"'{$xml->url->attributes()->domain}'\";\r\n }\r\n $textinfo = makeTextInfo($xml);\r\n $update['yc'] = \"'\" . str_replace(\"\\n\", \"<br />\", $textinfo) . \"'\";\r\n $db->update($table, $update, array('domain' => \"'{$row->domain}'\"));\r\n }\r\n }\r\n $result = array('count' => $count);\r\n return $result;\r\n}",
"function FormSubscriberTableArray(){\n //get our status array\n $arrSubscriberStatus = Utility::Get()->CreateStatusArray();\n /**************************************************************\n ********** set CLIENTID statically for demo **********************\n **************************************************************/\n //get our subscribers\n if(!$arrSubscribers = $this->GetSubscribersData(CLIENTID)){\n DisplayMessages::Get()->AddUserMSG('No Subscribers at this time. <a data-toggle=\"tab\" href=\"#Subscriberupdate\">Try This</a>', 1);\n return FALSE;\n }\n //make our primary data arrary\n $arrTableArray = array('tabledescription'=>'Subscribers');\n $arrTableArray['tableheader'] = array('intSubscriberId'=>'ID',\n 'strSubscriberName'=>'Name',\n 'strSubscriberEmail'=>'Email',\n 'intSubscriberStatus'=>'status',\n 'intEDate'=>'Entry Date');\n //make our data table\n $arrTableArray['tabledata'] = array();\n foreach($arrSubscribers as $objSubscriber){\n //make our subscriber row\n $arrTableArray['tabledata'][$objSubscriber->{'intSubscriberId'}] = array();\n foreach($arrTableArray['tableheader'] as $strKey=>$strValue){\n $arrTableArray['tabledata'][$objSubscriber->{'intSubscriberId'}][$strKey] = array();\n $arrTableArray['tabledata'][$objSubscriber->{'intSubscriberId'}][$strKey]['linkvalue'] = 'Javascript:GetSubscriberUpdateForm('.$objSubscriber->{'intSubscriberId'}.')';\n $arrTableArray['tabledata'][$objSubscriber->{'intSubscriberId'}][$strKey]['tooltip'] = 'Update Subscriber';\n if($strKey == 'intSubscriberStatus'){\n //insert our status instead of its numeric key\n $arrTableArray['tabledata'][$objSubscriber->{'intSubscriberId'}][$strKey]['value'] = $arrSubscriberStatus[$objSubscriber->{$strKey}];\n\n\n }\n else if($strKey == 'intEDate'){\n //adjust our entry date to human readable date format\n $arrTableArray['tabledata'][$objSubscriber->{'intSubscriberId'}][$strKey]['value'] = date('m-d-Y',$objSubscriber->{$strKey});\n }\n else{\n $arrTableArray['tabledata'][$objSubscriber->{'intSubscriberId'}][$strKey]['value'] = $objSubscriber->{$strKey};\n }\n }\n }\n //all done, give it back for display\n return $arrTableArray;\n }",
"private function _update() {\n $this->db->replace(XCMS_Tables::TABLE_ARTICLES_BLOCKS, $this->getArray());\n }",
"protected function addData(Array $array){\n if(is_array($array)){\n if($this->is_single($array)){\n $this->dataView=array_merge((array)$this->dataView,$array);\n }else{\n $this->dataTable=$array;\n }\n }\n }",
"function set_dataTsubastas()\n {\n $this->tsubastas['data1'] = 'idProyecto';\n $this->tsubastas['data2'] = 'fechaInicio';\n $this->tsubastas['data3'] = 'fechaFin';\n $this->tsubastas['data4'] = 'tipo';\n $this->tsubastas['data5'] = 'regDate';\n $this->tsubastas['data6'] = 'estatus';\n }",
"function preprocess($arrData=array())\r\n\t{\r\n\t\tglobal $table;\r\n\t\t$entered = false;\r\n\r\n\t\tforeach($arrData as $key=>$row)\r\n\t\t{\t\t\r\n\t\t\t$entered = true;\r\n\t\t\t#es: Obtener los datos del campo o campos que se modificará(n)\r\n\t\t\t#en: Obtain the info for field or fields which will be processed\r\n\t\t\t//$arrDate = getdate($row['afiliation_date']);\r\n\t\t\t\r\n\t\t\t#es: Definir el nuevo valor del campo \r\n\t\t\t#en: Define new value for field \r\n\t\t//\t$month=(strlen($arrDate['mon'])==1)?'0'.$arrDate['mon']:$arrDate['mon'];\t# Generate 01, 02, 03, 04, etc.\r\n//\t\t\t$day=(strlen($arrDate['mday'])==1)?'0'.$arrDate['mday']:$arrDate['mday'];\t# Generate 01, 02, 03, 04, etc.\r\n//\t\t\t$row['afiliation_date'] = $arrDate['year'].\"-\".$month.\"-\".$day;\t\t\t\t# Display date format 2008-07-02\r\n\r\n\t\t\t\r\n\t\t\t$query = \"select name from cps_sku_group where id=\" . $row['skugroupid'] . \" limit 1\";\r\n\t\t\t$result = mysql_query_teik(\"get the parent's title\", $query);\r\n\t\t\twhile ($rr = mysql_fetch_assoc($result)) \r\n\t\t\t{\r\n\t\t\t\t$query2 = \"select * from cps_lookup_sku_attribute_version where id=\" . $row['versionid'] . \" limit 1\";\r\n\t\t\t\t$result2 = mysql_query_teik(\"lookup for the version\", $query2);\r\n\t\t\t\t$version = mysql_fetch_assoc($result2);\t\t\t\t\r\n\t\t\t\t$versioncode = $version['name'];\r\n\r\n\t\t\t\t$query2 = \"select * from cps_lookup_sku_attribute_color where id=\" . $row['colorid'] . \" limit 1\";\r\n\t\t\t\t$result2 = mysql_query_teik(\"lookup for the color\", $query2);\r\n\t\t\t\t$color = mysql_fetch_assoc($result2);\t\t\t\t\r\n\t\t\t\t$colorcode = $color['name'];\r\n\t\t\t\t$colorname = $color['details'];\r\n\t\r\n\t\t\t\t$name = $rr[\"name\"] . \" \" . $colorname;\r\n\t\t\t\t$skuid = right(\"000000\" . $row['skugroupid'] . \"-\" . $versioncode . \"-\" . $colorcode, 12);\r\n\t\t\t}\r\n\r\n\t\t\tif ($row['name'] == '') \r\n\t\t\t{\r\n\t\t\t\t$row['name'] = $name;\r\n\t\t\t\t//$row['utccorrectasof'] = date( 'Y-m-d H:i:s', time());\r\n\t\t\t\t$query2 = \"update \".$table.\" set utccorrectasof=now(), mastersku_cached='$skuid', name='\" . $row['name'] . \"' where id = \" . $row['id'];\r\n\t\t\t\t$result2 = mysql_query_teik(\"lookup for the color\", $query2);\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t#es: Almacenar los datos del registro en un array temporal\r\n\t\t\t#en: Store row data in a temporary array\r\n\t\t\t$arrTmpData[$key] = $row;\r\n\t\t};\r\n\t\t#es: Siempre se debe retornar un array con la nueva informacion\r\n\t\t#en: It is necesary to return the new processed array\r\n\t\tif ($entered) return $arrTmpData;\r\n\t\treturn $arrData; \r\n\t}",
"public static function leyenda_array($array){\r\n $original = array('P','ONC','G','AI','D','A','T','PU','OC'); //array('P','ONC','G','AI','D','AO','A','T','PU','OC')\r\n $cambiar = array('Profesional','Obrero no capa','Gerente','A I','Director','Administrativo','Tecnico','Pasante Universitario','Obrero Capacitado');\r\n //('Profesional','Obrero no capa','Gerente','A I','Director','A O','Administrativo','Tecnico','Pasante Universitario','Obrero Capacitado');\r\n if(is_array($array)) \r\n foreach($array as $key => $valor)\r\n $array[$key] = $cambiar[$key];//str_replace($original,$cambiar,self::limpiarPalabra($valor));\r\n return $array;\r\n }",
"function SetDefaultTableAttribute($array) {\n foreach ($array as $key => $value) {\n $this->default_settings[\"table\"][$key] = $value;\n }\n }",
"public function setArrayData(Array $array);",
"function editarMeta($array)\r\n {\r\n $this->establecerAtributos($array, __CLASS__);\r\n }",
"function SetCellAttributes($row, $col, $array) {\n if (is_array($array)) {\n foreach ($array as $attribute => $value) {\n $this->table[$row][$col][$attribute] = $value;\n }\n }\n }"
] | [
"0.70495886",
"0.5742611",
"0.5728006",
"0.53856134",
"0.5371754",
"0.5130337",
"0.503323",
"0.5002344",
"0.49695143",
"0.49570543",
"0.49481276",
"0.49410588",
"0.4890505",
"0.48680717",
"0.47664005",
"0.47625822",
"0.4738479",
"0.4737644",
"0.47326145",
"0.466984",
"0.46475148",
"0.4643814",
"0.4642962",
"0.4629306",
"0.45968562",
"0.4584268",
"0.45774093",
"0.45609987",
"0.4552593",
"0.45481884"
] | 0.580062 | 1 |
Case insensitive version of array_key_exists() using preg_match() | function array_ikey_exists($key,$arr)
{
if(preg_match("/".$key."/i", join(",", array_keys($arr))))
return true;
else
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function in_arrayi($needle, $haystack) {\n//src: https://php.net/manual/en/function.in-array.php#89256\n//and src: https://php.net/manual/en/function.in-array.php#96198\n //return in_array(strtolower($needle), array_map('strtolower', $haystack));\n //$flipped_haystack = array_flip(array_map('strtolower', $haystack));\n# $flipped_haystack = array_flip($haystack);//XXX: array_flip(): Can only flip STRING and INTEGER values!\n// $flipped_haystack = \n# $flipped_haystack = array_change_key_case($flipped_haystack, CASE_LOWER);\n# print_r($flipped_haystack);\n# return isset($flipped_haystack[strtolower($needle)]) || array_key_exists(strtolower($needle),$flipped_haystack);\n/* XXX: note\n$search_array = array('first' => null, 'second' => 4);\n// returns false\nisset($search_array['first']);\n// returns true\narray_key_exists('first', $search_array);\n */\n if (is_string($needle)) {\n $needle = strtolower($needle);\n }\n foreach($haystack as $k => $v) {\n if (($v === $needle) || ((is_string($v)) && (strtolower($v) === $needle))) {\n return TRUE;\n }\n }\n return FALSE;\n}",
"function array_key_exists ($key, array $search) {}",
"function array_key_exists_nc($key, $search)\r\n{\r\n\tif (!is_array($search)) return false;\r\n\r\n\tif (array_key_exists($key, $search)) {\r\n\t\treturn $key;\r\n\t}\r\n\tif (!(is_string($key) && is_array($search) && count($search))) {\r\n\t\treturn false;\r\n\t}\r\n\t$key = strtolower($key);\r\n\tforeach ($search as $k => $v) {\r\n\t\tif (strtolower($k) == $key) {\r\n\t\t\treturn $k;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}",
"function in_array_nocase($needle, $haystack)\n{\n // use much faster method for ascii\n if (is_ascii($needle)) {\n foreach ((array) $haystack as $value) {\n if (strcasecmp($value, $needle) === 0) {\n return true;\n }\n }\n }\n else {\n $needle = mb_strtolower($needle);\n foreach ((array) $haystack as $value) {\n if ($needle === mb_strtolower($value)) {\n return true;\n }\n }\n }\n\n return false;\n}",
"public function testKeyExists()\n {\n $array = array('SEVRAN' => 5, 'OKLM' => 10);\n $bool = ArrayValidator::keyExists($array, 'SEVRAN');\n $this->assertTrue($bool);\n }",
"function checkKeyInArray($key,$search_array){\r\n\tif (array_key_exists($key, $search_array)) {\r\n\treturn true;\r\n\t}\r\n\telse return false;\r\n\t}",
"function array_search_i($str,$array){ \r\n foreach($array as $key => $value)\r\n\t\t{ \r\n\t\t\r\n if(stristr($str,$value)) return 1; \r\n } \r\n return false; \r\n }",
"function array_search_case($needle, $array)\r\n\t{\r\n\t\tif (!is_array($array)) return FALSE;\r\n\t\tif (empty($array)) return FALSE;\r\n\t\tforeach($array as $index=>$string)\r\n\t\tif (strcasecmp($needle, $string) == 0) return intval($index);\r\n\t\treturn FALSE;\r\n\t}",
"function containsValue($arr, $val) {\n\tforeach ($arr as $k=>$v) {\n\t if (trim(strtolower($v)) == trim(strtolower($val))) return $k;\n\t}\n\treturn 0;\n }",
"function inArrayI($needle, array $haystack)\n{\n return in_array(strtolower($needle), array_map('strtolower', $haystack));\n\n}",
"public static function hasKey($key)\n\t{\n\t\tif (empty(self::$strings))\n\t\t{\n\t\t\tself::loadLanguage('en-GB');\n\t\t\tself::loadLanguage();\n\t\t}\n\n\t\t$key = strtoupper($key);\n\n\t\treturn array_key_exists($key, self::$strings);\n\t}",
"function search_array($search, $array) {\n foreach($array as $key => $value) {\n if (!!stristr($search, $value)) {\n return true;\n }\n }\n return false;\n }",
"public function ContainsKey(string $Key): bool;",
"static function inArrayCaseCompare($string, $data = []) {\n\n if (count($data)) {\n foreach ($data as $tocheck) {\n if (strcasecmp($string, $tocheck) == 0) {\n return true;\n }\n }\n }\n return false;\n }",
"public function inArray($array, $value)\n {\n foreach ($array as $key => $item) {\n if (strtolower($item) == strtolower($value)) {\n return $key;\n }\n\n if (strtolower($item) == strtolower(Tools::atktext($value, $this->m_node->m_module, $this->m_node->m_type))) {\n return $key;\n }\n }\n\n return false;\n }",
"function array_hasEx($array, $key)\n {\n if (empty($array) || is_null($key)) {\n return false;\n }\n if (array_key_exists($key, $array)) {\n return true;\n }\n foreach (explode('.', $key) as $segment) {\n if (!array_key_exists_safe($segment, $array)) {\n return false;\n }\n $array = $array[$segment];\n }\n return true;\n }",
"function checkForTrue($str)\n{\n global $true;\n if (in_array(mb_strtolower($str), $true)) {\n return true;\n } else {\n return false;\n }\n}",
"function _array_match($input, $arrayName)\n\t{\n\t\t$arr = $this->arrayValidationComparator[$arrayName];\n\t\tif(isset($arr[$input]))\n\t\t\treturn TRUE;\n\n\t\treturn FALSE;\n\t}",
"function _array_match($input, $arrayName)\n\t{\n\t\t$arr = $this->arrayValidationComparator[$arrayName];\n\t\tif(isset($arr[$input]))\n\t\t\treturn TRUE;\n\n\t\treturn FALSE;\n\t}",
"public function containsKey($key);",
"public function containsKey($key);",
"function arraySearchI($needle, array $haystack)\n{\n return array_search(strtolower($needle), array_map('strtolower', $haystack));\n\n}",
"static function inArray_i($needle,$Array){\n return (in_array(strtolower($needle),array_map('strtolower',$Array)));\n }",
"protected static function _keyExists(array $arr, $key)\n {\n if (array_key_exists($key, $arr)) {\n return true;\n }\n\n foreach (explode('.', $key) as $keySeg) {\n if (!is_array($arr) || !array_key_exists($keySeg, $arr)) {\n return false;\n }\n\n $arr = $arr[$keySeg];\n }\n\n return true;\n }",
"function in_arrayi($needle, $haystack)\n{\n for ($h = 0; $h < count($haystack); $h++) {\n $haystack[$h] = strtolower($haystack[$h]);\n }\n return in_array(strtolower($needle), $haystack);\n}",
"function in_arrayi($needle, $haystack) {\n foreach ($haystack as $value) {\n if (strtolower($value) == strtolower($needle)) return true;\n }\n unset($value);\n return false;\n }",
"public function contains($key);",
"public function contains($key);",
"public function containsKey($key) : bool;",
"public function exists($key);"
] | [
"0.6624404",
"0.6605426",
"0.64851975",
"0.62833524",
"0.62663275",
"0.621867",
"0.61650527",
"0.61434084",
"0.6084317",
"0.60086375",
"0.59292084",
"0.5901033",
"0.58573276",
"0.5843882",
"0.5820252",
"0.58153063",
"0.58143085",
"0.5802112",
"0.5802112",
"0.5790912",
"0.5790912",
"0.57756144",
"0.5770138",
"0.57689583",
"0.5761845",
"0.5686716",
"0.5660267",
"0.5660267",
"0.56546485",
"0.56301486"
] | 0.7273368 | 0 |
Constructs a new CollabNetRSSChannel based on the given URL | public function __construct($url) {
$this->url = $url;
$this->rssChannel = new RssChannel();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function addChannelItem ($url) {\r\n $li=$this->dom->createElement('rdf:li');\r\n $li->setAttribute('resource',$url);\r\n $this->itemSequence->appendChild($li);\r\n }",
"function add($url) {\n $xml = new SimpleXMLElement($url, null, true);\n\n foreach($xml->channel->item as $item) {\n $item->sitetitle = $xml->channel->title;\n $item->sitelink = $xml->channel->link;\n\t\t\t\n\t\t\tif($item->pubDate){\n\t\t\t\tpreg_match(\"/^[A-Za-z]{3}, ([0-9]{2}) ([A-Za-z]{3}) ([0-9]{4}) ([0-9]{2}):([0-9]{2}):([0-9]{2}) ([\\+|\\-]?[0-9]{4})$/\", $item->pubDate, $match);\n\t\t\t\t$t =mktime($match[4]+($match[6]/100),$match[5],$match[6],date(\"m\",strtotime($match[2])),$match[1],$match[3]);\n \t$item->time = $t;\n\n\t\t\t}\n\t\t\telse{\n\t\t\t\t// parsing namespace\n\t\t\t\t$dc = $item->children('http://purl.org/dc/elements/1.1/');\n\n\t\t\t\tpreg_match(\"/^([0-9]{4})-([0-9]{2})-([0-9]{2})([A-Za-z]{1})([0-9]{2}):([0-9]{2}):([0-9]{2})([A-Za-z]{1})$/\",\n\t\t\t\t$dc->date,$match);\n\t\t\t\t$t=mktime($match[5],$match[6],$match[7],$match[2],$match[3],$match[1]);\n\t\t\t\t\n\t\t\t\t$item->time = $t;\n\t\t\t}\n\t\t\t$item->isoDT = date(\"Y-m-d H:i:s\",$t);\n\t\t\t\n\n\t\t\tvar_dump($item);\n\t\t\techo '<hr>';\n\n\n $this->feeds[] = $item;\n }\n }",
"private function getRSS()\n\t{\n\t\t$this->trace(\"getRSS\");\n\n\t\t$cache_id=\"loremblogum-feed-\".$this->feed->feed_id;\n\t\t$raw=$this->getCurl($this->feed->url,$cache_id);\n\n\t\tif(trim($raw)=='')\n\t\t{\n\t\t\t$this->feed->title=\"[Connection error -- feed can not be fetched.]\";\n\t\t\t$this->trace($this->feed->title);\n\t\t\treturn false;\n\t\t}\n\n\t\tlibxml_use_internal_errors(true);\n\t\ttry {\n\t\t\t$xml = new \\SimpleXmlElement($raw, LIBXML_NOCDATA);\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{}\n\n\t\t/* */\n\t\tif (!isset($xml)||!isset($xml->channel)) {\n\t\t\t$errors = libxml_get_errors();\n\t\t\tlibxml_clear_errors();\n\t\t\t$this->feed->title=\"[Connection error -- feed invalid.]\";\t\n\t\t\t$this->trace($this->feed->url.\" ==> \".var_export($errors,true).\"\");\n\t\t\treturn false;\n\t\t}\n\n\t\t/* */\n\t\t$ns = array\n\t\t(\n\t\t\t'content' => 'http://purl.org/rss/1.0/modules/content/',\n\t\t\t'wfw' => 'http://wellformedweb.org/CommentAPI/',\n\t\t\t'dc' => 'http://purl.org/dc/elements/1.1/',\n\t\t\t'sy' => 'http://purl.org/rss/1.0/modules/syndication/',\n\t\t\t'slash' => 'http://purl.org/rss/1.0/modules/slash/'\n\t\t\t);\n\n\t\t$this->feed->type='RSS';\n\t\t$this->feed->title=(string)$xml->channel->title;\n\t\tif(isset($xml->channel->pubDate))\n\t\t\t$this->feed->published_at=date(\"Y-m-d h:m:s\",strtotime((string)$xml->channel->pubDate));\n\t\telse if(isset($xml->channel->lastBuildDate))\n\t\t\t$this->feed->published_at=date(\"Y-m-d h:m:s\",strtotime((string)$xml->channel->lastBuildDate));\n\t\telse\n\t\t\t$this->feed->published_at=null;\n\n\t\t$sy = $xml->channel->children($ns['sy']);\n\n\t\t$this->feed_items=[];\n\t\t$count = count($xml->channel->item);\n\t\t$this->feed->log['feed_item_raw_count']=$count;\n\n\t\tfor($i=0; $i<$count; $i++)\n\t\t{\n\t\t\t$item=$xml->channel->item[$i];\n\t\t\t$this->feed->log['feed_items_title'][]=trim(wp_strip_all_tags((string)$item->title));\n\t\t\t$this->feed->log['feed_items_url'][]=trim(wp_strip_all_tags((string)$item->link));\n\t\t}\n\n\t\t$this->new_item_count=0;\n\t\t$this->rejects=0;\n\t\t$skip=false;\n\t\tfor($i=0; $i<$count; $i++)\n\t\t{\n\t\t\t$this->trace(\"RSS i=\".$i);\n\n\t\t\t$item=$xml->channel->item[$i];\n\n\t\t\tif($this->feed->published_at==null&&isset($item->pubDate))\n\t\t\t\t$this->feed->published_at=date(\"Y-m-d h:m:s\",strtotime((string)$item->pubDate));\n\n\t\t\t$this->feed_item=new \\loremblogumFeedItems();\n\t\t\t$this->feed_item->feed_id=$this->feed->feed_id;\t\n\t\t\t$this->feed_item->url=trim((string)$item->link);\n\t\t\t$this->feed_item->title=trim((string)$item->title);\n\t\t\t$this->feed_item->published_at=date(\"Y-m-d h:m:s\",strtotime((string)$item->pubDate));\n\t\t\t$this->feed_item->content=\"\";\n\n\t\t\t$this->cleanFeedItemCategories($item->category);\n\n\t\t\t$this->trace(\"RSS i=\".$i.\" computePredefine\");\n\n\t\t\t$this->computePredefine();\n\n\t\t\tif($this->feed->predefine!=null)\n\t\t\t{\n\t\t\t\tif($this->postItem())\n\t\t\t\t{\n\t\t\t\t\tif($this->new_item_count>=$this->maximum_imports_per_call)\n\t\t\t\t\t{\n\t\t\t\t\t\t$skip=true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif($this->rejects>=$this->maximum_rejects_per_call)\n\t\t\t\t\t{\n\t\t\t\t\t\t$skip=true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->feed_items[]=$this->feed_item;\n\t\t\t$this->save_options();\n\t\t\tif($skip) break;\n\t\t}\n\n\t\treturn true;\n\t}",
"protected function fetch_feed(string $url) : \\moodle_simplepie {\n // Fetch the rss feed, using standard simplepie caching so feeds will be renewed only if cache has expired.\n \\core_php_time_limit::raise(60);\n\n $feed = new \\moodle_simplepie();\n\n // Set timeout for longer than normal to be agressive at fetching feeds if possible..\n $feed->set_timeout(40);\n $feed->set_cache_duration(0);\n $feed->set_feed_url($url);\n $feed->init();\n\n return $feed;\n }",
"static function getRSSFeed($url, $cache_duration = DAY_TIMESTAMP) {\n global $CFG_GLPI;\n\n $feed = new SimplePie();\n $feed->set_cache_location(GLPI_RSS_DIR);\n $feed->set_cache_duration($cache_duration);\n\n // proxy support\n if (!empty($CFG_GLPI[\"proxy_name\"])) {\n $prx_opt = [];\n $prx_opt[CURLOPT_PROXY] = $CFG_GLPI[\"proxy_name\"];\n $prx_opt[CURLOPT_PROXYPORT] = $CFG_GLPI[\"proxy_port\"];\n if (!empty($CFG_GLPI[\"proxy_user\"])) {\n $prx_opt[CURLOPT_HTTPAUTH] = CURLAUTH_ANYSAFE;\n $prx_opt[CURLOPT_PROXYUSERPWD] = $CFG_GLPI[\"proxy_user\"].\":\".\n Toolbox::sodiumDecrypt($CFG_GLPI[\"proxy_passwd\"]);\n }\n $feed->set_curl_options($prx_opt);\n }\n\n $feed->enable_cache(true);\n $feed->set_feed_url($url);\n $feed->force_feed(true);\n // Initialize the whole SimplePie object. Read the feed, process it, parse it, cache it, and\n // all that other good stuff. The feed's information will not be available to SimplePie before\n // this is called.\n $feed->init();\n\n // We'll make sure that the right content type and character encoding gets set automatically.\n // This function will grab the proper character encoding, as well as set the content type to text/html.\n $feed->handle_content_type();\n if ($feed->error()) {\n return false;\n }\n return $feed;\n }",
"private function addChannelImage($url) {\r\n $image=$this->dom->createElement('image');\r\n $image->setAttribute('rdf:resource',$url);\r\n $this->channel->appendChild($image);\r\n }",
"public function __construct()\n\t{\n\t\t$url\t\t= ee()->TMPL->fetch_param('url');\n\t\t$limit\t\t= (int) ee()->TMPL->fetch_param('limit', 10);\n\t\t$offset\t\t= (int) ee()->TMPL->fetch_param('offset', 0);\n\t\t$refresh\t= (int) ee()->TMPL->fetch_param('refresh', 180);\n\n\t\t// Bring in SimplePie\n\t\tee()->load->library('rss_parser');\n\n\t\t// Attempt to create the feed, if there's an exception try to replace\n\t\t// {if feed_error} and {feed_error}\n\t\ttry\n\t\t{\n\t\t\t$feed = ee()->rss_parser->create($url, $refresh, $this->cache_name);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\treturn $this->return_data = ee()->TMPL->exclusive_conditional(\n\t\t\t\tee()->TMPL->tagdata,\n\t\t\t\t'feed_error',\n\t\t\t\tarray(array('feed_error' => $e->getMessage()))\n\t\t\t);\n\t\t}\n\n\t\t// Make sure there's at least one item\n\t\tif ($feed->get_item_quantity() <= 0)\n\t\t{\n\t\t\t$this->return_data = ee()->TMPL->no_results();\n\t\t}\n\n\t\t$content = array(\n\t\t\t'feed_items' \t\t=> $this->_map_feed_items($feed, $limit, $offset),\n\n\t\t\t// Feed Information\n\t\t\t'feed_title'\t\t=> $feed->get_title(),\n\t\t\t'feed_link'\t\t\t=> $feed->get_link(),\n\t\t\t'feed_copyright'\t=> $feed->get_copyright(),\n\t\t\t'feed_description'\t=> $feed->get_description(),\n\t\t\t'feed_language'\t\t=> $feed->get_language(),\n\n\t\t\t// Feed Logo Information\n\t\t\t'logo_url'\t\t\t=> $feed->get_image_url(),\n\t\t\t'logo_title'\t\t=> $feed->get_image_title(),\n\t\t\t'logo_link'\t\t\t=> $feed->get_image_link(),\n\t\t\t'logo_width'\t\t=> $feed->get_image_width(),\n\t\t\t'logo_height'\t\t=> $feed->get_image_height()\n\t\t);\n\n\t\t$this->return_data = ee()->TMPL->parse_variables(\n\t\t\tee()->TMPL->tagdata,\n\t\t\tarray($content)\n\t\t);\n\t}",
"function mk_feed($url, $str=''){\r\n\t// take url given, return xml for interigation\r\n\t$xml = LoadFeed($url);\r\n\r\n\t//title of xml stream\r\n\t$str .= '<h1>' . $xml->channel->title . '</h1>';\r\n\r\n\t#buil each story, one by one.\r\n\tforeach($xml->channel->item as $story)\r\n\t{\r\n\t\t$str .= '<a href=\"' . $story->link . '\">' . $story->title . '</a><br />';\r\n\t\t$str .= '<p>' . $story->description . '</p><br /><br />';\r\n\t}\r\n\r\n\treturn $str ;\r\n\r\n}",
"function load_feed_xml($url)\r\n{\r\n\t$feed = new SimplePie();\r\n\t$feed->set_feed_url($url);\r\n\t$feed->init();\r\n\t$feed->handle_content_type();\r\n\t$feed->set_cache_location($GLOBALS['root_path'] . '/cache');\r\n\t\r\n\treturn $feed;\r\n}",
"public function generateNewsRssFeed() {\r\n $dom = new DOMDocument();\r\n $dom->formatOutput = true;\r\n\r\n $el_root = $dom->appendChild($dom->createElement('rss'));\r\n $el_root->setAttribute('version', '2.0');\r\n \r\n $el_channel = $el_root->appendChild($dom->createElement('channel'));\r\n \r\n $el_channel->appendChild($dom->createElement('title', $this->title));\r\n $el_channel->appendChild($dom->createElement('link', $this->link));\r\n $el_channel->appendChild($dom->createElement('description', $this->desc));\r\n \r\n if ($this->lang != '') {\r\n \t$el_channel->appendChild($dom->createElement('language', $this->lang));\r\n }\r\n \r\n $el_channel->appendChild($dom->createElement('docs', $this->docs));\r\n $el_channel->appendChild($dom->createElement('lastBuildDate', date(DATE_RSS)));\r\n $el_channel->appendChild($dom->createElement('generator', 'OBBLM ' . OBBLM_VERSION));\r\n \r\n $entries = array();\r\n foreach ($this->type as $t) {\r\n $obj = (object) null;\r\n switch ($t)\r\n {\r\n case T_TEXT_MSG:\r\n foreach (Message::getMessages(RSS_SIZE) as $item) {\r\n $entries[] = (object) array('title' => \"Announcement by \".get_alt_col('coaches', 'coach_id', $item->f_coach_id, 'name').\": $item->title\", 'desc' => $item->message, 'date' => $item->date);\r\n }\r\n break;\r\n \r\n case 'HOF':\r\n if (Module::isRegistered('HOF')) {\r\n foreach (Module::run('HOF', array('getHOF',false,RSS_SIZE)) as $item) {\r\n $item = $item['hof'];\r\n $entries[] = (object) array('title' => \"HOF entry for \".get_alt_col('players', 'player_id', $item->pid, 'name').\": $item->title\", 'desc' => $item->about, 'date' => $item->date);\r\n }\r\n }\r\n break;\r\n \r\n case 'Wanted':\r\n if (Module::isRegistered('Wanted')) {\r\n foreach (Module::run('Wanted', array('getWanted', false, RSS_SIZE)) as $item) {\r\n $item = $item['wanted'];\r\n $entries[] = (object) array('title' => \"Wanted entry for \".get_alt_col('players', 'player_id', $item->pid, 'name').\": $item->bounty\", 'desc' => $item->why, 'date' => $item->date);\r\n }\r\n }\r\n break;\r\n \r\n case T_TEXT_MATCH_SUMMARY:\r\n foreach (MatchSummary::getSummaries(RSS_SIZE) as $item) {\r\n $m = new Match($item->match_id);\r\n $entries[] = (object) array(\r\n 'title' => \"Match: $m->team1_name ($m->team1_score) vs. $m->team2_name ($m->team2_score)\", \r\n 'desc' => $m->getText(), \r\n 'date' => $m->date_played\r\n );\r\n }\r\n break;\r\n \r\n case T_TEXT_TNEWS:\r\n foreach (TeamNews::getNews(false, RSS_SIZE) as $item) {\r\n $entries[] = (object) array('title' => \"Team news by \".get_alt_col('teams', 'team_id', $item->f_id, 'name'), 'desc' => $item->txt, 'date' => $item->date);\r\n }\r\n break;\r\n }\r\n }\r\n objsort($entries, array('-date'));\r\n foreach (array_slice($entries, 0, RSS_SIZE) as $item) {\r\n $el_item = $dom->createElement('item');\r\n $el_item->appendChild($dom->createElement('title', htmlspecialchars($item->title, ENT_NOQUOTES, \"UTF-8\")));\r\n $el_item->appendChild($dom->createElement('description', htmlspecialchars($item->desc, ENT_NOQUOTES, \"UTF-8\")));\r\n $el_item->appendChild($dom->createElement('link', $this->link));\r\n $el_item->appendChild($dom->createElement('pubDate', $item->date));\r\n $el_channel->appendChild($el_item);\r\n }\r\n \r\n // Write the file\r\n $handle = fopen (\"rss.xml\", \"w\");\r\n fwrite($handle, $dom->saveXML());\r\n fclose($handle);\r\n \r\n return $dom->saveXML();\r\n }",
"private function buildRssDocument()\n {\n $this->log('Building RSS document');\n\n $docRss = new DOMDocument();\n $nodeRss = $docRss->appendChild($docRss->createElement('rss'));\n $nodeRss->setAttribute('version', '2.0');\n \n $nodeChannel = $nodeRss->appendChild($docRss->createElement('channel'));\n \n $nodeTitle = $nodeChannel->appendChild($docRss->createElement('title'));\n\t\t$nodeTitle->appendChild($docRss->createTextNode($this->feedTitle));\n\n $nodeLink = $nodeChannel->appendChild($docRss->createElement('link'));\n\t\t$nodeLink->appendChild($docRss->createTextNode($this->feedURL));\n\n $nodeDescription = $nodeChannel->appendChild($docRss->createElement('description'));\n\t\t$nodeDescription->appendChild($docRss->createTextNode($this->feedDescription));\n \n $this->docRss = $docRss;\n $this->nodeChannel = $nodeChannel;\n \n // order items by date descending\n function cmp($a, $b)\n {\n if($a->date == $b->date) \n {\n return 0;\n }\n return ($a->date < $b->date) ? 1 : -1;\n }\n \n $this->log('Sorting items');\n uasort($this->itemCache, 'cmp');\n \n // loop items to max count adding them to the channel\n $count = 0;\n foreach($this->itemCache as $key => $value)\n {\n $this->createRssItem($value);\n $count += 1;\n if($count >= $this->itemCount)\n {\n $this->log('Reached maximum count ' . $count);\n break;\n }\n }\n }",
"public function __construct($rsslink)\n {\n $this->rsslink = $rsslink;\n }",
"private function createRSS()\n\t{\n\t\tglobal $site;\n\t\tglobal $pages;\n\t\tglobal $url;\n\n\t\t$feedCopyright = $this->getValue('feedCopyright');\n\t\t$feedFileRSS = $this->getValue('feedFileRSS');\n\t\t$feedGenerator = $this->getValue('feedGenerator');\n\t\t$feedGeneratorEnable = $this->getValue('feedGeneratorEnable');\n\t\t$feedItemLimit = $this->getValue('feedItemLimit');\n\t\t$feedTTL = $this->getValue('feedTTL');\n\n\t\t// Reset to default if 0 is selected\n\t\tif ($feedItemLimit === 0) {\n\t\t\t$feedItemLimit = 10;\n\t\t}\n\n\t\t$list = $pages->getList(\n\t\t\t$pageNumber = 1,\n\t\t\t$feedItemLimit,\n\t\t\t$published = true,\n\t\t\t$static = true,\n\t\t\t$sticky = true,\n\t\t\t$draft = false,\n\t\t\t$scheduled = false\n\t\t);\n\n\t\t// Begin - RSS Template\n\t\t$rss = '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>';\n\t\t$rss .= '<rss version=\"2.0\">';\n\t\t$rss .= '<channel>';\n\t\t$rss .= '<title>'.$site->title().'</title>';\n\t\t$rss .= '<link>'.$site->url().'</link>';\n\t\t$rss .= '<description>'.$site->description().'</description>';\n\t\t$rss .= '<language>'.Theme::lang().'</language>';\n\n\t\tif ($feedCopyright !== 'DISABLED') {\n\t\t\t$rss .= '<copyright>'.$feedCopyright.'</copyright>';\n\t\t}\n\n\t\t$rss .= '<lastBuildDate>'.date(DATE_RSS).'</lastBuildDate>';\n\n\t\tif ($feedGeneratorEnable === true) {\n\t\t\t$rss .= '<generator>'.$feedGenerator.'</generator>';\n\t\t}\n\n\t\tif (!empty($feedTTL) && ($feedTTL !== 0)) {\n\t\t\t$rss .= '<ttl>'.$feedTTL.'</ttl>';\n\t\t}\n\n\t\tforeach ($list as $pageKey) {\n\t\t\ttry {\n\t\t\t\t$page = new Page($pageKey);\n\t\t\t\t$rss .= '<item>';\n\t\t\t\t$rss .= '<title>'.$page->title().'</title>';\n\t\t\t\t$rss .= '<link>'.$page->permalink().'</link>';\n\t\t\t\t$rss .= '<description>'.Sanitize::html($page->contentBreak()).'</description>';\n\n\t\t\t\tif (!empty($page->category())) {\n\t\t\t\t\t$rss .= '<category>'.$page->category().'</category>';\n\t\t\t\t}\n\n\t\t\t\t$rss .= '<pubDate>'.$page->date(DATE_RSS).'</pubDate>';\n\t\t\t\t$rss .= '<guid isPermaLink=\"false\">'.$page->uuid().'</guid>';\n\t\t\t\t$rss .= '</item>';\n\t\t\t} catch (Exception $e) {\n\t\t\t\t// Continue\n\t\t\t}\n\t\t}\n\n\t\t$rss .= '</channel>';\n\t\t$rss .= '</rss>';\n\t\t// Cease - RSS Template\n\n\t\t// Create RSS File\n\t\t$doc = new DOMDocument();\n\t\t$doc->formatOutput = true;\n\t\t$doc->loadXML($rss);\n\n\t\t// Save RSS File\n\t\treturn $doc->save($this->workspace().$feedFileRSS);\n\t}",
"public function __construct($url) {\r\n\r\n\t\t$this->URL = $url;\r\n\t}",
"function __construct($url = '')\n {\n if (!$this->is_enabled()) {\n throw new Exception('cURL is not enabled in this PHP installation');\n }\n \n if($url)\n {\n $this->create($url);\n }\n }",
"function __construct($url) {\n\t\t$this->url = $url;\n }",
"public function __construct($url){\n if ($url){\n self::$og_content = self::get_graph($url); \n }\n }",
"private function generateRSS(){\n\t\t$posts=$this->model->getNewsPosts();\n\t\t$currentHost=CURRENTHOST;\n\t\t$news=array();\n\t\tforeach($posts as $post){\n\t\t\t$newsDate=strtotime($post['newsDate']);\n\t\t\tif($newsDate<=time()){\t\t\t\n\t\t\t\t$data=array(\n\t\t\t\t\t\"title\"=>$post['newsTitle'],\n\t\t\t\t\t\"link\"=>$currentHost.'index.php?pageName=news#'.$post['newsID'],\n\t\t\t\t\t\"description\"=>$post['newsText']\n\t\t\t\t);\t\t\t\n\t\t\t\tarray_push($news, $data);\n\t\t\t}\n\t\t}\t\n\t\t$doc=new DOMDocument('1.0', 'UTF-8');\n\t\t$rss=$doc->createElement('rss');\n\t\t$rss->setAttribute('version','2.0');\n\t\t$doc->appendChild($rss);\n\t\t$channel=$doc->createElement('channel');\n\t\t$channelTitle=$doc->createElement('title', 'Hydra News');\n\t\t$channelLink=$doc->createElement('link', $currentHost);\n\t\t$channelDesc=$doc->createElement('description', 'News on the Hydra Larp Convention');\n\t\t$rss->appendChild($channel);\n\t\t$channel->appendChild($channelTitle);\n\t\t$channel->appendChild($channelLink);\n\t\t$channel->appendChild($channelDesc);\t\t\n\t\tforeach($news as $post){\t\t\t\t\t\n\t\t\t$item = $doc->createElement('item');\n\t\t\t$itemTitle = $doc->createElement('title', $post['title']);\n\t\t\t$itemLink = $doc->createElement('link', $post['link']);\n\t\t\t$itemDesc = $doc->createElement('description', $post['description']);\n\t\t\t$channel->appendChild($item);\n\t\t\t$item->appendChild($itemTitle);\n\t\t\t$item->appendChild($itemLink);\n\t\t\t$item->appendChild($itemDesc);\t\t\n\t\t}\t\t\n\t\t$doc->formatOutput = true;\n\t\t$str = $doc->saveXML();\n\t\t$file = fopen('rss.xml','w');\n\t\tfwrite($file, $str);\n\t\tfclose($file);\n\t}",
"function __construct($url){\n $this->url = $url;\n }",
"private function fetch_rss($rss_url){\n\t\t$this->pie->set_feed_url($rss_url);\n\t\t$this->pie->enable_cache(false);\n\t\t$this->pie->init();\n\t\t$this->pie->handle_content_type();\n\n\t\t$level1_name = $this->rss_info['level1_name'];\n\t\t$level2_name = $this->rss_info['level2_name'];\n\t\t\n\t\t$max_pub_date = $this->get_max_pubdate($level1_name,$level2_name);\n\t\t\t\n\t\tforeach ($this->pie->get_items() as $item) {\n\t\t\t\n\t\t\t$title = $item->get_title();\n\t\t\t$link = $item->get_permalink();\n\t\t\t$description = $item->get_description();\n\t\t\t$pubDate = $item->get_date('Y-m-d H:i:s');\t\n\t\t\t//$level1_name = $this->rss_info['level1_name'];\n\t\t\t//$level2_name = $this->rss_info['level2_name'];\n\t\t\n\t\t\t//$max_pub_date = $this->get_max_pubdate($level1_name,$level2_name);\n\t\t\t\n\t\t\tif ($pubDate > $max_pub_date) { //check to make sure that current item's publish date is more current than the most current news item in datastore\n\t\t\t\techo $title.\"<br/>\";\n\t\t\t\tif ($level1_name == 'google') {\n\t\t\t\t\t$link = preg_replace('/^.*?&url=/', '', $link);\n\t\t\t\t}\n\t\t\t\n\t\t\t\t$item_info = array(\"title\"=>$title,\"link\"=>$link,\"description\"=>$description,\"pubDate\"=>$pubDate);\n\t\t\t\t$this->insert_data($item_info);\n\t\t\t}\n\t\t\t\n\t\t}\n\t}",
"public function __construct($url)\n {\n $this->url = $url;\n\n }",
"function Get ($rss_url) \r\n {\r\n $result = $this->Parse($rss_url);\r\n return $result;\r\n }",
"function fetch_remote_rss ($url) {\n\tlist($status, $data) = fetch_remote_file( $url );\n\tif ( $status ) {\n\t\t$rss = new MagpieRSS( $data );\n\t\tif ( $rss ) {\n\t\t\treturn array(1, $rss, 'success');\n\t\t}\n\t\telse {\n\t\t\treturn array(0, '', \"Failed to parse RSS file: $url\");\n\t\t}\n\t}\n\telse {\n\t\treturn array(0, '', $data);\n\t}\n}",
"public function __construct($url)\n {\n $this->url = $url;\n\n $this->baseUrl = preg_replace('#^(https?://[^/]+)#', '\\1', $this->url);\n $this->localUrl = preg_replace('#^(https?://.+)/.+#', '\\1', $this->url);\n\n $http = new HttpClient();\n $html = HtmlExplorer::fromWeb($url, $http);\n\n $node = $html->findFirstTag('base');\n\n if ($node && $href = $node->getAttribute('href')) {\n $this->baseUrl = trim($href, ' /');\n }\n\n $this->http = $http;\n $this->html = $html;\n }",
"public function create_feed() {\r\n \r\n $xml = '<?xml version=\"1.0\" encoding=\"utf-8\"?>' . \"\\n\";\r\n \r\n $xml .= '<rss version=\"2.0\"' . $this->xmlns . '>' . \"\\n\";\r\n \r\n // channel required properties\r\n $xml .= '<channel>' . \"\\n\";\r\n $xml .= '<title>' . $this->channel_properties[\"title\"] . '</title>' . \"\\n\";\r\n $xml .= '<link>' . $this->channel_properties[\"link\"] . '</link>' . \"\\n\";\r\n $xml .= '<description>' . $this->channel_properties[\"description\"] . '</description>' . \"\\n\";\r\n $xml .= '<author>' . $this->channel_properties[\"author\"] . '</author>' . \"\\n\";\r\n $xml .= '<copyright>Enough Records</copyright>' . \"\\n\";\r\n \r\n // channel optional properties\r\n if(array_key_exists(\"language\", $this->channel_properties)) {\r\n $xml .= '<language>' . $this->channel_properties[\"language\"] . '</language>' . \"\\n\";\r\n }\r\n if(array_key_exists(\"image_title\", $this->channel_properties)) {\r\n $xml .= '<image>' . \"\\n\";\r\n $xml .= '<title>' . $this->channel_properties[\"image_title\"] . '</title>' . \"\\n\";\r\n $xml .= '<link>' . $this->channel_properties[\"image_link\"] . '</link>' . \"\\n\";\r\n $xml .= '<url>' . $this->channel_properties[\"image_url\"] . '</url>' . \"\\n\";\r\n $xml .= '</image>' . \"\\n\";\r\n }\r\n\r\n\t$xml .= '<itunes:author>' . $this->channel_properties[\"author\"] . '</itunes:author>' . \"\\n\";\r\n\t$xml .= '<itunes:summary>' . $this->channel_properties[\"description\"] . '</itunes:summary>' . \"\\n\";\t\r\n\t$xml .= '<itunes:subtitle>' . $this->channel_properties[\"description\"] . '</itunes:subtitle>' . \"\\n\";\t\r\n\t$xml .= '<itunes:type>episodic</itunes:type>' . \"\\n\";\r\n\t$xml .= '<itunes:owner>' . \"\\n\";\r\n\t$xml .= '\t<itunes:name>' . $this->channel_properties[\"author\"] . '</itunes:name>' . \"\\n\";\r\n\t$xml .= '\t<itunes:email>' . $this->channel_properties[\"email\"] . '</itunes:email>' . \"\\n\";\r\n\t$xml .= '</itunes:owner>' . \"\\n\";\r\n\t$xml .= '<itunes:explicit>No</itunes:explicit>' . \"\\n\";\r\n\t$xml .= '<itunes:category text=\"Music\">' . \"\\n\";\r\n\t$xml .= '\t<itunes:category text=\"Music History\" />' . \"\\n\";\r\n\t$xml .= '</itunes:category>' . \"\\n\";\r\n\t$xml .= '<itunes:image href=\"' . $this->channel_properties[\"image_url\"] . '\"/>' . \"\\n\";\r\n\r\n // get RSS channel items\r\n $now = date(\"YmdHis\"); // get current time // configure appropriately to your environment\r\n $rss_items = $this->get_feed_items($now);\r\n \r\n foreach($rss_items as $rss_item) {\r\n $xml .= '<item>' . \"\\n\";\r\n $xml .= '<title>' . $rss_item['title'] . '</title>' . \"\\n\";\r\n $xml .= '<link>' . $rss_item['link'] . '</link>' . \"\\n\";\r\n $xml .= '<description>' . $rss_item['description'] . '</description>' . \"\\n\";\r\n $xml .= '<pubDate>' . $rss_item['pubDate'] . '</pubDate>' . \"\\n\";\r\n $xml .= '<category>' . $rss_item['category'] . '</category>' . \"\\n\";\r\n $xml .= '<source>' . $rss_item['source'] . '</source>' . \"\\n\";\r\n \r\n\t $filesize = 0;\r\n\t $thislink = $rss_item['link'];\r\n\t if ($thislink != null) $thisheaders = get_headers($thislink,1);\r\n\t $filesize = $thisheaders['Content-Length'];\r\n \r\n $xml .= '<enclosure url=\"' . $rss_item['link'] . '\" length=\"'. $filesize .'\" type=\"audio/mpeg\"/>' . \"\\n\";\r\n $xml .= '<guid>' . $rss_item['cat'] . '</guid>' . \"\\n\";\r\n\t $xml .= '<itunes:title>' . strip_tags($rss_item['title']) . '</itunes:title>' . \"\\n\";\r\n $xml .= '<itunes:author>' . strip_tags($rss_item['artist']) . '</itunes:author>' . \"\\n\";\r\n $xml .= '<itunes:summary>' . strip_tags($rss_item['description']) . '</itunes:summary>' . \"\\n\";\r\n $xml .= '<itunes:subtitle>' . strip_tags($rss_item['description']) . '</itunes:subtitle>' . \"\\n\";\r\n $xml .= '<itunes:explicit>No</itunes:explicit>' . \"\\n\";\r\n\t $catnumber = intval(explode(\"w\",$rss_item['cat'])[1]);\r\n\t if ($catnumber < 26) {\r\n\t\t$xml .= '<itunes:duration>3600</itunes:duration>' . \"\\n\";\r\n\t } else {\r\n\t\t$xml .= '<itunes:duration>7200</itunes:duration>' . \"\\n\";\r\n\t }\r\n //$xml .= '<itunes:image href=\"' . $rss_item['link'] . '\"/>' . \"\\n\";\r\n\t if (($catnumber == 41) || ($catnumber == 26) || ($catnumber == 25) || ($catnumber == 17)) {\r\n\t\t$xml .= '<itunes:image href=\"' . substr($rss_item['link'],0,-3).'jpg' . '\"/>' . \"\\n\";\r\n\t } else {\r\n\t\t$xml .= '<itunes:image href=\"' . substr($rss_item['link'],0,-3).'png' . '\"/>' . \"\\n\";\r\n\t }\t\t\r\n\t $xml .= '<itunes:season>1</itunes:season>' . \"\\n\";\r\n $xml .= '<itunes:episode>' . $catnumber . '</itunes:episode>' . \"\\n\";\r\n $xml .= '<itunes:episodeType>full</itunes:episodeType>' . \"\\n\";\r\n\t \r\n if($this->full_feed) {\r\n $xml .= '<content:encoded>' . $rss_item['content'] . '</content:encoded>' . \"\\n\";\r\n }\r\n \r\n $xml .= '</item>' . \"\\n\";\r\n }\r\n \r\n $xml .= '</channel>';\r\n \r\n $xml .= '</rss>';\r\n \r\n return $xml;\r\n }",
"public function getFeed($url)\n {\n $simplePie = new \\SimplePie();\n $simplePie->enable_cache(false);\n $simplePie->set_feed_url($url);\n $simplePie->init();\n\n return $simplePie;\n }",
"function __construct(){\n\t\tparent::__construct(\"http://botcards.jlparry.com/data/series\");\n\n\t}",
"public function get_rss(){\n\t\textract($this->rss_info);\n\t\t$this->fetch_rss($rss_url);\n\t}",
"function getFeed(&$params)\n\t{\n\t\t$cacheDir \t\t= JPATH_CACHE .'/';\n\t\tif ( !is_writable( $cacheDir ) ) {\n\t\t\treturn 'Cache Directory Unwriteable';\n\t\t}\n\n\t\t$rssurl\t\t\t\t= $params->get( 'rssurl' );\n\t\t$rssitems \t\t\t= $params->get( 'rssitems', 5 );\n\t\t$rssdesc \t\t\t= $params->get( 'rssdesc', 1 );\n\t\t$rssdesc_2\t\t\t= $params->get( 'rssdesc_2', 0 ); // desc below link\n\t\t$desc_limit\t\t\t= $params->get( 'desc_limit', 0 );\n\t\t$rssimage \t\t\t= $params->get( 'rssimage', 1 );//?\n\t\t$newsWinY\t\t\t= $params->get( 'newsWinY', 650);\n\t\t$newsWinX\t\t\t= $params->get( 'newsWinX', 850);\n\t\t$rssitemdesc\t\t\t= $params->get( 'rssitemdesc', 1 );\n\t\t$showdate\t\t\t= $params->get( 'showdate', 0 );\n\t\t$dateformat\t\t\t= $params->get( 'dateformat', '' );\n\t\t$dateposition\t\t= $params->get( 'dateposition', 0 );\n\t\t$words_t\t\t\t= $params->def( 'word_count_title', 0 );\n\t\t$words_d\t\t\t= $params->def( 'word_count_descr', 0 );\n\t\t$rsstitle\t\t\t= $params->get( 'rsstitle', 1 );\n\t\t$rsscache\t\t\t= $params->get( 'rsscache', 60 );\n\t\t//Custom\n\t\t$enable_tooltip \t\t= $params->get( 'enable_tooltip','no' );\n\t\t$moduleclass_sfx \t\t= $params->get( 'moduleclass_sfx', '' );\n\t\t$disable_modal \t\t= $params->get( 'disable_modal', 0 );\n\t\t$disable_errors \t\t= $params->get( 'disable_errors', 0 );\n\n\n\t\t$content_buffer\t= '';\n\t\t$rssurls = preg_split(\"/[\\s]+/\", $rssurl);\n\n\t\t$content_buffer\t.= \"<!-- RSS BROWSER, http://www.lbm-services.de START -->\\n\";\n\t\t$content_buffer\t.= '<div class=\"rss-container'.$moduleclass_sfx.'\">';\n\t\t\n\t\tforeach($rssurls as $rssurl){\n\n\t\t\tif( trim($rssurl) != \"\") { \t\t\t// only if array element is not empty\n\n\t\t\t\tif (!empty($rssurl)) {\n\n\t\t\t\t$feed = new SimplePie();\n\t\t\t\t$feed->set_feed_url($rssurl);\n\t\t\t\t//echo $rssurl. \"<br/>\"; //debug\n\t\t\t\t\n\t\t\t\t//set / override Joomla HTML page metatag charset to match RSS character encoding\n\t\t\t\t$feed->handle_content_type(); \n\t\t\t\t$feed->set_cache_location($cacheDir);\n\t\t\t\t$feed->set_cache_duration( $rsscache*60 );\n\t\t\t\t\n\n\t\t\t\tif (!$feed->init())\n\t\t\t\t\t{\n if ( 0 == $disable_errors){\n JFactory::getApplication()->enqueueMessage( \"Could not load feed: $rssurl\", 'error');\n } \n JLog::addLogger(\n array(\n 'text_file' => 'mod_thick_rss.connection_errors.php',\n 'text_entry_format' => '{DATETIME} {PRIORITY} {MESSAGE}'\n ),\n JLog::ALL & ~JLog::DEBUG,\n array('mod_thick_rss')\n );\n JLog::add(\"Could not load feed: $rssurl\", JLog::ERROR, 'mod_thick_rss' );\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tif ($feed->data) {\n\t\t\t\t\t$items = $feed->get_items();\n\t\t\t\t\t$iUrl\t\t= 0;\n\t\t\t\t\t$iUrl\t= $feed->get_image_url();\n\t\t\t\t\t$iTitle\t= $feed->get_image_title();\n\t\t\t\t\t$iLink = $feed->get_image_link();\n\t\t\t\t\t$feed_link = $feed->get_link() ;\n\t\t\t\t\t$feed_title \t= $feed->get_title();\n\t\t\t\t\t$feed_descrip \t= $feed->get_description();\n\t\t\t\t\tif (strpos($iLink,\"?\") === false ) $cChr = \"?\";\n\t\t\t\t\telse $cChr = \"&\";\n\n\t\t\t\t\tif ( $rssimage && $iUrl ) {\n\t\t\t\t\t\tif ($disable_modal == 0 ) $content_buffer .= '<a href=\"'. JFilterOutput::ampReplace($iLink . $cChr.'keepThis=true&TB_iframe=true&height='. $newsWinY .'&width='. $newsWinX) .'\" title=\"'.$feed_title .'\" class=\"lightbox\"><img style=\"display:inline;\" src=\"'. $iUrl .'\" alt=\"'. $iTitle .'\" border=\"0\"/></a>';\n \t\t\telse $content_buffer .= '<a href=\"javascript://\" title=\"'.$iTitle .'\" onclick=\"window.open(\\''.$ilink.'\\',\\'news\\',\\'toolbar=no,location=no,scrollbars=1,status=no,menubar=no,width=' .$newsWinX.',height=' .$newsWinY.', top=50,left=150\\').focus();\"><img style=\"display:inline;\" src=\"'. $iUrl .'\" alt=\"'. $iTitle .'\" border=\"0\"/></a>';\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\tif (strpos($feed_link,\"?\") === false ) $cChr = \"?\";\n\t\t\t\t\telse $cChr = \"&\";\n\n\t\t\t\t\tif ($rsstitle) {\n\t\t\t\t\t\t$content_buffer .= \"<h4 class=\\\"rssfeed_title\".$moduleclass_sfx.\"\\\">\";\n\t\t\t\t\t\tif ($disable_modal == 0 ) $content_buffer .= '<a href=\"'. JFilterOutput::ampReplace($feed_link . $cChr.'keepThis=true&TB_iframe=true&height='. $newsWinY .'&width='. $newsWinX) .'\" title=\"'.$feed_title .'\" class=\"lightbox\">';\n\t\t\t\t\t\telse $content_buffer .= '<a href=\"javascript://\" title=\"'.$feed_title .'\" onclick=\"window.open(\\''.$feed_link.'\\',\\'news\\',\\'toolbar=no,location=no,scrollbars=1,status=no,menubar=no,width=' .$newsWinX.',height=' .$newsWinY.', top=50,left=150\\').focus();\">';\n\t\t\t\t\t\t$content_buffer .= $feed_title;\n\t\t\t\t\t\t$content_buffer .= \"</a></h4>\\n\";\n\t\t\t\t\t}\n\t\t\t\t\tif ($rssdesc) $content_buffer .= \"<div class=\\\"rssfeed_desc\".$moduleclass_sfx.\"\\\">\".$feed_descrip .\"</div>\\n\";\n\n\t\t\t\t\t$actualItems \t= $feed->get_item_quantity() ;\n\t\t\t\t\t$setItems \t\t= $rssitems;\n\n\t\t\t\t\tif ($setItems > $actualItems) {\n\t\t\t\t\t\t$totalItems = $actualItems;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$totalItems = $setItems;\n\t\t\t\t\t}\n\n\n\n\t\t\t\t\t$content_buffer .= \"\t\t<ul class=\\\"rssfeed_list\" . $moduleclass_sfx . \"\\\">\\n\";\n\t\t\t\t\tfor ($j = 0; $j < $totalItems; $j++) {\n\n\t\t\t\t\t\t$currItem =& $feed->get_item($j);\n\t\t\t\t\t\t$item_title = $currItem->get_title();\n\t\t\t\t\t\t$date = $currItem->get_date();\n\t\t\t\t\t\t// \"d.m.Y H:i\"\n\t\t\t\t\t\tif ($dateformat != '') $date = date($dateformat , strtotime($date));\n\t\t\t\t\t\t$text = $currItem->get_description();\n\t\t\t\t\t\t$pLink = $currItem->get_permalink();\n\t\t\t\t\t\tif (strpos($pLink, \"?\") === false) $cChr = \"?\";\n\t\t\t\t\t\telse $cChr = \"&\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$tooltip_title = $item_title;\n\t\t\t\t\t\tif ( $words_t ) {\n\t\t\t\t\t\t\tif ( strlen($item_title) > $words_t ) {\n\t\t\t\t\t\t\t\t$item_title = substr($item_title, 0, $words_t);\n\t\t\t\t\t\t\t\t$item_title .= '...';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( $rssitemdesc ) {\n\t\t\t\t\t\t\t// item description\n\t\t\t\t\t\t\t$text = strip_tags($currItem->get_description());\n\t\t\t\t\t\t\t// word limit check\n\t\t\t\t\t\t\tif ( $words_d ) {\n\t\t\t\t\t\t\t\t$texts = explode( ' ', $text );\n\t\t\t\t\t\t\t\t$count = count( $texts );\n\t\t\t\t\t\t\t\tif ( $count > $words_d ) {\n\t\t\t\t\t\t\t\t\t$text = '';\n\t\t\t\t\t\t\t\t\tfor( $i=0; $i < $words_d; $i++ ) {\n\t\t\t\t\t\t\t\t\t\t$text .= ' '. $texts[$i];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t$text .= '...';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif($enable_tooltip =='yes'){\n\t\t\t\t\t\t\t//generate tooltip content\n\t\t\t\t\t\t\t$text = preg_replace(\"/(\\r\\n|\\n|\\r)/\", \" \", $text); //replace new line characters, important!\n\t\t\t\t\t\t\t$text = htmlspecialchars(addslashes($text)); //format text for overlib popup html display\n\t\t\t\t\t\t\t$tooltip = $tooltip_title. \"::\".$text ;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$tooltip = \"\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$content_buffer .= \"<li class=\\\"rssfeed_item\" . $moduleclass_sfx . \"\\\">\\n\";\n\t\t\t\t\t\tif ($disable_modal == 0) $content_buffer .= '<a href=\"' . $currItem->get_permalink(). '\" title=\"'. $tooltip. '\" class=\"lightbox\" data-group=\"news\" data-height=\"'.$newsWinY .'\" data-width=\"'.$newsWinX.'\" >';\n\t\t\t\t\t\t\telse $content_buffer .= '<a href=\"javascript://\" title=\"'. $tooltip. '\" onclick=\"window.open(\\''.$currItem->get_permalink().'\\',\\'news\\',\\'toolbar=no,location=no,scrollbars=1,status=no,menubar=no,width=' .$newsWinX.',height=' .$newsWinY.', top=50,left=150\\').focus();\">';\n\t\t\t\t\t\tif ($showdate == 1 ){\n\t\t\t\t\t\t\t$dateposition == 0 ? $content_buffer .= $item_title . \"<span class=\\\"rssfeed_date\" . $moduleclass_sfx . \"\\\">\".$date . \"</span> \" : $content_buffer .= \"<span class=\\\"rssfeed_date\" . $moduleclass_sfx . \"\\\"> \".$date . \"</span> \" . $item_title ;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$content_buffer .= $item_title ;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$content_buffer .= \"</a>\\n\";\n\t\t\t\t\t\tif ($rssdesc_2 > 0) {\n\t\t\t\t\t\t\t$desc = strip_tags($currItem->get_description());\n\t\t\t\t\t\t\tif ($desc_limit > 0 && strlen($desc) > $desc_limit ) $desc = substr($desc, 0, $desc_limit ) .\"...\" ;\n\t\t\t\t\t\t\t$content_buffer .= \"<br/>\".$desc .\"<br/>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$content_buffer .= \"</li>\\n\";\n\t\t\t\t\t}\n\t\t\t\t\t$content_buffer .= \" </ul>\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$content_buffer .= \"</div>\";\n\t\t$content_buffer\t.= \"<!-- // RSS BROWSER END -->\\n\";\n\t\t\t\n\t\treturn $content_buffer;\n\t}",
"function get_rss_channel() {\n $rss_content = file_get_contents( DOMPATH . 'rss-blogfeed.xml' );\n\t$rss_file = new SimpleXMLElement( $rss_content );\n\n return $rss_file->channel;\n}"
] | [
"0.60543567",
"0.59281754",
"0.59032947",
"0.5762678",
"0.57523215",
"0.5735073",
"0.5677892",
"0.55989486",
"0.55886763",
"0.5586041",
"0.5571988",
"0.55508846",
"0.5550831",
"0.5489215",
"0.5452659",
"0.54144657",
"0.54060453",
"0.53995746",
"0.5383042",
"0.53714347",
"0.5343162",
"0.5341676",
"0.53299904",
"0.5323831",
"0.5320537",
"0.53133935",
"0.5312564",
"0.5307194",
"0.53006905",
"0.52891505"
] | 0.72749305 | 0 |
Sets the new title of the RSS | public function setTitle($title) {
$this->rssChannel->setTitle($title);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function set_title($title)\r\n {\r\n $this->title = $title;\r\n }",
"function settitle($title) {\n\t\t$this->title=$title;\n\t}",
"public function set_title($title) {\n\t\t$this->title = $title;\n\t}",
"public function set_title( $title ) {\n\t\t$this->title = $title;\n\t}",
"public function setTitle($title) {\n\t\t$this->_title = $title;\n\t}",
"function setTitle($title)\r\n {\r\n $this->_title = $title;\r\n }",
"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\t{\n\t\t$this->_title = $title;\n\t}",
"function set_title($title) {\n\t\n\t $this->titles[] = $title;\t \n\t}",
"public function setTitle($title) {\r\n $this->title = $title ;\r\n }",
"public function setTitle($title)\n {\n $this->m_title = $title;\n }",
"public function setTitle($title) {\n\t\t$this->title = $title;\n\t}",
"public function setTitle($title) {\n\t\t$this->title = $title;\n\t}",
"function setTitle($title) {\n\t\t$this->title = $title;\n\t}",
"public function setTitle($title) {\n if (!$this->title) {\n $this->title = new Title();\n $this->head->addContent($this->title);\n } else {\n $this->title->clearContent();\n }\n $this->title->addContent($title);\n }",
"public function setTitle($title)\r\n {\r\n $this->title = $title;\r\n }",
"public function setTitle($title)\r\n {\r\n $this->title = $title;\r\n }",
"public function setTitle($title) {\r\n\t$this->title = $title;\r\n }",
"public function setTitle($title){\n $this->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($title) {\n $this->_title = htmlspecialchars($title);\n }",
"function setTitle($title) {\n $this->title = $title;\n }",
"public function setTitle($title) {\n $this->title = $title;\n }",
"public function setTitle($title) {\n $this->title = $title;\n }",
"public function setTitle($title) {\n $this->title = $title;\n }",
"public function setTitle($title) {\n $this->title = $title;\n }"
] | [
"0.76617426",
"0.76451087",
"0.7641057",
"0.7618856",
"0.75882316",
"0.7585258",
"0.7566819",
"0.7551745",
"0.7551745",
"0.7551745",
"0.7544568",
"0.7537238",
"0.7531858",
"0.7514016",
"0.75121385",
"0.75121385",
"0.75012374",
"0.7487369",
"0.7486294",
"0.7486294",
"0.74761117",
"0.7473669",
"0.74654764",
"0.74654764",
"0.7462885",
"0.7458256",
"0.74543417",
"0.7442372",
"0.7442372",
"0.7442372"
] | 0.8306916 | 0 |
Sets the link of the RSS | public function setLink($link) {
$this->rssChannel->setLink($link);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setLink($value) {\n $this->link = $value;\n }",
"public function setLink($link)\n {\n $this->_link = $link;\n }",
"public function getRSSLink()\n {\n return $this->Link('rss');\n }",
"public function setLink($link) {\n\t\t$this->link = $link;\n\t}",
"public function __construct($rsslink)\n {\n $this->rsslink = $rsslink;\n }",
"protected function _setFeedUrl()\n\t{\n\t\t$this->_url = $this->_config['gcal_url'];\n\t}",
"function setLinkParttern($link) {\n $this->_link = $link;\n }",
"public function setURL($url) {\n\t\t\t$this->feedURL = $url;\n\t\t}",
"public function setLink($url, $title = null) // This node links to...\n {\n if (isset($title)) {\n $this->link = array(\"href\" => $url, \"title\" => $title);\n } else {\n $this->link = array(\"href\" => $url);\n }\n }",
"public function setLink() {\n\n\t\t$this->link = \"http://localhost:8081/Practica_2/index.php?controller=encuestas&action=view&idEncuesta=\";\n\t}",
"public function setLinkAttribute($value)\n {\n $this->attributes['link'] = SamirzValidator::sanitizeUrl($value)[0];\n }",
"function __construct($id) {\n $this->rss_link = $this->rss_link . $id;\n }",
"public function setLink( $sLink ) {\n\t\t$this->sLink = $sLink;\n\t\treturn $this;\n\t}",
"function pshb_add_rss_link_tag() {\n\t$hub_urls = pshb_get_pubsub_endpoints();\n\tforeach ( $hub_urls as $hub_url ) {\n\t\techo '<atom:link rel=\"hub\" href=\"'.$hub_url.'\"/>';\n\t}\n}",
"public function getFeedLink();",
"public function updateLink($link);",
"public function setAsLink($field_name = NULL) {\n if ($field_name) {\n if (isset($this->entity->{$field_name}) && !$this->entity->{$field_name}->isEmpty() && $uri = $this->entity->{$field_name}->uri) {\n $this->setAttribute('href', Url::fromUri($uri)->toString());\n $this->setAttribute('rel', 'bookmark');\n }\n }\n else {\n $this->setAttribute('href', $this->variables['url']);\n }\n $this->setTag('a');\n $this->setAttribute('rel', 'bookmark');\n return $this;\n }",
"public function setLinkUrl(string $linkUrl)\n\t{\n\t\t$this->linkUrl=$linkUrl; \n\t\t$this->keyModified['$link_url'] = 1; \n\n\t}",
"function setLinkAttribute($name, $value);",
"function setChannelLink($a_link)\n\t{\n\t\t$this->ch_link = $a_link;\n\t}",
"public function getFeedLink() {\r\n\t\tif (array_key_exists ( 'feedlink', $this->data )) {\r\n\t\t\treturn $this->data ['feedlink'];\r\n\t\t}\r\n\t\t\r\n\t\t$link = null;\r\n\t\t\r\n\t\t$link = $this->getExtension ( 'Atom' )->getFeedLink ();\r\n\t\t\r\n\t\tif ($link === null || empty ( $link )) {\r\n\t\t\t$link = $this->getOriginalSourceUri ();\r\n\t\t}\r\n\t\t\r\n\t\t$this->data ['feedlink'] = $link;\r\n\t\t\r\n\t\treturn $this->data ['feedlink'];\r\n\t}",
"function setLinks($links) \n {\n $this->linkValues = $links;\n }",
"function setLinks( $links )\n {\n $this->links = $links;\n }",
"function setLink($link_to,$what)\r\n\t{\r\n\t\t$this->link_to[$this->data_num] \t= $link_to;\r\n\t\t$this->link_field[$this->data_num]\t= $what;\r\n\t}",
"public function getLink() {\r\n\t\tif (array_key_exists ( 'link', $this->data )) {\r\n\t\t\treturn $this->data ['link'];\r\n\t\t}\r\n\t\t\r\n\t\t$link = null;\r\n\t\t\r\n\t\tif ($this->getType () !== Reader\\Reader::TYPE_RSS_10 && $this->getType () !== Reader\\Reader::TYPE_RSS_090) {\r\n\t\t\t$link = $this->xpath->evaluate ( 'string(/rss/channel/link)' );\r\n\t\t} else {\r\n\t\t\t$link = $this->xpath->evaluate ( 'string(/rdf:RDF/rss:channel/rss:link)' );\r\n\t\t}\r\n\t\t\r\n\t\tif (empty ( $link )) {\r\n\t\t\t$link = $this->getExtension ( 'Atom' )->getLink ();\r\n\t\t}\r\n\t\t\r\n\t\tif (! $link) {\r\n\t\t\t$link = null;\r\n\t\t}\r\n\t\t\r\n\t\t$this->data ['link'] = $link;\r\n\t\t\r\n\t\treturn $this->data ['link'];\r\n\t}",
"public function getLink() {\n\t\tif (array_key_exists ( 'link', $this->_data )) {\n\t\t\treturn $this->_data ['link'];\n\t\t}\n\t\t\n\t\t$link = null;\n\t\t\n\t\tif ($this->getType () !== Zend_Feed_Reader::TYPE_RSS_10 && $this->getType () !== Zend_Feed_Reader::TYPE_RSS_090) {\n\t\t\t$link = $this->_xpath->evaluate ( 'string(/rss/channel/link)' );\n\t\t} else {\n\t\t\t$link = $this->_xpath->evaluate ( 'string(/rdf:RDF/rss:channel/rss:link)' );\n\t\t}\n\t\t\n\t\tif (empty ( $link )) {\n\t\t\t$link = $this->getExtension ( 'Atom' )->getLink ();\n\t\t}\n\t\t\n\t\tif (! $link) {\n\t\t\t$link = null;\n\t\t}\n\t\t\n\t\t$this->_data ['link'] = $link;\n\t\t\n\t\treturn $this->_data ['link'];\n\t}",
"public function set($sLink) {\n $this->_aLinkParts = parse_url($sLink);\n $this->_aLinkParts['link'] = $sLink;\n // parse parts\n return $this;\n }",
"protected function assignPopupLink() {\n\t\tif ($this->settings['link']) {\n\t\t\tunset($linkconf);\n\t\t\t$links = GeneralUtility::trimExplode(\"\\n\", $this->settings['link'], TRUE);\n\t\t\tif ($this->settings[type] == 'IMAGE') {\n\t\t\t\t$link = $links[$this->imageKey];\n\t\t\t} else $link = $link = $links[0];\n\t\t\t$linkconf['parameter'] = $link;\n\t\t\t$linkURL = $this->cObj->typoLink_URL($linkconf);\n\t\t\t$this->view->assign('link', $linkURL);\n\t\t}\n\t}",
"public function updateCMSEditLink(&$link)\n {\n $controller = AssetAdmin::singleton();\n $link = Director::absoluteURL($controller->getFileEditLink($this->owner));\n }",
"public function setLinkAttribute($value)\n {\n $this->attributes['link'] = strtolower($value);\n }"
] | [
"0.7278149",
"0.69915026",
"0.6986762",
"0.68963885",
"0.6869493",
"0.66894895",
"0.66713315",
"0.66519517",
"0.66022795",
"0.658099",
"0.6575469",
"0.65133524",
"0.6316051",
"0.62845147",
"0.62775844",
"0.62674975",
"0.62563527",
"0.6254963",
"0.6233769",
"0.62103856",
"0.61924094",
"0.61885875",
"0.6183809",
"0.6176445",
"0.61640257",
"0.61403036",
"0.6138079",
"0.6134274",
"0.61214197",
"0.6110295"
] | 0.8027197 | 0 |
Sets the description of the RSS | public function setDescription($description) {
$this->rssChannel->setDescription($description);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setDescription($description=\"\") {\n $this->description = $description;\n }",
"public function setDescription($description){\n $this->description = $description;\n }",
"public function setDescription( $description ) \n {\n $this->description = $description; \n }",
"function setDescription($description = \"\") \n\t{\n\t\t$this->description = $description;\n\t}",
"public function setDescription($description)\r\n {\r\n $this->_description = $description;\r\n }",
"public function setDescription($description) {\r\n\t$this->description = $description;\r\n }",
"public function setDescription($desc)\n\t{\n\t\t$this->description = $desc;\n\t}",
"public function setDescription($description) {\n $this->description = $description;\n }",
"public function setDescription($description) {\n $this->description = $description;\n }",
"function setDescription($value) {\n $this->description = $value;\n }",
"public function setDescription($description) {\n $this->description = $description;\n }",
"public function setDescription($description) {\n $this->description = $description;\n }",
"public function setDescription($val) {\n $this->_description = $val;\n }",
"public function setDescription($description)\n {\n $this->_description = $description;\n }",
"public function setDescription($description)\n\t{\n\t $this->description = $this->cleanHTML($description);\n\t}",
"function setDescription($new_description)\n\t\t{\n\t\t\t$this->description = $new_description;\n\t\t}",
"protected function set_description($description) {\n \n $this->description = (string)$description;\n \n }",
"public function setDescription($description) {\n\t\t$this->description = $description;\n\t}",
"public function setDescription($description) {\n $this->description = $description;\n }",
"public function setDescription($description) {\n $this->description = $description;\n }",
"public function setDescription($description) {\n $this->description = $description;\n }",
"public function setDescription($description)\n\t{\n\t\t$this->description = $description;\n\t}",
"public function setDescription($description)\n {\n $this->description = $description;\n }",
"public function setDescription($description)\n {\n $this->description = $description;\n }",
"public function setDescription($description)\n {\n $this->description = $description;\n }",
"public function setDescription($description)\n {\n $this->description = $description;\n }",
"public function setDescription($description)\n {\n $this->description = $description;\n }",
"public function setDescription($description)\n {\n $this->description = $description;\n }",
"public function setDescription($description)\n {\n $this->description = $description;\n }",
"public function setDescription( $description )\n {\n $this->description = $description;\n }"
] | [
"0.7201568",
"0.71884793",
"0.71532166",
"0.7145639",
"0.7137126",
"0.71094024",
"0.7103339",
"0.70918703",
"0.70918703",
"0.70860666",
"0.70653313",
"0.70653313",
"0.7061615",
"0.70609784",
"0.7051049",
"0.70480084",
"0.70468396",
"0.70424765",
"0.7023549",
"0.7023549",
"0.7023549",
"0.69900197",
"0.69726413",
"0.69726413",
"0.69726413",
"0.69726413",
"0.69726413",
"0.69726413",
"0.69726413",
"0.6957267"
] | 0.8174254 | 0 |
Builds the configuration object based on the conf. | private function buildConfigurations(
array $conf
) {
/* @var $configurations \Tx_Rnbase_Configuration_ProcessorInterface */
$configurations = \tx_rnbase::makeInstance(
'Tx_Rnbase_Configuration_Processor'
);
$configurations->init(
$conf,
$this->getContentObject(),
't3twig',
't3twig'
);
return $configurations;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function build()\n {\n $config = parent::build();\n $fields = $this->fieldsBuilder->build();\n $config['sub_fields'] = $fields['fields'];\n return $config;\n }",
"public function __construct()\n\t\t{\n\t\t\tif ( self::$_constructed ) return;\n\t\t\tself::$_constructed = true;\n\t\t\t$config = Table::_( 'config' )->fetchAll();\n\t\t\tforeach ( $config as $param ) {\n\t\t\t\tif ( !isset ( $this->{$param->section} ) ) {\n\t\t\t\t\t$this->{$param->section} = new Config();\n\t\t\t\t\t$this->{$param->section}->_fieldName = $param->section;\n\t\t\t\t}\n\t\t\t\t$lastField = &$this->{$param->section};\n\t\t\t\t$fields = explode( '.', $param['name'] );\n\t\t\t\t$lastFieldName = end( $fields );\n\t\t\t\treset( $fields );\n\t\t\t\tforeach ( $fields as $field ) {\n\t\t\t\t\tif ( !property_exists( $lastField, $field ) ) {\n\t\t\t\t\t\tif ( $field != $lastFieldName ) {\n\t\t\t\t\t\t\t$lastField->{$field} = new Config();\n\t\t\t\t\t\t\t$lastField->{$field}->_fieldName = $field;\n\t\t\t\t\t\t\t$lastField->{$field}->_parentField = $lastField;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$value = $param['value'];\n\t\t\t\t\t\t\t$value = str_replace( 'ROOT_PATH', ROOT_PATH, $value );\n\t\t\t\t\t\t\t$value = str_replace( 'APPLICATION_PATH', APPLICATION_PATH, $value );\n\t\t\t\t\t\t\t$lastField->{$field} = $value;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$lastField = &$lastField->{$field};\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"abstract protected function newConfiguration();",
"protected function createConfiguration()\n {\n // check if a phpbu xml/json config file is configured\n $phpbuConfigFile = $this->configProxy->get('phpbu.phpbu');\n if (!empty($phpbuConfigFile)) {\n // load xml or json configurations\n $configLoader = PhpbuConfigLoaderFactory::createLoader($phpbuConfigFile);\n $configuration = $configLoader->getConfiguration($this->runner->getFactory());\n } else {\n $this->validateConfig();\n // no phpbu config so translate the laravel settings\n $translator = new Translator();\n $configuration = $translator->translate($this->configProxy);\n $configuration->setSimulate((bool) $this->option('phpbu-simulate'));\n // in laravel mode we sync everything using the Laravel Filesystems\n PhpbuFactory::register('sync', 'laravel-storage', '\\\\phpbu\\\\Laravel\\\\Backup\\\\Sync\\\\LaravelStorage');\n }\n return $configuration;\n }",
"static function fromConfig(array $conf);",
"public function build()\n {\n $connectionManager = new ConnectionManager();\n\n foreach ($this->config['connections'] as $alias => $conn) {\n $config =\n isset($this->config['connections'][$alias]['config'])\n ? $this->config['connections'][$alias]['config']\n : Configuration::create()\n ->withTimeout(5);\n $connectionManager->registerConnection(\n $alias,\n $conn['uri'],\n $config\n );\n\n if (isset($conn['is_master']) && $conn['is_master'] === true) {\n $connectionManager->setMaster($alias);\n }\n }\n\n $ev = null;\n\n if (isset($this->config['event_listeners'])) {\n $ev = new EventDispatcher();\n\n foreach ($this->config['event_listeners'] as $k => $callbacks) {\n foreach ($callbacks as $callback) {\n $ev->addListener($k, $callback);\n }\n }\n }\n\n return new $this->config['client_class']($connectionManager, $ev);\n }",
"abstract protected function getConfiguration();",
"public function makeConfig()\n {\n // check if properties defined by the user and pass them to the config file if so\n $configFilePath = $this->getProperty(self::CONFIG_FILE_PATH_PROPERTY, false);\n\n // config file path is not defined by the user then get the config file path automatically\n if (is_null($configFilePath)) {\n $configFilePath = $this->getConfigFilePath();\n }\n\n return new Config($configFilePath);\n }",
"public function generateConfiguration()\n {\n }",
"public function __construct($conf = array())\n {\n \n }",
"public function getConfiguration();",
"public function getConfiguration();",
"public function getConfiguration();",
"public function build()\n {\n foreach ($this->config as $option => $value) {\n $this->riskFactor->$option = $value;\n }\n }",
"abstract public function setupConfig();",
"protected function configurable()\n {\n $this->config = ConfigFactory::makeOne();\n }",
"public static function create()\n {\n return new Configuration();\n }",
"private function configuration()\n {\n $config = [];\n $config_json = $this->getPath().'config.json';\n $config_php = $this->getPath().'config.php';\n\n // Parse config from jSon file\n if (file_exists($config_json))\n {\n $config = array_merge(\n $config, \n $this->json( $config_json, true )\n );\n }\n else if (file_exists($config_php))\n {\n include_once $config_php;\n }\n\n // Parse config from Index.php\n $config = array_merge(\n $config,\n self::configuration_index($this->getPath())\n );\n\n $this->config = (object) $config;\n }",
"public function build()\n\t{\n\t\tparent::build();\n\n\t\t//set the upload url depending on the type of config this is\n\t\t$url = $this->validator->getUrlInstance();\n\t\t$route = $this->config->getType() === 'settings' ? 'admin_settings_file_upload' : 'admin_file_upload';\n\n\t\t//set the upload url to the proper route\n\t\t$model = $this->config->getDataModel();\n\n\t\t$uploadUrl = $url->route(\n\t\t\t$route,\n\t\t\tarray(\n\t\t\t\t'model' => $this->config->getOption('name'),\n\t\t\t\t'field' => $this->suppliedOptions['field_name'],\n\t\t\t\t'id' => $model ? $model->{$model->getKeyName()} : null,\n\t\t\t)\n\t\t);\n\n $this->suppliedOptions['upload_url'] = preg_replace('$([^:])(//)$', '\\1/', $uploadUrl);\n\t}",
"private static function setupBaseConfiguration() {\n\n\t\t// server data\n\t\tself::set('host', $_SERVER['SERVER_NAME']);\n\t\tself::set('domain', 'http://' . $_SERVER['SERVER_NAME']);\n\t\tself::set('current_file', basename($_SERVER['PHP_SELF']));\n\t\tself::set('webroot', '/');\n\t\tself::set('web_address', self::get('domain') . self::get('webroot'));\n\t\tself::set('web_address_no_slash', substr(self::get('domain') . self::get('webroot'), 0, -1));\n\t\tself::set('root', $_SERVER['DOCUMENT_ROOT'] . self::get('webroot'));\n\t\t\n\t\t// folder locations\n\t\tself::set('modules', self::get('root') . 'modules/');\n\t\tself::set('config', self::get('root') . 'app/config/');\n self::set('temp', self::get('root') . 'runtime/');\n self::set('app', self::get('root') . 'app/');\n\t\t\n\t\t// errors\n\t\tself::set('error_log', self::get('temp') . 'errors/php.txt');\n\n\t\tself::parseIniConfig('system');\n self::parseIniConfig('source');\n self::parseIniConfig('custom');\n \n }",
"protected function getConfiguration()\n {\n return new Configuration();\n }",
"public function configuration();",
"public function getConfigTreeBuilder()\n {\n return $this->buildConfiguration();\n }",
"abstract function build($template, AbstractConfig $config);",
"public static function config()\n {\n return Config::forClass(get_called_class());\n }",
"private function __construct()\n {\n\n // HTTP Host\n $http_host = $_SERVER['HTTP_HOST'];\n \n // Home\n if (is_array($this->config['states']) && count($this->config['states']) == 1) {\n $stateList = State::getStates();\n $this->config['settings']['URL_BUILDERS'] = Settings::getInstance()->SETTINGS['URL_RAW'] . '/builders/' . str_replace(' ', '-', strtolower($stateList[$this->config['states'][0]]));\n } else {\n $this->config['settings']['URL_BUILDERS'] = Settings::getInstance()->SETTINGS['URL_RAW'] . '/builders';\n }\n $this->config['settings']['BASE_URL_BUILDERS'] = Settings::getInstance()->SETTINGS['URL_RAW']. '/builders';\n \n // Replace %host% and %root% For Web Addresses\n if (!empty($this->config['urls']) && is_array($this->config['urls'])) {\n foreach ($this->config['urls'] as $k => $v) {\n $this->config['urls'][$k] = str_replace(array(\n '%host%',\n '%root%'\n ), array(\n Http_Uri::getScheme() . '://' . $http_host,\n Http_Uri::getScheme() . '://' . $http_host\n ), $v);\n }\n }\n\n // Replace %root% For Directory Paths\n if (!empty($this->config['dirs']) && is_array($this->config['dirs'])) {\n foreach ($this->config['dirs'] as $k => $v) {\n $this->config['dirs'][$k] = str_replace('%root%', $_SERVER['DOCUMENT_ROOT'], $v);\n }\n }\n }",
"public function buildConfigCache() {\r\n\t\t$this->_writeFileStart($this->_frontCacheFileWriter);\r\n\t\t$this->_writeFileStart($this->_adminCacheFileWriter);\r\n\t\t$this->_writeFileStart($this->_settingsCacheFileWriter);\r\n\t\t$this->_writeFileStart($this->_eventsCacheFileWriter);\r\n\t\tforeach ($this->_supportedLanguages as $language) {\r\n\t\t\t$this->_writeMsgFileStart($this->_messagesFileWriters[$language]);\r\n\t\t\t$this->_writeMsgFileStart($this->_adminMessagesFileWriters[$language]);\r\n\t\t\t$this->_writeMsgFileStart($this->_entityMessagesFileWriters[$language]);\r\n\t\t}\t\t\r\n\t\t\r\n\t\t$this->_buildModulesConfig();\r\n\t\t\r\n\t\t$this->_writeFileEnd($this->_frontCacheFileWriter);\r\n\t\t$this->_writeFileEnd($this->_adminCacheFileWriter);\r\n\t\t$this->_writeFileEnd($this->_settingsCacheFileWriter);\r\n\t\t$this->_writeFileEnd($this->_eventsCacheFileWriter);\r\n\t\tforeach ($this->_supportedLanguages as $language) {\r\n\t\t\t$this->_writeMsgFileEnd($this->_messagesFileWriters[$language]);\r\n\t\t\t$this->_writeMsgFileEnd($this->_adminMessagesFileWriters[$language]);\r\n\t\t\t$this->_writeMsgFileEnd($this->_entityMessagesFileWriters[$language]);\r\n\t\t}\t\t\r\n\t\t\r\n\t\t// update global config\r\n\t\tif (is_array($this->_newSettings) && count($this->_newSettings)) {\r\n\t\t\tglobal $conf;\r\n\t\t\t$cf = ConfigFileWriter::getInstance($conf);\r\n\t\t\t$cf->saveSettings($this->_newSettings);\r\n\t\t}\r\n\r\n\t}",
"public static function Create()\n {\n return new Conf();\n }",
"public function getConfigTreeBuilder()\n {\n }",
"abstract public function configure();"
] | [
"0.66977316",
"0.6483767",
"0.63840264",
"0.63135403",
"0.6178729",
"0.6171486",
"0.6158218",
"0.59949476",
"0.59005404",
"0.5890615",
"0.58234626",
"0.58234626",
"0.58234626",
"0.5816048",
"0.5809042",
"0.57838964",
"0.5782022",
"0.5741094",
"0.5704598",
"0.5697178",
"0.5689699",
"0.5683548",
"0.56728864",
"0.5647839",
"0.56429136",
"0.56232995",
"0.56230825",
"0.55913174",
"0.5558477",
"0.5554414"
] | 0.6658961 | 1 |
/ unique valid student roll verification is done here | public function unique_roll($roll)
{
if (empty($roll)) {
return true;
}
$branchID = $this->application_model->get_branch_id();
$classID = $this->input->post('class_id');
if ($this->uri->segment(3)) {
$this->db->where_not_in('student_id', $this->uri->segment(3));
}
$this->db->where(array('roll' => $roll, 'class_id' => $classID, 'branch_id' => $branchID));
$q = $this->db->get('enroll')->num_rows();
if ($q == 0) {
return true;
} else {
$this->form_validation->set_message("unique_roll", translate('already_taken'));
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkRoll($roll)\n {\n global $conn;\n $sql = \"SELECT * FROM alumni_info WHERE roll = '$roll'\";\n $com_data = $conn->query($sql);\n $num_rows = $com_data->num_rows;\n\n if ($num_rows > 0) {\n return false;\n } else {\n return true;\n }\n }",
"public static function checkStudent()\n {\n return array_key_exists('fn', $_SESSION) && is_numeric($_SESSION['fn']) && !self::checkTeacher();\n }",
"public static function valid_student($admno)\n {\n $student = Studentdetails::where('admno', '=', $admno)->first();\n if(count($student)< 1){\n return false;\n } else{\n return true;\n }\n }",
"public function check_max_student(){\n\t\t// $this->db->select('*');\n\t\t// $this->db->from('acadah_setup');\n\t\t// $this->db->where('setup_id', $schoolid);\n\t\t$sch_id = $_SESSION['sch_id'];\n\t\t$query = $this->db->get_where('acadah_school', array('sch_id=>$sch_id'));\n\t\t// $query = $this->db->get();\n\t\t$query = $query->row_array();\n\t\t$max_student = $query['max_student'];\n\t\t//Next I am gonna count the number of users in the db and see the number of students already added\n\t\t$this->db->select(\"*\");\n\t\t$this->db->from('acadah_users');\n\t\t$this->db->where('sch_id',$sch_id);\n\t\t$this->db->where('user_type','student');\n\t\t$query = $this->db->get();\n\t\t$current_student = $query->num_rows();\n\t\tif($current_student == $max_student){\n\t\t\treturn \"You Can No longer add any more student, please subscribe for more slots\";\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}",
"function check_studAddOnce($user,$student_code)\n{\n\t$q = mysql_query(\"SELECT id FROM Members_Student WHERE mem_id = '$user' AND stud_id = '$student_code\");\n\n\tif($q === false)\n\t{\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n\t\n}",
"function check_if_exam_taken($dbc, $student_id, $course){\r\n\t\t// If yes, display the matric number and score\r\n\t\t// exit the script\r\n\t\t$q1 = \"SELECT score FROM student_results WHERE student_id = $student_id AND course_id = $course\";\r\n\t\t//exit($q1);\r\n\t\t$r1 = mysqli_query($dbc, $q1);\r\n\t\tif (mysqli_num_rows($r1) > 0 ) {\r\n\t\t\t$row1 = mysqli_fetch_array($r1, MYSQLI_ASSOC);\r\n\t\t\t//unset($_SESSION['matricno'],$_SESSION['course_id'], $_SESSION['qn'], $_SESSION['question_id'] );\r\n\t\t\t\r\n\t\t\t//session_destroy();\r\n\t\t\t\r\n\t\t\t//session_regenerate_id();\r\n\t\t\t//include 'views/already_taken_exam.html';\r\n\t\t\treturn true;\r\n\t\t\texit();\r\n\t\t}\r\n}",
"function sidValidation($SID,$conn){\n // echo 'sid.'.$SID;\n $sql = \"SELECT SID FROM students\";\n $result = mysqli_query($conn,$sql);\n foreach ($result as $e) {\n // print_r($e['SID']);\n if($SID==$e['SID']){\n return 1;\n }\n }\n return 0;\n }",
"private function validateSSNHash() {\n $ssnHashParts = $this->ssnDay . $this->ssnMonth . $this->ssnYear . $this->ssnUnique;\n\n $ssnHashPartsInt = (int)$ssnHashParts;\n\n $remainder = $ssnHashPartsInt % 31;\n\n // Compare SSN hash to the precalculated remainder value hash\n if($this->ssnHash != $this->ssnHashes[$remainder]) {\n return false;\n }\n\n return true;\n }",
"public function addMarks($roll) {\n if ($this->input->post()) {\n $studentInfo = $this->ma->getSingleStudentinfo($roll);\n\n if (!empty($studentInfo)) {\n $this->addStudentMarks(intval($studentInfo->student_id));\n } else {\n $this->session->set_flashdata('error', 'Student information not found!');\n redirect('admin/all-students');\n }\n }\n\n $result = $this->ma->getSingleStudentResult($roll);\n if ($result) {\n $this->load->view('admin/notice2');\n } else {\n $students = $this->ma->getSingleStudentinfo($roll);\n $this->load->view('admin/add_result', ['students' => $students, 'roll' => $roll]);\n }\n }",
"function StudentInfoValidation()\r\n\t{\r\n\t\t$errorFlag = false;\r\n\t\tif (!preg_match(\"/^[a-zA-z ]*$/\", $_POST[\"Firstname\"]))\r\n\t\t{\r\n\t\t\techo \"Error: Firstname Entered Incorrectly\";\r\n\t\t\t$errorFlag = true;\r\n\t\t}\r\n\t\tif (!preg_match(\"/^[a-zA-z ]*$/\", $_POST[\"Surname\"]))\r\n\t\t{\r\n\t\t\techo \"Error: Surname Entered Incorrectly!\";\r\n\t\t\t$errorFlag = true;\r\n\t\t}\r\n\t\tif (!preg_match(\"/^[0-9]{8}$/\", $_POST[\"StudentID\"]))\r\n\t\t{\r\n\t\t\t$nameErr = \"Error: StudentID Entered Incorrectly!\";\r\n\t\t\t$errorFlag = true;\r\n\t\t}\r\n\t\treturn $errorFlag;\r\n\t}",
"public function CUENROLL($data)\n {\n $adviserstudentid = $data['StudID'];\n $advisersectid = $data['SectID'];\n $grade = $data['Grade'];\n\n // $checkEmail = $this->checkExistEmail($email);\n\n if ($adviserstudentid == \"\" || $advisersectid == \"\") {\n $msg = '<div class=\"alert alert-danger alert-dismissible mt-3\" id=\"flash-msg\">\n\t\t\t <a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">×</a>\n\t\t\t <strong>Error !</strong> STUDENT & SECTION Input fields must not be Empty ! GRADE (OPTIONAL)</div>';\n return $msg;\n } elseif (strlen($adviserstudentid) < 3) {\n $msg = '<div class=\"alert alert-danger alert-dismissible mt-3\" id=\"flash-msg\">\n\t\t\t <a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">×</a>\n\t\t\t <strong>Error !</strong> User Identification Number Is Incorrect Length !</div>';\n return $msg;\n } elseif (filter_var($advisersectid, FILTER_SANITIZE_NUMBER_INT) == FALSE) {\n $msg = '<div class=\"alert alert-danger alert-dismissible mt-3\" id=\"flash-msg\">\n\t\t\t <a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">×</a>\n\t\t\t <strong>Error !</strong> Enter only Numbers for Section Identification field !</div>';\n return $msg;\n } elseif (filter_var($adviserstudentid, FILTER_SANITIZE_NUMBER_INT) == FALSE) {\n $msg = '<div class=\"alert alert-danger alert-dismissible mt-3\" id=\"flash-msg\">\n <a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">×</a>\n <strong>Error !</strong> Enter only Numbers for Student Identification Value !</div>';\n return $msg;\n } else {\n\n $sql = \"INSERT INTO History (StudID, SectID, Grade) VALUES(:adviserstudentid, :advisersectid, :grade)\";\n $stmt = $this->db->pdo->prepare($sql);\n $stmt->bindValue(':adviserstudentid', $adviserstudentid);\n $stmt->bindValue(':advisersectid', $advisersectid);\n $stmt->bindValue(':grade', $grade);\n\n $result = $stmt->execute();\n\n if ($result) {\n $msg = '<div class=\"alert alert-success alert-dismissible mt-3\" id=\"flash-msg\">\n\t\t\t\t<a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">×</a>\n\t\t\t\t<strong>Success !</strong> Wow, you have CU Enrolled Successfully !</div>';\n return $msg;\n } else {\n $msg = '<div class=\"alert alert-danger alert-dismissible mt-3\" id=\"flash-msg\">\n\t\t\t\t<a href=\"#\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">×</a>\n\t\t\t\t<strong>Error !</strong> OOPS Something went Wrong !</div>';\n return $msg;\n }\n }\n }",
"function StudentInfoValid()\n{\n $student_username = htmlspecialchars($_POST[\"student_username\"]);\n $student_password = htmlspecialchars($_POST[\"student_password\"]);\n \n //If the account exists check if the credentials are valid\n if (Student::AccountExists($student_username))\n {\n\n if(Student::LoginInfoValid($student_username,$student_password))\n {\n \n //Cleanup - we don't need this anymore\n unset($student_username);\n unset($student_password); \n return true;\n }\n else\n { \n //Cleanup - we don't need this anymore\n unset($student_username);\n unset($student_password); \n return false;\n }\n \n }\n else //The account does not exist. Return false\n {\n // ErrorHandler::PrintSuccess(\"Account doesn't exist <br>Username input: \".$student_username.\"<br>Password input :\".$student_password);\n\n //Cleanup - we don't need this anymore\n unset($student_username);\n unset($student_password); \n return false;\n }\n}",
"public function add_student_from_classroom()\n {\n $sname = $this->input->post('username');\n $classroom_id = $this->input->post('classroom_id');\n $student_id = $this->check_username_exists($sname);\n\n //if the student is already enrolled, return false\n $is_enrolled = $this->db->get_where('enrolled_students', array('classroom_id' => $classroom_id, 'student_id' => $student_id))->num_rows();\n\n if ($student_id !== FALSE && $is_enrolled == FALSE) {\n $data = array(\n 'classroom_id' => $classroom_id,\n 'student_id' => $student_id\n );\n $this->db->insert('enrolled_students', $data);\n return $this->db->affected_rows() > 0;\n } else {\n return false;\n }\n }",
"public function check_or_add_student_to_user_student($student_data) {\n\t\t//print_r($student_data); echo \"<br>\";\n\t\t$table = 'user_student';\n\n\t\t// check first before add\n\t\t$this->db->where(\"stu_id\",$student_data['stu_id']);\n\t\t$query = $this->db->get($table);\n\t\tif ($query->num_rows() >= 1) {\n\t\t\t//echo \"Already exist : \"; print_r($query->result_array());\n\t\t\treturn \"Already exist !!!\";\n\t\t} else { \n\t\t\t//add new student to 'user' table\n\t\t\t\n\t\t\t$this->db->insert($table,$student_data);\n\t\t\t//echo \"Insert : \".$student_data['stu_id'].\" : num of row : \".$this->db->affected_rows();\n\t\t\treturn \"OK\";\n\t\t}\n\n\t}",
"function register_student($data){\n global $current_user;\n\n \tif(check_token($data['crf_code'],'check')){\n\n\nif (preg_match('/-/', $data['balance'])) {\n exit('invalid balance please check paid or discounts');\n}\n\n// fix date\n\nif ($data['admin_date'] > 31) {\n exit('invalid billing date ');\n}else{\n $data['admin_date'] = date('Y-m').'-'.$data['admin_date']; \n}\n\n$data['gender'] = 'male';\n\n/* if (empty($data['gender'])) {\n exit('choose gender!');\n }*/\n\n\n // register student \n if(empty($data['student_id'])){\n mysqli_query_(\"INSERT INTO `students`(`name`, `mobile`, `date`, `address`, `status`, `gender`, `description`) VALUES ('{$data['name']}','{$data['mobile']}','{$data['admin_date']}','{$data['address']}','1','{$data['gender']}','{$data['description']}')\");\n $student_id = mysqli_result_(mysqli_query_(\"select student_id from students where delete_status!='1' ORDER BY student_id DESC LIMIT 1\"),0);\n $data['student_id'] = $student_id;\n }else{\n $student_id = sanitize($data['student_id']);\n $data['student_id'] = sanitize($data['student_id']);\n\n }\n\n\n // create student subject \n for ($i=0; $i < count($data['courses_data']['subject']); $i++) { \n $subject = sanitize($data['courses_data']['subject'][$i]);\n $oneTimeDisounct_ = sanitize($data['courses_data']['oneTimeDisounct'][$i]);\n \n $cost = sanitize(str_replace(',','',$data['courses_data']['cost'][$i]));\n $monthly_discount = sanitize(str_replace(',','',$data['courses_data']['monthly_discount'][$i])); \n $monthly_discount = (ctype_digit($monthly_discount ))?$monthly_discount:0;\n $paid_ = sanitize(str_replace(',','',$data['courses_data']['paid'][$i]));\n $subject_id = sanitize(str_replace(',','',$data['courses_data']['subject_id'][$i]));\n\n \n $teacher = mysqli_result_(mysqli_query_(\"select teacher from subjects where subject='$subject_id'\"),0);\n $time = mysqli_result_(mysqli_query_(\"select time from subjects where subject='$subject_id'\"),0); \n $discription = mysqli_result_(mysqli_query_(\"select description from subjects where subject='$subject_id'\"),0);\n\n // add student subject \n mysqli_query_(\"INSERT INTO `student_subjects`(`subject`, `teacher`, `time`, `discount`, `cost`, `description`, `student_id`, `subject_id`, `admin_date`) VALUES ('$subject','$teacher','$time','$monthly_discount','$cost','$discription','$student_id','$subject_id','{$data['admin_date']}')\");\n\n \n // create invoices\n $from_date = date('Y-m-d',strtotime(\"{$data['admin_date']}\"));\n $to_date = date('Y-m-d',strtotime(\"+1 month $from_date\"));\n \n $cos_d = $cost-$monthly_discount;\n mysqli_query_(\"INSERT INTO `invoices`(`student_id`, `from_date`, `to_date`, `student_subject`, `balance`, `status`) VALUES ('$student_id','$from_date','$to_date','$subject','$cos_d','1')\");\n\n\n\n \n\n }\n\n \n\n\n $data['balance'] = sanitize(str_replace(',','',$data['balance']));\n $data['paid'] = sanitize(str_replace(',','',$data['paid']));\n $data['discount'] = sanitize(str_replace(',','',$data['discount']));\n \n $data['paid'] = (ctype_digit($data['paid']))?$data['paid']:0;\n $data['discount'] = (ctype_digit($data['discount']))?$data['discount']:0;\n\n\n\n// make payment \n \n if (!empty($data['paid']+$data['discount'])) {\n \n mysqli_query_(\"INSERT INTO payments (`student_id`,`amount`,`discount`,`date`,`description`,`taken_by`)VALUES('$student_id','{$data['paid']}','{$data['discount']}','{$data['admin_date']}','{$data['description']}','$current_user')\");\n\n $data['paid'] = $data['paid']+$data['discount'];\n fix_unpaid_invoices($student_id,$data['paid']);\n\n\n } \n\n if (!empty($data['r_fee'])){\n mysqli_query_(\"INSERT INTO payments (`student_id`,`amount`,`discount`,`date`,`description`,`taken_by`)VALUES('$student_id','{$data['r_fee']}','0','{$data['admin_date']}','registration fee','$current_user')\");\n\n }\n\n \n\t\t\t \n\t\t\t\t// remove_crf\n\t\t\t\t check_token($data['crf_code'],''); \n\n\t\t\t\treturn 'ok';\t\n\t\t\t\t \n\t}else{\n\t\treturn 'login';\n\t}\n}",
"function chk_s_id($s_id, $registered_id = null)\n\t{\n\t\tglobal $epsclass, $eps_lang;\n\n\t\tif (preg_match('#^200[23][c\\d]{4}$#uis', $s_id))\n\t\t{\n\t\t\t$sql = \"SELECT s_id FROM \".TBL_USER.\" WHERE s_id='\".$epsclass->db->escape($s_id).\"'\";\n\t\t\tif ($registered_id > 0)\n\t\t\t\t$sql .= ' AND id!='.$registered_id;\n\n\t\t\t$result = $epsclass->db->query($sql) or error('Unable to fetch user info', __FILE__, __LINE__, $epsclass->db->error());\n\t\t\tif ($epsclass->db->num_rows($result))\n\t\t\t{\n\t\t\t\t$this->errors[] = $eps_lang['StudentID'].': '.$eps_lang['Validate_duplicate'];\n\t\t\t\t$epsclass->db->free_result($result);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$epsclass->db->free_result($result);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->errors[] = $eps_lang['StudentID'].': '.$eps_lang['Validate_invalid'];\n\t\t\treturn false;\n\t\t}\n\t}",
"public function validate_studentID()\n {\n $validationResult = [];\n //Added 'constriant' that studentID must be an integer greater than 0\n if(!is_int($this->studentID) || $this->studentID <= 0)\n {\n $validationResult ['studentID'] = 'Student ID must be an integer greater than 0';\n }\n\n return $validationResult;\n }",
"public function studentEnroll()\n\t {\n\n\t\t$this->getCoursesFee($this->course_id);\n\t\t//echo '<pre>'; print_r($this->course_fee); exit;\n\t\t$this->transaction_uid = 'TR-'.mt_rand(100000,999999);\n\t\t\n\t\t// BEGIN A TRANSACTION //\n\t\tmysql_query('BEGIN');\n\t\t\n\t\t$sql = \"INSERT INTO tbl_transactions SET \n\t\ttt_transaction_uid = '\".$this->transaction_uid.\"',\n\t\ttt_student_id='\".$this->student_id.\"',\n\t\ttt_amount = '\".$this->amount.\"',\n\t\ttt_trnsaction_type = '\".$this->transaction_type.\"',\n\t\ttt_transaction_date = CURRENT_DATE(),\n\t\ttt_transaction_time = TIME(NOW()),\n\t\ttt_ip_address = '\".$this->ip_address.\"' \";\t\n\t\t \n\t\tmysql_query($sql);\n\t\tif(!(mysql_affected_rows()) > 0){mysql_query('ROLLBACK'); return 'MAIN_TRAN_FAIL';}\n\t\t\n\t\t$this->transaction_id = mysql_insert_id();\n\t\t\n\t\tforeach($this->course_fee as $key => $value)\n\t\t{\n\t\t\t$query = \"INSERT INTO tbl_transaction_details (tt_transactions_id,tt_course,tt_fee) VALUES(\n\t\t\t$this->transaction_id,'\".$value['tc_course_id'].\"','\".$value['tc_fee'].\"')\";\n\t\t\t\n\t\t\tmysql_query($query) or die(mysql_error());\n\t\t\tif(!(mysql_affected_rows() > 0)){mysql_query(\"ROLLBACK\"); return 'TRANSACTION_DETAILS_FAIL'.mysql_error();}\n\t\t}\n\t\t\n\t\tforeach($this->course_fee as $key => $value)\n\t\t{\n\t\t\t\n\t\t$sql = \"INSERT INTO tbl_student_courses SET \n\t\t`tsc_student_id` = $this->student_id,\n\t\t`tsc_course_id` = '\".$value['tc_course_id'].\"'\";\n\t\tmysql_query($sql)or die(mysql_error());\n\t\tif(!(mysql_affected_rows() > 0)){mysql_query(\"ROLLBACK\"); return 'STUDENT_COURSE ENROLL IS_FAIL';}\n\t\t}\n\t\tmysql_query(\"COMMIT\");\n\t\treturn true;\n\t\t\n\t}",
"function studentNameValidation($firstName, $lastName)\n {\n // Both name fields cannot be empty.\n if(empty($firstName) || empty($lastName))\n {\n echo \"<p class = 'errorMessages'>** The First Name or Surname cannot be empty! </br></p>\";\n return false;\n }\n // Both first name and surname cannot be the same.\n elseif (!(empty($firstName) || empty($lastName)) && $firstName == $lastName)\n {\n echo \"<p class = 'errorMessages'>** The first name and the surname cannot be the same. </br> Please try again! </br></p>\";\n return false;\n }\n // Both first name and surname has a minimum length of 2.\n elseif (!(empty($firstName) || empty($lastName)) && strlen($firstName) < 2 || strlen($lastName) < 2)\n {\n echo \"<p class = 'errorMessages'>** Invalid First Name or Surname! </br></p>\";\n return false;\n }\n // Both name fields cannot contain digits or special characters.\n elseif (!ctype_alpha($firstName) || !ctype_alpha($lastName))\n {\n echo \"<p class = 'errorMessages'>** The Name fields cannot contain digits or other characters! </br></p>\";\n return false;\n }\n return true;\n}",
"public function testValidRolls() {\n $seeds = array(6,17,15,12,19,6,3,10,8,5,12,19,16,13,20,8,5,12,19,6);\n\n foreach ( $seeds as $seed => $result ) {\n srand($seed);\n\n $roll = Nuffle::roll(20);\n\n $this->assertEquals($result, $roll);\n $this->assertGreaterThanOrEqual(1, $roll);\n $this->assertLessThanOrEqual(20, $roll);\n }\n }",
"function checkStudentSubmission($sid, $asid){\n global $pdo;\n $stmt = $pdo->prepare('SELECT * FROM assignment_students WHERE asaid = :aid AND asuid = :sid');\n $criteria = ['aid'=>$asid, 'sid'=>$sid];\n $stmt->execute($criteria);\n\n if($stmt->rowCount()>0) return true;\n else return false;\n }",
"function valid_user($first_name, $last_name, $student_num, $config) {\n\tif (empty($last_name) || empty($student_num)) {\n\t\treturn false;\n\t} else {\n\t\treturn get_user_id($first_name, $last_name, $student_num, $config);\n\t}\n}",
"function verifystudentlab($studid, $classid)\n {\n include('../../config.php');\n $q = \"select * from studentsubjectlab where studid=$studid and classid=$classid\";\n $r = mysqli_query($conn,$q);\n if (mysqli_num_rows($r) < 1) {\n return true;\n } else {\n return false;\n }\n }",
"function validateBid($bid_data, $row, $allStudentInfo, $allCourseInfo, $bidSectionsInfo){\n \n // Retrieve necessary data for validation\n $error = [];\n $message = [];\n $userid = $bid_data[0];\n $bidAmount = $bid_data[1];\n \n $bidCode = $bid_data[2];\n $bidSection = $bid_data[3];\n $studentList = [];\n $bidDAO = new BidDAO();\n $bidInfo = $bidDAO->retrieveStudentBidsWithInfo($userid); // Retrieve INNER JOIN table of bid and section and course\n $bidCodeCompletedDAO = new CourseCompletedDAO();\n // UserID Validation \n $useridList = [];\n foreach($allStudentInfo as $val){\n if ($userid == $val->getUserid()) \n $student = $val; // Retrieve 'student' class for logic validation \n $useridList[] = $val->getUserid(); // store all userid in $useridList\n }\n if (!in_array($userid, $useridList)){ // Check if inputted user id exist in current student database\n $message[] = \"Course: $bidCode Section: $bidSection Error: invalid userid\";\n }\n\n // Bid Amount Validation\n if(!is_numeric($bidAmount) || $bidAmount < 10.0){ // check if edollar is not numerical value or less than e$10\n $message[] = \"Course: $bidCode Section: $bidSection Error: invalid amount\";\n }\n else {\n if ((intval($bidAmount) != $bidAmount) && (strlen($bidAmount) - strrpos($bidAmount, '.') - 1 > 2)) { // check that the edollar is not more than 2 decimal places\n $message[] = \"Course: $bidCode Section: $bidSection Error: invalid amount\";\n }\n }\n\n // Course Validation\n $bidCodeList = [];\n foreach($allCourseInfo as $val){\n if ($bidCode == $val->getCourse())\n $bidCode = $val; // Retrieve 'course' class for logic validation \n $bidCodeList[] = $val->getCourse(); // Store all course in $bidCodeList\n }\n if (!in_array($bidCode, $bidCodeList)){ \n var_dump($bidCode);\n var_dump($bidSection);\n $course = $bidCode->getCourse();\n var_dump($course);\n \n $message[] = \"Course: \" . $course. \" Section: \". $bidSection . \" Error: invalid course\"; \n var_dump($message); \n }\n else { \n // Section Validation // Check ONLY if course validation is valid\n $bidSectionList = [];\n foreach($bidSectionsInfo as $val){\n if ($bidSection == $val->getSection())\n $bidSection = $val; // Retrieve 'section' class for logic validation \n $bidSectionList[] = $val->getSection(); // Store all section filtered by course in $bidSectionList\n }\n if (!in_array($bidSection, $bidSectionList)){ // Check if bidSection is in section list (after filtered with course)\n $message[] = \"Course: $bidCode Section: $bidSection Error: invalid section\"; \n }\n }\n\n\n\n // Logic Validation\n $bidStatusDAO = new BidStatusDAO();\n $bidStatus = $bidStatusDAO->getBidStatus();\n\n // if student bid is not from their own school\n if (isset($student) && isset($bidCode) && $student->getSchool() != $bidCode->getSchool() && $bidStatus->getRound() == 1){ \n $message[] = \"Course: $bidCode Section: $bidSection Error: Can only bid from same school during Round 1\"; \n }\n\n $start_timing = [ // Changed to 08:30:00 instead of 8:30 because it's converted to DATETIME format\n '08:30:00' => 0, // when it's uploaded to the database (PHPmyAdmin)\n '12:00:00' => 1, \n '15:30:00' => 2\n ];\n $end_timing = [\n '11:45:00' => 0, \n '15:15:00' => 1, \n '18:45:00' => 2\n ];\n\n // Check for class timetable clash \n foreach ($bidInfo as $bid) {\n if (isset($bidSection) && ($bid['day'] == $bidSection->getDay()) && ($start_timing[$bid['start']] == $start_timing[$bidSection->getStart()] || $end_timing[$bid['end']] == $end_timing[$bidSection->getEnd()])){\n echo $bid['day'];\n $message[] = \"Course: $bidCode Section: $bidSection Error: You have a class timetable clash\";\n }\n }\n\n // Check for exam timetable clash\n foreach ($bidInfo as $bid) {\n if (($bid['exam date'] == $bidCode->getExamdate()) && ($start_timing[$bid['exam start']] == $start_timing[$bidCode->getExamstart()] || $end_timing[$bid['exam end']] == $end_timing[$bidCode->getExamend()])){\n $message[] = \"Course: $bidCode Section: $bidSection Error: You have a exam timetable clash\";\n }\n }\n\n // Check for incomplete prerequisites \n $bidCodesCompleted = $bidCodeCompletedDAO->retrieveCourseCompletedByUserId($userid);\n $prerequisiteDAO = new PrerequisiteDAO();\n $prerequisites = $prerequisiteDAO -> retrievePrerequisiteByCourse($course);\n if (!empty($prerequisites)){ // If there is prerequisites\n if (array_diff($prerequisites, $bidCodesCompleted)) {\n $message[] = \"Course: $bidCode Section: $bidSection Error: You have incomplete prerequisites\";\n }\n }\n\n // Check for course completed \n if (in_array($bidCode,$bidCodesCompleted)) {\n $message[] = \"Course: $bidCode Section: $bidSection Error: The course is completed already\";\n }\n\n // Check for Section limit (Student can only bid for 5 sections)\n $num = 0;\n foreach($bidInfo as $bid) {\n if ($bid['userid'] == $userid) {\n $num++;\n }\n }\n if ($num >= 5) {\n $message[] = \"Course: $bidCode Section: $bidSection Error: Section limit reached\";\n }\n \n\n return $message;\n}",
"public function check_or_add_student_to_user($stu_id) {\n\t\t$this->db->where(\"id\",$stu_id);\n\t\t$query = $this->db->get('user');\n\t\tif ($query->num_rows() >= 1) {\n\t\t\t//print_r($query->result_array());\n\t\t\t//echo $stu_id.\" have previously been added to 'user' table.<br>\";\n\t\t\treturn \"cannot add\";\n\t\t\t\n\t\t} else { \n\t\t\t//add new student to 'user' table\n\t\t\t$data = array(\n\t\t\t\t\t\t\"id\"\t\t=> $stu_id,\n\t\t\t\t\t\t\"username\"\t=> $stu_id,\n\t\t\t\t\t\t\"password\"\t=> md5($stu_id),\n\t\t\t\t\t\t\"role\"\t\t=> 'student',\n\t\t\t\t\t\t\"active\"\t=> 'yes',\n\t\t\t\t\t\t\"added_by\"\t=> $_SESSION['username']\n\t\t\t\t\t\t);\n\t\t\t$this->db->insert('user',$data);\n\t\t\t//echo \"Insert : \".$data['id'].\" : num of row : \".$this->db->affected_rows();\n\t\t\treturn \"OK\";\n\t\t}\n\t}",
"function addStudent($theStudentUserID, $theStudentPassword, $theFirst_Name, $theMiddle_Name, $theLast_Name, $theSchoolName, $theEmail, $theMarks, $theRole){\r\n // data must (will) go through the global validateInput objects setMethod security checks (has not yet been created as of 11/07/2019).\r\n if($this->createNewStudent($theStudentUserID, $theStudentPassword, $theFirst_Name, $theMiddle_Name, $theLast_Name, $theSchoolName, $theEmail, $theMarks, $theRole)){\r\n return true;\r\n }// end if \r\n else{\r\n return false;\r\n }// end else\r\n }",
"public function isstudentsExisting ($student_number){\n return ($this -> restfullDAO -> isstudentExisting ($student_number ));\n }",
"function deleteStudent(Student $student)\n {\n foreach ($this->students as $key => $stu){\n if($stu->getRollNo() == $student->getRollNo())\n {\n unset($this->students[$key]);\n }\n }\n }",
"function checkNonfacultyCrhrs($studentProfile)\n {\n $totWeight=0.0;\n $courseList = array();\n foreach($studentProfile->get(\"courses\") as $course)\n {\n $department = $course->get(\"department\");\n $courseNumber = $course->get(\"courseNumber\");\n if ($department==\"ADCS\" || $department==\"CDEV\" || $department==\"CRED\" || $department==\"EDUC\" \n || $department==\"HLSC\" || $department==\"MGT\" || $department==\"NURS\" || $department==\"PUBH\")\n {\n if(($department==\"HLSC\" && $courseNumber == 3450) || ($department==\"MGT\" && $courseNumber == 3780)){}\n else\n {\n $totWeight += $course->get(\"weight\");\n $courseList[] = $course->toArray();\n }\n }\n }\n return array(\n \"result\" => $totWeight <= 12,\n \"reason\" => $courseList\n );\n }",
"function verifystudentleclab($studid, $classid)\n {\n include('../../config.php');\n $q = \"select * from studentsubject where studid=$studid and classid=$classid\";\n $r = mysqli_query($conn,$q);\n if (mysqli_num_rows($r) < 1) {\n return true;\n } else {\n return false;\n }\n }"
] | [
"0.64485574",
"0.6062814",
"0.59313315",
"0.5924257",
"0.5916483",
"0.59042335",
"0.58827794",
"0.5850544",
"0.5691807",
"0.5671771",
"0.5637445",
"0.561624",
"0.56144506",
"0.56069016",
"0.56019056",
"0.55815965",
"0.55732507",
"0.55599636",
"0.55562425",
"0.55414414",
"0.55358297",
"0.5524313",
"0.5520531",
"0.5511534",
"0.5504199",
"0.5495079",
"0.54573375",
"0.54497665",
"0.5441516",
"0.5411704"
] | 0.68023205 | 0 |
/ unique valid register ID verification is done here | public function unique_registerid($register)
{
$branchID = $this->application_model->get_branch_id();
if ($this->uri->segment(3)) {
$this->db->where_not_in('id', $this->uri->segment(3));
}
$this->db->where('register_no', $register);
$query = $this->db->get('student')->num_rows();
if ($query == 0) {
return true;
} else {
$this->form_validation->set_message("unique_registerid", translate('already_taken'));
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function checkIsValidForRegister() {\n $errors = array();\n /*-------------------debe validarse que el dni sea correcto-------------------------------------------------*/\n }",
"public function hasUniqueid(){\n return $this->_has(13);\n }",
"private function _valid_id()\n {\n $user = get_userdata($this->uid);\n\n return ($user->user_login !='' && !empty($user->user_login) );\n }",
"function chk_s_id($s_id, $registered_id = null)\n\t{\n\t\tglobal $epsclass, $eps_lang;\n\n\t\tif (preg_match('#^200[23][c\\d]{4}$#uis', $s_id))\n\t\t{\n\t\t\t$sql = \"SELECT s_id FROM \".TBL_USER.\" WHERE s_id='\".$epsclass->db->escape($s_id).\"'\";\n\t\t\tif ($registered_id > 0)\n\t\t\t\t$sql .= ' AND id!='.$registered_id;\n\n\t\t\t$result = $epsclass->db->query($sql) or error('Unable to fetch user info', __FILE__, __LINE__, $epsclass->db->error());\n\t\t\tif ($epsclass->db->num_rows($result))\n\t\t\t{\n\t\t\t\t$this->errors[] = $eps_lang['StudentID'].': '.$eps_lang['Validate_duplicate'];\n\t\t\t\t$epsclass->db->free_result($result);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$epsclass->db->free_result($result);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->errors[] = $eps_lang['StudentID'].': '.$eps_lang['Validate_invalid'];\n\t\t\treturn false;\n\t\t}\n\t}",
"function verify_unique_member_id ($element_name,$element_value) {\n\t$member = new cMember();\n\t\n\treturn !($member->LoadMember($element_value, false));\n}",
"function meberins()\n{\n //$encypt1=uniqid(rand(), true);\n $encypt1=uniqid(rand(1000000000,9999999999), true);\n $usid1=str_replace(\".\", \"\", $encypt1);\n $pre_userid = substr($usid1, 0, 10);\n \n $checkid=mysql_query(\"select transaction_no from registration where transaction_no='$pre_userid'\");\n if(mysql_num_rows($checkid)>0)\n {\n\t meberins();\n }\n else\n return $pre_userid;\n }",
"function regNoExists($ref =''){\n\t\t$conn = Doctrine_Manager::connection();\n\t\t# validate unique username and email\n\t\t$id_check = \"\";\n\t\tif(!isEmptyString($this->getID())){\n\t\t\t$id_check = \" AND id <> '\".$this->getID().\"' \";\n\t\t}\n\t\tif(isEmptyString($ref)){\n\t\t\t$ref = $this->getRegNo();\n\t\t}\n\t\t# unique email\n\t\t$ref_query = \"SELECT id FROM farmgroup WHERE regno = '\".$ref.\"' AND regno <> '' \".$id_check.\"\";\n\t\t$ref_result = $conn->fetchOne($ref_query);\n\t\tif(isEmptyString($ref_result)){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"private function hasUniqueId()\r\n {\r\n\t\tif ($this->hasUniqueId)\r\n\t\t\treturn true;\r\n\r\n\t\t$id = null;\r\n\t\ttry \r\n\t\t{\r\n\t\t\t$id = $this->uniqueid(1);\r\n\t\t} \r\n\t\tcatch(Exception $e) \r\n\t\t{\r\n\t\t\t// ignoring error\r\n\t\t}\r\n\t\t$this->hasUniqueId = $id ? true : false;\r\n\t\treturn $this->hasUniqueId;\r\n }",
"abstract public function hasGUID();",
"function hasRegistration();",
"function isValidUDID($udid)\n{\n if (strlen($udid) != 64 ){ // 32 for simulator\n \n echo \"bad udid\" . strlen($udid) .\"\\n\";\n return false;\n }\n if (preg_match(\"/^[0-9a-fA-F]+$/\", $udid) == 0)\n return false;\n \n return true;\n}",
"private function testRegNumExists($uniqueRegNum)\n {\n $user = User::where('username', $uniqueRegNum)->get();\n return ! $user->isEmpty();\n }",
"function isValidGuid($source = NULL)\n{\n\tif(preg_match('/[a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{12}/', $source))\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}",
"function validateUniqueInst($value,$field,$idval=-1) {\r\n\tglobal $VALIDATE_TEXT;\r\n\t$VALIDATE_TEXT = \"\";\r\n\r\n\t// do the provider check\r\n\t$checkItem = new Institution();\r\n\tswitch ($field) {\r\n\t\tcase \"name\": $checkItem->getInstByName($value); break;\r\n\t\tdefault: echo \"Invalid field type ($field) for validateUniqueInst\"; return false;\r\n\t}\r\n\r\n\tif ($checkItem->pk == 0 || $checkItem->pk == $idval) {\r\n\t\t// no item by this field or current item is using it which is ok\r\n\t\t$VALIDATE_TEXT = \"\";\r\n\t\treturn true;\r\n\t}\r\n\t$VALIDATE_TEXT = \"Item is not unique, enter another\";\r\n\treturn false;\r\n}",
"function goodvcode()\n{\n clean();\n\n $_SESSION['error'] = [];\n\n $email = db_exists('register_vlink', ['reg_vcode' => $_GET['vcode']]);\n\n if (!$email->num_rows) {\n $_SESSION['error'][] = sprintf(lang('err_invalid'), lang('verification_code'));\n } else {\n $user = db_exists('user', ['email' => $email->row['email'], 'is_active' => 1]);\n if ($user->num_rows) {\n $_SESSION['error'][] = sprintf(lang('err_exists'), $email->row['email']);\n }\n }\n\n if ($_SESSION['error']) {\n return false;\n }\n\n return true;\n}",
"private function _checkUniqueID(Certificate $cert): bool\n {\n if (! $cert->tbsCertificate()->hasIssuerUniqueID()) {\n return false;\n }\n $uid = $cert->tbsCertificate()\n ->issuerUniqueID()\n ->string();\n return $this->issuerUID?->string() === $uid;\n }",
"function verify_good_member_id ($element_name,$element_value) {\n\tif(ctype_alnum($element_value)) { // it's good, so return immediately & save a little time\n\t\treturn true;\n\t} else {\n\t\t$member_id = ereg_replace(\"\\_\",\"\",$element_value);\n\t\t$member_id = ereg_replace(\"\\-\",\"\",$member_id);\n\t\t$member_id = ereg_replace(\"\\.\",\"\",$member_id);\n\t\tif(ctype_alnum($member_id)) // test again now that we've stripped the allowable special chars\n\t\t\treturn true;\t\t\n\t}\n}",
"function checkReg($registrationid)\n {\n global $conn;\n $sql = \"SELECT * FROM alumni_info WHERE registration_id = '$registrationid'\";\n $com_data = $conn->query($sql);\n $num_rows = $com_data->num_rows;\n\n if ($num_rows > 0) {\n return false;\n } else {\n return true;\n }\n }",
"private function loginradius_is_valid_guid($value){\n\treturn preg_match('/^\\{?[A-Z0-9]{8}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{12}\\}?$/i', $value);\n}",
"public function testCheckIdExistNG() {\n\t\t$result = $this->User->checkIdExist('1');\n\t\tdebug($result);\n\t\t// Check ID fail\n\t\t$expected = CONSTANT_MESSAGE_ID_EXIST;\n\t\n\t\t$this->assertEquals($expected, $result['id']);\n\t}",
"private function __validate_id() {\n if ($this->validate_id === false) {\n } elseif (isset($this->initial_data[\"id\"])) {\n if (array_key_exists($this->initial_data[\"id\"], $this->config[\"unbound\"][\"hosts\"])) {\n $this->id = $this->initial_data[\"id\"];\n } else {\n $this->errors[] = APIResponse\\get(2016);\n }\n } else {\n $this->errors[] = APIResponse\\get(2015);\n }\n }",
"private function checkId()\n {\n if (empty($this->id)) {\n $this->id = $this->getNextId(null);\n }\n }",
"public function idchecker($data){\n\t\t$condition = \"value =\" . \"'\" . $data . \"'\";\n\t\t$this->db->select('*');\n\t\t$this->db->from('uuid_te');\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() == 0) {\n\t\t\treturn FALSE;\n\n\t\t}\n\t\telse{\n\t\t\treturn TRUE;\n\t\t}\n\t}",
"function revalidateUserID() {\n\t\treturn true;\n\t}",
"function CheckValidatePartiRegId($reg_id){\n global $ConnectingDB;\n $sql = \"SELECT r_id FROM arena_comp WHERE r_id = :EmaIl\";\n $stmt = $ConnectingDB->prepare($sql);\n $stmt->bindValue(':EmaIl',$reg_id);\n $stmt->execute();\n $Result = $stmt->rowCount();\n if ($Result==1) {\n return true;\n }else{\n return false;\n }\n }",
"public function checkId(){\n\n }",
"protected function is_valid_id()\n\t{\n\t\treturn\t!empty($this -> id);\n\t}",
"function verify_id()\n\t{\n\t\tlog_debug(\"inc_services\", \"Executing verify_id()\");\n\n\t\tif ($this->id)\n\t\t{\n\t\t\t$sql_obj\t\t= New sql_query;\n\t\t\t$sql_obj->string\t= \"SELECT id FROM `services` WHERE id='\". $this->id .\"' LIMIT 1\";\n\t\t\t$sql_obj->execute();\n\n\t\t\tif ($sql_obj->num_rows())\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\n\t}",
"function validate_accountid($id) {\r\n if (strlen($id) == 3) {\r\n return true;\r\n }\r\n return false;\r\n}",
"public function hasUuid(){\r\n return $this->_has(2);\r\n }"
] | [
"0.68481785",
"0.67212665",
"0.6683012",
"0.66177857",
"0.65318227",
"0.6432778",
"0.63894737",
"0.6389149",
"0.63858336",
"0.6381683",
"0.63785756",
"0.62683576",
"0.62548405",
"0.6240607",
"0.62392867",
"0.6218593",
"0.61378074",
"0.6109232",
"0.61041874",
"0.6103759",
"0.6086241",
"0.60837257",
"0.60787106",
"0.6067021",
"0.6058289",
"0.6042519",
"0.6025133",
"0.60152984",
"0.6004774",
"0.60037225"
] | 0.7039508 | 0 |
Build a new Pipeline object | public function build(ProcessorInterface $processor = null) {
return new Pipeline($this->stages, $processor);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function pipeline() {}",
"private function getPipelineOne($qid, $id){\n\t\t$services = \t[\n\t\t\"http://visko.cybershare.utep.edu:5080/visko-web/registry/module_gmt.owl#surface\",\n\t\t\"http://visko.cybershare.utep.edu:5080/visko-web/registry/module_gmt.owl#grdcontour\",\n\t\t\"http://visko.cybershare.utep.edu:5080/visko-web/registry/module_gs.owl#ps2pdf\"\n\t\t\t\t];\n\t\t$viewerSets = [\n \"http://visko.cybershare.utep.edu:5080/visko-web/registry/module_webbrowser.owl#web-browser\"\n ];\n\t\t\n\t\t$viewURI = \"http://openvisko.org/rdf/ontology/visko-view.owl#2D_ContourMap\";\n\t\t$viewerURI = \"http://visko.cybershare.utep.edu:5080/visko-web/registry/module_webbrowser.owl#web-browser-pdf-viewer\";\n\t\t$toolkit = \"http://visko.cybershare.utep.edu:5080/visko-web/registry/module_gmt.owl#gmt\";\n\t\t$outputFormat = \"http://openvisko.org/rdf/pml2/formats/PDF.owl#PDF\";\n\t\t$requiresInputURL = true;\n\t\t\n\t\t$p = new Pipeline(\n\t\t\t\t$qid,\n\t\t\t\t$viewURI,\n\t\t\t\t$viewerURI,\n\t\t\t\t$toolkit,\n\t\t\t\t$requiresInputURL,\n\t\t\t\t$outputFormat,\n\t\t\t\t$services,\n\t\t\t\t$viewerSets\n\t\t);\n\t\t\n\t\t$p->setID($id);\n\t\treturn $p;\n\t}",
"public function pipeline(/* arguments */)\n {\n return $this->sharedContextFactory('createPipeline', func_get_args());\n }",
"function getPipeline()\n {\n\t\t$args = new safe_args();\n\t\t$args->set('hmpartner_id', \tNOTSET, 'sqlsafe');\n\t\t$args->set('refresh', \t\t'N', 'sqlsafe');\n\t\t$args = $args->get(func_get_args());\n\t\t\t\t\n\t\tinclude_once('class.pipeline.php');\n\t\t$pipe = new pipeline;\n \t\t\n# \tif( $GLOBALS['appshore_data']['current_user']['type_id'] == 'Partner' && $GLOBALS['appshore_data']['current_user']['hmpartner_id'] )\n#\t\t\t$args['hmpartner_id'] = $GLOBALS['appshore_data']['current_user']['hmpartner_id'];\n\n\t\t$pipe->generate($args['hmpartner_id'], $args['refresh']);\n\n\t\tif ( $pipeline = $pipe->get($args['hmpartner_id']) )\n\t\t{\n\t\t\t$count = count($pipeline);\n\t\t\treset($pipeline);\n\t\t\tfor( $i = 0; $i < $count; $i++ )\n\t\t\t{\n\t\t\t\t$val = current($pipeline);\n\t\t\t\t$key = key($pipeline);\n\t\t\t\tif( preg_match('/(pct|pbg)/', $key) ) // percentage\n\t\t\t\t\t$result['pipeline'][$key] = number_format($val,2).'%';\n\t\t\t\telse if( preg_match('/(com|fat|ifa|pft|funding)/', $key) ) // currency\n\t\t\t\t\t$result['pipeline'][$key] = '$'.number_format((int)$val);\n\t\t\t\telse\n\t\t\t\t\t$result['pipeline'][$key] = $val;\n\t\t\t\tnext($pipeline);\n\t\t\t}\n\t\t}\n\t\t\t\n \t\t$_SESSION[$this->appName]['hmpartner_id'] = $args['hmpartner_id']; \t\t\n\t\t$GLOBALS['appshore_data']['server']['xml_render'] = true;\n \t\treturn $result;\n\t}",
"public function getPipeline(): array;",
"public function __construct(Pipeline $pipeline, $passable)\n {\n $this->pipeline = $pipeline;\n $this->passable = $passable;\n }",
"public function createProcess()\n {\n /**\n * If process not load with construct class\n * created him\n */\n if (!$this->getIsInitProcess()) {\n $params = [\n 'entityId' => $this->getEntityId(),\n 'groupId' => $this->getGroupId(),\n 'entityType' => $this->getEntityType(),\n 'groupType' => $this->getGroupType()\n ];\n $processService = $this->container->get('app.process');\n $process = $processService->create($params, $this->container->getParameter('expertise.process_id_group'));\n if (!empty($process)) {\n $this->setProcess($process);\n $this->isInitProcess = true;\n } else {\n $this->container->get('logger')->addDebug(\"ExpertiseGroup: process not init with params:\" . json_encode($params));\n $this->isInitProcess = false;\n }\n }\n\n return $this;\n }",
"public function createProcess(string $name, ...$constructorArguments): ProcessorChainInterface;",
"private function buildPipelineTree(string $pipelineId, string $testId, Pipeline $pipeline): MergeTree\n {\n // construct all nodes from pipeline, we need to have list of boxes\n // indexed by name for searching and second list as execution queue\n // and also set of variables with references to input and output box\n /** @var PortNode[] $queue */\n $queue = array();\n /** @var PortNode[] $nodes */\n $nodes = array();\n /** @var VariablePair[] $variables */\n $variables = array();\n foreach ($pipeline->getAll() as $box) {\n $node = new PortNode($box, $pipelineId, $testId);\n $queue[] = $node;\n $nodes[$box->getName()] = $node;\n\n // go through all ports of box and assign them to appropriate variables set\n foreach ($box->getInputPorts() as $inPort) {\n $varName = $inPort->getVariable();\n if (empty($varName)) {\n continue; // variable in port is not specified... jump over\n }\n if (!array_key_exists($varName, $variables)) {\n $variables[$varName] = new VariablePair();\n }\n $variables[$varName]->input[] = new NodePortPair($node, $inPort);\n }\n foreach ($box->getOutputPorts() as $outPort) {\n $varName = $outPort->getVariable();\n if (empty($varName)) {\n continue; // variable in port is not specified... jump over\n }\n if (!array_key_exists($varName, $variables)) {\n $variables[$varName] = new VariablePair();\n }\n $variables[$varName]->output = new NodePortPair($node, $outPort);\n }\n }\n\n // process queue and make connections between nodes\n $tree = new MergeTree();\n foreach ($queue as $node) {\n $box = $node->getBox();\n foreach ($box->getInputPorts() as $inPort) {\n $varName = $inPort->getVariable();\n if (empty($varName)) {\n continue; // variable in port is not specified... jump over\n }\n $parent = $variables[$varName]->output ? $variables[$varName]->output->node : null;\n if ($parent === null || $parent->isInTree()) {\n continue; // parent output port does not have to be present for input ports\n }\n $node->addParent($inPort->getName(), $parent);\n $parent->addChild($variables[$varName]->output->port->getName(), $node);\n }\n foreach ($box->getOutputPorts() as $outPort) {\n $varName = $outPort->getVariable();\n if (empty($varName)) {\n continue; // variable in port is not specified... jump over\n }\n\n // go through all children for this port\n foreach ($variables[$varName]->input as $childPair) {\n $child = $childPair->node;\n $port = $childPair->port;\n if ($child->isInTree()) {\n continue;\n }\n $node->addChild($outPort->getName(), $child);\n $child->addParent($port->getName(), $node);\n }\n }\n\n // ... visited flag\n $node->setInTree(true);\n }\n\n // add input boxes into tree\n foreach ($pipeline->getDataInBoxes() as $box) {\n $tree->addInputNode($nodes[$box->getName()]);\n }\n\n // add output boxes into tree\n foreach ($pipeline->getDataOutBoxes() as $box) {\n $tree->addOutputNode($nodes[$box->getName()]);\n }\n\n // add other boxes into tree\n foreach ($pipeline->getOtherBoxes() as $box) {\n $tree->addOtherNode($nodes[$box->getName()]);\n }\n\n // ... and return resulting tree\n return $tree;\n }",
"public function add(MatchablePipelineInterface $pipeline): void;",
"protected function createPipeline(array $options = null, $callable = null)\n {\n if (isset($options['atomic']) && $options['atomic']) {\n $class = 'Predis\\Pipeline\\Atomic';\n } elseif (isset($options['fire-and-forget']) && $options['fire-and-forget']) {\n $class = 'Predis\\Pipeline\\FireAndForget';\n } else {\n $class = 'Predis\\Pipeline\\Pipeline';\n }\n\n /*\n * @var ClientContextInterface\n */\n $pipeline = new $class($this);\n\n if (isset($callable)) {\n return $pipeline->execute($callable);\n }\n\n return $pipeline;\n }",
"public static function sequential()\n {\n $definition = new ProcessDefinition();\n\n $c1 = new Condition();\n $c2 = new Condition();\n $c3 = new Condition();\n $t1 = new Task();\n $t2 = new Task();\n\n $definition\n ->addCondition($c1)\n ->addTask($c1, $t1, $c2)\n ->addTask($c2, $t2, $c3)\n ->setSource($c1)\n ->setSink($c3);\n\n return $definition;\n }",
"public abstract function build();",
"public static function getPipeline()\n {\n /** @var \\Bugsnag\\Client $instance */\n return $instance->getPipeline();\n }",
"abstract public function build();",
"abstract public function build();",
"public function project(array $pipeline)\n {\n $this->addStage('$project', $pipeline);\n return $this;\n }",
"public function pipe(callable ...$stages) {\n $pipeline = clone $this;\n foreach ($stages as $stage) {\n $pipeline->stages[] = $stage;\n }\n return $pipeline;\n }",
"public function build();",
"public function build();",
"public function build();",
"public function build();",
"public function build();",
"public function build();",
"public function build();",
"public function build();",
"protected function construct() {}",
"public function build() {\n \n $this->conf = HttpParameterPollution::getInstance();\n \n $this->source = file_get_contents($this->filename);\n \n $this->tokens = token_get_all($this->source);\n \n // For the strange token_get_all behaviour that leave empty array \n // elements i need to use array_values to reorder indexes\n $this->tokens = array_values($this->tokens);\n \n // Clean tokens\n $this->clean();\n \n //$this->pt();\n \n // Reconstruct arrays into one single token\n $this->manageArrays();\n \n //$this->pt();\n \n //$this->pat();\n }",
"public function build() {\n }",
"abstract function build();"
] | [
"0.68054074",
"0.6425052",
"0.63251626",
"0.60276175",
"0.6024557",
"0.569985",
"0.5678833",
"0.5578267",
"0.55714536",
"0.5468468",
"0.5437202",
"0.538853",
"0.53600335",
"0.5349805",
"0.5246543",
"0.5246543",
"0.5242589",
"0.52410567",
"0.5235518",
"0.5235518",
"0.5235518",
"0.5235518",
"0.5235518",
"0.5235518",
"0.5235518",
"0.5235518",
"0.520939",
"0.519511",
"0.51716787",
"0.5169939"
] | 0.6729612 | 1 |
/ Get authentication headers for sending notifications | protected function _getAuthHeaders()
{
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function auth_header()\n\t{\n\t\treturn array( 'Authorization: GoogleLogin auth=' . $this->auth );\n\t}",
"private function getHeaders()\n {\n return 'X-Authorization:' . $this->apiKey;\n\n }",
"private function getAuthToken()\n {\n return array('headers' => array('Authorization' => 'Basic ' . base64_encode($this->config['login']. \":\" . $this->config['password'])));\n }",
"public function getAuthHeaders()\r\n {\r\n $parameters = array(\r\n 'auth_system_auth_id' => $this->m_app_auth_id,\r\n 'auth_system_public_key' => $this->m_app_api_key,\r\n 'auth_user_auth_id' => $this->m_user_auth_id,\r\n 'auth_user_public_key' => $this->m_user_api_key,\r\n );\r\n \r\n return $parameters;\r\n }",
"protected function generateAuthHeader() {\n if ($this->auth_token) {\n return array('Authorization: GuifiLogin auth=' . $this->auth_token );\n } else {\n return array();\n }\n }",
"private static function getAuthFromHeaders() {\n $headers = getallheaders();\n if (!empty($headers['Authorization'])) {\n if (preg_match('/IndiciaTokens (?<auth_token>[a-z0-9]+(:\\d+)?)\\|(?<nonce>[a-z0-9]+)/', $headers['Authorization'], $matches)) {\n return [\n 'auth_token' => $matches['auth_token'],\n 'nonce' => $matches['nonce'],\n ];\n }\n }\n hostsite_access_denied();\n }",
"public function getHeaders()\n {\n $headers = array();\n $contentHeaders = array('CONTENT_LENGTH' => true, 'CONTENT_MD5' => true, 'CONTENT_TYPE' => true);\n foreach ($this->parameters as $key => $value) {\n if (0 === strpos($key, 'HTTP_')) {\n $headers[substr($key, 5)] = $value;\n } elseif (isset($contentHeaders[$key])) {\n $headers[$key] = $value;\n }\n }\n if (isset($this->parameters['PHP_AUTH_USER'])) {\n $headers['PHP_AUTH_USER'] = $this->parameters['PHP_AUTH_USER'];\n $headers['PHP_AUTH_PW'] = isset($this->parameters['PHP_AUTH_PW']) ? $this->parameters['PHP_AUTH_PW'] : '';\n } else {\n /*\n * php-cgi under Apache does not pass HTTP Basic user/pass to PHP by default\n * For this workaround to work, add these lines to your .htaccess file:\n * RewriteCond %{HTTP:Authorization} ^(.+)$\n * RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]\n *\n * A sample .htaccess file:\n * RewriteEngine On\n * RewriteCond %{HTTP:Authorization} ^(.+)$\n * RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]\n * RewriteCond %{REQUEST_FILENAME} !-f\n * RewriteRule ^(.*)$ app.php [QSA,L]\n */\n $authorizationHeader = null;\n if (isset($this->parameters['HTTP_AUTHORIZATION'])) {\n $authorizationHeader = $this->parameters['HTTP_AUTHORIZATION'];\n } elseif (isset($this->parameters['REDIRECT_HTTP_AUTHORIZATION'])) {\n $authorizationHeader = $this->parameters['REDIRECT_HTTP_AUTHORIZATION'];\n }\n // Decode AUTHORIZATION header into PHP_AUTH_USER and PHP_AUTH_PW when authorization header is basic\n if (null !== $authorizationHeader && 0 === stripos($authorizationHeader, 'basic')) {\n $exploded = explode(':', base64_decode(substr($authorizationHeader, 6)));\n if (count($exploded) == 2) {\n list($headers['PHP_AUTH_USER'], $headers['PHP_AUTH_PW']) = $exploded;\n }\n }\n }\n // PHP_AUTH_USER/PHP_AUTH_PW\n if (isset($headers['PHP_AUTH_USER'])) {\n $headers['AUTHORIZATION'] = 'Basic ' . base64_encode($headers['PHP_AUTH_USER'] . ':' . $headers['PHP_AUTH_PW']);\n }\n return $headers;\n }",
"protected function getRequestHeaders()\n {\n $userAgents = array(\n 'PHP/'.PHP_VERSION,\n str_replace(\n array(' ', \"\\t\", \"\\n\", \"\\r\"),\n '-',\n $this->configService->getIntegrationName().'/'.$this->configService->getIntegrationVersion()\n ),\n str_replace(\n array(' ', \"\\t\", \"\\n\", \"\\r\"),\n '-',\n $this->configService->getExtensionName().'/'.$this->configService->getExtensionVersion()\n ),\n );\n\n return array(\n 'accept' => 'Accept: application/json',\n 'content' => 'Content-Type: application/json',\n 'useragent' => 'User-Agent: '.implode(' ', $userAgents),\n 'token' => 'Authorization: Bearer ' . $this->configService->getAuthorizationToken(),\n );\n }",
"private function getHeaders(): array\n {\n return [\n 'Access-Token' => $this->token,\n ];\n }",
"public function getRequestAuthentication()\n {\n return $this->history[0]['request']->getHeaders()['Authentication'][0];\n }",
"public function getHeaders();",
"public function getHeaders();",
"public function getHeaders();",
"public function getHeaders();",
"public function getHeaders();",
"public function getHeaders();",
"public function getHeaders();",
"private function _getAuthHeaders() {\n // alternatively, use this method to laod from file.\n $api_key = self::API_KEY;\n $auth_key = self::AUTH_KEY;\n if (!isset($api_key) or !isset($auth_key)) {\n throw new\n Exception(\"Error: unable to get AppFigures Client credentials\");\n }\n return array(\n \"X-Client-Key: {$api_key}\",\n \"Authorization: Basic {$auth_key}\"\n );\n }",
"function getHeaders();",
"private function _getHeaders()\n {\n $headers = array();\n if (count($this->_to) > 1) {\n $headers['Cc'] = implode(', ', array_slice($this->_to, 1));\n }\n $headers['From'] = $this->_from;\n $headers['MIME-Version'] = '1.0';\n $headers['Content-Type'] = 'text/plain; charset=UTF-8';\n $headers['Content-transfer-encoding'] = 'base64';\n\n return implode(\n \"\\r\\n\",\n array_map(\n create_function('$v, $k', 'return $k . \": \" . $v;'),\n $headers,\n array_keys($headers)\n )\n );\n }",
"function qm_get_headers()\n {\n return \\Quantum\\Request::getHeaders();\n }",
"public function getRestHeaders()\n\t{\n\t\t$headers = array();\n\t\n\t\t// Setting the headers for REST\n\t\t$rest_username = $this->params->get('rest_username');\n\t\t$rest_password = $this->params->get('rest_password');\n\t\t$rest_key = $this->params->get('rest_key');\n\n\t\t// Setting the headers for REST\n\t\t$str = $rest_username.\":\".$rest_password;\n\t\t$headers['Authorization'] = base64_encode($str);\n\n\t\t// Encoding user\n\t\t$user_encode = $rest_username.\":\".$rest_key;\n\t\t$headers['AUTH_USER'] = base64_encode($user_encode);\n\t\t// Sending by other way, some servers not allow AUTH_ values\n\t\t$headers['USER'] = base64_encode($user_encode);\n\n\t\t// Encoding password\n\t\t$pw_encode = $rest_password.\":\".$rest_key;\n\t\t$headers['AUTH_PW'] = base64_encode($pw_encode);\n\t\t// Sending by other way, some servers not allow AUTH_ values\n\t\t$headers['PW'] = base64_encode($pw_encode);\n\n\t\t// Encoding key\n\t\t$key_encode = $rest_key.\":\".$rest_key;\n\t\t$headers['KEY'] = base64_encode($key_encode);\n\n\t\treturn $headers;\n\t}",
"public static function get_headers() {\n\t if (function_exists('apache_request_headers')) {\n\t // we need this to get the actual Authorization: header\n\t // because apache tends to tell us it doesn't exist\n\t return apache_request_headers();\n\t }\n\t // otherwise we don't have apache and are just going to have to hope\n\t // that $_SERVER actually contains what we need\n\t $out = array();\n\t foreach ($_SERVER as $key => $value) {\n\t if (substr($key, 0, 5) == \"HTTP_\") {\n\t // this is chaos, basically it is just there to capitalize the first\n\t // letter of every word that is not an initial HTTP and strip HTTP\n\t // code from przemek\n\t $key = str_replace(\n\t \" \",\n\t \"-\",\n\t ucwords(strtolower(str_replace(\"_\", \" \", substr($key, 5))))\n\t );\n\t $out[$key] = $value;\n\t }\n\t }\n\t return $out;\n\t}",
"public static function get_headers() {\n if (function_exists('apache_request_headers')) {\n // we need this to get the actual Authorization: header\n // because apache tends to tell us it doesn't exist\n $headers = apache_request_headers();\n\n // sanitize the output of apache_request_headers because\n // we always want the keys to be Cased-Like-This and arh()\n // returns the headers in the same case as they are in the\n // request\n $out = array();\n foreach( $headers AS $key => $value ) {\n $key = str_replace(\n \" \",\n \"-\",\n ucwords(strtolower(str_replace(\"-\", \" \", $key)))\n );\n $out[$key] = $value;\n }\n } else {\n // otherwise we don't have apache and are just going to have to hope\n // that $_SERVER actually contains what we need\n $out = array();\n if( isset($_SERVER['CONTENT_TYPE']) )\n $out['Content-Type'] = $_SERVER['CONTENT_TYPE'];\n if( isset($_ENV['CONTENT_TYPE']) )\n $out['Content-Type'] = $_ENV['CONTENT_TYPE'];\n\n foreach ($_SERVER as $key => $value) {\n if (substr($key, 0, 5) == \"HTTP_\") {\n // this is chaos, basically it is just there to capitalize the first\n // letter of every word that is not an initial HTTP and strip HTTP\n // code from przemek\n $key = str_replace(\n \" \",\n \"-\",\n ucwords(strtolower(str_replace(\"_\", \" \", substr($key, 5))))\n );\n $out[$key] = $value;\n }\n }\n }\n return $out;\n }",
"private function constructHeaders()\n\t{\n\t\treturn [\n\t\t\t'Content-Type: application/json',\n\t\t\t'Authorization: '.$this->access_token,\n\t\t];\n\t}",
"private function createHeader()\n {\n $headers = $this->headers;\n\n $username = $this->getUsername();\n $auth_type = $this->getAuthType();\n\n if ('hash' == $auth_type) {\n $headers['Authorization'] = 'WHM ' . $username . ':' . preg_replace(\"'(\\r|\\n|\\s|\\t)'\", '', $this->getPassword());\n } elseif ('password' == $auth_type) {\n $headers['Authorization'] = 'Basic ' . base64_encode($username . ':' .$this->getPassword());\n }\n return $headers;\n }",
"function getallheaders()\n {\n $headers = array();\n $copy_server = array(\n 'CONTENT_TYPE' => 'Content-Type',\n 'CONTENT_LENGTH' => 'Content-Length',\n 'CONTENT_MD5' => 'Content-Md5',\n );\n foreach ($_SERVER as $key => $value) {\n if (substr($key, 0, 5) === 'HTTP_') {\n $key = substr($key, 5);\n if (!isset($copy_server[$key]) || !isset($_SERVER[$key])) {\n $key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', $key))));\n $headers[$key] = $value;\n }\n } elseif (isset($copy_server[$key])) {\n $headers[$copy_server[$key]] = $value;\n }\n }\n if (!isset($headers['Authorization'])) {\n if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) {\n $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION'];\n } elseif (isset($_SERVER['PHP_AUTH_USER'])) {\n $basic_pass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : '';\n $headers['Authorization'] = 'Basic ' . base64_encode($_SERVER['PHP_AUTH_USER'] . ':' . $basic_pass);\n } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) {\n $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST'];\n }\n }\n return $headers;\n }",
"public function getRequiredHeaders();",
"function getAuthorizedToken(){\r\n $headers = apache_request_headers();\r\n $token = get_data_from_array(\"Authorization\",$headers);\r\n return $token;\r\n}",
"private function authzInfo(){\n\t\t$key = defined('CREDENTIAL_ACCESS_KEY') ? CREDENTIAL_ACCESS_KEY:$this->credentials['key'];\n\t\t$secret = defined('CREDENTIAL_ACCESS_SECRET') ? CREDENTIAL_ACCESS_SECRET:$this->credentials['secret'];\n\t\t\n\t\t$headerKey = 'HTTP_'.strtoupper($key);\n\t\t$headerSecret = 'HTTP_'.strtoupper($secret);\n\t\t\n\t\t$info = [];\n\t\tif(isset( $_SERVER[$headerKey] )&&isset( $_SERVER[$headerSecret]) ){\n\t\t\t$info['key'] = $_SERVER[$headerKey];\n\t\t\t$info['secret'] = $_SERVER[$headerSecret];\n\t\t}\n\t\t\n\t\tif(empty($info)){\n\t\t\t$info['key'] = empty($_GET[$key])?empty($_POST[$key])?'none':$_POST[$key]:$_GET[$key];\n\t\t\t$info['secret'] = empty($_GET[$secret])?empty($_POST[$secret])?'none':$_POST[$secret]:$_GET[$secret];\n\t\t}\n\t\t\n\t\treturn $info;\n\t}"
] | [
"0.72291875",
"0.71094817",
"0.7064853",
"0.70611596",
"0.6965813",
"0.68447983",
"0.67857105",
"0.66658485",
"0.65774256",
"0.6566464",
"0.64812005",
"0.64812005",
"0.64812005",
"0.64812005",
"0.64812005",
"0.64812005",
"0.64812005",
"0.64803624",
"0.64594936",
"0.64496136",
"0.6426181",
"0.63032806",
"0.62883383",
"0.6267326",
"0.626575",
"0.6242051",
"0.6237909",
"0.62279403",
"0.6224893",
"0.62245154"
] | 0.7255067 | 0 |
/ _Send Message to devices (it is a abstract function so developer can define in function) | abstract protected function _send($deviceId, $message, $sendOptions = []); | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public abstract function send_message($message);",
"public function SendMessage()\n {\n }",
"public function sendMessage()\n {\n // section 10-5-1-60-5ce3491f:15700383283:-8000:0000000000000BAD begin\n // section 10-5-1-60-5ce3491f:15700383283:-8000:0000000000000BAD end\n }",
"function sendMsg($senderId,$receiveId,$msg)\n{\n\t\n}",
"public function send(): void ;",
"public function sendSms()\n {\n }",
"public function send(string $message): void\n {\n }",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send();",
"public function send(Message $message) : void;",
"function send_message() {\r\n\t\t\r\n\t\t$this->Fields(array\r\n\t\t\t\t(\r\n\t\t\t\t\t\t\"id\"=>$this->_message_id,\r\n\t\t\t\t\t\t\"description\"=>$this->_message_description,\r\n\t\t\t\t\t\t\"user_from\"=>$this->_user_from,\r\n\t\t\t\t\t\t\"user_to\"=>$this->_user_to,\r\n\t\t\t\t\t\t\"messaging_time\"=>$this->_messaging_time\r\n\t\t\t\t)\r\n\t\t);\r\n\t\t\r\n\t\t$this->From(\"messaging\");\r\n\t\t$this->Insert();\r\n\t\t//echo $this->lastQuery();\r\n\t\t//echo (mysql_error());\r\n\r\n\t}",
"function sendmsg($to,$msg)\n{\n}",
"public function send() {\n }",
"public function sendMessage(string $message): void;",
"private function send($msg)\n {\n $msg .= \"\\n\";\n $this->serial->sendMessage($msg);\n }",
"public static function sendSMS(){\n }",
"abstract public function send(string $from, string $to, string $message): void;",
"public function send(Message $message): void;",
"function sendMessage($params, $addNotSend) {\n global $con;\n\n\n if ($params[\"registration_id\"] && $params[\"data\"]) {\n switch ($params[\"pushtype\"]) {\n case \"ios\":\n $ress = sendMessageIos($params[\"registration_id\"], $params);\n if ($addNotSend['type'] != 'message') {\n insertIntoNotSend($addNotSend);\n }\n break;\n case \"android\":\n $ress = sendMessageAndroid($params[\"registration_id\"], $params);\n $ress = json_decode($ress);\n if ($ress) {\n if ($ress->success == 0) {\n updateDevices($params['data']['client_id'], $params[\"registration_id\"]);\n }\n if ($addNotSend['type'] != 'message') {\n insertIntoNotSend($addNotSend);\n }\n }\n break;\n }\n }\n }",
"public function send()\n {\n if ($this->to) {\n $client = new Client($this->sid, $this->auth_token);\n $client->messages->create($this->to, [\n 'from' => $this->sms_from,\n 'body' => $this->message\n ]);\n }\n }",
"function sendMessage(string $phone_number, string $message)\n{\n global $device_id;\n global $api_key;\n\n // Configure client\n $config = Configuration::getDefaultConfiguration();\n $config->setApiKey('Authorization', $api_key);\n $apiClient = new ApiClient($config);\n $messageClient = new MessageApi($apiClient);\n\n // Sending a SMS Message\n $sendMessageRequest = new SendMessageRequest([\n 'phoneNumber' => $phone_number,\n 'message' => $message,\n 'deviceId' => $device_id\n ]);\n $sendMessage = $messageClient->sendMessages([$sendMessageRequest]);\n return $sendMessage;\n}",
"public function sendMessage()\n {\n $this->processData($this->orderModel);\n $this->getTemplate(\"订单支付成功通知\");\n $this->getBackMember();\n if (empty($this->temp_open)) {\n $back['message'] = \"消息通知未开启\";\n \\Log::debug($back['message']);\n }\n\n $this->organizeData();\n\n $result = (new AppletMessageNotice($this->temp_id,0,$this->data,$this->minOpenIds,2))->sendMessage();\n\n if ($result['status'] == 0) {\n \\Log::debug($result['message']);\n }\n }",
"public function sendMessage($code, $text)\n {\n }",
"public function sendMessage($code, $text)\n {\n }",
"function send($client,$msg){ \n $msg = $this->frame_encode($msg);\n socket_write($client, $msg);\n $this->say(\"> \".$msg.\" (\".strlen($msg). \" bytes) \\n\");\n }"
] | [
"0.76244825",
"0.7494614",
"0.74832237",
"0.7178631",
"0.71406615",
"0.6997258",
"0.6969545",
"0.6962013",
"0.6962013",
"0.6962013",
"0.6962013",
"0.6962013",
"0.6962013",
"0.6962013",
"0.6919355",
"0.6876293",
"0.6871009",
"0.6861698",
"0.67859125",
"0.6783427",
"0.6768322",
"0.66956604",
"0.6641862",
"0.66232103",
"0.65954393",
"0.65571666",
"0.6556896",
"0.6538775",
"0.6538775",
"0.6532251"
] | 0.755372 | 1 |
Get a list of filter options for the levels. | static function getLevelsOptions()
{
// Build the filter options.
$options = array();
$options[] = Html::select('option', '1', Lang::txt('COM_MEMBERS_OPTION_LEVEL_COMPONENT', 1));
$options[] = Html::select('option', '2', Lang::txt('COM_MEMBERS_OPTION_LEVEL_CATEGORY', 2));
$options[] = Html::select('option', '3', Lang::txt('COM_MEMBERS_OPTION_LEVEL_DEEPER', 3));
$options[] = Html::select('option', '4', '4');
$options[] = Html::select('option', '5', '5');
$options[] = Html::select('option', '6', '6');
return $options;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getOptions()\n {\n $options = [];\n $component = $this->filter->getComponent();\n $childComponents = $component->getChildComponents();\n $listingTop = $childComponents['listing_top'];\n foreach ($listingTop->getChildComponents() as $child) {\n if ($child instanceof Filters) {\n foreach ($child->getChildComponents() as $filter) {\n if ($filter instanceof Select) {\n $options[$filter->getName()] = $this->getFilterOptions($filter);\n }\n }\n }\n }\n return $options;\n }",
"public function getFilterOptions()\n {\n return $this->filter_options;\n }",
"public static function filters()\n {\n return collect(self::$filters)->map(function ($val) {\n $val['name'] = trans($val['name']);\n if (isset($val['sub_menus'])) {\n foreach ($val['sub_menus'] as $key => $menu) {\n $val['sub_menus'][$key]['name'] = trans($menu['name']);\n }\n }\n return $val;\n })->toArray();\n }",
"public function getFilters() {\n return $this->_options['filter'];\n }",
"public function getFilters()\n {\n $filters = [];\n\n $orderPaymentStatus = [\n 'fieldID' => 'order_payment_status_id',\n 'type' => 'dropDownList',\n 'label' => trans('HCECommerceOrders::e_commerce_orders_history.order_payment_status_id'),\n 'options' => HCECOrderPaymentStatus::select('id')->get()->toArray(),\n 'showNodes' => ['title'],\n ];\n\n $orderStates = [\n 'fieldID' => 'order_state_id',\n 'type' => 'dropDownList',\n 'label' => trans('HCECommerceOrders::e_commerce_orders_history.order_state_id'),\n 'options' => HCECOrderStates::select('id')->get()->toArray(),\n 'showNodes' => ['title'],\n ];\n\n $filters[] = addAllOptionToDropDownList($orderPaymentStatus);\n $filters[] = addAllOptionToDropDownList($orderStates);\n\n return $filters;\n }",
"function get_filter_type_options(){\n return $this->get_mapped_property('filter_type_options');\n }",
"static function getLevelOptions(){\n return array(\n 1 => \"Ideação\",\n 2 => \"Operação\",\n 3 => \"Tração\",\n 0 => \"Outros\"\n );\n }",
"private function getFilters(){\n $filters = array(\n 'tag' => LANGUAGE,\n 'keys' => 'all'\n );\n\n if(App::request()->getCookies('languages-filters')) {\n $filters = json_decode(App::request()->getCookies('languages-filters'), true);\n }\n\n return $filters;\n }",
"public function getFilters();",
"public function getFilters();",
"public function getFilterOptions() {\n\t\t$language = (string)Configure::read('Config.language');\n\t\t$cachePath = 'local_fields_filter_opt_' . $language;\n\t\t$cached = Cache::read($cachePath, CAKE_LDAP_CACHE_KEY_LDAP_SYNC_DB);\n\t\tif ($cached !== false) {\n\t\t\treturn $cached;\n\t\t}\n\n\t\t$result = [];\n\t\t$excludeFields = [\n\t\t\t'id',\n\t\t\t'department_id',\n\t\t\t'manager_id',\n\t\t\t'lft',\n\t\t\t'rght',\n\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_OBJECT_GUID,\n\t\t\tCAKE_LDAP_LDAP_ATTRIBUTE_DISTINGUISHED_NAME,\n\t\t];\n\t\t$excludeFieldsLabel = [\n\t\t\t$this->alias . '.' . CAKE_LDAP_LDAP_ATTRIBUTE_OBJECT_GUID,\n\t\t\t$this->alias . '.' . CAKE_LDAP_LDAP_ATTRIBUTE_DISTINGUISHED_NAME,\n\t\t];\n\n\t\t$fieldsInfo = $this->_modelConfigSync->getLocalFieldsInfo();\n\t\t$fieldsInfo += $this->_modelConfigSync->getLdapFieldsInfo();\n\t\t$fieldsInfo = array_diff_key($fieldsInfo, array_flip($excludeFields));\n\t\t$fieldsLabels = $this->_getLabelForFields($fieldsInfo, true);\n\t\tforeach ($fieldsLabels as $fieldName => $label) {\n\t\t\t$fieldOptions = [];\n\t\t\tif (!empty($label)) {\n\t\t\t\t$fieldOptions['label'] = $label;\n\t\t\t}\n\t\t\tif ($this->_isHashPath($fieldName)) {\n\t\t\t\t$fieldOptions['disabled'] = true;\n\t\t\t}\n\t\t\t$result[$fieldName] = $fieldOptions;\n\t\t}\n\t\tCache::write($cachePath, $result, CAKE_LDAP_CACHE_KEY_LDAP_SYNC_DB);\n\n\t\treturn $result;\n\t}",
"public function getAdminFilters()\n {\n return $this->displayFilterConfiguration ?? [];\n }",
"public function getFilters(){\n if(App::request()->getHeaders('X-List-Filter')) {\n App::session()->getUser()->setOption('admin.user-filter', App::request()->getHeaders('X-List-Filter'));\n }\n\n return json_decode(App::session()->getUser()->getOptions('admin.user-filter'), true);\n }",
"public function filters() {\n return [];\n }",
"public function filters()\n {\n return array(\n );\n }",
"public function filters()\n {\n return array(\n );\n }",
"public function filters()\n {\n return array(\n );\n }",
"public function getFiltersList(){\n return $this->_get(1);\n }",
"public function getFiltersList(){\n return $this->_get(1);\n }",
"public function filters()\n {\n return [];\n }",
"public static function get_filters();",
"public function filters() {\n return array(\n 'rights',\n );\n }",
"public function filters()\n\t{\n\t\treturn array(\n\t\t\t'checkPrivilages',\n\t\t);\n\t}",
"public function filters(){\r\n return array();\r\n }",
"public static function getContextOptions()\n\t{\n\t\t// Build the filter options.\n\t\t$options = array();\n\n\t\t// Load the attached plugin group.\n\t\tJPluginHelper::importPlugin('attached');\n\n\t\t// Get the event dispatcher.\n\t\t$dispatcher = JEventDispatcher::getInstance();\n\n\t\t// Trigger the onGetConfig event.\n\t\t$result = $dispatcher->trigger('onGetConfig', array($config = array()));\n\n\t\tforeach ($result as $item)\n\t\t{\n\t\t\t$options[] = JHtml::_('select.option', $item['context'], $item['text']);\n\t\t}\n\n\t\treturn $options;\n\t}",
"public function formFilterFieldOptions(): array\n {\n $options = $this->options->toArray();\n $options['htmlName'] = 'filters['.$this->machineName.']';\n $options['required'] = false;\n $options['disabled'] = false;\n return $options;\n }",
"public function filters()\r\n {\r\n\t\t$filters = array(\r\n //'postOnly + delete, slug',\r\n );\r\n return CMap::mergeArray($filters, parent::filters());\r\n }",
"public function filters()\r\n {\r\n\t\t$filters = array(\r\n //'postOnly + delete, slug',\r\n );\r\n return CMap::mergeArray($filters, parent::filters());\r\n }",
"public function getFilters(){ }",
"public function getFilters(){ }"
] | [
"0.72275966",
"0.70823073",
"0.672023",
"0.66884667",
"0.66702497",
"0.6474573",
"0.63702667",
"0.63120544",
"0.6269827",
"0.6269827",
"0.62174374",
"0.62157226",
"0.61919725",
"0.61752295",
"0.61681134",
"0.61681134",
"0.61681134",
"0.615072",
"0.615072",
"0.6144601",
"0.61377794",
"0.61106503",
"0.6103794",
"0.6085166",
"0.6075393",
"0.6058344",
"0.60426563",
"0.60426563",
"0.6028422",
"0.6028422"
] | 0.7755775 | 0 |
Get the SIGPAC reference values from the CATASTRO identification number | public function catastroToSigpac($reference)
{
//Convert the data to string
$reference = is_object($reference)
? $reference->get('reference')
: $reference;
//
return [
'region' => substr($reference, 0, 2),
'city' => substr($reference, 2, 3),
'aggregate' => '0',
'zone' => '0',
'polygon' => substr($reference, 6, 3),
'plot' => substr($reference, 9, 5),
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getReferences($code) {\n $references = [\n \"0\" => \"Il faut remplir le formulaire\",\n \"1\" => \"Certains champs sont vides\",\n \"2\" => \"Le nom utilisateur est trop court\",\n \"3\" => \"Le mot de passe ne correspond pas à sa confirmation\",\n \"4\" => \"Le mot de passe ne respecte pas les conditions indiquées\",\n \"5\" => \"Un utilisateur utilise déjà cet email merci d'en choisir un autre\",\n \"6\" => \"Veuillez entrer un email au format valide\",\n \"7\" => \"Veuillez saisir des identifiants valident.\",\n \"8\" => \"Il faut vous identifier pour accéder au contenu\",\n \"9\" => \"Contenu reservé aux administrateurs du site\"\n ];\n return $references;\n}",
"function LoadSignatureReference($db) {\n $sig_ref_array = array();\n $temp_sql = \"SELECT sig_id, ref_seq, ref_id FROM sig_reference\";\n $tmp_sig_ref = $db->baseExecute($temp_sql);\n $num_rows = $tmp_sig_ref->baseRecordCount();\n for ($i = 0; $i < $num_rows; $i++) {\n $myrow = $tmp_sig_ref->baseFetchRow();\n if (!isset($sig_ref_array[$myrow[0]])) {\n $sig_ref_array[$myrow[0]] = array();\n }\n $sig_ref_array[$myrow[0]][$myrow[1]] = $myrow[2];\n }\n if (!isset($_SESSION['acid_sig_refs'])) $_SESSION['acid_sig_refs'] = $sig_ref_array;\n}",
"function extract_document_reference($string) {\n $is_match = preg_match('/(LC|CP|LCCP)\\s*(\\d+)/i', $string, $matches);\n\n if (!$is_match) {\n return array();\n }\n\n switch (strtoupper($matches[1])) {\n case 'LC':\n $prefix = 'LC';\n break;\n\n case 'CP':\n case 'LCCP':\n $prefix = 'CP';\n break;\n\n default:\n $prefix = false;\n break;\n }\n\n $number = intval($matches[2]);\n\n return array(\n 'prefix' => $prefix,\n 'number' => $number,\n );\n}",
"function find_genbank_accession_numbers(&$document)\n{\n\t$results = find_accession_numbers($document->current_paragraph_node->content);\n\t\n\tforeach ($results as $specimen)\n\t{\n\t\t$annotation = new_annotation($document, 'genbank', false);\n\n\t\t$annotation->range = $specimen->range;\n\t\t$annotation->pre = $specimen->pre;\n\t\t$annotation->mid = $specimen->mid;\n\t\t$annotation->post = $specimen->post;\n\t\t\t\t\n\t\tadd_annotation($document, $annotation);\t\n\t}\t\n}",
"function getDiplomaBacOriginal($id_formular)\n{\n $c = oci_connect(\"ADMITERE1\", \"ADMITERE1\", \"localhost/xe\", 'AL32UTF8');\n $s = oci_parse($c, \" begin select REPLACE(REPLACE(idl.diploma_bac_original, '1', 'DA'), '0', 'NU') into :bv from informatii_documente_licenta idl\n join formular_licenta f on f.id=idl.formular_id\n where f.id='$id_formular'; end; \");\n oci_bind_by_name($s, \":bv\", $v, 100);\n oci_execute($s);\n oci_close($c);\n return $v;\n}",
"private function getCDC() {\n\n\t\tif (!isset($_COOKIE['_saml_idp'])) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$ret = (string)$_COOKIE['_saml_idp'];\n\t\t$ret = explode(' ', $ret);\n\t\tforeach ($ret as &$idp) {\n\t\t\t$idp = base64_decode($idp);\n\t\t\tif ($idp === FALSE) {\n\t\t\t\t/* Not properly base64 encoded. */\n\t\t\t\treturn array();\n\t\t\t}\n\t\t}\n\n\t\treturn $ret;\n\t}",
"function getNaSeqByAccessNum($accessNum) {\n $result = array();\n $gidArr = getGidByAccessNum($accessNum);\n foreach ($gidArr as $gid) {\n $naSeq = getNaSeq($gid);\n array_push($result, $naSeq);\n }\n return $result;\n}",
"function getDiseaseControlInfo(){\n\tglobal $db,$icpcClass;\n\t$diseaseList = array();\n\t$sql=\"SELECT auto_id,ICPC,prev_rf FROM disease WHERE 1\";\n\t$result = $db->query($sql);\n\twhile($row = $result->fetch_array()){\n\t\t$temp = array();\n\t\tif($row[\"ICPC\"] != \"?\"||$row[\"prev_rf\"]!=0){//为了过滤没有ICPC的疾病\n\t\t\t$temp[] = (int)$row[\"auto_id\"];\n\t\t\t$temp[] = $icpcClass[strtolower(substr($row[\"ICPC\"],0,1))];\n\t\t\t$temp[] = 2;//设置默认的长度。\n $temp[] = \"all diseases\";\n\t\t\t\n\t\t\t$diseaseList[] = $temp;\n\t\t}\n\t}\n\treturn $diseaseList;\n}",
"function getCodigoControl_IBAN($codigoPais,$cc)\n{\n\t$valoresPaises = array(\n\t\t'A' => '10',\n\t\t'B' => '11',\n\n\t\t'C' => '12',\n\n\t\t'D' => '13',\n\n\t\t'E' => '14',\n\n\t\t'F' => '15',\n\n\t\t'G' => '16',\n\n\t\t'H' => '17',\n\n\t\t'I' => '18',\n\n\t\t'J' => '19',\n\n\t\t'K' => '20',\n\n\t\t'L' => '21',\n\n\t\t'M' => '22',\n\n\t\t'N' => '23',\n\n\t\t'O' => '24',\n\n\t\t'P' => '25',\n\n\t\t'Q' => '26',\n\n\t\t'R' => '27',\n\n\t\t'S' => '28',\n\n\t\t'T' => '29',\n\n\t\t'U' => '30',\n\n\t\t'V' => '31',\n\n\t\t'W' => '32',\n\n\t\t'X' => '33',\n\n\t\t'Y' => '34',\n\n\t\t'Z' => '35'\n\t);\n\n \t// reemplazamos cada letra por su valor numerico y ponemos los valores mas dos ceros al final de la cuenta\n\t$dividendo = $cc.$valoresPaises[substr($codigoPais,0,1)].$valoresPaises[substr($codigoPais,1,1)].'00';\n\t// Calculamos el modulo 97 sobre el valor numerico y lo restamos de 98\n\t// Utilizamos bcmod para poder realizar el calculo, ya que un int sobre 32 bits no puede gestionar tantos numeros\n\t$digitoControl = 98 - bcmod($dividendo, '97');\n\t// Si el digito de control es un solo numero, añadimos un cero al delante\n\tif(strlen($digitoControl)==1)\n\t{\n\t\t$digitoControl = '0'.$digitoControl;\n\t}\n\treturn $digitoControl;\n}",
"function getTblClinicalNote(){\n\t\treturn $this->getTblPre($this->tbl_pre.\"1_\", $this->tbl_clinical_notes);\n\t}",
"public function getRefNumber()\n\t{\n\t\t$LeadDetails = LeadDetails::where('active', 1)->whereNotNull('deliveryStatus')->get();\n\t\t$refNumber1 = [];\n\t\tforeach ($LeadDetails as $lead) {\n\t\t\tif (isset($lead->deliveryStatus)) {\n\t\t\t\tforeach ($lead->deliveryStatus as $status) {\n\t\t\t\t\tif ((isset($status['upload_sign']) && $status['upload_sign'] != \"\" && isset($status['status']) && $status['status'] == \"Delivered\")\n\t\t\t\t\t\t|| (isset($status['upload_sign']) && $status['upload_sign'] != \"\" && !isset($status['status']))\n\t\t\t\t\t) {\n\t\t\t\t\t\t$refNumber1[] = $lead->referenceNumber;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdd(array_unique($refNumber1));\n\t}",
"public function getRefR1C1()\n\t{\n\t}",
"public function getReferenceNumber(){\n return $this->txref;\n }",
"function getNationalIdentificationNumber();",
"public function getPaperRef(){\n\t\t$reg = $this->userRegistration;\n\t\treturn $this->conference->conf_abbr . ': ' . str_pad($reg->confly_number, 3 , '0', STR_PAD_LEFT) . '-' . str_pad($this->confly_number, 3 , '0', STR_PAD_LEFT);\n\t}",
"function getSantanderConstant($clientNumber)\n{\n $temporalString = str_split($clientNumber);\n //print_r(\"temporalString : {$temporalString}<br>\");\n //print_r($assignValuesArray);\n $formatedChars = array_map(\"santanderSetCharValues\", $temporalString);\n\n $verificationCode = santanderVerificationDigit(array_reverse($formatedChars));\n //print_r(\"verificationCode : {$verificationCode}<br>\");\n return $clientNumber . $verificationCode;\n}",
"public function getNoteNumberMapUseCases() : array;",
"public function get_reference_value($p_id)\n {\n\n if (is_array($this->m_data_info[C__PROPERTY__DATA__REFERENCES]) && count($this->m_data_info[C__PROPERTY__DATA__REFERENCES]) > 0 && $p_id > 0)\n {\n $l_dao = new isys_cmdb_dao($this->m_database);\n $l_table = $this->m_data_info[C__PROPERTY__DATA__REFERENCES][0];\n\n if (!strpos($l_table, '_list') && !strpos($l_table, '_2_')) $l_table .= '_list';\n\n if ($l_table == 'isys_catg_ip_list')\n {\n $l_query = \"SELECT \" . $this->m_data_info[C__PROPERTY__DATA__REFERENCES][1] . \" AS id, \" . \"isys_cats_net_ip_addresses_list__title AS title FROM \" . $l_table . \" \" . \"INNER JOIN isys_cats_net_ip_addresses_list ON isys_cats_net_ip_addresses_list__id = \" . $l_table . \"__isys_cats_net_ip_addresses_list__id \" . \"WHERE \" . $this->m_data_info[C__PROPERTY__DATA__REFERENCES][1] . \" = \" . $l_dao->convert_sql_id(\n $p_id\n );\n }\n else\n {\n $l_query = \"SELECT \" . $this->m_data_info[C__PROPERTY__DATA__REFERENCES][1] . \" AS id, \" . $l_table . \"__title AS title FROM \" . $l_table . \" WHERE \" . $this->m_data_info[C__PROPERTY__DATA__REFERENCES][1] . \" = \" . $l_dao->convert_sql_id(\n $p_id\n );\n }\n\n $l_data = $l_dao->retrieve($l_query)\n ->get_row();\n\n if ($l_data)\n {\n $l_row = $l_dao->retrieve(\n \"SELECT isysgui_catg__const FROM isysgui_catg WHERE \" . \"isysgui_catg__class_name NOT LIKE '%_view%' \" . \"AND isysgui_catg__source_table = \" . $l_dao->convert_sql_text(\n ((strpos($this->m_data_info[C__PROPERTY__DATA__REFERENCES][0], '_list') && !strpos(\n $this->m_data_info[C__PROPERTY__DATA__REFERENCES][0],\n '_2_'\n )) ? str_replace('_list', '', $this->m_data_info[C__PROPERTY__DATA__REFERENCES][0]) : $this->m_data_info[C__PROPERTY__DATA__REFERENCES][0])\n )\n )\n ->get_row();\n\n $l_data['type'] = isset($l_row['isysgui_catg__const']) ? $l_row['isysgui_catg__const'] : '';\n\n $l_data['reference'] = $this->m_data_info[C__PROPERTY__DATA__REFERENCES][0];\n\n return $l_data;\n }\n }\n\n return [];\n }",
"function certrt_get_code($certrt, $certrecord) {\n if ($certrt->printnumber) {\n return $certrecord->code;\n }\n\n return '';\n}",
"public function getReferenceID()\n\t{\n\t\t$this->db->select('prnt_reference_id');\n\t\t$this->db->from('cms_parents');\n\t\t$this->db->order_by('prnt_id','desc');\n\t\t$this->db->limit('1');\n\n\t\t$query = $this->db->get();\n\t\t$EMPID = '';\n\t\t$LastInsertedID = 0;\n\t\t$countID = $query->num_rows();\n\t\tif($countID > 0){\n\t\t\t$result = $query->row();\n\t\t\t$EMPID = $result->prnt_reference_id;\n\t\t}else{\n\t\t\t$EMPID = 'PRT00000';\n\t\t}\n\t\t$LastInsertedID = substr($EMPID, 3, 5);\n\t\t$NEWIDS = 'PRT' . str_pad($LastInsertedID + 1, 5, '0', STR_PAD_LEFT);\n\t\treturn $NEWIDS;\n\n\t}",
"public function BroRef() {\n $ref = $this->DadBrO->BroId;\n if ($this->IsStart())\n $ref .= 's';\n if ($this->DiMeIdsA)\n $ref .= ','.implode(',', $this->DiMeIdsA);\n return $ref;\n }",
"function getNaSeq($gid) {\n $seqs = queryNaSeq($gid);\n return $seqs[0]['naseq'];\n}",
"public function getFINumber($data){\n $this->openFunction('BKK_RFC_GL_GET_DOCNO_BY_AWKEY');\n $this->fce->I_AWSYS = ' ';\n $this->fce->I_AWTYP = 'RMRP';\n $this->fce->I_AWKEY = $data['AWKEY'];\n\n $this->fce->call();\n $i = 0;\n $itTampung = array();\n if ($this->fce->GetStatus() == SAPRFC_OK) {\n $itTampung = array('COMPANY_CODE' => $this->fce->E_BUKRS, 'FI_NUMBER' => $this->fce->E_BELNR, 'FI_YEAR' => $this->fce->E_GJAHR);\n }\n return $itTampung;\n }",
"public function refer_patient(){\n\t\t\n\t}",
"protected function get_cities_id_by_ref(){\n $sql = $this->db->query(\"SELECT `city_id`, `city_ref` FROM `\" . DB_PREFIX . \"novapochta_city`\");\n $id_and_ref = array();\n foreach($sql->rows as $row){\n $id_and_ref[(string)$row[\"city_ref\"]] = (string)$row[\"city_id\"];\n }\n return $id_and_ref;\n }",
"public function getCDA() {\n \n $oDadosInstit = db_stdClass::getDadosInstit(); \n $iRegraIPTU = $oDadosInstit->db21_regracgmiptu;\n $iRegraISS = $oDadosInstit->db21_regracgmiss;\n \n $sSqlDadosLivro = \"select v13_certid as certidao, \";\n $sSqlDadosLivro .= \" v13_dtemis as dtemissao, \";\n $sSqlDadosLivro .= \" v26_numerofolha as numerofolha, \";\n $sSqlDadosLivro .= \" round(sum(v14_vlrhis), 2) as vlrhis, \";\n $sSqlDadosLivro .= \" round(sum(v14_vlrcor), 2) as vlrcor, \";\n $sSqlDadosLivro .= \" round(sum(v14_vlrmul), 2) as vlrmul, \";\n $sSqlDadosLivro .= \" round(sum(v14_vlrjur), 2) as vlrjur, \";\n $sSqlDadosLivro .= \" origem, \";\n $sSqlDadosLivro .= \" (select rvNome||'|'||coalesce(rinumcgm,0)||'|'||coalesce(rimatric,0)||'|'||coalesce(riinscr,0)\";\n $sSqlDadosLivro .= \" from fc_socio_promitente(numpre,true,{$iRegraIPTU},{$iRegraISS}) limit 1) as nome \";\n $sSqlDadosLivro .= \"from ( \";\n $sSqlDadosLivro .= \" SELECT v13_certid, \";\n $sSqlDadosLivro .= \" v13_dtemis, \";\n $sSqlDadosLivro .= \" v26_numerofolha, \";\n $sSqlDadosLivro .= \" (case when certter.v14_certid is null \";\n $sSqlDadosLivro .= \" then '1' else '2' end) as origem, \";\n $sSqlDadosLivro .= \" (case when certter.v14_certid is null \";\n $sSqlDadosLivro .= \" then certdiv.v14_vlrhis else certter.v14_vlrhis end) as v14_vlrhis, \";\n $sSqlDadosLivro .= \" (case when certter.v14_certid is null \";\n $sSqlDadosLivro .= \" then certdiv.v14_vlrcor else certter.v14_vlrcor end) as v14_vlrcor, \";\n $sSqlDadosLivro .= \" (case when certter.v14_certid is null \";\n $sSqlDadosLivro .= \" then certdiv.v14_vlrjur else certter.v14_vlrjur end) as v14_vlrjur, \";\n $sSqlDadosLivro .= \" (case when certter.v14_certid is null \";\n $sSqlDadosLivro .= \" then certdiv.v14_vlrmul else certter.v14_vlrmul end) as v14_vlrmul, \";\n $sSqlDadosLivro .= \" (case when certter.v14_certid is null \";\n $sSqlDadosLivro .= \" then divida.v01_numpre else termo.v07_numpre end ) as numpre\";\n $sSqlDadosLivro .= \" from certid \";\n $sSqlDadosLivro .= \" left join certdiv on certdiv.v14_certid = v13_certid \";\n $sSqlDadosLivro .= \" left join divida on v01_coddiv = v14_coddiv \";\n $sSqlDadosLivro .= \" left join certter on certter.v14_certid = v13_certid \";\n $sSqlDadosLivro .= \" left join termo on certter.v14_parcel = v07_parcel \";\n $sSqlDadosLivro .= \" left join certidlivrofolha on v13_certid = v26_certid \";\n $sSqlDadosLivro .= \" where certidlivrofolha.v26_certidlivro = {$this->iCodigoLivro}\";\n $sSqlDadosLivro .= \" and (certter.v14_certid is not null or certdiv.v14_certid is not null)\";\n $sSqlDadosLivro .= \" ) as x \";\n $sSqlDadosLivro .= \" group by v13_certid, \";\n $sSqlDadosLivro .= \" v13_dtemis, \";\n $sSqlDadosLivro .= \" v26_numerofolha,\";\n $sSqlDadosLivro .= \" origem,\";\n $sSqlDadosLivro .= \" nome \";\n $sSqlDadosLivro .= \" order by v26_numerofolha, v13_certid\";\n $rsDadosLivro = $this->oDaoCertidLivro->sql_record($sSqlDadosLivro);\n $aDadosLivro = array();\n if ($this->oDaoCertidLivro->numrows > 0) {\n\n for ($i = 0; $i < $this->oDaoCertidLivro->numrows; $i++) {\n\n $oDadosCda = db_utils::fieldsMemory($rsDadosLivro, $i);\n $aOrigem = explode(\"|\", $oDadosCda->nome);\n if ($aOrigem[2] != 0) {\n \n $oDadosCda->origemdebito = \"Matrícula {$aOrigem[2]}\"; \n $oDadosCda->tipoorigemdebito = 2;\n \n } else if ($aOrigem[3] != 0) {\n \n $oDadosCda->origemdebito = \"Inscrição {$aOrigem[3]}\";\n $oDadosCda->tipoorigemdebito = 3;\n \n } else {\n \n $oDadosCda->origemdebito = \"Numcgm {$aOrigem[1]}\";\n $oDadosCda->tipoorigemdebito = 1;\n \n }\n $oDadosCda->nome = $aOrigem[0];\n $oDadosCda->valortotal = $oDadosCda->vlrcor+$oDadosCda->vlrmul+$oDadosCda->vlrjur;\n $aDadosLivro[] = $oDadosCda;\n }\n }\n return $aDadosLivro;\n }",
"public function get_reference_value_import($p_value)\n {\n $l_dao = new isys_cmdb_dao($this->m_database);\n\n if (is_array($p_value[C__DATA__VALUE]))\n {\n while (array_key_exists(C__DATA__VALUE, $p_value) && is_array($p_value[C__DATA__VALUE]))\n {\n $p_value = $p_value[C__DATA__VALUE];\n }\n }\n\n $l_const = $p_value['type'];\n $l_catg = strpos($p_value['type'], 'C__CATG');\n\n if ($l_catg !== false)\n {\n if ($l_catg === 0)\n {\n $l_cat_type = C__CMDB__CATEGORY__TYPE_GLOBAL;\n }\n else\n {\n $l_cat_type = C__CMDB__CATEGORY__TYPE_SPECIFIC;\n } // if\n }\n else\n {\n $l_count = $l_dao->retrieve(\"SELECT count(isysgui_catg__id) AS `count` FROM isysgui_catg WHERE isysgui_catg__const = \" . $l_dao->convert_sql_text($l_const))\n ->__to_array();\n\n if ($l_count['count'] > 0)\n {\n $l_cat_type = C__CMDB__CATEGORY__TYPE_GLOBAL;\n }\n else\n {\n $l_cat_type = C__CMDB__CATEGORY__TYPE_SPECIFIC;\n } // if\n } // if\n\n if (defined($l_const))\n {\n return $this->m_category_data_ids[$l_cat_type][constant($l_const)][$p_value['id']];\n }\n\n return null;\n }",
"function getAlteConcursuri($id_formular)\n{\n $c = oci_connect(\"ADMITERE1\", \"ADMITERE1\", \"localhost/xe\", 'AL32UTF8');\n $s = oci_parse($c, \" begin select REPLACE(REPLACE(idl.participa_altundeva, '1', 'DA'), '0', 'NU') into :bv from informatii_documente_licenta idl\n join formular_licenta f on f.id=idl.formular_id\n where f.id='$id_formular'; end; \");\n oci_bind_by_name($s, \":bv\", $v, 100);\n oci_execute($s);\n oci_close($c);\n return $v;\n}",
"public function pontAtv($seqticms,$uf){\n $iretpont = 0;\n $sSql = \"select icmspesatv from widl.ICMS(nolock) \"\n .\"where icmsseq =\".$seqticms.\" and icmsestcod ='\".$uf.\"' and icmsconpes = 'S' \";\n $result =$this->getObjetoSql($sSql);\n $row = $result->fetch(PDO::FETCH_OBJ);\n $iretpont = $row->icmspesatv;\n return $iretpont; \n }",
"public function getCodeCga() {\n return $this->codeCga;\n }"
] | [
"0.5388361",
"0.5364037",
"0.5293702",
"0.5272162",
"0.50360674",
"0.49209946",
"0.49137688",
"0.49123618",
"0.4889554",
"0.48840544",
"0.4852478",
"0.48270288",
"0.48074543",
"0.4786857",
"0.4753432",
"0.47425443",
"0.47403404",
"0.47199807",
"0.4718822",
"0.4689339",
"0.4679713",
"0.4673358",
"0.46713218",
"0.46615943",
"0.46379727",
"0.46363074",
"0.46318096",
"0.46240407",
"0.4622769",
"0.46169043"
] | 0.6023177 | 0 |
function mdlIngresarTipoDocumento /============================================= EDITAR TIPO DOCUMENTO ============================================= | static public function mdlEditarTipoDocumento($tabla, $datos){
$datos = arrayMapUtf8Decode($datos);
$db = new Conexion();
$sql = $db->consulta("UPDATE $tabla SET dsc_tipo_documento = '".$datos["dsc_tipo_documento"]."', cod_usr_modifica = '".$datos["cod_usr_modifica"]."', fch_modifica = CONVERT(datetime,'".$datos["fch_modifica"]."',21) WHERE cod_tipo_documento = '".$datos["cod_tipo_documento"]."'");
if($sql){
return "ok";
}else{
return "error";
}
$db->liberar($sql);
$db->cerrar();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static public function mdlIngresarTipoDocumento($tabla, $datos){\n\t\t$datos = arrayMapUtf8Decode($datos);\n\t\t$db = new Conexion();\n\t\t$sql = $db->consulta(\"INSERT INTO $tabla(cod_tipo_documento,dsc_tipo_documento,cod_usr_registro,fch_registro) VALUES('\".$datos['cod_tipo_documento'].\"','\".$datos['dsc_tipo_documento'].\"','\".$datos[\"cod_usr_registro\"].\"',CONVERT(datetime,'\".$datos[\"fch_registro\"].\"',21))\");\n\t\tif($sql){\n\t\t\treturn \"ok\";\n\t\t}else{\n\t\t\treturn \"error\";\n\t\t}\n\t\t$db->liberar($sql);\n $db->cerrar();\n\t}",
"static public function mdlEditarTipoDocumento($tabla, $datos){\n\n\t\t$stmt = Conexion::conectar()->prepare(\"UPDATE $tabla SET tipo_doc = :tipo_doc WHERE cod_doc = :cod_doc\");\n\n\t\t$stmt -> bindParam(\":tipo_doc\", $datos[\"tipo_doc\"], PDO::PARAM_STR);\n\t\t$stmt -> bindParam(\":cod_doc\", $datos[\"cod_doc\"], PDO::PARAM_INT);\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n\t}",
"function prepara_Editar_DocumentoSinFila($aDatos, $sCodigo)\n {\n $bEditor = 0;\n if ($_COOKIE['ed'] == 1) {\n $bEditor = 1;\n }\n require_once 'constantes.inc.php';\n require_once 'Manejador_Base_Datos.class.php';\n //Ponemos el nombre del tipo (esta en idiomas), y la id (esta en constantes.inc.php)\n switch ($aDatos[0]) {\n case iIdPg:\n {\n $aParametros = array('tipo' => gettext('sPg'), 'idtipo' => iIdPg);\n break;\n }\n case iIdPe:\n {\n $aParametros = array('tipo' => gettext('sPe'), 'idtipo' => iIdPe);\n break;\n }\n case iIdManual:\n {\n $aParametros = array('tipo' => gettext('sManual'), 'idtipo' => iIdManual);\n break;\n }\n case iIdExterno:\n {\n $aParametros = array('tipo' => gettext('sTExterno'), 'idtipo' => iIdExterno);\n break;\n }\n case iIdPolitica:\n {\n $aParametros = array('tipo' => gettext('sTPoliticaI'), 'idtipo' => iIdPolitica);\n break;\n }\n case iIdObjetivos:\n {\n $aParametros = array('tipo' => gettext('sObjetivos'), 'idtipo' => iIdObjetivos);\n break;\n }\n case iIdFichaMa:\n {\n $aParametros = array('tipo' => gettext('sItma'), 'idtipo' => iIdFichaMa);\n break;\n }\n case iIdArchivoProc:\n {\n $aParametros = array('tipo' => gettext('sMIProceso'), 'idtipo' => iIdArchivoProc);\n break;\n }\n\n default:\n {\n $aParametros = array('tipo' => 'error');\n break;\n }\n }\n $aParametros['editor'] = $bEditor;\n $aParametros['id'] = $aDatos[1];\n $oBaseDatos = new Manejador_Base_Datos($_SESSION['login'], $_SESSION['pass'], $_SESSION['db']);\n $oBaseDatos->iniciar_Consulta('SELECT');\n $oBaseDatos->construir_Campos(array('internoexterno'));\n $oBaseDatos->construir_Tablas(array('tipo_documento'));\n $oBaseDatos->construir_Where(array('id=' . $aParametros['idtipo']));\n\n $oBaseDatos->consulta();\n $aIterador = $oBaseDatos->coger_Fila();\n if ($aIterador[0] == 'interno') {\n $aParametros['accion'] = 'editor:documento:editor:editar';\n $aParametros['idDocumento'] = $aDatos[1];\n } else {\n $aParametros['accion'] = $sCodigo;\n }\n return $aParametros;\n }",
"static public function mdlIngresarTipoDocumento($tabla, $datos){\n\n\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla(tipo_doc) VALUES (:tipo_doc)\");\n\n\t\t$stmt->bindParam(\":tipo_doc\", $datos, PDO::PARAM_STR);\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n\t}",
"function modificarDocumentoAnexo(){\n\t\t$this->procedimiento='saj.ft_documento_anexo_ime';\n\t\t$this->transaccion='SA_DOCANEX_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_documento_anexo','id_documento_anexo','int4');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('id_proceso_contrato','id_proceso_contrato','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"static public function mdlEditarDocumento($tabla, $datos){\n\n\t\t$stmt = Conexion::conectar()->prepare(\"UPDATE $tabla SET tipo_documento = :tipo_documento WHERE id = :id\");\n\n\t\t$stmt -> bindParam(\":tipo_documento\", $datos[\"tipo_documento\"], PDO::PARAM_STR);\n\t\t$stmt -> bindParam(\":id\", $datos[\"id\"], PDO::PARAM_INT);\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n\t}",
"public function edit(docentes $docente)\n {\n\n }",
"function get_tipo_documento($vals,$args){\n\textract($vals);\n\textract($args);\n\t//habria que ver si hay do de tipo de documento\n\t$do_tipo_documento = DB_DataObject::factory('tipo_documento');\n\t$do_tipo_documento -> tipo_doc_id = $record[$id];\n\tif($do_tipo_documento -> find(true))\n\t\treturn $do_tipo_documento -> tipo_doc_descripcion;\n}",
"function prepara_Ver_Documento($aDatos, $sCodigo)\n {\n //Miramos si es interno o externo\n require_once 'Manejador_Base_Datos.class.php';\n $oBaseDatos = new Manejador_Base_Datos($_SESSION['login'], $_SESSION['pass'], $_SESSION['db']);\n\n $oBaseDatos->iniciar_Consulta('SELECT');\n $oBaseDatos->construir_Campos(array('tipo_documento', 'id'));\n $oBaseDatos->construir_Tablas(array('documentos'));\n $oBaseDatos->construir_Where(array('id=' . $_SESSION['pagina'][$aDatos[0]]));\n $oBaseDatos->consulta();\n $aIterador = $oBaseDatos->coger_Fila();\n $iId = $aIterador[1];\n\n $oBaseDatos->iniciar_Consulta('SELECT');\n $oBaseDatos->construir_Campos(array('internoexterno', 'id'));\n $oBaseDatos->construir_Tablas(array('tipo_documento'));\n $oBaseDatos->construir_Where(array('id=' . $aIterador[0]));\n $oBaseDatos->consulta();\n $aIterador = $oBaseDatos->coger_Fila();\n\n if ($aIterador[1] == iIdProceso) {\n $sAccion = 'catalogo:verdocumentoprocesosinfilahistorial:listado:ver:fila';\n return (array('accion' => $sAccion, 'numeroDeFila' => $aDatos[0], 'proviene' => $iId));\n } else if ($aIterador[0] == 'interno') {\n $aParametros['accion'] = 'editor:documento:editor:ver';\n $aParametros['iddoc'] = $_SESSION['pagina'][$aDatos[0]];\n return ($aParametros);\n } else {\n return (array('accion' => $sCodigo, 'documento' => $aDatos[0]));\n }\n\n }",
"public function ImportarDocumento($idproveedor='',$estatus,$tipo)\r\n {\r\n $sql=\"SELECT \r\n c.idcompra AS idcompraop ,c.idproveedor,c.cod_compra AS origenc ,c.estatus,pv.cod_proveedor,pv.desc_proveedor,\r\n pv.rif,c.idcondpago,pv.limite,cp.cod_condpago,cp.desc_condpago,cp.dias,c.tipo,c.numerod,c.totalh,\r\n DATE_FORMAT(c.fechareg,'%d/%m/%Y') AS fechareg, DATE_FORMAT(c.fechaven,'%d/%m/%Y') AS fechaven\r\n FROM tbcompra c\r\n INNER JOIN tbproveedor pv ON pv.idproveedor=c.idproveedor\r\n INNER JOIN tbcondpago cp ON cp.idcondpago =c.idcondpago\r\n AND \r\n ('$idproveedor'='' OR c.idproveedor='$idproveedor')\r\n AND (c.tipo='$tipo') \r\n AND ( ('$estatus'='todos' AND c.estatus<>'Anulado')\r\n OR('$estatus'='sinp' AND c.estatus<>'Anulado' AND c.estatus<>'Procesado'))\";\r\n return ejecutarConsulta($sql);\r\n }",
"function editar($id) {\r\n $this->_vista->setJs('bootstrapValidator.min');\r\n $this->_vista->setCss('bootstrapValidator.min');\r\n $this->_vista->setJs('validarForm', 'documentoEspacio');\r\n\r\n /* declarar e inicializar variables */\r\n $this->_vista->titulo = 'DocumentoEspacio-Editar';\r\n $this->_vista->errorForm = array();\r\n $id = $this->filtrarEntero($id);\r\n $this->_vista->documento = new DocumentoEspacio();\r\n\r\n /* logica */\r\n $this->_vista->documento->buscar($id);\r\n\r\n // comprobar que el registro exista\r\n if ($this->_vista->documento->getId() == -1) {\r\n $this->redireccionar('error/tipo/Registro_NoExiste');\r\n }\r\n\r\n //lista\r\n $this->_vista->listaTiposDocumento = $this->_vista->documento->getTipoDocumento()->lista();\r\n\r\n $this->_vista->render('documentoEspacio/editar');\r\n }",
"function prepara_Ver_DocumentoSinFila($aDatos, $sCodigo)\n {\n require_once 'Manejador_Base_Datos.class.php';\n $oBaseDatos = new Manejador_Base_Datos($_SESSION['login'], $_SESSION['pass'], $_SESSION['db']);\n\n $oBaseDatos->iniciar_Consulta('SELECT');\n $oBaseDatos->construir_Campos(array('tipo_documento'));\n $oBaseDatos->construir_Tablas(array('documentos'));\n $oBaseDatos->construir_Where(array('id=' . $aDatos[0]));\n\n $oBaseDatos->consulta();\n $aIterador = $oBaseDatos->coger_Fila();\n\n $oBaseDatos->iniciar_Consulta('SELECT');\n $oBaseDatos->construir_Campos(array('internoexterno'));\n $oBaseDatos->construir_Tablas(array('tipo_documento'));\n $oBaseDatos->construir_Where(array('id=' . $aIterador[0]));\n\n $oBaseDatos->consulta();\n\n $aIterador = $oBaseDatos->coger_Fila();\n if ($aIterador[0] == 'interno') {\n $aParametros['accion'] = 'editor:documento:editor:ver';\n $aParametros['iddoc'] = $aDatos[0];\n return ($aParametros);\n } else {\n return (array('accion' => $sCodigo, 'id' => $aDatos[0]));\n }\n }",
"public function updateTipoDocumento($id, $tipodocumento, $descripcion, $vigencia, $duracion, $obligatoriedad, $sesion, $fecha) {\n try {\n DB::update('UPDATE doc_tiposdocumentos SET id_session=?, updated_at=?, detalle_tipodocumento=?, descripcion_tipodocumento=?, vigencia_tipodocumento=?,\n duracion_tipodocumento=?, obligatoriedad_tipodocumento=? WHERE id_tipodocumento=?' , array($sesion, $fecha, $tipodocumento, $descripcion, $vigencia, $duracion, $obligatoriedad, $id));\n return true;\n }catch (Exception $e) {\n return false;\n } \n }",
"public function edit(tipoNota $tipoNota)\n {\n //\n }",
"function editar( $id, $campos=null ) {\r\n global $link;\r\n loadClasses('Producto');\r\n global $Producto;\r\n \r\n // edicion de datos\r\n //datos basicos \r\n $duenio = escapeSQLFull($campos['duenio']);\r\n $cliente_cuen = escapeSQLFull($campos['registro']['cuen']);\r\n $cliente_dni = escapeSQLFull($campos['registro']['dni']);\r\n $cliente_nombre = escapeSQLFull($campos['registro']['nombre']);\r\n $cliente_apellido = escapeSQLFull($campos['registro']['apellido']);\r\n $cliente_telefono = escapeSQLFull($campos['registro']['cliente_telefono']);\r\n $cliente_celular = escapeSQLFull($campos['registro']['cliente_celular']);\r\n \r\n $cliente_email = escapeSQLFull($campos['registro']['email']);\r\n $id_provincia = escapeSQLFull($campos['registro']['id_provincia']);\r\n $id_canton = escapeSQLFull($campos['registro']['id_canton']);\r\n $parroquia = escapeSQLFull($campos['registro']['parroquia']);\r\n $barrio = escapeSQLFull($campos['registro']['barrio']); \r\n $cliente_calle = escapeSQLFull($campos['registro']['cliente_calle']);\r\n $cliente_calle_numero = escapeSQLFull($campos['registro']['cliente_calle_numero']); \r\n $cliente_calle_secundaria = escapeSQLFull($campos['registro']['cliente_calle_secundaria']); \r\n $cliente_referencia = escapeSQLFull($campos['registro']['cliente_referencia']); \r\n $latitude = escapeSQLFull($campos['latitude']); \r\n $longitude = escapeSQLFull($campos['longitude']); \r\n \r\n // COCINA \r\n $id_producto = escapeSQLFull($campos['registro']['id_producto']); \r\n $marca = escapeSQLFull($campos['registro']['marca']);\r\n $modelo = escapeSQLFull($campos['registro']['modelo']);\r\n $color = escapeSQLFull($campos['registro']['color']);\r\n \r\n // obtiene el modelo con el id\r\n $arrModelo = $Producto->obtener_modelo($modelo);\r\n $arrMarca = $Producto->obtener_marca($marca);\r\n \r\n // PAGOS \r\n $cuotas = escapeSQLFull($campos['registro']['cuotas']);\r\n $forma_pago = escapeSQLFull($campos['registro']['forma_pago']);\r\n $promocion = escapeSQLFull($campos['registro']['promocion']);\r\n \r\n // horario \r\n $horario_recepcion = escapeSQLFull($campos['registro']['horario_recepcion']);\r\n\r\n // actualiza los datos\r\n $q = \"UPDATE pedidos SET id_modelo='\".$arrModelo['id'].\"', id_marca='\".$arrMarca['id'].\"', modelo='\".$modelo.\"', marca='\".$marca.\"', color='\".$color.\"', cliente_email='\".$cliente_email.\"', cuota_entrada='\".$cuota_entrada.\"', cliente_cuen='\".$cliente_cuen.\"', duenio='\".$duenio.\"', cliente_dni='\".$cliente_dni.\"', cliente_nombre='\".$cliente_nombre.\"', cliente_apellido='\".$cliente_apellido.\"', cliente_telefono='\".$cliente_telefono.\"', cliente_celular='\".$cliente_celular.\"', id_provincia='\".$id_provincia.\"', id_canton='\".$id_canton.\"', parroquia='\".$parroquia.\"', barrio='\".$barrio.\"', cliente_calle='\".$cliente_calle.\"', cliente_calle_numero='\".$cliente_calle_numero.\"', cliente_calle_secundaria='\".$cliente_calle_secundaria.\"', cliente_referencia='\".$cliente_referencia.\"', latitude='\".$latitude.\"', longitude='\".$longitude.\"', fecha_mod=NOW() WHERE id='\".$id.\"'\";\r\n $r = @mysql_query($q,$link);\r\n }",
"public function documento($datos)\n {\n if ($datos['tipo_documento'] == 'CC') {\n $this->identificador = 1;\n $this->documento = $datos['tipo_documento'] . $datos['documento'];\n }\n if ($datos['tipo_documento'] == 'TI') {\n $this->identificador = 2;\n $this->documento = $datos['tipo_documento'] . $datos['documento'];\n }\n if ($datos['tipo_documento'] == 'CE') {\n $this->identificador = 3;\n $this->documento = $datos['tipo_documento'] . $datos['documento'];\n }\n\n }",
"public function edit(ExpedienteDocument $expedienteDocument)\n {\n //\n }",
"public function EditarTipoDocumento(Request $request, $idTipo)\r\n {\r\n $urlinfo= $request->getPathInfo();\r\n $urlinfo = explode('/'.$idTipo,$urlinfo)[0];//se parte la url para quitarle el parametro y porder consultarla NOTA:provicional mientras se encuentra otra forma\r\n $request->user()->AutorizarUrlRecurso($urlinfo);\r\n $tipoDocumento = $this->TipoDocumentoServicio->ObtenerTipoDocumento($idTipo);\r\n $view = View::make('MSistema/TipoDocumento/editarTipoDocumento', array('tipoDocumento'=>$tipoDocumento));\r\n if($request->ajax()){\r\n $sections = $view->renderSections();\r\n return Response::json($sections['content']);\r\n }else return view('MSistema/TipoDocumento/crearTipoDocumento');\r\n }",
"function edit(Inmueble $objeto) {\n $hoy = date(\"Y-m-d H:i:s\");\n $id = $objeto->getId();\n $parametros['titulo'] = $objeto->getTitulo();\n $parametros[\"descripcion\"] = $objeto->getDescripcion();\n $parametros[\"estado\"] = $objeto->getEstado();\n $parametros[\"precio\"] = $objeto->getPrecio();\n $parametros[\"localidad\"] = $objeto->getLocalidad();\n $parametros[\"provincia\"] = $objeto->getProvincia();\n $parametros[\"tipo\"] = $objeto->getTipo();\n $parametros[\"calle\"] = $objeto->getCalle();\n $parametros[\"superficie\"] = $objeto->getSuperficie();\n $parametros[\"cp\"] = $objeto->getCp();\n $parametros[\"objetivo\"] = $objeto->getObjetivo();\n $parametros[\"fecha\"] = $hoy;\n //Preparamos la consulta\n $sql = \"UPDATE $this->tabla SET titulo = :titulo, descripcion = :descripcion, estado = :estado, precio = :precio, localidad = :localidad, provincia = :provincia, tipo = :tipo, calle = :calle, superficie = :superficie, cp = :cp, objetivo=:objetivo, fecha = :fecha WHERE id = $id\";\n echo $sql;\n $r = $this->bd->setConsulta($sql, $parametros);\n if (!$r) {\n return $this->bd->getError();\n } else {\n return $this->bd->getNumeroFilas();\n }\n $bd->closeConsulta();\n }",
"static public function mdlMostrarTipoDocumento($tabla,$item,$valor){\n\t\t$db = new Conexion();\n\t\tif($item != null){\n\t\t\t$sql = $db->consulta(\"SELECT cod_tipo_documento,dsc_tipo_documento FROM $tabla WHERE $item = '$valor'\");\n\t\t\t$datos = arrayMapUtf8Encode($db->recorrer($sql));\n\t\t}else{\n\t\t\t$sql = $db->consulta(\"SELECT cod_tipo_documento,dsc_tipo_documento FROM $tabla\");\n\t\t\t$datos = array();\n\t\t while($key = $db->recorrer($sql)){\n\t\t \t$datos[] = arrayMapUtf8Encode($key);\n\t\t }\n\t\t}\n\t return $datos;\n\t}",
"function editar_formulario($id_usuario_sesion, $tipo_sesion, $usuario_sesion, $id_ef_sesion, $conexion) {\n\n\t$errFlag = false;\n\t$errArr['errorarchivo'] = '';\n\t$idformulario = base64_decode($_GET['idformulario']);\n\t$id_ef = base64_decode($_GET['id_ef']);\n\t//$idusuario = strtolower($idusuario);\n\n\t//VEO SI SE HA HECHO CLICK EN EL BOTON GUARDAR\n\tif(isset($_POST['accionGuardar'])) {\n \n\t\t\n\t\t $validacion = validarPdf('txtArchivo', 2097152, '2 MB', '../file_form', false);\n\t\t\tif($validacion['flag']) {\n\t\t\t\t//SE VALIDO CORRECTAMENTE LA IMAGEN\n\t\t\t\t$archivoServidor = $validacion['archivo'];\n\t\t\t} else {\n\t\t\t\t//EL ARCHIVO NO SE VALIDO\n\t\t\t\t$errArr['errorarchivo'] = $validacion['mensaje'];\n\t\t\t\t$errFlag = true;\n\t\t\t}\n\t \n //VEMOS SI TODO SE VALIDO BIEN\n if($errFlag) {\n //SI HUBIERON ERRORES, MOSTRAMOS EL FORM CON LOS ERRORES\n mostrar_editar_contenido($id_usuario_sesion, $tipo_sesion, $usuario_sesion, $id_ef_sesion, $conexion, $errArr);\n } else {\n //SEGURIDAD\n\t\t\t$titulo = $conexion->real_escape_string($_POST['txtTitulo']);\n\t\t\t$idhome = $conexion->real_escape_string($_POST['idhome']);\n //CARGAMOS LOS DATOS A LA BASE DE DATOS\n $update = \"UPDATE s_sgc_formulario as sf\n\t\t\t inner join s_sgc_home as sh on (sh.id_home=sf.id_home)\n\t\t\t\t\t SET sf.titulo='\".$titulo.\"',\";\n if($archivoServidor!=''){\n if(file_exists('../file_form/'.$_POST['archivoAux']))\n {borra_archivo('../file_form/'.$_POST['archivoAux']);}\n\n $update.=\" sf.archivo='\".$archivoServidor.\"', \";\n }else{\n $update.=\" sf.archivo='\".$_POST['archivoAux'].\"', \";\n }\n $update.=\"sf.id_home='\".$idhome.\"' WHERE sf.id_formulario='\".$idformulario.\"' and sh.id_ef='\".$id_ef.\"';\";\n //echo $update;\n\n if($conexion->query($update) === TRUE){\n $mensaje=\"Se actualizo correctamente los datos del formulario\";\n\t\t\t header('Location: index.php?l=archivos&var='.$_GET['var'].'&op=1&msg='.base64_encode($mensaje));\n\t\t\t exit;\n } else{\n $mensaje=\"Hubo un error al ingresar los datos, consulte con su administrador \".\"\\n \".$conexion->errno.\": \" . $conexion->error;\n\t\t\t header('Location: index.php?l=archivos&var='.$_GET['var'].'&op=2&msg='.base64_encode($mensaje));\n\t\t\t\texit;\n }\n\n }\n\n\t} else {\n\t //MUESTRO FORM PARA EDITAR UNA CATEGORIA\n\t mostrar_editar_contenido($id_usuario_sesion, $tipo_sesion, $usuario_sesion, $id_ef_sesion, $conexion, $errArr);\n\t}\n\t\n}",
"function recepcion_documentacion($id,$campos) {\r\n loadClasses('Producto');\r\n global $link;\r\n global $Producto;\r\n \r\n $ck_factura = ($campos['ck_factura']==1) ? '1' : '0' ; \r\n $pagare = ($campos['ck_pagare']==1) ? '1' : '0' ; \r\n $peticion = ($campos['ck_peticion']==1) ? '1' : '0' ; \r\n $acta_de_entrega = ($campos['ck_acta_de_entrega']==1) ? '1' : '0' ; \r\n $incentivo = ($campos['ck_incentivo']==1) ? '1' : '0' ; \r\n $cedula_dueno = ($campos['ck_cedula_dueno']==1) ? '1' : '0' ; \r\n $cedula_arrendador = ($campos['ck_cedula_arrendador']==1) ? '1' : '0' ; \r\n\r\n $q = \"UPDATE pedidos SET cedula_arrendador='\".$cedula_arrendador.\"', cedula_dueno='\".$cedula_dueno.\"', incentivo='\".$incentivo.\"', pagare='\".$pagare.\"', peticion='\".$peticion.\"',acta_de_entrega='\".$acta_de_entrega.\"', ck_factura='\".$ck_factura.\"', estado='7' WHERE id='\".$id.\"' \";\r\n $r = @mysql_query($q,$link);\r\n \r\n return $r;\r\n }",
"public function setDocumento($documento){\n\t\t$this->documento = $documento;\n\t}",
"public function editarDiagnostico() {\n if(!isRolOKPro(\"profesional\")){\n PRG(\"Rol inadecuado, debes de ser un profesional\");\n }\n \n $id = isset($_POST['idCaso']) ? $_POST['idCaso'] : null;\n $diagnosticoGeneral = isset($_POST['diagnosticoGeneral']) ? $_POST['diagnosticoGeneral'] : null;\n \n $this->load->model('afeccion_model');\n $this->load->model('caso_model');\n $this->load->model('cita_model');\n $this->load->model('sintoma_model');\n $this->load->model('especialidad_model');\n \n $this->caso_model->editarDiagnostico($id, $diagnosticoGeneral);\n $datos['especialidades'] = $this->especialidad_model->getEspecialidades();\n $datos['sintomas'] = $this->sintoma_model->getSintomas();\n $datos['caso'] = $this->caso_model->getCasoById($id);\n $datos['citas'] = $this->cita_model->getCitasByCasoId($id);\n frame($this, 'cita/rProfesional', $datos);\n \n \n }",
"static public function mdlEliminarTipoDocumento($tabla,$datos){\n\t\t$db = new Conexion();\n\t\t$sql = $db->consulta(\"DELETE FROM $tabla WHERE cod_tipo_documento = '\".$datos.\"'\");\n\t\tif($sql){\n\t\t\treturn \"ok\";\n\t\t}else{\n\t\t\treturn \"error\";\n\t\t}\n\t\t$db->liberar($sql);\n $db->cerrar();\n\t}",
"public function edit(Objeto $objeto)\n {\n //\n }",
"public function editar($idPersona){\n\n\t\t\t//validacion de rol\n\t\t\tif($_SESSION[\"rol\"]!=\"administrador\")\n\t\t\t{\n\t\t\t\t// agrego mensaje a arreglo de datos para ser mostrado \n\t\t\t\t$datos['mensaje_advertencia'] ='Usted no tiene permiso para realizar esta acción';\n\t\t\t\t// vuelvo a llamar la misma vista con los datos enviados previamente para que usuario corrija\n\t\t\t\t$this->vista('/paginas/index',$datos);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST' and !isset($datos['mensaje_error'])){\n\t\t\t\t//es un submit y no es la redireccion despues de haber encontrado un error al actualizar el usuario (no existe mensaje de error entre los parametros)\n\t\t\t\t$datos=[\n\t\t\t\t\t'idPersona'\t\t\t=>$idPersona,\t\t\t\t\n\t\t\t\t\t'primerNombre'\t\t=>trim($_POST['primerNombre']),\n\t\t\t\t\t'segundoNombre'\t\t=>trim($_POST['segundoNombre']),\n\t\t\t\t\t'primerApellido'\t=>trim($_POST['primerApellido']),\n\t\t\t\t\t'segundoApellido'\t=>trim($_POST['segundoApellido']),\n\t\t\t\t\t'documentoIdentidad'=>trim($_POST['documentoIdentidad']),\n\t\t\t\t\t'fechaNacimiento'\t=>trim($_POST['fechaNacimiento']),\n\t\t\t\t\t'sexo'\t\t\t\t=>trim($_POST['sexo']),\n\t\t\t\t\t'correo'\t\t\t=>trim($_POST['correo']),\n\t\t\t\t\t'numeroContacto'\t=>trim($_POST['numeroContacto']),\n\t\t\t\t\t'direccion'\t\t\t=>trim($_POST['direccion']),\n\t\t\t\t\t'rol'\t\t\t\t=>trim($_POST['rol']),\n\t\t\t\t\t'estado'\t\t\t=>trim($_POST['estado']),\t\t\t\t\n\t\t\t\t];\n\n\t\t\t\t//SE EJECUTA EL MÉTODO \teditarUsuario() del Modelo Persona.\n\t\t\t\t$id = $this->personaModelo->editarUsuario_x_admin($datos);\n\t\t\t\tif($id==0){\n\n\t\t\t\t\tif ($_POST['contrasena']!='')\n\t\t\t\t\t{\n\t\t\t\t\t\t//validaciones antes de realizar la operacion:\n\t\t\t\t\t\tif($_POST[\"contrasena\"]!=$_POST[\"confi_Contrasena\"])\n\t\t\t\t\t\t{\t\t\t\t\t\n\t\t\t\t\t\t\t// agrego mensaje al arreglo de datos para ser mostrado \n\t\t\t\t\t\t\t$datos['mensaje_error'] ='Las contraseñas no coinciden';\n\t\t\t\t\t\t\t// vuelvo a llamar la misma vista con los datos enviados previamente para que usuario corrija\n\t\t\t\t\t\t\t$this->vista('/perfiles/consultar_admin', $datos);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t$resultado= $this->personaModelo->cambiarContrasena($idPersona, $_POST['contrasena']);\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 ($resultado==0){\n\t\t\t\t\t\t\t$datos=[\t\t\t\t\n\t\t\t\t\t\t\t'mensaje_advertencia'=> 'Perfil Actualizado'\n\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\tredireccionar('/Usuarios/index');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// no se ejecutó el update\n\t\t\t\t\t\t// agrego mensaje a arreglo de datos para ser mostrado \n\t\t\t\t\t\t$datos['mensaje_error'] ='Ocurrió un problema al procesar la solicitud';\n\t\t\t\t\t\t// vuelvo a llamar la misma vista con los datos enviados previamente para que usuario intente de nuevo\n\t\t\t\t\t\t$this->vista('/usuarios/editar', $datos);\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ($id!=0){\n\t \t\t\t\t$datos=[\t\t\t\t\n\t\t\t\t\t\t'mensaje_advertencia'\t\t=> 'Ocurrio un error al procesar la solicitud'\n\t\t\t\t\t];\n \t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// es GET (primera carga del formulario, con datos desde la base de datos), o se esta cargando el formulario de edicion con mensajes de error encontrados al editar el usuario\n\t\t\t\tif(empty($datos)){\n\t\t\t\t\t//si los datos no se enviaron, cargar los datos desde la bd\n\t\t\t\t\t$usuario=$this->personaModelo->obtenerUsuarioId($idPersona);\n\t\t\t\t\t\n\t\t\t\t\t$datos=[\n\t\t\t\t\t\t'idPersona'\t\t\t=> $usuario->idPersona,\t\t\t\t\n\t\t\t\t\t\t'primerNombre'\t\t=> $usuario->primerNombre,\n\t\t\t\t\t\t'segundoNombre'\t\t=> $usuario->segundoNombre,\n\t\t\t\t\t\t'primerApellido'\t=> $usuario->primerApellido,\n\t\t\t\t\t\t'segundoApellido'\t=> $usuario->segundoApellido,\n\t\t\t\t\t\t'documentoIdentidad'=> $usuario->documentoIdentidad,\n\t\t\t\t\t\t'fechaNacimiento'\t=> $usuario->fechaNacimiento,\n\t\t\t\t\t\t'sexo'\t\t\t\t=> $usuario->sexo,\n\t\t\t\t\t\t'correo'\t\t\t=> $usuario->correo,\n\t\t\t\t\t\t'numeroContacto'\t=> $usuario->numeroContacto,\n\t\t\t\t\t\t'direccion'\t\t\t=> $usuario->direccion,\n\t\t\t\t\t\t'rol'\t\t\t\t=> $usuario->rol,\n\t\t\t\t\t\t'contrasena'\t\t=> $usuario->contrasena,\t\n\t\t\t\t\t\t'confi_Contrasena'\t\t=> $usuario->contrasena,\t\t\t\t\t\n\t\t\t\t\t\t'estado'\t\t\t=> $usuario->estado,\t\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t\t//finalmente renderizar a la vista de edicion con los datos sean cargados desde la bd o los enviados por parametros (intento de edicion fallido)\n\t\t\t\t$this->vista('/Usuarios/editar', $datos);\n\t\t\t}\n\t\t\t\n\t\t}",
"function atualizaCodigoInepDocente($oLinha) {\n\n \t$oDaoRechumano = db_utils::getdao('rechumano'); \n $aDadosRechumano = $this->getMatriculasRechumano($oLinha, true);\n \n if ($aDadosRechumano == null) {\n $aDadosRechumano = $this->getMatriculasRechumano($oLinha, false);\n }\n\n if ($aDadosRechumano != null) {\n \t\n $iTam = count($aDadosRechumano);\n\n for ($iCont = 0; $iCont < $iTam; $iCont++) {\n \t\n $oDaoRechumano = db_utils::getdao('rechumano');\n $oDaoRechumano->ed20_i_pais = \"\";\n \n if ($oLinha->inepdocente != \"\") { \n $oDaoRechumano->ed20_i_codigoinep = $oLinha->inepdocente; \n }\t\n \n $oDaoRechumano->ed20_i_codigo = $aDadosRechumano[$iCont]->ed20_i_codigo;\n $oDaoRechumano->alterar($aDadosRechumano[$iCont]->ed20_i_codigo);\n \n if ($oDaoRechumano->erro_status == '0') {\n throw new Exception(\"Erro na alteração dos dados do Rechumano. Erro da classe \".$oDaoRechumano->erro_msg); \n }//fecha o if do erro_status\n \t\n }//fecha o for\n \n } else {//fecha o fi que verifica se os dados rechumano != null\n \t\n $sMsg = \"Docente: [\".$oLinha->inepdocente.\"] \".$oLinha->nomedocente.\" - \".$oLinha->codigodocenteescola; \n $sMsg .= \" não foi encontrado no sistema.\\n\";\n $this->log($sMsg);\n \n }//fecha o else\n \t\n }",
"static public function mdlIngresarDocumento($tabla, $datos){\n\n\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla(tipo_documento,fecha_registro) VALUES (:tipo_documento,SYSDATETIME())\");\n\n\t\t$stmt->bindParam(\":tipo_documento\", $datos, PDO::PARAM_STR);\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"ok\";\n\n\t\t}else{\n\n\t\t\treturn \"error\";\n\t\t\n\t\t}\n\n\t\t$stmt->close();\n\t\t$stmt = null;\n\n\t}",
"static public function ctrEditarDocente(){\n\n\t\tif(isset($_POST[\"editarDocente\"])){\n\n\t\t\tif(preg_match('/^[a-zA-Z0-9ñÑáéíóúÁÉÍÓÚ ]+$/', $_POST[\"editarDocente\"]) &&\n\t\t\t preg_match('/^[0-9]+$/', $_POST[\"editarDocumentoId\"]) &&\n\t\t\t preg_match('/^[^0-9][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[@][a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)*[.][a-zA-Z]{2,4}$/', $_POST[\"editarEmail\"]) && \n\t\t\t preg_match('/^[()\\-0-9 ]+$/', $_POST[\"editarTelefono\"]) && \n\t\t\t preg_match('/^[#\\.\\-a-zA-Z0-9 ]+$/', $_POST[\"editarDireccion\"])){\n\n\t\t\t \t$tabla = \"docentes\";\n\n\t\t\t \t$datos = array(\"id\"=>$_POST[\"idDocente\"],\n\t\t\t \t\t\t\t \"nombre\"=>$_POST[\"editarDocente\"],\n\t\t\t\t\t \"documento\"=>$_POST[\"editarDocumentoId\"],\n\t\t\t\t\t \"email\"=>$_POST[\"editarEmail\"],\n\t\t\t\t\t \"telefono\"=>$_POST[\"editarTelefono\"],\n\t\t\t\t\t \"direccion\"=>$_POST[\"editarDireccion\"],\n\t\t\t\t\t \"fecha_nacimiento\"=>$_POST[\"editarFechaNacimiento\"]);\n\n\t\t\t \t$respuesta = ModeloDocentes::mdlEditarDocente($tabla, $datos);\n\n\t\t\t \tif($respuesta == \"ok\"){\n\n\t\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t title: \"El Docente ha sido cambiado correctamente\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\t\t\twindow.location = \"docentes\";\n\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t</script>';\n\n\t\t\t\t}\n\n\t\t\t}else{\n\n\t\t\t\techo'<script>\n\n\t\t\t\t\tswal({\n\t\t\t\t\t\t type: \"error\",\n\t\t\t\t\t\t title: \"¡El Docente no puede ir vacío o llevar caracteres especiales!\",\n\t\t\t\t\t\t showConfirmButton: true,\n\t\t\t\t\t\t confirmButtonText: \"Cerrar\"\n\t\t\t\t\t\t }).then(function(result){\n\t\t\t\t\t\t\tif (result.value) {\n\n\t\t\t\t\t\t\twindow.location = \"docentes\";\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\n\t\t\t \t</script>';\n\n\n\n\t\t\t}\n\n\t\t}\n\n\t}"
] | [
"0.69961315",
"0.6817616",
"0.68083894",
"0.6747988",
"0.65864325",
"0.6553671",
"0.6528029",
"0.6476417",
"0.64255756",
"0.6264154",
"0.6239998",
"0.6215187",
"0.62047446",
"0.61986935",
"0.61747354",
"0.6135829",
"0.61167324",
"0.61137146",
"0.61116457",
"0.6081443",
"0.60681707",
"0.6065413",
"0.6061622",
"0.60581684",
"0.60442483",
"0.6038572",
"0.6027735",
"0.6022178",
"0.6011628",
"0.6005672"
] | 0.69033 | 1 |
Scope a query to add the unapproved condition. | public function scopeUnapproved($query)
{
return $query->where('approved', -1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function scopeNotApproved($query){\n return $query->where('status','=','NOT APPROVED');\n }",
"public function scopePendingApproval($query)\n {\n return $query->where('approved', 0);\n }",
"public function scopeNotActive($query)\n {\n return $query->where('status', false);\n }",
"public function scopeApproved($query)\n {\n return $query->where('approved', 1);\n }",
"public function scopeApproved($query)\n {\n return $query->where('approved', true);\n }",
"public function scopeInactive($query)\n {\n return $query->where('status', 0);\n }",
"public function scopeOnlyNotAvailable($query)\n {\n return $query->where('status', 'Not available');\n }",
"public function scopeApproved($query)\n {\n return $query->where('status', 'approved');\n }",
"public function scopeInactivecoupon($query){\n return $query->where('status',0);\n}",
"public function scopeUnConfirmed($query)\n {\n return $query;\n }",
"public function scopeActive($query)\n {\n $query = $query->notComplete();\n\n if (is_null(auth()->user()) or \\PanicHDMember::find(auth()->user()->id)->currentLevel() < 2) {\n return $query;\n } else {\n return $query->where('status_id', '!=', Setting::grab('default_status_id'));\n }\n }",
"public function scopePending($query)\n {\n return $query->where('adoption_status', '=', 'pending');\n }",
"public function scopeUnpaid($query) {\n return $query->where('paid', 0);\n }",
"public function scopeRestrict($query) {\n return $query->currentSite()->visibleBy()->status();\n }",
"public function scopeInactive($query)\n {\n return $query->whereStatus(Status::INACTVE);\n\n }",
"public function scopeInactive($query)\n\t{\n\t\treturn $query->where('active', 0);\n\t}",
"public function scopeNonAktif($query)\n {\n return $query->where('status', Mahasiswa::NONAKTIF);\n }",
"public function scopeUnexpired($query)\n {\n $query->where('expires_at', '>', Carbon::now());\n }",
"public function scopeNotOnGracePeriod($query)\n {\n $query->whereNull('ends_at')->orWhere('ends_at', '<=', Carbon::now());\n }",
"public function scopeActive($query)\n {\n return $query->whereNotIn('status', [Statuses::NOT_ACTIVE]);\n }",
"public function scopeOnlyAvailable($query)\n {\n return $query->where('status', 'Available');\n }",
"public function scopeInactive($query)\n {\n return $query->where('active', false);\n }",
"public function scopeNotRequired($query)\n {\n return $query->whereIn('required', [false, 0]);\n }",
"public function scopeInactive($query, $at = null) {\n $at = \\Parse::date($at, true);\n\n $query->whereNull('activated_at')\n ->orWhere('activated_at','>', $at)\n ->orWhere('deactivated_at','<=', $at);\n\n return $query;\n }",
"public function scopeNotCancelled($query)\n {\n $query->whereNull('ends_at');\n }",
"public function scopeActive($query)\n {\n return $query->whereNotNull('submitted_at')->whereNull('withdrawn_at');\n }",
"public function scopeWithoutAdminShops($query)\n {\n $query->where('user_id', '!=', 1);\n }",
"public function scopeNotSold($query)\r\n {\r\n return $query->where('sold', false);\r\n }",
"public function scopeUnlisted($query)\n {\n return $query->where('static_name', self::UNLISTED_ACCESS);\n }",
"public function scopeUnassigned($query)\n {\n return $query->whereNull('visitor_id');\n }"
] | [
"0.77793247",
"0.72327703",
"0.67747146",
"0.6740903",
"0.67000407",
"0.6698669",
"0.66724825",
"0.66705436",
"0.6605599",
"0.65973663",
"0.6592824",
"0.659132",
"0.6574956",
"0.6561734",
"0.6552796",
"0.6550395",
"0.6529454",
"0.65109396",
"0.64970076",
"0.64766246",
"0.6451592",
"0.6427482",
"0.6426817",
"0.6400321",
"0.63887346",
"0.6386006",
"0.63800144",
"0.6365555",
"0.63562506",
"0.63436216"
] | 0.76627326 | 1 |
Scope a query to add the pending approval condition. | public function scopePendingApproval($query)
{
return $query->where('approved', 0);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function scopePending($query)\n {\n return $query->where('adoption_status', '=', 'pending');\n }",
"public function scopePending($query, $pending)\n {\n if ($pending != null)\n {\n if ($pending)\n return $query->whereNull('accepted_at');\n return $query->whereNotNull('accepted_at');\n }\n return $query;\n }",
"public function scopePending($query)\n {\n return $query->where('status', 'pending');\n }",
"public function scopeApproved($query)\n {\n return $query->where('status', 'approved');\n }",
"public function scopeActive($query)\n {\n return $query->where('status', 'Pending');\n }",
"public function scopeApproved($query)\n {\n return $query->where('approved', true);\n }",
"public function scopeApproved($query)\n {\n return $query->where('approved', 1);\n }",
"public function scopePending($query)\n {\n return $query->whereStatus('I');\n }",
"public function scopeNotApproved($query){\n return $query->where('status','=','NOT APPROVED');\n }",
"public function scopeApproveStatus(Builder $query, int $status): Builder {\n return $query->where('approve_status', $status);\n }",
"public function scopePending($query): void\n {\n $query->withoutGlobalScope('executed');\n\n $query->whereNull('executed_at');\n }",
"public function scopePaid($query)\n {\n return $query->where('state', 1);\n }",
"public function scopeActive($query)\n {\n $query->whereNull('ends_at')->orWhere(function ($query) {\n $query->onGracePeriod();\n });\n }",
"public function scopeActive($query)\n {\n $query = $query->notComplete();\n\n if (is_null(auth()->user()) or \\PanicHDMember::find(auth()->user()->id)->currentLevel() < 2) {\n return $query;\n } else {\n return $query->where('status_id', '!=', Setting::grab('default_status_id'));\n }\n }",
"public function scopeApproved($query, int $value)\n {\n return $query->where('approved_' . LANG(), $value);\n }",
"public function actionApprovalPending()\n {\n $searchModel = new OrganizationSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n $query = Organization::find()->isAprovalPending();\n\n //custom data provider\n $dataProvider = new ActiveDataProvider([\n 'query' => $query,\n 'pagination' => [\n 'pageSize' => 10,\n ],\n 'sort' => [\n 'defaultOrder' => [\n 'name' => SORT_ASC,\n ]\n ],\n ]);\n\n return $this->render('approval-pending', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function scopePaid($query)\n {\n return $query->where('paid', 1);\n }",
"public function scopeActive($query)\n {\n $query->where('status', static::PUBLISHED);\n }",
"public function scopePending($query,$nim){\n return $query->join('kp','kp.id','=','kp_seminar.kp_id')\n ->join('ref_mahasiswa','ref_mahasiswa.id','=','kp.mahasiswa_id')\n ->join('ref_ruang','kp_seminar.ruang_id','=','ref_ruang.id')\n ->where('nim',$nim)\n ->where('status_kp','SETUJU')\n ->where('status_seminarkp','PENDING')\n ->select('*','kp_seminar.id','kp.sks','kp.ipk');\n }",
"public function scopeActive($query)\n {\n return $query->whereNotNull('submitted_at')->whereNull('withdrawn_at');\n }",
"public static function pending()\n\t{\n\t\treturn Approval::where('approved', '=', 'PENDING')\n\t\t\t\t\t\t->where('approver_id', '=', Auth::user()->id)\n\t\t\t\t\t\t->get();\n\n\t}",
"public function scopeOnGracePeriod($query)\n {\n $query->whereNotNull('ends_at')->where('ends_at', '>', Carbon::now());\n }",
"public function scopeActive($query)\n {\n return $query->where('status',1);\n }",
"function request_approval($ap_type_id, $user_no) {\n $res = false;\n $this->get_approvals();\n // Do we have a record loaded for this type?..\n if (isset($this->approvals[$ap_type_id])) {\n $approval = $this->approvals[$ap_type_id];\n // Can't use it if already been approved..\n if ($approval->approval_datetime != \"\") {\n $approval = new qa_project_approval($this->project_id);\n }\n }\n else {\n $approval = new qa_project_approval($this->project_id);\n }\n // Initialise it if it is new..\n if ($approval->qa_approval_id == 0) {\n $approval->qa_step_id = $this->qa_step_id;\n $approval->qa_approval_type_id = $ap_type_id;\n }\n // Assign the data..\n $approval->approval_status = \"p\"; // In Progress\n $approval->assigned_to_usr = $user_no;\n $approval->assigned_datetime = date('Y-m-d H:i:s');\n $approval->approval_by_usr = \"\";\n $approval->approval_datetime = \"\";\n $approval->comment = \"\";\n\n // Now save it. This will insert a new record if necessary..\n $qry = new PgQuery(\"BEGIN\");\n $ok = $qry->Exec(\"qa_project_step::request_approval\");\n if ($ok) {\n // Save/create the approval record..\n $ok = $approval->save();\n if ($ok) {\n // Save last approval status..\n $q = \"UPDATE qa_project_step_approval SET \";\n $q .= \" last_approval_status='p'\";\n $q .= \" WHERE project_id=$this->project_id\";\n $q .= \" AND qa_step_id=$this->qa_step_id\";\n $q .= \" AND qa_approval_type_id=$ap_type_id\";\n $qry = new PgQuery($q);\n $ok = $qry->Exec(\"qa_project_step::request_approval\");\n }\n if ($ok) {\n // Save current QA phase to project record..\n $q = \"UPDATE request_project SET\";\n $q .= \" qa_phase='$this->qa_phase'\";\n $q .= \" WHERE request_id=$this->project_id\";\n $qry = new PgQuery($q);\n $ok = $qry->Exec(\"qa_project_step::request_approval\");\n }\n $qry = new PgQuery(($ok ? \"COMMIT;\" : \"ROLLBACK;\"));\n $res = $qry->Exec(\"qa_project_step::request_approval\");\n\n // Forced-refresh locally..\n $this->get_approvals(true);\n $this->get_approvals_required(true);\n }\n return $res;\n\n }",
"public function scopeInactivecoupon($query){\n return $query->where('status',0);\n}",
"public static function scopeActive($query)\n {\n \treturn $query->whereStatus('Active');\n }",
"public function scopeProvider($query)\n {\n return $query->where('type_persona', 1)\n ->where('status', 1);\n }",
"public function scopeAwardedProjects($query)\n {\n $query->where('awarded', true);\n }",
"public function scopeActive($query)\n {\n return $query->where('status', 1);\n }",
"public function scopeActive($query)\n {\n return $query->where('status', 1);\n }"
] | [
"0.71452695",
"0.69197005",
"0.68890184",
"0.6800627",
"0.6756905",
"0.6744173",
"0.6731754",
"0.6713356",
"0.66871274",
"0.64691424",
"0.6271736",
"0.62656677",
"0.6242801",
"0.61840165",
"0.61701125",
"0.6154631",
"0.6141367",
"0.61021906",
"0.60826445",
"0.6059875",
"0.6042481",
"0.60181284",
"0.59490407",
"0.5943364",
"0.5929307",
"0.590387",
"0.5891132",
"0.58836454",
"0.5874754",
"0.5874754"
] | 0.772666 | 0 |
Creates a Psr7 Request for the mysterious API, from a resource endpoint. | public static function getRequest(string $endpoint): Request
{
return new Request('GET', "https://b-viguier.github.io/Afup-Workshop-Async/api$endpoint");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getResourcesRequest()\n {\n\n $resourcePath = '/v1/resources';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/links+json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/links+json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // // this endpoint requires Bearer token\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function createRequest(string $method, $uri): RequestInterface;",
"protected function makeApiRequest($resource, $method = 'GET', $body = array(), $extraHeaders = array())\n {\n /** @var Stopwatch $timer */\n $timer = new Stopwatch();\n $timer->start('API Request', 'Jawbone UP API');\n\n $path = $resource;\n\n if ($method == 'GET' && !empty($body)) {\n $path .= '?' . http_build_query($body);\n $body = array();\n }\n\n try\n {\n $response = $this->service->request($path, $method, $body, $extraHeaders);\n }\n catch (\\Exception $e)\n {\n throw new JawboneException('The service request failed.', 401, $e);\n }\n\n try\n {\n $response = $this->parseResponse($response);\n }\n catch (\\Exception $e)\n {\n throw new JawboneException('The response from Jawbone UP could not be interpreted.', 402, $e);\n }\n $timer->stop('API Request');\n return $response;\n }",
"protected function siteGetGendersRequest(): \\GuzzleHttp\\Psr7\\Request\n {\n\n $resourcePath = '/public/v6/site/genders';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'multipart/form-data']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'multipart/form-data'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = Utils::jsonEncode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = Utils::jsonEncode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('authorization');\n if ($apiKey !== null) {\n $headers['authorization'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('siteId');\n if ($apiKey !== null) {\n $headers['siteId'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function getEventRequest(): Request\n {\n $contentType = self::contentTypes['getEvent'];\n\n $resourcePath = '/v3/ca/promotion/events';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n $method = 'GET';\n\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n $contentType,\n $multipart\n );\n\n $defaultHeaders = parent::getDefaultHeaders();\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n // for model (json/xml)\n if (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 } elseif (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n $query = ObjectSerializer::buildQuery($queryParams);\n $requestInfo = [\n 'path' => $resourcePath,\n 'method' => $method,\n 'timestamp' => $defaultHeaders['WM_SEC.TIMESTAMP'],\n 'query' => $query,\n ];\n\n $signatureApiKey = $this->config->getApiKey('signature', $requestInfo);\n if ($signatureApiKey !== null) {\n $headers['WM_SEC.AUTH_SIGNATURE'] = $signatureApiKey;\n }\n\n $consumerIdApiKey = $this->config->getApiKey('consumerId', $requestInfo);\n if ($consumerIdApiKey !== null) {\n $headers['WM_CONSUMER.ID'] = $consumerIdApiKey;\n }\n\n $channelTypeApiKey = $this->config->getApiKey('channelType', $requestInfo);\n if ($channelTypeApiKey !== null) {\n $headers['WM_CONSUMER.CHANNEL.TYPE'] = $channelTypeApiKey;\n }\n\n $operationHost = $this->config->getHost();\n return new Request(\n $method,\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function getRequest(stdClass $sanitized_input = null):Request;",
"public function request(string $method, string $uri, array $options = []): ResourceInterface\n {\n }",
"public function request()\n {\n return new GuzzleHttp\\Psr7\\Request('GET', 'Persons/'.$this->id);\n }",
"public function getObjectRequest()\n {\n\n $resourcePath = '/authentication';\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 []\n );\n }\n\n // for model (json/xml)\n if (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 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"function drewlabs_create_psr7_request(Request $request = null)\n {\n $request = $request ?? ServerRequest::createFromServerGlobals();\n $psr17Factory = new Psr17Factory();\n $psrHttpFactory = new PsrRequestFactory($psr17Factory, $psr17Factory, $psr17Factory);\n return $psrHttpFactory->create($request);\n }",
"private function createRequest() {\n $req = new GraphRequest();\n $req->setUrl(Paths::getRelativeRequestUrl());\n $req->setIp($_SERVER['REMOTE_ADDR']);\n $req->setMethod($_SERVER['REQUEST_METHOD']);\n if (count($_POST) > 0 || count($_FILES) > 0) {\n $tree = $this->treeFromFlat(array_merge($_FILES,$_POST,$_GET));\n $req->setData($tree);\n } else {\n $jsonData = json_decode(file_get_contents(\"php://input\"),true);\n if ($jsonData === null) {\n $jsonData = [];\n }\n $req->setData(array_merge($this->treeFromFlat($_GET),$jsonData));\n }\n $headers = apache_request_headers();\n foreach ($headers as $header => $value) {\n $req->setHeader($header,$value);\n }\n\n $this->pushRequest($req);\n }",
"protected function pingRequest()\n {\n\n $resourcePath = '/v4/auth/ping';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['text/plain']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['text/plain'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function toRequest(): Request\n {\n // Create URI\n $uri = new Uri(sprintf($this->uriTemplate, $this->credentials->getShop()));\n\n // Create request\n return new Request(\n $this->httpMethod,\n $uri,\n $this->headers\n );\n }",
"protected function getSymbolsRequest()\n {\n\n $resourcePath = '/symbols';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-API-Token');\n if ($apiKey !== null) {\n $headers['X-API-Token'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function request(string $method, string $url, array $headers = [], string $body = ''): ResponseInterface;",
"protected function getOpenIdAuthResourcesRequest()\n {\n\n $resourcePath = '/v4/auth/openid/resources';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json;charset=UTF-8']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json;charset=UTF-8'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public static function ngRestApiEndpoint();",
"public function makeRequest ()\n {\n /**\n * Holds JWT given by headers\n */\n $jwt = null;\n if ($this->doesNeedToken())\n {\n /*\n * if token should be present, we'll try to get it from headers\n * and then validate it -> otherwise we'll raise 401 error code\n */\n if (isset($_SERVER['Authorization']))\n {\n $bearer = explode(\" \", $_SERVER['Authorization']);\n $jwt = $this->validateAndDecodeToken($bearer[1]);\n }\n elseif (getallheaders()['Authorization'])\n {\n $bearer = explode(\" \", getallheaders()['Authorization']);\n $jwt = $this->validateAndDecodeToken($bearer[1]);\n }\n else\n {\n header('WWW-Authenticate: Bearer realm=\"protected area\"');\n response(401, \"Authorization Required\", null);\n }\n }\n // includes API's class file and initializes new instance of it\n include_once './resources/api.php';\n $api = new Api(\n $this->method, $this->object,\n $this->ID, $this->subject,\n $this->subjectID, $jwt\n );\n\n //\n //\n //\n // TO-DO: not all of these methods might actually be useful\n //\n //\n //\n switch ($this->method)\n {\n case 'GET':\n case 'POST':\n case 'PUT':\n case 'DELETE':\n $this->apiPerformance($api);\n break;\n default:\n response(405, 'Method Not Allowed', null);\n }\n }",
"public function resource()\n\t{\n\t\tif (!$this->serverLib->server->verifyResourceRequest(OAuth2\\Request::createFromGlobals())) {\n\t\t\t$this->serverLib->server->getResponse()->send();\n\t\t\tdie;\n\t\t}\n\t\techo json_encode(array('success' => true, 'message' => 'You accessed my APIs!'));\n\t}",
"public function availableOperationsRequest()\n {\n\n $resourcePath = '/user';\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 []\n );\n }\n\n // for model (json/xml)\n if (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 'OPTIONS',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function test_psr7_request(): void {\n\t\t$http = new HTTP();\n\t\t$request = $http->psr7_request(\n\t\t\t'GET',\n\t\t\t'https://google.com'\n\t\t);\n\n\t\t$this->assertInstanceOf( RequestInterface::class, $request );\n\t\t$this->assertEquals( 'GET', $request->getMethod() );\n\t\t$this->assertInstanceOf( UriInterface::class, $request->getUri() );\n\t\t$this->assertEquals( 'google.com', $request->getUri()->getHost() );\n\t}",
"public function rest($endpoint) {\n\n }",
"public function getWebhooksRequest()\n {\n\n $resourcePath = '/webhooks';\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 []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('api-key');\n if ($apiKey !== null) {\n $headers['api-key'] = $apiKey;\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 $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function getTemplatesRequest()\n {\n\n $resourcePath = '/templates';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires Bearer (JWT) authentication (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function siteGetActivationCodeRequest(): \\GuzzleHttp\\Psr7\\Request\n {\n\n $resourcePath = '/public/v6/site/activationcode';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'multipart/form-data']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json', 'text/json', 'application/xml', 'text/xml', 'multipart/form-data'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n \n if($headers['Content-Type'] === 'application/json') {\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass) {\n $httpBody = Utils::jsonEncode($httpBody);\n }\n // array has no __toString(), so we should encode it manually\n if(is_array($httpBody)) {\n $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($httpBody));\n }\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = Utils::jsonEncode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\Query::build($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('API-Key');\n if ($apiKey !== null) {\n $headers['API-Key'] = $apiKey;\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('authorization');\n if ($apiKey !== null) {\n $headers['authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\Query::build($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"protected function createApiKeyRequest($api_key_body)\n {\n // verify the required parameter 'api_key_body' is set\n if ($api_key_body === null || (is_array($api_key_body) && count($api_key_body) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $api_key_body when calling createApiKey'\n );\n }\n\n $resourcePath = '/users/me/api_keys';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n // body params\n $_tempBody = null;\n if (isset($api_key_body)) {\n $_tempBody = $api_key_body;\n }\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n ['application/json']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public static function fromUserRequest() {\n $url = explode('?', $_SERVER['REQUEST_URI'])[0];\n return new Request($url, $_GET, $_POST, $_FILES);\n }",
"public function getRequest() {}",
"protected function getTickersRequest()\n {\n\n $resourcePath = '/tickers';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('X-API-Token');\n if ($apiKey !== null) {\n $headers['X-API-Token'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }",
"public function testBuildRequestUrl()\n {\n $api = new PingdomApi('user', 'password', 'api_key');\n // Create a mock subscriber and queue a response.\n $mockResponse = new Response(200);\n $mockResponseBody = \\GuzzleHttp\\Stream\\Stream::factory('{}');\n $mockResponse->setBody($mockResponseBody);\n $mock = new Mock([\n $mockResponse,\n ]);\n $api->getClient()->getEmitter()->attach($mock);\n\n $parameters = array(\n 'bool_true' => true,\n 'bool_false' => false,\n 'int_true' => 1,\n 'int_false' => 0,\n );\n $api->request('GET', 'resource', $parameters);\n $expected = 'https://api.pingdom.com/api/2.0/resource?bool_true=true&bool_false=false&int_true=1&int_false=0';\n $this->assertSame($api->getLastResponse()->getEffectiveUrl(), $expected);\n }"
] | [
"0.62912214",
"0.60649335",
"0.60220414",
"0.58643097",
"0.57895267",
"0.56693816",
"0.565977",
"0.563188",
"0.5590737",
"0.5585484",
"0.55660915",
"0.55634874",
"0.5560671",
"0.5560075",
"0.55542415",
"0.55209476",
"0.5511118",
"0.5486641",
"0.5475525",
"0.54750437",
"0.54669946",
"0.54385525",
"0.54339504",
"0.54184073",
"0.5414671",
"0.53892195",
"0.53887534",
"0.53880966",
"0.5382307",
"0.5374844"
] | 0.6141064 | 1 |
Tru so luong trong kho $type = "" Cong so luong trong kho $type = "+" $listid : danh sach cac id product $listnum : danh sach so luong tuong ung product_number_order() | function product_number_order($listid, $listnum, $listgroup, $type = '-')
{
global $db_config, $db, $module_data;
foreach ($listid as $i => $id) {
if ($id > 0) {
if (empty($listnum[$i])) {
$listnum[$i] = 0;
}
$sql = 'UPDATE ' . $db_config['prefix'] . '_' . $module_data . '_rows SET product_number = product_number ' . $type . ' ' . intval($listnum[$i]) . ' WHERE id =' . $id;
$db->query($sql);
if (!empty($listgroup)) {
$sql = 'UPDATE ' . $db_config['prefix'] . '_' . $module_data . '_group_quantity SET quantity = quantity ' . $type . ' ' . intval($listnum[$i]) . ' WHERE pro_id =' . $id . ' AND listgroup=' . $db->quote($listgroup[$i]);
$db->query($sql);
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function add_price_list($product_id, $access_id, $line){\r\n //$counter is category id\r\n \r\n //add distributor price list\r\n $vals = array(\"exGST\"=>$line[8],\r\n \"incGST\"=>$line[9],\r\n \"cate_fk\"=>$this->cate_size,\r\n \"product_type_fk\"=>$this->product_type_size,\r\n \"dealer_type_fk\"=>\"1\",\r\n \"product_fk\"=>$product_id,\r\n \"access_fk\"=>$access_id);\r\n $this->obj_con->insert('nec_price_list',$vals);\r\n \r\n //add key partner price list\r\n $vals = array(\"exGST\"=>$line[10],\r\n \"incGST\"=>$line[11],\r\n \"cate_fk\"=>$this->cate_size,\r\n \"product_type_fk\"=>$this->product_type_size,\r\n \"dealer_type_fk\"=>\"2\",\r\n \"product_fk\"=>$product_id,\r\n \"access_fk\"=>$access_id);\r\n $this->obj_con->insert('nec_price_list',$vals);\r\n \r\n //add pro av price list\r\n $vals = array(\"exGST\"=>$line[12],\r\n \"incGST\"=>$line[13],\r\n \"cate_fk\"=>$this->cate_size,\r\n \"product_type_fk\"=>$this->product_type_size,\r\n \"dealer_type_fk\"=>\"3\",\r\n \"product_fk\"=>$product_id,\r\n \"access_fk\"=>$access_id);\r\n $this->obj_con->insert('nec_price_list',$vals);\r\n \r\n //add gov price list\r\n $vals = array(\"exGST\"=>$line[14],\r\n \"incGST\"=>$line[15],\r\n \"cate_fk\"=>$this->cate_size,\r\n \"product_type_fk\"=>$this->product_type_size,\r\n \"dealer_type_fk\"=>\"4\",\r\n \"product_fk\"=>$product_id,\r\n \"access_fk\"=>$access_id);\r\n $this->obj_con->insert('nec_price_list',$vals);\r\n \r\n //add wholesale 1 price list\r\n $vals = array(\"exGST\"=>$line[16],\r\n \"incGST\"=>$line[17],\r\n \"cate_fk\"=>$this->cate_size,\r\n \"product_type_fk\"=>$this->product_type_size,\r\n \"dealer_type_fk\"=>\"5\",\r\n \"product_fk\"=>$product_id,\r\n \"access_fk\"=>$access_id);\r\n $this->obj_con->insert('nec_price_list',$vals);\r\n \r\n //add wholesale 2 price list\r\n $vals = array(\"exGST\"=>$line[18],\r\n \"incGST\"=>$line[19],\r\n \"cate_fk\"=>$this->cate_size,\r\n \"product_type_fk\"=>$this->product_type_size,\r\n \"dealer_type_fk\"=>\"6\",\r\n \"product_fk\"=>$product_id,\r\n \"access_fk\"=>$access_id);\r\n $this->obj_con->insert('nec_price_list',$vals);\r\n \r\n //add h/norman comm price list\r\n $vals = array(\"exGST\"=>$line[20],\r\n \"incGST\"=>$line[21],\r\n \"cate_fk\"=>$this->cate_size,\r\n \"product_type_fk\"=>$this->product_type_size,\r\n \"dealer_type_fk\"=>\"7\",\r\n \"product_fk\"=>$product_id,\r\n \"access_fk\"=>$access_id);\r\n $this->obj_con->insert('nec_price_list',$vals);\r\n \r\n //add int vision price list\r\n $vals = array(\"exGST\"=>$line[22],\r\n \"incGST\"=>$line[23],\r\n \"cate_fk\"=>$this->cate_size,\r\n \"product_type_fk\"=>$this->product_type_size,\r\n \"dealer_type_fk\"=>\"8\",\r\n \"product_fk\"=>$product_id,\r\n \"access_fk\"=>$access_id);\r\n $this->obj_con->insert('nec_price_list',$vals);\r\n \r\n //add RRP price list\r\n $vals = array(\"exGST\"=>\"0\",\r\n \"incGST\"=>$line[24],\r\n \"cate_fk\"=>$this->cate_size,\r\n \"product_type_fk\"=>$this->product_type_size,\r\n \"dealer_type_fk\"=>\"9\",\r\n \"product_fk\"=>$product_id,\r\n \"access_fk\"=>$access_id);\r\n $this->obj_con->insert('nec_price_list',$vals);\r\n }",
"function setOrderedProduct()\r\n{\r\n\tglobal $DB, $objComm, $FBPanel;\r\n\t$data=$_REQUEST[\"orderedProduct\"];\r\n\t$_SESSION[\"fb_id\"]=$fb_id=$FBPanel->panelGetUser();\r\n\t$datumFacebook=$DB->fetchOne(\"SELECT * FROM facebook WHERE facebook.fb_id='\".$fb_id.\"'\",\"\");\t\t\r\n\t$insertData[\"pi_transaction_id\"]=0;\r\n\t$insertData[\"pi_purchaser_id\"]=$fb_id;\r\n\t$insertData[\"pi_invoice_number\"]=\"INC\".time();\r\n\t$insertData[\"pi_purchaser_name\"]=$datumFacebook->fb_name;\r\n\t$insertData[\"pi_purchaser_email\"]=$datumFacebook->fb_email;\r\n\t$insertData[\"pi_purchaser_contact\"]=$datumFacebook->fb_phone;\r\n\t$insertData[\"pi_purchaser_address\"]=$datumFacebook->fb_location;\r\n\t\r\n\t\r\n\t$insertData[\"pi_date\"]=date(\"Y-m-d H:i:s\");\r\n\t$_SESSION[\"porder_pi_id\"]=$porder_pi_id=$DB->addNewRecord(\"product_invoice\",$insertData,\"\"); \r\n\t\r\n\tforeach($data as $datum)\r\n\t{\t\t\r\n\t\t$insertNData[\"porder_pi_id\"]=$porder_pi_id;\r\n\t\t$insertNData[\"porder_product_id\"]=$datum[\"porder_product_id\"];\t\t\r\n\t\t$insertNData[\"porder_product_name\"]=$datum[\"porder_product_name\"];\r\n\t\t$insertNData[\"porder_product_qty\"]=$datum[\"porder_product_qty\"];\r\n\t\t$insertNData[\"porder_product_price\"]=$datum[\"porder_product_price\"];\r\n\t\t$insertNData[\"porder_product_discount\"]=$datum[\"porder_product_discount\"];\r\n\t\t$insertNData[\"porder_product_tax\"]=$datum[\"porder_product_tax\"];\r\n\t\t$insertNData[\"porder_product_paid_amount\"]=$datum[\"porder_product_paid_amount\"];\r\n\t\t$response=$DB->addNewRecord(\"product_order\",$insertNData,\"\");\r\n\t}\t\r\n\t\r\n\t$status=($response) ? \"OK\" : \"ERROR\";\r\n\techo json_encode(array(\"status\"=>$status));\r\n}",
"function methtml_product($listtype,$type,$titlenum,$paranum,$detail,$feedback,$time,$hits,$newwindow=1,$desription,$desnum,$classname,$news,$hot,$top,$listnav=1,$max,$topcolor){\n global $product_list,$product_list_com,$product_list_img,$product_class,$lang_Colunm,$lang_Hits,$lang_UpdateTime,$lang_Title,$lang_Detail,$lang_Buy,$lang_ProductTitle;\n global $product_paralist,$met_img_x,$met_img_y,$addfeedback_url,$met_product_page;\n global $class1,$class2,$class3,$nav_list2,$nav_list3,$class_list,$module_list1,$search,$metblank;\n $listarray=($type=='new')?$product_list_new:(($type=='com')?$product_list_com:$product_list);\n $metproductok=0;\n if($met_product_page && $listtype=='img' &&($search<>'search')){\n if($class2 && count($nav_list3[$class2])&& (!$class3) ){\n $listarray=$nav_list3[$class2];\n\t $metproductok=1;\n\t}elseif((!$class2) && count($nav_list2[$class1]) && $class1 && (!$class3)){\n\t $listarray=$nav_list2[$class1];\n\t $metproductok=1;\n\t}elseif($class_list[$class1][module]==100){\n $listarray=$module_list1[3];\n\t $metproductok=1;\n }}\n $listtext.=\"<ul>\\n\";\n if($listtype=='text' or $listtype==''){\n if($listnav==1){\n $listtext.=\"<li class='product_list_title'>\";\n if($classname==1)$listtext.=\"<span class='info_class' >[\".$lang_Colunm.\"]</span>\"; \n\t$listtext.=\"<span class='info_title'>\".$lang_ProductTitle.\"</span>\";\n $i=0;\n foreach($product_paralist as $key=>$val1){\n $i++;\n\tif($i>$paranum)break;\n $listtext.=\"<span class='info_para\".$i.\"'>\".$val1[name].\"</span>\";\n }\n if($hits==1)$listtext.=\"<span class='info_hits'>\".$lang_Hits.\"</span>\";\n\tif($time==1)$listtext.=\"<span class='info_updatetime'>\".$lang_UpdateTime.\"</span>\";\n\tif($detail==1)$listtext.=\"<span class='info_detail'>\".$lang_Detail.\"</span>\";\n\tif($feedback==1)$listtext.=\"<span class='info_feedback'>\".$lang_Buy.\"</span>\";\n\t$listtext.=\"</li>\\n\";\n }\n }\n $i=0;\n foreach($listarray as $key=>$val){\n $val[title]=($val[title]=='')?$val[name]:$val[title];\n $val[name]=($val[name]=='')?$val[title]:$val[name];\n $addfeedback_url1=$addfeedback_url.$val[title];\n $i++;\n if(intval($titlenum)<>0)$val[title]=utf8substr($val[title], 0, $titlenum); \n if(intval($desnum)<>0)$val[description]=utf8substr($val[description], 0, $desnum); \n $listtext.=\"<li>\";\nif($listtype=='img'){\n $listtext.=\"<span class='info_img' ><a href='\".$val[url].\"' title='\".$val[name].\"'\";\n if($metproductok){\n $listtext.=\" \".$val[new_windows].\"><img src=\".$val[columnimg].\" alt='\".$val[name].\"' title='\".$val[name].\"' width='\".$met_img_x.\"' height='\".$met_img_y.\"' /></a></span>\";\n $listtext.=\"<span class='info_title' ><a title='\".$val[name].\"' href=\".$val[url].\" \".$val[new_windows].\" >\".$val[name].\"</a></span>\";\n \n if($paranum)$listtext.=\"<span class='info_description' ><a title='\".$val[name].\"' href=\".$val[url].\" \".$val[new_windows].\" >\".$val[description].\"</a></span>\";\n if($detail==1)$listtext.=\"<span class='info_detail' ><a href=\".$val[url].\" \".$val[new_windows].\" >\".$lang_Detail.\"</a></span>\";\n if($feedback==1)$listtext.=\"<span class='info_feedback'><a href='\".$addfeedback_url1.\"' >\".$lang_Buy.\"</a></span>\";\n }else{\n if($newwindow==1)$listtext.=\" target='_blank' \";\n $listtext.=\" ><img src=\".$val[imgurls].\" alt='\".$val[title].\"' title='\".$val[title].\"' width='\".$met_img_x.\"' height='\".$met_img_y.\"' /></a></span>\";\n if($classname==1)$listtext.=\"<span class='info_class' ><a href='\".$val[classurl].\"' title='\".$val[classname].\"' >[\".$val[classname].\"]</a></span>\";\n $listtext.=\"<span class='info_title' ><a title='\".$val[title].\"' href=\".$val[url];\n if($newwindow==1)$listtext.=\" target='_blank' \";\n if($val[top_ok]==1)$listtext.=\"style='color:\".$topcolor.\";'\";\n $listtext.=\">\".$val[title].\"</a></span>\";\n if($desription==1 && $val[description]){\n $listtext.=\"<span class='info_description' ><a title='\".$val[title].\"' href=\".$val[url];\n if($newwindow==1)$listtext.=\" target='_blank' \";\n $listtext.=\">\".$val[description].\"</a></span>\"; \n }\n $j=0;\n foreach($product_paralist as $key=>$val1){\n $j++;\n if($j>$paranum)break;\n $listtext.=\"<span class='info_para\".$j.\"' ><b>\".$val1[name].\":</b> \".$val[$val1[para]].\"</span>\";\n }\n if($hits==1)$listtext.=\"<span class='info_hits'>\".$lang_Hits.\":<font>\".$val[hits].\"</font></span>\";\n if($time==1)$listtext.=\"<span class='info_updatetime'>\".$lang_UpdateTime.\":\".$val[updatetime].\"</span>\";\n if($detail==1){\n $listtext.=\"<span class='info_detail' ><a href=\".$val[url];\n if($newwindow==1)$listtext.=\" target='_blank' \";\n $listtext.=\">\".$lang_Detail.\"</a></span>\";\n }\n if($feedback==1)$listtext.=\"<span class='info_feedback'><a href='\".$addfeedback_url1.\"' >\".$lang_Buy.\"</a></span>\";\n }\n}else{\n if($classname==1)$listtext.=\"<span class='info_class'><a href='\".$val[classurl].\"' title='\".$val[classname].\"' >[\".$val[classname].\"]</a></span>\";\n $listtext.=\"<span class='info_title'><a href=\".$val[url];\n if($newwindow==1)$listtext.=\" target='_blank' \";\n if($val[top_ok]==1)$listtext.=\" style='color:\".$topcolor.\";'\";\n $listtext.=\" title='\".$val[title].\"' >\".$val[title].\"</a></span>\";\n $j=0;\n foreach($product_paralist as $key=>$val1){\n $j++;\n if($j>$paranum)break;\n $listtext.=\"<span class='info_para\".$j.\"' >\".$val[$val1[para]].\"</span>\";\n }\n if($hits==1)$listtext.=\"<span class='info_hits' ><b>\".$val[hits].\"</b></span>\";\n if($top==1)$listtext.=$val[top];\n if($news==1)$listtext.=$val[news];\n if($hot==1)$listtext.=$val[hot];\n if($time==1)$listtext.=\"<span class='info_updatetime' >\".$val[updatetime].\"</span>\";\n if($detail==1){\n $listtext.=\"<span class='info_detail' ><a href=\".$val[url];\n if($newwindow==1)$listtext.=\" target='_blank' \";\n $listtext.=\">\".$lang_Detail.\"</a></span>\";\n }\n if($feedback==1)$listtext.=\"<span class='info_feedback'><a href='\".$addfeedback_url1.\"' >\".$lang_Buy.\"</a></span>\";\n}\n $listtext.=\"</li>\\n\";\n if($max&&$i>=$max)break;\n }\n $listtext.=\"</ul>\";\n return $listtext;\n }",
"private function _create_list($input = array(), $filter = array(), $filter_fields = array())\n {\n // pr($this->input->post_get(null));\n $filter_input = array('order');\n $filter_fields = array_merge($filter_fields, model('product')->fields_filter);\n $mod_filter = mod('product')->create_filter($filter_fields, $filter_input);\n $filter = array_merge( $filter,$mod_filter);\n $filter['types']= $this->input->get('types');\n $filter_input['types'] =$filter['types'];\n $key = $this->input->get('name');\n $key = str_replace(array('-', '+'), ' ', $key);\n\n if (isset($filter['name']) && $filter['name']) {\n unset($filter['name']);\n $filter['%name'] = $filter_fields['name'] = trim($key);\n }\n if ($point=$this->input->get('point')) {\n $filter['point_total_gte'] =$point;\n }\n\n // lay thong tin cua cac khoang tim kiem\n foreach (array('price',) as $range) {\n if (isset($filter[$range])) {\n if (is_array($filter[$range])) {\n foreach ($filter[$range] as $key => $row) {\n $filter[$range.'_range'][$key] = model('range')->get($row, $range);\n }\n } else {\n $filter[$range.'_range'] = model('range')->get($filter[$range], $range);\n }\n unset($filter[$range]);\n }\n }\n\n //pr($filter);\n //pr($input);\n // Gan filter\n $filter['show'] = 1;\n\n //== Lay tong so\n if (!isset($input['limit'])) {\n $total = model('product')->filter_get_total($filter, $input);\n // pr($filter,0); pr_db($total);\n\n $page_size = config('list_limit', 'main');\n\n $limit = $this->input->get('per_page');\n $limit = min($limit, $total - fmod($total, $page_size));\n $limit = max(0, $limit);\n //== Lay danh sach\n $input['limit'] = array($limit, $page_size);\n }\n //== Sort Order\n $sort_orders = array(\n 'is_feature|desc',\n 'id|desc',\n 'point_total|desc',\n //'price|asc',\n //'price|desc',\n // 'view_total|desc',\n /*'count_buy|desc',\n 'new|desc',\n\n 'rate|desc',\n 'name|asc',*/\n );\n $order = $this->input->get(\"order\", true);\n if ($order && in_array($order, $sort_orders)) {\n $orderex = explode('|', $order);\n } else {\n $orderex = explode('|', $sort_orders[0]);\n }\n if (!isset($input['order'])) {\n $input['order'] = array($orderex[0], $orderex[1]);\n $filter_input['order']=$order;\n }\n $list = model('product')->filter_get_list($filter, $input);\n if(admin_is_login()){\n // echo $total; pr($filter,0); pr_db($list);\n }\n // pr($filter,0); pr_db($list);\n\n foreach ($list as $row) {\n $row = mod('product')->add_info($row,1);\n }\n // pr($list);\n // Tao chia trang\n $pages_config = array();\n if (isset($total)) {\n $pages_config['page_query_string'] = TRUE;\n $pages_config['base_url'] = current_url() . '?' . url_build_query($filter_input);\n //pr( $filter_input );\n // $pages_config['base_url'] = current_url(1);\n $pages_config['total_rows'] = $total;\n $pages_config['per_page'] = $page_size;\n $pages_config['cur_page'] = $limit;\n }\n\n $this->data['pages_config'] = $pages_config;\n $this->data['total'] = $total;\n $this->data['list'] = $list;\n $this->data['filter'] = $filter_input;\n $this->data['sort_orders'] = $sort_orders;\n $this->data['sort_order'] = $order;\n $this->data['action'] = current_url();\n\n //===== Ajax list====\n $this->_create_list_ajax();\n\n // luu lai thong so loc va ket qua\n mod('product')->sess_data_set('list_filter', $filter);// phuc vu loc du lieu\n mod('product')->sess_data_set('list_filter_input', $filter_input);// phuc vu hien thi\n mod('product')->sess_data_set('list_sort_orders', $sort_orders);// phuc vu hien thi\n mod('product')->sess_data_set('list_sort_order', $order);// phuc vu hien thi\n mod('product')->sess_data_set('list_total_rows', $total);// phuc vu hien thi\n\n }",
"public function add($data){\n \t$db = $this->getAdapter();\n \t$db->beginTransaction();\n \ttry {\n\t\t\t$sql =\"SELECT p.id FROM `tb_product` AS p WHERE p.`item_code`='\".$data[\"pro_code\"].\"'\";\n\t\t\t$exist_code = $db->fetchOne($sql);\n\t\t\t$new_code = $this->getProductPrefix($data[\"category\"]);\n\t\t\tif(!empty($exist_code)){\n\t\t\t\t$p_code = $new_code[\"p_code\"];\n\t\t\t\t$int_code = $new_code[\"int_code\"];\n\t\t\t}else{\n\t\t\t\t$p_code = $data[\"pro_code\"];\n\t\t\t\t$int_code = $data[\"int_code\"];\n\t\t\t}\n \t\t$arr = array(\n \t\t\t'item_name'\t\t=>\t$data[\"name\"],\n \t\t\t'item_code'\t\t=>\t$p_code,\n\t\t\t\t'int_code'\t\t=>\t$int_code,\n \t\t\t'barcode'\t\t=>\t$data[\"barcode\"],\n \t\t\t'cate_id'\t\t=>\t$data[\"category\"],\n \t\t\t'brand_id'\t\t=>\t$data[\"brand\"],\n \t\t\t'model_id'\t\t=>\t$data[\"model\"],\n \t\t\t'color_id'\t\t=>\t$data[\"color\"],\n \t\t\t'measure_id'\t=>\t$data[\"measure\"],\n \t\t\t'size_id'\t\t=>\t$data[\"size\"],\n \t\t\t'serial_number'\t=>\t$data[\"serial\"],\n// \t\t\t'qty_perunit'\t=>\t$data[\"qty_unit\"],\n// \t\t\t'unit_label'\t=>\t$data[\"label\"],\n \t\t\t'user_id'\t\t=>\t$this->getUserId(),\n \t\t\t'note'\t\t\t=>\t$data[\"description\"],\n \t\t\t'status'\t\t=>\t1,\n\t\t\t\t'price'\t\t\t=>\t$data[\"price\"],\n\t\t\t\t'is_convertor'\t=>\t@$data[\"is_convertor\"],\n\t\t\t\t'convertor_measure'\t=>\t$data[\"convertor_measure\"],\n\t\t\t\t'sign'\t\t\t\t=>\t$data[\"sign\"],\n\t\t\t\t'is_meterail'\t\t=>\t@$data[\"is_meterail\"]\n \t\t);\n \t\t$this->_name=\"tb_product\";\n \t\t$id = $this->insert($arr);\n \t\t\n \t\t// For Product Location Section\n \t\tif(!empty($data['identity'])){\n \t\t\t$identitys = explode(',',$data['identity']);\n \t\t\tforeach($identitys as $i)\n \t\t\t{\n \t\t\t\t$arr1 = array(\n \t\t\t\t\t'pro_id'\t\t\t=>\t$id,\n \t\t\t\t\t'location_id'\t\t=>\t$data[\"branch_id_\".$i],\n \t\t\t\t\t'qty'\t\t\t\t=>\t$data[\"current_qty_\".$i],\n \t\t\t\t\t'qty_warning'\t\t=>\t$data[\"qty_warnning_\".$i],\n\t\t\t\t\t\t'price'\t\t\t\t=>\t$data[\"cost_price_\".$i],\n \t\t\t\t\t'last_mod_userid'\t=>\t$this->getUserId(),\n \t\t\t\t\t'last_mod_date'\t\t=>\tnew Zend_Date(),\n \t\t\t\t);\n \t\t\t\t$this->_name = \"tb_prolocation\";\n \t\t\t\t$this->insert($arr1);\n \t\t\t}\n \t\t}\n \t\t// For Product Price\n \t\t/*if(!empty($data['identity_price'])){\n \t\t\t$identityss = explode(',',$data['identity_price']);\n \t\t\tforeach($identityss as $i)\n \t\t\t{\n \t\t\t\t$arr2 = array(\n \t\t\t\t\t\t'pro_id'\t\t\t=>\t$id,\n \t\t\t\t\t\t'type_id'\t\t\t=>\t$data[\"price_type_\".$i],\n \t\t\t\t\t\t//'location_id'\t\t=>\t$data[\"current_qty_\".$i],\n \t\t\t\t\t\t'price'\t\t\t\t=>\t$data[\"price_\".$i],\n \t\t\t\t\t\t'remark'\t\t\t=>\t$data[\"price_remark_\".$i],\n \t\t\t\t\t\t//'last_mod_userid'\t=>\t$this->getUserId(),\n \t\t\t\t\t\t//'last_mod_date'\t\t=>\tnew Zend_Date(),\n \t\t\t\t);\n \t\t\t\t$this->_name = \"tb_product_price\";\n \t\t\t\t$this->insert($arr2);\n \t\t\t}\n \t\t}*/\n \t\t$db->commit();\n \t}catch (Exception $e){\n \t\t$db->rollBack();\n \t\tApplication_Model_DbTable_DbUserLog::writeMessageError($e);\n \t}\n }",
"static function addOrder($params)\n {\n\t$con =$params['dbconnection'];\n\t\n\t$delivery_charges=\"\";\n\t$tax=\"\";\n\t$accepted_delivery_time=\"\";\n\t$estimated_carry_out_time=\"\";\n\t$defaults = \"SELECT \n\t`id`,\n\t`tax`,\n\t`accepted_delivery_time`,\n\t`estimated_carry_out_time`,\n\t`delivery_charges`\n\tFROM `defaults` \n\tORDER BY `id` DESC LIMIT 0,1 \";\n\t$resultd = mysqli_query($con,$defaults) ;\n\tif (mysqli_error($con) != '')\n\treturn \"mysql_Error:-\".mysqli_error($con);\n\tif (mysqli_num_rows($resultd) > 0) \n\t{\n\t\t$rowd = mysqli_fetch_assoc($resultd);\n\t\t\n\t\tif($params['order_type']=='delivery' && $rowd['delivery_charges'] !=NULL)\n\t\t$delivery_charges=\"`delivery_charges`='{$rowd['delivery_charges']}',\";\n\t\t\n\t\tif($rowd['tax'] !=NULL)\n\t\t$tax=\"`tax`='{$rowd['tax']}',\";\n\t\tif($params['order_type']=='delivery')\n\t\t{\t\n\t\t\tif($rowd['accepted_delivery_time'] !=NULL)\n\t\t\t$accepted_delivery_time=\"`accepted_delivery_time`='{$rowd['accepted_delivery_time']}',\";\n\t\t\telse\n\t\t\t$accepted_delivery_time=\"`accepted_delivery_time`='1',\";\n\t\t\t\n\t\t}\n\t\telse if($params['order_type']=='carry_out')\n\t\t{\n\t\t\tif($rowd['estimated_carry_out_time'] !=NULL)\n\t\t\t$estimated_carry_out_time=\"`estimated_carry_out_time`='{$rowd['estimated_carry_out_time']}',\";\n\t\t\telse\n\t\t\t$estimated_carry_out_time=\"`estimated_carry_out_time`='1',\";\n\t\t}\n\t}\n\n $discount='';\n\t$discounttype='';\n\tif($params['code'] !=\"\")\n\t{\n\t\t$checkCode=DbMethods::checkCode($params);\n\t if($checkCode=='' || $checkCode ==NULL ) return 'promoCodeNotvalid';\n\t\telse if($checkCode['type']=='flat')\n\t\t{\n\t\t if(!empty($checkCode['discount']) || $checkCode['discount'] !=''){ $discount=\" `discount`='{$checkCode['discount']}' ,\"; }\n\t\t}\n\t\telse\n\t\t$discounttype=$checkCode['type'];\n\t\t\n\t}\n\t$totalamount=\"\";\n\t$con->begin_transaction();\n\ttry { \n\t\t\t$latlong=\"\";\n\t\t\tif($params['latitude'] !=\"\" && $params['longitude'] !=\"\")\n\t\t\t$latlong=\"`latitude`='{$params['latitude']}', `longitude`='{$params['longitude']}',\";\n\t\t\t \n\t\t\t $query = \"INSERT INTO `orders` SET \n\t\t\t`user_id`='{$params['user_id']}',\n\t\t\t`branche_id`='{$params['branche_id']}',\n\t\t\t`order_type`='{$params['order_type']}',\n\t\t\t\".$latlong.\"\n\t\t\t\".$tax.\"\n\t\t\t\".$discount.\"\n\t\t\t\".$delivery_charges.\"\n\t\t\t\".$accepted_delivery_time.\"\n\t\t\t\".$estimated_carry_out_time.\"\n\t\t\t`payment_order`='{$params['payment_order']}'\" ;\n\t\t\tmysqli_query($con,$query) ;\n\t\t\tif (mysqli_error($con) != '')\n\t\t\treturn \"mysql_Error:-\".mysqli_error($con);\n\t\t\tif(mysqli_affected_rows($con)==0)\n\t\t\tthrow new Exception(mysqli_error($con));\n\t\t\t$order_id=mysqli_insert_id($con);\n\t\t\t\n\t\t\t$order_items = stripslashes($params['order_items']);\n\t\t\t$order_items = json_decode($order_items,true);\t\n\t\t\t$outletObj=array();\n\t\t\tfor($i=0;$i<count($order_items); $i++)\n\t\t\t{\n\t\t\t\t$queryid = \"SELECT \n\t\t\t\t`price`\n\t\t\t\tFROM `menu_items` \n\t\t\t\tWHERE `id`='{$order_items[$i]['menu_item_id']}'\";\n\t\t\t\t$resultid = mysqli_query($con,$queryid) ;\n\t\t\t\tif (mysqli_error($con) != '')\n\t\t\t\tthrow new Exception(mysqli_error($con));\n\t\t\t\tif (mysqli_num_rows($resultid) > 0) \n\t\t\t\t{\n\t\t\t\t\t$rowid = mysqli_fetch_assoc($resultid);\n\t\t\t\t\t $amount=($order_items[$i]['quantity'] * $rowid['price']);\n\t\t\t\t\t $totalamount= $totalamount + ($order_items[$i]['quantity'] * $rowid['price']);\n\t\t\t\t\t $queryi = \"INSERT INTO `order_items` SET \n\t\t\t\t\t`order_id`='{$order_id}',\n\t\t\t\t\t`menu_item_id`='{$order_items[$i]['menu_item_id']}',\n\t\t\t\t\t`quantity`='{$order_items[$i]['quantity']}',\n\t\t\t\t\t`amount`='{$amount}'\" ;\n\t\t\t\t\t mysqli_query($con,$queryi) ;\n\t\t\t\t\t if (mysqli_error($con) != '')\n\t\t\t\t\t throw new Exception(mysqli_error($con));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\tthrow new Exception('mysql_Error:- menu_item_id is wrong');\n\t\t\t}\n\t\t\t$con->commit();\n\t\t\t\n\t\t\tif($discounttype=='percentage')\n\t\t\t{\n\t\t\t\t$discount=($checkCode['discount'] / 100) * $totalamount;\n\t\t\t\tif($discount !='')\n\t\t\t\tmysqli_query($con,\"UPDATE `orders` SET `discount`='{$discount}' WHERE `id`='{$order_id}'\") ;\n\t\t\t}\n\t\t\t\n\t\t\tif(!empty($checkCode['id']))\n\t\t\t{\n\t\t\t mysqli_query($con,\"INSERT INTO `used_promo_codes` SET `promo_code_id`='{$checkCode['id']}', `user_id`='{$params['user_id']}'\") ;\t\n\t\t\t}\n\t\t\t\n\t\t\t$authorization=$params['Authorization'];\n\t\t\t$dbconnection=$params['dbconnection'];\n\t\t\t$apiBasePath=$params['apiBasePath'];\n\t\t\tunset($params);\n\t\t\t$params['order_id']=$order_id;\n\t\t\t$params['status']='0';\n\t\t\t$params['Authorization']=$authorization;\n\t\t\t$params['dbconnection']=$dbconnection;\n\t\t\t$params['apiBasePath']=$apiBasePath;\n\t\t\tDbMethods::changeOrderStatus($params);\n\t\t\treturn array(\"order_id\"=>(int)$order_id ) ;\n\t\t\t\n\t} catch(\\Exception $e) {\n\t\t$con->rollBack();\n\t\tthrow $e;\n\t} catch(\\Throwable $e) {\n\t\t$con->rollBack();\n\t\tthrow $e;\n\t}\n }",
"function get_order($data)\n {\n $query = '';\n $number = is_array($data) && isset($data['number']) ? $data['number'] : null;\n $order = null;\n\n // filer by date add\n if (isset($this->all_configs['settings']['terminal_orders_days']) && intval($this->all_configs['settings']['terminal_orders_days']) > 0) {\n $query = $this->all_configs['db']->makeQuery('AND o.date_add>DATE_ADD(NOW(), INTERVAL -?i DAY)',\n array(intval($this->all_configs['settings']['terminal_orders_days'])));\n }\n\n if ($number) {\n // find order by id\n $order = $this->all_configs['db']->query('SELECT o.* FROM {orders} as o WHERE o.id=? ?query',\n array($number, $query))->row();\n\n if ($order) {\n // get order goods\n $order = $this->order_goods($order, $number);\n } else {\n // find serial\n $serial = suppliers_order_generate_serial(array('serial' => mb_strtolower($number, 'UTF-8')), false);\n $order = $this->all_configs['db']->query(\n 'SELECT i.* FROM {warehouses_goods_items} as i, {warehouses} as w\n WHERE ?query AND i.order_id IS NULL AND w.id=i.wh_id AND w.consider_all=1',\n array(is_integer($serial) ? 'i.id=' . $serial : 'i.serial=' . $number))->row();\n if ($order) {\n $order['item_id'] = $order['id'];\n $order['id'] = $serial;\n $order['result'] = 1;\n $order['goods'][$order['goods_id']] = $this->all_configs['db']->query(\n 'SELECT * FROM {goods} WHERE id=?i', array($order['goods_id']))->row();\n $order['fio'] = $this->all_configs['db']->query('SELECT fio FROM {clients} WHERE id=?',\n array($this->all_configs['configs']['erp-so-client-terminal']))->el();\n $order['goods'][$order['goods_id']]['count'] = 1;\n $order['sum_paid'] = 0;\n $course = getCourse($this->all_configs['settings']['currency_suppliers_orders']) / 100;\n $order['sum'] = $order['debt'] = $order['price'] * $course;\n }\n }\n }\n\n return $order;\n }",
"function getOrderedQuantity();",
"function convert_to_order() {\n\t\t\t /** **\n if(isset($id_presupuesto)){\n $row33[0] = $id_presupuesto;\n $consulta = \"update Lineas_detalle set id_presupuesto=0 where id_presupuesto = $id_presupuesto\";\n $Sesion->query($consulta);\n }\n\t\t /** **/\n\t}",
"function transfer_order_number()\n\t{\n\t\t$number = '';\n\t\t$query = $this->db->query('SELECT * FROM tbl_purchase where order_type=\"Transfer Order\"');\n\t\t\tif($query->num_rows()>0){;\n\t\t\t$this->db->select(\"*\");\n\t\t\t$this->db->from(\"tbl_purchase\");\n\t\t\t$this->db->where('order_type','Transfer Order');\n\t\t\t$this->db->limit(1);\n\t\t\t$this->db->order_by('id',\"DESC\");\n\t\t\t$query = $this->db->get();\n\t\t\t$result = $query->result();\n\t\t\t//echo \"<pre>\"; print_r($result);\n\t\t\tif(count($result) > 0){\n\t\t\t\t$number = $result[0]->purchase_order;\n\t\t\t\t$number = explode('-',$number);\n\t\t\t\t$number = str_pad(++$number[1],4,'0',STR_PAD_LEFT);\n\t\t\t\treturn $number;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} else {\n\t\t\t$number = '0001';\n\t\t\t\treturn $number;\n\t\t}\t\n\t\t\n\t}",
"function products($category='',$cateid='') {\n \t$data['order']='';\n\t\t$order = '';\n \t$like='';\n\t\t$currentPosition = (isset($_POST['formKey']))?$_POST['formKey']:0;\n\t\t$data['currentPosition'] = $currentPosition;\n\t\t$data['user'] = 1;\n\t\t$join_array = array('ts_categories','ts_categories.cate_id = ts_products.prod_cateid');\n\t\t$condition = \"prod_status = '1'\";\n \n if(isset($_POST['sorting'])){\n \t\t if( $_POST['sorting'] != '' ) {\t\n\t\t\t $order=array($_POST['sorting'],'asc');\n\t\t\t $data['order']=$_POST['sorting'];\n\t\t\t }\n\t}\n\t\n\t if( $category == '' ) {\n\t $data['headlineText'] = $this->ts_functions->getlanguage('alltext','homepage','solo');\n\t }\n elseif( $category == 'freebies-audio' ) {\n\t // All free audio products\n\t $condition .= \"AND prod_free = '1' AND prod_cateid in(2,3,4)\"; \n\t $data['headlineText'] = \"Free\";\n\t $data['freebies_audio']=1; \n\t }\n elseif( $category == 'featured-audio' ) {\n\t // All free audio products\n\t $condition .= \"AND prod_featured = '1' AND prod_cateid in(2,3,4)\"; \n\t $data['headlineText'] = \"Featured\";\n\t $data['featured_audio']=1;\n\t }\n\t elseif( $category == 'recent-audio' ) {\n\t // All free audio products\n\t $condition .= \"AND prod_free = '0' AND prod_cateid in(2,3,4)\"; \n\t $data['headlineText'] = \"Recent\";\n\t $data['recent_audio']=1;\n\t } \n\t\telseif( $category == 'freebies-ebook' ) {\n\t // All free audio products\n\t $condition .= \"AND prod_free = '1' AND prod_cateid in(5,6,7)\"; \n\t $data['headlineText'] = \"Free\";\n\t $data['freebies_ebook']=1;\n\t }\n elseif( $category == 'featured-ebook' ) {\n\t // All free audio products\n\t $condition .= \"AND prod_featured = '1' AND prod_cateid in(5,6,7)\"; \n\t $data['headlineText'] = \"Featured\";\n\t $data['featured_ebook']=1;\n\t }\n\t elseif( $category == 'recent-ebook' ) {\n\t // All free audio products\n\t $condition .= \"AND prod_free = '0' AND prod_cateid in(5,6,7)\"; \n\t $data['headlineText'] = \"Recent\";\n\t $data['recent_ebook']=1;\n\t }\n\t elseif($category!='' AND $cateid=='' ){\n\t \t$category = urldecode($category);\n // $like= array('prod_urlname,prod_name,prod_tags' , '$category,$category,$category');\n $condition.= \" AND (prod_urlname LIKE '%$category%' OR prod_name LIKE '%$category%' OR prod_tags LIKE '%$category%')\";\n \n\n\t } \n\t elseif($category=='category' AND $cateid!=''){\n $condition .= \"AND prod_cateid =$cateid\";\n\t } \n elseif($category!='category' AND $cateid!=''){\n $condition .= \"AND prod_subcateid =$cateid\";\n\t } \n \n\t\t$data['productdetails'] = $this->my_model->select_data('*' , 'ts_products' , $condition , array('12' , $currentPosition),$order,$like);\n\n\n\t\t$this->load->library('ci_pagination'); \n\t\t$countTotal = $this->my_model->aggregate_data('ts_products' , 'prod_id' , 'COUNT' ,$condition,'',$like); \n\t\t$data['paginationButton'] = $this->ci_pagination->pagination_data($countTotal, $currentPosition , '12');\n\t\t$data['countTotal'] = $countTotal;\n\t\t$data['categoryList'] = $this->DatabaseModel->access_database('ts_categories','select','',array('cate_status'=>1));\n\t\t$data['languageList'] = $this->DatabaseModel->access_database('ts_lancate','select','',array('lancate_status'=>1));\n\t\t$data['sub_categoryList'] = $this->DatabaseModel->access_database('ts_subcategories','select','','');\n\n $data['basepath'] = base_url();\n $this->load->view('themes/'.$this->theme.'/home/include/home_header',$data);\n\t\t$this->load->view('themes/'.$this->theme.'/home/include/menu_header',$data);\n\t\t$this->load->view('themes/'.$this->theme.'/home/products_view',$data);\n\t\t$this->load->view('themes/'.$this->theme.'/home/include/home_footer',$data);\n}",
"function getOrder($type=0){\n\t\t\tif($type==0){\n\t\t\t\treturn $this->order;\n\t\t\t}else if($type==1){\n\t\t\t\treturn implode(\" AND \",$this->order);\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"function add_item($num, $code) {\n $CI = &get_instance();\n \n // If an item of the given type already is already ordered, update it's quantity.\n if ($CI->orderitems->exists($num, $code)) {\n $record = $CI->orderitems->get($num, $code);\n $record->quantity++;\n $CI->orderitems->update($record);\n }\n // If no item of the given type is already ordered, add a new one to the order.\n else {\n $record = $CI->orderitems->create();\n $record->order = $num;\n $record->item = $code;\n $record->quantity = 1;\n $CI->orderitems->add($record);\n }\n }",
"public function user_mail_quote_2_order($data = array()) {\n \n }",
"function getQtyOrderfr23apr18($type,$itemIds,$condition,$row='',$WID='',$dropship='')\r\n {\t\r\n\t$join='';\r\n\t$tbl = ($type == 'sale') ? 's_order_item' : 'p_order_item' ;\t\t\r\n\t$tbl2 = ($type == 'sale') ? 's_order' : 'p_order' ;\r\n\t\r\n \t//$col2 = ($type == 'purchase') ? ' and NOT EXISTS (SELECT 1 FROM p_order b WHERE b.PurchaseID = t2.PurchaseID and b.Module =\"Invoice\" and b.PostToGL=1 )and NOT EXISTS (SELECT 1 FROM p_order p WHERE p.PurchaseID = t2.PurchaseID and p.Module =\"Receipt\" and p.ReceiptStatus=\"Completed\" ) ' : '' ;\r\n$col2 = ($type == 'purchase') ? ' and NOT EXISTS (SELECT 1 FROM p_order b WHERE b.PurchaseID = t2.PurchaseID and b.Module =\"Invoice\" and b.PostToGL=1 ) ' : '' ;\r\n\t$col = ($type == 'sale') ? ' and NOT EXISTS (SELECT 1 FROM s_order b WHERE b.SaleID = t2.SaleID and b.Module =\"Invoice\" and b.PostToGL=1 ) ' : '' ;\r\n\t\r\n\t$sumcol = ($type == 'sale') ? ' SUM(t1.qty) ' : ' SUM(t1.qty-t1.SaleQty) ';\r\n\tif(is_array($itemIds)){\r\n\t\t$Itemids = implode(\"','\",$itemIds);\r\n\t\t$str = \" and t1.item_id IN('\".$Itemids.\"') \";\r\n\t}else{\r\n\t\t$str = \" and t1.item_id = '\".$itemIds.\"' \";\r\n\t}\r\nif($type == 'purchase'){\r\n$recCol = \",SUM(t1.qty_received) as recqty,t2.PurchaseID,t2.SuppCompany,t2.SuppCode,t2.OrderDate \";\r\n//$purCol = \",\";\r\n}\r\n\t $strAddQuery = (($dropship>0 && $dropship!='') && $type == 'sale')?(\" and t1.DropshipCheck = '\".$dropship.\"' \"):(\" \");\t//updated by chetan on 31Mar2017//\r\n\t$strAddQuery .= (!empty($WID))?(\" and t1.WID = '\".$WID.\"' \"):(\" and t1.WID = 1 \");\t//updated by chetan on 31Mar2017//\r\n\tif($row)\r\n\t{\r\n\t\t $Strquery = \"SELECT t1.*$recCol FROM $tbl as t1 inner join $tbl2 as t2 on t1.OrderID = t2.OrderID WHERE 1 and t2.Module ='Order' \".$str.\" and t1.Condition = '\".$condition.\"' $col $col2 $strAddQuery\"; //updated by chetan on 31Mar2017//\r\n\t\t$res = $this->query($Strquery,1);\r\n\r\n\t\treturn $res;\r\n\t}else{\r\n\t\r\n\t\t$Strquery = \"SELECT t2.TrackingNo,t2.ShippingMethod, t1.sku,$sumcol as qty,t2.OrderID,t1.`Condition` $recCol,t2.SaleID,t2.Module FROM $tbl as t1 inner join $tbl2 as t2 on t1.OrderID = t2.OrderID $join WHERE 1 and t2.Module ='Order' \".$str.\" and t1.Condition = '\".$condition.\"' $col $col2 $strAddQuery\"; //updated by chetan on 31Mar2017//\r\n$res = $this->query($Strquery,1);\r\n\tif(!empty($_GET['this'])){ echo $Strquery;}\r\n\r\n\t\t $qty = $res[0]['qty']-$res[0]['recqty'];\r\n\r\n\t\treturn (!empty($res) && $qty != NULL) ? $qty : '0';\r\n\t}\r\n }",
"function add_product($crtobj)\n\t{\n\t\t\n\t\t$param_array = func_get_args();\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD cart::add_product() - PARAMETER LIST : ', $param_array);\n\t\t\n\t\t//$crtobj = $this;\n\t\t\n\t\n\t\t$crtobj->Id = $_REQUEST['Id'];\n\t\t\n\t\t$prod_obj = new products();\n\t\t\n\t\t$res = $prod_obj->fetch_record($crtobj->Id);\n\t\t\n\t\tif($data = mysql_fetch_object($res[0]))\n\t\t{\n\t\t\n\t\t\t$temp_EnName = display_field_value($data,\"Name\");\n\t\t\t\n\n\t\t\t$Price = $data->Price;\n\t\t\t\n\t\t\t$Weight = $data->Weight;\n\t\t\t\n\t\t\t$crtobj->prod_id = $data->Id ;\t\t\n\t\t\t\n\t\t\t$crtobj->prod_name = $data->EnName;\n\t\t\t\n\t\t\tif($_REQUEST['sizes'] > 0) {\n\t\t\t$size_res = $GLOBALS['db_con_obj']->fetch_flds('product_sizes','Price,Id,EnTitle','Id ='.$_REQUEST['sizes']); \n\t\t\t\t$size_data = mysql_fetch_object($size_res[0]);\t\t\t\t \n\t\t\t\t $Price = $size_data->Price;\n\t\t\t\t \n\t\t\t\t $crtobj->prod_unit_price = format_number(product_price($data->Id,$Price)) ;\n\t\t\t}\n\t\t\telse{ \n\t\t\t\t$crtobj->prod_unit_price = format_number(product_price($data->Id,$Price)) ;\n\t\t\t}\n\t\t\t//$crtobj->prod_unit_price = $_SESSION['ses_product']['price'];\n\t\t\t\n\t\t\tunset($_SESSION['ses_product']['price']);\n\t\t\t\n\t\t\t$quantity = $_REQUEST['quantity'];\t\n\t\t\t\n\t\t\t$crtobj->size = $_REQUEST['sizes'];\t\n\t\t\t\n\t\t\t$crtobj->colour = $_REQUEST['Colors'];\t\n\t\t\t\n\t\t\t//$crtobj->size = $size;\n\t\t\t\n\t\t\t$crtobj->prod_quantity = $quantity;\n\t\t\t\n\t\t\t$crtobj->prod_code = $data->ProdCode;\n\t\t\t\t\n\t\t\t$crtobj->Weight = $Weight;\n\t\t\t\n\t\t\t$crtobj->category_id = $category_id;\n\t\t\t\n\t\t\t$crtobj->prod_type = $data->ProdType;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t$crtobj->prod_thumb_path = $prod_obj->attachment_path . $data->Image;\n\t\t\t\n\t\t\tif(!(file_exists($crtobj->prod_thumb_path) && is_file($crtobj->prod_thumb_path)))\n\t\t\t$crtobj->prod_thumb_path = $prod_obj->attachment_path . \"default_th_prod.jpg\";\n\t\n\t\t\t$cur_key = 0;\n\t\t\t$exists = false;\n\t\t\t\n\t\t\tforeach($_SESSION['ses_cart_items'] as $key => $value)\n\t\t\t{\n\t\t\t\t//$obj_vars = get_object_vars($value);\n\t\t\t\t\n\t\t\t\tif($value['Id'] == $crtobj->Id && $value['size'] == $crtobj->size )\n\t\t\t\t{\n\t\t\t\t\t$exists = true;\n\t\t\t\t\t$cur_key = $key;\n\t\t\t\t\t$crtobj->prod_quantity = 1;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$crtobj = get_object_vars($crtobj);\n\t\t\tif($exists )\n\t\t\t\t\n\t\t\t\t$_SESSION['ses_cart_items'][$cur_key] = $crtobj;\n\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t$crtobj->prod_quantity = $quantity;\n\t\t\t\t$_SESSION['ses_cart_items'][] = $crtobj;\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($_SESSION['ses_coupon_code'])){\n\t\t\t\n\t\t\t$this->apply_promocode($_SESSION['ses_coupon_code']);\n\t\t\t}\n\t\t\t\n\t\t\t$crtobj->last_added_prod = end($_SESSION['ses_cart_items']);\n\t\t\t\n\t\t\t$_SESSION['ses_last_added_prod'] = $crtobj->last_added_prod;\n\t\n\t\t}\n\t\t\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD cart::add_product() - Return Value : ', 'Added a product to the cart and returning void');\n\n\t\treturn $ret_val;\n\t\n\t}",
"public function addOrderProducts() {\n \n }",
"public function createPoshtaOrder(Request $request){\n\n $orderCatalog = [];\n $allCount = 0;\n foreach ($request->product_type as $key => $item){\n $orderCatalog[$request->product_count[$key]] = $item;\n $allCount += $request->product_count[$key];\n }\n $orderCatalogJson = \\GuzzleHttp\\json_encode($orderCatalog);\n PostaOrder::create([\n 'city_poster' => $request->city_poster,\n 'type-of-services' => $request->type_of_services,\n 'departyre-type' => \"\",\n 'phone_recipient' => $request->phone_recipient,\n 'phone_poster' => $request->phone_poster,\n 'name_recipient' => $request->name_recipient,\n 'name_poster' => $request->name_poster,\n 'sender' => \"\",\n 'recipient' => \"\",\n 'product-type' => $orderCatalogJson,\n 'product-count' => $allCount,\n 'email_poster' => $request->email_poster,\n 'email_recipient' => $request->email_recipient,\n ]);\n\n return \"<h3 style='text-align: center; font-size: 25px; padding-top: 40px;'>Заказ оформен. Скоро мы с вами свяжемся</h3>\";\n\n }",
"function prepare ($id_order, $id_request) {\n\t\t$order = new shp_commande($id_order);\n\t\t$current = $order->get_infos_tpi();\n\t\tif ($current != '') {\n\t\t\t$props = explode('|', $current);\n\t\t\t$cnt = $props[0];\n\t\t} else\t$cnt = 0;\n\t\t$order->set_infos_tpi(++$cnt.'|'.$id_request);\n\t\tdbUpdate($order);\n\t}",
"function prostart_trx_addons_sc_type($list, $sc) {\n if($sc == 'trx_sc_testimonials') {\n $list['extra'] = 'Extra';\n $list['plain'] = 'Plain';\n }\n if($sc == 'trx_sc_services') {\n $list['extra'] = 'Extra';\n }\n if($sc == 'trx_sc_button') {\n $list['iconic'] = 'Iconic(Select Icon) ';\n }\n if($sc == 'trx_sc_title') {\n $list['decoration'] = 'Decoration';\n $list['extra'] = 'Extra';\n }\n\n return $list;\n\t}",
"public function create ()\t{\n\t\t$newId = 0;\n\t\t$pid = intval($this->conf['PID_sys_products_orders']);\n\n\t\tif (!$pid)\t{\n\t\t\t$pid = intval($GLOBALS['TSFE']->id);\n\t\t}\n\n\t\tif ($GLOBALS['TSFE']->sys_page->getPage_noCheck($pid))\t{\n\t\t\t$advanceUid = 0;\n\t\t\tif ($this->conf['advanceOrderNumberWithInteger'] || $this->conf['alwaysAdvanceOrderNumber'])\t{\n\t\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid', 'sys_products_orders', '', '', 'uid DESC', '1');\n\t\t\t\tlist($prevUid) = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);\n\t\t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($res);\n\n\t\t\t\tif ($this->conf['advanceOrderNumberWithInteger']) {\n\t\t\t\t\t$rndParts = explode(',',$this->conf['advanceOrderNumberWithInteger']);\n\t\t\t\t\t$randomValue = rand(intval($rndParts[0]), intval($rndParts[1]));\n\t\t\t\t\t$advanceUid = $prevUid + tx_div2007_core::intInRange($randomValue, 1);\n\t\t\t\t} else {\n\t\t\t\t\t$advanceUid = $prevUid + 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$time = time();\n\t\t\t$insertFields = array (\n\t\t\t\t'pid' => intval($pid),\n\t\t\t\t'tstamp' => $time,\n\t\t\t\t'crdate' => $time,\n\t\t\t\t'deleted' => 0,\n\t\t\t\t'hidden' => 1\n\t\t\t);\n\t\t\tif ($advanceUid > 0)\t{\n\t\t\t\t$insertFields['uid'] = intval($advanceUid);\n\t\t\t}\n\n\t\t\t$GLOBALS['TYPO3_DB']->exec_INSERTquery('sys_products_orders', $insertFields);\n\t\t\t$newId = $GLOBALS['TYPO3_DB']->sql_insert_id();\n\n\t\t\tif (\n\t\t\t\t!$newId &&\n\t\t\t\t(\n\t\t\t\t\tget_class($GLOBALS['TYPO3_DB']->getDatabaseHandle()) == 'mysqli'\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\t$rowArray = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid', 'sys_products_orders', 'uid=LAST_INSERT_ID()', '');\n\t\t\t\tif (\n\t\t\t\t\tisset($rowArray) &&\n\t\t\t\t\tis_array($rowArray) &&\n\t\t\t\t\tisset($rowArray['0']) &&\n\t\t\t\t\tis_array($rowArray['0'])\n\t\t\t\t) {\n\t\t\t\t\t$newId = $rowArray['0']['uid'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $newId;\n\t}",
"function _prePayment( $data ) {\n $app = JFactory::getApplication();\n $this->http = HttpFactory::getHttp();\n $vars = new JObject();\n $vars->order_id = $data['order_id'];\n $vars->orderpayment_id = $data['orderpayment_id'];\n $vars->orderpayment_amount = $data['orderpayment_amount'];\n $vars->orderpayment_type = $this->_element;\n $vars->button_text = $this->params->get( 'button_text', 'J2STORE_PLACE_ORDER' );\n $vars->display_name = 'پرداخت با رای پی';\n $vars->user_id = $this->params->get( 'user_id', '' );\n $vars->marketing_id = $this->params->get( 'marketing_id', '' );\n $vars->sandbox = $this->params->get( 'sandbox', '' );\n\n // Customer information\n $orderinfo = F0FTable::getInstance( 'Orderinfo', 'J2StoreTable' )\n ->getClone();\n $orderinfo->load( [ 'order_id' => $data['order_id'] ] );\n\n $name = $orderinfo->billing_first_name . ' ' . $orderinfo->billing_last_name;\n $all_billing = $orderinfo->all_billing;\n $all_billing = json_decode( $all_billing );\n $mail = $all_billing->email->value;\n $phone = $orderinfo->billing_phone_2;\n\n if ( empty( $phone ) )\n {\n $phone = !empty( $orderinfo->billing_phone_1 ) ? $orderinfo->billing_phone_1 : '';\n }\n\n // Load order\n F0FTable::addIncludePath( JPATH_ADMINISTRATOR . '/components/com_j2store/tables' );\n $orderpayment = F0FTable::getInstance( 'Order', 'J2StoreTable' )\n ->getClone();\n $orderpayment->load( $data['orderpayment_id'] );\n\n if ( $vars->user_id == NULL || $vars->user_id == '' || $vars->marketing_id == NULL || $vars->marketing_id == '' )\n {\n $msg = 'لطفا شناسه کاربری و شناسه کسب و کار را برای افزونه رای پی تنظیم نمایید .';\n $vars->error = $msg;\n $orderpayment->add_history( $msg );\n $orderpayment->store();\n\n return $this->_getLayout( 'prepayment', $vars );\n }\n else\n {\n $user_id = $vars->user_id;\n $marketing_id = $vars->marketing_id;\n $sandbox = !($vars->sandbox == 'no');\n //$sandbox = !($this->params->get('sandbox', '') == 'no');\n\n $amount = round( $vars->orderpayment_amount, 0 );\n $desc = ' خرید از فروشگاه چی 2 استور با شماره سفارش ' . $vars->order_id;\n $callback = JRoute::_( JURI::root() . \"index.php?option=com_j2store&view=checkout\" ) . '&orderpayment_type=' . $vars->orderpayment_type . '&order_id=' . $data['orderpayment_id'] . '&task=confirmPayment';\n $invoice_id = round(microtime(true) * 1000);\n\n if ( empty( $amount ) )\n {\n $msg = 'مبلغ پرداخت صحیح نمی باشد.';\n $vars->error = $msg;\n $orderpayment->add_history( $msg );\n $orderpayment->store();\n\n return $this->_getLayout( 'prepayment', $vars );\n }\n\n $data = array(\n 'amount' => strval($amount),\n 'invoiceID' => strval($invoice_id),\n 'userID' => $user_id,\n 'redirectUrl' => $callback,\n 'factorNumber' => strval($data['orderpayment_id']),\n 'marketingID' => $marketing_id,\n 'email' => $mail,\n 'mobile' => $phone,\n 'fullName' => $name,\n 'comment' => $desc,\n 'enableSandBox' => $sandbox\n );\n\n $url = 'https://api.raypay.ir/raypay/api/v1/Payment/pay';\n\t\t\t$options = array('Content-Type: application/json');\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER,$options );\n\t\t\t$result = curl_exec($ch);\n\t\t\t$result = json_decode($result );\n\t\t\t$http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n\t\t\tcurl_close($ch);\n// $result = $this->http->post($url, json_encode($data, true), $options);\n// $result = json_decode($result->body);\n// $http_status = $result->StatusCode;\n\n if ( $http_status != 200 || empty($result) || empty($result->Data) )\n {\n $msg = sprintf('خطا هنگام ایجاد تراکنش. کد خطا: %s - پیام خطا: %s', $http_status, $result->Message);\n $vars->error = $msg;\n $vars->data = json_encode($data);\n $orderpayment->add_history( $msg );\n $orderpayment->store();\n\n return $this->_getLayout( 'prepayment', $vars );\n }\n\n // Save invoice id\n $orderpayment->transaction_id = $invoice_id;\n $orderpayment->store();\n\n\n $token = $result->Data;\n $link='https://my.raypay.ir/ipg?token=' . $token;\n $vars->link = $link;\n return $this->_getLayout( 'prepayment', $vars );\n }\n }",
"public static function getProductsOrder($type, $value = null, $prefix = false)\n {\n }",
"function getProductRate($sell_type,$pid)\n\t {\t\n\t \n\t \tob_start();\n\t\t $sql=\"select * from \".INFINITE_PRODUCT_DETAIL.\" where product_id='\".$pid.\"'\";\n\t\t$result= $this->db->query($sql,__FILE__,__LINE__);\n\t\t$row= $this->db->fetch_array($result);\n\t\t ?>\n <input name=\"unit_price[]\" readonly=\"readonly\" style=\"width:100px\" class=\"cost\" value=\"<?php if($sell_type=='bundel' or $sell_type=='kg') echo $row['bundel_price']; else echo $row['pices_price']; ?>\" type=\"text\">\n <?php \n\t\t $html = ob_get_contents();\n\t\tob_end_clean();\n\t\treturn $html;\n\t }",
"public function order(){\n\t\tif($this->request->is('post')){\n\t\t\t$post_data = $this->request->input('json_decode',true);\n\t\t\t//pr($post_data);die();\n\t\t\t$outOfStockProducts = $this->checkAvailableProductInstock($post_data['cart']);\n\t\t\tif(sizeof($outOfStockProducts) < 1){\n\t\t\t\t//pr($post_data);\n\t\t\t\t$shippingDetails = $post_data['shippingDetail'];\n\t\t\t\t\n\t\t\t\tif(isset($shippingDetails['shippingCost'])){\n\t\t\t\t\t$shippingDetails['shipping_cost'] = $shippingDetails['shippingCost'];\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t$orderDetail['cart'] = $post_data['cart'];\n\t\t\t\tif(isset($post_data['discount'])){\n\t\t\t\t\t$orderDetail['discount'] = $post_data['discount'];\n\t\t\t\t}\n\t\t\t\t$couponId = '';\n\t\t\t\tif(isset($post_data['couponData'])){\n\t\t\t\t\t$orderDetail['couponData'] = $post_data['couponData'];\n\t\t\t\t\t$couponId = $post_data['couponData']['couponId'];\n\t\t\t\t}\n\t\t\t\tif(isset($shippingDetails['paymentMethod'])){\n\t\t\t\t\t$shippingDetails['paymentMethod'] = $shippingDetails['paymentMethod'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//$clientDetails = $post_data['userDetail'];\n\t\t\t\t\t\n\t\t\t\t//pr($details);\n\t\t\t\t\n\t\t\t\t$ready_data['ProductOrder']['order_detail'] \t= json_encode($orderDetail);\n\t\t\t\t$ready_data['ProductOrder']['shipping_detail']\t= json_encode($shippingDetails);\n\t\t\t\t$ready_data['ProductOrder']['status'] \t\t\t= 'ordered';\n\t\t\t\t\n\t\t\t\t$clientDetails = $post_data['userDetail'];\n\t\t\t\t$userData = array();\n\t\t\t\t$userData['username'] = $clientDetails['username'];\n\t\t\t\t$updated = true;\n\t\t\t\tif($post_data['accountSatus'] == 'registered'){\n\t\t\t\t\t$userData['id'] = $clientDetails['id'];\n\t\t\t\t\tunset( $clientDetails['id'],$clientDetails['username']);\n\t\t\t\t\t\n\t\t\t\t\t$userData['details'] = json_encode($clientDetails);\n\t\t\t\t\t$updated = $this->updateClientInfo($userData);\n\t\t\t\t\t$userData['details'] = json_encode(array_merge($clientDetails,$post_data['clientAddressStr']));\n\t\t\t\t\t$ready_data['ProductOrder']['client_detail'] \t= json_encode($userData);\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tif($post_data['accountSatus'] == 'registration'){\n\t\t\t\t\t\n\t\t\t\t\t\t$userData['status'] = 'active';\n\t\t\t\t\t\t$userData['password'] = $clientDetails['password'];\n\t\t\t\t\t\tunset($clientDetails['username'],$clientDetails['password']);\n\t\t\t\t\t\t$userData['details'] = json_encode($clientDetails);\n\t\t\t\t\t\t$updated = $this->updateClientInfo($userData);\n\t\t\t\t\t\tunset($userData['status'],$userData['password']);\n\t\t\t\t\t\t$userData['details'] = json_encode(array_merge($clientDetails,$post_data['clientAddressStr']));\n\t\t\t\t\t\t$ready_data['ProductOrder']['client_detail'] \t= json_encode($userData);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tunset($clientDetails['username'],$clientDetails['password']);\n\t\t\t\t\t\t$userData['details'] = json_encode(array_merge($clientDetails,$post_data['clientAddressStr']));\n\t\t\t\t\t\t$ready_data['ProductOrder']['client_detail'] \t= json_encode($userData);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//pr($updated);die();\n\t\t\t\t//$this->updateClientInfo($clientDetails);\n\t\t\t\t//pr($ready_data);\n\t\t\t \tif($updated){\n\t\t\t\t\tif($this->ProductOrder->save($ready_data)){\n\t\t\t\t\t\n\t\t\t\t\t\t$order_id = $this->ProductOrder->getInsertId();\n\t\t\t\t\t\tif(!empty($couponId)){\n\t\t\t\t\t\t\t$this->alterCouponStatus($couponId);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$response['status'] = true;\n\t\t\t\t\t\t//$response['message'] = $payment_url;\n\t\t\t\t\t\t$response['orderId'] = $order_id;\n\t\t\t\t\t\tif($shippingDetails['paymentMethod'] == 'cod'){\n\t\t\t\t\t\t\t$orderData = $this->ProductOrder->find('first',array('recursive'=>0,'conditions'=>array('ProductOrder.id'=>$order_id)));\n\t\t\t\t\t\t\tif(!empty($orderData)){\n\t\t\t\t\t\t\t\t$this->sendOrderEmail($orderData);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$response['message'] = $updated;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$response['status'] = false;\n\t\t\t\t\t\t$response['message'] = 'Please try fgfghfgh';\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$response['status'] = false;\n\t\t\t\t\t$response['message'] = 'Please try again.';\n\t\t\t\t} \n\t\t\t\t \n\t\t\t}else{\n\t\t\t\t$response['status'] = false;\n\t\t\t\t$response['outOfStockProducts'] = $outOfStockProducts; \n\t\t\t}\n\t\t\t\t \n\t\t}else{\n\t\t\t$response = array('message'=>'Invalid Request');\n\t\t}\n\t\n\t\t$this->set(\n\t\t\tarray(\n\t\t\t\t'_serialize',\n\t\t\t\t'data' => array('ecommerceCheckout'=> $response),\n\t\t\t\t'_jsonp' => true\n\t\t\t)\n\t\t);\n\t\t$this->render('data_layout');\n\t\n\t}",
"public function repositionProductCategory()\r\n {\r\n\t\r\n\t$list_order = $_POST['position'];\r\n\t$list = explode(',' , $list_order);\r\n\t$i = 1;\r\n\tforeach($list as $id)\r\n\t{\r\n\t $sql= \"UPDATE productcategory SET position='$i' WHERE id ='$id'\" ;\t\r\n\t $result[]=$this->db->query($sql);\r\n\t $i++;\r\n\t $query[]=$sql;\r\n\t //echo $sql.\"<br>\";\r\n\t}\r\n\tprint_r($query);\r\n }",
"function order($idKlant, $idAddress, $totaalprijs, $db, $bezorgen, $korting, $email)\n{\n// Berekend korting bij de totaalbrijs\n $afTeTrekkenPrijs = (($totaalprijs / 100) * $korting);\n ($totaalprijs -= $afTeTrekkenPrijs);\n// Rekent 50 extra bij de totaalprijs op wanneer er voor bezorgen is gekozen\n if ($bezorgen == 1) {\n ($totaalprijs += 50);\n }\n\n// Plaatst de order\n $query = \"INSERT INTO orders (orders_idKlant, orders_idAddress, totaalprijs, betaald, bezorgen) VALUES ('$idKlant', '$idAddress', '$totaalprijs', false, $bezorgen)\";\n $db->exec($query);\n if ($query) {\n//Pakt het order id van de net gemaakte order\n $sql = \"SELECT idOrders FROM orders WHERE orders_idKlant = '$idKlant' AND orders_idAddress = '$idAddress' AND totaalprijs = '$totaalprijs'\";\n $stmt = $db->prepare($sql);\n $stmt->execute(array());\n $result = $stmt->fetch(PDO::FETCH_ASSOC);\n if ($sql) {\n// Maakt voor elk artikel in de winkelwagen een order regel aan met de juiste gegevens\n foreach ($_SESSION['artikelen'] as $pId => $items) {\n $idOrders = $result[\"idOrders\"];\n $idArtikel = $items[\"id\"];\n $categorie = $items[\"categorie\"];\n $aantal = $items[\"aantal\"];\n $empty = '';\n// Kijkt of een product een koopproduct is\n if ($categorie == 1) {\n $now = date('Y-m-d', strtotime(' + 1 days'));\n $query = \"INSERT INTO orderregel (orderRegel_idArtikel, orderRegel_idOrders, bestelDatum, retourDatum, aantal) VALUES ('$idArtikel', '$idOrders', '$now', '$empty', '$aantal')\";\n $db->exec($query);\n// Kijkt of een product een Huurproduct is\n } else {\n $bestelDatum = $items[\"startDatum\"];\n $retourDatum = $items[\"eindDatum\"];\n $query = \"INSERT INTO orderregel (orderRegel_idArtikel, orderRegel_idOrders, bestelDatum, retourDatum, aantal) VALUES ('$idArtikel', '$idOrders', '$bestelDatum', '$retourDatum', '$aantal')\";\n $db->exec($query);\n }\n }\n// Verwijdert alle artikelen uit de winkelwagen en herlaad de pagina\n $_SESSION['artikelen'] = array();\n echo '<script language=\"javascript\">';\n echo 'alert(\"Uw reservering is verzonden. \\nBij het ophalen of bezorgen moet u €' . $totaalprijs . ' betalen.\")';\n echo '</script>';\n\n echo \"<script>window.location = 'shoppingCart.php';</script>\";\n }\n }\n}",
"public function add()\n {\n\t\tinclude(\"dbs.php\");\n\t\t$query=\"INSERT INTO order_table (Organizationfull, Organizationshort, FIOdir, Positiondir, Reasondir, Phonedir, FIOcont, Positioncont, Phonecont, Email, INN, KPP, OGRN, Schet,Korrschet,BIK,Bankname,Addrlegal,Addrfact,Comment) VALUES ('$this->Organizationfull', '$this->Organizationshort', '$this->FIOdir', '$this->Positiondir', '$this->Reasondir', '$this->Phonedir', '$this->FIOcont', '$this->Positioncont', '$this->Phonecont', '$this->Email', '$this->INN', '$this->KPP', '$this->OGRN', '$this->Schet', '$this->Korrschet', '$this->BIK', '$this->Bankname', '$this->Addrlegal', '$this->Addrfact', '$this->Comment')\";\n\t\tmysqli_query($dbcnx, $query);\n\t $seq = mysqli_insert_id ($dbcnx);\n\t\techo $query;\n\t\tforeach ($this->items as $key => $val)\n\t\t{\n\t\t\t$query=\"INSERT INTO items (order_id, name, quantity) VALUES ('$seq','$val->Product', '$val->Quantity')\";\n\t\t\t//echo $query;\n\t\t\tmysqli_query($dbcnx, $query);\n\t\t}\n return(\"<p>Ваша заявка принята, с вами свяжется ответственный исполнитель</p>\");\n }",
"public function reorder()\n {\n $this->load->language('account/order');\n\n if (isset($this->request->get['order_id'])) {\n $orderId = $this->request->get['order_id'];\n } else {\n $orderId = 0;\n }\n\n $this->load->model('account/order');\n\n $orderInfo = $this->model_account_order->getOrder($orderId);\n if ($orderInfo) {\n if (isset($this->request->get['order_product_id'])) {\n $orderProductId = $this->request->get['order_product_id'];\n } else {\n $orderProductId = 0;\n }\n\n $orderProductInfo = $this->model_account_order->getOrderProduct($orderId, $orderProductId);\n if ($orderProductInfo) {\n $this->load->model('catalog/product');\n $productInfo = $this->model_catalog_product->getProduct($orderProductInfo['product_id']);\n if ($productInfo) {\n $optionData = [];\n $orderOptions = $this->model_account_order->getOrderOptions(\n $orderProductInfo['order_id'],\n $orderProductId\n );\n foreach ($orderOptions as $orderOption) {\n if ($orderOption['type'] == 'select' ||\n $orderOption['type'] == 'radio' ||\n $orderOption['type'] == 'image'\n ) {\n $optionData[$orderOption['product_option_id']] = $orderOption['product_option_value_id'];\n } elseif ($orderOption['type'] == 'checkbox') {\n $optionData[$orderOption['product_option_id']][] = $orderOption['product_option_value_id'];\n } elseif ($orderOption['type'] == 'text' ||\n $orderOption['type'] == 'textarea' ||\n $orderOption['type'] == 'date' ||\n $orderOption['type'] == 'datetime' ||\n $orderOption['type'] == 'time'\n ) {\n $optionData[$orderOption['product_option_id']] = $orderOption['value'];\n } elseif ($orderOption['type'] == 'file') {\n $optionData[$orderOption['product_option_id']] = $this->encryption->encrypt(\n $this->config->get('config_encryption'),\n $orderOption['value']\n );\n }\n }\n\n $this->cart->add($orderProductInfo['product_id'], $orderProductInfo['quantity'], $optionData);\n $this->session->data['success'] = sprintf(\n $this->language->get('text_success'),\n $this->url->link('product/product', 'product_id=' . $productInfo['product_id']),\n $productInfo['name'],\n $this->url->link('checkout/cart')\n );\n unset($this->session->data['shipping_method']);\n unset($this->session->data['shipping_methods']);\n unset($this->session->data['payment_method']);\n unset($this->session->data['payment_methods']);\n } else {\n $this->session->data['error'] = sprintf(\n $this->language->get('error_reorder'),\n $orderProductInfo['name']\n );\n }\n }\n }\n\n $this->response->redirect($this->url->link('account/order/info', 'order_id=' . $orderId));\n }",
"public function add($order_detail = array()) {\n //Get pro_cost\n foreach ($order_detail['products_id'] as $key => $pro_id) {\n $query = $this->db->get_where('tbtt_product', array('pro_id' => $pro_id), 1, 0);\n $product = $query->result_array();\n $product = $product[0];\n $data = array(\n 'order_id' => $order_detail['order_id'],\n 'pro_id' => $pro_id,\n 'pro_price' => (float)$product['pro_cost'],\n 'af_id' => $order_detail['af_id'],\n 'af_rate' => (float)$product['af_rate'],\n 'af_amt' => (float)$product['af_amt'],\n 'qty' => (int)$order_detail['qtys'][$key],\n// 'lastStatus' => \n );\n $this->db->insert($this->_table, $data);\n } \n }"
] | [
"0.59487814",
"0.58189493",
"0.58114356",
"0.579688",
"0.5772052",
"0.5735433",
"0.5634734",
"0.5622074",
"0.56144357",
"0.5611773",
"0.5597873",
"0.55400926",
"0.5539096",
"0.5526673",
"0.5503863",
"0.549183",
"0.54749817",
"0.5469163",
"0.5467949",
"0.5465611",
"0.54525656",
"0.54430866",
"0.53968924",
"0.53862464",
"0.53498876",
"0.5334606",
"0.5314313",
"0.53115284",
"0.5310142",
"0.52997047"
] | 0.7221781 | 0 |
Checks we have a valid shop. | protected function validateShop(Request $request)
{
// Setup the session service
$session = new ShopSession();
// Grab the shop's myshopify domain from query or session
$shopDomainParam = $request->get('shop');
$shopDomainSession = $session->getDomain();
$shopDomain = ShopifyApp::sanitizeShopDomain($shopDomainParam ?? $shopDomainSession);
// Get the shop based on domaian
$shop = ShopifyApp::shop($shopDomain);
$flowType = null;
if ($shop === null
|| $shop->trashed()
|| ($shopDomain && $shopDomain !== $shop->shopify_domain) === true
|| ($shopDomain && $shopDomainSession && $shopDomain !== $shopDomainSession) === true
) {
// We need to do a full flow
$flowType = AuthShopHandler::FLOW_FULL;
} elseif ($session->setShop($shop) && !$session->isValid()) {
// Just a session issue, do a partial flow if we can...
$flowType = $session->isType(ShopSession::GRANT_PERUSER) ?
AuthShopHandler::FLOW_FULL :
AuthShopHandler::FLOW_PARTIAL;
}
if ($flowType !== null) {
// We have a bad session
return $this->handleBadSession(
$flowType,
$session,
$request,
$shopDomain
);
}
// Everything is fine!
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function checkShopIsSupported()\n\t\t{\n\t\t\t$lang_id = Configuration::get('PS_LANG_DEFAULT');\n\t\t\t$shop_country_id = Configuration::get('PS_COUNTRY_DEFAULT');\n\t\t\t$shop_country = new Country($shop_country_id, $lang_id);\n\t\t\treturn in_array($shop_country->iso_code, $this->allowed_country_codes);\n\t\t}",
"private function configurationPageIsValid()\n\t\t{\n\t\t\t$errors = array();\n\n\t\t\tif (trim(Tools::getValue('PS_SHOP_NAME')) == '' || !Validate::isString(Tools::getValue('PS_SHOP_NAME')))\n\t\t\t\tarray_push($errors, '<li>'.$this->l('Please check yout shop name.').'</li>');\n\n\t\t\tif (trim(Tools::getValue('PS_SHOP_ADDR1')) == '' || !Validate::isString(Tools::getValue('PS_SHOP_ADDR1')))\n\t\t\t\tarray_push($errors, '<li>'.$this->l('Please check your shops address').'</li>');\n\n\t\t\tif (trim(Tools::getValue('PS_SHOP_CODE')) == '' || !Validate::isString(Tools::getValue('PS_SHOP_CODE')))\n\t\t\t\tarray_push($errors, '<li>'.$this->l('Please check your shops zipcode').'</li>');\n\n\t\t\tif (trim(Tools::getValue('PS_SHOP_CITY')) == '' || !Validate::isString(Tools::getValue('PS_SHOP_CITY')))\n\t\t\t\tarray_push($errors, '<li>'.$this->l('Please check your shops city').'</li>');\n\n\t\t\tif (trim(Tools::getValue('PS_SHOP_PHONE')) == '' || !Validate::isPhoneNumber(Tools::getValue('PS_SHOP_PHONE')))\n\t\t\t\tarray_push($errors, '<li>'.$this->l('Please check your shops phone number').'</li>');\n\n\t\t\tif (trim(Tools::getValue('PS_SHOP_EMAIL')) == '' || !Validate::isEmail(Tools::getValue('PS_SHOP_EMAIL')))\n\t\t\t\tarray_push($errors, '<li>'.$this->l('Please check your shops email address').'</li>');\n\n\t\t\tif (trim(Tools::getValue('API_USER_ID')) == '' || !Validate::isInt(Tools::getValue('API_USER_ID')))\n\t\t\t\tarray_push($errors, '<li>'.$this->l('Please check your API User ID').'</li>');\n\n\t\t\tif (trim(Tools::getValue('API_PASS')) == '' || !Validate::isString(Tools::getValue('API_PASS')))\n\t\t\t\tarray_push($errors, '<li>'.$this->l('Please check your API password').'</li>');\n\n\t\t\tif (trim(Tools::getValue('API_HMAC_KEY')) == '' || !Validate::isString(Tools::getValue('API_HMAC_KEY')))\n\t\t\t\tarray_push($errors, '<li>'.$this->l('Please check your API HMAC key').'</li>');\n\n\t\t\tif (trim(Tools::getValue('API_COUNTRY')) == '' || !Validate::isString(Tools::getValue('API_COUNTRY')))\n\t\t\t\tarray_push($errors, '<li>'.$this->l('Please check your API country').'</li>');\n\n\t\t\tif (trim(Tools::getValue('SHIPPING_STATUS')) == '' || !Validate::isString(Tools::getValue('SHIPPING_STATUS')))\n\t\t\t\tarray_push($errors, '<li>'.$this->l('Please check the shipping status').'</li>');\n\n\t\t\tif (count($errors))\n\t\t\t{\n\t\t\t\t$this->config_contents .= $this->displayError($this->l('The following errors occured: ').'<ul>'.implode(' ', $errors).'</ul>');\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}",
"public function testShopsShow()\n {\n // Create a test shop with filled out fields\n $shop = $this->createShop();\n\n // Check the API for the new entry\n $response = $this->json('GET', \"api/v1/shops/{$shop->id}\");\n\n // Delete the test shop\n $shop->delete();\n\n $response\n ->assertStatus(201)\n ->assertJson([\n 'data' => true\n ]);\n }",
"public static function validate() {\n// avoid hack attempts during the checkout procedure by checking the internal cartID\n if (!isset($_SESSION['shipping'], $_SESSION['sendto'], $_SESSION['cart']->cartID, $_SESSION['cartID'])\n || ($_SESSION['cart']->cartID !== $_SESSION['cartID']))\n {\n tep_redirect(tep_href_link('checkout_shipping.php', '', 'SSL'));\n }\n }",
"public function testShopsStore()\n {\n $shop = $this->createShop();\n $shop = $shop->toArray();\n echo $shop['name'];\n // Category is required (see StoreShops Request validator)\n $shop['category'] = 1;\n\n $response = $this->json('POST', \"api/v1/shops/\", $shop);\n (\\KushyApi\\Posts::class)::destroy($shop['id']);\n\n $response\n ->assertStatus(201)\n ->assertJson([\n 'data' => [\n 'name' => $shop['name'],\n 'categories' => [\n ['category_id' => $shop['category'] ]\n ]\n ]\n ]);\n }",
"public function checkHasProducts(){\n\t\tif ( sizeof( $this->order->products ) < 1 ) {\n\t\t\tzen_redirect( zen_href_link( FILENAME_SHOPPING_CART ) );\n\t\t}\n\t}",
"public function check()\n\t{\n\t\t$query = 'SELECT price_id FROM ' . $this->_table_prefix . 'product_price WHERE shopper_group_id = \"'\n\t\t\t. $this->shopper_group_id . '\" AND product_id = ' . (int) $this->product_id\n\t\t\t. ' AND price_quantity_start <= ' . $this->_db->quote($this->price_quantity_start)\n\t\t\t. ' AND price_quantity_end >= ' . $this->_db->quote($this->price_quantity_start) . '';\n\n\t\t$this->_db->setQuery($query);\n\t\t$xid = intval($this->_db->loadResult());\n\n\t\t$query_end = 'SELECT price_id FROM ' . $this->_table_prefix . 'product_price WHERE shopper_group_id = \"'\n\t\t\t. $this->shopper_group_id . '\" AND product_id = ' . (int) $this->product_id\n\t\t\t. ' AND price_quantity_start <= ' . $this->_db->quote($this->price_quantity_end)\n\t\t\t. ' AND price_quantity_end >= ' . $this->_db->quote($this->price_quantity_end) . '';\n\n\t\t$this->_db->setQuery($query_end);\n\t\t$xid_end = intval($this->_db->loadResult());\n\n\t\tif (($xid || $xid_end) && (($xid != intval($this->price_id) && $xid != 0) || ($xid_end != intval($this->price_id) && $xid_end != 0)))\n\t\t{\n\t\t\t$this->_error = JText::sprintf('WARNNAMETRYAGAIN', JText::_('COM_REDSHOP_PRICE_ALREADY_EXISTS'));\n\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}",
"public function isValid(): bool\n {\n return $this->getShipment()->countShippableUnits() >= 0;\n }",
"public static function isShop($parameter) {\r\n\r\n\t\treturn !self::isEmpty($parameter);\r\n\t}",
"private function checkExecutionPermissions()\n {\n /** @var PsAccountRepository $psAccountRepository */\n $psAccountRepository = $this->module->getService('ps_checkout.repository.prestashop.account');\n\n if ($this->shopId !== $psAccountRepository->getShopUuid()) {\n throw new PsCheckoutException('shopId wrong', PsCheckoutException::PSCHECKOUT_WEBHOOK_SHOP_ID_INVALID);\n }\n\n return true;\n }",
"private function validateCheckout() {\n\n if (!filter_var($this->apiUrl, FILTER_VALIDATE_URL))\n $this->errors[] = 'The configuration URL in configuration file is malformed or missing: \"' . $this->apiUrl . '\"';\n\n if (empty($this->merchantId) ||\n (strlen($this->merchantId) < 36 && $this->apiVersion == '3') )\n $this->errors[] = 'The configured Merchant ID in configuration file is incorrect or missing: \"'. $this->merchantId .'\"';\n\n //TODO: validate required fields\n\n\n if (count($this->errors) > 0) return false;\n\n return true;\n }",
"public function __construct($shop)\n {\n $this->shop = $shop;\n }",
"public function only_real_book_can_be_checked() {\n// $this->withoutExceptionHandling();\n $user = factory(User::class)->create();\n\n $this->be($user)->post('checkout/122')\n ->assertStatus(404);\n\n\n $this->assertCount(0, Reservation::all());\n }",
"public function __construct(Shop $shop)\n {\n $this->shop = $shop;\n }",
"private function _checkGoodslist()\n {\n if (!is_array($this->goodsList) || empty($this->goodsList)) {\n throw new Klarna_MissingGoodslistException;\n }\n }",
"private function _validateCartStep()\n {\n //simulate server error, un-comment line below\n //return;\n\n $cart = geoCart::getInstance();\n\n //use text off of the details page\n $cart->site->messages = $this->messages = $cart->db->get_text(true, 9);\n\n $step = $cart->cart_variables['step'];\n $userId = (int)$_GET['userId'];\n $adminId = (int)$_GET['adminId'];\n\n $session = geoSession::getInstance();\n\n $sessionUser = $session->getUserId();\n\n $checkUser = ($adminId) ? $adminId : $userId;\n\n if ($checkUser && !$sessionUser) {\n //user was logged in, now logged out\n return $this->_error($this->messages[502227]);\n }\n if ($sessionUser != $checkUser) {\n //user different than when started?\n return $this->_error($this->messages[502228]);\n }\n\n //check to make sure there is an item in there\n if (!$cart->item) {\n //oops, no item in cart, can't go forward. Not on details step error msg\n return $this->_error($this->messages[502229]);\n }\n\n //make sure the step is not one of the built in ones\n if ($step !== 'combined' && strpos($step, ':') === false) {\n //They are on a built-in step, not details. Not on details step error msg\n return $this->_error($this->messages[502229]);\n }\n\n //make sure the order items that are OK to be attached to\n $validItems = geoOrderItem::getParentTypesFor('images');\n\n if (!in_array($cart->item->getType(), $validItems)) {\n //oops! this isn't a valid order item... Not on details step error msg\n return $this->_error($this->messages[502229]);\n }\n\n //Go ahead and get max images from the cart\n require_once CLASSES_DIR . 'order_items/images.php';\n $this->maxImages = (int)imagesOrderItem::getMaxImages();\n\n //got this far, they should be on images step...\n return true;\n }",
"private function validateItems($items) {\n\t\t// current items from DB\n\t\t$model = new RokQuickCartModelRokQuickCart();\n\t\t$stock = $model->getItems(); \t\t\t\t\n\t\t\n\t\t// currency\n\t\t$option = jfactory::getapplication()->input->get('option');\n\t\t$com_params = jcomponenthelper::getparams($option);\n\t\t$currency = $com_params->get('page_title');\n\t\t\n\t\t// perform check\n\t\t$result = false;\n\t\t$index = 0;\n\t\tforeach ($items as $item):\n\t\t\t$index++;\n\t\t\tforeach ($stock as $stockItem):\n\t\t\t\tif($item->id == $stockItem->id && \n\t\t\t\t\t$item->unit_price == $stockItem->price &&\n\t\t\t\t\t$item->currency_id == $currency && $item->quantity > 0\n\t\t\t\t\t)\t\t\t\t\t\n\t\t\t\t{\n\t\t\t\t\t$result = true;\n\t\t\t\t}\n\t\t\tendforeach;\n\t\t\tif(!$result) { // breaks, the item does NOT match\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse if($index < count($items)){\n\t\t\t\t$result = false; // item is OK, reset the result (if not end of array)\n\t\t\t}\n\t\tendforeach;\n\t\t\n\t\t// return result\n\t\treturn $result;\t\t\n\t}",
"public function shop_type_store(Request $request){\n\t\t$this->validate($request, [\n\t 'product_type' => 'required',\n\t 'boutique_type' => 'required',\n\t 'country_id' => 'required',\n\t ]);\n\t //session\n\t $shop['product_type'] = $request->product_type; \n\t $shop['boutique_type'] = $request->boutique_type; \n\t $shop['country_id'] = $request->country_id;\n\t $request->session()->put('shop', $shop);\n\n\t return redirect('my-shop/profile');\n\t}",
"public function show(Shop $shop)\n {\n //\n }",
"public function show(Shop $shop)\n {\n //\n }",
"public function isValid(){\r\n\r\n\t\tif(empty($this->entity->getId())){\r\n\t\t\t$this->_messages[] = \"ID cannot be null\";\r\n\t\t}\r\n\r\n\t\tif($this->entity->getQuantity() < 0){\r\n\t\t\t$this->_messages[] = \"A quantity cannot be negative\";\r\n\t\t}\r\n\r\n\t\tif(($this->entity->getQuantity() == 0) && $this->entity->getIsAvailable()){\r\n\t\t\t$this->messages[] = \"There cannot be an available variant with no stock\";\r\n\t\t}\r\n\r\n\t\tif(empty($this->entity->getSize())){\r\n\t\t\t$this->messages[] = \"The variant must have a size defined\";\r\n\t\t}\r\n\r\n\t\tif(empty($this->entity->getPrice())){\r\n\t\t\t$this->messages[] = \"The variant must have a price defined\";\r\n\t\t}\r\n\r\n\t\tif(empty($this->entity->getProduct())){\r\n\t\t\t$this->messages[] = \"The variant is not assigned to a product\";\r\n\t\t}\r\n\t\t\r\n\t\treturn (count($this->messages) <= 0);\r\n\t}",
"function isValidInsert($product) {\n\treturn isset($product['description']) &&\n\tisset($product['image_path']) && isset($product['price']) && \n\tisset($product['shipping_cost']) && isset($product['product_type_id']);\t\t\n}",
"public function checkOrder() {\n //start tracking errors\n $errors = [];\n\n $cart = new stdClass();\n $addresses = \\CI::Customers()->get_address_list($this->customer->id);\n foreach($addresses as $address)\n {\n if($address['id'] == $this->cart->shipping_address_id)\n {\n $cart->shippingAddress = (object)$address;\n }\n if($address['id'] == $this->cart->billing_address_id)\n {\n $cart->billingAddress = (object)$address;\n }\n }\n\n //check shipping\n if($this->orderRequiresShipping())\n {\n if(!$this->getShippingMethod())\n {\n $errors['shipping'] = lang('error_choose_shipping');\n }\n\n if(empty($cart->shippingAddress))\n {\n $errors['shippingAddress'] = lang('error_shipping_address');\n }\n }\n\n if(empty($cart->billingAddress))\n {\n $errors['billingAddress'] = lang('error_billing_address');\n }\n\n //check coupons\n $checkCoupons = $this->checkCoupons();\n if(!empty($checkCoupons))\n {\n $errors['coupons'] = $checkCoupons;\n }\n\n //check the inventory of our products\n $inventory = $this->checkInventory();\n if(!empty($inventory))\n {\n $errors['inventory'] = $inventory;\n }\n\n //if we have errors, return them\n if(!empty($errors))\n {\n return $errors;\n }\n }",
"public function valid()\n {\n\n if ($this->container['addToCartButton'] === null) {\n return false;\n }\n if ($this->container['addToCompareButton'] === null) {\n return false;\n }\n if ($this->container['priceInfo'] === null) {\n return false;\n }\n if ($this->container['images'] === null) {\n return false;\n }\n if ($this->container['url'] === null) {\n return false;\n }\n if ($this->container['id'] === null) {\n return false;\n }\n if ($this->container['name'] === null) {\n return false;\n }\n if ($this->container['type'] === null) {\n return false;\n }\n if ($this->container['isSalable'] === null) {\n return false;\n }\n if ($this->container['storeId'] === null) {\n return false;\n }\n if ($this->container['currencyCode'] === null) {\n return false;\n }\n if ($this->container['extensionAttributes'] === null) {\n return false;\n }\n return true;\n }",
"function checkCartEmpty()\r\n\t{\r\n\t\tglobal $_SETTINGS;\r\n\t\tglobal $_REQUEST;\r\n\t\tglobal $_POST;\r\n\t\tglobal $_COOKIE;\r\n\t\tglobal $_SESSION;\r\n\t\t\t\r\n\t\t$sessionrandomphrase = md5($_SETTINGS['session_random_phrase']);\r\n\t\t$cartid\t\t= $_SESSION['shoppingcart-'.$sessionrandomphrase.''];\r\n\t\t\r\n\t\t// GET CART ITEMS\r\n\t\t$selinsert = \t\"SELECT * FROM ecommerce_product_cart_relational WHERE \".\r\n\t\t\t\t\t\t\"shopping_cart_id='\".$cartid.\"'\";\r\n\t\t$selresult = \tdoQuery($selinsert);\r\n\t\t\t\t\t\r\n\t\t$selnum = mysql_num_rows($selresult);\r\n\t\t\r\n\t\tif($selnum > 0){\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}",
"public function checkInventory()\n {\n $errors = [];\n\n //if we do not allow overstock sale, then check stock otherwise return an empty array\n if(!config_item('allow_os_purchase'))\n {\n foreach($this->items as $item)\n {\n if($item->type == 'product')\n {\n $stock = \\CI::Products()->getProduct($item->product_id);\n if((bool)$stock->track_stock && $stock->quantity < $item->quantity)\n {\n if ($stock->quantity < 1)\n {\n $errors[$item->id] = lang('this_item_is_out_of_stock'); //completely out of stock.\n }\n else\n {\n $errors[$item->id] = str_replace('{quantity}', $stock->quantity, lang('not_enough_stock_quantity'));\n }\n }\n }\n }\n }\n return $errors;\n }",
"private function checkCart() {\n\t\t\n\t\tif (isset($_SESSION['shoppingcart']) && is_array($_SESSION['shoppingcart']) && count($_SESSION['shoppingcart'])>0)\n\t\t{\n\t\t\t$this->__result['func'] = 'showCart';\n\t\t\t$this->__result['valid'] = 'ok';\n\t\t\techo json_encode($this->__result); \n\t\t}\n\t\telse {\n\t\t\t$this->__result['func'] = 'showCart';\n\t\t\t$this->__result['valid'] = 'nok';\n\t\t\techo json_encode($this->__result);\n\t\t}\n\t\t\n\t\t\n\t}",
"public function checkShopUrl()\n {\n $seller = $this->seller->findOneByField([\n 'url' => trim(request()->input('url'))\n ]);\n\n return response()->json([\n 'available' => $seller ? false : true\n ]);\n }",
"public function testValidate(): void\n {\n $this->assertTrue(method_exists(ShopAdmin::class, 'validate'));\n }",
"public function is_shopname_exists($shopname) {\n $Query = \"SELECT shopname FROM shop WHERE customerno=$this->customerno AND shopname='%s' AND isdeleted=0\";\n $SQL = sprintf($Query, Sanitise::String($shopname));\n $this->executeQuery($SQL);\n if ($this->get_rowCount() > 0) {\n return true;\n } else {\n return false;\n }\n }"
] | [
"0.63794065",
"0.6138495",
"0.5976858",
"0.59359276",
"0.58954865",
"0.5890473",
"0.5860809",
"0.5850606",
"0.58216846",
"0.56730634",
"0.56708336",
"0.5587944",
"0.55826473",
"0.5564119",
"0.55344033",
"0.5456267",
"0.5453",
"0.543185",
"0.5420016",
"0.5420016",
"0.5419054",
"0.53898466",
"0.5375351",
"0.53691703",
"0.53662723",
"0.5365648",
"0.535502",
"0.5332196",
"0.5331955",
"0.53257895"
] | 0.7055506 | 0 |
Handles a bad shop session. | protected function handleBadSession(
string $type,
ShopSession $session,
Request $request,
string $shopDomain = null
) {
// Clear all session variables (domain, token, user, etc)
$session->forget();
// Set the return-to path so we can redirect after successful authentication
Session::put('return_to', $request->fullUrl());
// Depending on the type of grant mode, we need to do a full auth or partial
return Redirect::route(
'authenticate',
[
'type' => $type,
'shop' => $shopDomain,
]
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function handle_sessions() {\n\t\t\t// this will require updating sessions and everything, particularly for flashes\n\t\t}",
"function _badRequest() {\n if (Configure::read('forceSSL') && !$this->RequestHandler->isSSL()) {\n $this->_forceSSL();\n } else {\n $this->redirect(array('controller' => 'error', 'action' => 'error'));\n }\n exit;\n }",
"public static function checkForValidSession(): void\n {\n if (session_status() === PHP_SESSION_ACTIVE && !$_SESSION['activeGame']) {\n self::flash('warning', 'Invalid session or your session has expired. Ending game.');\n }\n }",
"function report_session_error() {\n global $CFG, $FULLME;\n\n if (empty($CFG->lang)) {\n $CFG->lang = \"en\";\n }\n // Set up default theme and locale\n theme_setup();\n moodle_setlocale();\n\n //clear session cookies\n setcookie('MoodleSession'.$CFG->sessioncookie, '', time() - 3600, $CFG->sessioncookiepath, $CFG->sessioncookiedomain, $CFG->cookiesecure, $CFG->cookiehttponly);\n setcookie('MoodleSessionTest'.$CFG->sessioncookie, '', time() - 3600, $CFG->sessioncookiepath, $CFG->sessioncookiedomain, $CFG->cookiesecure, $CFG->cookiehttponly);\n\n //increment database error counters\n if (isset($CFG->session_error_counter)) {\n set_config('session_error_counter', 1 + $CFG->session_error_counter);\n } else {\n set_config('session_error_counter', 1);\n }\n redirect($FULLME, get_string('sessionerroruser2', 'error'), 5);\n }",
"function upgrade_error( $session ) {\n\t\t$session['status'] = self::STATUS_ERROR;\n\t\t$this->save_session( $session );\n\t\t$this->unschedule();\n\t}",
"public function callbackFail()\n {\n $this->AddOutput(\"<p><i>Något gick fel.</i></p>\");\n $this->saveInSession = true;\n $this->redirectTo('users/login');\n }",
"protected function _not_logged_in () {\n\t\t\t$this->session->set( 'return-to', Request::$current->url() );\n\t\t\tthrow new HTTP_Exception_401();\n\t\t}",
"public function exceptionAction()\n {\n if (!$this->_validatePlationlineData()) {\n $this->_redirect('checkout/cart');\n return;\n }\n $this->_exceptionProcess();\n }",
"public function failSession()\n\t{\n\t\t//\n\t\t// Init local storage.\n\t\t//\n\t\t$session = $this->session();\n\t\t\n\t\t//\n\t\t// Close session.\n\t\t//\n\t\t$session->offsetSet( kTAG_SESSION_END, TRUE );\n\t\t$session->offsetSet( kTAG_SESSION_STATUS, kTYPE_STATUS_FAILED );\n\t\t\n\t\treturn FALSE;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// ==>\n\n\t}",
"public static function preventSessionFix()\n {\n if (!isset( $_SESSION['SERVER_SID'] )) {\n // delete session content\n session_unset();\n $_SESSION = array();\n\n // restart session\n session_destroy();\n session_start();\n\n // generate new session id\n session_regenerate_id(true);\n\n // save status that serverSID is given\n $_SESSION['SERVER_SID'] = true;\n }\n }",
"public function handle_session_timeout() {\n global $SESSION;\n\n /// Check for timed out sessions\n if (!empty($SESSION->has_timed_out)) {\n unset($SESSION->has_timed_out);\n set_moodle_cookie('');\n notification::error(get_string('sessionerroruser', 'error'));\n }\n }",
"public function error_validation_session_check()\n{\n\tif(!isset($_SESSION['user_login']))\n\t{\n\t\t\tredirect('Home','refresh');\n\t}\n}",
"protected function _expireAjax()\n {\n if (!Mage::getSingleton('checkout/session')->getQuote()->hasItems()) {\n $this->getResponse()->setHeader('HTTP/1.1','403 Session Expired');\n exit;\n }\n }",
"protected function _expireAjax()\n {\n if (!Mage::getSingleton('checkout/session')->getQuote()->hasItems()) {\n $this->getResponse()->setHeader('HTTP/1.1','403 Session Expired');\n exit;\n }\n }",
"function bad_login()\n\t{\n\t}",
"public function testCheckoutProcedureErrorCases()\n {\n $checkoutData = [\n \"client_name\" => \"Test Test\",\n \"client_address\" => \"St. Anton am Arlberg, Austria\",\n \"shipping_option\" => \"express\",\n \"cardNumber\" => \"4111111111111111\",\n \"expiryDate\" => \"11/22\",\n \"cvc\" => \"123\"\n ];\n // Create Session Data using random product id\n $session['cart'] = ['products' => [[\"id\" => 1, \"quantity\" => 1]]];\n\n\n // If no session set it should redirect to homepage with Errors\n $this->post('/checkout')->assertRedirect('/')->assertSessionHasErrors();\n\n // Send post checkout data without setting session\n // Should redirect to homepage with errors\n $this->post('/checkout', $checkoutData)->assertRedirect('/')->assertSessionHasErrors();\n\n\n // Send post data & set session data too without seeding the db ( should throw pollution error )\n $this->withSession($session)->post('/checkout', $checkoutData)->assertRedirect('/')->assertSessionHasErrors();\n }",
"public function it_does_not_store_coupon_for_invalid_code(){\n\n $response = $this->get('/promotions/invalid-code');\n\n $response->assertRedirect('/#buy-now');\n $response->assertSessionMissing('coupon_id');\n\n }",
"public function throw()\n {\n session(\"yatzy\")->moveDice();\n // session(\"yatzy\")->showPost();\n\n return redirect()->route('yatzy');\n }",
"function exception_handler($e) {\n \t\n \tglobal $oSession;\n \t\n \t$oSession->SetErrorCode($e->getCode());\n \t$oSession->SetErrorData($e->getMessage());\n \t$oSession->Save();\n \n \tLogger::Msg($e);\n \tdie();\n \t//Http::Redirect(\"/\".ROUTE_ERROR); \n }",
"function checkBadSearch()\r\n\t{\r\n\t if (array_key_exists('BAD_SEARCH', $_SESSION))\r\n\t {\r\n\t\tif ($_SESSION['BAD_SEARCH'])\r\n\t\t{\r\n\t\t echo \"<FONT COLOR='#ff0000'> <h4> Bad search please try again!</h4></FONT>\" ;\r\n\t\t $_SESSION['BAD_SEARCH'] = false;\r\n\t\t}\r\n\t }\r\n\t}",
"function boing(){\n\theader(\"location:http://asiascatcreations.com/order-now/\");\n\tunset($_SESSION['product_9_quantity']);\n\tunset ($_SESSION['product_10_quantity']);\n\tunset ($_SESSION['product_11_quantity']);\n\tunset ($_SESSION['product_12_quantity']); \n\tunset ($_SESSION['product_13_quantity']);\n\tdie();\n}",
"private function handleSessionException(\\Exception $exception)\n {\n if ($exception instanceof \\Magento\\Framework\\Exception\\SessionException) {\n $this->_response->setRedirect($this->_request->getDistroBaseUrl());\n $this->_response->sendHeaders();\n return true;\n }\n return false;\n }",
"protected function _checkForErrorsToRedirect()\n {\n if ( oxRegistry::getSession()->getVariable( 'pm_init_data' ) ) {\n $sUrl = oxRegistry::getConfig()->getShopCurrentUrl() . \"cl=payment\";\n $sUrl = oxRegistry::get( \"oxUtilsUrl\" )->processUrl( $sUrl );\n\n oxRegistry::getUtils()->redirect( $sUrl, false );\n }\n }",
"public function checkSession()\r\n {\r\n if($this->session->getValue('exists'))\r\n {\r\n $this->redirect(\"/home\");\r\n }\r\n }",
"public static function UserNotLoggedInAction() {\n\t\theader('Location: ' . Config::LOGIN_PAGE_URL);\n\t\tdie(); // DO NOT REMOVE THIS. The request must end here.\n\t}",
"function wputh_admin_protect_die_bad_request() {\n do_action('wputh_admin_protect_die_bad_request__custom_action');\n @header('HTTP/1.1 403 Forbidden');\n @header('Status: 403 Forbidden');\n @header('Connection: Close');\n die;\n}",
"function RegisterBadLogon()\n {\n if ($this->BadLogonRegistered!=0) { return; }\n\n $login=strtolower($this->GetPOST(\"Login\"));\n\n $time=time();\n\n //All sessions with attempted Login OR IP address\n //$where=\"Login='\".$login.\"' OR IP='\".$_SERVER[ \"REMOTE_ADDR\" ].\"'\";\n $where=\n $this->Sql_Table_Column_Name_Qualify(\"Login\").\n \"=\".\n $this->Sql_Table_Column_Value_Qualify($login);\n \n $sessions=$this->SelectHashesFromTable($this->GetSessionsTable(),$where);\n\n if (count($sessions)>0)\n {\n foreach ($sessions as $id => $session)\n {\n $session[ \"Login\" ]=$login;\n $session[ \"IP\" ]=$_SERVER[ \"REMOTE_ADDR\" ];\n $session[ \"ATime\" ]=$time;\n $session[ \"LastAuthenticationAttempt\" ]=$time;\n $session[ \"Authenticated\" ]=1; //1, is not auth, enum!\n $session[ \"LastAuthenticationSuccess\" ]=-1;\n $session[ \"NAuthenticationAttempts\" ]++;\n\n $this->MySqlUpdateItem\n (\n $this->GetSessionsTable(),\n $session,$where\n );\n $this->SessionAddMsg(\"Removing bad session: \".$session[ \"Login\" ]);\n }\n }\n else\n { \n $session=array\n (\n \"SID\" => -1,\n \"LoginID\" => $this->LoginData[ \"ID\" ],\n \"Login\" => $login,\n \"LoginName\" => $this->LoginData[ \"Name\" ],\n \"CTime\" => $time,\n \"ATime\" => $time,\n \"IP\" => $_SERVER[ \"REMOTE_ADDR\" ],\n \"Authenticated\" => 1, //1, is not auth, enum!\n \"LastAuthenticationAttempt\" => $time,\n \"LastAuthenticationSuccess\" => -1,\n \"NAuthenticationAttempts\" => 1,\n );\n\n $this->MySqlInsertItem($this->GetSessionsTable(),$session);\n }\n\n $this->BadLogonRegistered=1;\n }",
"function notLoggedInStore(){\n\t\tif(loggedInStore() == false){\n\n header(\"location:store-login-reg.php\");\n\t\t}\n\t}",
"public function testErrorIsPassedToLoginForNonDebug()\n {\n $response = $this->get('/billing');\n $response->assertRedirect('/login');\n $response->assertSessionHas('error', 'Unable to get shop domain.');\n }",
"protected function runProcessingIfInvalidCsrfToken()\n\t{\n\t\t$this->sendJsonAccessDeniedResponse('Wrong csrf token');\n\t}"
] | [
"0.6443329",
"0.6132211",
"0.6020195",
"0.59712297",
"0.58191955",
"0.58083016",
"0.57396156",
"0.5731619",
"0.5724632",
"0.5698072",
"0.5639584",
"0.56260794",
"0.5608995",
"0.5608995",
"0.55915576",
"0.5552631",
"0.55519956",
"0.5519839",
"0.54452115",
"0.5445009",
"0.54438144",
"0.54269844",
"0.53645754",
"0.53378755",
"0.53308713",
"0.5317178",
"0.5314807",
"0.5290603",
"0.52758706",
"0.52754885"
] | 0.6693206 | 0 |
Display Top 3 Organiztaions. | public function getTop()
{
$organization = Organization::limit(3)->get();
return response()->json(compact('organization'),200);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function index()\n { \n $topCompanies = \\DB::select('SELECT tblCustCompany.strCompanyName as name, COUNT(strCompanyID) as ctr FROM tblJobOrder,tblCustCompany WHERE tblCustCompany.strCompanyID = tblJobOrder.strJO_CustomerCompanyFK GROUP BY strCompanyID ORDER BY ctr DESC limit 3');\n // dd($topCustomers);\n\n return view('queries.queries-top-companies')\n ->with('topCompanies', $topCompanies);\n }",
"function getTopArtists($max_entries = null)\n\t{\n\t\treturn $this->getGenericLevel3('topartists', 'user', $max_entries);\n\t}",
"protected function _getOrganizationsList()\r\n {\r\n $html = new \\MUtil_Html_Sequence();\r\n $sql = '\r\n SELECT *\r\n FROM gems__organizations\r\n WHERE gor_active=1 AND gor_url IS NOT NULL AND gor_task IS NOT NULL\r\n ORDER BY gor_name';\r\n\r\n // $organizations = array();\r\n // $organizations = array(key($organizations) => reset($organizations));\r\n $organizations = $this->db->fetchAll($sql);\r\n $orgCount = count($organizations);\r\n\r\n\r\n switch ($orgCount) {\r\n case 0:\r\n return $html->pInfo(sprintf($this->_('%s is still under development.'), $this->project->getName()));\r\n\r\n case 1:\r\n $organization = reset($organizations);\r\n\r\n $p = $html->pInfo(sprintf($this->_('%s is run by: '), $this->project->getName()));\r\n $p->a($organization['gor_url'], $organization['gor_name']);\r\n $p->append('.');\r\n\r\n $html->pInfo()->sprintf(\r\n $this->_('Please contact the %s if you have any questions regarding %s.'),\r\n $organization['gor_name'],\r\n $this->project->getName()\r\n );\r\n\r\n return $html;\r\n\r\n default:\r\n\r\n $p = $html->pInfo(sprintf(\r\n $this->_('%s is a collaboration of these organizations:'),\r\n $this->project->getName()\r\n ));\r\n\r\n $data = \\MUtil_Lazy::repeat($organizations);\r\n $ul = $p->ul($data, array('class' => 'indent'));\r\n $li = $ul->li();\r\n $li->a($data->gor_url->call($this, '_'), $data->gor_name, array('rel' => 'external'));\r\n $li->append(' (');\r\n $li->append($data->gor_task->call(array($this, '_')));\r\n $li->append(')');\r\n\r\n $html->pInfo()->sprintf(\r\n $this->_('You can contact any of these organizations if you have questions regarding %s.'),\r\n $this->project->getName()\r\n );\r\n\r\n return $html;\r\n }\r\n }",
"public function index()\n {\n return Organization::latest()->paginate(10);\n }",
"function _c4m_user_profile_organisations($text) {\n $results = [];\n\n if (strlen($text) >= 3) {\n $query = db_select('field_data_c4m_organisation', 'o')\n ->distinct()\n ->condition('c4m_organisation_value', db_like($text) . '%', 'LIKE')\n ->fields('o', ['c4m_organisation_value'])\n ->orderBy('c4m_organisation_value', 'ASC')\n ->range(0, 10);\n $results = $query->execute()->fetchCol();\n }\n\n drupal_json_output($results);\n}",
"public function displayTopContributor($limit=3, $close = NULL)\n\t\t\t{\n\t\t\t\t$this->displayTopContributor_arr\t=\tarray();\n\t\t\t\t$this->displayTopContributor_arr['top_contributors']\t=\t$top_contributors = $this->getTopContributorIds($limit);\n\t\t\t\t$this->displayTopContributor_arr['have_contributors']\t=\t$have_contributors = false;\n\t\t\t\tif ($top_contributors)\n\t\t\t\t\t{\n\t\t\t\t\t\t$i\t=\t0;\n\t\t\t\t\t\t$inc\t=\t0;\n\t\t\t\t\t\t$this->displayTopContributor_arr['row']\t=\tarray();\n\t\t\t\t\t\tforeach($top_contributors as $eachMember)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->displayTopContributor_arr['row'][$inc]['userDetails']\t=\t$userDetails = $this->getUserDetails($eachMember);\n\t\t\t\t\t\t\t\tif (!$userDetails)\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t$this->displayTopContributor_arr['have_contributors']\t=\t$have_contributors = true;\n\t\t\t\t\t\t\t\t$this->displayTopContributor_arr['row'][$inc]['uid']\t=\t$uid \t\t= $userDetails['user_id'];\n\t\t\t\t\t\t\t\t$this->displayTopContributor_arr['row'][$inc]['userLog']\t=\t$userLog \t= $this->getUserLog($uid);\n\t\t\t\t\t\t\t $this->displayTopContributor_arr['row'][$inc]['uname']\t=\t$uname \t\t= $userDetails['name'];\n\t\t\t\t\t\t\t\t$this->displayTopContributor_arr['row'][$inc]['userLevelClass']\t=\t$userLevelClass = '';\n\n\t\t\t\t\t\t\t\tif($userLog['total_points']<= 100)\n\t\t\t\t\t\t\t\t\t$this->displayTopContributor_arr['row'][$inc]['point_class'] = 'clsUserPoint100';\n\t\t\t\t\t\t\t\telseif($userLog['total_points']<= 500)\n\t\t\t\t\t\t\t\t\t$this->displayTopContributor_arr['row'][$inc]['point_class'] = 'clsUserPoint500';\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t$this->displayTopContributor_arr['row'][$inc]['point_class'] = 'clsUserPoint1000';\n\n\t\t\t\t\t\t\t\tif($this->CFG['admin']['user_levels']['allowed'])\n\t\t\t\t\t\t\t\t\t$this->displayTopContributor_arr['row'][$inc]['userLevelClass']\t=\t$userLevelClass = getUserLevelClass($userLog['total_points']);\n\t\t\t\t\t\t\t\t$i++;\n\t\t\t\t\t\t\t\t$this->displayTopContributor_arr['row'][$inc]['clsOddOrEvenBoard']\t=\t$clsOddOrEvenBoard = 'clsEvenBoard';\n\t\t\t\t\t\t\t\tif ($i%2)\n\t\t\t\t\t\t\t\t\t$this->displayTopContributor_arr['row'][$inc]['clsOddOrEvenBoard']\t=\t$clsOddOrEvenBoard = 'clsOddBoard';\n\t\t\t\t\t\t\t\t$this->displayTopContributor_arr['row'][$inc]['userDetails']['image_id']\t=\t$userDetails['image_id'] = 'dta';\n\t\t\t\t\t\t\t\t$this->displayTopContributor_arr['row'][$inc]['mysolutions_url']\t=\tgetMemberUrl($uid, $uname);\n\t\t\t\t\t\t\t\t$this->displayTopContributor_arr['row'][$inc]['stripString_display_name']\t=\tstripString($userDetails['display_name'], 16);\n\t\t\t\t\t\t\t\t$inc++;\n\t\t\t\t\t\t\t} //foreach\n\t\t\t\t\t\tif ($have_contributors)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$this->displayTopContributor_arr['topcontributors_url']\t=\tgetUrl('topcontributors', '', '', '', $this->CFG['admin']['index']['home_module']);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\treturn $this->displayTopContributor_arr;\n\t\t\t}",
"public function view_organization(){\n \n $this->select_data();\n }",
"function getTopAlbums($max_entries = null)\n\t{\n\t\treturn $this->getGenericLevel3('topalbums', 'user', $max_entries);\n\t}",
"public function gettopfiveAction()\n {\n $ar = KC\\Repository\\User::getTopFiveForAutoComp($this->getRequest()->getParam('for'),$this->getRequest()->getParam('text'));\n echo Zend_Json::encode($ar);\n die();\n }",
"function top_show($options) \n{\n\t$SHOW_RECOMMEND = false;\n\t$LIMIT_RECOMMEND = 3;\n\n\t$DIRNAME = empty( $options[0] ) ? basename( dirname( dirname( __FILE__ ) ) ) : $options[0];\n\n\t$order = $options[1];\n\t$limit = intval($options[2]);\n\t$title_length = intval($options[3]);\n\t$cat_title_length = intval($options[4]);\n\t$desc_length = intval($options[5]);\n\t$newdays = intval($options[6]);\n\t$popular = intval($options[7]);\n\t$max_width = intval($options[8]);\n\t$width_default = intval($options[9]);\n\n\t$gm_mode = isset($options[10]) ? intval($options[10]) : 0;\n\t$gm_latitude = isset($options[11]) ? floatval($options[11]) : 0;\n\t$gm_longitude = isset($options[12]) ? floatval($options[12]) : 0;\n\t$gm_zoom = isset($options[13]) ? intval($options[13]) : 0;\n\t$gm_height = isset($options[14]) ? intval($options[14]) : 0;\n\t$gm_timeout = isset($options[15]) ? intval($options[15]) : 0;\n\n// use config value\n//\t$gm_desc_length = isset($options[16]) ? intval($options[16]) : 0;\n//\t$gm_wordwrap = isset($options[17]) ? intval($options[17]) : 0;\n//\t$gm_marker_width = isset($options[18]) ? intval($options[18]) : 0;\n\n// NOT use\n//\t$gm_control = isset($options[19]) ? intval($options[19]) : 1;\n//\t$gm_type_control = isset($options[20]) ? intval($options[20]) : 1;\n\n// time_create\n\tif (($order != 'hits')&&($order != 'rating')&&($order != 'time_create')) {\n\t\t$order = 'time_update';\n\t}\n\n\t$lid_array = array();\n\n\t$block = array();\n\t$block['dirname'] = $DIRNAME;\n\t$block['lang_hits'] = _MB_WEBLINKS_HITS;\n\t$block['lang_rating'] = _MB_WEBLINKS_RATING;\n\t$block['lang_votes'] = _MB_WEBLINKS_VOTES;\n\t$block['lang_comments'] = _MB_WEBLINKS_COMMENTS;\n\t$block['lang_more'] = _MB_WEBLINKS_MORE;\n\n\t$gm_links = array();\n\t$show_webmap = false;\n\t$webmap_div_id = '';\n\t$webmap_func = '';\n\t$webmap_style = '';\n\n// config\n\t$conf =& weblinks_get_config( $DIRNAME );\n\tif ( !isset($conf['broken_threshold']) )\n\t{\treturn $block;\t}\n\n\t$broken = $conf['broken_threshold'];\n\n\t$link_param = array(\n\t\t'order' => $order,\n\t\t'title_length' => $title_length,\n\t\t'cat_title_length' => $cat_title_length,\n\t\t'desc_length' => $desc_length,\n\t\t'newdays' => $newdays,\n\t\t'popular' => $popular,\n\t\t'max_width' => $max_width,\n\t\t'width_default' => $width_default,\n\n// hack for multi language\n\t\t'is_japanese_site' => weblinks_multi_is_japanese_site(),\n\t);\n\n\t$rows1 = $this->get_rows_order_in_link( $order, $broken, $limit );\n\tif ( !is_array($rows1) || !count($rows1) ) {\n\t\treturn $block;\n\t}\n\n\tforeach ( $rows1 as $row1 ) {\n\t\t$lid_array[] = $row1['lid'];\n\t\t$link = $this->build_link($row1, $link_param);\n\t\t$block['links'][] = $link;\n\n\t\tif ( $link['google_use'] ) {\n\t\t\t$gm_links[] = $link;\n\t\t}\n\t}\n\n// randum recommend link\n\tif ( $SHOW_RECOMMEND && $LIMIT_RECOMMEND )\n\t{\n\t\t$rows3 = $this->get_rows_recommend_in_link( $broken, $LIMIT_RECOMMEND );\n\t\tif ( !is_array($rows3) || !count($rows3) ) {\n\t\t\treturn $block;\n\t\t}\n\n\t\tforeach ( $rows3 as $row3 ) {\n\t\t\t$link = $thos->build_link($row3, $link_param);\n\t\t\t$block['recommend_links'][] = $link;\n\n// not in latest link\n\t\t\tif ( !in_array($row3['lid'], $lid_array)&& $link['google_use'] ) {\n\t\t\t\t$gm_links[] = $link;\n\t\t\t}\n\t\t}\n\t}\n\n\t$block['show_recommend'] = $SHOW_RECOMMEND;\n\n// google map\n\t$gm_name = $DIRNAME . '_b_' .$order;\n\t$gm_param = array(\n\t\t'dirname' => $DIRNAME ,\n\t\t'latitude' => $gm_latitude,\n\t\t'longitude' => $gm_longitude,\n\t\t'zoom' => $gm_zoom,\n\t\t'name' => $gm_name,\n\t\t'mode' => $gm_mode,\n\t\t'style_height' => $gm_height ,\n\t\t'links' => $gm_links ,\n\t\t'conf' => $conf ,\n\t);\n\n\t$webmap_param = $this->_webmap_class->build_map_block( $gm_param );\n\tif ( is_array($webmap_param) ) {\n\t\t$show_webmap = $webmap_param['show_webmap'];\n\t\t$webmap_div_id = $webmap_param['webmap_div_id'];\n\t\t$webmap_func = $webmap_param['webmap_func'];\n\t\t$webmap_style = $webmap_param['webmap_style'];\n\t}\n\n\t$block['show_webmap'] = $show_webmap;\n\t$block['webmap_div_id'] = $webmap_div_id;\n\t$block['webmap_func'] = $webmap_func;\n\t$block['webmap_style'] = $webmap_style;\n\t$block['webmap_timeout'] = $gm_timeout;\n\n\treturn $block;\n}",
"public function top()\n\t{\n\t\t// callables to fetch user data\n\t\t$fetchUsers = function($start, $pageSize) {\n\t\t\treturn array(\n\t\t\t\tqa_opt('cache_userpointscount'),\n\t\t\t\tqa_db_select_with_pending(qa_db_top_users_selectspec($start, $pageSize))\n\t\t\t);\n\t\t};\n\t\t$userScore = function($user) {\n\t\t\treturn qa_html(qa_format_number($user['points'], 0, true));\n\t\t};\n\n\t\t$qa_content = $this->rankedUsersContent($fetchUsers, $userScore);\n\n\t\t$qa_content['title'] = empty($qa_content['ranking']['items'])\n\t\t\t? qa_lang_html('main/no_active_users')\n\t\t\t: qa_lang_html('main/highest_users');\n\n\t\t$qa_content['ranking']['sort'] = 'points';\n\n\t\treturn $qa_content;\n\t}",
"public function beheerOrganisatoren()\r\n {\r\n // Standaardvariabelen\r\n $data['titel'] = 'Organisatoren beheren';\r\n $data['paginaverantwoordelijke'] = 'Joren Synaeve';\r\n // Organisatoren laden\r\n $this->load->model('persoon_model');\r\n $data['organisatoren'] = $this->persoon_model->getAllWhereTypeId('1');\r\n // Laden van pagina\r\n $partials = array('hoofding' => 'hoofding',\r\n 'inhoud' => 'organisator/beheerOrganisatoren',\r\n 'voetnoot' => 'voetnoot');\r\n $this->template->load('main_master', $partials, $data);\r\n }",
"function displayProjects($arrProjects) {\n\n\t// Need a clear here; otherwise, e.g. when the number of projects\n\t// in the \"Projects\" section is 1, the \"Followed projects\" title\n\t// will show up on the same line as the first project int the\n\t// \"Projects\" section. \n\techo \"<div style='clear: both;'></div>\";\n\n\t$retStr = '';\n\t$numRecs = count($arrProjects);\n\tif ($numRecs == 0) {\n\t\t// No records available.\n\t\treturn $retStr;\n\t}\n\n\tif ($numRecs <= NUM_PROJECTS_TO_SHOW) {\n\n\t\t// \"See all\" not needed.\n\n\t\tfor ($cnt = 0; $cnt < $numRecs; $cnt++) {\n\t\t\t$retStr .= genProjectRecDisplay($arrProjects[$cnt]);\n\t\t}\n\t}\n\telse {\n\n\t\t// \"See all\" needed.\n\n\t\tfor ($cnt = 0; $cnt < NUM_PROJECTS_TO_SHOW; $cnt++) {\n\t\t\t// The related items shown before \"See all\".\n\t\t\t$retStr .= genProjectRecDisplay($arrProjects[$cnt]);\n\t\t}\n\n\t\t$retStr .= \"<div class='related_link'>\";\n\t\t$retStr .= '<h2><a href=\"#\" onclick=\"' . \n\t\t\t\t'$(' . \"'.related_more').show();\" . \n\t\t\t\t'$(' . \"'.related_link').hide();\" .\n\t\t\t\t'return false;' . \n\t\t\t'\">See all</a></h2>';\n\t\t$retStr .= \"</div>\";\n\n\t\t$retStr .= \"<div class='related_more' style='display:none'>\";\n\t\t// The rest of the related items.\n\t\tfor ($cnt = NUM_PROJECTS_TO_SHOW; $cnt < $numRecs; $cnt++) {\n\t\t\t$retStr .= genProjectRecDisplay($arrProjects[$cnt]);\n\t\t}\n\t\t$retStr .= \"</div><!-- related_more -->\";\n\t}\n\n\treturn $retStr;\n}",
"function ra_top_users($limit = 5, $size){\n\t$users = qa_db_select_with_pending(qa_db_top_users_selectspec(qa_get_start()));\n\t\n\t$output = '<ul class=\"top-users-list clearfix\">';\n\t$i = 1;\n\tforeach($users as $u){\n\t\tif(defined('QA_WORDPRESS_INTEGRATE_PATH')){\n\t\t\trequire_once QA_INCLUDE_DIR.'qa-app-posts.php';\n\t\t\t$u['handle'] = qa_post_userid_to_handle($u['userid']);\n\t\t}\n\t\t\n\t\t$output .= '<li class=\"top-user\">';\n\t\t$output .= '<div class=\"avatar pull-left\" data-handle=\"'.$u['handle'].'\" data-id=\"'. qa_handle_to_userid($u['handle']).'\">';\n\t\t$output .= ra_get_avatar($u['handle'], $size).'</div>';\n\t\t$output .= '<div class=\"top-user-data\">';\n\t\t\n\t\t$output .= '<a href=\"'.qa_path_html('user/'.$u['handle']).'\" class=\"name\">'.ra_name($u['handle']).'</a>';\n\t\t\n\t\t//$output .= ra_user_badge($u['handle']);\t\n\t\t$output .= '<dl class=\"points\">'.$u['points'].' '._ra_lang('Points').'</dl>';\t\t\n\t\t$output .= '</div>';\n\t\t$output .= '</li>';\n\t\tif($i==$limit)break;\n\t\t$i++;\n\t\n\t}\n\t$output .= '</ul>';\n\techo $output;\n}",
"public function viewTopFourAction() {\n\n $this->db->select('*')\n ->from(\"comment WHERE title NOT LIKE '%Reply%' ORDER BY timestamp DESC LIMIT 4\");\n $top_new = $this->db->executeFetchAll();\n\n $this->db->select('*')\n ->from(\"comment WHERE title NOT LIKE '%Reply%' ORDER BY timestamp ASC LIMIT 4\");\n $top_old = $this->db->executeFetchAll();\n\n $this->db->select('idTag, COUNT(idTag) as tc')\n ->from('assigntags GROUP BY idTag ORDER BY tc DESC LIMIT 4');\n $top_tags = $this->db->executeFetchAll();\n foreach ($top_tags as $value) {\n $value->tag = $this->assignTags->getTagName($value->idTag)->name;\n }\n\n $this->db->select('userId, COUNT(userId) as uc')\n ->from('comment GROUP BY userId ORDER BY uc DESC LIMIT 4');\n $top_users = $this->db->executeFetchAll();\n foreach ($top_users as $value) {\n $value->name = $this->users->find($value->userId)->name;\n }\n\n $this->views->add('comment/topfour', [\n 'new' => $top_new,\n 'tags' => $top_tags,\n 'users' => $top_users,\n 'old' => $top_old,\n 'title' => 'stats',\n ]);\n\n }",
"private function topCategories(){\n return Categories::selectRaw('EC.id,EC.name,EC.title,EC.slug,EC.category_image_url,EC.featured,\n (SELECT count(E.id) FROM experiences E WHERE E.category_id = EC.id) as total_exp'\n )->from('experience_categories as EC')->orderBy('total_exp','DESC')->limit(3)->get();\n }",
"function top($data){\n # check and remove defaults\n $info = array();\n if($data['box'] == 'short'){\n $info['box'] = 'short';\n }\n if($data['cabin'] == 'crew'){\n $info['cabin'] = 'crew';\n }\n if($data['drivetrain'] == '4x4'){\n $info['drivetrain'] = '4x4';\n }\n\n return $this->sentence($data['action'], $info);\n }",
"public function loadTopNavPanel() {\n\t\t$director = $this->model->selectAlldirector();\n\t\t$actor = $this->model->selectAllactor();\n\t\t$genre = $this->model->selectAllgenre();\n\t\t$studio = $this->model->selectAllstudio();\n\t\tif (($director != null) && ($actor != null) && ($genre != null)) {\n\t\t\t$this->view->topNavPanel($director, $actor, $genre, $studio);\n\t\t}\n\t\telse {\n\t\t\t$error = $this->model->getError();\n\t\t\tif (!empty($error))\n\t\t\t\t$this->view->showError($error);\n\t\t}\n\t}",
"protected function index(){\n $no_of_pages = \"\";\n $pagintaionEnabled = config('kloves.enablePagination');\n if ($pagintaionEnabled) {\n $no_of_pages = config('kloves.paginateListSize');\n }\n $organizations = $this->organization->organization_list(\"\", $no_of_pages);\n $data = [\n 'organizations' => $organizations\n ];\n return view('organizations.listing')->with($data);\n }",
"public function actionTopBlogs() {\n $this->setView('blog/topbloglist');\n $this->pagetitle = 'Top blogs';\n $this->content->heading = 'Top blogs';\n // find IDs of topbloggers\n $userids = BaseDAO::factory('Blogpost')->findTopBloggerIds();\n $this->content->userids = $userids;\n // get the blogs of these IDs\n $this->content->users = BaseDAO::factory('User')->findManyById($userids);\n }",
"public function getUserOrganizations();",
"function topTen()\n {\n $array = $this->model->getTopTen();\n $result = array();\n foreach($array as $name => $value) {\n //truncate array, return only ID and title\n $value = array_slice($value,0,2);\n $result[] = $value;\n }\n return $result;\n }",
"public function showAlbumsOrderByArtist(){\n\n $albums = $this->model->getAlbumsOrderArtist();\n\n //se la paso a la vista jeje\n $this->view->showAlbumsOrderByArtist($albums);\n }",
"public function index()\n\t{\n\t\t$organizers = Organizers::orderBy('name')->paginate(15);\n\n\t\t$matbrs = array('0' => 'Izaberite matični broj') + Organizers::lists('mat_br','mat_br');\n\t\t$pibs = array('0' => 'Izaberite PIB') + Organizers::lists('pib','pib');\n\t\t$names = array('0' => 'Izaberite naziv') + Organizers::lists('name','name');\n\t\t$addresses = array('0' => 'Izaberite adresu') + Organizers::lists('address','address');\n\t\t$phones = array('0' => 'Izaberite teelefon') + Organizers::lists('phone','phone');\n\t\t$webs = array('0' => 'Izaberite web sajt') + Organizers::lists('web','web');\n\t\t$emails = array('0' => 'Izaberite email') + Organizers::lists('email','email');\n\n\t\treturn View::make('organizators', array('pibs' => $pibs, 'matbrs'=>$matbrs, 'names'=>$names, 'addresses'=>$addresses, 'phones'=>$phones,'webs'=>$webs,\"emails\"=>$emails))->nest('orgzPartial', 'orgzPartial', array('organizators' => $organizers));\n\t}",
"function rendertopitemslist($list, $itemtype, $num=10) {\n $count;\n echo '<div class=\"toplist\">\n <ol>';\n foreach ($list as $item => $total) {\n if ($item == \"\") { continue; }\n $count++; // may no longer be needed.\n $itemurlencode = urlencode($item);\n echo \"<li><a href=\\\"?task=itemdetails&item=$itemurlencode&itemtype=$itemtype\\\">$item\n </a>($total) </li>\";\n if ($count >= $num) { break; }\n }\n echo \"</ol>\n </div>\";\n}",
"function printACategoryOfProjects($name, $projects, $authorizedStates, $archivedProjectsAuthorized = false)\n{\n $noProjectDisplayed = true; //default value\n echo '<h2 class=\"mt-4\">' . $name . '</h2>\n <div class=\"divGroups margin-5px\">'; //name of category and start of div\n foreach ($projects as $project) {\n if (isAtLeastEqual($project['state'], $authorizedStates)) { //accept only project with states authorized by the category\n if ($project['archived'] == 1) { //if project is archived\n if ($archivedProjectsAuthorized) { //display only if authorized\n printAProject($project);\n }\n } else {\n printAProject($project);\n }\n $noProjectDisplayed = false; //at least one project has been display (so no msg to say \"no project in this category\")\n }\n }\n //If no project has been displayed, display a information message\n if ($noProjectDisplayed) {\n echo \"<p class='marginplus5px'>Aucun projet de cette catégorie...</p>\";\n }\n\n echo \"</div>\";\n echo \"<hr class='hryellowproject'>\"; //horizontal separator line\n}",
"function top_sucesos() {\n\t\tinclude_once 'connections/guayana_s.php';\n\t\t$conexion=new Conexion();\n\t\t$db=$conexion->getDbConn();\n\t\t$db->debug = false;\n\t\t$db->SetFetchMode(ADODB_FETCH_ASSOC);\n\t\t$query_sucesos = $db->Prepare(\"SELECT suceso_id, fecha_suceso As fecha_suceso, delito_id, delito_detalle_id,\n\t\t\ttitulo, nombre_victima, fuente\n\t\t\tFROM sucesos As s\n\t\t\tORDER BY fecha_suceso DESC\n\t\t\tLIMIT 10\");\n\t\t$rs_sucesos = $db->Execute($query_sucesos);\n\t\t$i = 0;\n\t\tforeach ($rs_sucesos as $suceso) {\n\t\t\t$sucesos[$i]['suceso_id'] = $suceso['suceso_id'];\n\t\t\t$sucesos[$i]['titulo'] = $suceso['titulo'];\n\t\t\t$sucesos[$i]['fecha_suceso'] = $suceso['fecha_suceso'];\n\t\t\t$sucesos[$i]['fuente'] = $suceso['fuente'];\n\t\t\t$i++;\n\t\t}\n\t\treturn $sucesos;\n\t}",
"public function topRanking()\n {\n $objRanking = new RankingDAO();\n $objRanking->selectRanking();\n }",
"function gmop_object_show(){\n\tglobal $wpdb;\n\n\t$objecttable_name = $wpdb->prefix . \"gmop_objects\";\n\t$typetable_name = $wpdb->prefix . \"gmop_markers\";\n\n\tif($_GET['gmopsort'] == 'asc'){\n\t\t$gmopsort\t= \"ASC\";\n\t}else{\n\t\t$gmopsort\t= \"DESC\";\n\t}\n\n\tif($_GET['gmopsortby'] == 'marker'){\n\t\t$gmopsortby\t= \"marker\";\n\t}else if($_GET['gmopsortby'] == 'title'){\n\t\t$gmopsortby\t= \"title\";\n\t}else{\n\t\t$gmopsortby\t= \"ID\";\n\t}\n\n\t$itemsonpage = 20;\n\t$pageno = $wpdb->escape($_GET['pageno']);\n\tif( ($pageno < 2) || (!is_numeric($pageno)) ){\n\t\t$pageno = 1;\n\t\t$pmin = 0;\n\t\t$pmax = $itemsonpage;\n\t}else{\n\t\t$pmin = ($pageno * $itemsonpage) - $itemsonpage;\n\t\t$pmax = $pageno * $itemsonpage;\n\t}\n\n\t$linkparam = 'admin.php?page=/admin/object_manage.php';\n\tif(isset($_GET['gmopsort'])){\n\t\t$linkparam .= '&gmopsort='.$_GET['gmopsort'];\n\t}\n\tif(isset($_GET['gmopsortby'])){\n\t\t$linkparam .= '&gmopsortby='.$_GET['gmopsortby'];\n\t}\n\t$linkparam .= '&pageno=';\n\t\n\t$gmopcount_total = $wpdb->get_var($wpdb->prepare(\"SELECT COUNT(*) FROM $objecttable_name;\"));\n\t$gmopcount = ceil($gmopcount_total / $itemsonpage);\n\t$pagination = '';\n\tfor($i=1; $i<=$gmopcount; $i++){\n\t\tif($pageno == $i){\n\t\t\t$pagination .= '<a href=\"' . $linkparam . $i . '\"><strong>'.$i.'</strong></a> ';\n\t\t}else{\n\t\t\t$pagination .= '<a href=\"' . $linkparam . $i . '\">'.$i.'</a> ';\n\t\t}\n\t}\n?>\n\t<div class=\"wrap\">\n\t\t<h2><?php _e( 'GMOP Objects', GMOP_TD ); ?> <a href=\"<?php echo 'admin.php?page=/admin/object_manage.php&gmopaction=add'; ?>\" class=\"button add-new-h2\"><?php _e( 'Add New', GMOP_TD ); ?></a>\n\t\t <a href=\"<?php echo 'admin.php?page=/admin/object_manage.php&gmopaction=regenerate'; ?>\" class=\"button add-new-h2\"><?php _e( 'ReGenerate Cache', GMOP_TD ); ?></a></h2>\n\t\t<p class=\"admin-msg\"><?php _e( 'Below You will find a list of already created objects, which can be show on google map.', GMOP_TD ); ?></p>\n\t\t<p><?php _e( 'Page:', GMOP_TD ); ?> <?php echo $pagination; ?></p>\n<?php\n\t//Handle deleting\n\tif ($_GET['gmopaction'] == \"delete\") {\n\t\t$theid = $_GET['theid'];\n\t\techo '<div id=\"message\" class=\"updated fade\"><p>' . __( 'Are you sure you want to delete object?', GMOP_TD ) . ' <a href=\"admin.php?page=/admin/object_manage.php&gmopaction=deleteconf&theid='.$theid.'\">' . __( 'Yes', GMOP_TD ) . '</a> <a href=\"admin.php?page=/admin/object_manage.php\">' . __( 'No!', GMOP_TD ) . '</a></p></div>';\n\t}\n\tif ($_GET['gmopaction'] == \"deleteconf\") {\n\t\t$theid = $_GET['theid'];\n\t\t$wpdb->query(\"DELETE FROM $objecttable_name WHERE ID = '$theid'\");\n\t\techo '<div id=\"message\" class=\"updated fade\"><p>' . __( 'Object deleted.', GMOP_TD ) . '</p></div>';\n\t}\n\n\t$gmopobjects = $wpdb->get_results(\"SELECT * FROM $objecttable_name ORDER BY $gmopsortby $gmopsort LIMIT $pmin , $pmax\", OBJECT);\n\t$gmoptypes = $wpdb->get_results(\"SELECT * FROM $typetable_name ORDER BY ID ASC\", OBJECT_K);\n\n\techo '\n\t<table class=\"widefat\">\n\t\t<thead><tr>\n\t\t\t<th scope=\"col\">' . __( 'ID', GMOP_TD ) . ' <a href=\"admin.php?page=/admin/object_manage.php&gmopsort=asc&gmopsortby=ID&pageno='.$pageno.'\"><img src=\"/img/link_up.gif\" title=\"' . __( 'Ascending', GMOP_TD ) . '\" alt=\"' . __( 'Ascending', GMOP_TD ) . '\" /></a>\t<a href=\"admin.php?page=/admin/object_manage.php&gmopsort=desc&gmopsortby=ID&pageno='.$pageno.'\"><img src=\"/img/link_down.gif\" title=\"' . __( 'Descending', GMOP_TD ) . '\" alt=\"' . __( 'Descending', GMOP_TD ) . '\" /></a></th>\n\t\t\t<th scope=\"col\">' . __( 'Name', GMOP_TD ) . ' <a href=\"admin.php?page=/admin/object_manage.php&gmopsort=asc&gmopsortby=title&pageno='.$pageno.'\"><img src=\"/img/link_up.gif\" title=\"' . __( 'Ascending', GMOP_TD ) . '\" alt=\"' . __( 'Ascending', GMOP_TD ) . '\" /></a>\t<a href=\"admin.php?page=/admin/object_manage.php&gmopsort=desc&gmopsortby=title&pageno='.$pageno.'\"><img src=\"/img/link_down.gif\" title=\"' . __( 'Descending', GMOP_TD ) . '\" alt=\"' . __( 'Descending', GMOP_TD ) . '\" /></a></th>\n\t\t\t<th scope=\"col\" style=\"width:300px;\">' . __( 'Description', GMOP_TD ) . '</th>\n\t\t\t<th scope=\"col\">' . __( 'URL', GMOP_TD ) . '</th>\n\t\t\t<th scope=\"col\">' . __( 'Marker', GMOP_TD ) . ' <a href=\"admin.php?page=/admin/object_manage.php&gmopsort=asc&gmopsortby=marker&pageno='.$pageno.'\"><img src=\"/img/link_up.gif\" title=\"' . __( 'Ascending', GMOP_TD ) . '\" alt=\"' . __( 'Ascending', GMOP_TD ) . '\" /></a> <a href=\"admin.php?page=/admin/object_manage.php&gmopsort=desc&gmopsortby=marker&pageno='.$pageno.'\"><img src=\"/img/link_down.gif\" title=\"' . __( 'Descending', GMOP_TD ) . '\" alt=\"' . __( 'Descending', GMOP_TD ) . '\" /></a></th>\n\t\t\t<th scope=\"col\">' . __( 'Action', GMOP_TD ) . '</th>\n\t\t</tr></thead>\n\t\t<tbody>';\n\n\tif ($gmopobjects) {\n\t\tforeach ($gmopobjects as $gmopobject){\n\t\t\techo '<tr>';\n\t\t\techo '<td>' . $gmopobject->ID . '</td>';\n\t\t\techo '<td><strong>' . $gmopobject->title . '</strong></td>';\n\t\t\techo '<td>' . $gmopobject->description . '</td>';\n\t\t\techo '<td>' . $gmopobject->url . '</td>';\n\t\t\t$markerid = $gmopobject->marker;\n\t\t\techo '<td><img src=\"' . $gmoptypes[$markerid]->image_url . '\" /><br />' . $gmoptypes[$markerid]->title . '</td>';\n\t\t\techo '<td><a href=\"admin.php?page=/admin/object_manage.php&gmopaction=edit&theid='.$gmopobject->ID.'\"><img src=\"/img/edit.png\" title=\"' . __( 'Edit', GMOP_TD ) . '\" alt=\"' . __( 'Edit', GMOP_TD ) . '\" /></a>\t<a href=\"admin.php?page=/admin/object_manage.php&gmopaction=delete&theid='.$gmopobject->ID.'\"><img src=\"/img/delete.png\" title=\"' . __( 'Delete', GMOP_TD ) . '\" alt=\"' . __( 'Delete', GMOP_TD ) . '\" /></a></td>';\n\t\t\techo '</tr>';\n\t\t}\n\t} else { \n\t\techo '<tr> <td colspan=\"6\">' . __( 'No objects found.', GMOP_TD ) . '</td> </tr>'; \n\t}\n\n\techo '</tbody>\n\t</table>';\n?>\n\t\t<p><?php _e( 'Page:', GMOP_TD ); ?> <?php echo $pagination; ?></p>\n\t</div><!-- wrap ends -->\n<?php\n}",
"public function findTopThirdOfTn($tournament)\n {\n return $this->createQueryBuilder('u')\n ->andWhere('u.tournament = :tournament')\n ->setParameter('tournament', $tournament)\n ->orderBy('u.points', 'DESC')\n ->setFirstResult(2)\n ->setMaxResults(1)\n ->getQuery()\n ->getOneOrNullResult()\n ;\n }"
] | [
"0.60057276",
"0.575459",
"0.5708563",
"0.5603122",
"0.56014866",
"0.559215",
"0.55265474",
"0.55054504",
"0.5456225",
"0.5384786",
"0.53795344",
"0.53785205",
"0.5358048",
"0.5349293",
"0.5309085",
"0.5305461",
"0.5305291",
"0.53037274",
"0.5294118",
"0.5292551",
"0.5258038",
"0.5252253",
"0.5243169",
"0.5235215",
"0.52141064",
"0.5206753",
"0.51974726",
"0.5187506",
"0.51854384",
"0.51808876"
] | 0.6815275 | 0 |
Test create field boosting. | public function testFieldRelevanceBoosting()
{
$scoreStrategy = ScoreStrategy::createFieldBoosting('relevance');
$this->assertEquals(
ScoreStrategy::BOOSTING_FIELD_VALUE,
$scoreStrategy->getType()
);
$this->assertEquals(
'relevance',
$scoreStrategy->getConfigurationValue('field')
);
$this->assertEquals(
ScoreStrategy::DEFAULT_FACTOR,
$scoreStrategy->getConfigurationValue('factor')
);
$this->assertEquals(
ScoreStrategy::DEFAULT_MISSING,
$scoreStrategy->getConfigurationValue('missing')
);
$this->assertEquals(
ScoreStrategy::MODIFIER_NONE,
$scoreStrategy->getConfigurationValue('modifier')
);
$this->assertEquals(
ScoreStrategy::DEFAULT_WEIGHT,
$scoreStrategy->getWeight()
);
$this->assertNull($scoreStrategy->getFilter());
$this->assertEquals(
ScoreStrategy::SCORE_MODE_AVG,
$scoreStrategy->getScoreMode()
);
$scoreStrategy = HttpHelper::emulateHttpTransport($scoreStrategy);
$this->assertEquals(
ScoreStrategy::BOOSTING_FIELD_VALUE,
$scoreStrategy->getType()
);
$this->assertEquals(
'relevance',
$scoreStrategy->getConfigurationValue('field')
);
$this->assertEquals(
ScoreStrategy::DEFAULT_FACTOR,
$scoreStrategy->getConfigurationValue('factor')
);
$this->assertEquals(
ScoreStrategy::DEFAULT_MISSING,
$scoreStrategy->getConfigurationValue('missing')
);
$this->assertEquals(
ScoreStrategy::MODIFIER_NONE,
$scoreStrategy->getConfigurationValue('modifier')
);
$this->assertEquals(
ScoreStrategy::DEFAULT_WEIGHT,
$scoreStrategy->getWeight()
);
$this->assertNull($scoreStrategy->getFilter());
$this->assertEquals(
ScoreStrategy::SCORE_MODE_AVG,
$scoreStrategy->getScoreMode()
);
$scoreStrategy = ScoreStrategy::createFieldBoosting(
'relevance',
1.0,
2.0,
ScoreStrategy::MODIFIER_LN,
4.00,
Filter::create('x', [], 0, ''),
ScoreStrategy::SCORE_MODE_MIN
);
$this->assertEquals(
1.0,
$scoreStrategy->getConfigurationValue('factor')
);
$this->assertEquals(
2.0,
$scoreStrategy->getConfigurationValue('missing')
);
$this->assertEquals(
ScoreStrategy::MODIFIER_LN,
$scoreStrategy->getConfigurationValue('modifier')
);
$this->assertEquals(
4.0,
$scoreStrategy->getWeight()
);
$this->assertInstanceOf(
Filter::class,
$scoreStrategy->getFilter()
);
$this->assertEquals(
ScoreStrategy::SCORE_MODE_MIN,
$scoreStrategy->getScoreMode()
);
$scoreStrategy = HttpHelper::emulateHttpTransport($scoreStrategy);
$this->assertEquals(
1.0,
$scoreStrategy->getConfigurationValue('factor')
);
$this->assertEquals(
2.0,
$scoreStrategy->getConfigurationValue('missing')
);
$this->assertEquals(
ScoreStrategy::MODIFIER_LN,
$scoreStrategy->getConfigurationValue('modifier')
);
$this->assertEquals(
4.0,
$scoreStrategy->getWeight()
);
$this->assertInstanceOf(
Filter::class,
$scoreStrategy->getFilter()
);
$this->assertEquals(
ScoreStrategy::SCORE_MODE_MIN,
$scoreStrategy->getScoreMode()
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testBoostedField()\n {\n $serviceMock = $this->getServiceMock();\n Phockito::when($serviceMock)\n ->search(\n \\Hamcrest_Matchers::anything(),\n \\Hamcrest_Matchers::anything(),\n \\Hamcrest_Matchers::anything(),\n \\Hamcrest_Matchers::anything(),\n \\Hamcrest_Matchers::anything()\n )->return($this->getFakeRawSolrResponse());\n\n $index = new SolrIndexTest_BoostedIndex();\n $index->setService($serviceMock);\n\n $query = new SearchQuery();\n $query->search('term');\n $index->search($query);\n\n // Ensure matcher contains correct boost in 'qf' parameter\n $matcher = new Hamcrest_Array_IsArrayContainingKeyValuePair(\n new Hamcrest_Core_IsEqual('qf'),\n new Hamcrest_Core_IsEqual('SearchUpdaterTest_Container_Field1^1.5 SearchUpdaterTest_Container_Field2^2.1 _text')\n );\n Phockito::verify($serviceMock)\n ->search(\n '+term',\n \\Hamcrest_Matchers::anything(),\n \\Hamcrest_Matchers::anything(),\n $matcher,\n \\Hamcrest_Matchers::anything()\n );\n }",
"public function testCustomFieldsCreate()\n {\n }",
"public static function createRelevanceBoosting(): self\n {\n $score = self::createDefault();\n $score->type = self::BOOSTING_RELEVANCE_FIELD;\n\n return $score;\n }",
"public function testBoostedQuery()\n {\n $serviceMock = $this->getServiceMock();\n Phockito::when($serviceMock)\n ->search(\n \\Hamcrest_Matchers::anything(),\n \\Hamcrest_Matchers::anything(),\n \\Hamcrest_Matchers::anything(),\n \\Hamcrest_Matchers::anything(),\n \\Hamcrest_Matchers::anything()\n )->return($this->getFakeRawSolrResponse());\n\n $index = new SolrIndexTest_FakeIndex();\n $index->setService($serviceMock);\n\n $query = new SearchQuery();\n $query->search(\n 'term',\n null,\n array('Field1' => 1.5, 'HasOneObject_Field1' => 3)\n );\n $index->search($query);\n\n Phockito::verify($serviceMock)\n ->search(\n '+(Field1:term^1.5 OR HasOneObject_Field1:term^3)',\n \\Hamcrest_Matchers::anything(),\n \\Hamcrest_Matchers::anything(),\n \\Hamcrest_Matchers::anything(),\n \\Hamcrest_Matchers::anything()\n );\n }",
"public function testBindersGetBinderCustomFields()\n {\n }",
"public function addMltQueryField($field, $boost) {}",
"public function testCustomFieldsUpdate()\n {\n }",
"public function setBoost($boost) {\n\t\treturn $this->setParam('boost', $boost);\n\t}",
"public function getBoost()\n {\n return $this->boost;\n }",
"public function testCustomFieldsGet()\n {\n }",
"public function testBindersBinderCustomFieldsTranslations0()\n {\n }",
"public function testBindersBinderCustomFieldsTranslations()\n {\n }",
"public function getMltBoost() {}",
"public function testBindersGetBinderCustomFieldsTranslations()\n {\n }",
"function create_field($field)\n\t{\n\t\t\n\t}",
"public function setBoost(array $boost)\n {\n $this->boost = $boost;\n }",
"public function testCanSetMaxBoxesToWeightBalance(): void\n {\n $packer = new Packer();\n $packer->setMaxBoxesToBalanceWeight(3);\n self::assertEquals(3, $packer->getMaxBoxesToBalanceWeight());\n }",
"public function __construct(int $boost = 1)\n {\n $this->query = [\n 'dis_max' => [\n 'boost' => $boost\n ]\n ];\n }",
"public function getBoostQueryFields();",
"public function testGetWeight()\n {\n // deleting discounts to ignore bundle problems\n foreach ( $this->aDiscounts as $oDiscount )\n $oDiscount->delete();\n\n $oBasket = new oxbasket();\n $oBasket->addToBasket( $this->oArticle->getId(), 10 );\n $oBasket->addToBasket( $this->oVariant->getId(), 10 );\n $oBasket->calculateBasket( false );\n $this->assertEquals( 200, $oBasket->getWeight() );\n }",
"public function testBindersInsertNewBinderType()\n {\n }",
"public function setMltBoost($flag) {}",
"public function create($fields = array())\n\t{\n\t\tif(!$this->_db->insert('budget', $fields)){\n\t\t\tthrow new Exception(\"Error While add budget..\");\n\t\t}\n\t}",
"public function testCustomFieldsList()\n {\n }",
"private function getBoost(&$term) {\n if (isset($term[static::TERM][$this->options[static::FIELD]]) && isset($this->options[static::BOOST])) {\n $term[static::TERM][$this->options[static::FIELD]][static::BOOST] = $this->options[static::BOOST];\n }\n }",
"protected abstract function createModelTest();",
"function genBehaviorFields($bid, $fields, &$fieldMap, $setid = 'default') {\n global $zen;\n // create a new set of matches\n foreach($fields as $f) {\n $fkey = $f['field_name'];\n // store the field to behavior mappings for use later\n if( !is_array($fieldMap[\"$fkey\"]) ) { $fieldMap[\"$fkey\"] = array(); }\n if( !in_array($bid, $fieldMap[\"$fkey\"]) ) {\n $fieldMap[\"$fkey\"][] = $bid;\n }\n \n // here we are going to try to parse the field values into\n // a simple integer date that can be used for comparisons\n $val = $f['field_value'];\n if( strpos($f['field_name'], '_date') > 0 ) {\n // can't be the first character, so 0 is not a concern\n $val = $zen->dateParse($val);\n }\n \n // create the behavior fields objects\n print \" behaviorMap['$bid'].addField(\";\n print $zen->fixJsVal($f['field_name']);\n print ','.$zen->fixJsVal($f['field_operator']);\n print ','.$zen->fixJsVal($val);\n print ','.$zen->fixJsVal($setid);\n print \");\\n\";\n }\n }",
"public function test_updateWarehouseCustomFields() {\n\n }",
"public function testBindersGetBindersFieldsByType()\n {\n }",
"public function testBindersCanInsertNewBinderType()\n {\n }"
] | [
"0.7594236",
"0.6036369",
"0.60113794",
"0.5891807",
"0.57682425",
"0.5664571",
"0.5406787",
"0.53395116",
"0.5325568",
"0.524015",
"0.5226542",
"0.5213114",
"0.5190678",
"0.51888645",
"0.51459885",
"0.5129313",
"0.5100875",
"0.5088003",
"0.50752735",
"0.5036835",
"0.5016124",
"0.50154585",
"0.49993423",
"0.49870637",
"0.4967969",
"0.49614066",
"0.49593586",
"0.49534103",
"0.4936109",
"0.49089497"
] | 0.66715074 | 1 |
index test Lists all Programas entities. | public function indexAction()
{
$em = $this->getDoctrine()->getManager();
$programas = $em->getRepository('CoreBundle:Programas')->findAll();
return $this->render('programas/index.html.twig', array(
'programas' => $programas,
));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function seedOrganizationIndex()\n {\n $organizations = Organization::all();\n $organizationService = new organizationService();\n foreach($organizations as $organization)\n $organizationService->indexOrganization($organization);\n }",
"public function test_index()\n {\n factory('App\\Course', 10)->create()->each(function ($u) {\n $u->partecipants()->saveMany(factory('App\\Partecipant', 10)->create());\n });\n $this->actingAs($this->user);\n $response = $this->get('/courses');\n $response->assertStatus(200)\n ->assertSee(Course::first()->description);\n }",
"public function testIndex() {\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER => '',\n\t\t\tUSER_ROLE_USER | USER_ROLE_SECRETARY => 'secret',\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\n\t\t\tUSER_ROLE_USER | USER_ROLE_ADMIN => 'admin',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'GET',\n\t\t\t'return' => 'contents',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'employees',\n\t\t\t\t'action' => 'index',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$view = $this->testAction($url, $opt);\n\t\t\t$numForm = $this->getNumberItemsByCssSelector($view, 'div#content div.container form[action$=\"/employees/search\"]');\n\t\t\t$expected = 1;\n\t\t\t$this->assertData($expected, $numForm);\n\n\t\t\t$numDl = $this->getNumberItemsByCssSelector($view, 'div#content div.container ul.list-statistics li');\n\t\t\t$expected = 2;\n\t\t\t$this->assertData($expected, $numDl);\n\t\t}\n\t}",
"public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Program::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function getIndex() {\n\t\t/*\n\t\tIgualamos la base de datos con mayúsculas\n\n\t\t */$familys = Family::get();\n\t\tforeach ($familys as $family) {\n\t\t\t$family->description = strtoupper($family->alias);\n\t\t\t$family->save();\n\t\t}\n\n\t}",
"public function getIndex()\n {\n //\n }",
"public function indexes();",
"public function indexes();",
"public function indexes();",
"public function getIndex()\n {\n \n }",
"public function index() {\n\t\t$this->post_indexation->index();\n\t\t$this->term_indexation->index();\n\t\t$this->general_indexation->index();\n\t\t$this->post_type_archive_indexation->index();\n\t\t$this->post_link_indexing_action->index();\n\t\t$this->term_link_indexing_action->index();\n\t\t$this->complete_indexation_action->complete();\n\t}",
"public function getIndex() {}",
"public function exigency_indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('PasaRequirementBundle:Exigency')->findAll();\n\n return array('entities' => $entities);\n }",
"public function executeIndex()\n {\n }",
"public function getIndex()\n {\n \n }",
"abstract function index();",
"abstract function index();",
"abstract function index();",
"public function _index(){\n\t $this->_list();\n\t}",
"public function index()\n\t{\n\t\t/*\n\t\t|\tnot a logical function since OrganismAntibiotic shd be specific to an organism\n\t\t|\torganism.show used instead\n\t\t*/\n\t}",
"function index() {\n $this->getList();\n }",
"public function index() \n {\n \t$this->testALL(\"func\");\n }",
"public function indexAction()\r\n {\r\n $em = $this->getDoctrine()->getManager();\r\n\r\n $page = $this->getRequest()->get('page');\r\n\r\n //$entities = $em->getRepository($this->getEntityName())->findBy(array(), array(), FilterInterface::PAGE_COUNT_RESULT, FilterInterface::PAGE_COUNT_RESULT * $page);\r\n $entities = $em->getRepository($this->getEntityName())->findAll();\r\n\r\n return array(\r\n 'entities' => $entities,\r\n );\r\n }",
"public function index()\n {\n \n // return $programmes = Programmes::with('ProgramCategory')->get();\n return ProgramCollection::collection(Programmes::with('ProgramCategory')->get());\n }",
"public function testIndex()\r\n {\r\n $this->getBrowser()->\r\n getAndCheck('recherche', 'index', '/', 200)\r\n ;\r\n }",
"public function testIndex() {\n\t\t$result = $this->testAction ( '/EditUser/index' );\n\t\tdebug ( $result );\n\t}",
"public function index() {\n $this->Entity->recursive = 1;\n\n $this->setSearch('Entity', array(\n 'nome' => 'Entity.name',\n 'email' => 'Entity.email',\n 'telefone' => 'Entity.phone',\n 'celular' => 'Entity.cellphone',\n 'endereço' => 'Entity.address',\n 'contact' => 'Entity.contact'\n ));\n\n $this->set('title', 'Módulos > Entidades');\n $this->set('entities', $this->paginate('Entity'));\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('AcmeFmpsBundle:EnfantTiteur')->findAll();\n\n return array('entities' => $entities);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $atlhetes = $em->getRepository('RioBundle:Atlhete')->findAll();\n\n return $this->render('atlhete/index.html.twig', array(\n 'atlhetes' => $atlhetes,\n ));\n }",
"public function testIndex()\n {\n foreach ($this->users as $user) {\n $res = $this->actingAs($user, 'api')\n ->json('GET', '/api/v1/android_apps')\n ->assertStatus(200)\n ->assertJsonStructure([\n 'data' => [\n [\n 'id',\n 'name',\n 'description',\n 'version',\n 'price',\n 'created_at',\n 'updated_at',\n ]\n ],\n 'links',\n 'meta'\n ]);\n }\n }"
] | [
"0.630655",
"0.6248768",
"0.6164385",
"0.6063047",
"0.60601926",
"0.6028542",
"0.59921783",
"0.59921783",
"0.59921783",
"0.5982178",
"0.5941005",
"0.5940218",
"0.59262615",
"0.59142035",
"0.5911672",
"0.5911215",
"0.5911215",
"0.5911215",
"0.5906703",
"0.58998305",
"0.58938247",
"0.58879894",
"0.5887365",
"0.58799016",
"0.58672017",
"0.5854602",
"0.5854374",
"0.5852239",
"0.58448404",
"0.5836066"
] | 0.6303251 | 1 |
Creates a form to delete a Programas entity. | private function createDeleteForm(Programas $programa)
{
return $this->createFormBuilder()
->setAction($this->generateUrl('programas_delete', array('id' => $programa->getId())))
->setMethod('DELETE')
->getForm()
;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function createDeleteForm(Program $program)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('program_delete', array('id' => $program->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm( Persona $persona ) {\n\t\treturn $this->createFormBuilder()\n\t\t ->setAction( $this->generateUrl( 'persona_delete', array( 'id' => $persona->getId() ) ) )\n\t\t ->setMethod( 'DELETE' )\n\t\t ->getForm();\n\t}",
"private function createDeleteForm(Practicas $practica)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('practicas_delete', array('idPractica' => $practica->getIdpractica())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm()\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('turnossede_delete', array('id' => '__obj_id__')))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm()\n {\n return $this->factory->createBuilder()\n ->setMethod('DELETE')\n ->getForm();\n }",
"private function createDeleteForm(FrigaEdital $frigaedital)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('edital_remover', array('uuid' => $frigaedital->getUuid())))\n ->setMethod('DELETE')\n ->getForm();\n }",
"private function createDeleteForm(Aspirante $aspirante)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('aspirante_delete', array('id' => $aspirante->getRfc())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(DelaiResultat $delaiResultat)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('delairesultat_delete', array('id' => $delaiResultat->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Proceso $proceso)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('proceso_delete', array('idProceso' => $proceso->getIdproceso())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Paquet_Colis $paquet_Coli)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('colis_delete', array('id' => $paquet_Coli->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"protected function createComponentDeleteForm()\r\n\t{\r\n\t\t$form = new Form;\r\n\t\t$form->addSubmit('delete', 'Smazat')->setAttribute('class', 'default');\r\n\t\t$form->addSubmit('cancel', 'Storno');\r\n\t\t$form->onSuccess[] = callback($this, 'deleteFormSubmitted');\r\n\t\t$form->addProtection(self::MESS_PROTECT);\r\n\t\treturn $form;\r\n\t}",
"private function createDeleteForm(Anuncio $anuncio)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('anuncio_delete', array('id' => $anuncio->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Constancia $constancium) {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('constancia_delete', array('id' => $constancium->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Atlhete $atlhete)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('atlhete_delete', array('id' => $atlhete->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Constat $constat)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('constat_delete', array('codeRec' => $constat->getCodeRec())))\n ->setMethod('DELETE')\n ->getForm();\n }",
"protected function createComponentDeleteForm() {\r\n $form = new Form;\r\n $form->addSubmit('cancel', 'Zrušit');\r\n $form->addSubmit('delete', 'Smazat')->setAttribute('class', 'default');\r\n $form->onSubmit[] = callback($this, 'deleteFormSubmitted');\r\n $form->addProtection('Odešlete prosím formulář znovu (bezpečnostní token vypršel).');\r\n return $form;\r\n }",
"private function createDeleteForm(Convitepessoa $convitepessoa)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('convitepessoa_delete', array('id' => $convitepessoa->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Atala $atala)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_atala_delete', array('id' => $atala->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"function thumbwhere_program_delete_form($form, &$form_state, $thumbwhere_program) {\n $form_state['thumbwhere_program'] = $thumbwhere_program;\n\n $form['#submit'][] = 'thumbwhere_program_delete_form_submit';\n\n $form = confirm_form($form,\n t('Are you sure you want to delete thumbwhere_program %name?', array('%name' => $thumbwhere_program->name)),\n 'admin/thumbwhere/thumbwhere_programs/thumbwhere_program',\n '<p>' . t('This action cannot be undone.') . '</p>',\n t('Delete'),\n t('Cancel'),\n 'confirm'\n );\n\n return $form;\n}",
"private function createDeleteForm(Stagiaiarebtp $stagiaiarebtp)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('stagiaiarebtp_delete', array('id' => $stagiaiarebtp->getIdstagiaiarebtp())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"public function delete( Entity $form ) {\n\t}",
"private function createDeleteForm(Deia $deium)\r\n {\r\n return $this->createFormBuilder()\r\n ->setAction($this->generateUrl('deia_delete', array('id' => $deium->getId())))\r\n ->setMethod('DELETE')\r\n ->getForm()\r\n ;\r\n }",
"private function createDeleteForm(EtatFormation $etatFormation)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('parametrage_etatformation_delete', array('id' => $etatFormation->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Pizarra $pizarra)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('pizarra_delete', array('id' => $pizarra->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Etiquetas $etiqueta)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('admin_crud_etiquetas_delete', array('id' => $etiqueta->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Exposicion $exposicion)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('exposicion_delete', array('id' => $exposicion->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(ProgramPoint $programPoint)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('programpoint_delete', array('id' => $programPoint->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(Tapa $tapa)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('dash_tapa_delete', array('id' => $tapa->getId())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"private function createDeleteForm(AtencionDetalle $atencionDetalle)\n {\n return $this->createFormBuilder()\n ->setAction($this->generateUrl('atenciondetalle_delete', array('idAtencionDetalle' => $atencionDetalle->getIdatenciondetalle())))\n ->setMethod('DELETE')\n ->getForm()\n ;\n }",
"function thumbwhere_program_form_submit_delete(&$form, &$form_state) {\n $form_state['redirect'] = 'admin/thumbwhere/thumbwhere_programs/thumbwhere_program/' . $form_state['thumbwhere_program']->pk_program . '/delete';\n}"
] | [
"0.78965056",
"0.71064144",
"0.70615566",
"0.70603865",
"0.70118207",
"0.69396996",
"0.68419427",
"0.68289703",
"0.6813351",
"0.6804461",
"0.6794361",
"0.6738243",
"0.6736177",
"0.67304176",
"0.67111903",
"0.6690701",
"0.6687512",
"0.6684657",
"0.66617227",
"0.66537964",
"0.66534996",
"0.66273296",
"0.65998155",
"0.6586446",
"0.657971",
"0.65422696",
"0.6537965",
"0.65213674",
"0.651612",
"0.65004325"
] | 0.83372426 | 0 |
Get fake instance of Cupon | public function fakeCupon($cuponFields = [])
{
return new Cupon($this->fakeCuponData($cuponFields));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testCreateCouponMerchant()\n {\n\n }",
"function oliver_coupon_init($id) {\n \techo $id;\n // if ( class_exists('WC_Coupon') ) {\n $coupon = new WC_Coupon($id);\n // some code here\n return $coupon;;\n // }\n}",
"public function __construct(Coupon $coupon)\n {\n $this->coupon = $coupon;\n }",
"public function getCoupon() {\n\t\treturn $this->coupon;\n\t}",
"public function makeCupon($cuponFields = [])\n {\n /** @var CuponRepository $cuponRepo */\n $cuponRepo = App::make(CuponRepository::class);\n $theme = $this->fakeCuponData($cuponFields);\n return $cuponRepo->create($theme);\n }",
"public function create_coupon() {\n $current_user = wp_get_current_user();\n $this->coupon = $current_user->first_name . '-' . $current_user->last_name . '-' . sha1( random_bytes( 24 ) );\n add_post_meta( $this->id, 'ESP_RECORD_COUPON', $this->coupon );\n // Create coupon in Eventbrite's system\n $esp = ESP();\n $id = $esp->eb_user[\"id\"];\n $result = $esp->eb_sdk->client->post(\n \"/organizations/$id/discounts/\",\n array(\n \"discount\" => array(\n \"type\" => \"coded\",\n \"code\" => $this->coupon,\n \"percent_off\" => \"100\",\n \"quantity_available\" => 1,\n \"event_id\" => $this->event_id,\n ),\n )\n );\n // Save the Eventbrite ID for later use.\n $this->coupon_eb_id = $result[\"id\"];\n add_post_meta( $this->id, 'ESP_EB_COUPON_ID', $this->coupon_eb_id );\n }",
"public function api()\n {\n return new StripeCouponApi();\n }",
"function __construct(){\n\n $this->PayFlowProClient = new buzz;\n\n }",
"public function coupon()\n {\n return $this->belongsTo(Coupons::class);\n }",
"public function testCreateCouponReservation()\n {\n }",
"public static function grabCoupon($coupon_id, $user_id)\n {\n //if (empty($existing)) {\n $coupon_user = CouponUser::create(['coupon_id' => $coupon_id, 'user_id' => $user_id]);\n\n $coupon_user->raise(new UserCouponCreated($coupon_user));\n $coupon_user->raise(new CouponSold($coupon_user));\n\n return $coupon_user;\n //} else {\n // throw new UserOwnsCouponException('you already own this coupon!');\n //}\n }",
"public function __construct(CouponService $couponService)\n {\n $this->couponService = $couponService;\n }",
"public function couponAction()\n {\n $quote = Mage::getSingleton('swell/quote');\n $quote = $quote->applyCoupon(\n $this->apiRequest->getQuoteId(),\n $this->apiRequest->getCouponCode(),\n $this->apiRequest->getSwellCouponCodes()\n );\n\n $this->sendResponse($quote);\n }",
"function wc_url_coupons() {\n\n\treturn \\WC_URL_Coupons::instance();\n}",
"public function get_coupon(Request $request){\n\t\t$get_coupon = Coupon::get_all_coupon_list($request->all());\n\t\tif($get_coupon){\n\t\t\treturn sHelper::get_respFormat(1, \"Get Coupon\", null, $get_coupon);\n\t\t} else {\n\t\t\treturn sHelper::get_respFormat(0, \"Un-expected , please try again .\", null, null);\n\t\t}\n\t}",
"public function testCouponDelete()\n {\n $coupon = $this->randomCoupon();\n $this->json('DELETE', static::ADDR . \"/{$coupon->id}\", [])\n ->assertOk()\n ->assertJson(OK);\n }",
"public static function init(): self\n {\n return new self(new LinkCustomerToGiftCardResponse());\n }",
"public function create_gift_coupon( $amount ){\n\t\t$coupon_code = time(); \n\t\t$discount_type = 'fixed_cart';\n\n\t\t$coupon = array(\n\t\t 'post_title' \t=> $coupon_code,\n\t\t 'post_content' \t=> '',\n\t\t 'post_status' \t=> 'publish',\n\t\t 'post_author' \t=> 1,\n\t\t 'post_type' => 'shop_coupon'\n\t\t); \n\t\t$new_coupon_id = wp_insert_post( $coupon );\n\n\t\tupdate_post_meta( $new_coupon_id, 'discount_type', $discount_type );\n\t\tupdate_post_meta( $new_coupon_id, 'coupon_amount', $amount );\n\t\tupdate_post_meta( $new_coupon_id, 'individual_use', 'yes' );\n\t\tupdate_post_meta( $new_coupon_id, 'product_ids', '' );\n\t\tupdate_post_meta( $new_coupon_id, 'exclude_product_ids', '' );\n\t\tupdate_post_meta( $new_coupon_id, 'usage_limit', '1' );\n\t\t//update_post_meta( $new_coupon_id, 'usage_limit_per_user', '1' );\n\t\tupdate_post_meta( $new_coupon_id, 'expiry_date', '' );\n\t\tupdate_post_meta( $new_coupon_id, 'apply_before_tax', 'yes' );\n\t\tupdate_post_meta( $new_coupon_id, 'free_shipping', 'no' );\n\n\t\treturn $coupon_code;\n\t}",
"protected function getCouponCode()\r\n {\r\n $randomCode = $this->getRandomCode();\r\n\r\n /** @var \\Magento\\Catalog\\Api\\ProductRepositoryInterface $productRepository */\r\n $productRepository = $this->getObjectManager()->get('Magento\\Catalog\\Api\\ProductRepositoryInterface');\r\n try {\r\n $product = $productRepository->get($this->_productSku);\r\n } catch (NoSuchEntityException $e) {\r\n return false;\r\n }\r\n\r\n if (!$product->getId())\r\n {\r\n return false;\r\n }\r\n\r\n // using the old crud models since the core class is still using them, but crud models are deprecated so this should use repository and filters\r\n /** @var \\Magento\\SalesRule\\Model\\Rule $coupon */\r\n $coupon = $this->getObjectManager()->get('Magento\\SalesRule\\Model\\Rule');\r\n\r\n $coupon->setName('Newsletter Coupon')\r\n ->setDescription('Auto generated from newsletter signup')\r\n ->setFromDate( date('Y-m-d'))\r\n ->setToDate('')\r\n ->setUsesPerCustomer(1)\r\n ->setCustomerGroupIds('0')\r\n ->setIsActive('1')\r\n ->setSimpleAction('by_percent')\r\n ->setProductIds((string)$product->getId())\r\n ->setDiscountAmount(15.000)\r\n ->setDiscountQty(1)\r\n ->setApplyToShipping(0)\r\n ->setTimesUsed(1)\r\n ->setWebsiteIds('1')\r\n ->setCouponType('2')\r\n ->setCouponCode($randomCode)\r\n ->setUsesPerCoupon(NULL);\r\n try {\r\n $coupon->save();\r\n } catch (\\Exception $e)\r\n {\r\n return false;\r\n }\r\n return $coupon->getCouponCode();\r\n }",
"public function show($id)\n {\n return Coupon::find($id);\n }",
"public function coupons()\n {\n return $this->hasMany(Coupon::class);\n }",
"public function coupons()\n {\n return $this->hasMany(Coupon::class);\n }",
"public function testGetReservedCoupons()\n {\n }",
"public function getCouponAmount()\n {\n return $this->couponAmount;\n }",
"public function getCoupons()\n\t{\n\t\treturn $this->coupons;\n\t}",
"function get_coupon($id) {\n\t\t$this->db->where ( 'id', $id );\n\t\t$res = $this->db->get ( 'coupons' );\n\t\treturn $res->row ();\n\t}",
"public function get_coupon_data(): Learndash_Transaction_Coupon_DTO {\n\t\t/**\n\t\t * Filters transaction coupon data.\n\t\t *\n\t\t * @since 4.5.0\n\t\t *\n\t\t * @param Learndash_Transaction_Coupon_DTO $coupon_data Transaction coupon data.\n\t\t * @param Transaction $transaction Transaction model.\n\t\t *\n\t\t * @return array Transaction coupon data.\n\t\t */\n\t\treturn apply_filters(\n\t\t\t'learndash_model_transaction_coupon_data',\n\t\t\tLearndash_Transaction_Coupon_DTO::create(\n\t\t\t\t(array) $this->getAttribute( LEARNDASH_TRANSACTION_COUPON_META_KEY, array() )\n\t\t\t),\n\t\t\t$this\n\t\t);\n\t}",
"public function setCoupon($coupon){\n\n $valide = $this->coupon->findByTitle($coupon);\n\n if(!$valide)\n {\n $this->hasCoupon = false;\n $this->applyCoupon();\n session()->forget('coupon');\n\n throw new \\App\\Exceptions\\CouponException('Ce rabais n\\'est pas valide');\n }\n\n $this->hasCoupon = $valide;\n\n session(['coupon.title' => $valide->title]);\n session(['coupon.value' => $valide->value]);\n session(['coupon.type' => $valide->type]);\n session(['coupon.id' => $valide->id]);\n\n return $this;\n }",
"public function coupon(Request $request){\n $coupon=DB::select('CALL GetCoupon(?)',[$request->code]);\n //$coupon=Coupon::where('code','=',$request->code)->first();\n if(!$coupon){\n return response()->json(['error_msg'=>'Invalid Coupon']);\n }\n if($coupon[0]->quantity < 1)\n {\n return response()->json(['error_msg'=>'Coupon Expired !']);\n\n }\n if($coupon[0]->type==\"1\"){\n $discount=(Cart::total()*$coupon[0]->discount)/100;\n $discount=number_format($discount,2);\n }\n else{\n $discount=$coupon[0]->discount;\n }\n \n return response()->json(['couponid'=>$coupon[0]->id, 'name'=>$request->code,'discount'=>$discount,'total'=>Cart::total()]);\n\n }",
"public function couponPostAction($observer)\n {\n if (!Mage::helper('promotionalgift')->enablePromotionalgift())\n return $this;\n\n $action = $observer->getEvent()->getControllerAction();\n $code = trim($action->getRequest()->getParam('coupon_code'));\n if (!$code)\n return $this;\n $session = Mage::getSingleton('checkout/session');\n $cart = Mage::getSingleton('checkout/cart');\n $ruleId = '';\n $salesRules = Mage::getModel('promotionalgift/shoppingcartrule')->getAvailableCouponRule();\n foreach ($salesRules as $salesRule) {\n if ($salesRule->getCouponCode() == $code) {\n if (Mage::helper('promotionalgift/rule')->validateRuleQuote($salesRule)) {\n $ruleId = $salesRule->getId();\n break;\n }\n }\n }\n\n if ($action->getRequest()->getParam('remove') == 1) {\n if ($session->getData('promptionalgift_coupon_code')) {\n $session->addSuccess(Mage::helper('promotionalgift')->__('Coupon code \"%s\" was canceled.', $session->getData('promptionalgift_coupon_code')));\n $session->setData('promptionalgift_coupon_code', null);\n $session->setData('shoppingcart_couponcode_rule_id', null);\n $session->setData('promotionalgift_shoppingcart_rule_id', null);\n $session->setData('promotionalgift_shoppingcart_rule_used', null);\n if ($ruleId) {\n $shoppingQuote = Mage::getModel('sales/quote_item');\n $giftItems = Mage::getModel('promotionalgift/shoppingquote')->getCollection()\n ->addFieldToFilter('shoppingcartrule_id', $ruleId);\n foreach ($giftItems as $item) {\n try {\n $item->delete();\n $cart->removeItem($item->getItemId())->save();\n } catch (Exception $e) {\n\n }\n }\n }\n $action->getResponse()->setRedirect(Mage::getUrl('checkout/cart'));\n return $this;\n }\n } else {\n if ($ruleId) {\n if (!$session->getData('promptionalgift_coupon_code')) {\n $session->setData('promptionalgift_coupon_code', $code);\n $session->setData('promotionalgift_shoppingcart_rule_id', $ruleId);\n $quote = Mage::getSingleton('checkout/cart')->getQuote();\n $quote->setCouponCode('');\n $quote->collectTotals()->save();\n $available = false;\n foreach ($quote->getAddressesCollection() as $address) {\n if (!$address->isDeleted() && $session->getData('promptionalgift_coupon_code') == $code) {\n $available = true;\n break;\n }\n }\n if ($session->getData('promotionalgift_shoppingcart_use_full_rule')) {\n $session->addError(Mage::helper('promotionalgift')\n ->__(\"You're out of rule to use. Please remove gift(s) of other rules from cart and try again\"));\n }\n }\n }\n $action->getResponse()->setRedirect(Mage::getUrl('checkout/cart'));\n }\n $autoAddGift = Mage::getStoreConfig('promotionalgift/shoppingcart_rule_configuration/automaticadd', Mage::app()->getStore()->getId());\n if (!Mage::registry('autoaddcart') && $autoAddGift) {\n $availableCart = $this->getShoppingcartRule();\n $numberShoppingCart = Mage::getStoreConfig(\n 'promotionalgift/shoppingcart_rule_configuration/numberofshoppingcartrule'\n );\n if (isset($numberShoppingCart) && ($numberShoppingCart != null)\n && ($numberShoppingCart > 0)\n ) {\n if (count($availableCart) > $numberShoppingCart) {\n for (\n $count = $numberShoppingCart;\n $count <= count($availableCart); $count++\n ) {\n unset($availableCart[$count]);\n }\n }\n }\n if ($availableCart) {\n Mage::register('autoaddcart', 1);\n $this->autoAddGiftShoppingCart($availableCart);\n }\n }\n }"
] | [
"0.6240725",
"0.6079695",
"0.6014723",
"0.59661555",
"0.5939211",
"0.5916719",
"0.5828872",
"0.5796728",
"0.5713219",
"0.55165535",
"0.5404117",
"0.539885",
"0.52812797",
"0.52233636",
"0.5179114",
"0.5175987",
"0.5151554",
"0.5147846",
"0.5073844",
"0.50706154",
"0.5069812",
"0.5069812",
"0.50610244",
"0.503159",
"0.5027759",
"0.50185907",
"0.5016782",
"0.49968636",
"0.4996639",
"0.49850243"
] | 0.72295535 | 0 |
Get fake data of Cupon | public function fakeCuponData($cuponFields = [])
{
$fake = Faker::create();
return array_merge([
'cupon_code' => $fake->word,
'cupon_object' => $fake->word,
'cupon_type' => $fake->word,
'cupon_is_recuring' => $fake->word,
'cupon_start' => $fake->word,
'cupon_end' => $fake->word,
'cupon_description' => $fake->text,
'created_at' => $fake->word,
'updated_at' => $fake->word
], $cuponFields);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function get_coupon_data(): Learndash_Transaction_Coupon_DTO {\n\t\t/**\n\t\t * Filters transaction coupon data.\n\t\t *\n\t\t * @since 4.5.0\n\t\t *\n\t\t * @param Learndash_Transaction_Coupon_DTO $coupon_data Transaction coupon data.\n\t\t * @param Transaction $transaction Transaction model.\n\t\t *\n\t\t * @return array Transaction coupon data.\n\t\t */\n\t\treturn apply_filters(\n\t\t\t'learndash_model_transaction_coupon_data',\n\t\t\tLearndash_Transaction_Coupon_DTO::create(\n\t\t\t\t(array) $this->getAttribute( LEARNDASH_TRANSACTION_COUPON_META_KEY, array() )\n\t\t\t),\n\t\t\t$this\n\t\t);\n\t}",
"public function fakeCupon($cuponFields = [])\n {\n return new Cupon($this->fakeCuponData($cuponFields));\n }",
"private function getCouponPostData()\n {\n return $this->getRequest()->getParam('coupons');\n }",
"public function getCoupon() {\n\t\treturn $this->coupon;\n\t}",
"public function create_coupon() {\n $current_user = wp_get_current_user();\n $this->coupon = $current_user->first_name . '-' . $current_user->last_name . '-' . sha1( random_bytes( 24 ) );\n add_post_meta( $this->id, 'ESP_RECORD_COUPON', $this->coupon );\n // Create coupon in Eventbrite's system\n $esp = ESP();\n $id = $esp->eb_user[\"id\"];\n $result = $esp->eb_sdk->client->post(\n \"/organizations/$id/discounts/\",\n array(\n \"discount\" => array(\n \"type\" => \"coded\",\n \"code\" => $this->coupon,\n \"percent_off\" => \"100\",\n \"quantity_available\" => 1,\n \"event_id\" => $this->event_id,\n ),\n )\n );\n // Save the Eventbrite ID for later use.\n $this->coupon_eb_id = $result[\"id\"];\n add_post_meta( $this->id, 'ESP_EB_COUPON_ID', $this->coupon_eb_id );\n }",
"public function testCreateCouponMerchant()\n {\n\n }",
"public function getCouponCode()\n {\n return $this->getData(self::COUPONCODE);\n }",
"public function get_coupon(Request $request){\n\t\t$get_coupon = Coupon::get_all_coupon_list($request->all());\n\t\tif($get_coupon){\n\t\t\treturn sHelper::get_respFormat(1, \"Get Coupon\", null, $get_coupon);\n\t\t} else {\n\t\t\treturn sHelper::get_respFormat(0, \"Un-expected , please try again .\", null, null);\n\t\t}\n\t}",
"public abstract function getMockData();",
"public function getCustomerData()\n {\n $data = array();\n $quote = $this->getQuote();\n $birthDate = $quote->getCustomerDob();\n $gender = $quote->getCustomerGender();\n\n $data['birthdate'] = isset($birthDate) ? $birthDate : '';\n $data['gender'] = isset($gender) ? $gender : '';\n\n return $data;\n }",
"private function calculateCoupon()\n {\n // Calculate\n $taxPercent = config('cart.tax');\n $tax = $taxPercent / 100;\n $discount = session()->get('coupon')['discount'] ?? 0;\n $code = session()->get('coupon')['name'] ?? null;\n\n $newSubtotal = (Cart::instance('shopping')->subtotal() - $discount);\n $newTax = $newSubtotal * $tax;\n $newTotal = $newSubtotal + $newTax;\n if ($newTotal < 0) {\n $newTotal = 0;\n }\n if ($newSubtotal < 0) {\n $newSubtotal = 0;\n }\n if ($newTax < 0) {\n $newTax = 0;\n }\n\n return collect([\n 'taxPercent' => $taxPercent,\n 'discount' => $discount,\n 'newSubtotal' => $newSubtotal,\n 'newTax' => $newTax,\n 'newTotal' => $newTotal,\n 'code' => $code,\n ]);\n }",
"public static function getDiscountCouponInfo()\n {\n if (self::$discountCouponInfo === null) {\n // get a session\n $paymentSession = new SessionContainer('payment');\n\n if (!empty($paymentSession->discountCouponId)) {\n // get a discount coupon info\n if (null != ($discountInfo =\n self::getModel()->getActiveCouponInfo($paymentSession->discountCouponId, 'id'))) {\n\n self::$discountCouponInfo = $discountInfo;\n\n return $discountInfo;\n }\n\n // remove the discount from the session\n $paymentSession->discountCouponId = null;\n }\n\n self::$discountCouponInfo = [];\n }\n\n return self::$discountCouponInfo;\n }",
"public function getData()\n {\n $this->validate('merchantTransactionId', 'amount', 'currency', 'referenceUuid');\n\n $data = $this->getBaseData();\n\n $data['amount'] = $this->getAmount();\n $data['currency'] = $this->getCurrency();\n $data['referenceUuid'] = $this->getReferenceUuid();\n\n\n if($callbackUrl = $this->getCallbackUrl()) {\n $data['callbackUrl'] = $callbackUrl;\n }\n\n\n if($transactionToken = $this->getTransactionToken()) {\n $data['transactionToken'] = $transactionToken;\n }\n\n if($description = $this->getDescription()) {\n $data['description'] = $description;\n }\n\n\n if($items = $this->getItemData()) {\n $data['items'] = $items;\n }\n\n return $data;\n }",
"public function getCustomerData()\n {\n return $this->customer_data;\n }",
"public function coupon(Request $request){\n $coupon=DB::select('CALL GetCoupon(?)',[$request->code]);\n //$coupon=Coupon::where('code','=',$request->code)->first();\n if(!$coupon){\n return response()->json(['error_msg'=>'Invalid Coupon']);\n }\n if($coupon[0]->quantity < 1)\n {\n return response()->json(['error_msg'=>'Coupon Expired !']);\n\n }\n if($coupon[0]->type==\"1\"){\n $discount=(Cart::total()*$coupon[0]->discount)/100;\n $discount=number_format($discount,2);\n }\n else{\n $discount=$coupon[0]->discount;\n }\n \n return response()->json(['couponid'=>$coupon[0]->id, 'name'=>$request->code,'discount'=>$discount,'total'=>Cart::total()]);\n\n }",
"function get_coupon($id) {\n\t\t$this->db->where ( 'id', $id );\n\t\t$res = $this->db->get ( 'coupons' );\n\t\treturn $res->row ();\n\t}",
"public function index()\n {\n return Coupon::all();\n }",
"private function get_centralbank_data($url){\n // create curl resource \n $ch = curl_init(); \n\n // set url \n curl_setopt($ch, CURLOPT_URL, $url); \n\n //return the transfer as a string \n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17');\n curl_setopt($ch, CURLOPT_AUTOREFERER, true); \n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n // $output contains the output string \n $output = curl_exec($ch); \n\n $data = json_decode($output,true);\n\n // close curl resource to free up system resources \n curl_close($ch); \n\n $rate=str_replace(',','',$data['rates'][\"USD\"]);\n\n \n \n return [\n \"title\" => \"Central Bank\",\n \"currency\" =>\"USD\",\n \"buy\" => intval($rate),\n \"sell\" => intval($rate),\n 'created_at'=>date('Y-m-d H:i:s'),\n 'updated_at'=> date('Y-m-d H:i:s')\n ];\n }",
"public function getBillingData()\n {\n return $this->data['billing'];\n }",
"public function makeCupon($cuponFields = [])\n {\n /** @var CuponRepository $cuponRepo */\n $cuponRepo = App::make(CuponRepository::class);\n $theme = $this->fakeCuponData($cuponFields);\n return $cuponRepo->create($theme);\n }",
"public function getCouponAmount()\n {\n return $this->couponAmount;\n }",
"function GetFakeData()\n {\n return $this->arrFakeData;\n }",
"public function postactualizarcupon() {\n CuponValidation::validate($_POST);\n\n $model = (new CuponRepository())->Obtener($_POST['id']);\n\n if (isset($_POST['codigo'])) $model->codigo = $_POST['codigo'];\n if (isset($_POST['descuento'])) $model->descuento = $_POST['descuento'];\n if (isset($_POST['descripcion'])) $model->descripcion = $_POST['descripcion'];\n if (isset($_POST['inicio_fecha'])) $model->inicio_fecha = $_POST['inicio_fecha'];\n if (isset($_POST['fin_fecha'])) $model->fin_fecha = $_POST['fin_fecha'];\n\n $rh = new ResponseHelper();\n if ($model->fin_fecha > $model->inicio_fecha) {\n $rh = (new CuponRepository())->Guardar($model);\n if ($rh->response) {\n $rh->href = 'mantenimiento/cupones';\n }\n }\n print_r(json_encode($rh));\n }",
"public function getData() {}",
"function getCouponDetails() \n{\n\t\n\t\t $obj_con = new class_dbconnector();\n \n \n\t\n\n\t\t$sSQL = \" SELECT * FROM `tbl_genrate_coupon` where 1=1 \";\n\t\t\n\t\tif(isset($this->coupon_code))\n\t\t{\n\t\t\t$sSQL.= \" AND \tcoupon_code='$this->coupon_code'\";\n\t\t}\n\t\n\t\t\n\t\n\t \n $sSQL;\n\t\n\t\n\t\t$RecordSet = $obj_con->select($sSQL);\n\t\t$obj_con->connection_close();\n\t\treturn $RecordSet;\n\t}",
"public function getData()\n {\n $this->validate(\n 'merNo',\n 'gatewayNo',\n 'signKey',\n 'transactionId',\n 'amount',\n 'currency',\n 'clientIp',\n 'returnUrl',\n 'csid'\n );\n\n $this->getCard()->validate();\n\n $data = array();\n $data['merNo'] = $this->getMerNo();\n $data['gatewayNo'] = $this->getGatewayNo();\n $data['orderNo'] = $this->getTransactionId();\n $data['orderCurrency'] = $this->getCurrency();\n $data['orderAmount'] = $this->getAmount();\n $data['firstName'] = $this->getCard()->getFirstName();\n $data['lastName'] = $this->getCard()->getLastName();\n $data['cardNo'] = $this->getCard()->getNumber();\n $data['cardExpireMonth'] = $this->getCard()->getExpiryDate('m');\n $data['cardExpireYear'] = $this->getCard()->getExpiryDate('Y');\n $data['cardSecurityCode'] = $this->getCard()->getCvv();\n $data['issuingBank'] = $this->getIssuer()->getName();\n $data['email'] = $this->getCard()->getEmail();\n $data['ip'] = $this->getClientIp();\n $data['returnUrl'] = $this->getReturnUrl();\n $data['phone'] = $this->getCard()->getPhone();\n $data['country'] = $this->getCard()->getCountry();\n $data['state'] = $this->getCard()->getState();\n $data['city'] = $this->getCard()->getCity();\n $data['address'] = $this->getCard()->getAddress1();\n $data['zip'] = $this->getCard()->getPostcode();\n $data['remark'] = $this->getDescription();\n\n $data['signInfo'] = $this->getSignInfo();\n $data['csid'] = $this->getCsid();\n\n return $data;\n }",
"public function getAllCoupons(){\n $sql = \"SELECT * FROM t_coupons\";\n\n return $this->db->query($sql);\n }",
"public function getData()\n {\n $this->validateData();\n\n $data = array(\n 'version' => $this->getVersion(),\n 'charset' => $this->getEncoding(), //UTF-8, GBK等\n 'merId' => $this->getMerId(), //无卡商户填写\n 'merAbbr' => $this->getMerAbbr(), //商户名称\n 'transType' => $this->getTransType(), //交易类型,CONSUME or PRE_AUTH\n 'orderAmount' => $this->getOrderAmount(), //交易金额\n 'orderNumber' => $this->getOrderNumber(), //订单号,必须唯一\n 'orderTime' => $this->getOrderTime(), //交易时间, YYYYmmhhddHHMMSS\n 'orderCurrency' => $this->getOrderCurrency(), //交易币种,CURRENCY_CNY=>156\n 'customerIp' => $this->getCustomerIp(), //用户IP\n 'frontEndUrl' => $this->getReturnUrl(), //前台回调URL\n 'backEndUrl' => $this->getNotifyUrl(), //后台回调URL\n 'commodityUrl' => $this->getShowUrl(),\n 'commodityName' => $this->getTitle(),\n 'origQid' => '',\n 'acqCode' => '',\n 'merCode' => '',\n 'commodityUnitPrice' => '',\n 'commodityQuantity' => '',\n 'commodityDiscount' => '',\n 'transferFee' => '',\n 'customerName' => '',\n 'defaultPayType' => '',\n 'defaultBankNumber' => '',\n 'transTimeout' => '',\n 'merReserved' => '',\n 'signMethod' => 'md5',\n );\n\n $data = $this->filter($data);\n\n $data['signature'] = $this->sign($data);\n\n return $data;\n }",
"private function getCheckoutData()\n {\n\n // Enter the details of the payment\n\n //dd('VONE' . $this->userPhone);\n \n \n $this->calculateTotal();\n $order_id = $this->paymentRepository->all()->count() + 1;\n $data = [\n 'amount' => $this->total,\n 'tx_ref' => $order_id,\n 'email' => $this->order->user->email,\n 'currency' => \"KES\",\n 'payment_options' => 'mpesa,card,banktransfer',\n 'customer' => [\n 'name' => $this->order->user->name,\n 'phone_number' => $this->userPhone,\n 'email' => $this->order->user->email,\n ],\n 'customizations' => [\n 'title' => $this->order->user->cart[0]->product->market->name,\n \"description\" => \"Checkout\",\n ],\n 'redirect_url' => url(\"payments/flutterwave/callback?user_id=\" . $this->order->user_id . \"&delivery_address_id=\" . $this->order->delivery_address_id)\n ];\n \n return $data;\n }",
"public function getData()\n {\n $this->validate('apitoken', 'serviceId', 'transactionReference');\n\n $data = array();\n $data['transactionId'] = $this->getTransactionReference();\n\n if ($this->getAmount() != null) {\n $data['amount'] = round($this->getAmount() * 100);\n }\n if ($this->getDescription() != null) {\n $data['description'] = $this->getDescription();\n }\n\n return $data;\n }"
] | [
"0.64182824",
"0.63640916",
"0.61339456",
"0.59905106",
"0.58022344",
"0.5742471",
"0.5689372",
"0.5684805",
"0.562621",
"0.5593684",
"0.5562463",
"0.5536754",
"0.55202574",
"0.5504113",
"0.54648674",
"0.54425263",
"0.54343814",
"0.5427064",
"0.5422697",
"0.5412178",
"0.5402379",
"0.5371111",
"0.5341913",
"0.53345263",
"0.53122604",
"0.5300449",
"0.5287984",
"0.52864444",
"0.52337784",
"0.5224699"
] | 0.64479166 | 0 |
/ (C) 2020 Skyfallen / Skyfallen Secure Forms Developed by / The Skyfallen Company / / File Since: SFR301120 / This file is used for rendering the system updates page This function renders the software update page. | function render_updates_page() {
$provider_info = \SkyfallenCodeLibrary\UpdatesConsoleConnector::getProviderData(UC_API_ENDPOINT);
$new_vname = \SkyfallenCodeLibrary\UpdatesConsoleConnector::getLatestVersion(UC_API_APPID,UC_API_APPSEED,UC_API_ENDPOINT);
$new_version_data = \SkyfallenCodeLibrary\UpdatesConsoleConnector::getLatestVersionData(UC_API_APPID,UC_API_APPSEED,UC_API_ENDPOINT);
$user = new SSFUser(USERNAME);
if($user->role != "SUPERUSER"){
include_once SSF_ABSPATH."/SSF_Includes/404.php";
die();
}
?>
<html>
<head>
<title>Skyfallen SecureForms: Software Update</title>
<link rel="stylesheet" type="text/css" href="<?php the_fileurl("static/css/updates-page.css"); ?>">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap" rel="stylesheet">
</head>
<body>
<div class="infowrap">
<h1 class="app-branding">SecureForms by Skyfallen</h1>
<h3 class="rel-id"><?php echo THIS_VERSION_NICKNAME." (".THIS_VERSION_BRANCH." ".THIS_VERSION.")"; ?></h3>
<hr>
<div class="new-version-info">
<?php
if (THIS_VERSION != $new_vname){
if(isset($_GET["install"])) {
if ($_GET["install"] == "start") {
$_SESSION["UPDATE_AUTHORIZED"] = "TRUE";
ssf_redirect("SoftwareUpdater.php");
}
}
?>
<div class="text-center">
<h3>Updates are available:</h3>
</div>
<div class="update-details">
<div class="update-details-padded-container">
<h4><?php echo $new_version_data["title"]; ?> (<?php echo $new_version_data["version"]; ?>) </h4>
<h4>Release Date:<?php echo $new_version_data["releasedate"]; ?></h4>
<h5>Description:<br><?php echo $new_version_data["description"]; ?></h5>
</div>
</div>
<div class="text-center">
<a href="?install=start" class="update-btn">Update</a>
</div>
<?php
}
else {
echo "<div class='noupdates-container'><p class='noupdates'>You are up to date.</p></div>";
}
?>
</div>
<hr>
<div class="provider-info">
<div class="provider-info-text">
<h4>This SecureForms instance's software updates are externally managed by<br> <a href="<?php echo $provider_info["url"] ?>"><?php echo $provider_info["name"]; ?></a></h4>
<h6><small><?php echo THIS_VERSION; ?> - <?php echo "Current Version's Provider: ".VERSION_PROVIDER; ?></small></h6>
</div>
</div>
</div>
</body>
</html>
<?php
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function shell_system_update() {\n $this->system_update();\n $this->render('system_update');\n }",
"function supreme_framework_update_head()\r\n{\r\n\tif( isset( $_REQUEST['page'] ) ) {\r\n\t// Sanitize page being requested.\r\n\t$_page = esc_attr( $_REQUEST['page'] );\r\n\r\n\tif( ($_page == 'templatic_menu' || $_page=='tmpl_framework_update') && @$_REQUEST['spreme_update']=='Update Framework') {\r\n\t\t//Setup Filesystem\r\n\t\t$method = get_filesystem_method();\r\n\r\n\t\tif( isset( $_POST['supreme_ftp_cred'] ) ) {\r\n\t\t\t$cred = unserialize( base64_decode( $_POST['supreme_ftp_cred'] ) );\r\n\t\t\t$filesystem = WP_Filesystem($cred);\r\n\t\t} else {\r\n\t\t $filesystem = WP_Filesystem();\r\n\t\t}\r\n\t\t\r\n\t\tif( $filesystem == false && $_POST['upgrade'] != 'Proceed' ) {\r\n\r\n\t\t\tfunction supreme_framework_update_filesystem_warning() {\r\n\t\t\t\t\t$method = get_filesystem_method();\r\n\t\t\t\t\techo \"<div id='filesystem-warning' class='updated fade'><p>Failed: Filesystem preventing downloads. ( \". $method .\")</p></div>\";\r\n\t\t\t\t}\r\n\t\t\t\tadd_action( 'admin_notices', 'supreme_framework_update_filesystem_warning' );\r\n\t\t\t\treturn;\r\n\t\t}\r\n\t\tif(isset($_REQUEST['supreme_update_save'])){\r\n\r\n\t\t\t// Sanitize action being requested.\r\n\t\t\t$_action = esc_attr( $_REQUEST['supreme_update_save'] );\r\n\r\n\t\tif( $_action == 'save' ) {\r\n\r\n\t\t$temp_file_addr = download_url( esc_url( 'http://www.templatic.com/updates/library.zip' ) );\t\t\r\n\t\tif ( is_wp_error($temp_file_addr) ) {\r\n\r\n\t\t\t$error = esc_html( $temp_file_addr->get_error_code() );\r\n\r\n\t\t\tif( $error == 'http_no_url' ) {\r\n\t\t\t//The source file was not found or is invalid\r\n\t\t\t\tfunction supreme_framework_update_missing_source_warning() {\r\n\t\t\t\t\techo \"<div id='source-warning' class='updated fade'><p>Failed: Invalid URL Provided</p></div>\";\r\n\t\t\t\t}\r\n\t\t\t\tadd_action( 'admin_notices', 'supreme_framework_update_missing_source_warning' );\r\n\t\t\t} else {\r\n\t\t\t\tfunction supreme_framework_update_other_upload_warning() {\r\n\t\t\t\t\techo \"<div id='source-warning' class='updated fade'><p>Failed: Upload - $error</p></div>\";\r\n\t\t\t\t}\r\n\t\t\t\tadd_action( 'admin_notices', 'supreme_framework_update_other_upload_warning' );\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn;\r\n\r\n\t\t }\r\n\t\t//Unzip it\r\n\t\tglobal $wp_filesystem;\r\n\t\t$to = $wp_filesystem->wp_content_dir() . \"/themes/\" . get_option( 'template' ) ;\t\t\r\n\t\t\r\n\t\t$dounzip = unzip_file($temp_file_addr, $to);\r\n\r\n\t\tunlink($temp_file_addr); // Delete Temp File\r\n\r\n\t\tif ( is_wp_error($dounzip) ) {\r\n\r\n\t\t\t//DEBUG\r\n\t\t\t$error = esc_html( $dounzip->get_error_code() );\r\n\t\t\t$data = $dounzip->get_error_data($error);\r\n\t\t\t//echo $error. ' - ';\r\n\t\t\t//print_r($data);\r\n\r\n\t\t\tif($error == 'incompatible_archive') {\r\n\t\t\t\t//The source file was not found or is invalid\r\n\t\t\t\tfunction supreme_framework_update_no_archive_warning() {\r\n\t\t\t\t\techo \"<div id='woo-no-archive-warning' class='updated fade'><p>Failed: Incompatible archive</p></div>\";\r\n\t\t\t\t}\r\n\t\t\t\tadd_action( 'admin_notices', 'supreme_framework_update_no_archive_warning' );\r\n\t\t\t}\r\n\t\t\tif($error == 'empty_archive') {\r\n\t\t\t\tfunction supreme_framework_update_empty_archive_warning() {\r\n\t\t\t\t\techo \"<div id='woo-empty-archive-warning' class='updated fade'><p>Failed: Empty Archive</p></div>\";\r\n\t\t\t\t}\r\n\t\t\t\tadd_action( 'admin_notices', 'supreme_framework_update_empty_archive_warning' );\r\n\t\t\t}\r\n\t\t\tif($error == 'mkdir_failed') {\r\n\t\t\t\tfunction supreme_framework_update_mkdir_warning() {\r\n\t\t\t\t\techo \"<div id='woo-mkdir-warning' class='updated fade'><p>Failed: mkdir Failure</p></div>\";\r\n\t\t\t\t}\r\n\t\t\t\tadd_action( 'admin_notices', 'supreme_framework_update_mkdir_warning' );\r\n\t\t\t}\r\n\t\t\tif($error == 'copy_failed') {\r\n\t\t\t\tfunction supreme_framework_update_copy_fail_warning() {\r\n\t\t\t\t\techo \"<div id='woo-copy-fail-warning' class='updated fade'><p>Failed: Copy Failed</p></div>\";\r\n\t\t\t\t}\r\n\t\t\t\tadd_action( 'admin_notices', 'supreme_framework_update_copy_fail_warning' );\r\n\t\t\t}\r\n\r\n\t\t\treturn;\r\n\r\n\t\t}\r\n\r\n\t\tfunction supreme_framework_updated_success() {\r\n\t\t\techo \"<div id='framework-upgraded' class='updated fade'><p>New framework successfully downloaded, extracted and updated.</p></div>\";\r\n\t\t\tupdate_option( 'suprem_framework_version', $_POST['remote_version']);\r\n\t\t}\r\n\t\t\r\n\t\tadd_action( 'admin_notices', 'supreme_framework_updated_success' );\r\n\r\n\t\t}\r\n\t}\r\n\t} //End user input save part of the update\r\n }\t\r\n}",
"function update_info_page() {\n _drupal_flush_css_js();\n // Flush the cache of all data for the update status module.\n if (db_table_exists('cache_update')) {\n cache_clear_all('*', 'cache_update', TRUE);\n }\n\n update_task_list('info');\n drupal_set_title('Drupal database update');\n $token = drupal_get_token('update');\n $output = '<p>Use this utility to update your database whenever a new release of Drupal or a module is installed.</p><p>For more detailed information, see the <a href=\"http://drupal.org/node/258\">Installation and upgrading handbook</a>. If you are unsure what these terms mean you should probably contact your hosting provider.</p>';\n $output .= \"<ol>\\n\";\n $output .= \"<li><strong>Back up your database</strong>. This process will change your database values and in case of emergency you may need to revert to a backup.</li>\\n\";\n $output .= \"<li><strong>Back up your code</strong>. Hint: when backing up module code, do not leave that backup in the 'modules' or 'sites/*/modules' directories as this may confuse Drupal's auto-discovery mechanism.</li>\\n\";\n $output .= '<li>Put your site into <a href=\"'. base_path() .'?q=admin/settings/site-maintenance\">maintenance mode</a>.</li>'.\"\\n\";\n $output .= \"<li>Install your new files in the appropriate location, as described in the handbook.</li>\\n\";\n $output .= \"</ol>\\n\";\n $output .= \"<p>When you have performed the steps above, you may proceed.</p>\\n\";\n $output .= '<form method=\"post\" action=\"update.php?op=selection&token='. $token .'\"><p><input type=\"submit\" value=\"Continue\" /></p></form>';\n $output .= \"\\n\";\n return $output;\n}",
"public function renderIEPUpdates() {\n\t\t$layout = RCLayout::factory()\n\t\t\t->newLine()\n\t\t\t->addText('V. IEP Updates (Address and include only the applicable attachments.):', $this->titleStyle());\n\n\t\t$updates = IDEADef::getValidValues('TX_IEP_Updates');\n\t\t$allUpdates = count($updates);\n\t\t$values = explode(\n\t\t\t',',\n\t\t\tIDEAStudentRegistry::readStdKey(\n\t\t\t\t$this->std->get('tsrefid') ,\n\t\t\t\t'tx_ard' ,\n\t\t\t\t'iep_updates' ,\n\t\t\t\t$this->std->get('stdiepyear')\n\t\t\t)\n\t\t);\n\n\t\tfor ($i = 0; $i < $allUpdates; $i++) {\n\t\t\t$layout->newLine('.martop10')\n\t\t\t\t->addText('<b>' . $updates[$i]->get(IDEADefValidValue::F_VALUE_ID) . '</b>');\n\n\t\t\t$check = 'N';\n\t\t\t# if exist in array refid add checked\n\t\t\tif (in_array($updates[$i]->get(IDEADefValidValue::F_REFID), $values)) $check = 'Y';\n\n\t\t\t$this->addYN($layout->newLine('.martop10'), $check);\n\t\t\t$layout->addText($updates[$i]->get(IDEADefValidValue::F_VALUE), '.padtop5');\n\t\t}\n\n\t\t$this->rcDoc->addObject($layout);\n\t}",
"public function system_update() {\n\t\t$http_host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';\n $this->set('network_url', 'http://' . $http_host . $this->webroot);\n \n // XXX security_token is set to avoid \"undefined variable\" error in view\n $this->set('security_token', '');\n $this->set('extensions', ExtensionsChecker::check());\n\t\t$this->set('random_number_generator', RandomNumberGeneratorChecker::check());\n \n $this->layout = 'system_update';\n \n $directories = WriteableFoldersChecker::check();\n $this->set('directories', $directories);\n if(!empty($directories)) {\n return;\n }\n \n CacheCleaner::cleanUp();\n \n $this->ConfigurationChecker = new ConfigurationChecker();\n $constants = $this->ConfigurationChecker->check();\n $this->set('constants', $constants);\n if(!empty($constants)) {\n return;\n }\n \n $database_status = $this->Migration->getDatabaseStatus();\n $this->set('database_status', $database_status);\n if($database_status == 1) {\n $current_migration = $this->Migration->getCurrentMigration();\n $most_recent_migration = $this->Migration->getMostRecentMigration();\n $this->set('current_migration', $current_migration);\n $this->set('most_recent_migration', $most_recent_migration);\n \n if($current_migration < $most_recent_migration) {\n $migrations = $this->Migration->getOpenMigrations($current_migration);\n $this->Migration->migrate($migrations, $current_migration, $most_recent_migration);\n \n $this->set('migrations', $migrations);\n }\n } \n }",
"function apps_update_page($server_name) { \n apps_include('manifest'); \n // find all updateable apps (NOTE: currently this never retruns anything\n //$apps = apps_apps($server_name, array(\"updateable\" =>TRUE), TRUE);\n return array(\n '#theme'=> 'apps_update_page',\n );\n}",
"public function update()\n\t{\n\t\tif ($this->util_model->checkUpdate())\n\t\t{\n\t\t\tif ($this->input->get('confirm'))\n\t\t\t{\n\t\t\t\t$data['message'] = \"Please wait while I'm upgrading the system...\";\n\t\t\t\t$data['timer'] = true;\n\t\t\t\t$this->util_model->update();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$data['title'] = \"System update detected\";\n\t\t\t\t$data['message'] = '<a href=\"'.site_url(\"app/update\").'?confirm=1\"><button class=\"btn btn-default btn-lg\"><i class=\"fa fa-check\"></i> Let me install the updates</button></a> <a href=\"'.site_url(\"app/dashboard\").'\"><button class=\"btn btn-default btn-lg\"><i class=\"fa fa-times\"></i> No, thanks</button></a>';\n\t\t\t\t$data['timer'] = false;\n\t\t\t}\n\t\t\t$data['messageEnd'] = \"System updated!\";\n\t\t\t$data['htmlTag'] = \"lockscreen\";\n\t\t\t$data['seconds'] = 15;\n\t\t\t$data['refreshUrl'] = site_url(\"app/index\");\n\t\t\t$this->load->view('include/header', $data);\n\t\t\t$this->load->view('sysop', $data);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tredirect(\"app/dashboard\");\n\t\t}\n\t}",
"function supreme_framework_update_notice()\r\n{\t\r\n\t$framework_version=get_option( 'suprem_framework_version' );\r\n\t$supreme_framework_response=get_option('supreme_framework_response');\t\r\n\tif(empty($supreme_framework_response) || $supreme_framework_response=='')\r\n\t\treturn false;\r\n\tif (version_compare($framework_version, $supreme_framework_response['new_version'], '<') && $framework_version!='' && (@$_REQUEST['page'] != 'tmpl_framework_update')){\r\n\t\techo '<div id=\"update-nag\">';\r\n\t\t$framework_changelog = esc_url( add_query_arg( array( 'slug' => 'framework_changelog', 'action' => 'framework_changelog' , '_ajax_nonce' => wp_create_nonce( 'framework_changelog' ), 'TB_iframe' => true ,'width'=>500,'height'=>400), admin_url( 'admin-ajax.php' ) ) );\r\n\t\t\r\n\t\t$new_version .= ' <a class=\"thickbox\" title=\"Framework\" href=\"'.$framework_changelog.'\">'. sprintf(__('View version %s Details', 'Framework'), $supreme_framework_response['new_version']) . '</a>. or ' ;\r\n\t\techo \"A new version of Framework is available. {$new_version} update framework from <a href='\".site_url().\"/wp-admin/admin.php?page=tmpl_framework_update'>Framework Update</a> menu\";\t\t\t \r\n\t\techo '</div>';\t;\t\r\n\t}\r\n}",
"function logger_firmwareupgrade_page() {\n\n drupal_set_title(t('Device Firmware Upgrade'));\n\n $form = drupal_get_form('logger_firmwareupgradefilter_form');\n return drupal_render($form);\n}",
"function fpd_admin_display_version_info() {\n\n\t\techo '<div class=\"fpd-header-right\"><a href=\"http://support.fancyproductdesigner.com\" target=\"_blank\" class=\"button-primary\">'.__('Support Center', 'radykal').'</a><p class=\"description\">';\n\n\t\tif( false === ( $fpd_version = get_transient( 'fpd_version' ) )) {\n\n\t\t\t$version_str = fpd_admin_get_file_content(\"http://assets.radykal.de/fpd/version.json\");\n\t\t\tif($version_str !== false) {\n\t\t\t\t$json = json_decode($version_str, true);\n\t\t\t\t$current_version = $json['version'];\n\n\t\t\t\tset_transient('fpd_version', $current_version, HOUR_IN_SECONDS);\n\t\t\t}\n\n\t\t}\n\t\telse {\n\n\t\t\t$current_version = $fpd_version;\n\t\t\tdelete_transient('fpd_version');\n\n\t\t}\n\n\t\tif(Fancy_Product_Designer::VERSION < $current_version) {\n\n\t\t\t_e('You are not using the <a href=\"http://support.fancyproductdesigner.com/support/discussions/forums/5000283646\" target=\"_blank\">latest version</a> of Fancy Product Designer. Please go to your <a href=\"http://codecanyon.net/downloads\" target=\"_blank\">downloads tab on codecanyon</a> and download it again. Read also the <a href=\"http://support.fancyproductdesigner.com/support/solutions/articles/5000582931\" target=\"_blank\">upgrading documentation</a> how to install a new version.', 'radykal');\n\n\t\t}\n\n\t\techo '</p></div>';\n}",
"function support_mainpage(){\n\t\tglobal $txt, $db, $x7c, $x7s, $print, $prefix;\n\t\t\n\t\t// Make sure they are who they say they are\n\t\t$supporters= explode(\";\",$x7c->settings['support_personel']);\n\t\tif(!in_array($x7s->username,$supporters)){\n\t\t\t// Give them an access denied message\n\t\t\t$print->normal_window($txt[14],$txt[216]);\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\t// See which page we want\n\t\tif(isset($_GET['update'])){\n\t\t\t// Conserve bandwidth like it means your life\n\t\t\t// Make us online\n\t\t\t$query = $db->DoQuery(\"SELECT * FROM {$prefix}online WHERE name='$x7s->username' AND room='support;'\");\n\t\t\t$row = $db->Do_Fetch_Row($query);\n\t\t\tif($row[0] == \"\"){\n\t\t\t\t// We are new here\n\t\t\t\t$time = time();\n\t\t\t\t$ip = $_SERVER['REMOTE_ADDR'];\n\t\t\t\t$db->DoQuery(\"INSERT INTO {$prefix}online VALUES(0,'$x7s->username','$ip','support;','','$time','')\");\n\t\t\t}else{\n\t\t\t\t// Run an update\n\t\t\t\t$time = time();\n\t\t\t\t$db->DoQuery(\"UPDATE {$prefix}online SET time='$time' WHERE name='$x7s->username' AND room='support;'\");\n\t\t\t}\n\t\t\t\n\t\t\t// Continuez\n\t\t\t$pm_time = time()-2*($x7c->settings['refresh_rate']/1000);\n\t\t\t$query = $db->DoQuery(\"SELECT user FROM {$prefix}messages WHERE type='5' AND room='$x7s->username:0' AND time<'$pm_time' ORDER BY time ASC\");\n\t\t\techo mysql_error();\n\t\t\t$script = \"\";\n\t\t\twhile($row = $db->Do_Fetch_Row($query)){\n\t\t\t\tif(!in_array($row[0],$x7c->profile['ignored'])){\n\t\t\t\t\t// Open a new support window\n\t\t\t\t\t$script = \"window.open('index.php?act=pm&send_to=$row[0]','','location=no,menubar=no,resizable=no,status=no,toolbar=no,scrollbars=yes,width={$x7c->settings['tweak_window_large_width']},height={$x7c->settings['tweak_window_large_height']}');\\r\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$body = \"<html><head><script language=\\\"javascript\\\" type=\\\"text/javascript\\\">$script</script></head><body onLoad=\\\"javascript: setTimeout('location.reload()','{$x7c->settings['refresh_rate']}');\\\"> </body>\";\n\t\t\t$print->add($body);\n\t\t}else{\n\t\t\t\n\t\t\t// Give them a screen with an update frame and info about site\n\t\t\t$ranroom = \"General Chat\";\n\t\t\t$body = \"<iframe src=\\\"./index.php?act=support_sit&update=1&room=$ranroom\\\" width=\\\"0\\\" height=\\\"0\\\" style=\\\"visibility: hidden;\\\"></iframe>\";\n\t\t\t$body .= \"$txt[603]\";\n\t\t\t\n\t\t\t$print->normal_window($txt[599],$body);\n\t\t}\n\t\t\n\t\treturn 1;\n\t}",
"function update_notifier_menu() {\n\tif ( function_exists( 'simplexml_load_string' ) ) { // Stop if simplexml_load_string funtion isn't available.\n\t\t$xml = get_latest_theme_version( UDESIGN_NOTIFIER_CACHE_INTERVAL ); // Get the latest remote XML file on our server.\n\t\t\n\t\tif( version_compare( $xml->latest, UDESIGN_NOTIFIER_CURR_THEME_VERSION, '>' ) ) { // Compare current theme version with the remote XML version.\n\t\t\tadd_dashboard_page( \n\t\t\t\t__( 'U-Design Theme Updates', 'udesign' ), \n\t\t\t\t__( 'U-Design <span class=\"update-plugins\">' . __( '1 Update', 'udesign' ) . '</span>' ), \n\t\t\t\twho_can_edit_udesign_theme_options(), // Roles and capabilities.\n\t\t\t\t'theme-update-notifier', \n\t\t\t\t'update_notifier' \n\t\t\t);\n\t\t}\n\t}\n}",
"public function notice_upfront_update() {\r\n\t\t$upfront_url = '#update=' . $this->id_upfront;\r\n\t\t$message = sprintf(\r\n\t\t\t'<b>%s</b><br>%s',\r\n\t\t\t__( 'Awesome news for Upfront', 'wpmudev' ),\r\n\t\t\t__( 'We have a new version of Upfront for you! Install it right now to get all the latest improvements and features.', 'wpmudev' )\r\n\t\t);\r\n\r\n\t\t$cta = sprintf(\r\n\t\t\t'<span data-project=\"%s\">\r\n\t\t\t<a href=\"%s\" class=\"button show-project-update\">Update Upfront</a>\r\n\t\t\t</span>',\r\n\t\t\t$this->id_upfront,\r\n\t\t\t$upfront_url\r\n\t\t);\r\n\r\n\t\tdo_action( 'wpmudev_override_notice', $message, $cta );\r\n\r\n\t\tWPMUDEV_Dashboard::$notice->setup_message();\r\n\t}",
"public function updateinfo()\n\t{\n\t\t$updateModel = JModelLegacy::getInstance('Updates', 'CmcModel');\n\t\t$updateInfo = (object) $updateModel->getUpdates(true);\n\t\t$extensionName = 'CMC';\n\n\t\t$result = '';\n\n\t\tif ($updateInfo->hasUpdate)\n\t\t{\n\t\t\t$strings = array(\n\t\t\t\t'header' => JText::sprintf('LIB_COMPOJOOM_DASHBOARD_MSG_UPDATEFOUND', $extensionName, $updateInfo->version),\n\t\t\t\t'button' => JText::sprintf('LIB_COMPOJOOM_DASHBOARD_MSG_UPDATENOW', $updateInfo->version),\n\t\t\t\t'infourl' => $updateInfo->infoURL,\n\t\t\t\t'infolbl' => JText::_('LIB_COMPOJOOM_DASHBOARD_MSG_MOREINFO'),\n\t\t\t);\n\n\t\t\t$result = <<<ENDRESULT\n\t<div class=\"alert alert-warning\">\n\t\t<h3>\n\t\t\t<span class=\"fa fa-warning\"></span>\n\t\t\t{$strings['header']}\n\t\t</h3>\n\t\t<p>\n\t\t\t<a href=\"index.php?option=com_installer&view=update\" class=\"btn btn-primary\">\n\t\t\t\t{$strings['button']}\n\t\t\t</a>\n\t\t\t<a href=\"{$strings['infourl']}\" target=\"_blank\" class=\"btn btn-small btn-info\">\n\t\t\t\t{$strings['infolbl']}\n\t\t\t</a>\n\t\t</p>\n\t</div>\nENDRESULT;\n\t\t}\n\n\t\techo '###' . $result . '###';\n\n\t\t// Cut the execution short\n\t\tJFactory::getApplication()->close();\n\t}",
"function ayecode_show_update_plugin_requirement() {\n\t\t\tif ( !defined( 'WP_EASY_UPDATES_ACTIVE' ) ) {\n\t\t\t\t?>\n\t\t\t\t<div class=\"notice notice-warning is-dismissible\">\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<strong>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\techo sprintf( __( 'The plugin %sWP Easy Updates%s is required to check for and update some installed plugins/themes, please install it now.', 'geodirectory' ), '<a href=\"https://wpeasyupdates.com/\" target=\"_blank\" title=\"WP Easy Updates\">', '</a>' );\n\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t</strong>\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t<?php\n\t\t\t}\n\t\t}",
"function new_update()\n\t{\n\t\tif (!defined(PAPOO_ABS_PFAD)) {\n\t\t\tglobal $version;\n\t\t\tdefine(PAPOO_ABS_PFAD,PAPOO_ABS_PFAD);\n\t\t\tdefine(PAPOO_VERSION_STRING,$version);\n\t\t}\n\n\t\t//Update der 3.6.0\n\t\tif (stristr(PAPOO_VERSION_STRING,\"3.6.0\")) {\n\t\t\t$nr=360;\n\t\t}\n\t\t//Update der 3.6.1\n\t\tif (stristr(PAPOO_VERSION_STRING,\"3.6.1\")) {\n\t\t\t$nr=361;\n\t\t}\n\t\t//Update der 3.6.0\n\t\tif (stristr(PAPOO_VERSION_STRING,\"3.7.0\")) {\n\t\t\t$nr=370;\n\t\t}\n\t\t//Update der 3.6.1\n\t\tif (stristr(PAPOO_VERSION_STRING,\"3.7.1\")) {\n\t\t\t$nr=371;\n\t\t}\n\t\tif (stristr(PAPOO_VERSION_STRING,\"3.7.2\")) {\n\t\t\t$nr=372;\n\t\t}\n\t\tif (stristr(PAPOO_VERSION_STRING,\"3.7.3\")) {\n\t\t\t$nr=373;\n\t\t}\n\t\tif (stristr(PAPOO_VERSION_STRING,\"3.7.5\")) {\n\t\t\t$nr=375;\n\t\t}\n\n\t\t$this->content->template['update_templateweiche_ok'] = \"OK\";\n\t\t$this->content->template['update_templateweiche_new'] = \"NEU\";\n\n\t\t//Update noch nicht durchgeführt\n\t\tif ($this->checked->drin!=\"ok\") {\n\t\t\t//Update durchführen\n\t\t\tif ($this->checked->update_now==\"ok\") {\n\t\t\t\t$this->dumpnrestore->restore_load(PAPOO_ABS_PFAD.\"/update/update\".$nr.\".sql\");\n\t\t\t\t$this->db->hide_errors();\n\t\t\t\t$this->dumpnrestore->restore_save();\n\t\t\t\t//Menüpunkte zuweisen aus der alten Version\n\t\t\t\tif ($nr<370) {\n\t\t\t\t\t$this->do_old_menu();\n\t\t\t\t}\n\t\t\t\t//Interne Templates_c löschen\n\t\t\t\t$this->diverse->remove_files(PAPOO_ABS_PFAD.\"/interna/templates_c/standard/\",\".html.php\");\n\n\t\t\t\t$_SESSION['start_update']=\"20\";\n\t\t\t\t$location_url = $_SERVER['PHP_SELF'] . \"?menuid=65&drin=ok&start_update=2\";\n\t\t\t\tif ($_SESSION['debug_stopallredirect']) {\n\t\t\t\t\techo '<a href=\"' . $location_url . '\">Weiter</a>';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\theader(\"Location: $location_url\");\n\t\t\t\t}\n\t\t\t\texit();\n\t\t\t}\n\n\n\t\t\t//Update Text anzeigen\n\t\t\t$dateiarray = @file(PAPOO_ABS_PFAD.\"/update/update\".$nr.\".txt\");\n\t\t\t$this->content->template['update_content_text'] =@implode($dateiarray);\n\t\t\tif (empty($this->content->template['update_content_text'])) {\n\t\t\t\t$this->content->template['update_content_text']=\"Keine Datei vorhanden / No File\";\n\t\t\t}\n\t\t\t//Update Datei anzeigen\n\t\t\t$dateiarray = @file(PAPOO_ABS_PFAD.\"/update/update\".$nr.\".sql\");\n\t\t\t$this->content->template['update_content'] =(htmlentities(@implode($dateiarray), ENT_COMPAT,'utf-8'));\n\t\t\tif (empty($this->content->template['update_content'])) {\n\t\t\t\t$this->content->template['update_content']=\"Keine Datei vorhanden / No File\";\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t//Fertig anzeigen\n\t\t\t$this->content->template['fertig_update']=\"ok\";\n\t\t}\n\t}",
"function dynamik_updated_notice()\n{\n\tif( !isset( $_GET['page'] ) || $_GET['page'] != 'dynamik-settings' )\n\t\treturn;\n\t\n\tif( isset( $_GET['updated'] ) && $_GET['updated'] == 'dynamik-gen' )\n\t{\n\t\techo '<div id=\"update-nag\">' . sprintf( __( 'Congratulations! Your update to <strong>Dynamik %s</strong> is complete.', 'dynamik' ), get_option( 'dynamik_gen_version_number' ) ) . '</div>';\n\t}\n}",
"function pewc_plugin_update_message( $data, $response ) {\n\t$file = file_get_contents( 'https://pluginrepublic.com/wp-content/uploads/readme.txt' );\n\tif( $file ) {\n\t\t$notice = str_replace( \"== Upgrade Notice ==\\n\", '', stristr( $file, '== Upgrade Notice ==', false ) );\n\t\t$notice = trim( $notice, \"\\n\" );\n\t\tif( $notice ) {\n\t\t\techo '<style type=\"text/css\">\n\t\t\t.update-message.notice.inline.notice-warning.notice-alt p:empty {\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t.update-message .pewc-update-message p:before {\n\t\t\t\tcontent: \"\";\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\t.pewc-update-message ul {\n\t\t\t\tlist-style: disc;\n\t\t\t\tmargin-left: 2em;\n\t\t\t}\n\t\t\t</style>';\n\t\t\tprintf(\n\t\t\t\t'<div class=\"pewc-update-message\">%s</div>',\n\t\t\t\twpautop( $notice )\n\t\t\t);\n\t\t}\n\t}\n\n}",
"public function RenderUpdate($aArgs = array())\n\t{\n\t\tthrow new Exception(__class__.'::'.__function__.'Not implemented !');\n\t}",
"function show_plugin_table_update_notice() {\n\t\t\t\techo \"<tr class='plugin-update-tr'><td colspan='5' class='plugin-update'>\";\n\t\t\t\techo '<div class=\"update-message\">There is a new version of '.$this->plugin.' available. Download version '.get_option('dyno_'.$this->slug.'_remote_ver').' from the '.$this->plugin.' > Support tab.</div>';\n\t\t\t\techo \"</td></tr>\";\n\t}",
"public static function update_screen()\n {\n }",
"public function displayUpdate() {\n $postManager = new PostManager();\n\n $post = $postManager->getPostUpdate($_GET['id']);\n require(__DIR__ . '/../View/backend/updatePost.php');\n }",
"public function update() {\r\n\r\n\t\t\tif ( ! defined( 'IFRAME_REQUEST' ) && ! defined( 'DOING_AJAX' ) && ( get_option( wolf_get_theme_slug() . '_version' ) != WOLF_THEME_VERSION ) ) {\r\n\t\t\t\r\n\t\t\t\t// Update hook\r\n\t\t\t\tdo_action( 'wolf_do_update' );\r\n\r\n\t\t\t\t// Update version\r\n\t\t\t\tdelete_option( wolf_get_theme_slug() . '_version' );\r\n\t\t\t\tadd_option( wolf_get_theme_slug() . '_version', WOLF_THEME_VERSION );\r\n\r\n\t\t\t\t// After update hook\r\n\t\t\t\tdo_action( 'wolf_updated' );\r\n\t\t\t}\r\n\t\t}",
"function check_for_updates($my_version) {\r\n\t\t\t$version = file_get_contents('http://pwaplusphp.smccandl.net/wp-pro-ver.html');\r\n\t\t\tif ($version !== false) {\r\n\t\t\t\t$version=trim($version);\r\n\t\t\t\tif ($version > $my_version) {\r\n\t\t\t\t\treturn(\"<table><tr class='plugin-update-tr'><td class='plugin-update'><div class='update-message'>New Version Available. <a href='http://code.google.com/p/pwaplusphp/downloads/list'>Get v$version!</a></div></td></tr></table>\");\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn(\"Thanks for your donation!\");\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t# We had an error, fake a high version number so no message is printed.\r\n\t\t\t\t$version = \"9999\";\r\n\t\t\t}\r\n\t\t}",
"public function onAfterRender()\n\t{\n\t\t// Is the One Click Action plugin enabled?\n\t\t$app = JFactory::getApplication();\n\t\t$jResponse = $app->triggerEvent('onOneClickActionEnabled');\n\n\t\tif (empty($jResponse))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t$status = false;\n\n\t\tforeach ($jResponse as $response)\n\t\t{\n\t\t\t$status = $status || $response;\n\t\t}\n\n\t\tif (!$status)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Is the CMS Update extension installed and activated?\n\t\t$filePath = JPATH_ADMINISTRATOR . '/components/com_cmsupdate/cmsupdate.php';\n\n\t\tif (!file_exists($filePath))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Give it a 50% chance to run. This is necessary to avoid race conditions on busy sites.\n\t\tif (!defined('CMSUPDATEDEBUG'))\n\t\t{\n\t\t\tif (!mt_rand(0, 1))\n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t// Load FOF\n\t\tinclude_once JPATH_LIBRARIES . '/f0f/include.php';\n\n\t\tif(!defined('F0F_INCLUDED') || !class_exists('F0FForm', true))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Get the updates\n\t\t$model = F0FModel::getTmpInstance('Updates', 'CmsupdateModel');\n\t\t$updates = $model->getUpdateInfo();\n\n\t\tif (!$updates->status)\n\t\t{\n\t\t\t// No updates were found\n\t\t\treturn;\n\t\t}\n\n\t\t$source = $updates->source;\n\n\t\tif (empty($source) || ($source == 'none'))\n\t\t{\n\t\t\t// Really, no update was found!\n\t\t\treturn;\n\t\t}\n\n\t\t$update = $updates->$source;\n\n\t\t// Check the version. It must be different than the current version.\n\t\tif (version_compare($update['version'], JVERSION, 'eq'))\n\t\t{\n\t\t\t// I mean, come on, really, there are no updates!!!\n\t\t\treturn;\n\t\t}\n\n\t\t// Extra sanity check: the component must be enabled.\n\t\t// DO NOT MOVE UP THE STACK! getUpdateInfo() updates the component parameters. If you call\n\t\t// JComponentHelper::getComponent before the parameters are updated, the subsequent\n\t\t// JComponentHelper::getParams will not know the parameters have been updated and you will\n\t\t// cause unnecessary update checks against the updates server.\n\t\tjimport('joomla.application.component.helper');\n\t\t$component = JComponentHelper::getComponent('com_cmsupdate', true);\n\n\t\tif (!$component->enabled)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Should I send an email?\n\t\t$params = JComponentHelper::getParams('com_cmsupdate');\n\t\t$lastEmail = $params->get('lastemail', 0);\n\t\t$emailFrequency = $params->get('emailfrequency', 168);\n\t\t$now = time();\n\n\t\tif (!defined('CMSUPDATEDEBUG') && (abs($now - $lastEmail) < ($emailFrequency * 3600)))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Update the last email timestamp\n\t\t$params->set('lastemail', $now);\n\n\t\t$db = JFactory::getDbo();\n\t\t$query = $db->getQuery(true)\n\t\t\t->update($db->qn('#__extensions'))\n\t\t\t->set($db->qn('params') . ' = ' . $db->q($params->toString('JSON')))\n\t\t\t->where($db->qn('extension_id') . ' = ' . $db->q($component->id));\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\n\t\t// If we're here, we have updates. Let's create an OTP.\n\t\t$uri = JURI::base();\n\t\t$uri = rtrim($uri,'/');\n\t\t$uri .= (substr($uri,-13) != 'administrator') ? '/administrator/' : '/';\n\t\t$link = 'index.php?option=com_cmsupdate';\n\n\t\t// Get the super users to send the email to\n\t\t$superAdmins = array();\n\t\t$superAdminEmail = $params->get('email', '');\n\n\t\tif (empty($superAdminEmail))\n\t\t{\n\t\t\t$superAdminEmail = null;\n\t\t}\n\n\t\t$superAdmins = $this->_getSuperAdministrators($superAdminEmail);\n\n\t\tif (empty($superAdmins))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Send the email\n\t\t$this->loadLanguage();\n\n\t\t$email_subject = JText::_('PLG_CMSUPDATEEMAIL_EMAIL_HEADER');\n\t\t$email_body = '<p>' . JText::_('PLG_CMSUPDATEEMAIL_EMAIL_BODY_TITLE') . '</p>' .\n\t\t\t'<p>' . JText::_('PLG_CMSUPDATEEMAIL_EMAIL_BODY_WHOSENTIT') . '</p>' .\n\t\t\t'<p>' . JText::_('PLG_CMSUPDATEEMAIL_EMAIL_BODY_VERSIONINFO') . '</p>' .\n\t\t\t'<p>' . JText::_('PLG_CMSUPDATEEMAIL_EMAIL_BODY_INSTRUCTIONS') . '</p>' .\n\t\t\t'<p>' . JText::_('PLG_CMSUPDATEEMAIL_EMAIL_BODY_WHATISTHISLINK') . '</p>';\n\n\t\t$newVersion = $update['version'];\n\n\t\t$jVersion = new JVersion;\n\t\t$currentVersion = $jVersion->getShortVersion();\n\n\t\t$jconfig = JFactory::getConfig();\n\t\t$sitename = $jconfig->get('sitename');\n\n\t\t$substitutions = array(\n\t\t\t'[NEWVERSION]'\t\t=> $newVersion,\n\t\t\t'[CURVERSION]'\t\t=> $currentVersion,\n\t\t\t'[SITENAME]'\t\t=> $sitename,\n\t\t\t'[PLUGINNAME]'\t\t=> JText::_('PLG_CMSUPDATEEMAIL'),\n\t\t);\n\n\t\t// If Admin Tools Professional is installed, fetch the administrator secret key as well\n\t\t$adminpw = '';\n\t\t$modelFile = JPATH_ROOT.'/administrator/components/com_admintools/models/storage.php';\n\n\t\tif (@file_exists($modelFile))\n\t\t{\n\t\t\tinclude_once $modelFile;\n\n\t\t\tif (class_exists('AdmintoolsModelStorage'))\n\t\t\t{\n\t\t\t\t$model = JModelLegacy::getInstance('Storage','AdmintoolsModel');\n\t\t\t\t$adminpw = $model->getValue('adminpw','');\n\t\t\t}\n\t\t}\n\n\t\tforeach($superAdmins as $sa)\n\t\t{\n\t\t\t$otp = plgSystemOneclickaction::addAction($sa->id, $link);\n\n\t\t\tif (is_null($otp))\n\t\t\t{\n\t\t\t\t// If the OTP is null, a database error occurred\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telseif (empty($otp))\n\t\t\t{\n\t\t\t\t// If the OTP is empty, an OTP for the same action was already\n\t\t\t\t// created and it hasn't expired.\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$emaillink = $uri . 'index.php?oneclickaction=' . $otp;\n\n\t\t\tif (!empty($adminpw))\n\t\t\t{\n\t\t\t\t$emaillink .= '&' . urlencode($adminpw);\n\t\t\t}\n\n\t\t\t$substitutions['[LINK]'] = $emaillink;\n\n\t\t\tforeach ($substitutions as $k => $v)\n\t\t\t{\n\t\t\t\t$email_subject = str_replace($k, $v, $email_subject);\n\t\t\t\t$email_body = str_replace($k, $v, $email_body);\n\t\t\t}\n\n\t\t\t$mailer = JFactory::getMailer();\n\t\t\t$mailfrom = $jconfig->get('mailfrom');\n\t\t\t$fromname = $jconfig->get('fromname');\n\t\t\t$mailer->isHtml(true);\n\t\t\t$mailer->setSender(array( $mailfrom, $fromname ));\n\t\t\t$mailer->addRecipient($sa->email);\n\t\t\t$mailer->setSubject($email_subject);\n\t\t\t$mailer->setBody($email_body);\n\t\t\t$mailer->Send();\n\t\t}\n\t}",
"function PLG_update($name)\n{\n\tinclude(\"/m23/inc/i18n/\".$GLOBALS[\"m23_language\"].\"/m23base.php\");\n\n\t//getting the file with update infomations\n\tPLG_getUpdateFile($name);\n\n\techo(\"<h2>$I18N_plugin_information</h2>\");\n\tPLG_listInfofile($name);\n}",
"function main()\t{\r\n\t\tglobal $BACK_PATH,$LANG;\r\n\t\t$LANG->includeLLFile(\"EXT:pmkglossary/locallang.xml\");\r\n\t\t$this->sys_page = t3lib_div::makeInstance(\"t3lib_pageSelect\");\r\n\t\tif (t3lib_extMgm::isLoaded('mr_glossary')) {\r\n\r\n\t\t\tif (t3lib_div::_GP('update')) {\r\n\t\t\t\t$this->convertData(intval(t3lib_div::_GP('options')));\r\n\t\t\t\t$content = sprintf($LANG->getLL('upd.result'),$this->totalCount,$this->convertCount);\r\n\t\t\t\tif ($this->dupeCount>0) {\r\n\t\t\t\t\t$content .= '<br />'.sprintf($LANG->getLL('upd.duperesult'),$this->dupeCount);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$content =$test.'<form action=\"'.htmlspecialchars(t3lib_div::linkThisScript()).'\" method=\"post\">\r\n\t\t\t\t\t<fieldset>\r\n\t\t\t\t\t\t<legend>'.$LANG->getLL('upd.legend').'</legend>\r\n \t\t\t\t\t\t<p> </p>\r\n\t\t\t\t\t\t<div>\r\n\t\t\t\t\t\t\t<label for=\"options\">'.$LANG->getLL('upd.option').'\r\n\t\t\t\t\t\t\t<select name=\"options\">\r\n\t\t\t\t\t\t\t\t<option value=\"1\">'.$LANG->getLL('upd.option.nothing').'</option>\r\n\t\t\t\t\t\t\t\t<option value=\"2\">'.$LANG->getLL('upd.option.hide').'</option>\r\n\t\t\t\t\t\t\t\t<option value=\"3\">'.$LANG->getLL('upd.option.delete').'</option>\r\n\t\t\t\t\t\t\t</select>\r\n\t\t\t\t\t\t\t</label>\r\n\t\t\t\t\t\t</div>\r\n \t\t\t\t\t\t<p> </p>\r\n\t\t\t\t\t\t<div>\r\n\t\t\t\t\t\t\t<input name=\"update\" value=\"'.$LANG->getLL('upd.convert').'\" type=\"submit\" />\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t</fieldset>\r\n\t\t\t\t</form>';\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$content = $LANG->getLL('upd.error');\r\n\t\t}\r\n\t\treturn $content;\r\n\t}",
"public function updateAdmin()\n {\n $template = 'updateAdminForm.html.twig';\n $argsArray = [\n 'pageTitle' => 'Update Admin Form',\n 'username' => $this->usernameFromSession()\n ];\n $html = $this->twig->render($template, $argsArray);\n print $html;\n }",
"static function update() {\n\t\t\tglobal $parts,$_POST;\n\t\t\t$g = $parts[\"calendar\"][\"settings\"];\n\t\t\t\n\t\t\tforeach ($_POST as $con=>$o) {\n\t\t\t\tif (isset($g[$con])) \n\t\t\t\t\t$g[$con] = $o;\n\t\t\t\tif ($con==\"dropable\")\n\t\t\t\t\t$g[$con] = (bool)$o;\n\t\t\t}\n\t\t\t\n\t\t\t$parts[\"calendar\"][\"settings\"] = $g;\n\t\t\t\n\t\t\t$output = \"<?php \\n\".\"$\".\"parts = \".var_export($parts,true).\";\\n\\n\";\n\t\t\t\n\t\t\tfile_put_contents(\"conf/parts.inc.php\", $output);\n\t\t\t\t\t\t\n\t\t\treturn \"<div class='alert alert-info'>Bilgiler Güncellendi</div>\";\n\t\t}",
"function main()\t{\n\n\t\t$content = '';\n\n\t\t$content.= '<br />Update the Static Info Tables with new language labels.';\n\t\t$content .= '<br />';\n\t\t$import = GeneralUtility::_GP('import');\n\n\t\tif ($import == 'Import') {\n\n\t\t\t$destEncoding = GeneralUtility::_GP('dest_encoding');\n\t\t\t$extPath = ExtensionManagementUtility::extPath('static_info_tables_pl');\n\t\t\t\n\t\t\t// Update polish labels\n\t\t\t$fileContent = explode(\"\\n\", GeneralUtility::getURL($extPath . 'ext_tables_static_update.sql'));\n\n\t\t\tforeach($fileContent as $line) {\n\t\t\t\t$line = trim($line);\n\t\t\t\tif ($line && preg_match('#^UPDATE#i', $line) ) {\n\t\t\t\t\t$query = $this->getUpdateEncoded($line, $destEncoding);\n\t\t\t\t\tif (TYPO3_DLOG)\n\t\t\t\t\t\tGeneralUtility::devLog('SQL Query', 'static_info_tables_pl', 0, array('query:' => $query));\n\t\t\t\t\t$res = $GLOBALS['TYPO3_DB']->admin_query($query);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$content .= '<br />';\n\t\t\t$content .= '<p>Encoding: ' . htmlspecialchars($destEncoding) . '</p>';\n\t\t\t$content .= '<p>Done.</p>';\n\t\t} elseif (ExtensionManagementUtility::isLoaded('static_info_tables')) {\n\n\t\t\t$content .= '</form>';\n\t\t\t$content .= '<form action=\"' . htmlspecialchars(GeneralUtility::linkThisScript()) . '\" method=\"post\">';\n\t\t\t$content .= '<br />Destination character encoding:';\n\t\t\t$content .= '<br />' . tx_staticinfotables_encoding::getEncodingSelect('dest_encoding', '', 'utf-8');\n\t\t\t$content .= '<br />(The character encoding must match the encoding of the existing tables data. By default this is UTF-8.)';\n\t\t\t$content .= '<br /><br />';\n\t\t\t$content .= '<input type=\"submit\" name=\"import\" value=\"Import\" />';\n\t\t\t$content .= '</form>';\n\t\t} else {\n\t\t\t$content .= '<br /><strong>The extension static_info_tables needs to be installed first!</strong>';\n\t\t}\n\n\t\treturn $content;\n\t}"
] | [
"0.685961",
"0.6828121",
"0.6539336",
"0.64060557",
"0.6363105",
"0.6277963",
"0.6253921",
"0.6253228",
"0.62027276",
"0.6199511",
"0.6175288",
"0.61247736",
"0.6110579",
"0.6075558",
"0.6066065",
"0.6040626",
"0.60273063",
"0.599717",
"0.5993819",
"0.5988358",
"0.5888793",
"0.58625436",
"0.58542526",
"0.5852427",
"0.5844889",
"0.5830951",
"0.5808087",
"0.57840943",
"0.57835674",
"0.5769576"
] | 0.81128716 | 0 |
Gets the value of phpCsFixer. | public function getPhpCsFixer()
{
if (null === $this->phpCsFixer) {
throw new \RuntimeException('Php CS fixer service is not injected');
}
return $this->phpCsFixer;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCodeFraisFixe() {\n return $this->codeFraisFixe;\n }",
"public function setPhpCsFixer($phpCsFixer)\n {\n $this->phpCsFixer = $phpCsFixer;\n\n return $this;\n }",
"public function withPhpcsConfiguration()\n {\n return $this->phpcsConfiguration;\n }",
"public function getCvc(): ?string\n {\n return $this->cvc;\n }",
"public function getCodeConvention(): ?string {\n return $this->codeConvention;\n }",
"protected function getConfiguredCountryCode () {\n\t\t$configurationManager = $this->objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\Configuration\\\\ConfigurationManager');\n\t\t$settings = $configurationManager->getConfiguration(\\TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);\n\t\treturn $settings['plugin.']['tx_staticinfotables_pi1.']['countryCode'];\n\t}",
"public function getCpf(): string\n {\n return $this->cpf;\n }",
"protected function codeFixer($file) {\n $succeed = TRUE;\n\n $processBuilder = new ProcessBuilder([\n $this->vendor_path . '/bin/phpcs',\n '--config-set',\n 'installed_paths',\n $this->vendor_path . '/drupal/coder/coder_sniffer',\n ]);\n $process = $processBuilder->getProcess();\n $process->run();\n\n $processBuilder = new ProcessBuilder([\n $this->vendor_path . '/bin/phpcbf',\n '--standard=' . $this->vendor_path . '/geo0000/drupal-code-check/DrupalCodeCheck',\n '-p',\n $file,\n ]);\n $process = $processBuilder->getProcess();\n $status = $process->run();\n\n echo $status;\n\n if ($status == self::PHPCBF_PASSED) {\n $this->output->writeln('No formatting errors to be automatically fixed.');\n }\n else {\n if ($status == self::PHPCBF_FAILED) {\n $this->output->writeln('PHP Code Sniffer Beautifier and Fixer automatically fixed some coding style issues. Please stage these changes and commit again.');\n }\n else {\n $this->output->writeln('Invalid operation.');\n }\n\n $succeed = FALSE;\n }\n\n if (!$process->isSuccessful()) {\n $this->output->writeln(sprintf('<error>%s</error>', trim($process->getOutput())));\n $succeed = FALSE;\n }\n\n return $succeed;\n }",
"public function code() : int {\n\t\treturn isset( $this->ruleset->code ) ? $this->ruleset->code : 301;\n\t}",
"public function getReturnCharset() {\n\t\t\treturn $this->returnCharset;\n\t\t}",
"public function getCra()\n {\n return $this->cra;\n }",
"public function getCharset() : ?string;",
"public function getCodeCga() {\n return $this->codeCga;\n }",
"public function getCpf()\n {\n return $this->cpf;\n }",
"public function getCpf()\n {\n return $this->cpf;\n }",
"public function getCpf()\n {\n return $this->cpf;\n }",
"public function getCharset()\n {\n // see if its in the config first\n $cfg = $this->di->get('Config', true)->get('view.charset');\n return ($cfg !== null) ? $cfg : $this->charset;\n }",
"public function getCpf()\n {\n return $this->_cpf;\n }",
"public function getCodeChantier(): ?string {\n return $this->codeChantier;\n }",
"public function getCodeChantier(): ?string {\n return $this->codeChantier;\n }",
"public function getCpf()\r\n {\r\n return $this->cpf;\r\n }",
"public function getCpf()\n\t{\n\t\treturn $this->cpf;\n\t}",
"public function getFixedError()\n {\n return $this->fixed_error;\n }",
"public function getCodeTva(): ?string {\n return $this->codeTva;\n }",
"public function getCodeTva(): ?string {\n return $this->codeTva;\n }",
"public function getCpf()\r\n\t{\r\n\t\treturn $this->cpf;\r\n\t}",
"public function getCollatedSpellcheck()\n {\n return $this->collatedSpellcheck;\n }",
"public function getLintang()\n {\n return $this->lintang;\n }",
"public function getLintang()\n {\n return $this->lintang;\n }",
"public function getCpVille(): ?string {\n return $this->cpVille;\n }"
] | [
"0.63213116",
"0.59405684",
"0.54010177",
"0.53148735",
"0.5164377",
"0.5148334",
"0.514077",
"0.51280534",
"0.5051394",
"0.5042275",
"0.50293815",
"0.5024972",
"0.50184196",
"0.50044435",
"0.50044435",
"0.50044435",
"0.49956223",
"0.4987688",
"0.49716803",
"0.49716803",
"0.49677122",
"0.49431655",
"0.4942324",
"0.49300227",
"0.49300227",
"0.4927976",
"0.49132434",
"0.49100876",
"0.49100876",
"0.49087182"
] | 0.7452386 | 0 |
Sets the value of phpCsFixer. | public function setPhpCsFixer($phpCsFixer)
{
$this->phpCsFixer = $phpCsFixer;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPhpCsFixer()\n {\n if (null === $this->phpCsFixer) {\n throw new \\RuntimeException('Php CS fixer service is not injected');\n }\n return $this->phpCsFixer;\n }",
"public function addCustomFixer(FixerInterface $fixer);",
"protected function codeFixer($file) {\n $succeed = TRUE;\n\n $processBuilder = new ProcessBuilder([\n $this->vendor_path . '/bin/phpcs',\n '--config-set',\n 'installed_paths',\n $this->vendor_path . '/drupal/coder/coder_sniffer',\n ]);\n $process = $processBuilder->getProcess();\n $process->run();\n\n $processBuilder = new ProcessBuilder([\n $this->vendor_path . '/bin/phpcbf',\n '--standard=' . $this->vendor_path . '/geo0000/drupal-code-check/DrupalCodeCheck',\n '-p',\n $file,\n ]);\n $process = $processBuilder->getProcess();\n $status = $process->run();\n\n echo $status;\n\n if ($status == self::PHPCBF_PASSED) {\n $this->output->writeln('No formatting errors to be automatically fixed.');\n }\n else {\n if ($status == self::PHPCBF_FAILED) {\n $this->output->writeln('PHP Code Sniffer Beautifier and Fixer automatically fixed some coding style issues. Please stage these changes and commit again.');\n }\n else {\n $this->output->writeln('Invalid operation.');\n }\n\n $succeed = FALSE;\n }\n\n if (!$process->isSuccessful()) {\n $this->output->writeln(sprintf('<error>%s</error>', trim($process->getOutput())));\n $succeed = FALSE;\n }\n\n return $succeed;\n }",
"public function setCharset($value)\n\t{\n\t\t$this->setViewState('Charset',$value,'');\n\t}",
"private function fixCs(array $files): void\n {\n $fileInfos = [];\n foreach ($files as $file) {\n $fileInfos[] = new \\SplFileInfo($file);\n }\n\n // to keep compatibility with both versions of php-cs-fixer: 2.x and 3.x\n // ruleset object must be created depending on which class is available\n $rulesetClass = class_exists(LegacyRuleSet::class) ? LegacyRuleSet::class : Ruleset::class;\n $fixers = (new FixerFactory())\n ->registerBuiltInFixers()\n ->useRuleSet(new $rulesetClass([ // @phpstan-ignore-line\n '@Symfony' => true,\n 'array_syntax' => ['syntax' => 'short'],\n 'phpdoc_order' => true,\n 'declare_strict_types' => true,\n ]))\n ->getFixers();\n\n $runner = new Runner(\n new \\ArrayIterator($fileInfos),\n $fixers,\n new NullDiffer(),\n null,\n new ErrorsManager(),\n new Linter(),\n false,\n new NullCacheManager()\n );\n $runner->fix();\n }",
"public function registerFixer(): void\n {\n $this->app->singleton(ModelNamespaceFixer::class, function ($app) {\n return new ModelNamespaceFixer(\n $app->getNamespace(),\n $app['config']->get('model-namespace.namespace')\n );\n });\n }",
"public function testSetCodeCotis() {\n\n $obj = new DeclarationCafat();\n\n $obj->setCodeCotis(\"codeCotis\");\n $this->assertEquals(\"codeCotis\", $obj->getCodeCotis());\n }",
"public function setValue($value)\n\t{\n\n\t}",
"public function setCpf(string $cpf) : void\n {\n $this->cpf = $cpf;\n }",
"public function set($value) \n {\n parent::set(strtoupper($value));\n }",
"function set_charset($cs)\n {\n $this->default_charset = $cs;\n }",
"public function setCountryCode(?string $value): void;",
"protected function _setValue($value)\n {\n $this->value = \\Core\\View::escape($value);\n }",
"public function testThatSetParserChangesTheParserUsedOnCompiler()\n {\n $parser = new FooParser;\n \n $parser->addFormatter(function () {\n return 'baz';\n }, 'bar');\n\n $this->compiler->setParser($parser);\n $expected = 'test/baz';\n $result = $this->compiler->compile('test/foo@bar');\n $this->assertEquals($expected, $result);\n }",
"function setValue($value) {\r\r\n\t\t$this->value = $value;\r\r\n\t}",
"public function setFixType($type);",
"function setValue($value) {\r\n $this->value = $value;\r\n }",
"function setValue( $value )\r\n {\r\n $this -> _value = $value;\r\n }",
"function setCode($value) {\n $this->_code = trim($value);\n }",
"function setValue($value)\n\t{\n\t\t$this->value=$value;\n\t}",
"function setValue( $value ) {\n\t\t$this->value = $value;\n\t}",
"protected function createFixerDriver()\n {\n return new FixerApi;\n }",
"private function setValue($value){\n\t\t$this->value = $value;\n\t}",
"function setValue($value)\n {\n $this->_value = $value;\n }",
"public function fix($content);",
"protected function setCode($value)\n\t{\n\t\t$this->code = $value;\n\t}",
"final public function setValue($value)\n {\n $this->value = $value;\n }",
"public function testCodingStandardOption()\n {\n $command = $this->getPhpCsExecutable() . ' --extensions=php,inc --standard=myStandard --report=checkstyle ' . getcwd();\n $this->assertEquals(\n $command,\n $this->taskPhpCs(null, 'myStandard')->getCommand()\n );\n }",
"public function set($value)// : void\n {\n $this->value = $value;\n }",
"public function getCodeFraisFixe() {\n return $this->codeFraisFixe;\n }"
] | [
"0.61846864",
"0.573778",
"0.52544034",
"0.5109601",
"0.50470954",
"0.49853817",
"0.48238215",
"0.47941017",
"0.4789985",
"0.47560328",
"0.47558987",
"0.4711174",
"0.4701338",
"0.46869183",
"0.4676469",
"0.4650996",
"0.46497154",
"0.46460974",
"0.46402735",
"0.4639246",
"0.46361127",
"0.46147868",
"0.46112603",
"0.46105087",
"0.46049127",
"0.45843467",
"0.45833132",
"0.4581144",
"0.45754623",
"0.4565363"
] | 0.7006068 | 0 |
La funzione salva un oggetto Associato nel database e restituisce il suo ID | public function saveAssociato(Associato $a){
try{
$this->wpdb->insert(
$this->table,
array(
'id_utente_wp' => $a->getIdUtenteWP(),
'nome' => $a->getNome(),
'cognome' => $a->getCognome(),
'sesso' => $a->getSesso(),
'luogo_nascita' => $a->getLuogoNascita(),
'data_nascita' => $a->getDataNascita(),
'telefono' => $a->getTelefono(),
'email' => $a->getEmail(),
'ibernato' => 0
),
array('%d', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%d')
);
return $this->wpdb->insert_id;
} catch (Exception $ex) {
_e($ex);
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function save() {\n $query = DB::connection()->prepare('INSERT INTO Holari (pelaajaid, rataid, vayla, pvm, kuvaus) VALUES (:golfer, :course, :hole, :date, :description) RETURNING id');\n\n $query->execute(array('golfer' => $this->golfer, 'course' => $this->course,\n 'hole' => $this->hole, 'date' => $this->date, 'description' => $this->description));\n\n $row = $query->fetch();\n\n $this->id = $row['id'];\n }",
"public function save() {\n parent::save();\n\n //RECALCULAR EL TRASPASO\n $this->getIDTraspaso()->save();\n }",
"function savePersonnage($perso, $idUser) {\r\n\r\n\t$idPerso = null;\r\n\tif(isset($perso->id) ){\r\n\t\t$idPerso = $perso->id;\r\n\t}\r\n\r\n\t$levelPerso = null;\r\n\tif(isset($perso->level) && $perso->level != '') {\r\n\t\t$levelPerso = $perso->level;\r\n\t}\r\n\t\r\n\t$genrePerso = null;\r\n\tif(isset($perso->genre)) {\r\n\t\t$genrePerso = $perso->genre;\r\n\t}\r\n\t\r\n\t$idRacePerso = null;\r\n\tif(isset($perso->race) && isset($perso->race->id)) {\r\n\t\t$idRacePerso = $perso->race->id;\r\n\t}\r\n\t\r\n\t$idClassePerso = null;\r\n\tif(isset($perso->classe) && isset($perso->classe->id)) {\r\n\t\t$idClassePerso = $perso->classe->id;\r\n\t}\r\n\t\r\n\t// on créé la requête SQL\r\n\t$connexionBDD = getConnexionBDD();\r\n\t$sqlQuery = $connexionBDD->prepare(\"INSERT INTO er_personnage (id, nom,\r\n\tlevel,\t\r\n\tgenre,\r\n\tidRace,\r\n\tidClasse,\r\n\tidJeu,\r\n\tidUser)\r\n\tvalues (:idPerso, \r\n\t:nomPerso,\r\n\t:levelPerso, \r\n\t:genrePerso, \r\n\t:idRacePerso, \r\n\t:idClassePerso,\r\n\t:jeuId, \r\n\t:idUser) ON DUPLICATE KEY UPDATE \r\n\tnom = :nomPerso,\r\n\tlevel = :levelPerso,\r\n\tgenre = :genrePerso,\r\n\tidRace = :idRacePerso,\r\n\tidClasse = :idClassePerso,\r\n\tidJeu = :jeuId\");\r\n\t\r\n\t$resultat = $sqlQuery->execute(array(\r\n\t\t'idPerso' => $idPerso,\r\n\t\t'nomPerso' => $perso->nom,\r\n\t\t'levelPerso' => $levelPerso,\r\n\t\t'genrePerso' => $genrePerso,\r\n\t\t'idRacePerso' => $idRacePerso,\r\n\t\t'idClassePerso' => $idClassePerso,\r\n\t\t'jeuId' => $perso->jeu->id,\r\n\t\t'idUser' => $idUser\r\n\t));\r\n\t\r\n\treturn $resultat;\r\n}",
"public function saveAssociato(Associato $a){\n //salvo l'associato e ottengo l'id\n $idAssociato = $this->aDAO->saveAssociato($a); \n if($idAssociato != false){\n \n //salvo indirizzo\n $i = new Indirizzo();\n $i = $a->getIndirizzo();\n $i->setIdAssociato($idAssociato);\n \n if($this->iDAO->saveIndirizzo($i) == false){\n //se sopraggiunge errore, elimino l'associato\n $this->aDAO->deleteAssociato($idAssociato);\n return false;\n }\n \n //salvo iscrizioneRinnovo\n $ir = new IscrizioneRinnovo();\n $ir = $a->getIscrizioneRinnovo();\n $ir->setIdAssociato($idAssociato);\n if($this->irDAO->saveIscrizione($ir) == false){\n //se sopraggiunge errore, elimino l'indirizzo\n $this->iDAO->deleteIndirizzo($idAssociato);\n //ed elimino l'associato\n $this->aDAO->deleteAssociato($idAssociato);\n return false;\n }\n \n return true; \n }\n }",
"public function Save()\r\n\t\t{\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\t$this->validarGeneral();\r\n\t\t\t\tif ($this->datosEntidad->getEstado() == Estado::NUEVA)\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->validarNuevo();\r\n\t\t\t\t}\r\n\t\t\t\t$this->actualizar();\r\n\t\t\t\t$this->datosEntidad->save();\r\n\t\t\t\t//actualizo el ID desde capa datos\r\n\t\t\t\t$this->ID = $this->datosEntidad->getID();\r\n\t\t\t} catch (\\Exception $e) {\r\n\t\t\t\tthrow $e;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}",
"function Save(){\n $rowsAffected = 0;\n if(isset($this->id)){\n $rowsAffected = $this->UpdateSQL([\"id = \".$this->id]);\n }else{\n $rowsAffected = $this->InsertSQL();\n if($rowsAffected > 0){\n $this->id = $this->Max(\"id\");\n }\n }\n if($rowsAffected == 0){\n throw new \\Exception(\"Error al guardar Materia\");\n }else{\n $this->Refresh();\n }\n }",
"function save(){\n $statement = $GLOBALS['DB']->query(\"INSERT INTO students (first, last) VALUES ('{$this->getFirst()}', '{$this->getLast()}') RETURNING id;\");\n $result = $statement->fetch(PDO::FETCH_ASSOC);\n $this->setId($result['id']);\n }",
"public function save()\r\n {\r\n \r\n $id_usuario = ($this->usuario_id_atribuido \r\n instanceof \\OS\\Tabelas\\Usuarios)? \r\n $this->usuario_id_atribuido->getId():\r\n null;\r\n \r\n $valores = array(\r\n //$this->usuario_id_criado->getId(),\r\n 1,\r\n $id_usuario,\r\n $this->area_id,\r\n $this->datacriacao,\r\n $this->descricao,\r\n $this->observacao,\r\n $this->status,\r\n $this->prioridade,\r\n $this->prazo,\r\n $this->titulo\r\n );\r\n \r\n if($this->id == '')\r\n {\r\n \r\n $sql = \"INSERT INTO tarefas \r\n (usuario_id_criado, usuario_id_atribuido, \r\n area_id, datacriacao, descricao, observacao, \r\n status, prioridade, prazo, titulo)\r\n VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\";\r\n \r\n } else\r\n {\r\n $sql = \"UPDATE tarefas SET \"\r\n . \"usuario_id_criado = ?, \"\r\n . \"usuario_id_atribuido = ?, \"\r\n . \"area_id = ?, \"\r\n . \"datacriacao = ?, \"\r\n . \"descricao = ?, \"\r\n . \"observacao = ?, \"\r\n . \"status = ?, \"\r\n . \"prioridade = ?, \"\r\n . \"prazo = ?, \"\r\n . \"titulo = ? \"\r\n . \"WHERE id = ?\";\r\n\r\n $valores[] = $this->id;\r\n \r\n }\r\n try{\r\n $prep = $this->pdo->prepare($sql);\r\n if($prep->execute($valores) == FALSE)\r\n {\r\n throw new \\Exception('Não executou um sql direito');\r\n }\r\n } catch (\\PDOException $e)\r\n {\r\n echo $e->getMessage();\r\n }\r\n \r\n }",
"protected function kreiraj()\n {\n $keysStr = $valuesStr = '';\n $values = [];\n foreach ($this->atributi as $key => $value) {\n $keysStr .= $key . ', ';\n $valuesStr .= '?, ';\n $values[] = $value;\n }\n\n $queryStr = 'INSERT INTO ' . static::$tabela . ' (' . substr($keysStr, 0, -2) . ') VALUES (' . substr($valuesStr, 0, -2) . ')';\n\n $veza = Connection::veza();\n\n $veza->prepare($queryStr)->execute($values);\n\n $this->id = $veza->lastInsertId();\n }",
"abstract public function saveToDb($new_if_no_id=true);",
"public function save()\n {\n\n $fields = $this->fields;\n\n\n unset($fields[$this->getPk()]);\n foreach ($fields as $key => $fieldOptions) {\n if (isset($this->$key)) {\n $values[$key] = $this->$key;\n }\n }\n\n $adapter = Flame::getAdapter();\n\n $adapter->beginTransaction();\n\n try {\n $query = new Query($adapter);\n\n if (! is_null($this->getPkValue())) {\n\n $query->update($this->table)\n ->set($values)\n ->where(\"{$this->getPk()} = :pk\")\n ->setParam('pk', $this->getPkValue())\n ->execute();\n\n } else {\n\n $values[$this->getPk()] = null;\n $query->insert($this->table)\n ->values($values)\n ->execute();\n\n $insertId = Flame::getAdapter()->getLastInsertId();\n $this->{$this->getPk()} = $insertId;\n }\n foreach ($this->relations['hasOne'] as $relation) {\n $relation->processChanges();\n }\n foreach ($this->relations['hasMany'] as $relation) {\n $relation->processChanges();\n }\n $adapter->commit();\n } catch (\\Exception $ex) {\n $adapter->rollBack($ex);\n throw $ex;\n }\n }",
"public function commit() {\r\n $arr= array();\r\n foreach ($this->oIdToPHPId as $key => $pObject) { \r\n $arr[$pObject->getClass()->getName()][] = $pObject;\r\n unset($this->oIdToPHPId[$key]);\r\n unset($this->phpIdToOId[$pObject->getObjectId()->getId()]);\r\n }\r\n \r\n $this->session->getDatabase()->insertArray($arr);\r\n }",
"public function save()\n {\n $db = new BaseDeDatos();\n\n if (is_null($this->IdIngrediente)) :\n\n $sql = \"INSERT INTO ingrediente (IngredientePrincipal) \n VALUES ('{$this->IngredientePrincipal}') ;\";\n\n\n $db->query($sql);\n\n $this->IdIngrediente = $db->lastId();\n\n endif;\n\n return $this;\n }",
"public function save(){\n\t\t$sql = new Sql();\n\n\t\tif ($this->id == 0){\n\t\t\t$sql->query(\"INSERT INTO marca (nome) values (:NOME)\", array(\n\t\t\t\t':NOME' => $this->nome\n\t\t\t));\n\t\t} else {\n\t\t\t$sql->query(\"UPDATE marca SET nome=:NOME WHERE marca_id = :ID\", array(\n\t\t\t\t':ID' => $this->id,\n\t\t\t\t':NOME' => $this->nome\n\t\t\t));\n\t\t}\t\t\n\t}",
"public function save() {\n $primaryAll = [];\n $allAttr = [];\n\n //Costruisco gli array $primaryAll e $allAttr\n foreach($this as $key => $value) {\n $allAttr[$key] = $value;\n\n if(in_array($key, static::getPrimaryKey())) {\n $primaryAll[$key] = $value;\n }\n }\n\n //Prova a fare una select sui campi che costituiscono la chiave primaria\n $selected = self::find($primaryAll);\n\n //Se la riga esiste, faccio un update\n if(is_object($selected) || (is_array($selected) && count($selected) > 0)) {\n self::getConnectionManager()->update(self::getClassName(), $allAttr, $primaryAll);\n }\n //Se la riga non esiste, faccio insert \n else {\n self::getConnectionManager()->insert(self::getClassName(), $allAttr);\n }\n\n //Ritorno l'oggetto aggiornato\n return self::find($primaryAll);\n }",
"public function save() \r\n\t{\r\n\t\t$_SESSION[$this->key] = $this->id();\r\n\t}",
"function save()\n\t\t{\n\t\t\t$GLOBALS['DB']->exec(\"INSERT INTO leagues (league_name, sport_id, price, skill_level, description, location, website, email, org_id) VALUES ('{$this->getLeagueName()}', {$this->getSportId()}, {$this->getPrice()}, '{$this->getSkillLevel()}', '{$this->getDescription()}', '{$this->getLocation()}', '{$this->getWebsite()}', '{$this->getEmail()}', {$this->getOrgId()});\");\n\t\t\t$this->id = $GLOBALS['DB']->lastInsertId();\n\t\t}",
"public function save()\n {\n $this->_data = $this->beforeSave();\n $insert = $this->insertTable($this->_main_table,$this->_data);\n if($insert['result'] != 'success'){\n $this->throwException($insert['msg']);\n }\n $id = $insert['data'];\n $this->addData('id',$id);\n return $id;\n }",
"public function save()\n {\n $id = $this->get_id();\n\n if (!$id) :\n $this->create();\n else :\n $this->update();\n endif;\n }",
"public function save()\n { \n if ( is_null( $this->id )) \n $this->create();\n else \n $this->update(); \n }",
"public function save()\n {\n $this->personID = parent::save();\n //Save user information\n if (isset($this->id)) {\n $updateQuery = \"UPDATE usersTable SET personID=?, userEmail=?, userPass=?, lastLogin=?, registrationDate=?, isAdmin=? WHERE userId=?\";\n $stmnt = self::db()->prepare($updateQuery);\n $stmnt->bind_param('issssii',\n $this->personID,\n $this->email,\n $this->password,\n $this->lastLogin,\n $this->registrationDate,\n $this->isAdmin,\n $this->id\n );\n } else {\n $insertQuery = \"INSERT INTO usersTable (personID,userEmail,userPass,lastLogin,registrationDate,isAdmin) VALUES (?,?,?,?,?,?)\";\n $stmnt = self::db()->prepare($insertQuery);\n $stmnt->bind_param('issssi',\n $this->personID,\n $this->email,\n $this->password,\n $this->lastLogin,\n $this->registrationDate,\n $this->isAdmin\n );\n if ($stmnt->execute()) {\n $this->id = self::db()->insert_id;\n }\n }\n }",
"function save() {\n\t\tglobal $res,$prefix;\n\n\t\t/* Normalizamos datos */\n\t\t\n\t\t$this->data_normalize();\n\t\t$res=\"\";\n\t\tif (($this->ID>1)&&!empty($this->ID)) {\n\t\t\tdebug(\"Llamada \".$this->name.\"->save redirigida a update con \".$this->ID,\"yellow\");\n\t\t\treturn $this->update();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (!function_exists(\"fsadd\")) {\n\t\t\t\tfunction fsadd(&$str) {\n\t\t\t\t\tglobal $res;\n\t\t\t\t\tif ($str!=\"ID\")\n\t\t\t\t\t\t$res.=\",`$str`\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!function_exists(\"dsadd\")) {\n\t\t\t\t/* Funcion dinamica */\n\t\t\t\tfunction dsadd(&$str,$key) {\n\t\t\t\t\tglobal $res;\n\t\t\t\t\tif ($key!=\"ID\") {\n\t\t\t\t\t\t$res.=\",'$str'\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->S_UserID_CB=$_SESSION[\"__auth\"][\"uid\"];\n\t\t\t$this->S_Date_C=time();\n \t\t\t\n\t\t\t$this->_flat();\n\t\t\tarray_walk(array_keys($this->properties),\"fsadd\");\n\t\t\t$q=\"INSERT INTO `{$prefix}_\".$this->name.\"`( `ID` \".$res.\")\";\n\t\t\t$res=\"\";\n\t\t\treset($this->properties);\n\t\t\tarray_walk($this->properties,\"dsadd\");\n\t\t\t$q.=\" VALUES (''$res)\";\n\t\t\t\n\t\t\t$bdres=_query($q);\n\t\t\t$this->ID=_last_id();\n\t\t\t//----------------------------------------------------------------------------------\n\n\t\t\t$xref=array();\n\t\t\tforeach ($this->properties as $pk=>$pv) {\n\t\t\t\tif (strpos($this->properties_type[$pk],\"xref\")!==False) {\n\t\t\t\t\t$xref=explode(\":\",$this->properties_type[$pk]);\n\t\t\t\t\t$table_name=$this->name.\"_\".$xref[1];\n\n\t\t\t\t\t$field2=$this->name.\"_id\";\n\t\t\t\t\t$field3=$xref[1].\"_id\";\n\t\t\t\t\t\n\t\t\t\t\t$xref_2_array=array();\n\t\t\t\t\t\n\t\t\t\t\tif(!empty($this->$pk)) {\n\t\t\t\t\t\t// Rellenamos la tabla de referencias externas\n\t\t\t\t\t\tforeach ($this->$pk as $k=>$v) {\n\t\t\t\t\t\t\t$q=\"INSERT INTO `{$prefix}_\".$table_name.\"`( `ID` \".\",`$field2`\".\",`$field3`\".\")\";\n\t\t\t\t\t\t\t$q.=\" VALUES (''\".\",'$this->ID'\".\",'$v'\".\")\";\n\t\t\t\t\t\t\t$bdres=_query($q);\n\n\t\t\t\t\t\t\t$q2=\"SELECT `$xref[2]` FROM `{$prefix}_\".$xref[1].\"` WHERE `ID`=$v\";\n\t\t\t\t\t\t\t$bdres=_query($q2);\n\t\t\t\t\t\t\t$rawres=_fetch_array($bdres);\n\t\t\t\t\t\t\t$xref_2_array[$v]=$rawres[\"nombre_cat\"];\n\t\t\t\t\t\t}\t\t\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$this->$pk=$xref_2_array;\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t\t\n\t\t\t//----------------------------------------------------------------------------------\n\t\t\t$this->nRes=_affected_rows();\n\t\t\tif ($this->nRes>0)\n\t\t\t\treturn $this->ID;\n\t\t\telse\n\t\t\t\treturn False;\n\t\t}\n\n\t}",
"public function save(){\r\n\t\tif(!$this->get('id')){\r\n\t\t\t// insert new \r\n\t\t} else {\r\n\t\t\t// update\r\n\t\t}\r\n\t}",
"function registrarAfiliado($idinversionista,$nombres,$apellidos,$dni,$celular,$email,$imagen,$contrasenia){\n $db=new baseDatos();\n try {\n $conexion=$db->conectar();\n $sql='INSERT INTO tb_inversionista( nombres , apellidos , dni , celular ,email, imagen , contrasenia)'.\n ' VALUES( :nombres , :apellidos , :dni , :celular , :email , :imagen , :contrasenia)';\n $sentencia=$conexion->prepare($sql);\n $sentencia->bindParam(':nombres',$nombres);\n $sentencia->bindParam(':apellidos',$apellidos);\n $sentencia->bindParam(':dni',$dni);\n $sentencia->bindParam(':celular',$celular);\n $sentencia->bindParam(':email',$email);\n $sentencia->bindParam(':imagen',$imagen);\n $sentencia->bindParam(':contrasenia',$contrasenia);\n $sentencia->execute();\n $id=$conexion->lastInsertId();\n //insertar inversion inicial sin datos\n $sinversion=new sinversion();\n $sinversion->insertarInversion($id);\n $safiliado=new safiliado();\n $safiliado->registrarAfiliacion($idinversionista,$id,1);\n return $id;\n } catch (PDOException $e) {\n throw $e;\n }\n }",
"function save() {\n\n\t\t$conn = new Conexion();\n//\t\tdate_default_timezone_set('America/Argentina/Buenos_Aires');\n\n\n\t\tif ($this->id<>0) {\n\t\t\t$sql = $conn->prepare(\"update publications set description = '$this->description', image_url = '$this->image_url', active = '$this->active', date = '$this->date', userId = '$this->userId' where id='$this->id'\");\n \t\t\t$sql->execute();\n\t\t\t$lastId = \"\";\n\t\t} else { \n\t\t\t$sql = $conn->prepare( \"insert into publications values (null, '$this->description', '$this->image_url', '$this->active', '$this->date', '$this->userId')\"); \n \t\t\t$sql->execute();\n\t\t\t$lastId = $conn->lastInsertId();\n\n\t\t} \n\t\t$conn = null;\n\t\t$sql = null;\n\t\treturn $lastId;\t\t\n\t}",
"protected function save()\n {\n self::$id_map[$this->id] = $this;\n }",
"private function save() {\r\n $k = new dbKontakte();\r\n $k->insertKontakt(new kontaktData(0,\r\n $this->params['name'],\r\n $this->params['vorname'],\r\n $this->params['strasse'],\r\n $this->params['plz'],\r\n $this->params['ort'],\r\n $this->params['email'],\r\n $this->params['tpriv'],\r\n $this->params['tgesch']) );\r\n\t}",
"function setInstancia(){\n $objDBO=$this->Factory($this->__tempName);\n $campos = $objDBO->table();\n unset($campos[\"id\"]);\n unset($campos[\"fecha\"]);\n //Asigna los valores\n foreach($campos as $key => $value){\n $objDBO->$key = utf8_decode($this->$key);\n }\n $objDBO->fecha = date(\"Y-m-d H:i:s\");\n $objDBO->find();\n if($objDBO->fetch()){\n $ret = $objDBO->id;\n }else{\n $ret = $objDBO->insert();\n }\n //Libera el objeto DBO\n $objDBO->free();\n return $ret;\n }",
"public function save() {\n\n\t\tif (!isset($this->id)) {\n\t\t\t$id = $this->add();\n\t\t} else {\n\t\t\t$id = $this->update();\n\t\t}\n\t\treturn $id;\n\t}",
"public function store(Request $request)\n {\t\n\n\n $mensagens = ['matricula.required' => 'O campo :attribute é obrigatório',\n 'nome.required' => 'O campo :attribute é obrigatório',\n 'email.required' => 'O campo :attribute é obrigatório',\n 'curso.required' => 'O campo :attribute é obrigatório',\n 'email.unique' => 'Esse :attribute já foi cadastrado',\n ];\n\n\n\n\n $pessoa = DB::table('pessoas')\n ->where('matricula', $request->matricula)\n ->get(); \n if($pessoa->count() == 0)\n { \n //Adiciona pessoa\n\n $request->validate([\n 'matricula'=>'required',\n 'nome'=>'required',\n 'email'=>'required|email',\n 'curso'=>'required',\n ], $mensagens);\n\n $pessoa = new Pessoa();\n $pessoa->matricula = $request->matricula;\n $pessoa->nome = $request->nome;\n $pessoa->email = $request->email;\n $pessoa->curso_id = $request->curso;\n $pessoa->telefone = $request->telefone;\n\n $pessoa->save();\n\n /*DB::table('pessoas')->insert(\n ['matricula' => $request->matricula,'curso_id' => $request->curso, 'nome' => $request->nome , 'email' => $request->email, 'telefone' => $request->telefone]);*/\n //Adiciona o Associado\n\n $pessoa = DB::table('pessoas')->where('matricula', $request->matricula)->first();//\n\n $associado = new Associado();\n $associado->pessoa_id = $pessoa->id;\n $associado->data_termino= $request->data_termino;\n $associado->data_inicio= $request->data_inicio;\n\n $associado->save();\n\n //DB::table('associados')->insert(['pessoa_id' => $pessoa->id]);\n \n $request->session()->flash('success', 'Associado Inserido com Sucesso!');\n return redirect()->route('associado.index');\n\n }else\n {\n\n $pessoa = DB::table('pessoas')\n ->where('matricula', $request->matricula)\n ->first();\n $associado = DB::table('associados')\n ->where('pessoa_id', $pessoa->id)\n ->first();\n\n // Se já existir o registro de um atleta mas o mesmo não é associado, apenas cadastrá-lo como associado.\n if(!isset($associado))\n {\n $request->validate([\n 'matricula'=>'required',\n 'nome'=>'required',\n 'email'=>'required|email',\n 'curso'=>'required',\n ], $mensagens);\n\n // DB::table('associados')->insert(['pessoa_id' => $pessoa->id] );\n\n $associado = new Associado();\n $associado->pessoa_id = $pessoa->id;\n $associado->data_termino= $request->data_termino;\n $associado->data_inicio= $request->data_inicio;\n $associado->save();\n\n $request->session()->flash('success', 'Registro encontrado em nossa base de dados. Associado Inserido!');\n\n return redirect()->route('associado.index');\n\n }else\n {\n\n $request->session()->flash('error', 'A matricula informada já consta em nossa base de dados! ');\n\n return redirect()->route('associado.index');\n }\n\n }\n }"
] | [
"0.6487615",
"0.63546103",
"0.6230865",
"0.6230157",
"0.62244695",
"0.6216302",
"0.61720955",
"0.60922563",
"0.606164",
"0.60038155",
"0.6003099",
"0.5981277",
"0.5955393",
"0.5942797",
"0.59095836",
"0.5908003",
"0.58861685",
"0.58722734",
"0.58450705",
"0.58372635",
"0.58245575",
"0.580584",
"0.58038414",
"0.58026636",
"0.57896346",
"0.5788269",
"0.5768761",
"0.57667905",
"0.57594067",
"0.5753771"
] | 0.6537384 | 0 |
La funzione restituisce un array di id_utente_wp | public function getUtentiWpAssegnati(){
try{
$query = "SELECT id_utente_wp FROM ".$this->table;
return $this->wpdb->get_col($query);
} catch (Exception $ex) {
_e($ex);
return null;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getUtentiWpNonAssegnati(){\n //ottengo l'array degli utenti già assegnati\n $wpAssegnati = $this->aDAO->getUtentiWpAssegnati();\n //ottengo tutti gli utenti\n $args = array('fields' => 'all', 'orderby' => 'display_name', 'order' => 'ASC'); \n $usersWp = get_users($args);\n \n $results = array(); \n \n for($i=0; $i < count($usersWp); $i++){ \n for($j=0; $j < count($wpAssegnati); $j++){\n if($usersWp[$i]->ID == $wpAssegnati[$j]){\n $usersWp[$i]->ID = false; \n }\n }\n }\n \n for($i=0; $i < count($usersWp); $i++){\n $temp = array();\n if($usersWp[$i]->ID != false){\n $results[$usersWp[$i]->ID] = $usersWp[$i]->user_firstname.' '.$usersWp[$i]->user_lastname; \n }\n }\n \n return $results;\n \n }",
"function ss_turma_professor(){\n global $DBH;\n $ss_turma = $DBH->query(\"SELECT SS_USUARIO_TURMA_AULA.idTurma, SS_USUARIO.nome, SS_USUARIO.idUsuario FROM `SS_USUARIO` INNER join `SS_USUARIO_TURMA_AULA` ON SS_USUARIO.idUsuario LIKE SS_USUARIO_TURMA_AULA.idUsuario WHERE SS_USUARIO_TURMA_AULA.idTurma = 1 AND SS_USUARIO.IdUsuarioTipo = 2\") or die (\"Error: \".$ss_turma->errorInfo());\n\n //$ss_turma = mysql_query($sql_turma) or die (\"Erro turma: \" . mysql_error());\n\n $aluno = array(array());\n $i = 0;\n while ($linha = $ss_turma->fetch(PDO::FETCH_OBJ)){\n $aluno[$i][0] = $linha-> idUsuario;\n $aluno[$i][1] = $linha-> nome;\n $i++;\n }\n return $aluno;\n }",
"function get_ids(){\n\t\t$old_db = new wpdb($this->db_username ,$this->db_password ,$this->db_database,$this->db_host );\n\t\t\n\t\t $query = \"SELECT * FROM \".$this->db_prefix.\"posts where post_type = 'shop_order' and post_status = 'wc-completed' \";\n\t\t\t\n\t\t\t $r = $old_db->get_results($query, ARRAY_A);\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t for ($i = 0; $i < count($r); $i++) {\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$id[]= $r[$i]['ID'];\n\t\t\t\t\t\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t echo json_encode($id);\n\t\t\t\t exit;\n\t\t\t\t\t\n\t\t\t\t\t\n\t}",
"public function getIdAssociato($idUtenteWp){\n try{\n $query = \"SELECT ID FROM \".$this->table.\" WHERE id_utente_wp = \".$idUtenteWp;\n return $this->wpdb->get_var($query);\n } catch (Exception $ex) {\n _e($ex);\n return false;\n }\n \n }",
"function luoPuuhaTaidot($uusiPuuha) {\n\n $taitojenIdt = $uusiPuuha->getTaidot();\n foreach ($taitojenIdt as $taidonid):\n $puuhataidot = new PuuhaTaidot();\n $puuhataidot->setPuuhanId($uusiPuuha->getId());\n $puuhataidot->setTaitoId($taidonid);\n $puuhataidot->LisaaKantaan();\n endforeach;\n}",
"function get_ids_fila(&$productos_presup,$filasDB)\r\n{\r\n\t$i=0;\r\n\t$cant_filas=count($filasDB);\r\n\tfor ( ; $i < $cant_filas; $i++)\r\n\t\t$productos_presup[$i]['id_fila']=$filasDB[$productos_presup[$i]['pos_fila']]['id_fila'];\r\n}",
"private function get_array_huis_id()\r\n {\r\n $sql = \"SELECT hz.huis_id FROM tblHuizen_dev hz \";\r\n \r\n /** faciliteiten */\r\n if ($this->count_checkbox != 0)\r\n {\r\n $sql .= \" INNER JOIN sidebar_huis sb ON hz.huis_id = sb.huis_id \";\r\n } \r\n \r\n /** selectboxen */ \r\n if ($this->sql_select_box != '')\r\n {\r\n $sql .= $this->sql_select_box. ' ';\r\n }\r\n \r\n /** checkboxen sidebar */\r\n if ($this->count_checkbox != 0)\r\n {\r\n for ($x = 0; $x < $this->count_checkbox; $x++)\r\n {\r\n $fieldname = $this->arrcheckbox[$x];\r\n $sql .= \" AND sb.$fieldname = '1'\";\r\n }\r\n }\r\n \r\n /** zichtbaar en niet in archief */\r\n $sql .= \" AND hz.archief = 0 AND hz.zichtbaar = 0\";\r\n \r\n /** eerste AND in sql vervangen door WHERE */\r\n $pos = strpos($sql, 'AND');\r\n if ($pos !== FALSE) \r\n {\r\n $sql = substr_replace($sql, 'WHERE', $pos, 3);\r\n }\r\n \r\n $stmt = $this->db->query($sql);\r\n $size = $stmt->rowCount();\r\n \r\n if ($size != 0)\r\n { \r\n while ($row = $stmt->fetch(PDO::FETCH_ASSOC))\r\n {\r\n extract($row);\t\t\r\n array_push($this->huisID, $huis_id);\r\n }\r\n $stmt->closeCursor();\r\n }\r\n }",
"public function arrUppd()\n\t{\n\t\t$cmd = \"SELECT\n\t\t\tid_lokasi, lokasi\n\t\t\tFROM\n\t\t\tlokasi\n\t\t\tWHERE\n\t\t\tid_lokasi=id_induk AND id_lokasi!='05'\";\n\t\treturn $this->db->query($cmd);\n\t}",
"function listino_proprietario($idu){\r\n $sql = \"SELECT retegas_listini.id_utenti\r\n FROM retegas_listini\r\n\tWHERE (((retegas_listini.id_listini)='$idu'));\";\r\n $ret = mysql_query($sql);\r\n $row = mysql_fetch_row($ret);\r\n return $row[0];\r\n}",
"private function buscar_instituciones() {\n $hunter = new \\Ivansabik\\DomHunter\\DomHunter(URL_INSTITUCIONES);\n $presas = array();\n $presas[] = array('instituciones', new \\Ivansabik\\DomHunter\\SelectOptions(array('id_nodo' => 'comboDependencia'), 'clave_institucion', 'nombre_institucion', 1));\n $hunter->arrPresas = $presas;\n $hunted = $hunter->hunt();\n return $hunted['instituciones'];\n }",
"private function return_user_tribes($id){\n\t\t\t$query = \"SELECT tribe.title,tribe.description FROM tribe_user INNER JOIN tribe ON tribe_user.tid=tribe.tid WHERE tribe_user.uid=\".$id.\"\";\n\t\t\t$result = mysqli_query($this->db->connection,$query);\n\t\t\t$tribes = array();\n\n\t\t\tif($result->num_rows > 0){\n\t\t\t\twhile($row = $result->fetch_assoc()){\n\t\t\t\t\tarray_push($tribes,$row);\n\t\t\t\t}\n\n\t\t\t\techo json_encode($tribes);\n\t\t\t}else{\n\n\t\t\t}\n\t\t}",
"function get_feature_post_ids()\n{\n global $wpdb;\n $prefix = $wpdb->prefix;\n $sql = \"SELECT * FROM {$prefix}users WHERE user_login = 'admin'\";\n $user = $wpdb->get_results($sql);\n if ($user) {\n $sql = \"SELECT post_id FROM {$prefix}postmeta WHERE meta_key = 'feature_key' AND meta_value = 1\";\n $result = $wpdb->get_results($sql);\n /** getting only values */\n foreach ($result as $key => $item) {\n $arr[] = $item->post_id;\n }\n $output = ['feature' => $arr];\n return $output;\n }\n}",
"function generaArrayInt($tamaño){\n\t\t$vectorAleatorio=[];\n\t\tfor($i=0;$i<$tamaño;$i++){\n\t\t\t$vectorAleatorio[$i]=rand(0,100);\n\t\t}\n\t\treturn $vectorAleatorio;\n\t}",
"function rgw_utenti_online($site,$gas){\n//array_push($site->css,\"widgets_ui\");\n\n// Nome id del widget\n$w_name = \"rgw_6\";\n\n//SEZIONE CONTEGGIO UTENTI ATTIVI\n$h3 .= '<div class=\"\" style=\"margin-top:10px; padding:2px;font-size:.9em\">\n <b>Presenze GAS :<br></b>\n '.crea_lista_gas_attivi(2).'\n </div>';\n\n//SEZIONE CONTEGGIO UTENTI ATTIVI\n\n//se amministro\nif(_USER_PERMISSIONS & perm::puo_gestire_retegas){\n$h3 .= '<div class=\"\" style=\"margin-top:10px; padding:2px;font-size:.9em\">\n <b>User OnLine (Tutta '._SITE_NAME.'):<br></b>\n '.crea_lista_user_attivi_pubblica(2).'\n </div>';\n}\n\n//SEZIONE VISUALIZZAZIONE USER ONLINE\n\n//SEZIONE CONTEGGIO UTENTI ATTIVI PROPRIO GAS\n$h3 .= '<div class=\"\" style=\"margin-top:10px; padding:2px;font-size:.9em\">\n <b>'.gas_nome($gas).'<br></b>\n '.crea_lista_user_attivi_pubblica_gas(2,$gas).'\n </div>';\n\n\n// Negli array dei comandi java a fondo pagina inserisco le cose necessarie al widget\n//$site->java_scripts_bottom_body[]='<script type=\"text/javascript\">$(\"#'.$w_name.'\").draggable({});</script>';\n\n// istanzio un nuovo oggetto widget\n$w = new rg_widget();\n\n//Guardo quanta gente c'?;\n$online = crea_numero_user_attivi_totali(2);\n\n// Imposto le propriet? del widget\n$w->name = $w_name;\n$w->title=\"Utenti OnLine <cite style=\\\"font-size:.7em\\\">( \".$online.\" )</cite>\";\n$w->content = $h3;\n$w->use_handler =false;\n$w->footer = \"Utenti che stanno in questo momento usando il sito.\";\n\nif($online>1){\n //$w->can_toggle=true;\n $w->toggle_state = \"show\";\n}else{\n //$w->can_toggle=false;\n $w->toggle_state = \"hide\";\n}\n\n// Eseguo il rendering\n$h = $w->rgw_render();\n\n// Distruggo il widget\nunset($w);\n\n//Ritorno l'HTML\nreturn $h;\n\n\n}",
"function church_admin_get_user_id($name)\n{\n global $wpdb; \n $names=explode(',',$name);\n \n $user_ids=array();\n if(!empty($names))\n {\n foreach($names AS $key=>$value)\n {\n\t\t\t$value=trim($value);\n if(!empty($value))\n {//only look if a name stored!\n $sql='SELECT user_id FROM '.CA_PEO_TBL.' WHERE CONCAT_WS(\" \",first_name,last_name) REGEXP \"^'.esc_sql($value).'\" LIMIT 1';\n $result=$wpdb->get_var($sql);\n if($result){$user_ids[]=$result;}else\n\t\t\t\t{\n\t\t\t\t\techo '<p>'.esc_html($value).' is not stored by Church Admin as Wordpress User. ';\n\t\t\t\t\t$people_id=$wpdb->get_var('SELECT people_id FROM '.CA_PEO_TBL.' WHERE CONCAT_WS(\" \",first_name,last_name) REGEXP \"^'.esc_sql($value).'\" LIMIT 1');\n\t\t\t\t\tif(!empty($people_id))echo'Please <a href=\"'.wp_nonce_url('admin.php?page=church_admin/index.php&action=church_admin_edit_people&people_id='.$people_id,'edit_people').'\">edit</a> entry to connect/create site user account.';\n\t\t\t\t\techo'</p>';\n\t\t\t\t}\n }\n }\n }\n if(!empty($user_ids)){ return maybe_serialize(array_filter($user_ids));}else{return NULL;}\n}",
"function elv_get_all_the_authors() {\n $author_id = array();\n $query = new WP_Query( array( 'post_type' => 'elv_authors') );\n while ( $query->have_posts() ) : $query->the_post();\n $s_name = get_the_title(get_the_ID());\n $author_id[get_the_ID()] = $s_name;\n endwhile; wp_reset_postdata();\n return $author_id ;\n}",
"public function getIdUtente(){\n return $this->id_utente;\n }",
"function listar_temporada_privada($id){\n\t\t$this->mensaje = \"\"; $this->mensaje2 = \"\"; $this->mensaje3 = \"\";\n\t\t$sql=\"SELECT *, id AS habitacion FROM temporadas WHERE id_alojamiento='$id' ORDER BY orden\";\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t$this->mensaje=\"si\";\n\t\t\t$buscar=$resultado['id'];\n\t\t\t$lista=\"\"; $lista2=\"\";\n\t\t\t$sql2=\"SELECT * FROM habitaciones WHERE id_alojamiento='$id' AND id_temporada='$buscar' ORDER BY orden\";\n\t\t\t//echo $sql2.\"<br />\";\n\t\t\t$habitaciones=mysql_query($sql2) or die(mysql_error());\n\t\t\twhile ($respuesta = mysql_fetch_array($habitaciones)){\n\t\t\t\t$this->mensaje2=\"si\";\n\t\t\t\t//$respuesta['precio']=$this->mostrar_precio($respuesta['precio']);\n\t\t\t\t$lista[]=$respuesta;\n\t\t\t}\n\t\t\t\n\t\t\t$resultado['habitacion']=$lista;\n\t\t\t\n\t\t\t$sql3=\"SELECT * FROM rango_ninos WHERE temporada_ran='$buscar' ORDER BY etiqueta_ran\";\n\t\t\t//echo $sql3.\"<br />\";\n\t\t\t$rangos=mysql_query($sql3) or die(mysql_error());\n\t\t\twhile ($respuesta2 = mysql_fetch_array($rangos)){\n\t\t\t\t$this->mensaje3=\"si\";\n\t\t\t\t//$respuesta['precio']=$this->mostrar_precio($respuesta['precio']);\n\t\t\t\t$lista2[]=$respuesta2;\n\t\t\t}\n\t\t\t\n\t\t\t$resultado['rangokids']=$lista2;\n\t\t\t$resultado['fecha_inicio']=$this->convertir_fecha($resultado['fecha_inicio']);\n\t\t\t$resultado['fecha_fin']=$this->convertir_fecha($resultado['fecha_fin']);\n\t\t\t$this->listado[] = $resultado;\n\t\t\t\n\t\t}\n\t\t//print_r($this->listado);\n\t}",
"function get_unidaddidactica($idUnidadDidactica)\n {\n return $this->db->get_where('unidaddidactica',array('idUnidadDidactica'=>$idUnidadDidactica))->row_array();\n }",
"public function getRimossi($idUtente){\n try{\n $query = \"SELECT DISTINCT id_utente_proposto FROM \".$this->table.\" WHERE id_utente = \".$idUtente.\" AND display = 1 ORDER BY id_utente_proposto ASC\";\n //echo $query;\n return $this->wpdb->get_results($query);\n } catch (Exception $ex) {\n _e($ex);\n return false;\n }\n }",
"function bamobile_mobiconnector_get_user_social($user_id){\r\n global $wpdb;\r\n $table = $wpdb->prefix.'mobiconnector_social_users';\r\n $datas = $wpdb->get_results('SELECT * FROM '.$table.' WHERE user_id = '.$user_id);\r\n if(!empty($datas)){\r\n foreach($datas as $data){\r\n return $data;\r\n }\r\n }else{\r\n return array();\r\n }\r\n}",
"function listar_utilizadores($opcao){\n $arrayUtilizadores=[];\n global $mybd;\n //Devolve todos gestores ativos\n if($opcao==1){\n $STH = $mybd->DBH->prepare(\"Select uti_id,uti_nome,uti_email,uti_password,uti_estado,uti_tipo,uti_inscricao from utilizador where uti_estado='1' and uti_tipo='1' ;\");\n //Devolve todos anunciantes ativos\n }else if($opcao==2){\n $STH = $mybd->DBH->prepare(\"Select uti_id,uti_nome,uti_email,uti_password,uti_estado,uti_tipo,uti_inscricao from utilizador where uti_estado='1' and uti_tipo='2' ;\");\n }else{\n $STH =$mybd->DBH->prepare(\"Select uti_id,uti_nome,uti_email,uti_password,uti_estado,uti_tipo,uti_inscricao from utilizador where uti_estado='1' and uti_tipo=? and (uti_nome LIKE '%' ? '%' OR uti_email LIKE '%' ? '%');\");\n $STH->bindParam(1, $opcao[0]);\n $STH->bindParam(2, $opcao[1]);\n $STH->bindParam(3, $opcao[1]);\n }\n $STH->execute();\n $STH->setFetchMode(PDO::FETCH_OBJ);\n\t\twhile($row = $STH->fetch()){\n\t\t\t$arrayUtilizadores[sizeof($arrayUtilizadores)]=new Utilizador($row->uti_id,$row->uti_nome,$row->uti_email,$row->uti_password,$row->uti_estado,$row->uti_tipo,$row->uti_inscricao);\n\t\t}\n return $arrayUtilizadores;\n }",
"function moments_qodef_get_user_custom_fields( $id ) {\n\n\t\t$user_social_array = array();\n\t\t$social_network_array = array( 'instagram', 'twitter', 'facebook', 'googleplus' );\n\n\t\tforeach ( $social_network_array as $network ) {\n\n\t\t\t$$network = array(\n\t\t\t\t'name' => $network,\n\t\t\t\t'link' => get_the_author_meta( $network, $id ),\n\t\t\t\t'class' => 'social_' . $network\n\t\t\t);\n\n\t\t\t$user_social_array[ $network ] = $$network;\n\n\t\t}\n\n\t\treturn $user_social_array;\n\t}",
"function id_ordine_user($idu){\r\n \r\n $sql = \"SELECT retegas_ordini.id_utente FROM retegas_ordini WHERE (((retegas_ordini.id_ordini)='$idu'));\";\r\n $ret = mysql_query($sql);\r\n $row = mysql_fetch_row($ret);\r\n return $row[0];\r\n}",
"function liste_webmestres($void)\n{\n\t$webmestres = array();\n\tinclude_spip('inc/texte');\n\tinclude_spip('inc/plugin');\n\n\t// Version SPIP < 2.1 ou alors >= 2.1 mais utilisant toujours le define pour etablir la liste\n\tif (!function_exists('spip_version_compare') OR \n\tspip_version_compare($GLOBALS['spip_version_branche'],\"2.1.0-rc\",\"<\") OR\n\tdefined('_ID_WEBMESTRES')) {\n\t\t$s = spip_query(\"SELECT * FROM spip_auteurs WHERE id_auteur IN (\". join (',', array_filter(explode(':', _ID_WEBMESTRES), 'is_numeric')).\")\");\n\t}\n\t// Version SPIP >= 2.1 et utilisation du flag webmestre en base de donnees\n\telse {\n\t\t$s = spip_query(\"SELECT * FROM spip_auteurs WHERE webmestre='oui'\");\n\t}\n\n\twhile ($qui = sql_fetch($s)) {\n\t\tif (autoriser('webmestre','','',$qui))\n\t\t\t$webmestres[$qui['id_auteur']] = typo($qui['nom']);\n\t}\n\treturn join(', ', $webmestres);\n}",
"function loot_get_coffre_ville_return($id_equipe, $id_partie) {\n \n global $wpdb;\n \n try {\n $query = $wpdb->prepare(\"SELECT nom_objet, valeur_objet, quantite_objet, type_objet, class_objet FROM coffre_ville AS c, objet AS o, type_objet AS t, class_objet AS co WHERE co.id_class = o.id_class AND c.id_objet=o.id_objet AND o.id_type = t.id_type AND id_equipe='%d' AND id_partie='%d'\",$id_equipe,$id_partie);\n $tmp = ($wpdb->get_results($query));\n return $tmp;\n \n \n } catch (Exception $ex) {\n return $e->getMessage();\n }\n}",
"function import_identifie_id_mot($values, $table, $desc, $request) {\n\treturn array((0 - $values['id_groupe']), $values['titre']);\n}",
"function id_listino_user($idu){\r\n \r\n $sql = \"SELECT retegas_listini.id_utenti FROM retegas_listini WHERE (((retegas_listini.id_listini)=$idu));\";\r\n $ret = mysql_query($sql);\r\n $row = mysql_fetch_row($ret);\r\n return $row[0];\r\n}",
"function getInstaciasForm($id_OT){\n\t\t\t\n\t\t\t$this->db->select('frm_instancias_formulario.*');\n\t\t\t$this->db->from('frm_instancias_formulario');\n\t\t\t$this->db->where('ortra_id',$id_OT);\n\t\t\t$query = $this->db->get();\t\t\t\n\t\t\t$i=0;\n\t\t\tforeach ($query->result() as $row){\n $inst[$i] = $row->info_id;\t\t\t\t \n\t\t\t\t$i++; \n\t\t\t}\n\t\t\treturn $inst;\n\t\t}",
"function custom_array_list_user_administrator() {\n $list_user = [];\n // Get 2 results.\n $user_results = views_get_view_result('user_functions', 'block_user_roles');\n if (!empty($user_results)) {\n foreach ($user_results as $row) {\n if ($row->uid) {\n $list_user[] = $row->uid;\n }\n }\n }\n array_unique($list_user);\n return ($list_user);\n}"
] | [
"0.6536818",
"0.564571",
"0.5585424",
"0.54728806",
"0.5437309",
"0.5356009",
"0.5338435",
"0.53095406",
"0.5299232",
"0.5275241",
"0.5272273",
"0.5252376",
"0.5247421",
"0.52427894",
"0.52306473",
"0.5227972",
"0.5226608",
"0.5185686",
"0.51634645",
"0.5152703",
"0.51451004",
"0.51361334",
"0.512915",
"0.5125729",
"0.51251054",
"0.51150024",
"0.51132596",
"0.51013",
"0.5086624",
"0.506969"
] | 0.66712505 | 0 |
Create a formatted table with books matching the provided filter. | function displayBooks($filter)
{
// Prevent injections:
$filter = $this->conn->real_escape_string($filter);
// Build query:
$query = "SELECT b.bookid, b.title, a.name, b.pub_year, b.available
FROM books b, authors a
WHERE (a.authorid = b.authorid)
AND (b.bookid LIKE '%$filter%'
OR b.title LIKE '%$filter%'
OR b.ISBN LIKE '%$filter%'
OR b.pub_year LIKE '%$filter%'
OR b.available LIKE '%$filter%'
OR a.name LIKE '%$filter%')
ORDER BY b.bookid";
$result = $this->conn->query($query);
return $this->buildBooksTable($result);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function buildBooksTable($result)\n {\n if ($result->num_rows > 0) {\n $output = \"<table class='booksTable' width='690px' style='text-align:center'>\";\n $output .= \"<thead><tr><th>Select</th><th>S.N</th><th>Book title</th>\n <th>Author name</th><th>Published year</th><th>Available</th></tr></thead>\";\n $output .= \"<tbody>\";\n while ($row = $result->fetch_object()) {\n $output .= \"<tr><td><input type='checkbox' name='bookcbs[]' value='$row->bookid'></td>\n <td>$row->bookid</td><td>$row->title</td><td>$row->name</td>\n <td>$row->pub_year</td><td>$row->available</td></tr>\";\n }\n $output .= \"</tbody></table>\";\n return $output;\n } else {\n $output = \"No results for library books\";\n return $output;\n }\n }",
"function displayAuthors($filter)\n {\n // Prevent injections:\n $filter = $this->conn->real_escape_string($filter);\n // Build query:\n $query = \"SELECT a.authorid, a.name, \n COUNT(b.authorid) AS bookcount\n FROM authors AS a\n LEFT JOIN books AS b\n ON a.authorid = b.authorid\n WHERE b.title LIKE '%$filter%'\n OR b.ISBN = '%$filter%'\n OR a.authorid = '$filter'\n OR a.name LIKE '%$filter%'\n GROUP BY b.authorid\";\n\n $result = $this->conn->query($query);\n\n return $this->buildAuthorsTable($result);\n }",
"function printifTable($filter=\"\")\n\t\t{\n\t\tif ($filter==\"\")\n\t\t\t{\n\t\t\treturn ($this->lastTable);\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\t$result=array();\n\t\t\tif ( is_array($filter)==true )\n\t\t\t\t{\n\t\t\t\t//echo \"Ist ein Array.\\n\";\n\t\t\t\tforeach ($this->lastTable as $entry)\n\t\t\t\t\t{\n\t\t\t\t\t$str=\"\";\n\t\t\t\t\t$found=false;\n\t\t\t\t\tforeach ($entry as $key => $object)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tif (isset($filter[$this->collumns[$key]]) == true)\n\t\t\t\t\t\t\tif ($filter[$this->collumns[$key]] == $object) $found=true;\n\t\t\t\t\t\t$str.=$this->collumns[$key].\":\".$object.\" \";\n\t\t\t\t\t\t}\n\t\t\t\t\tif ($found) $result[]=$str.\"\\n\"; else $str=\"\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\t\n\t\t\t\tforeach ($this->lastTable as $entry)\n\t\t\t\t\t{\n\t\t\t\t\tforeach ($entry as $key => $object)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tif ($this->collumns[$key]==$filter) $result[]=$object;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\treturn ($result);\t\n\t\t\t}\t\n\t\t}",
"public function create_library_table() {\n if($this->check_table_exists(\"books\")) {\n echo \"\\e[1;33m Table \\\"books\\\" already exists.\\e[0m\";\n return;\n }\n\n $statement = \"CREATE TABLE books(\n id SERIAL PRIMARY KEY,\n name VARCHAR(128) NOT NULL,\n author VARCHAR(128) NOT NULL,\n created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n updated_at TIMESTAMP NULL,\n UNIQUE(name, author)\n )\";\n\n pg_query($this->connection, $statement);\n $latest_error = pg_last_error($this->connection);\n if(!empty($latest_error) || $latest_error === false) {\n throw new \\Exception(\"An error occurred when creating the \\\"books\\\" table\");\n }\n echo \"\\e[0;32m Table \\\"books\\\" created.\\e[0m\";\n }",
"function FancyTable($month, $year, $filter, $header)\r\n\t{\r\n\t\t$this->SetFillColor(41, 128, 185);\r\n\t\t$this->SetTextColor(255);\r\n\t\t$this->SetDrawColor(128,0,0);\r\n\t\t$this->SetLineWidth(.3);\r\n\t\t$this->SetFont('','B');\r\n\t\t// Header\r\n\t\t$w = array(50, 50, 40, 40);\r\n\t\tfor($i=0;$i<count($header);$i++)\r\n\t\t\t$this->Cell($w[$i],5,$header[$i],1,0,'C',true);\r\n\t\t$this->Ln();\r\n\t\t// Color and font restoration\r\n\t\t$this->SetFillColor(224,235,255);\r\n\t\t$this->SetTextColor(0);\r\n\t\t$this->SetFont('');\r\n\t\t// Data\r\n\t\t$fill = false;\r\n\t\t$number=1;\r\n\t\t//FROM read.php\r\n\t\t$object = new CRUD();\r\n\t\t\r\n\t\t$codes=$object->Read_Code($month, $year);\r\n\r\n\t\t$balance=$debet=$credit=$total_balance=$total_debet=$total_credit=$total_opening=0; $temu=false;\r\n\r\n\t\t$total1=$total2=$total3=0;$check1=$check2=true;$create_left=$create_right1=$create_right2=false;\r\n\t\t//read show0\r\n\t\t$this->SetFont('Arial','',10);\r\n\t\t$this->Cell($w[0],6,\"Total Revenue\",'LR',0,'L',$fill);\r\n\t\t$this->Cell($w[1],6,\"\",'LR',0,'L',$fill);\r\n\t\t$this->Cell($w[2],6,\"\",'LR',0,'L',$fill);\r\n\t\t$this->Cell($w[3],6,\"\",'LR',0,'L',$fill);\r\n\t\t$this->Ln();\r\n\t\t$this->SetFont('Arial','',7);\r\n\t\t$fill = !$fill;\r\n\t\t//End show0\r\n\t\tforeach($codes as $code){\r\n\t\t\t$debet=$credit=$balance=0;$create_left=$create_right1=$create_right2=false;\r\n\t\t\t//Start Total Revenue\r\n\t\t\tif($code['code']>40000 && $code['code']<50000){\r\n\t\t\t\t$create_right1=true;\r\n\t\t\t}\t\r\n\t\t\t//End Total Revenue\t\r\n\t\t\telse if($code['code']>50000 && $code['code']<60000){\r\n\t\t\t\tif($check1){\r\n\t\t\t\t\t$check1=false;\r\n\t\t\t\t\t//read show1\r\n\t\t\t\t\t$this->SetFont('Arial','',10);\r\n\t\t\t\t\t$this->Cell($w[0],6,\"Subtotal Revenue\",'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Cell($w[1],6,\"\",'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Cell($w[2],6,\"\",'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Cell($w[3],6,number_format($total1,2,\",\",\".\"),'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Ln();\r\n\t\t\t\t\t$fill = !$fill;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->Cell($w[0],6,\"Costs and Expenses\",'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Cell($w[1],6,\"\",'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Cell($w[2],6,\"\",'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Cell($w[3],6,\"\",'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Ln();\r\n\t\t\t\t\t$fill = !$fill;\r\n\t\t\t\t\t$this->SetFont('Arial','',7);\r\n\t\t\t\t\t//End show1\r\n\t\t\t\t}\r\n\t\t\t\t$create_left=true;\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tif($check2){\r\n\t\t\t\t\t$check2=false;\r\n\t\t\t\t\t//$data .=$object->show2($total1, $total2);\r\n\t\t\t\t\t//read show2\r\n\t\t\t\t\t$this->SetFont('Arial','',10);\r\n\t\t\t\t\t$this->Cell($w[0],6,\"Subtotal Costs and Expenses\",'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Cell($w[1],6,\"\",'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Cell($w[2],6,\"\",'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Cell($w[3],6,number_format($total2,2,\",\",\".\"),'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Ln();\r\n\t\t\t\t\t$fill = !$fill;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->Cell($w[0],6,\"Operation Profit\",'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Cell($w[1],6,\"\",'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Cell($w[2],6,\"\",'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Cell($w[3],6,number_format($total1-$total2,2,\",\",\".\"),'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Ln();\r\n\t\t\t\t\t$fill = !$fill;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->Cell($w[0],6,\"Other Revenue and Cost\",'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Cell($w[1],6,\"\",'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Cell($w[2],6,\"\",'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Cell($w[3],6,\"\",'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Ln();\r\n\t\t\t\t\t$fill = !$fill;\r\n\t\t\t\t\t$this->SetFont('Arial','',7);\r\n\t\t\t\t\t//End show2\r\n\t\t\t\t}\r\n\t\t\t\t$create_right2=true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif($create_left || $create_right1 || $create_right2){\r\n\t\t\t\t//From Cash\r\n\t\t\t\t$cashs2=$object->Read_Cash_Data($month, $year, $filter, $object->month($month), $code['code']);\r\n\t\t\t\tforeach($cashs2 as $cash2){\r\n\t\t\t\t\tif($cash2['debet']>0)\r\n\t\t\t\t\t\t$credit+=$cash2['debet'];\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$debet+=$cash2['credit'];\r\n\t\t\t\t}\r\n\t\t\t\t//From Bank\r\n\t\t\t\t$banks2=$object->Read_Bank_Data2($month, $year, $filter, $object->month($month), $code['code']);\r\n\t\t\t\tforeach($banks2 as $bank2){\r\n\t\t\t\t\tif($bank2['debet']>0)\r\n\t\t\t\t\t\t$credit+=$bank2['debet'];\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$debet+=$bank2['credit'];\r\n\t\t\t\t}\r\n\t\t\t\t//From Adjustment\r\n\t\t\t\t$adjs=$object->Read_Adj_Data($month, $year, $code['code']);\r\n\t\t\t\tforeach($adjs as $adj){\r\n\t\t\t\t\tif($adj['credit']>0)\r\n\t\t\t\t\t\t$credit+=$adj['credit'];\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$debet+=$adj['debet'];\r\n\t\t\t\t}\r\n\t\t\t\tif($code['type']== \"Debet\")\r\n\t\t\t\t\t$balance=$code['balance']+$debet-$credit;\r\n\t\t\t\telse\r\n\t\t\t\t\t$balance=$code['balance']+$credit-$debet;\r\n\t\t\t\t\r\n\t\t\t\t$total_debet+=$debet;$total_credit+=$credit;$total_balance+=$balance;$total_opening+=$code['balance'];\r\n\t\t\t\t//Create Data\r\n\t\t\t\tif($create_left){\r\n\t\t\t\t\t//$data.= $object->show_data_left($code['code'], $code['name'], $balance);\r\n\t\t\t\t\t$this->Cell($w[0],6,$code['code'],'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Cell($w[1],6,$code['name'],'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Cell($w[2],6,number_format($balance,2,\",\",\".\"),'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Cell($w[3],6,\"\",'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Ln();\r\n\t\t\t\t\t$fill = !$fill;\r\n\t\t\t\t\t$total2+=$balance;\r\n\t\t\t\t}\r\n\t\t\t\telse if($create_right1){\r\n\t\t\t\t\t//$data.= $object->show_data_right($code['code'], $code['name'], $balance);\r\n\t\t\t\t\t$this->Cell($w[0],6,$code['code'],'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Cell($w[1],6,$code['name'],'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Cell($w[2],6,\"\",'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Cell($w[3],6,number_format($balance,2,\",\",\".\"),'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Ln();\r\n\t\t\t\t\t$fill = !$fill;\r\n\t\t\t\t\t$total1+=$balance;\t\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t//$data.= $object->show_data_right($code['code'], $code['name'], $balance);\r\n\t\t\t\t\t$this->Cell($w[0],6,$code['code'],'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Cell($w[1],6,$code['name'],'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Cell($w[2],6,\"\",'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Cell($w[3],6,number_format($balance,2,\",\",\".\"),'LR',0,'L',$fill);\r\n\t\t\t\t\t$this->Ln();\r\n\t\t\t\t\t$fill = !$fill;\r\n\t\t\t\t\tif($code['code']==\"61010\")\r\n\t\t\t\t\t\t$total3+=$balance;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$total3-=$balance;\r\n\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//$data .=$object->show3($total1, $total2, $total3);\r\n\t\t$this->SetFont('Arial','',10);\r\n\t\t$this->Cell($w[0],6,\"Subtotal Other Revenue and Expenses\",'LR',0,'L',$fill);\r\n\t\t$this->Cell($w[1],6,\"\",'LR',0,'L',$fill);\r\n\t\t$this->Cell($w[2],6,\"\",'LR',0,'L',$fill);\r\n\t\t$this->Cell($w[3],6,number_format($total3,2,\",\",\".\"),'LR',0,'L',$fill);\r\n\t\t$this->Ln();\r\n\t\t$fill = !$fill;\r\n\t\t\r\n\t\t$result=$total1-$total2;\r\n\t\t$result2=$result+$total3;\r\n\t\t\r\n\t\t$this->Cell($w[0],6,\"Current Profit Month\",'LR',0,'L',$fill);\r\n\t\t$this->Cell($w[1],6,\"\",'LR',0,'L',$fill);\r\n\t\t$this->Cell($w[2],6,\"\",'LR',0,'L',$fill);\r\n\t\t$this->Cell($w[3],6,number_format($result2,2,\",\",\".\"),'LR',0,'L',$fill);\r\n\t\t$this->Ln();\r\n\t\t$fill = !$fill;\r\n\t\t$this->SetFont('Arial','',7);\r\n\t\t// Closing line\r\n\t\t\r\n\t}",
"function displayAllBooks()\n {\n $query = \"SELECT b.bookid, b.title, a.name, b.pub_year, b.available \n FROM books b, authors a \n WHERE a.authorid = b.authorid\n ORDER BY b.bookid\";\n $result = $this->conn->query($query);\n\n return $this->buildBooksTable($result);\n }",
"function genTable ($query=\"\",$param=array(),$title=\"\",$css=\"\",$fields=array(),$link_fields=array(),$linked_text=array()) {\n\n $data = $this->getData($query,$param);\n\t $result = $data->data2Table($fields,$link_fields,$linked_text,$css);\n return $result;\n }",
"private function buildAuthorsTable($result)\n {\n if ($result->num_rows > 0) {\n $output = \"<table class='booksTable' width='690px' style='text-align:center'>\";\n $output .= \"<col style='width:10%'>\n <col style='width:10%'>\n <col style='width:55%'>\n <col style='width:25%'>\";\n $output .= \"<thead><tr><th>Select</th><th>S.N</th><th>Author name</th>\n <th>Library books</th></tr></thead>\";\n $output .= \"<tbody>\";\n while ($row = $result->fetch_object()) {\n $output .= \"<tr><td><input type='checkbox' name='authorscbs[]' value='$row->authorid'></td>\n <td>$row->authorid</td><td>$row->name</td><td>$row->bookcount</td></tr>\";\n }\n $output .= \"</tbody></table>\";\n return $output;\n } else {\n $output = \"No results for authors\";\n return $output;\n }\n }",
"function ShowBooks($filter, $isUserSearch, $isAdminDisplay = FALSE){\n\t\ttry{\n\t\t\t$connection = ConnectToBD();\n\t\t\t\n\t\t\t$stm = $connection->prepare(\"call ListBooks(?,?)\");\n\t\t\t$stm->bindParam(1, $filter, PDO::PARAM_STR, 255);\n\t\t\t$stm->bindParam(2, $isUserSearch, PDO::PARAM_BOOL);\n\t\t\t$stm->execute();\n\t\t\t\n\t\t\tif($isAdminDisplay) {\n\t\t\t\twhile($data = $stm->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT)) {\n\t\t\t\t\techo '<tr><td>'.$data[\"BookCode\"].'</td><td>'.$data[\"BookName\"].'</td><td>'.FormatCurrency($data[\"BookCost\"]).'</td>';\n\t\t\t\t\techo '<td><a href=\"UpdateBook.php/?id='.$data[\"idBooks\"].'\">Modifier</a></td></tr>';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\twhile($data = $stm->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT)) {\n\t\t\t\t\tif(TRUE!==array_search($data[\"BookCode\"], $_SESSION[\"Cart\"], TRUE)) {\n\t\t\t\t\t\techo '<tr><td>'.$data[\"BookCode\"].'</td><td>'.$data[\"BookName\"].'</td><td>'.FormatCurrency($data[\"BookCost\"]).'</td>';\n\t\t\t\t\t\techo '<td><button type=\"button\" class=\"AddToCart\" data-id=\"'.$data[\"idBooks\"].'\">Ajouter au panier</button>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$stm = NULL;\n\t\t\t$connection = NULL;\n\t\t} catch(PDOException $e) {\n\t\t\tprint \"Erreur!: \" . $e->getMessage() . \"<br/>\";\n\t\t\tdie();\n\t\t}\n\t}",
"public function getTableQueryBuilder(array $filtros = []);",
"function generateTable($tableName, $titlesResultSet, $dataResultSet)\r\n{\r\n\r\n\techo \"<table border=1>\";\r\n\r\n\t//first - create the table caption and headings\r\n\techo \"<caption>\".strtoupper($tableName).\" TABLE - RESULT</caption>\";\r\n\techo '<tr>';\r\n\tforeach($titlesResultSet as $fieldName) {\r\n\t\techo '<th>'.$fieldName['Field'].'</th>';\r\n\t}\r\n\techo '</tr>';\r\n\r\n\t//then show the data\r\n\tforeach($dataResultSet as $row) {\r\n\t\techo '<tr>';\r\n\t\tforeach($titlesResultSet as $fieldName) {\r\n\t\t\techo '<td>'.$row[$fieldName['Field']].'</td>';}\r\n\t\techo '</tr>';\r\n\t\t}\r\n\techo \"</table>\";\r\n}",
"private function mkBooksQuery($searchType, $sortAscending, $queryFilter, $search = null, $translit = false)\n {\n switch ($searchType) {\n case CalibreSearchType::Book:\n $sortField = 'sort';\n break;\n case CalibreSearchType::TimestampOrderedBook:\n $sortField = 'timestamp';\n break;\n case CalibreSearchType::PubDateOrderedBook:\n $sortField = 'pubdate';\n break;\n case CalibreSearchType::LastModifiedOrderedBook:\n $sortField = 'last_modified';\n break;\n default:\n throw new Exception('Invalid search type');\n }\n if ($sortAscending) {\n $sortModifier = \" ASC\";\n } else {\n $sortModifier = \" DESC\";\n }\n if ($search) {\n if ($translit) {\n $where = 'lower(transliterated(title)) LIKE :search_l OR lower(transliterated(title)) LIKE :search_t';\n } else {\n $where = 'lower(title) LIKE :search_l OR lower(title) LIKE :search_t';\n }\n $query = 'SELECT * FROM ' . $queryFilter . \" WHERE {$where} ORDER BY \" . $sortField . ' ' . $sortModifier;\n } else {\n $query = 'SELECT * FROM ' . $queryFilter . ' ORDER BY ' . $sortField . ' ' . $sortModifier;\n }\n return $query;\n }",
"function createBookListing($dbc, $bookID, $conditionID, $price, $courseDept, $courseNumber) {\n\t\t$sql = \"INSERT INTO BookListing\n\t\t\t(PostDate, UserID, BookID, BookConditionID, Price, ViewCount, ChangeSource, RecordStatus, RecordStatusDate, CourseDept, CourseNumber)\n\t\t\tVALUES (\n\t\t\t\tNOW(),\" .\n\t\t\t\t$_SESSION['userID'] .\",\" .\n\t\t\t\t$bookID .\",\" .\n\t\t\t\t$conditionID .\",\" .\n\t\t\t\tdbw::zeroIfEmpty($price) .\", \n\t\t\t\t0, \n\t\t\t\t0, \n\t\t\t\t1, \n\t\t\t\tNOW(), \" .\n\t\t\t\t($courseDept == 'NULL' ? $courseDept : $dbc::singleQuote($courseDept)) .\", \" .\n\t\t\t\t(empty($courseNumber) ? 'NULL' : $dbc::singleQuote(strtoupper($courseNumber))) .\n\t\t\t\");\";\n\t\treturn $dbc->query($sql);\n\t}",
"function createTable($result,$fields)\n{\n $table = \"<table><thead><tr>\";\n foreach ($fields as $value) {\n $table .=\"<th>\".$value.\"</th>\";\n }\n $table .=\"</tr></thead>\";\n foreach ($result as $row)\n {\n $table.= \"<tr>\" ;\n foreach ($fields as $value) {\n $table .=\"<td>\" . $row[$value] . \"</td>\";\n }\n\n $table.= \"</tr>\" ;\n }\n $table .= \"<caption>Reserved Picnics</caption></table>\";\n return $table;\n}",
"function createTable($data){\n if (count($data) > 0): ?>\n <table>\n <thead>\n <style>\n table {\n font-family: arial, sans-serif;\n border-collapse: collapse;\n width: 90%;\n }\n td, th {\n border: 1px solid #dddddd;\n text-align: left;\n padding: 8px;\n }\n tr:nth-child(even) {\n background-color: #dddddd;\n }\n </style>\n <tr>\n <th><?php echo implode('</th><th>', $data[0]);?></th>\n </tr>\n </thead>\n <tbody>\n <?php foreach (array_slice($data,1,200) as $row):?>\n <tr>\n <td><?php echo implode('</td><td>', $row); ?></td>\n </tr>\n <?php endforeach; ?>\n </tbody>\n </table>\n <?php endif;\n }",
"function createTable($header, $data, $heading){\n\n\tGlobal $display_on_screen;\n\tif($display_on_screen == 'no'){\n\t\treturn;\n\t}\n\n\t_p(\"<h1>\".$heading.\":</h1>\");\n\techo '\n\t\t<table>\n\t\t <tr>';\n\t\t foreach ($header as $key => $value) {\n\t\t \techo '<th>'.$value.'</th>';\n\t\t }\n\t\t echo '\n\t\t </tr>\n\t\t ';\n\t\t foreach($data as $product_id=>$product_data){\n\t\t\t echo '<tr>';\n\t\t \tforeach($product_data as $key=>$value){\n\t\t\t \techo '<td>'.$value.'</td>';\n\t\t \t}\n\t\t \t\techo '</tr>';\n\t\t }\n\t\t echo '\n\t </table><br><br>\n\t';\n}",
"public function BuildTable();",
"public function onGenerate($format)\n {\n try\n {\n $filters = $this->getFilters();\n \n // open a transaction with database 'microerp'\n TTransaction::open('microerp');\n \n // creates a repository for Pessoa\n $repository = new TRepository('Pessoa');\n \n // creates a criteria\n $criteria = new TCriteria;\n\n if ($filters)\n {\n foreach ($filters as $filter) \n {\n $criteria->add($filter); \n }\n }\n\n // load the objects according to criteria\n $objects = $repository->load($criteria, FALSE);\n\n if ($objects)\n {\n $widths = array(100,200,200,200,200,200);\n\n switch ($format)\n {\n case 'html':\n $tr = new TTableWriterHTML($widths);\n break;\n case 'pdf':\n $tr = new TTableWriterPDF($widths, 'L');\n break;\n case 'rtf':\n if (!class_exists('PHPRtfLite_Autoloader'))\n {\n PHPRtfLite::registerAutoloader();\n }\n $tr = new TTableWriterRTF($widths);\n break;\n }\n\n if (!empty($tr))\n {\n // create the document styles\n $tr->addStyle('title', 'Helvetica', '10', 'B', '#000000', '#dbdbdb');\n $tr->addStyle('datap', 'Arial', '10', '', '#333333', '#f0f0f0');\n $tr->addStyle('datai', 'Arial', '10', '', '#333333', '#ffffff');\n $tr->addStyle('header', 'Helvetica', '16', 'B', '#5a5a5a', '#6B6B6B');\n $tr->addStyle('footer', 'Helvetica', '10', 'B', '#5a5a5a', '#A3A3A3');\n $tr->addStyle('break', 'Helvetica', '10', 'B', '#ffffff', '#9a9a9a');\n $tr->addStyle('total', 'Helvetica', '10', 'I', '#000000', '#c7c7c7');\n\n // add titles row\n $tr->addRow();\n $tr->addCell('Id', 'left', 'title');\n $tr->addCell('Nome', 'left', 'title');\n $tr->addCell('Fone', 'left', 'title');\n $tr->addCell('Email', 'left', 'title');\n $tr->addCell('Cep', 'left', 'title');\n $tr->addCell('Cidade', 'left', 'title');\n\n $grandTotal = [];\n\n // controls the background filling\n $colour = false; \n foreach ($objects as $object)\n {\n $style = $colour ? 'datap' : 'datai';\n \n $grandTotal['cidade_id'][] = $object->cidade_id;\n \n $tr->addRow();\n $tr->addCell($object->id, 'left', $style);\n $tr->addCell($object->nome, 'left', $style);\n $tr->addCell($object->fone, 'left', $style);\n $tr->addCell($object->email, 'left', $style);\n $tr->addCell($object->cep, 'left', $style);\n $tr->addCell($object->cidade->nome, 'left', $style);\n\n $colour = !$colour;\n }\n\n $tr->addRow();\n\n $total_cidade_id = count($grandTotal['cidade_id']);\n \n $tr->addCell('', '', 'total');\n $tr->addCell('', '', 'total');\n $tr->addCell('', '', 'total');\n $tr->addCell('', '', 'total');\n $tr->addCell('', '', 'total');\n $tr->addCell('Qtde: '.$total_cidade_id, 'left', 'total');\n\n $file = 'report_'.uniqid().\".{$format}\";\n \n // stores the file\n if (!file_exists(\"app/output/{$file}\") || is_writable(\"app/output/{$file}\"))\n {\n $tr->save(\"app/output/{$file}\");\n }\n else\n {\n throw new Exception(_t('Permission denied') . ': ' . \"app/output/{$file}\");\n }\n\n parent::openFile(\"app/output/{$file}\");\n\n // shows the success message\n new TMessage('info', 'Report generated. Please, enable popups.');\n }\n }\n else\n {\n new TMessage('error', _t('No records found'));\n }\n\n // close the transaction\n TTransaction::close();\n }\n catch (Exception $e)\n {\n new TMessage('error', $e->getMessage());\n TTransaction::rollback();\n }\n }",
"function createTableBillysInvoices()\n {\n $primary = DBIntegerColumn::create('invoice_object_id')->setLenght(11)->setUnsigned(true);\n $newTable = DB::createTable(TABLE_PREFIX . 'billys_invoices')->addColumns(array(\n $primary,\n DBStringColumn::create('invoiceId', 22),\n DBEnumColumn::create('status', array('issued', 'paid', 'cancelled')),\n DBIntegerColumn::create('confirmed', 1),\n ));\n $index = new DBIndex('invoice_object_id', DBIndex::PRIMARY, $primary);\n\n $newTable->addIndex($index);\n $newTable->save();\n }",
"public static function getBookByFilter($userselected, $filter) {\n if (empty($filter)) {\n $query = self::execute(\"SELECT id from book where id not in(select book from rental\"\n . \" where user=:user and rentaldate is null)\", array(\"user\" => $userselected));\n } else {\n $query = self::execute(\"SELECT id from book where id not in(select book from rental\"\n . \" where user=:user and rentaldate is null)\"\n . \"AND (title LIKE '%$filter%' or author LIKE '%$filter%' or editor LIKE '%$filter%'\"\n . \" or isbn LIKE '%$filter%') \", array(\"user\" => $userselected));\n }\n $data = $query->fetchAll();\n $results = [];\n foreach ($data as $row) {\n $results[] = Book::get_by_id($row['id']);\n }\n return $results;\n }",
"public function getAllBooks()\r\n {\r\n $sth = $this->db->prepare(\"SELECT \r\n b.id, \r\n b.title,\r\n b.category, \r\n b.author, \r\n b.isbn, \r\n b.available,\r\n b.onLoan,\r\n b.bin,\r\n b.publicationYear,\r\n case \r\n when cast(b.category as unsigned)= 0 then b.category\r\n else c.cat_name \r\n end as cat_name \r\n FROM book AS b\r\n left JOIN category AS c ON b.category = c.id\r\n WHERE archive != '1' AND bin != '1' ORDER BY id DESC LIMIT 30\");\r\n $sth->execute();\r\n\r\n $all_books = array();\r\n\r\n foreach ($sth->fetchAll() as $book) {\r\n // a new object for every user. This is eventually not really optimal when it comes\r\n // to performance, but it fits the view style better\r\n \r\n $all_books[$book->id] = new stdClass();\r\n $all_books[$book->id]->id = $book->id;\r\n $all_books[$book->id]->title = $book->title;\r\n $all_books[$book->id]->author = $book->author;\r\n $all_books[$book->id]->category = $book->cat_name;\r\n $all_books[$book->id]->isbn = $book->isbn;\r\n $all_books[$book->id]->available = $book->available;\r\n $all_books[$book->id]->onLoan = $book->onLoan;\r\n }\r\n return $all_books;\r\n }",
"public function index(BookRequest $request)\n {\n $data = $request->all();\n\n $query = new Book();\n\n if($includes = AppHelper::getIncludesFromUrl()){\n $query = $query->with($includes);\n }\n\n if(isset($data['title'])){\n $query = $query->where('title', 'LIKE', \"%\" . $data['title'] . \"%\");\n }\n\n if(isset($data['author']) && isset($data['author']['id'])){\n $authorId = $data['author']['id'];\n\n $query = $query->whereHas('author', function($q) use($authorId){\n $q->where('id', $authorId);\n });\n }\n\n if(isset($data['author']) && isset($data['author']['name'])){\n $authorName = $data['author']['name'];\n\n $query = $query->whereHas('author', function($q) use($authorName){\n $q->where('name', 'LIKE', \"%\" . $authorName . \"%\");\n });\n }\n\n if(isset($data['publisher']) && isset($data['publisher']['id'])){\n $publisherId = $data['publisher']['id'];\n\n $query = $query->whereHas('publisher', function($q) use($publisherId){\n $q->where('id', $publisherId);\n });\n }\n\n if(isset($data['publisher']) && isset($data['publisher']['name'])){\n $publisherName = $data['publisher']['name'];\n\n $query = $query->whereHas('publisher', function($q) use($publisherName){\n $q->where('name', 'LIKE', \"%\" . $publisherName . \"%\");\n });\n }\n\n $books = $query->get();\n\n// if($request->get('listFormat') === 'datatables'){\n// $books = Datatables::of($books)\n// ->setTransformer(new BookDatatablesTransformer)\n// ->orderByNullsLast()\n// ->make(true);\n//\n// // return $books;\n//\n// $books = $this->datatablesResponse($books->getData());\n//\n// return $this->successResponse($books);\n// }\n\n return $this->showAll($books);\n }",
"function buildFilterSelectTable($filterType, $dbTable, $fields, $selectType = \"checkbox\", $formID = \"reportData\") {\n\t\t//reports.php \t\t- USED TO GENERATE FILTER SELECTION TABLES IN FILTER SELECT TABS\n\t\t//dataCleaner.php \t- USED TO GENERATE SELECTABLE LOOKUP TABLE\n\t\tglobal $db_conn;\n\n\t\t//Opening Table Tag\n\t\techo '<table id=\"' . $filterType . 'FilterSelectTable\" class=\"filterSelectTable\">';\n\n\t\t//First Row (Select All Row) ONLY IF $selectType == \"checkbox\"\n\t\tif ($selectType == \"checkbox\") {\n\t\t\techo '<tr class=\"filterSelectAllRow\">';\n\t\t\techo \t'<td><input type=\"checkbox\" id=\"' . $filterType . '_all\" class=\"selectAll\" form=\"' . $formID . '\" name=\"' . $filterType . '_all\" filterType=\"' . $filterType . '\" checked /></td>';\n\t\t\techo \t'<td colspan=\"' . count($fields) . '\">Select/Deselect All</td>';\n\t\t\techo '</tr>';\n\t\t}\n\t\t\n\t\t//Second Row (Headings)\n\t\techo '<tr class=\"filterSelectTitleRow\">';\n\t\techo \t'<td></td>';\n\t\tforeach($fields as $field) {\n\t\t\techo \t'<td>' . getComment($dbTable, $field) . '</td>';\n\t\t}\n\t\techo '</tr>';\n\n\t\t//Build Body of Table\n\n\t\t//Build SQL\n\t\t$filterSQL = 'SELECT ID, ';\n\t\tforeach($fields as $field) {\n\t\t\t$filterSQL .= $field . ', ';\n\t\t}\n\t\t$filterSQL = rtrim($filterSQL, \", \");\n\t\t$filterSQL .= ' FROM ' . $dbTable . ' GROUP BY ' . $fields[0] . ' ORDER BY ID;';\n\n\t\t$filterQuery = mysqli_query($db_conn, $filterSQL);\n\t\t\t\t\n\t\t//$firstIsSelectAll REMOVED FROM FUNCTIONALITY BECAUSE RADIO BUTTON FILTER SELECTS DO NOT NEED A SELECT ALL\n\t\t//$firstIsSelectAll = $selectType == \"radio\" ? \"_all\" : \"\"; //If $selectType is 'radio', then the first choice is the 'Select All' choice\n\t\twhile ($row = mysqli_fetch_row($filterQuery)) {\n\t\t\t$property = ($row[0] == \"1\" ? \"checked\" : \"\");\n\t\t\t$property = ($selectType == \"checkbox\" ? \"checked\" : $property);\n\n\t\t\techo '<tr>';\n\t\t\techo '<td><input type=\"' . $selectType . '\" form=\"' . $formID . '\" class=\"' . $filterType . '\" name=\"' . $filterType /*. $firstIsSelectAll*/ . '\" value=\"' . $row[0] . '\" ' . $property . ' /></td>';\n\n\t\t\t//$firstIsSelectAll = \"\"; //Only the first radio button can be select all. This line has no effect if $selectType == \"checkbox\"\n\n\t\t\tfor ($i = 1; $i < count($row); $i++) {\n\t\t\t\techo '<td>' . $row[$i] . '</td>';\n\t\t\t}\n\n\t\t\techo '</tr>';\n\t\t}\n\n\t\techo '</table>';\n\t}",
"public function __construct($tableName, $filter, array $options = [])\n {\n if (!is_array($filter)&&!is_object($filter)) {\n throw InvalidArgumentException::invalidType('$filter', $filter, 'array or object');\n }\n\n if (isset($options['limit'])&&!is_integer($options['limit'])) {\n throw InvalidArgumentException::invalidType('\"limit\" option', $options['limit'], 'integer');\n }\n\n if (isset($options['skip'])&&!is_integer($options['skip'])) {\n throw InvalidArgumentException::invalidType('\"skip\" option', $options['skip'], 'integer');\n }\n\n\t if (isset($options['orderby'])) {\n\t\t throw InvalidArgumentException::invalidType('\"orderby\" option', $options['orderby'], 'string');\n\t }\n\n $this->tableName = (string)$tableName;\n $this->filter = $filter;\n $this->options = $options;\n }",
"function generateTable($tableName, $primaryKey, $titlesResultSet, $dataResultSet){\r\n\r\n\t\techo \"<table class='table'>\";\r\n\r\n\t\t//first - create the table caption and headings\r\n\t\techo \"<caption>\".strtoupper($tableName).\" TABLE</caption>\";\r\n\t\techo '<tr>';\r\n\t\tforeach($titlesResultSet as $fieldName) {\r\n\t\t\techo '<th>'.$fieldName['Field'].'</th>';\r\n\t\t}\r\n\t\techo '<th>DELETE</th>';\r\n\t\techo '<th>EDIT</th>';\r\n\t\techo '</tr>';\r\n\r\n\t\t//then show the data\r\n\t\tforeach($dataResultSet as $row) {\r\n\t\t\techo '<tr>';\r\n\t\t\tforeach($titlesResultSet as $fieldName) {\r\n\t\t\t\techo '<td>'.$row[$fieldName['Field']].'</td>';}\r\n\t\t\techo '<td>';\r\n\t\t\t//set the button values and display the button ton the form:\r\n\t\t\t$id=$row[$primaryKey]; //get the current PK value\r\n\t\t\t$buttonText=\"Delete\";\r\n\t\t\tinclude '../FORMS/delbutton.txt';\r\n\t\t\techo '</td>';\r\n\t\t\techo '<td>';\r\n\t\t\t//set the button values and display the button ton the form:\r\n\t\t\t$id=$row[$primaryKey]; //get the current PK value\r\n\t\t\t$buttonText=\"Edit\";\r\n\t\t\tinclude '../FORMS/editbutton.txt';\r\n\t\t\techo '</td>';\r\n\t\t\techo '</tr>';\r\n\t\t\t}\r\n\t\techo \"</table>\";\r\n\t}",
"function make_table($query) {\r\n\t\techo \"<table><tr>\";\r\n\t\t$row = mysqli_fetch_assoc($query);\r\n\t\tforeach ($row as $attr => $value) {\r\n\t\t\techo \"<th>$attr</th>\";\r\n\t\t}\r\n\t\techo \"</tr>\";\r\n\t\twhile ($row = mysqli_fetch_assoc($query)) { \r\n\t\t\techo \"<tr>\";\r\n\t\t\tforeach($row as $value) {\r\n\t\t\t\techo \"<td>$value</td>\";\r\n\t\t\t}\r\n\t\t\techo \"</tr>\";\r\n\t\t}\r\n\t\techo \"</table>\";\r\n\t}",
"function get_list($table, $template, $filter_data=null) {\n \n $tags = $this->get_tags();\n \n $list ='';\n if ($items = $this->build_list($table, $filter_data)) {\n\n if ($this->by_category) {\n foreach ($items AS $k => $v) {\n $list .= '<h2>'.$k.'</h2>';\n //asort($v);\n foreach ($v AS $id => $value) {\n $list .= str_replace($tags, $value, $template);\n }\n }\n } else {\n //asort($items);\n foreach ($items AS $id => $value) {\n $list .= str_replace($tags, $value, $template);\n }\n }\n return $list;\n } else {\n return false;\n }\n }",
"function queryToTable($array, $options=array()) {\n\tif (!is_array($array)) return '';\n \n $defaults = array(\n\t\t'class' => 'basictable',\n\t);\n\t\n\t$options = UTIL::merge($defaults, $options);\n\t$class = '';\n\t\n\t$class = ' class=\"'.$options['class'].'\"';\n\t\n\t$result = '<table'.$class.'>'.\"\\n\";\n\t$result .= '<tr class=\"titles\">';\n\t$titles = array_keys($array[0]);\n\tforeach ($titles as $item) {\n\t\t$result .= '<td>'.$item.'</td>';\n\t}\n\t$result .= '</tr>'.\"\\n\";\n\t\n\tforeach ($array as $row) {\n\t\tif (is_array($row)) {\n $result .= '<tr>';\n foreach ($row as $key => $item) {\n $result .= '<td>'.$item.'</td>';\n }\n\t\t\t$result .= '</tr>'.\"\\n\";\n }\n\t}\n\t$result .= '</table>'.\"\\n\";\n\t\n\treturn $result;\n}",
"private function create_table($tablename) {\n $table = new html_table();\n $table->attributes = array('class' => 'table table-responsive table-striped table-hover table-bordered');\n $th = new html_table_cell($tablename);\n $th->header = true;\n $th->colspan = 3;\n $th->attributes = array('class' => 'block-files-th');\n $table->head = array($th);\n return $table;\n }",
"function createBooks(){\n global $conn;\n global $description_text;\n\n $book_titles = array();\n\n $book_titles[] = 'The Curious Incident';\n $book_titles[] = 'The Dog In The Night Time';\n $book_titles[] = 'To Kill A Mockingbird';\n $book_titles[] = 'The Unbearable Lightness Of Being';\n $book_titles[] = 'Alexander And The Terrible';\n $book_titles[] = 'Horrible, No Good';\n $book_titles[] = 'A Confederacy Of Dunces';\n $book_titles[] = 'For Whom The Bell Tolls';\n $book_titles[] = 'Brave New World';\n $book_titles[] = 'The Lion, the Witch and the Wardrobe';\n $book_titles[] = 'She: A History of Adventure';\n $book_titles[] = 'Think and Grow Rich';\n $book_titles[] = 'Harry Potter and the Half-Blood Prince';\n $book_titles[] = 'The Adventures of Sherlock Holmes';\n $book_titles[] = 'Harry Potter and the Goblet of Fire';\n $book_titles[] = 'Harry Potter and the Deathly Hallows';\n $book_titles[] = 'Anne of Green Gables';\n $book_titles[] = 'The Eagle Has Landed';\n $book_titles[] = 'Watership Down';\n $book_titles[] = 'The Hobbit';\n $book_titles[] = 'The Odyssey';\n $book_titles[] = 'The Late, Great Planet Earth';\n $book_titles[] = 'Valley of the Dolls';\n $book_titles[] = 'Who Moved My Cheese?';\n $book_titles[] = 'The Wind in the Willows';\n $book_titles[] = 'The Hunger Games';\n $book_titles[] = 'The Godfather';\n $book_titles[] = 'Jaws';\n $book_titles[] = 'What to Expect';\n $book_titles[] = 'The Adventures of Huckleberry Finn';\n $book_titles[] = 'Pride and Prejudice';\n\n $years = array();\n $years[] = '1990';\n $years[] = '1993';\n $years[] = '1994';\n $years[] = '1995';\n $years[] = '1996';\n $years[] = '1997';\n $years[] = '1998';\n $years[] = '2000';\n $years[] = '2004';\n $years[] = '2005';\n $years[] = '2010';\n\n for ($i=1; $i < 30; $i++) { \n $isbn = mt_rand(10000,99999)+mt_rand(10000,99999);\n $Title = $book_titles[$i]; \n $published_year = $years[array_rand($years)];\n $genre_id = mt_rand(1,19); \n $cover_iamge = \"book(\". $i .\").png\";\n $num_copies = mt_rand(0,10);\n $page_count = mt_rand(200,900);\n $added_date = date(\"Y-m-d\",time() - mt_rand(10000,500000));\n \n\n $query_insert_tbl_book = \"INSERT INTO `book` (`isbn`, `book_title`, `book_description`,`published_year`, `genre_id`, `num_of_reads`, `cover_image`, `num_of_copies`, `page_count`, `added_date`) VALUES ('$isbn', '$Title', '$description_text', '$published_year', '$genre_id', '0', '$cover_iamge', '$num_copies', '$page_count', '$added_date')\";\n\n $result_insert_tbl_book = mysqli_query($conn,$query_insert_tbl_book);\n\n if(!$result_insert_tbl_book){\n echo \"error in creating books\";\n }\n }\n\n}"
] | [
"0.6246083",
"0.6013955",
"0.5727023",
"0.5571754",
"0.5471502",
"0.5465967",
"0.5449016",
"0.53881943",
"0.53827715",
"0.53196293",
"0.5283383",
"0.5144002",
"0.5134622",
"0.51214284",
"0.51148856",
"0.50587636",
"0.503274",
"0.5005389",
"0.5000027",
"0.49852902",
"0.49601874",
"0.49328086",
"0.49094534",
"0.49047893",
"0.4885028",
"0.4870548",
"0.48261204",
"0.4815287",
"0.48135635",
"0.48091546"
] | 0.6895422 | 0 |
Deletes one or more rows/books in in the books table. | function deleteBooks($books)
{
if (count($books) > 0) {
$query = "DELETE FROM books WHERE bookid IN ($books[0]";
for ($i = 1; $i < count($books); $i++) {
$query .= ",$books[$i]";
}
$query .= ")";
$result = $this->conn->query($query);
if (mysqli_affected_rows($this->conn) > 0) {
return "Book(s) have been succesfully deleted.";
} else {
return "Ooops. We had problems handling your delete request. Please try again later or contact us through our support page.";
}
} else {
return "No books are selected.";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function deleteBook(): void\n {\n $bookManager = new BookManager();\n $booksId = $bookManager->selectAllBookId();\n\n if (in_array($_GET['id'], array_column($booksId, 'id'))) {\n $bookManager = new BookManager();\n $bookManager->delete($_GET['id']);\n header('Location: /');\n } else {\n echo \"error\";\n }\n }",
"function deleteBook($book_id){\n $sql = \"DELETE FROM shelves WHERE BookId=%d;\";\n $sql = sprintf($sql,$book_id);\n $this->db_handle->run($sql);\n }",
"public function delete_books_by_id($id)\n\t{\n\t\t$this->db->where('id', $id);\n\t\t$this->db->delete('library_books');\n\t}",
"public function deleteBooks()\n {\n for ($i = 1; $i <= 20; $i++) {\n $cli = new Client(['base_uri' => $this->apiUrl]);\n $return = $cli->request('DELETE', 'books/' . $i);\n }\n\n return response()->json($return->getBody()->getContents())->getData();\n }",
"function book_remove($id_book = 0)\n{\n\t$query = 'DELETE FROM booking_list_attachment WHERE id_book ='.$id_book;\n\tmysql_query($query);\n\t$query = 'DELETE FROM booking_list_equipment WHERE id_book ='.$id_book;\n\tmysql_query($query);\n\t$query = 'DELETE FROM booking_list_period WHERE id_book ='.$id_book;\n\tmysql_query($query);\n\t$query = 'DELETE FROM booking_list WHERE id_book ='.$id_book;\n\tmysql_query($query);\n\treturn mysql_affected_rows();\n\t\n}",
"public function testDoDelete_MultiTable()\n {\n $hp = BookQuery::create()->filterByTitle(\"Harry Potter and the Order of the Phoenix\")->findOne();\n\n // print \"Attempting to delete [multi-table] by found pk: \";\n $c = new Criteria();\n $c->add(BookTableMap::ID, $hp->getId());\n // The only way for multi-delete to work currently\n // is to specify the author_id and publisher_id (i.e. the fkeys\n // have to be in the criteria).\n $c->add(AuthorTableMap::ID, $hp->getAuthorId());\n $c->add(PublisherTableMap::ID, $hp->getPublisherId());\n $c->setSingleRecord(true);\n BookTableMap::doDelete($c);\n\n // check to make sure the right # of records was removed\n $this->assertCount(3, AuthorQuery::create()->find(), \"Expected 3 authors after deleting.\");\n $this->assertCount(3, PublisherQuery::create()->find(), \"Expected 3 publishers after deleting.\");\n $this->assertCount(3, BookQuery::create()->find(), \"Expected 3 books after deleting.\");\n }",
"public function delete(BookInterface $book);",
"public function deleteBook(int $id)\n {\n /* Global $pdo object */\n global $pdo;\n\n /* Query template */\n $query = 'DELETE FROM books WHERE (book_id = :id)';\n\n $values = [':id' => $id];\n\n try {\n $res = $pdo->prepare($query);\n $res->execute($values);\n } catch (PDOException $e) {\n throw new Exception('Database query error');\n }\n }",
"function delete_Book_delete($id) {\n \n $result = $this->wm->delete_Book($id);\n \n if ($result === FALSE) {\n $this->response(array('status' => 'failed'));\n } else {\n $this->response(array('status' => 'success'));\n }\n }",
"public function delete() {\n \n $query = DB::connection()->prepare('DELETE FROM BandGenre WHERE genre_id = :id');\n \n $query->execute(array('id' => $this->id));\n\n $query = DB::connection()->prepare('DELETE FROM Genre WHERE id = :id');\n\n $query->execute(array('id' => $this->id));\n }",
"public function delete()\n {\n $UserConnected = $_SESSION['UserConnected'];\n\n if ($UserConnected != null) {\n\n\n $this->model->deleteBook($_GET['id']);\n header(\"Location: /resabike/book\");\n\n } else\n header(\"Location: /resabike/index\");\n }",
"public function practice11() {\n\n # First get a book to delete\n $book = Book::find(5);\n\n if(!$book) {\n dump('Did not delete- Book not found.');\n }\n else {\n $book->delete();\n dump('Deletion complete; check the database to see if it worked...');\n }\n }",
"public function delete_all_book_by_author(){\n # First get a book to delete\n $books = Book::where('author', 'LIKE', '%Rowling%')->get();\n\n # If we found the book, delete it\n if($books) {\n foreach($books as $book) {\n # Goodbye!\n $book->delete();\n }\n return \"Deletion complete; check the database to see if it worked...\";\n }\n else {\n return \"Can't delete - Book not found.\";\n }\n }",
"function deleteBook($db, $bookDeleteId){\n\t\tif ($bookDeleteId < 0) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (!($stmtDelete = $db->prepare(\"DELETE FROM books WHERE book_id=\".$bookDeleteId))) {\n\t\t\techo \"Prepare delete books failed: (\" . $db->errno . \") \" . $db->error;\n\t\t\treturn false;\n\t\t}\n\n if (!$stmtDelete->execute()) {\n\t\t\techo \"Execute delete books failed: (\" . $stmtDelete->errno . \") \" . $stmtDelete->error;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (!($stmtDeleteRelation = $db->prepare(\"DELETE FROM books_authors WHERE book_id=\".$bookDeleteId))) {\n\t\t\techo \"Prepare delete books_authors failed: (\" . $db->errno . \") \" . $db->error;\n\t\t\treturn false;\n\t\t}\n\n if (!$stmtDeleteRelation->execute()) {\n\t\t\techo \"Execute delete books_authors failed: (\" . $stmtDeleteRelation->errno . \") \" . $stmtDeleteRelation->error;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public function destroy(Books $book)\n {\n StockMaster::where('book_id',$book->id)->delete();\n StockTrxBorrow::where('book_id',$book->id)->delete();\n StockTrxReturn::where('book_id',$book->id)->delete();\n Storage::delete($book->cover);\n $book->delete();\n \n return redirect()->route('admin.books.index')\n ->with('danger','data buku berhasil dihapus');\n }",
"public function deleteBook($id)\r\n\t{\r\n\t\t$idx = $this->getBookIndexById($id);\r\n\t\tif ($idx > -1)\r\n\t\t{\r\n\t\t\tarray_splice($_SESSION['BookList'],$idx, 1);\r\n\t\t}\r\n\t}",
"public function testDoDelete_ByPks()\n {\n $books = BookQuery::create()->find();\n $bookCount = count($books);\n\n // 2) we have enough books to do this test\n $this->assertGreaterThan(1, $bookCount, 'There are at least two books');\n\n // 3) select two random books\n $book1 = $books[0];\n $book2 = $books[1];\n\n // 4) delete the books\n BookTableMap::doDelete(array($book1->getId(), $book2->getId()));\n\n // 5) we should have two less books than before\n $this->assertEquals($bookCount-2, BookQuery::create()->count(), 'Two books deleted successfully.');\n }",
"public function delete()\n {\n $this->db->delete(\"recyclebin\", $this->db->quoteInto(\"id = ?\", $this->model->getId()));\n }",
"public function delete(&$pks)\n\t{\n\t\tforeach ($pks as $i => $id)\n\t\t{\n\t\t\t$db = $this->getDatabase();\n\n\t\t\t$query = $db->getQuery(true);\n\n\t\t\t$query->delete($db->quoteName('#__u3a_booking'))\n\t\t\t\t->where($db->quoteName('id') . \" = $id\");\n\n\t\t\t$db->setQuery($query);\n\n\t\t\t$result = $db->execute();\n\t\t}\n\t}",
"public function deleteFromDatabase();",
"public function delete($id) {\r\n // Clean out foreign key tables rows\r\n (new BookAuthorGateway($this->db))->delete($id, null);\r\n (new BookIllustratorGateway($this->db))->delete($id, null);\r\n\r\n $statement = \"\r\n DELETE FROM book\r\n WHERE id = ?;\r\n \";\r\n\r\n try {\r\n $statement = $this->db->prepare($statement);\r\n $statement->execute(array($id));\r\n return $id;\r\n }\r\n catch(\\PDOException $e) {\r\n exit($e->getMessage());\r\n }\r\n }",
"public function removeAll() {\n $sql = 'SET FOREIGN_KEY_CHECKS = 0; TRUNCATE TABLE student';\n \n $connection_manager = new connection_manager();\n $conn = $connection_manager->connect();\n \n $stmt = $conn->prepare($sql);\n \n $stmt->execute();\n $count = $stmt->rowCount();\n }",
"function deleteRelationBookAuthorCollection($db, $bookId) {\n\n\t\tif ($bookId < 0) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (!($stmtDeleteRelation = $db->prepare(\"DELETE FROM books_authors WHERE book_id=\".$bookId))) {\n\t\t\t//echo \"Prepare delete books_authors failed: (\" . $db->errno . \") \" . $db->error;\n\t\t\treturn false;\n\t\t}\n\n if (!$stmtDeleteRelation->execute()) {\n\t\t\t//echo \"Execute delete books_authors failed: (\" . $stmtDeleteRelation->errno . \") \" . $stmtDeleteRelation->error;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public function actionDelete($id)\n {\n $book = $this->findModel($id);\n\n // deletes relations\n $authorBooks = $book->authorBooks;\n foreach ($authorBooks as $authorBook) {\n $authorBook->delete();\n }\n $book->delete();\n\n return $this->redirect(['index']);\n }",
"public function destroy($id)\n {\n $book = Books::where('id',$id)->first();\n $book->delete();\n Storage::disk('pdf_upload')->delete($book->content);\n Storage::disk('image_upload')->delete($book->image);\n $books = Chaps::where('book_id',$id)->get();\n if($books){\n foreach ($books as $book) {\n $book->delete();\n }\n }\n $books = Subs::where('book_id',$id)->get();\n if($books){\n foreach ($books as $book) {\n $book->delete();\n }\n }\n $books = Comments::where('book_id',$id)->get();\n if($books){\n foreach ($books as $book) {\n $book->delete();\n }\n }\n\n return redirect()->route('books.index')->with('status','Đã xóa thành công!');\n }",
"public function test_can_delete_a_book()\n {\n $book = Book::factory()->create();\n\n $response = $this->deleteJson(\"/books/{$book->id}\");\n\n $response->assertStatus(204);\n $this->assertDeleted($book);\n $this->assertModelMissing($book);\n }",
"protected function delete()\n\t{\n\t\t$this->table->delete();\n\t}",
"function Delete()\n\t{\tif ($this->CanDelete())\n\t\t{\t$sql = \"DELETE FROM bookings WHERE bookid=\" . $this->id;\n\t\t\tif ($result = $this->db->Query($sql))\n\t\t\t{\tif ($this->db->AffectedRows())\n\t\t\t\t{\t$linkmask = \"<a href='member.php?id={$this->user->id}' target='_blank'>\" . $this->InputSafeString($this->user->details[\"firstname\"] . \" \" . $this->user->details[\"surname\"]) . \"</a>\";\n\t\t\t\t\t$this->RecordAdminAction(array(\"tablename\"=>\"bookings\", \"tableid\"=>$this->id, \"area\"=>\"bookings\", \"action\"=>\"deleted\", \"actiontype\"=>\"deleted\", \"deleteparentid\"=>$this->details[\"course\"], \"deleteparenttable\"=>\"courses\", \"linkmask\"=>$linkmask));\n\t\t\t\t\t// delete payments if any\n\t\t\t\t\tforeach ($this->payments as $pmtrow)\n\t\t\t\t\t{\t$pmt = new AdminBookingPmt($pmtrow);\n\t\t\t\t\t\t$pmt->Delete();\n\t\t\t\t\t}\n\t\t\t\t\t// attendance if any\n\t\t\t\t\tforeach ($this->attendance as $attdate)\n\t\t\t\t\t{\t$this->RecordAttendance($attdate, 0);\n\t\t\t\t\t}\n\t\t\t\t\t// free scholarship if any\n\t\t\t\t\t$sql = \"UPDATE scholarships SET bookid=0 WHERE bookid={$this->id}\";\n\t\t\t\t\t$this->db->Query($sql);\n\t\t\t\t\t$this->Reset();\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function delete() {\n\t\t// Construct delete query\n $delete_query = \"DELETE FROM \" . static::$tableName . \" \"\n . $this->genPrimaryKeyWhereClause();\n\t\t// Execute delete query\n self::$database->query($delete_query);\n\t}",
"public function deleteAll() {\n $sql = \"DELETE FROM \" . $this->table;\n $stmt = $this->conn->prepare($sql);\n try {\n $stmt->execute();\n // history operation\n // $this->newHistory($this->id, 3);\n return true;\n } catch (PDOException $e) {\n // If the execution fails, throw an error\n echo $e->getMessage();\n return false;\n }\n }"
] | [
"0.6969669",
"0.6913647",
"0.6866678",
"0.65419096",
"0.64423376",
"0.6260555",
"0.6254628",
"0.62501377",
"0.62008405",
"0.6179587",
"0.61686486",
"0.6158319",
"0.6154407",
"0.61458343",
"0.6145348",
"0.6071116",
"0.6064471",
"0.60534126",
"0.6043751",
"0.60417587",
"0.60296476",
"0.5998565",
"0.59914756",
"0.5952585",
"0.5950831",
"0.59416074",
"0.5936741",
"0.59216654",
"0.5916435",
"0.5891333"
] | 0.71192396 | 0 |
Create a formatted table containing all authors in the database. | function displayAllAuthors()
{
$query = "SELECT a.authorid, a.name,
COUNT(b.authorid) AS bookcount
FROM authors AS a
LEFT JOIN books AS b
ON a.authorid = b.authorid
GROUP BY a.authorid";
$result = $this->conn->query($query);
return $this->buildAuthorsTable($result);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function getTableName()\n {\n return 'ibc_author';\n }",
"private function buildAuthorsTable($result)\n {\n if ($result->num_rows > 0) {\n $output = \"<table class='booksTable' width='690px' style='text-align:center'>\";\n $output .= \"<col style='width:10%'>\n <col style='width:10%'>\n <col style='width:55%'>\n <col style='width:25%'>\";\n $output .= \"<thead><tr><th>Select</th><th>S.N</th><th>Author name</th>\n <th>Library books</th></tr></thead>\";\n $output .= \"<tbody>\";\n while ($row = $result->fetch_object()) {\n $output .= \"<tr><td><input type='checkbox' name='authorscbs[]' value='$row->authorid'></td>\n <td>$row->authorid</td><td>$row->name</td><td>$row->bookcount</td></tr>\";\n }\n $output .= \"</tbody></table>\";\n return $output;\n } else {\n $output = \"No results for authors\";\n return $output;\n }\n }",
"public function makeTableAccounts(){\r\n $this->table = \"\";\r\n $str = \"\";\r\n $this->drop_table($this->table);\r\n $this->create_table($this->table, $str);\r\n // ~/~/~/\r\n //$this->makeUser('Owner', 'password', 1);\r\n //$this->makeUser('Admin', 'password', 2);\r\n //$this->makeUser('Test', 'password');\r\n }",
"public function run()\n {\n DB::table('authors')->insert([\n 'author_name' => 'Nguyen Van A,',\n ]);\n\n DB::table('authors')->insert([\n 'author_name' => 'Tran Van B,',\n ]);\n\n DB::table('authors')->insert([\n 'author_name' => 'Pham Thi C,',\n ]);\n\n DB::table('authors')->insert([\n 'author_name' => 'Bui Van D,',\n ]);\n\n DB::table('authors')->insert([\n 'author_name' => 'Le Thi E,',\n ]);\n\n DB::table('authors')->insert([\n 'author_name' => 'Hoang Van H,',\n ]);\n }",
"public function run()\n {\n DB::table('authors')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'first_name' => 'Joe',\n 'last_name' => 'Smith',\n 'birth_year' => 1975,\n //'bio_url' => 'https://en.wikipedia.org/wiki/F._Scott_Fitzgerald',\n ]);\n\n DB::table('authors')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'first_name' => 'Joe',\n 'last_name' => 'Smith',\n 'birth_year' => 1993,\n //'bio_url' => 'https://en.wikipedia.org/wiki/Sylvia_Plath',\n ]);\n\n DB::table('authors')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'first_name' => 'John',\n 'last_name' => 'Pedroza',\n 'birth_year' => 1969,\n //'bio_url' => 'https://en.wikipedia.org/wiki/Maya_Angelou',\n ]);\n\t\t\n\t\t DB::table('authors')->insert([\n 'created_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => Carbon\\Carbon::now()->toDateTimeString(),\n 'first_name' => 'Jan',\n 'last_name' => 'Connor',\n 'birth_year' => 1960,\n //'bio_url' => 'https://en.wikipedia.org/wiki/Maya_Angelou',\n ]);\n\n }",
"public function getAuthors(){\n // Get authors from database\n $authors = $this->model->getAuthors();\n \n // Render the view template where is the add-form and authors table included\n include_once('View.php');\n }",
"public static function createTables() {\n self::createUsersTable(); \n self::createBlacklistedTokensTable();\n self::createPostTable();\n self::createCategoriesTable();\n self::createKeywordsTable();\n self::createPostKeywordsTable(); \n }",
"function wxr_authors_list() {\n\t\t\tglobal $wpdb;\n\n\t\t\t$authors = array();\n\t\t\t$results = $wpdb->get_results( \"SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_status != 'auto-draft'\" );\n\t\t\tforeach ( (array) $results as $result )\n\t\t\t\t$authors[] = get_userdata( $result->post_author );\n\n\t\t\t$authors = array_filter( $authors );\n\n\t\t\tforeach ( $authors as $author ) {\n\t\t\t\techo \"\\t<wp:author>\";\n\t\t\t\techo '<wp:author_id>' . $author->ID . '</wp:author_id>';\n\t\t\t\techo '<wp:author_login>' . $author->user_login . '</wp:author_login>';\n\t\t\t\techo '<wp:author_email>' . $author->user_email . '</wp:author_email>';\n\t\t\t\techo '<wp:author_display_name>' . wxr_cdata( $author->display_name ) . '</wp:author_display_name>';\n\t\t\t\techo '<wp:author_first_name>' . wxr_cdata( $author->user_firstname ) . '</wp:author_first_name>';\n\t\t\t\techo '<wp:author_last_name>' . wxr_cdata( $author->user_lastname ) . '</wp:author_last_name>';\n\t\t\t\techo \"</wp:author>\\n\";\n\t\t\t}\n\t\t}",
"public function createTables(): void\n {\n $this->archiveTableIfExists(Table::PRODUCTS);\n $this->createTable(Table::PRODUCTS, [\n 'id' => $this->integer()->notNull(),\n 'shopifyId' => $this->string(),\n 'dateCreated' => $this->dateTime()->notNull(),\n 'dateUpdated' => $this->dateTime()->notNull(),\n 'uid' => $this->uid(),\n 'PRIMARY KEY([[id]])',\n ]);\n\n $this->archiveTableIfExists(Table::PRODUCTDATA);\n $this->createTable(Table::PRODUCTDATA, [\n 'shopifyId' => $this->string(),\n 'title' => $this->text(),\n 'bodyHtml' => $this->text(),\n 'createdAt' => $this->dateTime(),\n 'handle' => $this->string(),\n 'images' => $this->text(),\n 'options' => $this->text(),\n 'productType' => $this->string(),\n 'publishedAt' => $this->dateTime(),\n 'publishedScope' => $this->string(),\n 'shopifyStatus' => $this->string(),\n 'tags' => $this->text(),\n 'templateSuffix' => $this->string(),\n 'updatedAt' => $this->string(),\n 'variants' => $this->text(),\n 'vendor' => $this->string(),\n 'metaFields' => $this->text(),\n 'dateCreated' => $this->dateTime()->notNull(),\n 'dateUpdated' => $this->dateTime()->notNull(),\n 'uid' => $this->string(),\n 'PRIMARY KEY([[shopifyId]])',\n ]);\n }",
"public function index(AuthorDataTable $dataTable){\n\n return $dataTable->render('admin.authors.index');\n }",
"protected function createTable() {\n\t\t$columns = array(\n\t\t\t\t'id'\t=>\t'pk',\n\t\t\t\t'title'\t=>\t'string',\n\t\t\t\t'description'\t=>\t'text',\n\t\t);\n\t\t$this->getDbConnection()->createCommand(\n\t\t\t\t$this->getDbConnection()->getSchema()->createTable($this->tableName(), $columns)\n\t\t)->execute();\n\t}",
"public function run()\n {\n Author::create([\n 'first_name' => 'حسن',\n 'last_name' => \"تقی\"\n ]);\n\n Author::create([\n 'first_name' => 'امیر',\n 'last_name' => \"محمدی\"\n ]);\n }",
"public function run()\n {\n DB::table('authors')->insert([\n [\n 'first_name' => 'Waylon',\n 'last_name' => 'Dalton',\n 'middle_name' => 'Cruz'\n ],\n [\n 'first_name' => 'Marcus ',\n 'last_name' => 'Cruz',\n 'middle_name' => 'Randolph'\n ],\n [\n 'first_name' => 'Eddie',\n 'last_name' => 'Randolph',\n 'middle_name' => 'Hartman'\n ],\n [\n 'first_name' => 'Justine',\n 'last_name' => 'Henderson',\n 'middle_name' => 'Cobb'\n ],\n [\n 'first_name' => 'Thalia',\n 'last_name' => 'Cobb',\n 'middle_name' => 'Walker'\n ],\n ]);\n }",
"private function createTable() : void {\n\t\tglobal $wpdb;\n\t\t\n\t\t// Required for dbdelta\n\t\trequire_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n\t\t\n\t\t$table_name = $wpdb->prefix . self::TABLE_NAME;\n\t\t$charset_collate = $wpdb->get_charset_collate();\n\t\t\n\t\t$sql = \"CREATE TABLE $table_name (\n\t\t\tid int(11) NOT NULL AUTO_INCREMENT,\n\t\t\tlastchanged bigint NOT NULL,\n\t\t\ttitle varchar(255) NOT NULL,\n\t\t\tstartdate datetime NOT NULL,\n\t\t\tenddate datetime NOT NULL,\n\t\t\tcontact varchar(255),\n\t\t\tlink varchar(255),\n\t\t\tPRIMARY KEY (id),\n\t\t\tKEY title_index (title),\n\t\t\tKEY startdate_index (startdate),\n\t\t\tKEY enddate_index (enddate)\n\t\t) $charset_collate;\";\n\t\t\n\t\tdbDelta($sql);\n\t\t\n\t\tadd_option('jal_db_version', '1.0');\n\t}",
"function CreateTables()\n\t\t{\n\t\t\t$this->conn->exec(\"CREATE TABLE IF NOT EXISTS contact_book (\n id INTEGER PRIMARY KEY, \n names TEXT, \n email TEXT, \n time INTEGER)\");\n\t\t}",
"public static function createTables()\n {\n self::createContactsTable();\n self::createAddressesTable();\n self::createPhoneNumbersTable();\n }",
"public static function create_table() {\n\t\tglobal $wpdb;\n\n\t\t$tables = $wpdb->get_results( 'SHOW TABLES LIKE \"' . $wpdb->prefix . 'termmeta\"' );\n\n\t\tif ( ! empty( $tables ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$charset_collate = '';\n\t\tif ( ! empty( $wpdb->charset ) ) {\n\t\t\t$charset_collate = 'DEFAULT CHARACTER SET ' . $wpdb->charset;\n\t\t}\n\n\t\tif ( ! empty( $wpdb->collate ) ) {\n\t\t\t$charset_collate .= ' COLLATE ' . $wpdb->collate;\n\t\t}\n\n\t\t$wpdb->query( 'CREATE TABLE ' . $wpdb->prefix . 'termmeta (\n\t\t\tmeta_id bigint(20) unsigned NOT NULL auto_increment,\n\t\t\tterm_id bigint(20) unsigned NOT NULL default \"0\",\n\t\t\tmeta_key varchar(255) default NULL,\n\t\t\tmeta_value longtext,\n\t\t\tPRIMARY KEY\t(meta_id),\n\t\t\tKEY term_id (term_id),\n\t\t\tKEY meta_key (meta_key)\n\t\t) ' . $charset_collate . ';' );\n\t}",
"function makeEditableAuthorList($authors) {\t\t\n\t\treturn \"\n\t\t\t<div id='authorlist' class='authorlist'>\n\t\t\t\t\".$this->makeAuthorList($authors).\"\t\t\t\n\t\t\t</div>\n\t\t\";\n\t}",
"public function create_table() {\n\t\tglobal $wpdb;\n\t\t\n\t\tif ( ! empty( $wpdb->charset ) )\n\t\t\t$db_charset_collate = \"DEFAULT CHARACTER SET $wpdb->charset\";\n\t\tif ( ! empty( $wpdb->collate ) )\n\t\t\t$db_charset_collate .= \" COLLATE $wpdb->collate\";\n\t\t\n\t\tif ( $this->table ) {\n\t\t\t$sql = \"CREATE TABLE $this->table (\n\t\t\tid bigint(20) unsigned NOT NULL auto_increment,\n\t\t\tuser_id bigint(35) NOT NULL default '0',\n\t\t\tfbid varchar(35) NULL,\n\t\t\taccess_token text NULL,\n\t\t\tcrawl bool DEFAULT 0,\n\t\t\tPRIMARY KEY (id)\n\t\t\t) ENGINE=MyISAM $db_charset_collate;\";\n\t\t\tdbDelta( $sql );\n\t\t}\n\t}",
"public function run()\n {\n foreach ($this->authors as $author) {\n DB::table('authors')->insert([\n 'name' => $author\n ]);\n }\n }",
"public function create_library_table() {\n if($this->check_table_exists(\"books\")) {\n echo \"\\e[1;33m Table \\\"books\\\" already exists.\\e[0m\";\n return;\n }\n\n $statement = \"CREATE TABLE books(\n id SERIAL PRIMARY KEY,\n name VARCHAR(128) NOT NULL,\n author VARCHAR(128) NOT NULL,\n created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,\n updated_at TIMESTAMP NULL,\n UNIQUE(name, author)\n )\";\n\n pg_query($this->connection, $statement);\n $latest_error = pg_last_error($this->connection);\n if(!empty($latest_error) || $latest_error === false) {\n throw new \\Exception(\"An error occurred when creating the \\\"books\\\" table\");\n }\n echo \"\\e[0;32m Table \\\"books\\\" created.\\e[0m\";\n }",
"public function tables();",
"public function create()\n {\n return view('admin.authors.create');\n }",
"public function create()\n {\n return view('admin.authors.create');\n }",
"public function run()\n {\n DB::table('authors')->delete();\n $authors = [\n [\n 'id' => '2',\n 'name' => 'Jon Erickson',\n ],\n [\n 'id' => '3',\n 'name' => 'Stuart McClure',\n ],\n [\n 'id' => '4',\n 'name' => 'Joel Scambray',\n ],\n [\n 'id' => '5',\n 'name' => 'George Kurtz',\n ],\n [\n 'id' => '6',\n 'name' => 'Haruki Murakami',\n ],\n [\n 'id' => '7',\n 'name' => 'Yuval Noah Harari',\n ],\n [\n 'id' => '8',\n 'name' => 'Oleg Surajev',\n ],\n [\n 'id' => '9',\n 'name' => 'Andrius Tapinas',\n ],\n [\n 'id' => '10',\n 'name' => 'George Orwell',\n ],\n [\n 'id' => '11',\n 'name' => 'Jordan B. Peterson',\n ],\n [\n 'id' => '12',\n 'name' => 'Anthony Burgess',\n ],\n [\n 'id' => '13',\n 'name' => 'Erich Fromm',\n ],\n [\n 'id' => '14',\n 'name' => 'Dovydas Pancerovas',\n ],\n [\n 'id' => '15',\n 'name' => 'Birutė Davidonytė',\n ],\n [\n 'id' => '16',\n 'name' => 'Mark Manson',\n ]\n ];\n foreach ($authors as $author) {\n Author::create($author);\n }\n }",
"function makeAuthorList($authors) {\n\t\t$authorsJoined = implode(\"\",$authors);\n\t\tif ($authorsJoined == \"\") {\n\t\t\treturn \"\n\t\t\t\t\t<input type='hidden' name='authors' id='authors' value='' />\n\t\t\t\t\t<em style=\\\"color:red\\\">Noen må ta ansvar… Du må legge til minst én ansvarlig person.</em>\n\t\t\t\";\t\t\n\t\t}\n\t\t$alist = \"\n\t\t\t\t<input type='hidden' name='authors' id='authors' value=\\\"\".implode(\",\",$authors).\"\\\" />\n\t\t\t\t<ul class='memberlist_s'>\\n\";\n\t\t$udata = $this->getUserData($authors, array('FirstName','ProfilePicture'));\n\t\tforeach ($udata as $user_id => $u) {\t\t\t\n\t\t\t$alist .= '\n\t\t\t\t<li>\n\t\t\t\t\t<table><tr><td>\n\t\t\t\t\t<img src=\"'.$u['ProfilePicture']['SmallThumb'].'\" style=\"width:30px;\" />\n\t\t\t\t\t</td><td>\n\t\t\t\t\t<div style=\"padding:2px;\">'.$u['FirstName'].'</div>\n\t\t\t\t\t<div style=\"padding:2px;\"><a href=\"#\" style=\"background:url(/images/famfamfam_mini/action_stop.gif) no-repeat left;padding:2px 2px 2px 18px;\" onclick=\"removeAuthor('.$user_id.'); return false;\">Fjern</a>\n\t\t\t\t\t</div>\n\t\t\t\t\t</td></tr></table>\n\t\t\t\t</li> ';\n\t\t}\n\t\t$alist .= '\n\t\t\t\t</ul>\n\t\t\t\t';\n\t\treturn $alist;\n\t}",
"public function createTable()\n {\n $table = self::$table_name;\n $table_identifier = FRAMEWORK_TABLE_PREFIX.'collection_comments_identifier';\n $table_contact = FRAMEWORK_TABLE_PREFIX.'contact_contact';\n\n $SQL = <<<EOD\n CREATE TABLE IF NOT EXISTS `$table` (\n `id` INT(11) NOT NULL AUTO_INCREMENT,\n `ral` VARCHAR(16) NOT NULL DEFAULT '',\n `rgb` VARCHAR(16) NOT NULL DEFAULT '',\n `hex` VARCHAR(16) NOT NULL DEFAULT '',\n `de` VARCHAR(64) NOT NULL DEFAULT '',\n `en` VARCHAR(64) NOT NULL DEFAULT '',\n `fr` VARCHAR(64) NOT NULL DEFAULT '',\n `es` VARCHAR(64) NOT NULL DEFAULT '',\n `it` VARCHAR(64) NOT NULL DEFAULT '',\n `nl` VARCHAR(64) NOT NULL DEFAULT '',\n PRIMARY KEY (`id`)\n )\n COMMENT='RAL color table'\n ENGINE=InnoDB\n AUTO_INCREMENT=1\n DEFAULT CHARSET=utf8\n COLLATE='utf8_general_ci'\nEOD;\n try {\n $this->app['db']->query($SQL);\n $this->app['monolog']->addInfo(\"Created table '\".self::$table_name.\"'\", array(__METHOD__, __LINE__));\n } catch (\\Doctrine\\DBAL\\DBALException $e) {\n throw new \\Exception($e);\n }\n }",
"protected function _createTables() {\n // to be used lower down the inheritance chain to create the table(s)\n }",
"public function create()\n {\n\treturn view('library.edit.authors.create');\n }",
"function createTableBillysCompanies()\n {\n $primary = DBIntegerColumn::create('company_id')->setLenght(11)->setUnsigned(true);\n $newTable = DB::createTable(TABLE_PREFIX . 'billys_companies')->addColumns(array(\n $primary,\n DBStringColumn::create('organizationId', 22)\n ));\n $index = new DBIndex('company_id', DBIndex::PRIMARY, $primary);\n\n $newTable->addIndex($index);\n $newTable->save();\n\n\n }"
] | [
"0.61679447",
"0.60599387",
"0.5935931",
"0.5908312",
"0.59064525",
"0.5891571",
"0.5871995",
"0.5859386",
"0.5764735",
"0.57307947",
"0.5720972",
"0.5647517",
"0.56422395",
"0.5641743",
"0.5638196",
"0.5635564",
"0.5633274",
"0.56025577",
"0.560021",
"0.55948746",
"0.5584749",
"0.55771756",
"0.55565256",
"0.55565256",
"0.55536926",
"0.5514327",
"0.5514169",
"0.5507628",
"0.54997677",
"0.5499298"
] | 0.6650294 | 0 |
Create a formatted table with authors matching the provided filter. | function displayAuthors($filter)
{
// Prevent injections:
$filter = $this->conn->real_escape_string($filter);
// Build query:
$query = "SELECT a.authorid, a.name,
COUNT(b.authorid) AS bookcount
FROM authors AS a
LEFT JOIN books AS b
ON a.authorid = b.authorid
WHERE b.title LIKE '%$filter%'
OR b.ISBN = '%$filter%'
OR a.authorid = '$filter'
OR a.name LIKE '%$filter%'
GROUP BY b.authorid";
$result = $this->conn->query($query);
return $this->buildAuthorsTable($result);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function buildAuthorsTable($result)\n {\n if ($result->num_rows > 0) {\n $output = \"<table class='booksTable' width='690px' style='text-align:center'>\";\n $output .= \"<col style='width:10%'>\n <col style='width:10%'>\n <col style='width:55%'>\n <col style='width:25%'>\";\n $output .= \"<thead><tr><th>Select</th><th>S.N</th><th>Author name</th>\n <th>Library books</th></tr></thead>\";\n $output .= \"<tbody>\";\n while ($row = $result->fetch_object()) {\n $output .= \"<tr><td><input type='checkbox' name='authorscbs[]' value='$row->authorid'></td>\n <td>$row->authorid</td><td>$row->name</td><td>$row->bookcount</td></tr>\";\n }\n $output .= \"</tbody></table>\";\n return $output;\n } else {\n $output = \"No results for authors\";\n return $output;\n }\n }",
"function displayAllAuthors()\n {\n $query = \"SELECT a.authorid, a.name, \n COUNT(b.authorid) AS bookcount\n FROM authors AS a\n LEFT JOIN books AS b\n ON a.authorid = b.authorid\n GROUP BY a.authorid\";\n $result = $this->conn->query($query);\n\n return $this->buildAuthorsTable($result);\n }",
"function displayBooks($filter)\n {\n // Prevent injections:\n $filter = $this->conn->real_escape_string($filter);\n // Build query:\n $query = \"SELECT b.bookid, b.title, a.name, b.pub_year, b.available \n FROM books b, authors a \n WHERE (a.authorid = b.authorid)\n AND (b.bookid LIKE '%$filter%'\n OR b.title LIKE '%$filter%'\n OR b.ISBN LIKE '%$filter%'\n OR b.pub_year LIKE '%$filter%'\n OR b.available LIKE '%$filter%'\n OR a.name LIKE '%$filter%')\n ORDER BY b.bookid\";\n $result = $this->conn->query($query);\n\n return $this->buildBooksTable($result);\n }",
"function wxr_authors_list() {\n\t\t\tglobal $wpdb;\n\n\t\t\t$authors = array();\n\t\t\t$results = $wpdb->get_results( \"SELECT DISTINCT post_author FROM $wpdb->posts WHERE post_status != 'auto-draft'\" );\n\t\t\tforeach ( (array) $results as $result )\n\t\t\t\t$authors[] = get_userdata( $result->post_author );\n\n\t\t\t$authors = array_filter( $authors );\n\n\t\t\tforeach ( $authors as $author ) {\n\t\t\t\techo \"\\t<wp:author>\";\n\t\t\t\techo '<wp:author_id>' . $author->ID . '</wp:author_id>';\n\t\t\t\techo '<wp:author_login>' . $author->user_login . '</wp:author_login>';\n\t\t\t\techo '<wp:author_email>' . $author->user_email . '</wp:author_email>';\n\t\t\t\techo '<wp:author_display_name>' . wxr_cdata( $author->display_name ) . '</wp:author_display_name>';\n\t\t\t\techo '<wp:author_first_name>' . wxr_cdata( $author->user_firstname ) . '</wp:author_first_name>';\n\t\t\t\techo '<wp:author_last_name>' . wxr_cdata( $author->user_lastname ) . '</wp:author_last_name>';\n\t\t\t\techo \"</wp:author>\\n\";\n\t\t\t}\n\t\t}",
"public function groupByAuthors()\n {\n $this->filter = 'authors';\n\n return $this;\n }",
"public function index(AuthorDataTable $dataTable){\n\n return $dataTable->render('admin.authors.index');\n }",
"function makeEditableAuthorList($authors) {\t\t\n\t\treturn \"\n\t\t\t<div id='authorlist' class='authorlist'>\n\t\t\t\t\".$this->makeAuthorList($authors).\"\t\t\t\n\t\t\t</div>\n\t\t\";\n\t}",
"protected function formatAuthorForCitation()\n {\n return $this->formatNamesForCitation('authors');\n }",
"function makeAuthorList($authors) {\n\t\t$authorsJoined = implode(\"\",$authors);\n\t\tif ($authorsJoined == \"\") {\n\t\t\treturn \"\n\t\t\t\t\t<input type='hidden' name='authors' id='authors' value='' />\n\t\t\t\t\t<em style=\\\"color:red\\\">Noen må ta ansvar… Du må legge til minst én ansvarlig person.</em>\n\t\t\t\";\t\t\n\t\t}\n\t\t$alist = \"\n\t\t\t\t<input type='hidden' name='authors' id='authors' value=\\\"\".implode(\",\",$authors).\"\\\" />\n\t\t\t\t<ul class='memberlist_s'>\\n\";\n\t\t$udata = $this->getUserData($authors, array('FirstName','ProfilePicture'));\n\t\tforeach ($udata as $user_id => $u) {\t\t\t\n\t\t\t$alist .= '\n\t\t\t\t<li>\n\t\t\t\t\t<table><tr><td>\n\t\t\t\t\t<img src=\"'.$u['ProfilePicture']['SmallThumb'].'\" style=\"width:30px;\" />\n\t\t\t\t\t</td><td>\n\t\t\t\t\t<div style=\"padding:2px;\">'.$u['FirstName'].'</div>\n\t\t\t\t\t<div style=\"padding:2px;\"><a href=\"#\" style=\"background:url(/images/famfamfam_mini/action_stop.gif) no-repeat left;padding:2px 2px 2px 18px;\" onclick=\"removeAuthor('.$user_id.'); return false;\">Fjern</a>\n\t\t\t\t\t</div>\n\t\t\t\t\t</td></tr></table>\n\t\t\t\t</li> ';\n\t\t}\n\t\t$alist .= '\n\t\t\t\t</ul>\n\t\t\t\t';\n\t\treturn $alist;\n\t}",
"function authorsToHTML($authors){\n $explode = explode(' - ', $authors);\n return elementBuilder(\"\", \"span\", implode(\"</span> - <span>\", $explode));\n}",
"function generateTable($tableName, $titlesResultSet, $dataResultSet)\r\n{\r\n\r\n\techo \"<table border=1>\";\r\n\r\n\t//first - create the table caption and headings\r\n\techo \"<caption>\".strtoupper($tableName).\" TABLE - RESULT</caption>\";\r\n\techo '<tr>';\r\n\tforeach($titlesResultSet as $fieldName) {\r\n\t\techo '<th>'.$fieldName['Field'].'</th>';\r\n\t}\r\n\techo '</tr>';\r\n\r\n\t//then show the data\r\n\tforeach($dataResultSet as $row) {\r\n\t\techo '<tr>';\r\n\t\tforeach($titlesResultSet as $fieldName) {\r\n\t\t\techo '<td>'.$row[$fieldName['Field']].'</td>';}\r\n\t\techo '</tr>';\r\n\t\t}\r\n\techo \"</table>\";\r\n}",
"public function transform($data, string $to, array $context = []): AuthorOutput\n {\n $this->validator->validate($data);\n\n $output = new AuthorOutput();\n $output->authorName = $data->getName();\n $output->authorWebsite = $data->getWebsite();\n $output->authorRessources = $data->getRessources();\n return $output;\n }",
"function scoopit_author_settings_list() {\n\n\t$author_role = variable_get('scoopit_author_role', '');\n\n\t$author_id = variable_get('scoopit_author_id', '');\n\n\n\t// display current scoppit users authors\n\t$result = entity_load('user');\n\t// create table\n\t$header = array('Id', 'Username', /*'Role',*/ 'Action');\n\t$rows = array();\n\t// Looping for filling the table rows\n\tforeach($result as $data){\n\t\t// Fill the table rows\n\n\t\tif(user_has_roles($author_role,$data)){\n\t\t\t$rows[] = array(\n\t\t\t\t$data->uid,\n\t\t\t\t$data->name,\n\t\t\t\t//$data->roleid,\n\t\t\t\t'<input type=\"radio\" name=\"scoopItUserSel\" value=\"'.$data->uid.'\" '.(($author_id==$data->uid)?' checked=\"checked\" ':' ').' onclick=\"saveScoopitAuthor(this);\" />',\n\t\t\t);\n\t\t}\n\n\t}\n\n\n\treturn theme_table(\n\t\tarray(\n\t\t\t\"header\" => $header,\n\t\t\t\"rows\" => $rows,\n\t\t\t\"attributes\" => array(),\n\t\t\t\"sticky\" => true, // Table header will be sticky\n\t\t\t\"caption\" => \"Author List\",\n\t\t\t\"colgroups\" => array(),\n\t\t\t\"empty\" => t(\"Author Table has no data!\") // The message to be displayed if table is empty\n\t\t)\n\t);\n}",
"public function authorsAction(Application $app)\n {\n $xml = $app['twig']->render('opds/authors.xml.twig', array(\n 'updated' => date('Y-m-d\\TH:i:sP'),\n 'authorsAggregated' => $app['collection.author']->countGroupedByFirstLetter(),\n ));\n\n return $this->checkXml($xml);\n }",
"public function index()\n {\n $name = '%'.Session::get('author_filter').'%';\n if(Session::has('author_filter')) //verifica si hay en sesión una busqueda de autores\n {\n $authors = Author::where('first_name','LIKE',$name)->orwhere('last_name','LIKE',$name)->paginate(10);\n }\n else\n {\n $authors = Author::paginate(10);\n }\n return view('panel.authors.index')->with('authors', $authors);\n }",
"public function authorsAction(\\Silex\\Application $app)\n {\n $xml = $app['twig']->render('opds/authors.xml', array(\n 'updated' => date('Y-m-d\\TH:i:sP'),\n 'authorsAggregated' => $app['model.author']->getAggregatedList(),\n ));\n\n return $this->_checkXml($xml);\n }",
"function show_authors()\r\n{\r\n\t$tpl =& get_tpl();\r\n\t$db = get_db();\r\n\t$user = $db->query(\r\n\t'SELECT user_id AS id, user_name AS name, user_email AS email, user_website AS website, '\r\n\t\t.'author_name AS author, author_id AS authorid '\r\n\t\t.'FROM user LEFT JOIN author ON user_id=user_id_fk WHERE user_id='.$_GET['id'].' AND user_valid=1 LIMIT 1');\r\n\tif(!$user)\r\n\t{\r\n\t\tprintf('Errormessage: %s', $db->error);\r\n\t}\r\n\tif($user->num_rows < 1)\r\n\t{\r\n\t\theader('Location: index.php');\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$tpl['userinfo'] = $user->fetch_assoc();\r\n\t}\r\n\t$user->close();\r\n\t//now we grab authorage\r\n\t$authors = $db->query('SELECT usertoauthor_comment AS comment, author_id AS id, author_name AS name, author_count AS books, author_date AS date '\r\n\t\t.'FROM author LEFT JOIN usertoauthor ON author_id_fk=author_id WHERE usertoauthor.user_id_fk='.$_GET['id'].' and author_valid=1 ORDER BY author_name ASC');\r\n\tif(!$authors )\r\n\t{\r\n\t\tprintf('Errormessage: %s', $db->error);\r\n\t}\r\n\t$tpl['authors'] =& $authors;\r\n\t//page assignments\r\n\t$tpl['title'] = $tpl['userinfo']['name'].'\\'s Profile';\r\n\t$tpl['nest'] = '';\r\n\t$tpl['keywords'] = 'user profile information contact links book favorites';\r\n\t$tpl['description'] = 'Profile information for a user, show user favorite authors';\r\n\t//assign sub \"template\"\r\n\t$files['page'] = 'userauthor.html';\r\n\t//create sidebar\r\n\tinclude('../lib/sidebar.php');\r\n\t//show the \"template\"\r\n\tshow_tpl($tpl, $files);\r\n\treturn;\r\n}",
"public function getAuthors(){\n // Get authors from database\n $authors = $this->model->getAuthors();\n \n // Render the view template where is the add-form and authors table included\n include_once('View.php');\n }",
"function printifTable($filter=\"\")\n\t\t{\n\t\tif ($filter==\"\")\n\t\t\t{\n\t\t\treturn ($this->lastTable);\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\t$result=array();\n\t\t\tif ( is_array($filter)==true )\n\t\t\t\t{\n\t\t\t\t//echo \"Ist ein Array.\\n\";\n\t\t\t\tforeach ($this->lastTable as $entry)\n\t\t\t\t\t{\n\t\t\t\t\t$str=\"\";\n\t\t\t\t\t$found=false;\n\t\t\t\t\tforeach ($entry as $key => $object)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tif (isset($filter[$this->collumns[$key]]) == true)\n\t\t\t\t\t\t\tif ($filter[$this->collumns[$key]] == $object) $found=true;\n\t\t\t\t\t\t$str.=$this->collumns[$key].\":\".$object.\" \";\n\t\t\t\t\t\t}\n\t\t\t\t\tif ($found) $result[]=$str.\"\\n\"; else $str=\"\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\t\n\t\t\t\tforeach ($this->lastTable as $entry)\n\t\t\t\t\t{\n\t\t\t\t\tforeach ($entry as $key => $object)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tif ($this->collumns[$key]==$filter) $result[]=$object;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\t\n\t\t\treturn ($result);\t\n\t\t\t}\t\n\t\t}",
"public function author();",
"public function author();",
"function authors( $author )\r\n{ ?>\r\n\t<title>Author : @<?php echo( $author ); ?> - <?php showOption( 'name' ); ?></title><?php\r\n\t$posts = $GLOBALS['JBLDB'] -> select( 'posts', '*', array( 'state' => 'published', 'ilk' => 'article', 'author' => $author ), array( 'created', 'DESC') );\r\n\tif ( !isset( $post['error'] ) ) {\r\n\t\trequire_once( _ABSTHEMES_ . getOption( 'activetheme' ) .'/templates/archive.php' );\r\n\t} else {\r\n\t\trequire_once( _ABSTHEMES_ . getOption( 'activetheme' ) .'/templates/404.php' );\r\n\t}\r\n}",
"function formatReferenceBibTex_Authors($authorsStr){\n\t\t$authors = explode(\", \", $authorsStr);\n\t\tforeach ($authors as $idx => $author){\t\t\n\t\t\t$names = explode(\" \", $author);\n\t\t\tfor ($fNameIdx = 0; $fNameIdx <count($names); $fNameIdx++){\n\t\t\t\tif (strcmp(strtoupper($names[$fNameIdx ]), $names[$fNameIdx]) == 0){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$lastName = join(\" \", array_slice($names, 0, $fNameIdx ));\n\t\t\t$tmpFirstName = $names[$fNameIdx ];\n\t\t\t$firstName = \"\";\n\t\t\tfor ($i = 0; $i < strlen($tmpFirstName); $i++){\n\t\t\t\t$firstName = $firstName.$tmpFirstName[$i].\". \";\n\t\t\t}\n\t\t\t$firstName = trim($firstName);\n\n\t\t\t$suffix = join(\" \", array_slice($names, $fNameIdx + 1, count($names) - $fNameIdx - 1));\n\t\t\t$authors[$idx] = \"$lastName\".($firstName ? \", $firstName\".($suffix ? \" $suffix\" : \"\") : \"\");\t\t\t\t\t\t\t\t\n\t\t}\t\t\n\t\treturn join(\" and \", $authors);\n\t}",
"public function getAuthors();",
"public function getAuthors();",
"public function indexAction()\n {\n $authors = $this->getDoctrine()->getRepository('AcmeDemoBundle:Author')->findAll();\n \n $source = new GridEntity('AcmeDemoBundle:Book');\n $grid = $this->get('grid');\n $grid\n ->setSource($source)\n ->setDefaultOrder('id', 'asc')\n ->getColumn('authors.name')->manipulateRenderCell(\n function($value, $row, $router) {\n $authors = [];\n foreach ($row->getEntity()->getAuthors() as $author) {\n $authors[] = $author->getName();\n }\n \n return implode(', ', $authors);\n }\n )->setValues(array_combine($authors, $authors));\n\n return $grid->getGridResponse();\n }",
"public function author_label_filter() {\n\t\t\treturn apply_filters( \"{$this->prefix}_{$this->class_prefix}_author_label\", $this->args->label );\n\t\t}",
"public static function authorTemplate($template){\n\t$author = get_queried_object();\n\n\t$templates = array();\n\n\t$templates[] = \"author-{$author->user_nicename}.php\";\n\t$templates[] = \"author-{$author->ID}.php\";\n\t$templates[] = 'author.php';\n return self::locateTemplate($templates);\n }",
"static function add_authors(): void {\n self::add_acf_field(self::authors, [\n 'label' => 'Author(s)',\n 'type' => 'user',\n 'instructions' => '',\n 'required' => 0,\n 'conditional_logic' => 0,\n 'wrapper' => [\n 'width' => '50',\n 'class' => '',\n 'id' => '',\n ],\n 'role' => [\n\t 0 => 'author',\n ],\n 'multiple' => 1,\n 'allow_null' => 0,\n ]);\n }",
"function formatAuthor( $first , $middle , $last , $order = 1 )\n{\n\t$first = trim ( $first ) ;\t\t// Check for additional whitespace\n\t$middle = trim ( $middle ) ;\n\t$last = trim ( $last ) ;\n\n\tif ( strlen ( $first ) == 1 )\t\t// Check for initial only\n\t{\n\t\t$first .= \".\" ;\t\t\t// Add punctuation\n\t}\n\tif ( strlen ( $middle ) == 1 )\t\t// Check for initial only\n\t{\n\t\t$middle .= \".\" ;\t\t// Add punctuation\n\t}\n\tif ( strlen ( $middle ) == 0 )\t\t// Check for no middle name\n\t{\n\t\t$name = $first . \" \" . $last;\n\t}\n\telse\n\t{\n\t\t$name = $first . \" \" . $middle . \" \" . $last ;\n\t}\n\treturn $name ;\n}"
] | [
"0.61666495",
"0.59574693",
"0.5816608",
"0.5615869",
"0.55892366",
"0.5477525",
"0.5467883",
"0.5441012",
"0.5428234",
"0.53915155",
"0.5373174",
"0.5290791",
"0.52752435",
"0.52668744",
"0.52565295",
"0.52433795",
"0.5226098",
"0.5186777",
"0.5130263",
"0.5087628",
"0.5087628",
"0.5087219",
"0.5083446",
"0.5024229",
"0.5024229",
"0.5022617",
"0.4981826",
"0.49588498",
"0.49542946",
"0.4928714"
] | 0.72736007 | 0 |
Deletes one or more rows/authors in in the authors table. | function deleteAuthors($authors)
{
if (count($authors) > 0) {
$query = "DELETE FROM authors WHERE authorid IN ($authors[0]";
for ($i = 1; $i < count($authors); $i++) {
$query .= ",$authors[$i]";
}
$query .= ")";
$result = $this->conn->query($query);
if (mysqli_affected_rows($this->conn) > 0) {
return "Authors(s) have been succesfully deleted.";
} else {
return "Ooops. We had problems handling your delete request. Please try again later or contact us through our support page.";
}
} else {
return "No authors are selected.";
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function delete_author($authorid){\n\n $this->db->where('author_id', $authorid);\n $this->db->delete('authors');\n //$this->db->close();\n\n }",
"function delete_authors ( &$authorIDList , $err_message = \"\" ) // Caution it may delete referenced authors from other papers.\n{\n\t$db = adodb_connect( &$err_message );\n\t\n $numauthors = count ( $authorIDList ) ;\n\t\n\tfor ( $i = 0 ; $i < $numauthors ; $i++ )\n\t{\n\t\t// Delete a file from File table\n\t\t$delautid = \"DELETE FROM \" . $GLOBALS[\"DB_PREFIX\"] . \"Author\" ;\n\t\t$delautid .= \" WHERE AuthorID = $authorIDList[$i] \" ;\n\t\t$result = $db -> Execute($delautid) ;\n\t\t\n\t\tif( !$result )\n\t\t{\t\t\n\t\t\t$err_message .= \" Could not Delete Authors from failed Author Deletion <br>\\n \";\t// Exception has occurred\t\t\t\n\t\t\treturn false ;\n\t\t}\n\t}\t\t\n\n\treturn true ;\n}",
"public function deleteAuthors()\n {\n for ($i = 237; $i <= 280; $i++) {\n $cli = new Client(['base_uri' => $this->apiUrl]);\n $return = $cli->request('DELETE', 'authors/' . $i);\n }\n\n return response()->json($return->getBody()->getContents())->getData();\n }",
"function deleteAuthors($db, $authorId){\n\t\t\n\t\tif($authorId < 0){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (!($stmtDelete = $db->prepare(\"DELETE FROM authors \n\t\t\t\t\t\t\t\t\t\t WHERE author_id=\".$authorId))) {\n\t\t\techo \"Prepare delete authors failed: (\" . $db->errno . \") \" . $db->error;\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!$stmtDelete->execute()) {\n\t\t\techo \"Execute delete authors failed: (\" . $stmtDelete->errno . \") \" . $stmtDelete->error;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t }",
"public function deleteAction()\n {\n $id = $this->params('id');\n $ids = array_filter(explode(',', $id));\n if (empty($ids)) {\n return $this->jumpTo404(_a('Invalid author id!'));\n }\n\n $modelAuthor = $this->getModel('author');\n // Clear article author\n $this->getModel('article')->update(\n ['author' => 0],\n ['author' => $ids]\n );\n\n // Delete photo\n $resultset = $modelAuthor->select(['id' => $ids]);\n foreach ($resultset as $row) {\n if ($row->photo) {\n unlink(Pi::path($row->photo));\n }\n }\n\n // Delete author\n $modelAuthor->delete(['id' => $ids]);\n\n // Clear cache\n $module = $this->getModule();\n Pi::service('registry')\n ->handler('author', $module)\n ->clear($module);\n\n // Go to list page\n return $this->redirect()->toRoute('', ['action' => 'list']);\n }",
"function delete_unreferenced_authors ( $err_message = \"\" )\n{\n\t$db = adodb_connect( &$err_message );\n\t\n\t$sql_written = \"SELECT AuthorID FROM \" . $GLOBALS[\"DB_PREFIX\"] . \"Written \" ;\n \n\t$result = $db -> Execute( $sql_written );\n \n\tif(!$result)\n\t{\n\t\t$err_message .= \" Could not Query AuthorID from Written table in Deletion of unreferenced Authors function <br>\\n \" ;\n\t\treturn false ;\n\t}\n\telse\n\t{\t\t\n\t\t$authorIDList = array();\n\t\t$sql_authorIDList = \"\" ;\t\n\t\t\t\t\t\n\t\t// mysql_result($result,0); // Optimize to this later\n\t\twhile ( $row = $result -> FetchNextObj() )\n\t\t{\n\t\t\t$authorIDList[] = $row -> AuthorID ;\n\t\t}\t\t\n\t\t\n\t\t$element = each( $authorIDList ) ;\n\t\t$sql_authorIDList .= $element[\"value\"] ;\n\t\t\n\t\tforeach ( $authorIDList as $key => $value )\n\t\t{\n\t\t\t$sql_authorIDList .= \" , \" . $value ;\t\n\t\t}\n\t\n\t\t$sql_written = \"SELECT AuthorID FROM \" . $GLOBALS[\"DB_PREFIX\"] . \"Author \" ;\n\t\t$sql_written .= \" WHERE AuthorID NOT IN ( $sql_authorIDList ) \" ;\n\t\n\t\t$result = $db -> Execute( $sql_written ) ;\n\t\n\t\tif(!$result)\n\t\t{\n\t\t\t$err_message .= \" Could not Query AuthorID from Author table in Deletion of unreferenced Authors function <br>\\n \" ;\n\t\t\treturn false ;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$deleteAuthorIDList = array() ;\n\t\t\t\t\n\t\t\twhile ( $row = $result-> FetchNextObj() )\n\t\t\t{\n\t\t\t\t$deleteAuthorIDList[] = $row -> AuthorID ;\n\t\t\t}\n\t\t\t\n\t\t\tif ( delete_authors( $deleteAuthorIDList , &$err_message ) )\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$err_message .= \" Could not Delete Unreferenced Authors in Deletion of unreferenced Authors function <br>\\n \" ;\n\t\t\t\treturn false ;\n\t\t\t}\n\t\t}\n\t}\n}",
"public function delete_all_book_by_author(){\n # First get a book to delete\n $books = Book::where('author', 'LIKE', '%Rowling%')->get();\n\n # If we found the book, delete it\n if($books) {\n foreach($books as $book) {\n # Goodbye!\n $book->delete();\n }\n return \"Deletion complete; check the database to see if it worked...\";\n }\n else {\n return \"Can't delete - Book not found.\";\n }\n }",
"public function deleteAuthor($author)\n {\n return $this->performRequest('DELETE', \"/authors/{$author}\");\n }",
"public function destroy(Author $author)\n {\n //\n }",
"public function testDeleteAuthor()\n {\n $author = factory(Author::class)->create();\n\n $response = $this->withHeaders($this->apiHeaders)->delete(\"$this->endpoint/$author->id\");\n\n $response->assertStatus(204);\n }",
"public function delete($id)\n {\n $validator = Validator::make(['id' => $id], [\n 'id' => 'required|integer|exists:authors,id',\n ]);\n\n if ($validator->fails()) {\n return $this->validationError($validator);\n }\n\n $author = Author::find($id);\n $author->delete();\n\n return $this->deleteSuccess();\n }",
"public function destroy($id)\n {\n DB::table('authors')->where('id', $id)->delete();\n return redirect()->back();\n }",
"public function destroy($id)\n {\n $exist = Post_author::where('author_id', $id)->get();\n if (!count($exist))\n {\n $author = Author::find($id);\n if ($author->delete())\n {\n Session::flash('success','El autor ha sido eliminado exitosamente');\n return redirect('/blog/panel/authors');\n }\n }\n else\n {\n Session::flash('warning2', 'El autor tiene al menos 1 post, por lo que no puede ser eliminado');\n return redirect('/blog/panel/authors');\n }\n }",
"public function delete()\n { if (is_null($this->id))\n trigger_error(\"Contributor::delete(): Attempt to delete a Contributor object that does not have its ID property set.\", E_USER_ERROR);\n\n // Delete the Reaction\n $conn = new PDO(DB_DSN, DB_USER, DB_PASS);\n $st = $conn->prepare(\"DELETE FROM contributor WHERE id = :id LIMIT 1\");\n $st->bindValue(\":id\", $this->id, PDO::PARAM_INT);\n $st->execute();\n $conn = null;\n }",
"function deleteRelationBookAuthorCollection($db, $bookId) {\n\n\t\tif ($bookId < 0) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (!($stmtDeleteRelation = $db->prepare(\"DELETE FROM books_authors WHERE book_id=\".$bookId))) {\n\t\t\t//echo \"Prepare delete books_authors failed: (\" . $db->errno . \") \" . $db->error;\n\t\t\treturn false;\n\t\t}\n\n if (!$stmtDeleteRelation->execute()) {\n\t\t\t//echo \"Execute delete books_authors failed: (\" . $stmtDeleteRelation->errno . \") \" . $stmtDeleteRelation->error;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public function unlink($id, $author_id)\n {\n $post = Post::find($id);\n foreach ($post->post_authors as $p_au)\n {\n if ($p_au->author_id == $author_id)\n {\n $p_au->delete();\n }\n }\n Session::flash('success','El autor ha sido desvinculado exitosamente del Post');\n return redirect('/blog/panel/author/'.$author_id.'/edit');\n }",
"public function destroy(Author $author)\n {\n $author->find($author->id)->all();\n\n $author->delete();\n\n if ($author) {\n return redirect()->route('author.index')->with(['success' => 'Data Berhasil Di Delete!']);\n }\n else {\n return redirect()->route('author.index')->with(['erorr' => 'Data Gagal Di Delete!']);\n }\n }",
"public function test_can_delete_author()\n {\n GLOBAL $createdAuthorID;\n\n $response = $this->delete(\"$this->url/$createdAuthorID\");\n\n $response->assertStatus(200);\n }",
"public function destroy(Author $author)\n {\n try\n {\n $author->delete();\n } catch (\\Exception $e)\n {\n }\n\n return redirect('/authors');\n }",
"public function destroy($id)\n {\n $authors = Author::find($id);\n $authors->delete();\n\n return redirect(route('author.index'))->with('toast_success', 'Author Deleted Successfully!');\n }",
"public function disassociateAuthorWithBook($author_id, $isbn)\n {\n $authors = $this->db->prepare(<<<SQL\nDELETE FROM book_authors\nWHERE book_authors.author_id = :author_id\nAND book_authors.isbn = :isbn;\nSQL\n );\n $authors->execute(array(\n ':author_id' => $author_id,\n ':isbn' => $isbn));\n }",
"public function destroy($id)\n {\n $id=intval($id);\n if ($id==0) return redirect('/library/edit/');\n $author = Author::findOrFail($id);\n\tif (sizeof($author->books)==0) {\n\t $author->categories()->detach();\n\t\t$author->delete();\n\t\t}\n return redirect('/library/edit/author');\n }",
"public function delete() {\n\n // Does the Article object have an ID?\n if ( is_null( $this->id ) ) trigger_error ( \"Article::delete(): Attempt to delete an Article object that does not have its ID property set.\", E_USER_ERROR );\n\n // Delete the Article\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\n $stmt = $conn->prepare ( \"DELETE FROM articles WHERE id = :id LIMIT 1\" );\n $stmt->bindValue( \":id\", $this->id, PDO::PARAM_INT );\n $stmt->execute();\n $conn = null;\n }",
"public function deleting(ordenes $ordenes)\n {\n //code...\n }",
"public function deleteAuthor(Request $request)\n {\n $author = new Author();\n try {\n $author->deleteAuthor($request->input('deleteSubject'));\n $afterDelete = ['result' => true];\n } catch (Exception $e) {\n $afterDelete = ['result' => false];\n }\n return json_encode($afterDelete);\n }",
"public function destroySelected()\n {\n $authorities = Input::get('ids');\n if (!empty($authorities) > 0) {\n foreach ($authorities as $authority_id) {\n $authority = Authority::find($authority_id);\n\n SpiceHarvesterRecord::where('identifier', '=', $authority_id)->delete();\n\n $authority->delete();\n }\n }\n return Redirect::back()->withMessage('Bolo zmazaných ' . count($authorities) . ' autorít');\n }",
"public function destroyMany(Request $request)\n {\n\n // Soft Delete Method\n try {\n $id = $request->id;\n\n\n $allAuthors = [];\n $allAuthors = Story::whereIn(\"story_id\", $id)->select(\"user_id\")->get()->toArray();\n $allAuthors = array_column($allAuthors, \"user_id\");\n\n\n if (Story::whereIn(\"story_id\", $id)->delete()) {\n\n\n foreach ($allAuthors as $i) {\n Story::updateStoryCount($i);\n }\n\n\n Comment::whereIn(\"story_id\", $id)->delete();\n StoryStar::whereIn(\"story_id\", $id)->delete();\n\n $request->session()->flash('alert-success', $this->pluralName . ' has been deleted successfully!');\n } else {\n $request->session()->flash('alert-danger', 'There is some issue.Please try again!');\n }\n\n } catch (\\Exception $e) {\n $request->session()->flash('alert-danger', $e->getMessage());\n\n }\n\n $request->session()->flash('alert-success', $this->pluralName . ' has been deleted successfully!');\n return redirect()->back();\n\n\n }",
"public function actionDelete($id)\n {\n $book = $this->findModel($id);\n\n // deletes relations\n $authorBooks = $book->authorBooks;\n foreach ($authorBooks as $authorBook) {\n $authorBook->delete();\n }\n $book->delete();\n\n return $this->redirect(['index']);\n }",
"public function destroy($id)\n {\n //\n $author = Author::find($id);\n $author->delete();\n return redirect()->back();\n }",
"public function delete($id) {\n\t\t$author = Author::find($id); \n\n\t\treturn View::make('authors.delete',array(\n\t\t\t'author' => $author\n\t\t))->with(\"title\",\"Author Delete View from controller.delete\");\t\n\t}"
] | [
"0.723791",
"0.7176405",
"0.7043192",
"0.67092454",
"0.66832334",
"0.66665465",
"0.6520501",
"0.6220593",
"0.61986744",
"0.6167987",
"0.6102664",
"0.6098786",
"0.60650223",
"0.5977122",
"0.59501255",
"0.5921133",
"0.58793414",
"0.5864894",
"0.58397734",
"0.5812518",
"0.5774651",
"0.57645285",
"0.5761818",
"0.57332623",
"0.57270694",
"0.5709633",
"0.56907356",
"0.567223",
"0.56652015",
"0.56373006"
] | 0.76240087 | 0 |
Returns number of books the author matching the authorid has in the books table. | function getAuthorBookCount($authorid)
{
$query = "SELECT COUNT(*) AS bookcount
FROM books
WHERE authorid = $authorid";
$result = $this->conn->query($query);
return $result->fetch_object()->bookcount;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function countByAuthor($author_id) {\n\n $sql = $this->getDb()->prepare('SELECT COUNT(*) FROM t_quote WHERE a_id = ?');\n $sql->execute(array($author_id));\n\n return $sql->fetchColumn();\n }",
"function findBooksByAuthor($db, $authorId){\n\t\tif($authorId < 0){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (!($stmtSelectBooksForAuthor = $db->prepare(' SELECT count(book_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t FROM books_authors\n\t\t\t\t\t\t\t\t\t\t\t\t\t WHERE author_id = '.$authorId ))) {\n\t\t\techo ' Prepare select failed: (' . $db->errno . ' ) ' . $db->error;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (!$stmtSelectBooksForAuthor->execute()) {\n\t\t\techo ' Execute select failed: (' . $stmtSelectBooksForAuthor->errno . ' ) ' . $stmtSelectBooksForAuthor->error;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t/* store result */\n\t\t$stmtSelectBooksForAuthor->store_result();\n\t\t\n\t\t/* bind result variables */\n\t\t$stmtSelectBooksForAuthor->bind_result($books);\n\t\t\n\t\tif($stmtSelectBooksForAuthor->num_rows > 0) {\n\t\t\twhile ($row = $stmtSelectBooksForAuthor->fetch()) {\n\t\t\t\t$result = $books;\n\t\t\t\treturn $books;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$stmtSelectBooksForAuthor->close();\n\n return 0; \n\t}",
"public function num_issu_books($application_id)\n\t{\n\t\t$this->db->where('member_id', $application_id);\n\t\t$query=$this->db->get('library_issue_book');\n\t\treturn $query->num_rows();\n\t}",
"public function getBooksCount();",
"public function countPages($author)\n {\n $db = $this->db();\n\n $authorQuery = ($author != \"none\") ? ' AND `username` = ?' : '';\n\n $params = array();\n if ($author != 'none') {\n $params[] = $author;\n }\n\n return $db->query(\n 'SELECT COUNT(`deck_id`) as `count` FROM `deck` WHERE `is_shared` = TRUE AND `is_ready` = TRUE' . $authorQuery . ''\n , $params\n );\n }",
"public static function getNbCopies($idbook) {\n $query = self::execute(\"SELECT nbCopies from book where id=:id\", array(\"id\" => $idbook));\n $data = $query->fetch();\n return (int) $data;\n }",
"public function countBooks(){\n\t\treturn $this->bookbeatjson->countBooks();\n\t}",
"public function getDistinctBooksCount();",
"function bookSaleCountID($bookID)\n\t\t{\n\t\t\t$sql = \"SELECT count(*) FROM bookCopy WHERE bookID=\" . $bookID . \";\";\n\n\t\t\t$result = $this->dbconn->query( $sql );\n\t\t\t$count = $result->fetch(PDO::FETCH_NUM);\n\t\t\t\n\t\t\treturn($count[0]);\n\t\t}",
"public static function getStatsTotalBooks()\n {\n $db = Database::getInstance();\n $statement = $db->prepare(\"SELECT COUNT(id) as result FROM books;\");\n $statement->execute();\n\n $result = $statement->fetchObject(stdClass::class);\n\n if (!empty($result))\n return $result->result;\n\n return 0;\n\n }",
"public function countAll()\n {\n $query = \"SELECT book_id FROM \" . $this->table_name . \"\";\n $stmt = $this->conn->prepare($query);\n $totalRows = $stmt->rowCount();\n return $totalRows;\n }",
"public function count_filtered(string $author_name):int;",
"function get_total_objects_chapter($param) {\n\t\t$total = mysql_query(\"SELECT COUNT( * ) FROM book_pages WHERE book_info_id = $param->book_info_id AND facebook_id = $param->facebook_id\");\n\t\t$total = mysql_fetch_array($total);\n\t\treturn $total[0];\n\t}",
"public function countBook(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n return $this->db->getRows(array(\"return_type\"=>\"count\"));\n\t\t\t\t\t }",
"function displayAuthors($filter)\n {\n // Prevent injections:\n $filter = $this->conn->real_escape_string($filter);\n // Build query:\n $query = \"SELECT a.authorid, a.name, \n COUNT(b.authorid) AS bookcount\n FROM authors AS a\n LEFT JOIN books AS b\n ON a.authorid = b.authorid\n WHERE b.title LIKE '%$filter%'\n OR b.ISBN = '%$filter%'\n OR a.authorid = '$filter'\n OR a.name LIKE '%$filter%'\n GROUP BY b.authorid\";\n\n $result = $this->conn->query($query);\n\n return $this->buildAuthorsTable($result);\n }",
"function bookRequestCountID($bookID)\n\t\t{\n\t\t\t$sql = \"SELECT count(*) FROM bookRequests WHERE bookID=\" . $bookID . \" AND filled=0;\";\n\n\t\t\t$result = $this->dbconn->query( $sql );\n\t\t\t$count = $result->fetch(PDO::FETCH_NUM);\n\t\t\t\n\t\t\treturn($count[0]);\n\t\t}",
"function displayAllAuthors()\n {\n $query = \"SELECT a.authorid, a.name, \n COUNT(b.authorid) AS bookcount\n FROM authors AS a\n LEFT JOIN books AS b\n ON a.authorid = b.authorid\n GROUP BY a.authorid\";\n $result = $this->conn->query($query);\n\n return $this->buildAuthorsTable($result);\n }",
"public function getNumAuthors()\n {\n // TODO: Implement getNumAuthors() method.\n return 0;\n }",
"function get_total_books($fbid) {\n\t\t$status = 0;\n\t\t$msg = '';\n\t\t$total_book = 0;\n\t\t$query = $this->db->get_where('book_info', array(\n\t\t\t'facebook_id' => $fbid\n\t\t));\n\t\t$total_book = $query->num_rows();\n\t\tif ($this->db->_error_message()) {\n\t\t\t$msg = $this->db->_error_message();\n\t\t\t$status = 1;\n\t\t}\n\t\t$ret = array(\n\t\t\t'status' => $status,\n\t\t\t'msg' => $msg,\n\t\t\t'data' => $total_book\n\t\t);\n\t\treturn $ret;\n\t}",
"public function countBooks($serieId)\n {\n return (int) $this->getQueryBuilder()\n ->select('COUNT(*)')\n ->from('series', 'main')\n ->innerJoin('main', 'books_series_link', 'bsl', 'bsl.series = main.id')\n ->innerJoin('main', 'books', 'books', 'bsl.book = books.id')\n ->where('main.id = :serie_id')\n ->setParameter('serie_id', $serieId, PDO::PARAM_INT)\n ->execute()\n ->fetchColumn();\n }",
"public function countBooks($serieId)\n {\n return $this->getQueryBuilder()\n ->select('COUNT(*)')\n ->from('series', 'main')\n ->innerJoin('main', 'books_series_link', 'bsl', 'bsl.series = main.id')\n ->innerJoin('main', 'books', 'books', 'bsl.book = books.id')\n ->where('main.id = :serie_id')\n ->setParameter('serie_id', $serieId, PDO::PARAM_INT)\n ->execute()\n ->fetchColumn();\n }",
"function get_total_objects($param) {\n\t\t$total = mysql_query(\"SELECT COUNT( * ) FROM book_pages WHERE book_info_id = $param->book_info_id\");\n\t\t$total = mysql_fetch_array($total);\n\t\treturn $total[0];\n\t}",
"public function countChapters(): int\n {\n $db = $this->dbConnect();\n $req = $db->query('SELECT COUNT(id) FROM chapters');\n $nbChapters = $req->fetchColumn();\n\n return $nbChapters;\n }",
"public function getCitationsByAuthorId($authorIdentifier);",
"function likeit_get_count_by_post_id($post_id) {\n\tglobal $wpdb, $likeit_table;\n\t\n\treturn intval($wpdb->get_var(\"SELECT COUNT(id) FROM $likeit_table WHERE post_id = $post_id\"));\n}",
"public function associateAuthorWithBook($author_id, $isbn)\n {\n $authors = $this->db->prepare(<<<SQL\nINSERT INTO book_authors\n(book_authors.author_id, book_authors.isbn)\nVALUES (:author_id, :isbn);\nSQL\n );\n $authors->execute(array(\n ':author_id' => $author_id,\n ':isbn' => $isbn));\n }",
"public function getAuthorDetails($author_id);",
"abstract public function getBooksForAuthor($authorName);",
"public function list($authorId)\n\t{\n\t\treturn Book::where('author_id', $authorId)->get();\n\t}",
"public function getNumberOfArticles()\n {\n $query = \"SELECT count(id) FROM article\";\n\n $stm = $this->connection->query($query);\n\n return $stm->fetch(\\PDO::FETCH_OBJ);\n }"
] | [
"0.73544204",
"0.7029742",
"0.65665317",
"0.65661705",
"0.6172253",
"0.6165377",
"0.61629516",
"0.61463183",
"0.6078756",
"0.6078026",
"0.6072853",
"0.6006874",
"0.58931875",
"0.5892579",
"0.5830807",
"0.57468605",
"0.5666839",
"0.5622638",
"0.5569444",
"0.5549382",
"0.5535997",
"0.5509075",
"0.54525495",
"0.5435827",
"0.5411092",
"0.5388508",
"0.53652525",
"0.53593284",
"0.5346585",
"0.53339934"
] | 0.8311484 | 0 |
Subsets and Splits